Thread (7 messages) 7 messages, 6 authors, 2021-02-12

Re: default editor

flat view

From: Junio C Hamano <hidden>
Date: 2021-02-07 18:13:21

"brian m. carlson" [off-list ref] writes:
First of all, I don't use Windows and this sounds like a
Windows-specific problem, so you may have more help at the Git for
Windows issue tracker.  But I'll try to help anyway.
I don't do Windows, either ;-)
I don't think the return value is the problem.  Both Unix and Windows
return 0 on success and nonzero on error, and Git will interpret
editor return codes that way.
When git spawns an editor, it is asking the editor to give the text
file that has been edited by the end user into a shape that the end
user is happy with.  A non-zero exit is a way for the end user to
tell the editor (and hence git) that, even though the user has ended
the editor session, the resulting contents is not satisfactory and
not to be used.

If the 'ed' in question behaves the same as traditional UNIX 'ed' (I
am guessing so, as even this is on Windows, Cygwin was mentioned),
you can start making changes and attempt to quit without saving by
typing 'q<RET>' twice (the first one will be greeted with '?'
meaning "are you sure you want to quit without saving", and the
second one lets you quit).  'ed' will signal the calling environment
that the editor session was aborted by exiting with a non-zero
status.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help