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

Re: Surprising interaction of "binary" and "eol" gitattributes

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 11, 2015, 21:31 UTC
Message-ID
<xmqq7fun5ih6.fsf@gitster.dls.corp.google.com>
In-Reply-To
<5500A5F7.1000503@kdbg.org>
Johannes Sixt <j6t@kdbg.org> writes:
Show 22 quoted lines
>> I would say former.  You find out what attributes apply to a path
>> and then consider the collective effect of these attributes that
>> survived.
>>
>> So the second "No it is not text" which is overruled by the "oops,
>> no that is text" later should not get in the picture, I would say.
>>
>> As binary is not just -text and turns other things off, those other
>> things will be off after these three.
>
> Is that how attribute lookup works? I.e., given a path, all attributes
> are collected?
>
> Isn't it more like: Here we are interested in the "eol" attribute of
> this file named "a.foo". And the lookup would find the first line that
> says "eol=crlf". Elsewhere, we are interested in the "binary"
> attribute of the file named "a.foo", and lookup would find the second
> line that sets the "binary" attribute. And again elsewhere, we ask for
> the "text" attribute, and we find the last line that sets the "text"
> property.
>
> Am I totally off track?

In the codepath in question, we say "we are interested in text and eol attributes", grab the values (set/unset/set-to-value/unspecified) for these two for the path we are interested in from all the applicable gitattributes file and then act on the result.

Previous: Johannes SixtNext: Junio C Hamano
Message 14 of 17 in “Surprising interaction of "binary" and "eol" gitattributes”
  1. Michael HaggertyMar 5, 2015
  2. Torsten BögershausenMar 5, 2015
  3. Junio C HamanoMar 5, 2015
  4. Torsten BögershausenMar 6, 2015
  5. Michael HaggertyMar 6, 2015
  6. Torsten BögershausenMar 6, 2015
  7. Michael HaggertyMar 10, 2015
  8. Junio C HamanoMar 10, 2015
  9. Michael HaggertyMar 10, 2015
  10. Junio C HamanoMar 10, 2015
  11. Torsten BögershausenMar 11, 2015
  12. Junio C HamanoMar 11, 2015
  13. Johannes SixtMar 11, 2015
  14. Junio C HamanoMar 11, 2015
  15. Junio C HamanoMar 11, 2015
  16. Torsten BögershausenMar 10, 2015
  17. Michael HaggertyMar 10, 2015

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.