X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=PU;h=30cb5753d26a41dd8f2a4a3bfc0bd31954cc2848;hb=ae9133ae2de098045e2b8e955ca685378e3dba2e;hp=8d3d38f3d3fd0666563b862f82f0f07f2a6ce91c;hpb=1ad3ae4c173bd0557f0d0ebdf438db0f034710e1;p=git.git diff --git a/PU b/PU index 8d3d38f3..30cb5753 100755 --- a/PU +++ b/PU @@ -3,20 +3,58 @@ # Rebuild "pu" from topic branches. # -. git-sh-setup - -git-status && exit -git-checkout pu && -git-reset --hard master && -ORIG_HEAD=`git-rev-parse ORIG_HEAD` || exit +git status && exit +git checkout pu && +git reset --hard master && +ORIG_HEAD=`git rev-parse ORIG_HEAD` || exit + +case "$#" in +0) + # interactive ;-) + shift + HH=`cd .git/refs/heads && find -type f | + sed -e 's/^\.\///' -e '/^master$/d' -e '/^maint$/d' -e '/^pu$/d'` + while test "$HH" + do + I=0 + echo "0: done" + for H in $HH + do + I=$(($I+1)) + echo -n "$I: " + git-show-branch $H + done + echo -n "Merge which ones (0 to finish)? " + read ans + case "$ans" in + '' | 0) + break ;; + esac + I=0 + UNUSE= + USE= + for H in $HH + do + I=$(($I+1)) + case " $ans " in + *' '$I' '*) + USE="$USE$H " + ;; + *) + UNUSE="$UNUSE$H " + ;; + esac + done + git pull -n . $USE || exit + HH=$UNUSE + done + exit + ;; +esac for H do - (IFS=",$IFS"; git-pull -n . $H) || exit + (IFS=",$IFS"; git pull -n . $H) || exit done -(IFS=",$IFS"; git-show-branch master pu $* $ORIG_HEAD) - - - - +(IFS=",$IFS"; git show-branch master pu $* $ORIG_HEAD)