From: Patrick Steinhardt <ps@pks.im>
To: Junio C Hamano <gitster@pobox.com>
Cc: Michael J Gruber <git@grubix.eu>, git@vger.kernel.org
Subject: Re: [BUG/WIP PATCH] unit-tests: use clean test environment
Date: Mon, 3 Mar 2025 11:33:21 +0100 [thread overview]
Message-ID: <Z8WFcaEtMCD5C0EN@pks.im> (raw)
In-Reply-To: <xmqqseny40kx.fsf@gitster.g>
On Fri, Feb 28, 2025 at 06:15:42AM -0800, Junio C Hamano wrote:
> Patrick Steinhardt <ps@pks.im> writes:
> > I suspect that most environment variables shouldn't matter (for now), so
> > overall the duplication may be acceptable:
> >
> > - We need to unset a couple of variables, but we can probably reuse
> > logic `git rev-parse --local-env-vars`.
> >
> > - We need to ask Git to not read the configuration, which we can do by
> > setting a couple of envvars. This should be manageable.
>
> "Provide a controlled environment where Git pretends this is the
> $HOME and that is the $AUTHOR_NAME and so on" is much more
> preferrable than "Tell it not to read", no?
Maybe. I guess for unit tests it's a lot less clear cut as most of the
tests won't depend on such a controlled environment. So sanitizing the
environment would be a good enough first step for me, and if we see
demand for making specific information available to lots of tests we
could still start to expose those at a later point.
Of course, if the author already wants to do both steps right now I
won't complain :)
Patrick
next prev parent reply other threads:[~2025-03-03 10:33 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 [this message]
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
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=Z8WFcaEtMCD5C0EN@pks.im \
--to=ps@pks.im \
--cc=git@grubix.eu \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.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).