get-pick-list.sh revision 848b8605
1848b8605Smrg#!/bin/sh
2848b8605Smrg
3848b8605Smrg# Script for generating a list of candidates for cherry-picking to a stable branch
4848b8605Smrg#
5848b8605Smrg# Usage examples:
6848b8605Smrg#
7848b8605Smrg# $ bin/get-pick-list.sh
8848b8605Smrg# $ bin/get-pick-list.sh > picklist
9848b8605Smrg# $ bin/get-pick-list.sh | tee picklist
10848b8605Smrg
11848b8605Smrg# Grep for commits with "cherry picked from commit" in the commit message.
12848b8605Smrggit log --reverse --grep="cherry picked from commit" origin/master..HEAD |\
13848b8605Smrg	grep "cherry picked from commit" |\
14848b8605Smrg	sed -e 's/^[[:space:]]*(cherry picked from commit[[:space:]]*//' -e 's/)//' > already_picked
15848b8605Smrg
16848b8605Smrg# Grep for commits that were marked as a candidate for the stable tree.
17848b8605Smrggit log --reverse --pretty=%H -i --grep='^\([[:space:]]*NOTE: .*[Cc]andidate\|CC:.*10\.3.*mesa-stable\)' HEAD..origin/master |\
18848b8605Smrgwhile read sha
19848b8605Smrgdo
20848b8605Smrg	# Check to see whether the patch is on the ignore list.
21848b8605Smrg	if [ -f bin/.cherry-ignore ] ; then
22848b8605Smrg		if grep -q ^$sha bin/.cherry-ignore ; then
23848b8605Smrg			continue
24848b8605Smrg		fi
25848b8605Smrg	fi
26848b8605Smrg
27848b8605Smrg	# Check to see if it has already been picked over.
28848b8605Smrg	if grep -q ^$sha already_picked ; then
29848b8605Smrg		continue
30848b8605Smrg	fi
31848b8605Smrg
32848b8605Smrg	git log -n1 --pretty=oneline $sha | cat
33848b8605Smrgdone
34848b8605Smrg
35848b8605Smrgrm -f already_picked
36