diff options
author | Matthieu Moy <Matthieu.Moy@imag.fr> | 2011-08-24 16:01:48 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-08-26 14:57:09 -0700 |
commit | ffaaed88aed2e9b7936a0c5b43c1b198db0dc2ab (patch) | |
tree | 264997f5bdf5cf9504d66e82712f4cf3a75a6c0e /git-rebase--interactive.sh | |
parent | cd2b8ae983a277fb3f3c2b2c6747b0a075af1421 (diff) | |
download | git-ffaaed88aed2e9b7936a0c5b43c1b198db0dc2ab.tar.gz |
rebase -i: clean error message for --continue after failed exec
After an "exec false" stops the rebase and gives the control back to
the user, if changes are added to the index, "rebase --continue" fails
with this message, which may technically be correct, but does not point
at the real problem:
.../git-rebase--interactive: line 774: .../.git/rebase-merge/author-script: No such file or directory
We could try auto-amending HEAD, but this goes against the logic of
.git/rebase-merge/author-script (see also the testcase 'auto-amend only
edited commits after "edit"' in t3404-rebase-interactive.sh) to
auto-amend something the user hasn't explicitely asked to edit.
Instead of doing anything automatically, detect the situation and give a
clean error message. While we're there, also clarify the error message in
case '. "$author_script"' fails, which now corresponds to really weird
senario where the author script exists but can't be read.
Test-case-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-rebase--interactive.sh')
-rw-r--r-- | git-rebase--interactive.sh | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh index c6ba7c1551..5c94506098 100644 --- a/git-rebase--interactive.sh +++ b/git-rebase--interactive.sh @@ -647,8 +647,24 @@ continue) then : Nothing to commit -- skip this else + if ! test -f "$author_script" + then + die "You have staged changes in your working tree. If these changes are meant to be +squashed into the previous commit, run: + + git commit --amend + +If they are meant to go into a new commit, run: + + git commit + +In both case, once you're done, continue with: + + git rebase --continue +" + fi . "$author_script" || - die "Cannot find the author identity" + die "Error trying to find the author identity to amend commit" current_head= if test -f "$amend" then |