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

Re: Changing encoding of a file : What should happen to CRLF in file ?

From
Torsten Bögershausen <tboegi@web.de>
Date
Nov 14, 2017, 17:09 UTC
Message-ID
<f9dc6482-587d-50a9-d649-aed63be18fad@web.de>
In-Reply-To
<CAJ_+vJ7Yfcpz5252M4XJnDmEDCANp+eJ7RLJJF8TCcTxexZEUA@mail.gmail.com>
(Back to the beginning)

You have a file ApplicationManifest.xml It is encoded in UTF-16 (and has CRLF)

You convert it into UTF-8 The file has still CRLF (in the worktree)

Now you add it and make a commit. Under both Linux and Windows you have "text=auto".

I assume that you have efficiently core.eol=lf under Linux and core.eol=crlf on Windows.

(That is the default, when you don't change anything)

Now, what happens to the CRLF? If you commit the file, it will be stored with LF in the index, on both systems. On checkout, Windows will convert them into CRLF, but Linux will not.

That why you see
>On linux, during committing i get warning : warning: CRLF will be
>replaced by LF in …file_name..
All in all there is nothing wrong, at least as I see it.

The question remains: Do you need CRLF in Linux ? Probably not, but if yes, plase add a line

*.xml text eol=crlf

to your .gitattributes

Otherwise your .gitconfig looks good to  me.
Previous: Ashish NegiNext: Ashish Negi
Message 5 of 23 in “Changing encoding of a file : What should happen to CRLF in file ?”
  1. Ashish NegiNov 14, 2017
  2. Torsten BögershausenNov 14, 2017
  3. Ashish NegiNov 14, 2017
  4. Ashish NegiNov 14, 2017
  5. Torsten BögershausenNov 14, 2017
  6. Ashish NegiNov 15, 2017
  7. Torsten BögershausenNov 15, 2017
  8. Ashish NegiNov 15, 2017
  9. Torsten BögershausenNov 16, 2017
  10. Ashish NegiNov 23, 2017
  11. Torsten BögershausenNov 23, 2017
  12. Ashish NegiNov 24, 2017
  13. Torsten BögershausenNov 14, 2017
  14. 1/1 convert: tighten the safe autocrlf handlingtboegi@web.de, Nov 24, 2017
  15. Eric SunshineNov 24, 2017
  16. Torsten BögershausenNov 24, 2017
  17. Junio C HamanoNov 25, 2017
  18. 1/1 convert: tighten the safe autocrlf handlingtboegi@web.de, Nov 26, 2017
  19. 1/2 t0027: Don't use git commit <empty-pathspec>tboegi@web.de, Dec 8, 2017
  20. Junio C HamanoDec 8, 2017
  21. Junio C HamanoDec 8, 2017
  22. Torsten BögershausenDec 8, 2017
  23. 2/2 t0027: Adapt the new MIX tests to Windowstboegi@web.de, Dec 8, 2017

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.