blob: 0902fd08077dec3d8d4a292159fa2b6ed3c58e09 [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
Andreas Bollb8e41db2013-04-18 09:32:39 +02004#
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 Bollfa27a0d2012-10-19 22:54:56 +020010
Andreas Boll135ec3a2012-10-19 23:13:12 +020011# Grep for commits with "cherry picked from commit" in the commit message.
12git log --reverse --grep="cherry picked from commit" origin/master..HEAD |\
13 grep "cherry picked from commit" |\
14 sed -e 's/^[[:space:]]*(cherry picked from commit[[:space:]]*//' -e 's/)//' > already_picked
15
Andreas Bollb2991522012-10-19 23:00:17 +020016# Grep for commits that were marked as a candidate for the stable tree.
Carl Worthc6f30362013-07-31 15:49:48 -070017git log --reverse --pretty=%H -i --grep='^\([[:space:]]*NOTE: .*[Cc]andidate\|CC:.*mesa-stable\)' HEAD..origin/master |\
Ian Romanick2d95db62012-10-19 22:30:53 +020018while read sha
19do
Andreas Boll3e3ff4c2012-10-20 21:50:30 +020020 # Check to see whether the patch is on the ignore list.
Andreas Bollca898862012-10-22 21:18:17 +020021 if [ -f bin/.cherry-ignore ] ; then
22 if grep -q ^$sha bin/.cherry-ignore ; then
Andreas Boll3e3ff4c2012-10-20 21:50:30 +020023 continue
24 fi
Ian Romanick2d95db62012-10-19 22:30:53 +020025 fi
26
27 # Check to see if it has already been picked over.
Andreas Boll135ec3a2012-10-19 23:13:12 +020028 if grep -q ^$sha already_picked ; then
29 continue
Ian Romanick2d95db62012-10-19 22:30:53 +020030 fi
31
32 git log -n1 --pretty=oneline $sha | cat
Ian Romanick2d95db62012-10-19 22:30:53 +020033done
Andreas Boll135ec3a2012-10-19 23:13:12 +020034
35rm -f already_picked