Re: [PATCH] Document disabling core.whitespace values trailing-space and space-before-tab

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: "Peter Valdemar Mørch (Lists)"
Date: Thursday, July 24, 2008 - 2:41 am

Actually, it gets stranger and stranger!

Nanako Shiraishi nanako3-at-lavabit.com |Lists| wrote:

First, git-config.1 does not mention gitattributes except for specific
settings. core.whitespace is not one of these.

gitattributes.5 has:

note that this is ! before the *name* of the attribute, and for 
"Checking whitespace errors / whitespace":

...

So now, git attributes says to unspecify a setting with '!' in front of
the attribute *name*, which for core.whitespace means use the value from
git-config, which if not specified means to error on e.g. trailing-space.

Now, I notice that git's own .gitattributes has this:

Which I assume actually works, but is invalid according to git-config.1 
and gitattributes.5 because:

For the first line, neither of the values 'indent', 'trail' nor 'space'
are valid for core.whitespace, and the '!' notation is not defined in
neither gitattributes.5 nor in git-config.1 for *values*.

For the second line, gitattributes states generally about attributes that:

A value of true (unspecified would have required:"*.[ch] !whitespace") 
is not valid for core.whitespace either.

So now (as I read it), neither git-config.1 nor gitattributes.5 specify 
how to turn off core.whitespace "elements", but .gitattributes (from git 
itself) uses one notation (!) with settings that are invalid for other 
reaons, while "grep core.whitespace t/*" uses another notation (-) to 
turn off elements.

Also in t/* the elements have various different names, such as: "trail", 
"trailing", "trailing-space". t/t4019-diff-wserror.sh also uses this:
just to make things interesting!

It seems that there is some inconsistency about this. Perhaps 
documentation (and changing t/* and .gitattributes accordingly) isn't 
such a bad idea! :D

Peter
-- 
Peter Valdemar Mørch
http://www.morch.com
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] Document disabling core.whitespace values trailing ..., "Peter Valdemar Mørc ..., (Wed Jul 23, 10:34 pm)
Re: [PATCH] Document disabling core.whitespace values trai ..., "Peter Valdemar Mørc ..., (Thu Jul 24, 2:41 am)
Re: [PATCH] Document disabling core.whitespace values trai ..., Peter Valdemar Mørch, (Thu Jul 24, 11:11 pm)
Re: [PATCH] Document disabling core.whitespace values trai ..., "Peter Valdemar Mørc ..., (Thu Jul 24, 11:13 pm)