From 95c47f07a1d573c6e91c1d558f828fd8bc2a28fe Mon Sep 17 00:00:00 2001 From: Andreas Boll Date: Tue, 23 Oct 2012 19:32:33 +0200 Subject: [PATCH] mesa: add get-pick-list.sh script into bin/ This is a squash of: mesa: add get-pick-list.sh script into bin/ NOTE: This is a candidate for the stable branches. (cherry picked from commit 2d95db660e20787bcfe6af55569299515b434971) This is the 2nd commit message: mesa: simplify get-pick-list.sh script and add a description for the script NOTE: This is a candidate for the stable branches. Reviewed-by: Ian Romanick (cherry picked from commit fa27a0db43ba7ef8fdad41b5ad2bd6b45ba34b90) This is the 3rd commit message: mesa: optimize get-pick-list.sh script cuts down the while loop iterations from 4600 to 380 commits at the moment NOTE: This is a candidate for the stable branches. Reviewed-by: Ian Romanick (cherry picked from commit b2991526ed6faa713e3cf640fcdbbad68d991f3e) This is the 4th commit message: mesa: grep for commits with cherry picked in commit message only once and save them temporary in already_picked NOTE: This is a candidate for the stable branches. Reviewed-by: Ian Romanick (cherry picked from commit 135ec3a1db0de50e2bb3c57d4bf76f87ac80320f) This is the 5th commit message: mesa: fix indentation in get-pick-list.sh script NOTE: This is a candidate for the stable branches. Reviewed-by: Ian Romanick (cherry picked from commit 3e3ff4cd736ee881d37cfe4d40e540db503b41a5) --- bin/get-pick-list.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100755 bin/get-pick-list.sh diff --git a/bin/get-pick-list.sh b/bin/get-pick-list.sh new file mode 100755 index 0000000..7288090 --- /dev/null +++ b/bin/get-pick-list.sh @@ -0,0 +1,29 @@ +#!/bin/sh + +# Script for generating a list of candidates for cherry-picking to a stable branch + +# Grep for commits with "cherry picked from commit" in the commit message. +git log --reverse --grep="cherry picked from commit" origin/master..HEAD |\ + grep "cherry picked from commit" |\ + sed -e 's/^[[:space:]]*(cherry picked from commit[[:space:]]*//' -e 's/)//' > already_picked + +# Grep for commits that were marked as a candidate for the stable tree. +git log --reverse --pretty=%H -i --grep='^[[:space:]]*NOTE: This is a candidate' HEAD..origin/master |\ +while read sha +do + # Check to see whether the patch is on the ignore list. + if [ -f .git/cherry-ignore ] ; then + if grep -q ^$sha .git/cherry-ignore ; then + continue + fi + fi + + # Check to see if it has already been picked over. + if grep -q ^$sha already_picked ; then + continue + fi + + git log -n1 --pretty=oneline $sha | cat +done + +rm -f already_picked -- 2.7.4