2012-10-19 21:30:53 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
2012-10-19 21:54:56 +01:00
|
|
|
# Script for generating a list of candidates for cherry-picking to a stable branch
|
2013-04-18 08:32:39 +01:00
|
|
|
#
|
|
|
|
# Usage examples:
|
|
|
|
#
|
|
|
|
# $ bin/get-pick-list.sh
|
|
|
|
# $ bin/get-pick-list.sh > picklist
|
|
|
|
# $ bin/get-pick-list.sh | tee picklist
|
2012-10-19 21:54:56 +01:00
|
|
|
|
2017-02-13 00:37:03 +00:00
|
|
|
# Use the last branchpoint as our limit for the search
|
|
|
|
latest_branchpoint=`git merge-base origin/master HEAD`
|
|
|
|
|
2012-10-19 22:13:12 +01:00
|
|
|
# Grep for commits with "cherry picked from commit" in the commit message.
|
2017-02-13 00:37:03 +00:00
|
|
|
git log --reverse --grep="cherry picked from commit" $latest_branchpoint..HEAD |\
|
2012-10-19 22:13:12 +01:00
|
|
|
grep "cherry picked from commit" |\
|
|
|
|
sed -e 's/^[[:space:]]*(cherry picked from commit[[:space:]]*//' -e 's/)//' > already_picked
|
|
|
|
|
2012-10-19 22:00:17 +01:00
|
|
|
# Grep for commits that were marked as a candidate for the stable tree.
|
2017-02-13 01:37:55 +00:00
|
|
|
git log --reverse --pretty=%H -i --grep='^CC:.*mesa-stable' $latest_branchpoint..origin/master |\
|
2012-10-19 21:30:53 +01:00
|
|
|
while read sha
|
|
|
|
do
|
2012-10-20 20:50:30 +01:00
|
|
|
# Check to see whether the patch is on the ignore list.
|
2012-10-22 20:18:17 +01:00
|
|
|
if [ -f bin/.cherry-ignore ] ; then
|
|
|
|
if grep -q ^$sha bin/.cherry-ignore ; then
|
2012-10-20 20:50:30 +01:00
|
|
|
continue
|
|
|
|
fi
|
2012-10-19 21:30:53 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Check to see if it has already been picked over.
|
2012-10-19 22:13:12 +01:00
|
|
|
if grep -q ^$sha already_picked ; then
|
|
|
|
continue
|
2012-10-19 21:30:53 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
git log -n1 --pretty=oneline $sha | cat
|
|
|
|
done
|
2012-10-19 22:13:12 +01:00
|
|
|
|
|
|
|
rm -f already_picked
|