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

[PATCH] rebase -i: abort cleanly if the editor fails to launch

From
Björn Gustavsson <bgustavsson@gmail.com>
Date
Dec 19, 2009, 12:04 UTC
Message-ID
<4B2CC133.9010704@gmail.com>

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>
---
 git-rebase--interactive.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index 0bd3bf7..d529328 100755
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -779,7 +779,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"
-- 
1.6.6.rc3.dirty
Next: Junio C Hamano
Message 1 of 5 in “rebase -i: abort cleanly if the editor fails to launch”
  1. rebase -i: abort cleanly if the editor fails to launchBjörn Gustavsson, Dec 19, 2009
  2. Junio C HamanoDec 19, 2009
  3. Johannes SchindelinDec 19, 2009
  4. Junio C HamanoDec 20, 2009
  5. Björn GustavssonDec 20, 2009

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.