blob: 1bd0b367d8b6b27a6358f0ef85a78fba61d82783 [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
Emil Velikov61d94752017-02-13 00:37:03 +000011# Use the last branchpoint as our limit for the search
12latest_branchpoint=`git merge-base origin/master HEAD`
13
Andreas Boll135ec3a2012-10-19 23:13:12 +020014# Grep for commits with "cherry picked from commit" in the commit message.
Emil Velikov61d94752017-02-13 00:37:03 +000015git log --reverse --grep="cherry picked from commit" $latest_branchpoint..HEAD |\
Andreas Boll135ec3a2012-10-19 23:13:12 +020016 grep "cherry picked from commit" |\
17 sed -e 's/^[[:space:]]*(cherry picked from commit[[:space:]]*//' -e 's/)//' > already_picked
18
Andreas Bollb2991522012-10-19 23:00:17 +020019# Grep for commits that were marked as a candidate for the stable tree.
Emil Velikov13f1fb02017-02-13 01:37:55 +000020git log --reverse --pretty=%H -i --grep='^CC:.*mesa-stable' $latest_branchpoint..origin/master |\
Ian Romanick2d95db62012-10-19 22:30:53 +020021while read sha
22do
Andreas Boll3e3ff4c2012-10-20 21:50:30 +020023 # Check to see whether the patch is on the ignore list.
Andreas Bollca898862012-10-22 21:18:17 +020024 if [ -f bin/.cherry-ignore ] ; then
25 if grep -q ^$sha bin/.cherry-ignore ; then
Andreas Boll3e3ff4c2012-10-20 21:50:30 +020026 continue
27 fi
Ian Romanick2d95db62012-10-19 22:30:53 +020028 fi
29
30 # Check to see if it has already been picked over.
Andreas Boll135ec3a2012-10-19 23:13:12 +020031 if grep -q ^$sha already_picked ; then
32 continue
Ian Romanick2d95db62012-10-19 22:30:53 +020033 fi
34
35 git log -n1 --pretty=oneline $sha | cat
Ian Romanick2d95db62012-10-19 22:30:53 +020036done
Andreas Boll135ec3a2012-10-19 23:13:12 +020037
38rm -f already_picked