From: Junio C Hamano <gitster@pobox.com>
To: "Mark C. Chu-Carroll via B4 Relay"
<devnull+markchucarroll.fastmail.com@kernel.org>
Cc: git@vger.kernel.org,
"Mark C. Chu-Carroll" <markchucarroll@fastmail.com>
Subject: Re: [PATCH 1/2] Update shell tests to use semantic functions
Date: Fri, 04 Sep 2026 19:17:10 -0700 [thread overview]
Message-ID: <xmqq1pb830ih.fsf@gitster.g> (raw)
In-Reply-To: <20260904-file-tests-use-shell-functions-v1-1-b66f9cb4adbe@fastmail.com> (Mark C. Chu-Carroll via's message of "Fri, 04 Sep 2026 16:35:52 -0400")
"Mark C. Chu-Carroll via B4 Relay"
<devnull+markchucarroll.fastmail.com@kernel.org> writes:
> - if test_have_prereq MINGW && test -f /proc/$shell_pid/winpid
> + if test_have_prereq MINGW && test_path_is_file /proc/$shell_pid/winpid
This is Wrong.
First think what the point of "test_path_is_file" and other helpers
is. Once you understood them, you would never write them as part of
conditional expressions like the above one.
A conditional statement like this "if" does *not* want to shout when
the test condition it used to switch between its "then" (and "else"
if it has it) is not satisfied. If this "test -f" does not find the
named /proc/$shell_pid/winpid file, it does not mean that we
detected a breakage in the system that is being tested.
After looking at a handful of hunks from the top of this patch, it
seems there are many more similarly wrong conversions among them
than a few that are good, and I won't look at the remainder of the
[1/2] or [2/2]. Sifting the two large patches that lack sign-off
that span across many files and finding salvageable bits is not
something I would spend my weekend on.
This kind of conversion first needs to understand what each
invocation of "test -X" is really trying to check and why.
Brain-less mechanical conversion is not sufficient and will produce
a wrong conversion like the above one.
next prev parent reply other threads:[~2026-09-05 2:17 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-04 20:35 [PATCH 0/2] Update tests to use semantic functions Mark C. Chu-Carroll via B4 Relay
2026-09-04 20:35 ` [PATCH 1/2] Update shell " Mark C. Chu-Carroll via B4 Relay
2026-09-05 2:17 ` Junio C Hamano [this message]
2026-09-07 12:10 ` Patrick Steinhardt
2026-09-04 20:35 ` [PATCH 2/2] Second batch of shell test migrations Mark C. Chu-Carroll via B4 Relay
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=xmqq1pb830ih.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=devnull+markchucarroll.fastmail.com@kernel.org \
--cc=git@vger.kernel.org \
--cc=markchucarroll@fastmail.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