Ian Romanick | 2d95db6 | 2012-10-19 22:30:53 +0200 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
Andreas Boll | fa27a0d | 2012-10-19 22:54:56 +0200 | [diff] [blame] | 3 | # Script for generating a list of candidates for cherry-picking to a stable branch |
Andreas Boll | b8e41db | 2013-04-18 09:32:39 +0200 | [diff] [blame] | 4 | # |
| 5 | # Usage examples: |
| 6 | # |
| 7 | # $ bin/get-pick-list.sh |
| 8 | # $ bin/get-pick-list.sh > picklist |
| 9 | # $ bin/get-pick-list.sh | tee picklist |
Andreas Boll | fa27a0d | 2012-10-19 22:54:56 +0200 | [diff] [blame] | 10 | |
Emil Velikov | 61d9475 | 2017-02-13 00:37:03 +0000 | [diff] [blame] | 11 | # Use the last branchpoint as our limit for the search |
| 12 | latest_branchpoint=`git merge-base origin/master HEAD` |
| 13 | |
Andreas Boll | 135ec3a | 2012-10-19 23:13:12 +0200 | [diff] [blame] | 14 | # Grep for commits with "cherry picked from commit" in the commit message. |
Emil Velikov | 61d9475 | 2017-02-13 00:37:03 +0000 | [diff] [blame] | 15 | git log --reverse --grep="cherry picked from commit" $latest_branchpoint..HEAD |\ |
Andreas Boll | 135ec3a | 2012-10-19 23:13:12 +0200 | [diff] [blame] | 16 | grep "cherry picked from commit" |\ |
| 17 | sed -e 's/^[[:space:]]*(cherry picked from commit[[:space:]]*//' -e 's/)//' > already_picked |
| 18 | |
Andreas Boll | b299152 | 2012-10-19 23:00:17 +0200 | [diff] [blame] | 19 | # Grep for commits that were marked as a candidate for the stable tree. |
Emil Velikov | 13f1fb0 | 2017-02-13 01:37:55 +0000 | [diff] [blame] | 20 | git log --reverse --pretty=%H -i --grep='^CC:.*mesa-stable' $latest_branchpoint..origin/master |\ |
Ian Romanick | 2d95db6 | 2012-10-19 22:30:53 +0200 | [diff] [blame] | 21 | while read sha |
| 22 | do |
Andreas Boll | 3e3ff4c | 2012-10-20 21:50:30 +0200 | [diff] [blame] | 23 | # Check to see whether the patch is on the ignore list. |
Andreas Boll | ca89886 | 2012-10-22 21:18:17 +0200 | [diff] [blame] | 24 | if [ -f bin/.cherry-ignore ] ; then |
| 25 | if grep -q ^$sha bin/.cherry-ignore ; then |
Andreas Boll | 3e3ff4c | 2012-10-20 21:50:30 +0200 | [diff] [blame] | 26 | continue |
| 27 | fi |
Ian Romanick | 2d95db6 | 2012-10-19 22:30:53 +0200 | [diff] [blame] | 28 | fi |
| 29 | |
| 30 | # Check to see if it has already been picked over. |
Andreas Boll | 135ec3a | 2012-10-19 23:13:12 +0200 | [diff] [blame] | 31 | if grep -q ^$sha already_picked ; then |
| 32 | continue |
Ian Romanick | 2d95db6 | 2012-10-19 22:30:53 +0200 | [diff] [blame] | 33 | fi |
| 34 | |
| 35 | git log -n1 --pretty=oneline $sha | cat |
Ian Romanick | 2d95db6 | 2012-10-19 22:30:53 +0200 | [diff] [blame] | 36 | done |
Andreas Boll | 135ec3a | 2012-10-19 23:13:12 +0200 | [diff] [blame] | 37 | |
| 38 | rm -f already_picked |