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>
Eric Wong committed
Jun 24, 2006 at 18:29 UTC
9e4bc7dd1bb9d92491c475cec55147fa0b3f954d
1 file changed
+5
-28
git-rebase.sh
+5
-28
@@ -59,15 +59,16 @@ continue_merge () {
59
60
if test -n "`git-diff-index HEAD`"
61
then
62
+ printf "Committed: %0${prec}d" $msgnum
63
git-commit -C "`cat $dotest/current`"
64
else
64
- echo "Previous merge succeeded automatically"
65
+ printf "Already applied: %0${prec}d" $msgnum
66
fi
67
+ echo ' '`git-rev-list --pretty=oneline -1 HEAD | \
68
+ sed 's/^[a-f0-9]\+ //'`
69
70
prev_head=`git-rev-parse HEAD^0`
68
-
71
# save the resulting commit so we can read-tree on it later
70
- echo "$prev_head" > "$dotest/cmt.$msgnum.result"
72
echo "$prev_head" > "$dotest/prev_head"
73
74
# onto the next patch:
@@ -82,10 +83,7 @@ call_merge () {
83
rv=$?
84
case "$rv" in
85
0)
85
- if test -n "`git-diff-index HEAD`"
86
- then
87
- git-commit -C "$cmt" || die "commit failed: $MRESOLVEMSG"
88
- fi
86
+ return
87
;;
88
1)
89
test -d "$GIT_DIR/rr-cache" && git-rerere
@@ -103,27 +101,6 @@ call_merge () {
101
}
102
103
finish_rb_merge () {
106
- set -e
107
-
108
- msgnum=1
109
- echo "Finalizing rebased commits..."
110
- git-reset --hard "`cat $dotest/onto`"
111
- end="`cat $dotest/end`"
112
- while test "$msgnum" -le "$end"
113
- do
114
- git-read-tree `cat "$dotest/cmt.$msgnum.result"`
115
- git-checkout-index -q -f -u -a
116
- if test -n "`git-diff-index HEAD`"
117
- then
118
- git-commit -C "`cat $dotest/cmt.$msgnum`"
119
- printf "Committed %0${prec}d" $msgnum
120
- else
121
- printf "Already applied: %0${prec}d" $msgnum
122
- fi
123
- echo ' '`git-rev-list --pretty=oneline -1 HEAD | \
124
- sed 's/^[a-f0-9]\+ //'`
125
- msgnum=$(($msgnum + 1))
126
- done
104
rm -r "$dotest"
105
echo "All done."
106
}