- log "$" $@
- $@ 2>&1 | tee -a $LOG_FILE
- return ${PIPESTATUS[0]}
-}
-
-do_rebase()
-{
- rbase=${1#*/}
- rbase=${rbase%%:*}
- rtop=${1#*:}
- rbid=$(git rev-parse $2/$rbase)
- rtid=$(git rev-parse $2/$rtop)
- [ "$rbid" = "$rtid" ] && {
- echo Empty tree
- return
- }
- [ "$(git rev-list HEAD..$2/$rtop)" ] || {
- echo Already merged
- return
- }
- execute git clone -s -l -n -q . ../rebase-tmp || {
- echo Clone failed 1>&2
- bash -i || exit
- }
- log '$' cd ../rebase-tmp
- cd ../rebase-tmp
- execute git fetch --no-tags ../next refs/remotes/$2/$rtop:$2/$rtop || {
- echo Fetch of top failed 1>&2
- bash -i || exit
- }
- execute git fetch --no-tags ../next refs/remotes/$2/$rbase:$2/$rbase || {
- echo Fetch of base failed 1>&2
- bash -i || exit
- }
- execute git checkout $2/$rtop || {
- echo Checkout of top failed 1>&2
- bash -i || exit
- }
- execute git rebase --onto master $2/$rbase || {
- echo Rebase failed 1>&2
- bash -i || exit
- }
- log '$' cd ../next
- cd ../next
- execute git pull -f ../rebase-tmp $2/$rtop || {
- echo Pull failed 1>&2
- echo $h >>../merge.debug
- git diff >>../merge.debug 2>&1
- git diff 2>&1 | egrep -q '<<<<<|^\*' && {
- bash -i || exit
- }
- }
- execute rm -rf ../rebase-tmp