git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "brian m. carlson" <sandals@crustytoothpaste.net>
Cc: M Douglas McIlroy <m.douglas.mcilroy@dartmouth.edu>, git@vger.kernel.org
Subject: Re: default editor
Date: Sun, 07 Feb 2021 10:12:33 -0800	[thread overview]
Message-ID: <xmqqlfbz927i.fsf@gitster.c.googlers.com> (raw)
In-Reply-To: <YCAk8Zx8KvZhaJMx@camp.crustytoothpaste.net> (brian m. carlson's message of "Sun, 7 Feb 2021 17:35:45 +0000")

"brian m. carlson" <sandals@crustytoothpaste.net> 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.


  reply	other threads:[~2021-02-07 18:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-07 13:24 default editor M Douglas McIlroy
2021-02-07 17:35 ` brian m. carlson
2021-02-07 18:12   ` Junio C Hamano [this message]
2021-02-07 18:37     ` Jeff King
2021-02-07 19:09       ` brian m. carlson
2021-02-07 21:57       ` Eric Sunshine
2021-02-08 10:03         ` Adam Dinwoodie
2021-02-11 15:15           ` M Douglas McIlroy
2021-02-12  6:03             ` Eric Sunshine

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqlfbz927i.fsf@gitster.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=m.douglas.mcilroy@dartmouth.edu \
    --cc=sandals@crustytoothpaste.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).