Re: [RFC PATCH 0/1] config: surface editor failure in exit code

"brian m. carlson" <[email protected]>
Newsgroups org.kernel.vger.git
Message-ID <[email protected]>
On 2026-08-18 at 14:31:05, Junio C Hamano wrote:
> Karthik Nayak <[email protected]> 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
signature.asc (application/pgp-signature, 325 B)
-----BEGIN PGP SIGNATURE-----

wr0EABYKAG8FgmqE2OsJEHwMSWKIh6KBRxQAAAAAAB4AIHNhbHRAbm90YXRpb25z
LnNlcXVvaWEtcGdwLm9yZ0bPTfijG0H53ez0NKpsb7+RgHuCZ/m7zSIvaFfiRAbo
FiEECCzmip28ZfuD0cORfAxJYoiHooEAACFNAP9EQdepr3EiimYuCyarylGTkffV
egpyA5hxR+YTVgghCwD+JWrols6hnMuRDh1WYxJMBvUz91jQeKdNDV5XPSkRyA0=
=OzYp
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.