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

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

From
Kenneth Lorber <keni@his.com>
Date
Aug 17, 2026, 21:19 UTC
Message-ID
<20260817211936.2943278-1-keni@his.com>
When the editor invoked by 'git config -e' fails (crashes or calls exit(3)
with a non-zero value), git notices and give an error:
	editor.c:launch_specified_editor()
		return error("there was a problem with the editor '%s'", editor);
which is then lost:
	builtin/config.c:show_editor()
		launch_editor(config_file, NULL, NULL);
which results in git always calling exit(0).  Note that the value is
not explicitly thrown away with "(void)", so this may not have been
intentional.

This patch simply passes the returned error out of show_editor(), which currently has an unconditional "return 0" even though its callers both check the return value.

While this didn't trigger anything in 'make test', it's possible that someone is relying on 'git config -e' always succeeding, even if the editor failed, so this could be considered a breaking change.

The 2 new tests set GIT_EDITOR to true and false and check the return from git.

RFC because the community may not want to change this behavior and I'm not thrilled with my test code.

Kenneth Lorber (1):
  config: surface editor failure in exit code
 builtin/config.c  |  5 +++--
 t/t1300-config.sh | 18 ++++++++++++++++++
 2 files changed, 21 insertions(+), 2 deletions(-)
base-commit: 010afd3166ddc64c9863b1506f12cbcdda0d4ea1
-- 
2.43.0
Next: Kenneth Lorber
Message 1 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.