Skip to content

Commit

Permalink
rebase -i: abort cleanly if the editor fails to launch
Browse files Browse the repository at this point in the history
If the user's configured editor is emacsclient, the editor
will fail to launch if emacs is not running and the git
command that tried to lanuch the editor will abort. For most
commands, all you have to do is to start emacs and repeat
the command.

The "git rebase -i" command, however, aborts without cleaning
the "$GIT_DIR/rebase-merge" directory if it fails to launch the
editor, so you'll need to do "git rebase --abort" before
repeating the rebase command.

Change "git rebase -i" to terminate using "die_abort" (instead of
with "die") if the initial launch of the editor fails.

Signed-off-by: Björn Gustavsson <bgustavsson@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Björn Gustavsson authored and Junio C Hamano committed Dec 20, 2009
1 parent afab0fe commit e49ca97
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion git-rebase--interactive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,7 @@ EOF

cp "$TODO" "$TODO".backup
git_editor "$TODO" ||
die "Could not execute editor"
die_abort "Could not execute editor"

has_action "$TODO" ||
die_abort "Nothing to do"
Expand Down

0 comments on commit e49ca97

Please sign in to comment.