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

Re: [PATCH v4 12/12] t: detect errors outside of test cases

From
Jeff King <peff@peff.net>
Date
Apr 18, 2026, 21:05 UTC
Message-ID
<20260418210518.GA9632@coredump.intra.peff.net>
In-Reply-To
<xmqqtst8ul4q.fsf@gitster.g>
On Sat, Apr 18, 2026 at 12:24:53PM -0700, Junio C Hamano wrote:
> We could forget about "we know this is a good shell by its name and
> version" and test the feature we depend on ourselves, perhaps?

I looked into that but didn't get anywhere useful. You can try to test all of the "set -e" scenarios we care about, but there are a lot of them. For example, I would never have thought to check how "command" behaves inside a &&-chain while "set -e" is in effect.

So you basically end up adding a test case for the bugs you find, at which point it is not much better than blocking known-bad versions.

-Peff
Previous: Junio C HamanoNext: Patrick Steinhardt
Message 18 of 23 in “t: detect errors outside of test cases”
  1. 00/12 t: detect errors outside of test casesPatrick Steinhardt, Apr 17, 2026
  2. 01/12 t: prepare `test_match_signal ()` calls for `set -e`Patrick Steinhardt, Apr 17, 2026
  3. 02/12 t: prepare `test_must_fail ()` for `set -e`Patrick Steinhardt, Apr 17, 2026
  4. 03/12 t: prepare `stop_git_daemon ()` for `set -e`Patrick Steinhardt, Apr 17, 2026
  5. 04/12 t: prepare `git config --unset` calls for `set -e`Patrick Steinhardt, Apr 17, 2026
  6. 05/12 t: prepare conditional test execution for `set -e`Patrick Steinhardt, Apr 17, 2026
  7. 06/12 t: prepare execution of potentially failing commands for `set -e`Patrick Steinhardt, Apr 17, 2026
  8. 07/12 t: prepare `test_when_finished ()`/`test_atexit()` for `set -e`Patrick Steinhardt, Apr 17, 2026
  9. 08/12 t0008: silence error in subshell when using `grep -v`Patrick Steinhardt, Apr 17, 2026
  10. 09/12 t1301: don't fail in case setfacl(1) doesn't exist or failsPatrick Steinhardt, Apr 17, 2026
  11. 10/12 t6002: fix use of `expr` with `set -e`Patrick Steinhardt, Apr 17, 2026
  12. 11/12 t9902: fix use of `read` with `set -e`Patrick Steinhardt, Apr 17, 2026
  13. 12/12 t: detect errors outside of test casesPatrick Steinhardt, Apr 17, 2026
  14. Jeff KingApr 18, 2026
  15. Ben KnobleApr 18, 2026
  16. Jeff KingApr 18, 2026
  17. Junio C HamanoApr 18, 2026
  18. Jeff KingApr 18, 2026
  19. Patrick SteinhardtApr 20, 2026
  20. brian m. carlsonApr 18, 2026
  21. Jeff KingApr 18, 2026
  22. brian m. carlsonApr 18, 2026
  23. Jeff KingApr 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.