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 |
| 4 | |
Andreas Boll | 135ec3a | 2012-10-19 23:13:12 +0200 | [diff] [blame] | 5 | # Grep for commits with "cherry picked from commit" in the commit message. |
| 6 | git log --reverse --grep="cherry picked from commit" origin/master..HEAD |\ |
| 7 | grep "cherry picked from commit" |\ |
| 8 | sed -e 's/^[[:space:]]*(cherry picked from commit[[:space:]]*//' -e 's/)//' > already_picked |
| 9 | |
Andreas Boll | b299152 | 2012-10-19 23:00:17 +0200 | [diff] [blame] | 10 | # Grep for commits that were marked as a candidate for the stable tree. |
| 11 | git log --reverse --pretty=%H -i --grep='^[[:space:]]*NOTE: This is a candidate' HEAD..origin/master |\ |
Ian Romanick | 2d95db6 | 2012-10-19 22:30:53 +0200 | [diff] [blame] | 12 | while read sha |
| 13 | do |
Andreas Boll | 3e3ff4c | 2012-10-20 21:50:30 +0200 | [diff] [blame] | 14 | # Check to see whether the patch is on the ignore list. |
Andreas Boll | ca89886 | 2012-10-22 21:18:17 +0200 | [diff] [blame] | 15 | if [ -f bin/.cherry-ignore ] ; then |
| 16 | if grep -q ^$sha bin/.cherry-ignore ; then |
Andreas Boll | 3e3ff4c | 2012-10-20 21:50:30 +0200 | [diff] [blame] | 17 | continue |
| 18 | fi |
Ian Romanick | 2d95db6 | 2012-10-19 22:30:53 +0200 | [diff] [blame] | 19 | fi |
| 20 | |
| 21 | # Check to see if it has already been picked over. |
Andreas Boll | 135ec3a | 2012-10-19 23:13:12 +0200 | [diff] [blame] | 22 | if grep -q ^$sha already_picked ; then |
| 23 | continue |
Ian Romanick | 2d95db6 | 2012-10-19 22:30:53 +0200 | [diff] [blame] | 24 | fi |
| 25 | |
| 26 | git log -n1 --pretty=oneline $sha | cat |
Ian Romanick | 2d95db6 | 2012-10-19 22:30:53 +0200 | [diff] [blame] | 27 | done |
Andreas Boll | 135ec3a | 2012-10-19 23:13:12 +0200 | [diff] [blame] | 28 | |
| 29 | rm -f already_picked |