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

Re: [PATCH] trace2: intercept all common signals

From
Junio C Hamano <gitster@pobox.com>
Date
May 10, 2024, 20:34 UTC
Message-ID
<xmqqle4h4d99.fsf@gitster.g>
In-Reply-To
<CAJoAoZmvzZaLN6cQkH4XeD9-=OwWFjT1adRA1oFHaUVyVWwLXQ@mail.gmail.com>
Emily Shaffer <nasamuffin@google.com> writes:
Show 5 quoted lines
> While I'm at it, since you pointed out ! instead of test_must_fail, I
> wondered if I should change "! test_grep" as well - but when I grep t/
> it looks like it's not usual to use `test_must_fail test_grep`, but
> instead to use `test_grep ! <omitted pattern> <file>`. I'll change
> that too.

"! test_grep" is an anti-pattern. We should have a documentation somewhere in t/README or nearby (if we don't, somebody please add one).

The point of test_grep is "when we expect to see hits, we do show them to the standard output even if we just used a bare 'grep', but when such a test fails, we can easily miss the failure, because the failure is signalled only by $? and no output---hence, test_grep helper loudly says that we expected to find something but we did not see any". Using "! test_grep" will make "! grep" louder in a wrong case. That is the whole reason why "test_grep !" exists.

> I also wonder - do we want to capture SIGKILL as well?

An eternally interesting question is "How would you catch an uncatchable signal?" ;-)

Previous: Jeff KingNext: Jeff King
Message 8 of 14 in “trace2: intercept all common signals”
  1. trace2: intercept all common signalsEmily Shaffer, May 10, 2024
  2. Emily ShafferMay 10, 2024
  3. Junio C HamanoMay 10, 2024
  4. Emily ShafferMay 10, 2024
  5. Jeff KingMay 10, 2024
  6. Emily ShafferMay 10, 2024
  7. Jeff KingMay 10, 2024
  8. Junio C HamanoMay 10, 2024
  9. Jeff KingMay 10, 2024
  10. Jeff KingMay 10, 2024
  11. Emily ShafferMay 13, 2024
  12. Jeff KingMay 16, 2024
  13. Junio C HamanoMay 16, 2024
  14. Jeff KingMay 23, 2024

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.