{"thread":{"id":"30667","subject":"Re: [PATCHv2] Possibility to read both from ~/.gitconfig and from $XDG_CONFIG_HOME/git/config","startedAt":"2012-05-31T08:46:34Z","lastAt":"2012-05-31T08:46:34Z","messageCount":1,"participants":["nguyenhu@minatec.inpg.fr"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"192547","messageId":"20120531104634.Horde.MtY_VHwdC4BPxy-qPK1XmXA@webmail.minatec.grenoble-inp.fr","threadId":"30667","inReplyTo":null,"subject":"Re: [PATCHv2] Possibility to read both from ~/.gitconfig and from $XDG_CONFIG_HOME/git/config","fromName":"","fromEmail":"nguyenhu@minatec.inpg.fr","sentAt":"2012-05-31T08:46:34Z","receivedAt":"2012-05-31T08:46:34Z","isPatch":false,"sender":{"key":"nguyenhu@minatec.inpg.fr","avatar":null},"body":"\nJunio C Hamano <gitster@pobox.com> wrote:\n> Is it just me who finds the above three lines extremely unreadable?\n>\n> Also can you give this patch a bit more sensible title?\n> \"Possibility to\" does not tell us much---anything is possible if you\n> change code after all.\n>\n> I see the patch does not touch the writing codepath, which is\n> probably a good thing, but the log message should explicitly state\n> that.\n\nI will change that in my next version.\n\n> I am not sure in what way $HOME/.gitconfig has \"priority\".\n>\n> Your proposed log message says that You read from $HOME/.gitconfig\n> and then from $XDG_CONFIG_HOME/git/config, which means that any\n> single-valued variable set in $HOME/.gitconfig will be overwritten\n> by whatever is in $XDG_CONFIG_HOME/git/config, no?  That sounds like\n> you are giving priority to the latter to me.\n\nYou are right. Git takes into account $HOME/.gitconfig if one variable  \nis defined in both configuration files. I will explains that more  \nclearly in documentation.\n\n> The original that read from $HOME/.gitconfig was simple enough so\n> having three copies of getenv(\"HOME\") was perfectly fine, but as you\n> are introduce this much complexity to to decide which two files to\n> read from, the code added this patch needs to be refactored and\n> three copies of the same logic need to be consolidated, I would have\n> to say.\n\nMatthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:\n> Shouldn't there be a helper function to get the path ~/.config/git/\n> and then append config? You're already computing this path twice, and\n> we'll need more instances of it if we want to give default values to\n> core.excludesfile and core.attributesfile in this directory too.\n\nI agree. I will write a function to get ~/.config/git/ and refactor code.\n"}]}