]> git.wh0rd.org Git - home.git/commitdiff
better repo rebase
authorMike Frysinger <vapier@gentoo.org>
Mon, 19 Sep 2011 22:38:59 +0000 (18:38 -0400)
committerMike Frysinger <vapier@gentoo.org>
Sat, 28 Apr 2012 19:36:39 +0000 (15:36 -0400)
.bin/r

diff --git a/.bin/r b/.bin/r
index f973ff80130f29f9f24563079396033d6267b1df..80f2354d97281b523ae0021449bc706f1b70aca1 100755 (executable)
--- a/.bin/r
+++ b/.bin/r
@@ -7,10 +7,22 @@ acmd=$(git config --get "alias.${cmd}")
 case ${acmd} in
 rebase)
        if [[ $1 == "all" ]] ; then
-               for b in $(g b | awk '{print $NF}') ; do
+               shift
+               branches=$(g b | awk '
+                       {
+                               if ($0 ~ "^[*] *[(]no branch[)]") {
+                                       next
+                               } else if ($1 == "*") {
+                                       b = $NF
+                               } else {
+                                       list = list $NF " "
+                               }
+                       }
+                       END { print list b }')
+               for b in ${branches} ; do
                        echo " ### $b"
                        g co $b || exit 1
-                       r rb || exit 1
+                       r rb "$@" || exit 1
                done
                exit 0
        fi