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

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

From
MNMateusz Nowotyński <maxmati4@gmail.com>
Date
Apr 26, 2020, 19:32 UTC
Message-ID
<5c1005a7-273e-fab0-0d0d-78bd0d3d13f6@gmail.com>
In-Reply-To
<xmqq5zdn9k3r.fsf@gitster.c.googlers.com>
On Sat, Apr 25, 2020 at 05:16:56PM -0700, Junio C Hamano wrote:
> Mateusz Nowotyński <maxmati4@gmail.com> writes:
>
> > Currently, there is no way to use config file other then
~/.gitconfig.
> > This can cause a problem, for example, when running tests of
software that
> > depends on git. In such a case user's gitconfig may contain settings
that
> > are incompatible with tests.
>
> While I can remotely imagine how an environment variable that
> overrides everything might be useful at times, we already use
> GIT_CONFIG environment for a different purpose, so even if such a
> feature were desirable, the name is already taken, and you'd want to
> hunt for another one.  Also, I do not think I'll take this patch if
> the justification were solely the above, as it is a solved problem,
> together with the use of GIT_CONFIG_NOSYSTEM and GIT_ATTR_NOSYSTEM.
Agreed that we shouldn't reuse GIT_CONFIG but as you said, before huntig
for new name we should decide if we want this at all. As far as I know
GIT_CONFIG_NOSYSTEM only allows to ignore system wide config file stored

in /etc not one in the user home directory (~/.gitconfig). Is there any way

to achive it that I'm not aware of (other then overwriting HOME variable)?

Or maybe you would like more to add something like GIT_CONFIG_NOUSER to
just ignore this file?
>
> Tests of a software that depends on git, and perhaps other things,
> will be affected in things under the testing user's home directory,
> and not just ~/.gitconfig file.  Providing stable environment to run
> in to your tests is a useful thing to do, but it is not a viable or
> a particularly smart strategy for doing so to tweak each and every
> software that your software may depend on, and your software itself,
> with a custom change like this patch.
Problem that we are facing is that if developer has git configured to
sign commits using, for example, yubikey he has to touch it on each
commit that makes tests unusable.
> You can prepare a pretend-home directory for the use of your tests
> and point the environment variable $HOME to it while running your
> tests.  See how we do this in our test suite for inspiration---it
> all happens in t/test-lib.sh, I think.
>
This is what we do currently but the problem with this solution is that
it breaks other software that also uses HOME as base path for their
data. For example asdf version manager.
> Thanks.
>
Regards,
Mateusz
Previous: Philip OakleyNext: brian m. carlson
Message 4 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.