From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: Eric Sunshine <sunshine@sunshineco.com>
Cc: git@vger.kernel.org, Derrick Stolee <stolee@gmail.com>,
Johannes Schindelin <Johannes.Schindelin@gmx.de>
Subject: Re: [PATCH v2 0/2] make macOS `git maintenance` test work on Windows
Date: Mon, 30 Nov 2020 10:20:00 +0100 [thread overview]
Message-ID: <87blffjkne.fsf@evledraar.gmail.com> (raw)
In-Reply-To: <20201130044224.12298-1-sunshine@sunshineco.com>
On Mon, Nov 30 2020, Eric Sunshine wrote:
> v2 makes the macOS-specific test in t7900 UID-agnostic, as suggested by
> Ævar[2], thus the patch which added `test-tool getuid` has been dropped.
LGTM. FWIW I think your v1 is fine too, just meant to comment on the
basis of "you could also do it like that". Having a C program call
getuid() is fine, so is faking it. If you prefer the latter, cool.
As an aside and just because this is fresh in my mind, not really
relevant to this patch as-such:
I did wonder "why not just call perl -e 'print $<' ?" first. But then
found (by reading the Perl source[1], didn't actually test this) that it
fakes up UID=0 for everything on Windows.
I couldn't find any "is root?" in our tree that relies on Perl's $< in a
bad way (the couuple of occurances seem innocuous), we have some "id -u"
checks, but those also seem OK if it returned 0 on Windows (what does it
return?). Seems the worst we'd do there is unintentionally skip some
"skip this as root" tests.
Also as another aside (but your patch is fine as it is), my suggestion
used Perl+Perl RX but you switched it to sed+BRE. Do we want to avoid
"sed -E"? I wondered that for something else the other day, we have
this:
t/check-non-portable-shell.pl: /\bsed\s+-[^efn]\s+/ and err 'sed option not portable (use only -n, -e, -f)';
So maybe it means "nothing but -nef, or maybe "don't use -efn". The ERE
(-E and -r) options aren't mentioned, and a naïve log search of of "sed
-E" and "sed -r" in t/ returns nothing.
It's also my impression that just using $("$PERL_PATH" -e ...) is fine,
and at least to my reading the Perl RX is more readable with look-behind
assertions, but I'm biased by familiarity with it.
Our PERL prereq & NO_PERL=YesPlease is just for "this may require a
non-ancient Perl" & "don't install Perl for runtime stuff"
respectively. Is that not the case and we'd like to avoid new perl
invocations where possible?
I don't really care either way (or, if your switch in this case was just
a personal preference, also fine), but if we are trying to somewhat
discourage perl use (and maybe eventually get rid of it entirely) that
would be a useful t/README doc update.
I know Johannes (CC'd) has (this is from wetware memory) wanted to
(understandably) not need to bother with Perl as part of GFW, but I
can't remember if that's for a reason covered by NO_PERL=YesPlease,
i.e. packaging it up, or whether it's also to not wanting to provide a
perl for the test suite.
1. https://github.com/Perl/perl5/blob/v5.33.4/win32/win32.c#L1079-L1092
next prev parent reply other threads:[~2020-11-30 9:20 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-30 4:42 [PATCH v2 0/2] make macOS `git maintenance` test work on Windows Eric Sunshine
2020-11-30 4:42 ` [PATCH v2 1/2] t7900: fix test failures when invoked individually via --run Eric Sunshine
2020-11-30 4:42 ` [PATCH v2 2/2] t7900: make macOS-specific test work on Windows Eric Sunshine
2020-11-30 13:12 ` Derrick Stolee
2020-12-01 3:03 ` Eric Sunshine
2020-11-30 9:20 ` Ævar Arnfjörð Bjarmason [this message]
2020-11-30 23:32 ` [PATCH v2 0/2] make macOS `git maintenance` " Junio C Hamano
2020-12-01 3:58 ` Eric Sunshine
2020-12-01 12:31 ` Johannes Schindelin
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=87blffjkne.fsf@evledraar.gmail.com \
--to=avarab@gmail.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
--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).