"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Thomas Adam <thomas@xteddy.org>
Subject:
Re: regress: unset HOME for 'git init'
To:
gameoftrees@openbsd.org
Date:
Fri, 15 Aug 2025 13:37:01 +0100

Download raw body.

Thread
On Fri, Aug 15, 2025 at 02:27:54PM +0200, Stefan Sperling wrote:
> On Fri, Aug 15, 2025 at 01:04:34PM +0100, Thomas Adam wrote:
> > Hi,
> > 
> > When running regress, there's a potential that the "git init" command could
> > implicitly use ~/.gitconfig -- this has consequences for us, since this file
> > could affect the created git repo.
> > 
> > Specifically though, it's possible that the default branch name could be
> > anything, rather than what we want it to be -- which should be to match the
> > default for git(1).  Although this is still marked as a TODO item in
> > regress/cmdline/common.sh -- I think for now, explicitly making git(1) think
> > there's no ~/.gitconfig is the way to go -- we can address any specific git
> > issues we want to set (such as the default branch name) at a later date.
> > 
> > OK?
> 
> I would suggest to set GIT_CONFIG_GLOBAL and GIT_CONFIG_SYSTEM to /dev/null,
> rather than unsetting HOME. And we should probably do this across the entire
> test suite, not just during 'git init'.

OK

--- a/regress/cmdline/common.sh
+++ b/regress/cmdline/common.sh
@@ -20,6 +20,8 @@ export GIT_AUTHOR_NAME="Flan Hacker"
 export GIT_AUTHOR_EMAIL="flan_hacker@openbsd.org"
 export GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME"
 export GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL"
+export GIT_CONFIG_GLOBAL="/dev/null"
+export GIT_CONFIG_SYSTEM="/dev/null"

I had to clean up some caching.  The above seems fine to work.

-- Thomas