From e947e1df77bcc5727571c0018cba970b8599366c Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Mon, 19 Sep 2011 18:38:59 -0400 Subject: [PATCH] better repo rebase --- .bin/r | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.bin/r b/.bin/r index f973ff8..80f2354 100755 --- 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 -- 2.39.5