git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] config: use GIT_CONFIG in git config sequence

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 26, 2020, 21:16 UTC
Message-ID
<xmqqwo627xsd.fsf@gitster.c.googlers.com>
In-Reply-To
<8992c1a7-a638-e823-1cb7-2c8f6b28d486@iee.email>
Philip Oakley <philipoakley@iee.email> writes:
> Mateusz's original problem was with discovery of these env variables,...
I somehow doubt it.  

Certainly, defeating /etc/gitconfig should be a part of the solution to the "I want a stable environment to run tests reproducibly, without getting affected by random settings the testing user may get affected" problem. It is not enough to defeat $HOME/.gitconfig (and its xdg variant).

But I didn't get the feeling that Mateusz was even aware of the need to defeat the system wide configuration; Mateusz only mentioned and cared about $HOME/.gitconfig (and its xdg variant).

And the thing is that we do have support for an environment variable to defeat the system-wide configuration (GIT_CONFIG_NOSYSTEM), but discovering it would not have been sufficient to solve the "stable environment for reproducible tests" problem, as we do not have an environment variable to defeat the global (i.e. per user) one.

So, I do not think the problem was with discovery at all. The problem was two levels deep, (1) not realizing the need to defeat the system wide settings (for which the environment may have been a good solution once the need to solve that problem got recognised), and (2) not realizing the need to redirect $HOME for programs other than git, hence omitting $HOME/.gitconfig from the sequence is not a sufficient solution.

Having said all that, I addition of GIT_CONFIG_NOGLOBAL (or GIT_CONFIG_NOUSER) may not be such a bad thing. We probably will add GIT_CONFIG_NOLOCAL (or GIT_CONFIG_NOREPOSITORY) to complement these two if that happens. I dunno.

Previous: Philip OakleyNext: Junio C Hamano
Message 12 of 14 in “config: use GIT_CONFIG in git config sequence”
  1. config: use GIT_CONFIG in git config sequenceMateusz Nowotyński, Apr 25, 2020
  2. Junio C HamanoApr 26, 2020
  3. Philip OakleyApr 26, 2020
  4. Mateusz NowotyńskiApr 26, 2020
  5. brian m. carlsonApr 26, 2020
  6. Mateusz NowotynskiApr 27, 2020
  7. Junio C HamanoApr 26, 2020
  8. Matt RogersApr 26, 2020
  9. Philip OakleyApr 26, 2020
  10. Matt RogersApr 26, 2020
  11. Philip OakleyApr 26, 2020
  12. Junio C HamanoApr 26, 2020
  13. Junio C HamanoApr 26, 2020
  14. Mateusz NowotynskiApr 27, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.