]> git.wh0rd.org - home.git/commitdiff
r rebase: better output
authorMike Frysinger <vapier@gentoo.org>
Thu, 28 Mar 2013 18:36:49 +0000 (14:36 -0400)
committerMike Frysinger <vapier@gentoo.org>
Thu, 28 Mar 2013 18:36:49 +0000 (14:36 -0400)
.bin/r

diff --git a/.bin/r b/.bin/r
index e951e0531403dee63ec5eda85244429a72f169c0..af59962dd8b7416378ba06f727d09b82bceaddeb 100755 (executable)
--- a/.bin/r
+++ b/.bin/r
@@ -61,6 +61,7 @@ rebase)
        if [[ $1 == "all" ]] ; then
                shift
                if [[ $# -eq 0 ]] ; then
+                       eval $(bash-colors --env | sed 's:^:export :')
                        root=$(repo_root)
                        mj_init
                        while read -a line ; do
@@ -69,7 +70,17 @@ rebase)
                                cd "${root}/${dir}"
                                (
                                out=$(env _proj=${proj} r rb all . 2>&1)
-                               [[ -n ${out} ]] && echo -e "${out//[#]/###}"
+                               if [[ -n ${out} ]] ; then
+                                       while read line ; do
+                                               if [[ ${line} == "# "* ]] ; then
+                                                       line="${line#[#] }"
+                                                       printf '%s### %s%-40s%s: %s\n' \
+                                                               "${BRACKET}" "${GOOD}" "${line%%:*}" "${NORMAL}" "${line#*:}"
+                                               else
+                                                       echo "${line}"
+                                               fi
+                                       done < <(echo "${out}")
+                               fi
                                _mj_child
                                ) &
                                mj_post_child
@@ -92,11 +103,11 @@ rebase)
                        END { print list b }')
                [[ -z ${branches} ]] && exit 0
 
-               eval $(bash-colors --env)
+               [[ -z ${GOOD} ]] && eval $(bash-colors --env)
                #echo "${GOOD}### ${PWD}${NORMAL}"
                # Skip if rebase is in progress.
                if [[ -e .git/rebase-merge/interactive ]] ; then
-                       echo "# ${_proj}: skipping due to active rebase"
+                       echo -e "# ${_proj}: ${WARN}skipping due to active rebase${NORMAL}"
                        exit 1
                fi
                for b in ${branches} ; do