From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: Patrick Steinhardt <ps@pks.im>, Michael J Gruber <git@grubix.eu>,
git@vger.kernel.org
Subject: Re: [BUG/WIP PATCH] unit-tests: use clean test environment
Date: Tue, 04 Mar 2025 07:54:57 -0800 [thread overview]
Message-ID: <xmqq34fsu6y6.fsf@gitster.g> (raw)
In-Reply-To: <20250304083337.GB1297837@coredump.intra.peff.net> (Jeff King's message of "Tue, 4 Mar 2025 03:33:37 -0500")
Jeff King <peff@peff.net> writes:
>> Oh, yes. I didn't mean to say we shouldn't sanitize at all, I rather
>> meant to say we should sanitize to values that simply cause us to do a
>> no-op in the relevant parts. That means we'd:
>>
>> - Unset a bunch of environment variables where we know that they
>> impact Git.
>>
>> - Set config-related environment variables to read configuration
>> from "/dev/null".
>>
>> This is in contrast to the more involved fix here, which would be to
>> populate a temporary home directory with gitconfig files and whatnot.
>
> OK. I still think you'd want to set GIT_COMMITTER_NAME (to avoid gecos
> dependencies).
>
> And I'm assuming your "a bunch of environment variables where we know
> that they impact Git" includes $HOME, since we are inheriting
> dependencies from sub-programs. It doesn't necessarily have to point
> somewhere useful, though I wouldn't be surprised if some programs
> complain if they can't write to it.
I guess eventually we will come full circle and need to sanitize
pretty much the same set of environments as t/test-lib.sh does?
prev parent reply other threads:[~2025-03-04 15:55 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-25 20:48 [BUG/WIP PATCH] unit-tests: use clean test environment Michael J Gruber
2025-02-28 10:50 ` Patrick Steinhardt
2025-02-28 14:15 ` Junio C Hamano
2025-03-03 10:33 ` Patrick Steinhardt
2025-03-03 10:49 ` Michael J Gruber
2025-03-03 14:07 ` Junio C Hamano
2025-03-04 7:30 ` Jeff King
2025-03-04 7:39 ` Patrick Steinhardt
2025-03-04 8:33 ` Jeff King
2025-03-04 15:54 ` Junio C Hamano [this message]
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=xmqq34fsu6y6.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@grubix.eu \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
--cc=ps@pks.im \
/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).