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

Re: git makes it impossible to ignore or override global gitconfig, needs `GITCONFIGFILE`

From
Jeff King <peff@peff.net>
Date
Mar 20, 2020, 05:41 UTC
Message-ID
<20200320054101.GF499858@coredump.intra.peff.net>
In-Reply-To
<CANri+EzrP0TeHTfjhsf=LZkwkEZU7fSRnnKN9NLga7CNow9F0Q@mail.gmail.com>
On Thu, Mar 19, 2020 at 07:28:58PM -0700, Timothee Cour wrote:
> * require passing commands (eg `git -c`) is not good either; it'd
> require updating scripts that rely on git (this could be arbitrarily
> complex, sometimes impossible if you just have a binary and no source
> code access)

Well, yes, that's why I suggested setting $GIT_CONFIG_PARAMETERS directly. :)

That said, I don't have any real opposition to an environment variable to override the user-level config location, if somebody wants to work up a patch. A few preliminary thoughts:

 - there are several levels of config file, so it probably should be
   called GIT_GLOBAL_CONFIG or something to make it clear that it
   matches "config --global" (and not system or repo-level config)
 - we'll read user-level config from multiple sources currently:
   ~/.gitconfig and the xdg config dir. Presumably this would override
   them rather than add to them to be of any use.
 - I wondered for a moment if such a variable would need to be added to
   local_repo_env[] to get cleared when moving between repos. But as a
   user-level thing, it should be outside that.
-Peff
Previous: Timothee Cour
Message 5 of 5 in “git makes it impossible to ignore or override global gitconfig, needs `GITCONFIGFILE`”
  1. Timothee CourMar 19, 2020
  2. Eric WongMar 19, 2020
  3. Jeff KingMar 19, 2020
  4. Timothee CourMar 20, 2020
  5. Jeff KingMar 20, 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.