{"thread":{"id":"30648","subject":"[RFC] Possibility to have a per-user config directory","startedAt":"2012-05-29T23:50:35Z","lastAt":"2012-05-30T11:49:37Z","messageCount":2,"participants":["nguyenhu@minatec.inpg.fr","Victor Engmark"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"192452","messageId":"20120530015035.Horde.XJPMC3wdC4BPxWDLkXMByVA@webmail.minatec.grenoble-inp.fr","threadId":"30648","inReplyTo":null,"subject":"[RFC] Possibility to have a per-user config directory","fromName":"","fromEmail":"nguyenhu@minatec.inpg.fr","sentAt":"2012-05-29T23:50:35Z","receivedAt":"2012-05-29T23:50:35Z","isPatch":false,"sender":{"key":"nguyenhu@minatec.inpg.fr","avatar":null},"body":"\nHuynh Khoi Nguyen NGUYEN <nguyenhu@minatec.inpg.fr> writes:\n> Hello,\n>\n> As you know, git stores its configuration in ~/.gitconfig file and  \n> in other >hidden files at the root of the user's directory.\n>\n> We would like to have a configuration directory instead of all these  \n> >configuration files by following the XDG specification because:\n> - not a lot of hidden files at the root, so better view\n> - one directory per software in ~/.config\n\nI update my suggestion.\n\nAs I said, I would like to propose to users the possibility to have an  \nXDG configuration file, that's to say $XDG_CONFIG_HOME/git/config. If  \n$XDG_CONFIG_HOME is either not set or empty, $HOME/.config/git/config  \nwill be used.\n\nSo now I will put forward 2 patches: one for reading, and one for writing.\n\nPatch for reading:\nGit would read both in $XDG_CONFIG_HOME/git/config and in ~/.gitconfig  \nin this order:\n.git/config > ~/.gitconfig > $XDG_CONFIG_HOME/git/config > /etc/gitconfig\n\nPatch for writing:\nGit would write its configuration in $XDG_CONFIG_HOME/git/config file if:\n- this file exists,\n- and ~/.gitconfig file doesn't.\nOtherwise git would write its configuration in ~/.gitconfig as usual.\n\nIf you don't create $XDG_CONFIG_HOME/git/config, there is no change.\nI don't want to force users to have $XDG_CONFIG_HOME/git/config.\nI will write in documentation advice for users who often come back to  \nan old version of Git, on different computers with the same $HOME, not  \nto use $XDG_CONFIG_HOME/git/config for the time being. If they don't  \nread documentation, they can't know possibility of  \n$XDG_CONFIG_HOME/git/config.\n\nI will send you the patch for reading before 24h.\nThen I will try to send you the patch for writing before 24h.\n\nWe will also send other patches to propose to users the possiblity to  \nhave easily $XDG_CONFIG_HOME/git/gitignore and  \n$XDG_CONFIG_HOME/git/gitattributes.\n\nValentin DUPERRAY,\nFranck JONAS\nLucien KONG,\nThomas NGUY,\nHuynh Khoi Nguyen NGUYEN,\n\nGrenoble INP ENSIMAG\n"},{"id":"192480","messageId":"CAA5Ydx9u_nckv8MHXLhKR2JwCgptJq81vXpaHsA1Hqvb4Enuqg@mail.gmail.com","threadId":"30648","inReplyTo":"20120530015035.Horde.XJPMC3wdC4BPxWDLkXMByVA@webmail.minatec.grenoble-inp.fr","subject":"Re: [RFC] Possibility to have a per-user config directory","fromName":"Victor Engmark","fromEmail":"victor.engmark@gmail.com","sentAt":"2012-05-30T11:49:37Z","receivedAt":"2012-05-30T11:49:37Z","isPatch":false,"sender":{"key":"victor.engmark@gmail.com","avatar":"https://gravatar.com/avatar/5d7b4229a48f2ed011a265c19a1881c4ee58946449215db6627373a244c8aa4c?d=mp&s=160"},"body":"On Wed, May 30, 2012 at 1:50 AM,  <nguyenhu@minatec.inpg.fr> wrote:\n> Patch for writing:\n> Git would write its configuration in $XDG_CONFIG_HOME/git/config file if:\n> - this file exists,\n> - and ~/.gitconfig file doesn't.\n> Otherwise git would write its configuration in ~/.gitconfig as usual.\n\nMinor suggestion: Write to $XDG_CONFIG_HOME/git/config if:\n- $XDG_CONFIG_HOME/git exists (and therefore is planned for use even\nif there is no config file within)\n- [etc. as before]\n\nCheers,\nVictor\n"}]}