From: Junio C Hamano <gitster@pobox.com>
To: Emily Shaffer <nasamuffin@google.com>
Cc: git@vger.kernel.org, git@jeffhostetler.com
Subject: Re: [PATCH] trace2: intercept all common signals
Date: Fri, 10 May 2024 13:34:42 -0700 [thread overview]
Message-ID: <xmqqle4h4d99.fsf@gitster.g> (raw)
In-Reply-To: <CAJoAoZmvzZaLN6cQkH4XeD9-=OwWFjT1adRA1oFHaUVyVWwLXQ@mail.gmail.com> (Emily Shaffer's message of "Fri, 10 May 2024 12:34:07 -0700")
Emily Shaffer <nasamuffin@google.com> writes:
> 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?" ;-)
next prev parent reply other threads:[~2024-05-10 20:34 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-10 17:22 [PATCH] trace2: intercept all common signals Emily Shaffer
2024-05-10 17:57 ` Emily Shaffer
2024-05-10 18:47 ` Junio C Hamano
2024-05-10 19:34 ` Emily Shaffer
2024-05-10 19:46 ` Jeff King
2024-05-10 19:49 ` Emily Shaffer
2024-05-10 20:05 ` Jeff King
2024-05-10 20:34 ` Junio C Hamano [this message]
2024-05-10 22:20 ` Jeff King
2024-05-10 19:41 ` Jeff King
2024-05-13 16:21 ` Emily Shaffer
2024-05-16 7:11 ` Jeff King
2024-05-16 16:32 ` Junio C Hamano
2024-05-23 9:36 ` Jeff King
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqle4h4d99.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@jeffhostetler.com \
--cc=git@vger.kernel.org \
--cc=nasamuffin@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).