3 # Script for generating a list of candidates which fix commits that have been
4 # previously cherry-picked to a stable branch.
8 # $ bin/get-extra-pick-list.sh
9 # $ bin/get-extra-pick-list.sh > picklist
10 # $ bin/get-extra-pick-list.sh | tee picklist
12 # Use the last branchpoint as our limit for the search
13 latest_branchpoint=`git merge-base origin/master HEAD`
15 # Grep for commits with "cherry picked from commit" in the commit message.
16 git log --reverse --grep="cherry picked from commit" $latest_branchpoint..HEAD |\
17 grep "cherry picked from commit" |\
18 sed -e 's/^[[:space:]]*(cherry picked from commit[[:space:]]*//' -e 's/)//' > already_picked
20 # For each cherry-picked commit...
21 cat already_picked | cut -c -8 |\
24 # ... check if it's referenced (fixed by another) patch
25 git log -n1 --pretty=oneline --grep=$sha $latest_branchpoint..origin/master |\
29 # And flag up if it hasn't landed in branch yet.
30 if grep -q ^$candidate already_picked ; then
33 echo Commit $candidate references $sha