./all branch BRANCHNAME - makes a new branch
authorRudolf Polzer <rpolzer@nb-04.(none)>
Sat, 20 Mar 2010 13:14:50 +0000 (14:14 +0100)
committerRudolf Polzer <rpolzer@nb-04.(none)>
Sat, 20 Mar 2010 13:14:50 +0000 (14:14 +0100)
all

diff --git a/all b/all
index 91a38e60994735bac186a27d1631d2e17cef33b0..924f75e61ab2fb8cb6a077b05c733108472d7880 100755 (executable)
--- a/all
+++ b/all
@@ -55,13 +55,29 @@ case "$cmd" in
                "$0" branch
                ;;
        branch)
-               for d in $repos; do
-                       cd "$d0/$d"
-                       r=`git symbolic-ref HEAD`
-                       r=${r#refs/heads/}
-                       echo "$d is at $r"
-                       cd "$d0"
-               done
+               if [ $# = 0 ]; then
+                       for d in $repos; do
+                               cd "$d0/$d"
+                               r=`git symbolic-ref HEAD`
+                               r=${r#refs/heads/}
+                               echo "$d is at $r"
+                               cd "$d0"
+                       done
+               else
+                       for d in $repos; do
+                               cd "$d0/$d"
+                               a=
+                               while [ x"$a" != x"y" -a x"$a" != x"n" ]; do
+                                       echo "Branch in $d?"
+                                       read -r a
+                               done
+                               if [ x"$a" = "y" ]; then
+                                       git branch "$1"
+                               fi
+                               cd "$d0"
+                       done
+                       "$0" branch
+               fi
                ;;
        branches)
                for d in $repos; do