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

Re: wrong handling of text git attribute leading to files incorrectly reported as modified

From
FAFrank Ammeter <git@ammeter.ch>
Date
Apr 16, 2014, 11:49 UTC
Message-ID
<B3DF4E4A-F740-4588-AFD5-74D99E5299F5@ammeter.ch>
In-Reply-To
<xmqqob02jnhk.fsf@gitster.dls.corp.google.com>
Am 15.04.2014 um 23:23 schrieb Junio C Hamano <gitster@pobox.com>:
Show 9 quoted lines
> Brandon McCaig <bamccaig@gmail.com> writes:
> 
>> That is for your benefit, and for easily sharing that configuration
>> with collaborators. Git only cares that the file exists in your
>> working tree at run-time.
> 
> It is a lot more than "for sharing".  If you made .gitignore only
> effective after it gets committed, you cannot test your updated
> version of .gitignore is correct before committing the change.

Ok, I can follow that logic for .gitignore, but I was talking about .gitattributes and I always thought that .gitattributes as belonging to the repository, since it affects a) how files are checked out and b) how they are stored inside the repository. If committing .gitattributes were only for sharing convenience, git couldn’t decide whether to convert line endings when checking out a file. The same behavior doesn’t apply to .gitignore, because git will checkout a file that was added even though it matches an ignore pattern in .gitignore.

Previous: Junio C HamanoNext: Junio C Hamano
Message 6 of 8 in “wrong handling of text git attribute leading to files incorrectly reported as modified”
  1. Frank AmmeterApr 11, 2014
  2. Torsten BögershausenApr 11, 2014
  3. Frank AmmeterApr 12, 2014
  4. Brandon McCaigApr 15, 2014
  5. Junio C HamanoApr 15, 2014
  6. Frank AmmeterApr 16, 2014
  7. Junio C HamanoApr 16, 2014
  8. Holger HellmuthApr 16, 2014

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.