git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 2/3] rebase: cleanup rebasing with --merge

From
EWEric Wong <normalperson@yhbt.net>
Date
Jun 25, 2006, 01:29 UTC
Message-ID
<11511989922423-git-send-email-normalperson@yhbt.net>
In-Reply-To
<20060622110941.GA32261@hand.yhbt.net>

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>
---
 git-rebase.sh |   33 +++++----------------------------
 1 files changed, 5 insertions(+), 28 deletions(-)
diff --git a/git-rebase.sh b/git-rebase.sh
index 53fb14e..a95ada6 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -59,15 +59,16 @@ continue_merge () {
 
 	if test -n "`git-diff-index HEAD`"
 	then
+		printf "Committed: %0${prec}d" $msgnum
 		git-commit -C "`cat $dotest/current`"
 	else
-		echo "Previous merge succeeded automatically"
+		printf "Already applied: %0${prec}d" $msgnum
 	fi
+	echo ' '`git-rev-list --pretty=oneline -1 HEAD | \
+				sed 's/^[a-f0-9]\+ //'`
 
 	prev_head=`git-rev-parse HEAD^0`
-
 	# 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"
 
 	# onto the next patch:
@@ -82,10 +83,7 @@ call_merge () {
 	rv=$?
 	case "$rv" in
 	0)
-		if test -n "`git-diff-index HEAD`"
-		then
-			git-commit -C "$cmt" || die "commit failed: $MRESOLVEMSG"
-		fi
+		return
 		;;
 	1)
 		test -d "$GIT_DIR/rr-cache" && git-rerere
@@ -103,27 +101,6 @@ call_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"
 	echo "All done."
 }
-- 
1.4.0.g937a
Previous: Eric WongNext: Eric Wong
Message 9 of 10 in “rebase --merge: fix for rebasing more than 7 commits.”
  1. rebase --merge: fix for rebasing more than 7 commits.Junio C Hamano, Jun 22, 2006
  2. Junio C HamanoJun 22, 2006
  3. Eric WongJun 22, 2006
  4. Junio C HamanoJun 24, 2006
  5. 0/3 rebase --merge improvements and fixesEric Wong, Jun 25, 2006
  6. 1/3 rebase: allow --merge option to handle patches merged upstreamEric Wong, Jun 25, 2006
  7. Johannes SchindelinJun 25, 2006
  8. Eric WongJun 25, 2006
  9. 2/3 rebase: cleanup rebasing with --mergeEric Wong, Jun 25, 2006
  10. 3/3 rebase: allow --skip to work with --mergeEric Wong, Jun 25, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.