Add Doit script.
authorJunio C Hamano <junkio@cox.net>
Tue, 27 Dec 2005 05:00:32 +0000 (21:00 -0800)
committerJunio C Hamano <junkio@cox.net>
Tue, 27 Dec 2005 05:00:32 +0000 (21:00 -0800)
Doit [new file with mode: 0755]
R [new file with mode: 0755]

diff --git a/Doit b/Doit
new file mode 100755 (executable)
index 0000000..7c70f94
--- /dev/null
+++ b/Doit
@@ -0,0 +1,44 @@
+#!/bin/sh
+
+try_if_new () {
+       branch="$1"
+       to_install="$2"
+       commits=$(git-rev-list "ko-${branch}..${branch}")
+
+       to_build=no
+       case "$commits" in
+       '') 
+               echo "* Up-to-date at ko-$branch"
+               to_build=no
+               ;;
+       *)
+               to_build=yes
+               ;;
+       esac
+
+       case "$to_install" in
+       ?*)
+               to_build=yes
+               ;;
+       esac
+
+       case "$to_build" in
+       yes)
+               Meta/Make clean >/dev/null 2>&1 &&
+               git checkout "$branch" &&
+               echo "* Testing $branch" &&
+               Meta/Make clean test >./":${branch}.log" 2>&1 &&
+               case "$to_install" in
+               ?*)
+                       Meta/Make install >>./":${branch}.log" 2>&1 ;;
+               esac
+       esac
+}
+
+git fetch ko &&
+
+try_if_new maint &&
+try_if_new pu &&
+try_if_new master install &&
+Meta/Make clean >/dev/null 2>&1
+
diff --git a/R b/R
new file mode 100755 (executable)
index 0000000..146ad70
--- /dev/null
+++ b/R
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+m=$(git-rev-parse "master^0")
+for branch
+do
+       b=$(git-rev-parse "$branch^0")
+       case "$(git-merge-base --all "$b" "$m")" in
+       "$m")
+               echo >&2 "$branch: up to date"
+               continue
+               ;;
+       esac
+       git-show-branch "$branch" master
+       while :
+       do
+               echo -n >&2 "Rebase $branch [Y/n]? "
+               read ans
+               case "$ans" in
+               [Yy]*)
+                       git rebase master "$branch" || exit
+                       break
+                       ;;
+               [Nn]*)
+                       echo >&2 "Not rebasing $branch"
+                       break
+                       ;;
+               *)
+                       echo >&2 "Sorry, I could not hear you"
+                       ;;
+               esac
+       done
+done