Git development
 help / color / mirror / Atom feed
From: "brian m. carlson" <sandals@crustytoothpaste.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Karthik Nayak <karthik.188@gmail.com>,
	Kenneth Lorber <keni@his.com>,
	git@vger.kernel.org, Patrick Steinhardt <ps@pks.im>
Subject: Re: [RFC PATCH 0/1] config: surface editor failure in exit code
Date: Tue, 18 Aug 2026 22:12:59 +0000	[thread overview]
Message-ID: <aoTY6_wfcroOwrob@fruit.crustytoothpaste.net> (raw)
In-Reply-To: <xmqqecfv33h2.fsf@gitster.g>

[-- Attachment #1: Type: text/plain, Size: 1522 bytes --]

On 2026-08-18 at 14:31:05, Junio C Hamano wrote:
> Karthik Nayak <karthik.188@gmail.com> writes:
> 
> > Wouldn't it be better to notify the user that something went wrong
> > rather than simply brush it off?
> 
> If we were adding 'git config -e' today, absolutely.  The issue is
> not the comparison between signaling with an exit code and not
> doing so.  The question is whether the benefit or conceptual
> correctness outweighs any possible downside of changing the
> behavior existing users have grown accustomed to.
> 
> Having said that, 'git config -e' is relatively new, introduced in
> commit 3cbace5ee0 (builtin/config: introduce "edit" subcommand,
> 2024-05-06).  The folks who may be affected are those who used
> 'git config -e' in their scripts and carefully checked the exit
> status (or rather, lazily used 'set -e'), and did so in the past
> two years.  So the fallout might not be so great.

I think we should propagate the error code.  Other than ed(1) and POSIX
vi(1) implementations, editors only exit nonzero when there's an error.
If someone's scripting, then most of the major programming languages
should not exit nonzero unless something seriously went wrong or the
user requested a nonzero exit code, in which case they wanted the
process to abort.

I would actually argue that people might be ignoring errors with `set
-e` that they intended to catch just because they're not getting a
nonzero status code.
-- 
brian m. carlson (they/them)
Toronto, Ontario, CA

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 325 bytes --]

      reply	other threads:[~2026-08-18 22:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-17 21:19 [RFC PATCH 0/1] config: surface editor failure in exit code Kenneth Lorber
2026-08-17 21:19 ` [RFC PATCH 1/1] " Kenneth Lorber
2026-08-18  8:42   ` Karthik Nayak
2026-08-17 22:39 ` [RFC PATCH 0/1] " Junio C Hamano
2026-08-18  8:26   ` Karthik Nayak
2026-08-18 14:31     ` Junio C Hamano
2026-08-18 22:12       ` brian m. carlson [this message]

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=aoTY6_wfcroOwrob@fruit.crustytoothpaste.net \
    --to=sandals@crustytoothpaste.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=karthik.188@gmail.com \
    --cc=keni@his.com \
    --cc=ps@pks.im \
    /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