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

Re: Bug report: GIT_CONFIG and user.email/name

From
Jeff King <peff@peff.net>
Date
Jul 14, 2021, 21:36 UTC
Message-ID
<YO9YyTZdU4WadYGg@coredump.intra.peff.net>
In-Reply-To
<xmqqeec0vczo.fsf@gitster.g>
On Wed, Jul 14, 2021 at 01:47:55PM -0700, Junio C Hamano wrote:
Show 21 quoted lines
> Jeff King <peff@peff.net> writes:
> 
> > The GIT_CONFIG variable doesn't work that way. It is not a general
> > mechanism used by all of Git, but rather a specific feature of the
> > git-config program (and even there it is a historical wart; you should
> > use "git config --file" instead).
> 
> We both have known that, but a fresh re-read of GIT_CONFIG in "git
> help config" gave me a misleading impression.
> 
>     ENVIRONMENT
>     -----------
> 
>     GIT_CONFIG::
>             Take the configuration from the given file instead of .git/config.
>             Using the "--global" option forces this to ~/.gitconfig. Using the
>             "--system" option forces this to $(prefix)/etc/gitconfig.
> 
> is what we have above the GLOBAL and SYSTEM you quoted below.  We
> should say GIT_CONFIG is only for "git config" command while the
> other two affects everybody, right?

Yes, it looks like that description is from 2007 (when GIT_CONFIG really did impact other commands). And adding GIT_CONFIG_GLOBAL and SYSTEM nearby certainly didn't help (before then, I might have argued that since GIT_CONFIG is only in git-config(1), it is more clear that it only applies there).

Here's a short series to improve things.
  [1/3]: doc/git-config: explain --file instead of referring to GIT_CONFIG
  [2/3]: doc/git-config: clarify GIT_CONFIG environment variable
  [3/3]: doc/git-config: simplify "override" advice for FILES section
 Documentation/git-config.txt | 28 +++++++++++++++++-----------
 1 file changed, 17 insertions(+), 11 deletions(-)
-Peff
Previous: Junio C HamanoNext: Jeff King
Message 5 of 16 in “Bug report: GIT_CONFIG and user.email/name”
  1. German LashevichJul 14, 2021
  2. Jeff KingJul 14, 2021
  3. German LashevichJul 14, 2021
  4. Junio C HamanoJul 14, 2021
  5. Jeff KingJul 14, 2021
  6. 1/3 doc/git-config: explain --file instead of referring to GIT_CONFIGJeff King, Jul 14, 2021
  7. Taylor BlauJul 14, 2021
  8. Jeff KingJul 14, 2021
  9. Taylor BlauJul 14, 2021
  10. Martin ÅgrenJul 20, 2021
  11. Jeff KingJul 20, 2021
  12. Jeff KingJul 20, 2021
  13. Junio C HamanoJul 20, 2021
  14. 2/3 doc/git-config: clarify GIT_CONFIG environment variableJeff King, Jul 14, 2021
  15. 3/3 doc/git-config: simplify "override" advice for FILES sectionJeff King, Jul 14, 2021
  16. Taylor BlauJul 14, 2021

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.