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

Re: [PATCH] doc: clarify usage of XDG_CONFIG_HOME config file

From
Todd Zullinger <tmz@pobox.com>
Date
Dec 12, 2017, 15:20 UTC
Message-ID
<20171212152009.GS3693@zaya.teonanacatl.net>
In-Reply-To
<1513077862-165-1-git-send-email-jacob.keller@gmail.com>
Hi Jacob,
Jacob Keller wrote:
Show 13 quoted lines
> The documentation for git config and how it reads the user specific
> configuration file is misleading. In some places it implies that
> $XDG_CONFIG_HOME/git/config will always be read. In others, it implies
> that only one of ~/.gitconfig and $XDG_CONFIG_HOME/git/config will be
> read.
> 
> Improve the documentation explaining how the various configuration files
> are read, and combined.
> 
> Instead of referencing each file individually, reference each type of
> location git will check. When discussing the user configuration, explain
> how we switch between one of three choices. Ensure to note that only one
> of the three choices is used.

Perhaps it would read a little easier as "Make it clear ..." rather than "Ensure to note that ..." ?

> +Note that git will only ever use one of these files as the global user
> +configuration file at once. Additionally if you sometimes use an older version
> +of git, it is best to only rely on `~/.gitconfig` as support for the others was
> +added fairly recently.

Is it really accurate to say these were added fairly recently? It looks like XDG_CONFIG_HOME was added in 21cf322791 ("config: read (but not write) from $XDG_CONFIG_HOME/git/config file", 2012-06-22) and 0e8593dc5b ("config: write to $XDG_CONFIG_HOME/git/config file when appropriate", 2012-06-22) which are in 1.7.12.

Would it be better to say something like "if you sometimes use a version of git prior to 1.7.12" here?

Or maybe we can drop "Additionally ..." altogether now? Someone using a 5 year old git version sometimes will hopefully know to check the documentation for that older version.

-- 
Todd
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Now don't say you can't swear off drinking; it's easy. I've done it a
thousand times.
    -- W.C. Fields
Previous: Jacob KellerNext: Jacob Keller
Message 2 of 7 in “doc: clarify usage of XDG_CONFIG_HOME config file”
  1. doc: clarify usage of XDG_CONFIG_HOME config fileJacob Keller, Dec 12, 2017
  2. Todd ZullingerDec 12, 2017
  3. Jacob KellerDec 13, 2017
  4. Junio C HamanoDec 12, 2017
  5. Jacob KellerDec 13, 2017
  6. Yaroslav HalchenkoDec 13, 2017
  7. Junio C HamanoDec 13, 2017

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.