]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Meta/ML: allow target other than maint
authorJunio C Hamano <gitster@pobox.com>
Thu, 12 Apr 2012 22:38:54 +0000 (15:38 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 12 Apr 2012 22:41:06 +0000 (15:41 -0700)
ML

diff --git a/ML b/ML
index 4aa88893d791d5b05e1288fd719f590b9cbdaeb6..8a3c2de328ed0ba07b03bc47af08070f83766f3b 100755 (executable)
--- a/ML
+++ b/ML
@@ -1,11 +1,13 @@
 #!/bin/sh
 # Merge later...
 
+target=maint
+
 # Read from RelNotes and find mergeable topics
 search_topics () {
        tmp=/tmp/ML.$$
        trap 'rm -f "$tmp"' 0
-       git rev-list --parents --first-parent maint..master >"$tmp"
+       git rev-list --parents --first-parent $target..master >"$tmp"
 
        x40='[0-9a-f]'
        x40="$x40$x40$x40$x40$x40"
@@ -20,8 +22,8 @@ search_topics () {
                fi
 
                comment=
-               if ! git show-ref --quiet --verify "refs/heads/$topic" &&
-                   test $(git log --oneline maint..$full_sha1 | wc -l) != 0
+               if ! git show-ref --quiet --verify "refs/heads/$topic" ||
+                   test $(git log --oneline $target..$full_sha1 | wc -l) != 0
                then
                        comment="$topic gone"
                        tip=$full_sha1 topic=$sha1
@@ -38,7 +40,7 @@ search_topics () {
                ago=$(
                    git show -s --format='%ar' $fp
                )
-               lg=$(git log --oneline maint..$tip | wc -l)
+               lg=$(git log --oneline $target..$tip | wc -l)
                if test $lg != 0
                then
                        echo "$topic # $lg${ago+ ($ago)}${comment+ $comment}"
@@ -48,6 +50,23 @@ search_topics () {
        done
 }
 
+while  case "$#,$1" in
+       0,*)
+               break ;;
+       *,-t)
+               target=${2?"-t target???"}
+               git show-ref --quiet --verify "refs/heads/$target" || {
+                       echo >&2 "$target: no such branch"
+                       exit 1
+               }
+               shift ;;
+       *)
+               break ;;
+       esac
+do
+       shift
+done
+
 case $# in
 0)
        search_topics