Skip to content

Commit 7063693

Browse files
j6tgitster
authored andcommitted
rebase -i: remove an unnecessary 'rerere' invocation
Interactive rebase uses 'git cherry-pick' and 'git merge' to replay commits. Both invoke the 'rerere' machinery when they fail due to merge conflicts. Note that all code paths with these two commands also invoke the shell function die_with_patch when the commands fail. Since commit 629716d ("rerere: do use multiple variants") the second operation of the rerere machinery can be observed by a duplicated message "Recorded preimage for 'file'". This second operation records the same preimage as the first one and, hence, only wastes cycles. Remove the 'git rerere' invocation from die_with_patch. Shell function die_with_patch can be called after the failure of "git commit", too, which also calls into the rerere machinery, but it does so only after a successful commit to record the resolution. Therefore, it is wrong to call 'git rerere' from die_with_patch after "git commit" fails. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 7654286 commit 7063693

1 file changed

Lines changed: 0 additions & 1 deletion

File tree

git-rebase--interactive.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,6 @@ make_patch () {
181181
die_with_patch () {
182182
echo "$1" > "$state_dir"/stopped-sha
183183
make_patch "$1"
184-
git rerere
185184
die "$2"
186185
}
187186

0 commit comments

Comments
 (0)