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

[PATCH] rebase -i: give rerere a chance

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Nov 22, 2007, 11:18 UTC
Message-ID
<Pine.LNX.4.64.0711221117590.27959@racer.site>
In-Reply-To
<7vlk8q7hzg.fsf@gitster.siamese.dyndns.org>

Like non-interactive rebase, interactive mode now calls rerere when appropriate.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
	While I was working with rebase -i yesterday, I realised that it
	did not call rerere at all.  And sure enough, there was a
	NEEDSWORK in rebase -i for that.
	Now, I _hope_ I got all the locations where the rerere should be
	cleared, but this could use a few pairs of eyeballs.
 git-rebase--interactive.sh |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index ead7da7..a6dc72a 100755
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -81,6 +81,7 @@ make_patch () {
 
 die_with_patch () {
 	make_patch "$1"
+	git rerere
 	die "$2"
 }
 
@@ -166,13 +167,13 @@ pick_one_preserving_merges () {
 			msg="$(git cat-file commit $sha1 | sed -e '1,/^$/d')"
 			# No point in merging the first parent, that's HEAD
 			new_parents=${new_parents# $first_parent}
-			# NEEDSWORK: give rerere a chance
 			if ! GIT_AUTHOR_NAME="$GIT_AUTHOR_NAME" \
 				GIT_AUTHOR_EMAIL="$GIT_AUTHOR_EMAIL" \
 				GIT_AUTHOR_DATE="$GIT_AUTHOR_DATE" \
 				output git merge $STRATEGY -m "$msg" \
 					$new_parents
 			then
+				git rerere
 				printf "%s\n" "$msg" > "$GIT_DIR"/MERGE_MSG
 				die Error redoing merge $sha1
 			fi
@@ -360,6 +361,7 @@ do
 	--abort)
 		comment_for_reflog abort
 
+		git rerere clear
 		test -d "$DOTEST" || die "No interactive rebase running"
 
 		HEADNAME=$(cat "$DOTEST"/head-name)
@@ -376,6 +378,7 @@ do
 	--skip)
 		comment_for_reflog skip
 
+		git rerere clear
 		test -d "$DOTEST" || die "No interactive rebase running"
 
 		output git reset --hard && do_rest
-- 
1.5.3.6.1977.g54d30
Previous: Jeff KingNext: Junio C Hamano
Message 7 of 14 in “Reordering lines in "git-rebase -i" task sheet”
  1. Junio C HamanoNov 22, 2007
  2. rebase -i: move help to end of todo fileJohannes Schindelin, Nov 22, 2007
  3. Adjust t3404 to ignore empty lines in the todo fileJohannes Schindelin, Nov 22, 2007
  4. Junio C HamanoNov 22, 2007
  5. Johannes SchindelinNov 22, 2007
  6. Jeff KingNov 22, 2007
  7. rebase -i: give rerere a chanceJohannes Schindelin, Nov 22, 2007
  8. Junio C HamanoNov 29, 2007
  9. Johannes SchindelinNov 29, 2007
  10. David KastrupNov 29, 2007
  11. David BrownNov 22, 2007
  12. Johannes SchindelinNov 22, 2007
  13. Andy ParkinsNov 23, 2007
  14. Andy ParkinsNov 26, 2007

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.