From: Mike Frysinger Date: Thu, 28 Mar 2013 18:36:49 +0000 (-0400) Subject: r rebase: better output X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=71b529c693dcea47f7a4e7aedee363fffbf6e617;p=home.git r rebase: better output --- diff --git a/.bin/r b/.bin/r index e951e05..af59962 100755 --- 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