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

Re: The different EOL behavior between libgit2-based software and official Git

From
Torsten Bögershausen <tboegi@web.de>
Date
Jun 20, 2014, 06:56 UTC
Message-ID
<53A3DB01.7090904@web.de>
In-Reply-To
<53A285A1.3090804@web.de>

Hm, I feeled puzzled here. Even if I wouldn't recommend to use core.autocrlf, and prefer to use .gitattributes, the CRLF conversion should work under Git, but it doensn't seem to do so.

Clone this repo: origin https://github.com/YueLinHo/TestAutoCrlf.git Try to see if LF or CRLF can be converted into CRLF, when core.autocrlf is true.

Neither msysgit nor Git under Linux produces CRLF (?)

Git under Mac OS produces the CRLF: both Git 2.0.0 and the latest msygit code base (7e872d24a9bd03), compiled under Mac OS

What do I miss ?

git --version git version 2.0.0 tb@Linux:~/EOL_Test/TestAutoCrlf$ t=MIX-more_LF.txt && rm -f $t && git -c core.eol=CRLF checkout $t && od -c $t 0000000 L i n e 1 \n l i n e ( 2 ) \r 0000020 \n l i n e 3 . \n t h i s i s 0000040 l i n e 4 \n l i n e 0000060 N o . 5 \n L i n e N u m b e 0000100 r 6 \n

============================================= $ git --version git version 1.9.2.msysgit.0.1206.g7e872d2

tb@msgit ~/EOL_test/TestAutoCrlf (master) $ t=MIX-more_LF.txt && rm -f $t && git -c core.eol=CRLF checkout $t && od -c $t 0000000 L i n e 1 \n l i n e ( 2 ) \r 0000020 \n l i n e 3 . \n t h i s i s 0000040 l i n e 4 \n l i n e 0000060 N o . 5 \n L i n e N u m b e 0000100 r 6 \n

============================================= tb@mac:~/EOL_Test/TestAutoCrlf> git --version git version 2.0.0.622.g9478935 tb@mac:~/EOL_Test/TestAutoCrlf> t=MIX-more_LF.txt && rm -f $t && git -c core.eol=CRLF checkout $t && od -c $t 0000000 L i n e 1 \r \n l i n e ( 2 ) 0000020 \r \n l i n e 3 . \r \n t h i s 0000040 i s l i n e 4 \r \n l i n 0000060 e N o . 5 \r \n L i n e N 0000100 u m b e r 6 \r \n

============================================== tb@mac:~/EOL_Test/TestAutoCrlf> t=MIX-more_LF.txt && rm -f $t && ~/projects/git/tb.msygit/git -c core.eol=CRLF checkout $t && od -c $t 0000000 L i n e 1 \r \n l i n e ( 2 ) 0000020 \r \n l i n e 3 . \r \n t h i s 0000040 i s l i n e 4 \r \n l i n 0000060 e N o . 5 \r \n L i n e N 0000100 u m b e r 6 \r \n

Previous: Yue Lin HoNext: Yue Lin Ho
Message 4 of 10 in “The different EOL behavior between libgit2-based software and official Git”
  1. Yue Lin HoJun 19, 2014
  2. Torsten BögershausenJun 19, 2014
  3. Yue Lin HoJun 19, 2014
  4. Torsten BögershausenJun 20, 2014
  5. Yue Lin HoJun 20, 2014
  6. Torsten BögershausenJun 20, 2014
  7. Junio C HamanoJun 20, 2014
  8. Torsten BögershausenJun 22, 2014
  9. Junio C HamanoJun 23, 2014
  10. Yue Lin HoJun 20, 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.