mesa: add get-pick-list.sh script into bin/
authorAndreas Boll <andreas.boll.dev@gmail.com>
Tue, 23 Oct 2012 17:32:33 +0000 (19:32 +0200)
committerAndreas Boll <andreas.boll.dev@gmail.com>
Tue, 23 Oct 2012 17:32:33 +0000 (19:32 +0200)
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 <ian.d.romanick@intel.com>
    (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 <ian.d.romanick@intel.com>
    (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 <ian.d.romanick@intel.com>
    (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 <ian.d.romanick@intel.com>
    (cherry picked from commit 3e3ff4cd736ee881d37cfe4d40e540db503b41a5)

bin/get-pick-list.sh [new file with mode: 0755]

diff --git a/bin/get-pick-list.sh b/bin/get-pick-list.sh
new file mode 100755 (executable)
index 0000000..7288090
--- /dev/null
@@ -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