]> git.wh0rd.org Git - home.git/commitdiff
r: switch rb-all to git-rb-all
authorMike Frysinger <vapier@gentoo.org>
Fri, 27 Sep 2019 17:51:18 +0000 (13:51 -0400)
committerMike Frysinger <vapier@gentoo.org>
Fri, 27 Sep 2019 17:51:18 +0000 (13:51 -0400)
.bin/r

diff --git a/.bin/r b/.bin/r
index a969597655a52ff8dec24afdd286d64a705cbfab..848378ea2eedcc6abeba8fed90c3f680ce8800d4 100755 (executable)
--- a/.bin/r
+++ b/.bin/r
@@ -137,7 +137,7 @@ rebase)
        if [[ $1 == "all" ]] ; then
                shift
                if [[ $# -eq 0 ]] ; then
-                       eval $(bash-colors --env | sed 's:^:export :')
+                       eval "$(bash-colors --env | sed 's:^:export :')"
                        root=$(repo_root)
                        mj_init
                        while read -a line ; do
@@ -148,22 +148,10 @@ rebase)
                                        continue
                                fi
                                (
-                               out=$(env _proj=${proj} r rb all . 2>&1)
+                               out=$(r rb all . 2>&1)
                                if [[ -n ${out} ]] ; then
-                                       while read line ; do
-                                               case ${line} in
-                                               "Fast-forwarded "*) ;;
-                                               "# "*)
-                                                       line="${line#[#] }"
-                                                       printf '%s### %s%-40s%s: %s\n' \
-                                                               "${BRACKET}" "${GOOD}" "${line%%:*}" "${NORMAL}" "${line#*:}"
-                                                       ;;
-                                               *)
-                                                       printf '%s### %s%-40s%s: ERROR: %s\n' \
-                                                               "${BRACKET}" "${BAD}" "${dir}" "${NORMAL}" "${line}"
-                                                       ;;
-                                               esac
-                                       done < <(echo "${out}")
+                                       head=$(printf "%-40s" "${proj}")
+                                       echo "${out}" | sed "s:^:${head} :"
                                fi
                                _mj_child
                                ) &
@@ -174,36 +162,7 @@ rebase)
                        #exec r forall -p -c 'r rb all .' </dev/null
                fi
 
-               branches=$(g b | awk '
-                       {
-                               if ($0 ~ "^[*] *[(]no branch[)]") {
-                                       next
-                               } else if ($0 ~ "^[*] *[(](HEAD )?detached (from|at) ") {
-                                       next
-                               } else if ($1 == "*") {
-                                       b = $2
-                               } else {
-                                       list = list $1 " "
-                               }
-                       }
-                       END { print list b }')
-               [[ -z ${branches} ]] && exit 0
-
-               [[ -z ${GOOD} ]] && eval $(bash-colors --env)
-               #echo "${GOOD}### ${PWD}${NORMAL}"
-               # Skip if rebase is in progress.
-               if [[ -e .git/rebase-merge/interactive ]] ; then
-                       echo -e "# ${_proj}: ${WARN}skipping due to active rebase${NORMAL}"
-                       exit 1
-               fi
-               for b in ${branches} ; do
-                       #echo " ${HILITE}### $b${NORMAL}"
-                       g co -q $b || exit 1
-                       if ! r rb -q "$@" ; then
-                               g rb-a
-                       fi
-               done
-               exit 0
+               exec git rb-all -q
        fi
        ;;
 clean)