# "man gitattributes" doesn't explain comma-separated attribute values

7 messages from 2019-03-16 to 2019-03-18. Participants: Robert P. J. Day, Ævar Arnfjörð Bjarmason, Johannes Sixt, Philip Oakley.
Thread: https://gitlist.dev/t/50757

## Robert P. J. Day, 2019-03-16 12:22

Subject: "man gitattributes" doesn't explain comma-separated attribute values
Message-ID: <alpine.LFD.2.21.1903160816410.10724@localhost.localdomain>
URL: https://gitlist.dev/e/alpine.LFD.2.21.1903160816410.10724%40localhost.localdomain

```

  more nitpicking, but i'm working my way through the intricacies of
attributes and putting together some (allegedly) simple examples for a
class i'm giving on monday, and i noted a couple possible shortcomings
in "man gitattributes".

  as a working example, i looked at the top-level .gitattributes file
in the git source code itself, which opens with:

  * whitespace=!indent,trail,space
  *.[ch] whitespace=indent,trail,space diff=cpp
  *.sh whitespace=indent,trail,space eol=lf
  ... snip ...

first observation is that i see nothing in the man page that explains
the notion of a comma-separated list of attribute values. maybe i
missed it or maybe it's supposed to be intuitively obvious, but
there's nothing i can see that mentions the possibility.

  related to that is that there is no explanation as to how to
interpret:

  * whitespace=!indent,trail,space

does the "!" apply to "indent" or to the entire list? the man page
doesn't say.

  just being pedantic again.

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                  http://crashcourse.ca/dokuwiki

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================

```

## Ævar Arnfjörð Bjarmason, 2019-03-16 13:13

Subject: Re: "man gitattributes" doesn't explain comma-separated attribute values
Message-ID: <87r2b79d3p.fsf@evledraar.gmail.com>
URL: https://gitlist.dev/e/87r2b79d3p.fsf%40evledraar.gmail.com
In-Reply-To: <alpine.LFD.2.21.1903160816410.10724@localhost.localdomain>

```

On Sat, Mar 16 2019, Robert P. J. Day wrote:

>   more nitpicking, but i'm working my way through the intricacies of
> attributes and putting together some (allegedly) simple examples for a
> class i'm giving on monday, and i noted a couple possible shortcomings
> in "man gitattributes".
>
>   as a working example, i looked at the top-level .gitattributes file
> in the git source code itself, which opens with:
>
>   * whitespace=!indent,trail,space
>   *.[ch] whitespace=indent,trail,space diff=cpp
>   *.sh whitespace=indent,trail,space eol=lf
>   ... snip ...
>
> first observation is that i see nothing in the man page that explains
> the notion of a comma-separated list of attribute values. maybe i
> missed it or maybe it's supposed to be intuitively obvious, but
> there's nothing i can see that mentions the possibility.
>
>   related to that is that there is no explanation as to how to
> interpret:
>
>   * whitespace=!indent,trail,space
>
> does the "!" apply to "indent" or to the entire list? the man page
> doesn't say.
>
>   just being pedantic again.
>
> rday

It's documented in gitglossary, search for "attr". That's not an excuse
or a statement that that doesn't suck, just a pointer for anyone
interested in fixing the docs.

```

## Robert P. J. Day, 2019-03-16 13:48

Subject: Re: "man gitattributes" doesn't explain comma-separated attribute values
Message-ID: <alpine.LFD.2.21.1903160947430.12393@localhost.localdomain>
URL: https://gitlist.dev/e/alpine.LFD.2.21.1903160947430.12393%40localhost.localdomain
In-Reply-To: <87r2b79d3p.fsf@evledraar.gmail.com>

