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

Re: core.autocrlf considered half-assed

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Mar 8, 2010, 19:15 UTC
Message-ID
<alpine.DEB.1.00.1003082011440.14277@intel-tinevez-2-302>
In-Reply-To
<20100308185719.GQ2480@ece.pdx.edu>
Hi,
On Mon, 8 Mar 2010, Tait wrote:
Show 7 quoted lines
> > I do agree. It would probably have been a good idea to mark the CRLF 
> > status in the index, but we didn't...
> 
> We already have .gitattributes for tracking information about files. 
> Maybe add an attribute to describe the in-repository line endings? The 
> default would be LF, as now, and a new attribute could change the 
> checked-in format to be CRLF.
No.

The problem is not the description of the line endings in the repository. The information what line endings are used can be easily extracted from every blob, by a simple inspection.

The problem is that the core.autocrlf code blindly assumes that Unix line endings are the only thing you would ever commit. And worse, the mistake is repeated when updating the index. Git converts the DOS line endings into Unix line endings, then compares with what it has in the repository and says: "Ooops, it is different!" even if it just checked the files out.

And I demonstrated with the "html" example that even long-time Gitsters sometimes commit DOS line endings as-are, unconverted.

Ciao, Dscho

Previous: TaitNext: Junio C Hamano
Message 5 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.