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
Yaroslav Halchenko <yoh@onerussian.com>
Date
Dec 13, 2017, 14:23 UTC
Message-ID
<20171213142334.oy2uvkamho4whspj@hopa.kiewit.dartmouth.edu>
In-Reply-To
<CA+P7+xqR0C_Z5fJFdSBvzqCT=LU-mK0cdtaqJ=6TH5Ty60PQrg@mail.gmail.com>
On Tue, 12 Dec 2017, Jacob Keller wrote:
> > And then "and the other files will not be read" can be dropped from
> > the first sentence of this paragraph?
Show 5 quoted lines
> > Yaroslav on the original thread mentioned that reading codepath
> > without --file or --global does not limit to one of the three, and
> > this section is about "If not set explicitly with `--file`", so we'd
> > need to make sure if the above is what happens in reality (or update
> > the proposed clarification to match the reality).
> I'm pretty sure it does not read XDG_CONFIG_HOME unless ~/.gitconfig
> is missing. I tried a few things, but it was 2am for me, so I may be
> mis-remembering.
It always read it for non--global

$> ( HOME=/tmp/HOME; rm -rf $HOME; mkdir -p $HOME/.config/git; echo -e "[user]\n name=home" > $HOME/.gitconfig; echo -e "[user]\n name=xdg\n name2=xdg2" > $HOME/.config/git/config; git config user.name; git config user.name2; ) home xdg2

and it doesn't read it for --global

$> ( HOME=/tmp/HOME; rm -rf $HOME; mkdir -p $HOME/.config/git; echo -e "[user]\n name=home" > $HOME/.gitconfig; echo -e "[user]\n name=xdg\n name2=xdg2" > $HOME/.config/git/config; git config --global user.name; git config --global user.name2; ) home

unless ~/.gitconfig is missing

$> ( HOME=/tmp/HOME; rm -rf $HOME; mkdir -p $HOME/.config/git; echo -e "[user]\n name=xdg\n name2=xdg2" > $HOME/.config/git/config; git config --global user.name; git config --global user.name2; ) xdg xdg2

-- 
Yaroslav O. Halchenko
Center for Open Neuroscience     http://centerforopenneuroscience.org
Dartmouth College, 419 Moore Hall, Hinman Box 6207, Hanover, NH 03755
Phone: +1 (603) 646-9834                       Fax: +1 (603) 646-1419
WWW:   http://www.linkedin.com/in/yarik        
Previous: Jacob KellerNext: Junio C Hamano
Message 6 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.