rebase: cleanup rebasing with --merge
We no longer have to recommit each patch to remove the parent information we're rebasing since we're using the low-level merge strategies directly instead of git-merge. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
parent
9a99c087da
commit
9e4bc7dd1b
@ -59,15 +59,16 @@ continue_merge () {
|
|||||||
|
|
||||||
if test -n "`git-diff-index HEAD`"
|
if test -n "`git-diff-index HEAD`"
|
||||||
then
|
then
|
||||||
|
printf "Committed: %0${prec}d" $msgnum
|
||||||
git-commit -C "`cat $dotest/current`"
|
git-commit -C "`cat $dotest/current`"
|
||||||
else
|
else
|
||||||
echo "Previous merge succeeded automatically"
|
printf "Already applied: %0${prec}d" $msgnum
|
||||||
fi
|
fi
|
||||||
|
echo ' '`git-rev-list --pretty=oneline -1 HEAD | \
|
||||||
|
sed 's/^[a-f0-9]\+ //'`
|
||||||
|
|
||||||
prev_head=`git-rev-parse HEAD^0`
|
prev_head=`git-rev-parse HEAD^0`
|
||||||
|
|
||||||
# save the resulting commit so we can read-tree on it later
|
# save the resulting commit so we can read-tree on it later
|
||||||
echo "$prev_head" > "$dotest/cmt.$msgnum.result"
|
|
||||||
echo "$prev_head" > "$dotest/prev_head"
|
echo "$prev_head" > "$dotest/prev_head"
|
||||||
|
|
||||||
# onto the next patch:
|
# onto the next patch:
|
||||||
@ -82,10 +83,7 @@ call_merge () {
|
|||||||
rv=$?
|
rv=$?
|
||||||
case "$rv" in
|
case "$rv" in
|
||||||
0)
|
0)
|
||||||
if test -n "`git-diff-index HEAD`"
|
return
|
||||||
then
|
|
||||||
git-commit -C "$cmt" || die "commit failed: $MRESOLVEMSG"
|
|
||||||
fi
|
|
||||||
;;
|
;;
|
||||||
1)
|
1)
|
||||||
test -d "$GIT_DIR/rr-cache" && git-rerere
|
test -d "$GIT_DIR/rr-cache" && git-rerere
|
||||||
@ -103,27 +101,6 @@ call_merge () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
finish_rb_merge () {
|
finish_rb_merge () {
|
||||||
set -e
|
|
||||||
|
|
||||||
msgnum=1
|
|
||||||
echo "Finalizing rebased commits..."
|
|
||||||
git-reset --hard "`cat $dotest/onto`"
|
|
||||||
end="`cat $dotest/end`"
|
|
||||||
while test "$msgnum" -le "$end"
|
|
||||||
do
|
|
||||||
git-read-tree `cat "$dotest/cmt.$msgnum.result"`
|
|
||||||
git-checkout-index -q -f -u -a
|
|
||||||
if test -n "`git-diff-index HEAD`"
|
|
||||||
then
|
|
||||||
git-commit -C "`cat $dotest/cmt.$msgnum`"
|
|
||||||
printf "Committed %0${prec}d" $msgnum
|
|
||||||
else
|
|
||||||
printf "Already applied: %0${prec}d" $msgnum
|
|
||||||
fi
|
|
||||||
echo ' '`git-rev-list --pretty=oneline -1 HEAD | \
|
|
||||||
sed 's/^[a-f0-9]\+ //'`
|
|
||||||
msgnum=$(($msgnum + 1))
|
|
||||||
done
|
|
||||||
rm -r "$dotest"
|
rm -r "$dotest"
|
||||||
echo "All done."
|
echo "All done."
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user