From: Matthieu Moy Date: Thu, 31 May 2012 07:26:54 GMT Subject: Re: [PATCH] Possibility to read both from ~/.gitconfig and from $XDG_CONFIG_HOME/git/config Message-ID: In-Reply-To: <1338400955-22991-1-git-send-email-Huynh-Khoi-Nguyen.Nguyen@ensimag.imag.fr> Huynh Khoi Nguyen NGUYEN writes: > +$XDG_CONFIG_HOME/git/config:: > + Second user-specific configuration file. ~/.gitconfig has priority. You should mention the behavior if $XDG_CONFIG_HOME is not set. > + if (home) { > + const char *xdg_config_home = getenv("XDG_CONFIG_HOME"); > + if (xdg_config_home) > + xdg_global = xstrdup(mkpath("%s/git/config", xdg_config_home)); > + else > + xdg_global = xstrdup(mkpath("%s/.config/git/config", home)); Shouldn't there be a helper function to get the path ~/.config/git/ and then append config? You're already computing this path twice, and we'll need more instances of it if we want to give default values to core.excludesfile and core.attributesfile in this directory too. -- Matthieu Moy http://www-verimag.imag.fr/~moy/