Re: [PATCH] rebase -i: abort cleanly if the editor fails to launch
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Dec 19, 2009, 20:57 UTC
- Message-ID
- <alpine.DEB.1.00.0912192156030.4985@pacific.mpi-cbg.de>
- In-Reply-To
- <7v8wcy7kyc.fsf@alter.siamese.dyndns.org>
Hi,
On Sat, 19 Dec 2009, Junio C Hamano wrote:
Show 23 quoted lines
> Björn Gustavsson <bgustavsson@gmail.com> writes: > > > 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> > > Two questions: > > - Is emacsclient the _only_ editor that can exit with non-zero status to > signal an error condition "the user invoked me to edit an existing > file, but I ended up not letting the user edit it"?
The non-existent editor also aborts with a non-zero status.
> An editor that can exit with non-zero status on demand could use this > codepath to abort the rebase,
Removing all lines of the edit script will abort an interactive rebase.
Ciao, Dscho