threads / rfc / 30648

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

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

## tl;dr

2 messages between May 29, 2012 and May 30, 2012.

replies: 1people: 2as markdown or json

nguyenhu@minatec.inpg.fr· May 29, 2012, 23:50 UTC · lore
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
Victor Engmark· May 30, 2012, 11:49 UTC · re: nguyenhu@minatec.inpg.fr · lore

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

On Wed, May 30, 2012 at 1:50 AM,  <nguyenhu@minatec.inpg.fr> wrote:
Show 5 quoted lines
> 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.
Minor suggestion: Write to $XDG_CONFIG_HOME/git/config if:
- $XDG_CONFIG_HOME/git exists (and therefore is planned for use even
if there is no config file within)
- [etc. as before]

Cheers, Victor

← back to recent threads