From: Mark Mentovai <mark@chromium.org>
To: Eric Sunshine <sunshine@sunshineco.com>
Cc: Git Development <git@vger.kernel.org>,
Derrick Stolee <stolee@gmail.com>,
Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH] t7900: use pwd -P in macOS maintenance test
Date: Fri, 23 May 2025 16:43:40 -0400 (EDT) [thread overview]
Message-ID: <88e8231f-7c08-652d-f734-22c4632aa728@chromium.org> (raw)
In-Reply-To: <CAPig+cRpS=t-wNLxdV_WoKF0Wzy-S1oLUEyS18S9r-4OBQ87VQ@mail.gmail.com>
Eric Sunshine wrote:
> However, have you tested this on Windows?
Yes, via the CI:
https://github.com/markmentovai/git/actions/runs/15217563313.
> I ask because, despite the
> test's name, this and most of the tests in this script, are actually
> run on all platforms, and because `pwd` is overridden by a shell
> function for MinGW on Windows:
>
> # t/test-lib.sh
> ...
> # git sees Windows-style pwd
> pwd () {
> builtin pwd -W
> }
That MinGW fallback pwd ignores arguments, so any pwd in a test regardless
of whether it's specified as pwd or pwd -P will result in an underlying
pwd -W. The t7900 test's behavior should not change as a result of this
patch. If it's succeeding in some MinGW environment before this patch,
it'll continue to succeed after.
> My quick testing suggests that this patch's change might be problematic:
>
> # on Windows
> $ pwd
> /home/me
> $ pwd -W
> C:/msys64/home/me
> $ pwd -P
> /home/me
> $ pwd -W -P
> /home/me
>
> FOOTNOTES
>
> [*]: In the long run, a better fix would probably be for the tests to
> sanitize the output of the Git command, replacing (via `sed`) the
> actual emitted path with some placeholder, such as "%HOME%" or
> something, and then have the tests look for (`grep` or whatnot)
> needles using that literal placeholder rather than trying to perfectly
> match the path emitted by Git. This approach makes sense since these
> tests are about overall functionality of git-maintenance, not about
> the specific path in which the person happens to be running the tests.
The specific front of the path is not important, but the tail should be as
expected, and I suspect that it remains much less fragile and complex to
perform this equality comparison than it would be to try to reason about
the path's inner components.
The existing print-args in this test could be modified as you propose, but
the changes would also need to spill into the "start and stop when several
schedulers are available" test later in the same file. That seems more
invasive and produces less clear test code than just calculating a path
expectation in line with what git maintenance uses in the first place.
next prev parent reply other threads:[~2025-05-23 20:43 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-23 19:37 [PATCH] t7900: use pwd -P in macOS maintenance test Mark Mentovai
2025-05-23 20:08 ` Eric Sunshine
2025-05-23 20:42 ` Junio C Hamano
2025-05-23 21:24 ` Eric Sunshine
2025-05-23 21:51 ` Junio C Hamano
2025-05-24 4:39 ` Mark Mentovai
2025-05-27 17:19 ` Junio C Hamano
2025-05-23 20:43 ` Mark Mentovai [this message]
2025-05-23 21:36 ` Eric Sunshine
2025-05-28 20:17 ` [PATCH v2] t: run tests from a normalized working directory Mark Mentovai
2025-05-28 23:08 ` Torsten Bögershausen
2025-05-30 5:04 ` Junio C Hamano
2025-05-31 5:46 ` Torsten Bögershausen
2025-06-01 16:38 ` Junio C Hamano
2025-06-02 16:08 ` Mark Mentovai
2025-06-02 21:32 ` Junio C Hamano
2025-06-03 5:02 ` Torsten Bögershausen
2025-06-03 13:15 ` Mark Mentovai
2025-06-03 18:22 ` Junio C Hamano
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=88e8231f-7c08-652d-f734-22c4632aa728@chromium.org \
--to=mark@chromium.org \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=stolee@gmail.com \
--cc=sunshine@sunshineco.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).