blob: a141afe265048a71ce454ffe424bff1667b443d2 [file] [log] [blame]
Ian Romanick2d95db62012-10-19 22:30:53 +02001#!/bin/sh
2
Andreas Bollfa27a0d2012-10-19 22:54:56 +02003# Script for generating a list of candidates for cherry-picking to a stable branch
4
Andreas Boll135ec3a2012-10-19 23:13:12 +02005# Grep for commits with "cherry picked from commit" in the commit message.
6git 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 Bollb2991522012-10-19 23:00:17 +020010# Grep for commits that were marked as a candidate for the stable tree.
11git log --reverse --pretty=%H -i --grep='^[[:space:]]*NOTE: This is a candidate' HEAD..origin/master |\
Ian Romanick2d95db62012-10-19 22:30:53 +020012while read sha
13do
Andreas Boll3e3ff4c2012-10-20 21:50:30 +020014 # Check to see whether the patch is on the ignore list.
Andreas Bollca898862012-10-22 21:18:17 +020015 if [ -f bin/.cherry-ignore ] ; then
16 if grep -q ^$sha bin/.cherry-ignore ; then
Andreas Boll3e3ff4c2012-10-20 21:50:30 +020017 continue
18 fi
Ian Romanick2d95db62012-10-19 22:30:53 +020019 fi
20
21 # Check to see if it has already been picked over.
Andreas Boll135ec3a2012-10-19 23:13:12 +020022 if grep -q ^$sha already_picked ; then
23 continue
Ian Romanick2d95db62012-10-19 22:30:53 +020024 fi
25
26 git log -n1 --pretty=oneline $sha | cat
Ian Romanick2d95db62012-10-19 22:30:53 +020027done
Andreas Boll135ec3a2012-10-19 23:13:12 +020028
29rm -f already_picked