git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Johannes Sixt <j6t@kdbg.org>
Date
Mar 17, 2019, 08:18 UTC
Message-ID
<6aeca231-c024-1063-0f8c-03276c83161c@kdbg.org>
In-Reply-To
<alpine.LFD.2.21.1903161807480.19900@localhost.localdomain>
Am 16.03.19 um 23:09 schrieb Robert P. J. Day:
Show 23 quoted lines
> 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
Previous: Robert P. J. DayNext: Philip Oakley
Message 6 of 7 in “"man gitattributes" doesn't explain comma-separated attribute values”
  1. Robert P. J. DayMar 16, 2019
  2. Ævar Arnfjörð BjarmasonMar 16, 2019
  3. Robert P. J. DayMar 16, 2019
  4. Johannes SixtMar 16, 2019
  5. Robert P. J. DayMar 16, 2019
  6. Johannes SixtMar 17, 2019
  7. Philip OakleyMar 18, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.