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