git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Aug 18, 2026, 22:12 UTC
Message-ID
<aoTY6_wfcroOwrob@fruit.crustytoothpaste.net>
In-Reply-To
<xmqqecfv33h2.fsf@gitster.g>
On 2026-08-18 at 14:31:05, Junio C Hamano wrote:
Show 17 quoted lines
> 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
Previous: Junio C HamanoNext: Kenneth Lorber
Message 9 of 16 in “config: surface editor failure in exit code”
  1. 0/1 config: surface editor failure in exit codeKenneth Lorber, Aug 17, 2026
  2. 1/1 config: surface editor failure in exit codeKenneth Lorber, Aug 17, 2026
  3. Karthik NayakAug 18, 2026
  4. Kenneth LorberAug 19, 2026
  5. Junio C HamanoAug 19, 2026
  6. Junio C HamanoAug 17, 2026
  7. Karthik NayakAug 18, 2026
  8. Junio C HamanoAug 18, 2026
  9. brian m. carlsonAug 18, 2026
  10. 0/1 config: surface editor failure in exit codeKenneth Lorber, Aug 19, 2026
  11. 1/1 config: surface editor failure in exit codeKenneth Lorber, Aug 19, 2026
  12. 0/1 config: surface editor failure in exit codeKenneth Lorber, Aug 19, 2026
  13. 1/1 config: surface editor failure in exit codeKenneth Lorber, Aug 19, 2026
  14. Junio C HamanoAug 19, 2026
  15. Kenneth LorberAug 19, 2026
  16. Junio C HamanoAug 19, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.