./all: new admin-merge command to review and merge a branch
authorRudolf Polzer <divverent@alientrap.org>
Thu, 22 Apr 2010 13:56:16 +0000 (15:56 +0200)
committerRudolf Polzer <divverent@alientrap.org>
Thu, 22 Apr 2010 13:56:16 +0000 (15:56 +0200)
all

diff --git a/all b/all
index 1d85b6e24d457ca0fe6e96f7fbc57c7bdb50ee0a..7b882074d24bc05df04a93ec89e0049adcba102e 100755 (executable)
--- a/all
+++ b/all
@@ -444,6 +444,27 @@ case "$cmd" in
                done
                rm -rf "$patchdir"
                ;;
+       admin-merge)
+               for d in $repos; do
+                       enter "$d0/$d" verbose
+                       git rev-parse "$1/$2" || continue
+                       # 1. review
+                       {
+                               git log HEAD.."$1/$2"
+                               git diff HEAD..."$1/$2"
+                       } | less
+                       a=
+                       while [ x"$a" != x"y" -a x"$a" != x"n" ]; do
+                               echo "Merge \"$1/$2\" into `git symbolic-ref HEAD` of $d?"
+                               read -r a
+                       done
+                       if [ x"$a" = x"y" ]; then
+                               git merge "$1/$2"
+                               git push origin HEAD
+                               git push "$1" :"$2"
+                       fi
+               done
+               ;;
        *)
                echo "Usage:"
                echo "  $SELF pull"