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

[RFC] Possibility to have a per-user config directory

From
Nnguyenhu@minatec.inpg.fr <nguyenhu@minatec.inpg.fr>
Date
May 29, 2012, 23:50 UTC
Message-ID
<20120530015035.Horde.XJPMC3wdC4BPxWDLkXMByVA@webmail.minatec.grenoble-inp.fr>
Huynh Khoi Nguyen NGUYEN <nguyenhu@minatec.inpg.fr> writes:
Show 9 quoted lines
> Hello,
>
> As you know, git stores its configuration in ~/.gitconfig file and  
> in other >hidden files at the root of the user's directory.
>
> We would like to have a configuration directory instead of all these  
> >configuration files by following the XDG specification because:
> - not a lot of hidden files at the root, so better view
> - one directory per software in ~/.config
I update my suggestion.

As I said, I would like to propose to users the possibility to have an XDG configuration file, that's to say $XDG_CONFIG_HOME/git/config. If $XDG_CONFIG_HOME is either not set or empty, $HOME/.config/git/config will be used.

So now I will put forward 2 patches: one for reading, and one for writing.

Patch for reading: Git would read both in $XDG_CONFIG_HOME/git/config and in ~/.gitconfig in this order: .git/config > ~/.gitconfig > $XDG_CONFIG_HOME/git/config > /etc/gitconfig

Patch for writing:
Git would write its configuration in $XDG_CONFIG_HOME/git/config file if:
- this file exists,
- and ~/.gitconfig file doesn't.
Otherwise git would write its configuration in ~/.gitconfig as usual.

If you don't create $XDG_CONFIG_HOME/git/config, there is no change. I don't want to force users to have $XDG_CONFIG_HOME/git/config. I will write in documentation advice for users who often come back to an old version of Git, on different computers with the same $HOME, not to use $XDG_CONFIG_HOME/git/config for the time being. If they don't read documentation, they can't know possibility of $XDG_CONFIG_HOME/git/config.

I will send you the patch for reading before 24h. Then I will try to send you the patch for writing before 24h.

We will also send other patches to propose to users the possiblity to have easily $XDG_CONFIG_HOME/git/gitignore and $XDG_CONFIG_HOME/git/gitattributes.

Valentin DUPERRAY, Franck JONAS Lucien KONG, Thomas NGUY, Huynh Khoi Nguyen NGUYEN,

Grenoble INP ENSIMAG
Next: Victor Engmark
Message 1 of 2 in “[RFC] Possibility to have a per-user config directory”
  1. nguyenhu@minatec.inpg.frMay 29, 2012
  2. Victor EngmarkMay 30, 2012

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.