```
On Sat, 16 Mar 2019, Ævar Arnfjörð Bjarmason wrote:

>
> On Sat, Mar 16 2019, Robert P. J. Day wrote:
>
> >   more nitpicking, but i'm working my way through the intricacies of
> > attributes and putting together some (allegedly) simple examples for a
> > class i'm giving on monday, and i noted a couple possible shortcomings
> > in "man gitattributes".
> >
> >   as a working example, i looked at the top-level .gitattributes file
> > in the git source code itself, which opens with:
> >
> >   * whitespace=!indent,trail,space
> >   *.[ch] whitespace=indent,trail,space diff=cpp
> >   *.sh whitespace=indent,trail,space eol=lf
> >   ... snip ...
> >
> > first observation is that i see nothing in the man page that explains
> > the notion of a comma-separated list of attribute values. maybe i
> > missed it or maybe it's supposed to be intuitively obvious, but
> > there's nothing i can see that mentions the possibility.
> >
> >   related to that is that there is no explanation as to how to
> > interpret:
> >
> >   * whitespace=!indent,trail,space
> >
> > does the "!" apply to "indent" or to the entire list? the man page
> > doesn't say.
> >
> >   just being pedantic again.
> >
> > rday
>
> It's documented in gitglossary, search for "attr". That's not an excuse
> or a statement that that doesn't suck, just a pointer for anyone
> interested in fixing the docs.

  ah, gotcha. thenk you kindly.

rday

```

## Johannes Sixt, 2019-03-16 21:58

Subject: Re: "man gitattributes" doesn't explain comma-separated attribute values
Message-ID: <408d82f6-e935-487a-6d0c-9ec4be5e8b6e@kdbg.org>
URL: https://gitlist.dev/e/408d82f6-e935-487a-6d0c-9ec4be5e8b6e%40kdbg.org
In-Reply-To: <alpine.LFD.2.21.1903160816410.10724@localhost.localdomain>

```
Am 16.03.19 um 13:22 schrieb Robert P. J. Day:
>   as a working example, i looked at the top-level .gitattributes file
> in the git source code itself, which opens with:
> 
>   * whitespace=!indent,trail,space
>   *.[ch] whitespace=indent,trail,space diff=cpp
>   *.sh whitespace=indent,trail,space eol=lf
>   ... snip ...
> 
> first observation is that i see nothing in the man page that explains
> the notion of a comma-separated list of attribute values.

This comma-separated list is not a property of attributes in general,
but a property of the whitespace attribute in particular. See
core.whitespace in git-config(1) and "Checking whitespace errors" in
gitattributes(5).

-- Hannes

```

## Robert P. J. Day, 2019-03-16 22:09

Subject: Re: "man gitattributes" doesn't explain comma-separated attribute values
Message-ID: <alpine.LFD.2.21.1903161807480.19900@localhost.localdomain>
URL: https://gitlist.dev/e/alpine.LFD.2.21.1903161807480.19900%40localhost.localdomain
In-Reply-To: <408d82f6-e935-487a-6d0c-9ec4be5e8b6e@kdbg.org>

```
On Sat, 16 Mar 2019, Johannes Sixt wrote:

> Am 16.03.19 um 13:22 schrieb Robert P. J. Day:
> >   as a working example, i looked at the top-level .gitattributes file
> > in the git source code itself, which opens with:
> >
> >   * whitespace=!indent,trail,space
> >   *.[ch] whitespace=indent,trail,space diff=cpp
> >   *.sh whitespace=indent,trail,space eol=lf
> >   ... snip ...
> >
> > first observation is that i see nothing in the man page that explains
> > the notion of a comma-separated list of attribute values.
>
> This comma-separated list is not a property of attributes in
> general, but a property of the whitespace attribute in particular.
> See core.whitespace in git-config(1) and "Checking whitespace
> errors" in gitattributes(5).

  ah, i was digging through the code trying to figure out where the
whole CSV thing was explained -- it's massively helpful to understand
that that property is specific to whitespace. that does not appear to
be clarified anywhere.

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                  http://crashcourse.ca/dokuwiki

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================

```

## Johannes Sixt, 2019-03-17 08:18

Subject: Re: "man gitattributes" doesn't explain comma-separated attribute values
Message-ID: <6aeca231-c024-1063-0f8c-03276c83161c@kdbg.org>
URL: https://gitlist.dev/e/6aeca231-c024-1063-0f8c-03276c83161c%40kdbg.org
In-Reply-To: <alpine.LFD.2.21.1903161807480.19900@localhost.localdomain>

