git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* rebase -i: Should --continue auto-amend after failed exec?
@ 2011-08-08 21:11 Johannes Sixt
  2011-08-24 13:36 ` Matthieu Moy
  0 siblings, 1 reply; 9+ messages in thread
From: Johannes Sixt @ 2011-08-08 21:11 UTC (permalink / raw)
  To: Matthieu Moy; +Cc: git@vger.kernel.org List

If after a failed "exec" instruction there are staged changes, then currently rebase
--continue fails with:

.../git-rebase--interactive: line 774: .../.git/rebase-merge/author-script: No such file or directory

But shouldn't this amend the HEAD commit? The documentation is not clear
(from git-rebase.txt):

  The interactive rebase will stop when a command fails (i.e. exits with
  non-0 status) to give you an opportunity to fix the problem. You can
  continue with `git rebase --continue`.

This may be interpreted to work like "edit", and IMO would be a very useful
modus operandi.

Here is a test case.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>

diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
index 47c8371..2146e47 100755
--- a/t/t3404-rebase-interactive.sh
+++ b/t/t3404-rebase-interactive.sh
@@ -527,6 +527,21 @@ test_expect_success 'auto-amend only edited commits after "edit"' '
 	git rebase --abort
 '
 
+test_expect_failure 'auto-amend after failed "exec"' '
+	test_tick &&
+	test_when_finished "git rebase --abort || :" &&
+	(
+		FAKE_LINES="1 exec_false" &&
+		export FAKE_LINES &&
+		test_must_fail git rebase -i HEAD^
+	) &&
+	echo "edited again" > file7 &&
+	git add file7 &&
+	FAKE_COMMIT_MESSAGE="edited file7 again" git rebase --continue &&
+	actual=$(git show HEAD:file7) &&
+	test "edited again" = "$actual"
+'
+
 test_expect_success 'rebase a detached HEAD' '
 	grandparent=$(git rev-parse HEAD~2) &&
 	git checkout $(git rev-parse HEAD) &&

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2011-08-25 13:04 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-08 21:11 rebase -i: Should --continue auto-amend after failed exec? Johannes Sixt
2011-08-24 13:36 ` Matthieu Moy
2011-08-24 14:01   ` [PATCH] rebase -i: clean error message for --continue after failed exec Matthieu Moy
2011-08-24 18:42     ` Junio C Hamano
2011-08-24 18:54       ` Junio C Hamano
2011-08-25  7:09         ` Matthieu Moy
2011-08-25 13:04           ` Johannes Sixt
2011-08-24 20:20       ` Jeff King
2011-08-24 20:22         ` Jeff King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).