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

possible gitattributes eol bug with new eol=crlf | lf support?

From
Robert Buck <buck.robert.j@gmail.com>
Date
Sep 9, 2010, 22:31 UTC
Message-ID
<AANLkTinC8g9m=2ka=7LiHH4MtfxC-NbxbsYQEbmMyXmN@mail.gmail.com>
I start with a repository containing only four files:
  * lf.xml
  * lf.sln
  * crlf.xml
  * crlf.sln

The files whose names are prefixed by LF contain Unix LF EOL characters. The files whose names are prefixed by CRLF contain Windows CRLF EOL characters. Each file contains two lines, on one line 'jim', the second line contains 'tim'.

I later add and commit a .gitattributes file containing the following rules:
  *.sln  eol=crlf
  *.xml eol=lf
I _then_ clone the repository and open each file in binary mode to find:
  * the crlf.xml file contains CRLF when it should contain only LF
<<<<<<< BUG ???
  * the crlf.sln file contains CRLF as it rightly should
  * the lf.xml file contains LF as it rightly should
  * the lf.sln file contains CRLF as it rightly should

Conversion of LF-EOL files to CRLF works fine, but conversion of CRLF to LF fails to occur.

The doc is a little unclear if this is expected behavior, which if I recall correctly from the email threads related to the new eol support, this should not have occurred.

Guidance appreciated.
Next: Eyvind Bernhardsen
Message 1 of 6 in “possible gitattributes eol bug with new eol=crlf | lf support?”
  1. Robert BuckSep 9, 2010
  2. Eyvind BernhardsenSep 10, 2010
  3. Robert BuckSep 10, 2010
  4. Eyvind BernhardsenSep 12, 2010
  5. Robert BuckSep 12, 2010
  6. Eyvind BernhardsenSep 13, 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.