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

Re: core.autocrlf considered half-assed

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Mar 7, 2010, 23:45 UTC
Message-ID
<alpine.LFD.2.00.1003071538350.30214@localhost.localdomain>
In-Reply-To
<20100307092701.GC31105@dpotapov.dyndns.org>
On Sun, 7 Mar 2010, Dmitry Potapov wrote:
Show 7 quoted lines
> 
> Well, I agree there are some issues with it. In particularly, when
> someone changes core.autocrlf in his/her repository, and then git
> behavior is outright confusing. IMHO, the nuts of the problem is that
> does not store in the index how files were checkout. Instead it uses
> core.autocrlf, which specifies how the user _wants_ files to be check-
> out. So, when the autocrlf option changes, things get very confusing.

I do agree. It would probably have been a good idea to mark the CRLF status in the index, but we didn't. And crlf isn't actually the _only_ thing that can cause confusion, the 'ident' and 'filter' can do the same thing.

One option might be to have "git config" know about crlf, so that if you change crlf state with 'git config' rather than manually, we could at least _warn_ about the effects and tell people that they may need to do a full new checkout (or reset the stat info in the index, or whatever). But I like editing config files by hand, and I don't think I'm the only one.

			Linus
Previous: Dmitry PotapovNext: Tait
Message 3 of 12 in “core.autocrlf considered half-assed”
  1. Johannes SchindelinMar 5, 2010
  2. Dmitry PotapovMar 7, 2010
  3. Linus TorvaldsMar 7, 2010
  4. TaitMar 8, 2010
  5. Johannes SchindelinMar 8, 2010
  6. Junio C HamanoMar 8, 2010
  7. Johannes SchindelinMar 9, 2010
  8. Junio C HamanoMar 9, 2010
  9. Johannes SchindelinMar 8, 2010
  10. Dmitry PotapovMar 9, 2010
  11. Johannes SchindelinMar 9, 2010
  12. Dmitry PotapovMar 9, 2010

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.