]> git.wh0rd.org Git - home.git/commitdiff
implement repo-wide rb all
authorMike Frysinger <vapier@gentoo.org>
Thu, 5 Apr 2012 20:32:20 +0000 (16:32 -0400)
committerMike Frysinger <vapier@gentoo.org>
Sat, 28 Apr 2012 19:36:47 +0000 (15:36 -0400)
.bin/r

diff --git a/.bin/r b/.bin/r
index 68d624a7316c7f01b6059781d8cbdfc93c06fb7f..518b266db153d3b831ccfabc0fe2ae415f9ef1f0 100755 (executable)
--- a/.bin/r
+++ b/.bin/r
@@ -14,6 +14,10 @@ case ${acmd:-${cmd}} in
 rebase)
        if [[ $1 == "all" ]] ; then
                shift
+               if [[ $# -eq 0 ]] ; then
+                       exec r forall -c 'r rb all .'
+               fi
+
                branches=$(g b | awk '
                        {
                                if ($0 ~ "^[*] *[(]no branch[)]") {
@@ -25,10 +29,16 @@ rebase)
                                }
                        }
                        END { print list b }')
+               [[ -z ${branches} ]] && exit 0
+
+               eval $(bash-colors --env)
+               echo "${GOOD}### ${PWD}${NORMAL}"
                for b in ${branches} ; do
-                       echo " ### $b"
+                       echo " ${HILITE}### $b${NORMAL}"
                        g co $b || exit 1
-                       r rb "$@" || exit 1
+                       if ! r rb "$@" ; then
+                               g rb-a
+                       fi
                done
                exit 0
        fi