Subject: Re: [PATCH 3/4 v8] Let core.attributesfile default to $XDG_CONFIG_HOME/git/ignore

From: Matthieu Moy <[email-masked]>
Date: Mon, 25 Jun 2012 08:32:28 +0200

Junio C Hamano <[email-masked]> writes:

> The patch text may be OK but look at the Subject: line and notice
> something funny ;-)

Nice catch.

> Given the root cause of that "something funny", I'll reduce the log
> message of this one down to:
>
>     Let core.attributesfile default to $XDG_CONFIG_HOME/git/attributes
>     
>     This gives the default value for the core.attributesfile variable
>     following the exact same logic of the previous change for the
>     core.excludesfile setting.
>     
>     Signed-off-by: Huynh Khoi Nguyen Nguyen <[email-masked]>
>     ...
>     Signed-off-by: Junio C Hamano <[email-masked]>

Good (I see you did the change yourself in pu).

> I am not sure about use of git/ignore in [2/2], though.
>
> Shouldn't the default value for core.excludesfile be git/exclude,
> not git/ignore?

Both are valid options, and unfortunately, Git currently use both
"ignore" and "exclude" to mean the same thing. 

I have a slight preference for "ignore", because this file is the
user-wide version of the .gitignore file. I think most non-advanced
users have already been exposed to the wording "ignore" with this file,
but much less have been exposed to "exclude" (for example, I don't
remember having ever used the per-directory .git/info/exclude). So,
going for "ignore" means that the wording used for the most common
operations will be consistant, and only relatively advanced users (who
use .git/info/exclude, or "git ls-files --exclude-standard", or need to
set core.excludesfile to some value other than the default) will need to
learn that "exclude" is synonym for "ignore" in the Git world.

Actually, it would even make sense to reduce the number of occurences of
"excludes" in the UI, e.g. support something like core.ignoresfile as an
alias for core.excludesfile, along the lines of:

--- a/config.c
+++ b/config.c
@@ -723,7 +723,7 @@ static int git_default_core_config(const char *var, const char *value)
        if (!strcmp(var, "core.askpass"))
                return git_config_string(&askpass_program, var, value);
 
-       if (!strcmp(var, "core.excludesfile"))
+       if (!strcmp(var, "core.excludesfile") || !strcmp(var, "core.ignoresfile"))
                return git_config_pathname(&excludes_file, var, value);
 
        if (!strcmp(var, "core.whitespace")) {

(which would off course require some documentation)

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/