```
Am 16.03.19 um 23:09 schrieb Robert P. J. Day:
> On Sat, 16 Mar 2019, Johannes Sixt wrote:
> 
>> Am 16.03.19 um 13:22 schrieb Robert P. J. Day:
>>>   as a working example, i looked at the top-level .gitattributes file
>>> in the git source code itself, which opens with:
>>>
>>>   * whitespace=!indent,trail,space
>>>   *.[ch] whitespace=indent,trail,space diff=cpp
>>>   *.sh whitespace=indent,trail,space eol=lf
>>>   ... snip ...
>>>
>>> first observation is that i see nothing in the man page that explains
>>> the notion of a comma-separated list of attribute values.
>>
>> This comma-separated list is not a property of attributes in
>> general, but a property of the whitespace attribute in particular.
>> See core.whitespace in git-config(1) and "Checking whitespace
>> errors" in gitattributes(5).
> 
>   ah, i was digging through the code trying to figure out where the
> whole CSV thing was explained -- it's massively helpful to understand
> that that property is specific to whitespace. that does not appear to
> be clarified anywhere.

But it is. The very first paragraph of gitattributes(5) states that
attributes are whitespace separated. From this, conclude that the
comma-separated list must pertain to the whitespace attribute. Now
follow the documentation of that, and you end up at core.whitespace in
git-config(1). There you have it as the very first phrase.

-- Hannes

```

## Philip Oakley, 2019-03-18 10:10

Subject: Re: "man gitattributes" doesn't explain comma-separated attribute values
Message-ID: <21e31142-ace2-71e1-8a36-1940c35eb24d@iee.org>
URL: https://gitlist.dev/e/21e31142-ace2-71e1-8a36-1940c35eb24d%40iee.org
In-Reply-To: <6aeca231-c024-1063-0f8c-03276c83161c@kdbg.org>

```
On 17/03/2019 08:18, Johannes Sixt wrote:
> Am 16.03.19 um 23:09 schrieb Robert P. J. Day:
>> On Sat, 16 Mar 2019, Johannes Sixt wrote:
>>
>>> Am 16.03.19 um 13:22 schrieb Robert P. J. Day:
>>>>    as a working example, i looked at the top-level .gitattributes file
>>>> in the git source code itself, which opens with:
>>>>
>>>>    * whitespace=!indent,trail,space
>>>>    *.[ch] whitespace=indent,trail,space diff=cpp
>>>>    *.sh whitespace=indent,trail,space eol=lf
>>>>    ... snip ...
>>>>
>>>> first observation is that i see nothing in the man page that explains
>>>> the notion of a comma-separated list of attribute values.
>>> This comma-separated list is not a property of attributes in
>>> general, but a property of the whitespace attribute in particular.
>>> See core.whitespace in git-config(1) and "Checking whitespace
>>> errors" in gitattributes(5).
>>    ah, i was digging through the code trying to figure out where the
>> whole CSV thing was explained -- it's massively helpful to understand
>> that that property is specific to whitespace. that does not appear to
>> be clarified anywhere.
> But it is. The very first paragraph of gitattributes(5) states that
> attributes are whitespace separated. From this, conclude that the
> comma-separated list must pertain to the whitespace attribute.

I can't say that I follow that 'by omission'  argument. It is one of 
those argument types that sounds good in retrospect but is very hard for 
the unknowing reader to guess, especially as commas are widely taught as 
being one of the ubiquitous separators.

There is a similar issue with '/' in refs regarding the subtle 
distinctions between embedded characters that have a common convenience 
meaning vs the idea that they are all just a single whitespace separated 
string.

Given that, Robert may be able to suggest a short addendum that 
clarifies that the comma is processed elsewhere (IIUC).

>   Now
> follow the documentation of that, and you end up at core.whitespace in
> git-config(1). There you have it as the very first phrase.
>
> -- Hannes

-- 

Philip


```
