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

Re: [PATCH/RFC v2 1/4] Add "core.eolStyle" variable to control end-of-line conversion

From
Dmitry Potapov <dpotapov@gmail.com>
Date
May 10, 2010, 14:03 UTC
Message-ID
<20100510140321.GF14069@dpotapov.dyndns.org>
In-Reply-To
<AANLkTikYUypxH5WhCOMby_zpHsnHEFyix5MGpD96FVWD@mail.gmail.com>
On Mon, May 10, 2010 at 09:25:11AM -0400, Robert Buck wrote:
Show 8 quoted lines
> Today I am writing up some documentation related to Git use at the
> company, and planning to check in all the data from Git vs Hg testing,
> and all on-boarding/first-day documentation related to Git use. So
> within the directory containing all these files I init-ed the
> repository and got this when I attempted to add multiple files. Mind
> you, this is on Linux!
> 
>   "warning: LF will be replaced by CRLF"
It looks like you set core.autocrlf to true on Linux.

The problem is core.autocrlf says two things -- whether you want to enable automatic eol conversion for text files and whether you have CRLF for text files. Only if the answer is "yes" to both then you should set it to true. In other words, you should never set it to true on Linux.

You may want use core.autocrlf=input on Linux to avoid text files being accidentally commit with a wrong encoding, when they were copied from Windows directly.

> 
> This _really_ of scares me being that this was on Linux. Is this one
> of the problem spots that the topic of this thread attempts to
> resolve?

Yes, we want to have a separate setting, whihc will tell what is EOL on your system, and it should have sensible default, i.e. LF on Linux and CRLF on Windows.

Dmitry
Previous: Robert BuckNext: Jay Soffian
Message 21 of 37 in “End-of-line normalization, take 2 (now only slightly scary)”
  1. 0/4 End-of-line normalization, take 2 (now only slightly scary)Eyvind Bernhardsen, May 8, 2010
  2. 1/4 Add "core.eolStyle" variable to control end-of-line conversionEyvind Bernhardsen, May 8, 2010
  3. Linus TorvaldsMay 8, 2010
  4. Eyvind BernhardsenMay 8, 2010
  5. Eyvind BernhardsenMay 8, 2010
  6. Linus TorvaldsMay 8, 2010
  7. Eyvind BernhardsenMay 9, 2010
  8. Linus TorvaldsMay 9, 2010
  9. Eyvind BernhardsenMay 9, 2010
  10. Dmitry PotapovMay 9, 2010
  11. hasen jMay 9, 2010
  12. Dmitry PotapovMay 10, 2010
  13. Eyvind BernhardsenMay 9, 2010
  14. Eyvind BernhardsenMay 9, 2010
  15. Robert BuckMay 9, 2010
  16. Eyvind BernhardsenMay 9, 2010
  17. Robert BuckMay 9, 2010
  18. Eyvind BernhardsenMay 10, 2010
  19. Robert BuckMay 10, 2010
  20. Robert BuckMay 10, 2010
  21. Dmitry PotapovMay 10, 2010
  22. Jay SoffianMay 9, 2010
  23. Jay SoffianMay 9, 2010
  24. Eyvind BernhardsenMay 10, 2010
  25. Junio C HamanoMay 9, 2010
  26. Finn Arne GangstadMay 9, 2010
  27. Junio C HamanoMay 9, 2010
  28. Eyvind BernhardsenMay 10, 2010
  29. Eyvind BernhardsenMay 9, 2010
  30. Finn Arne GangstadMay 9, 2010
  31. Dmitry PotapovMay 10, 2010
  32. Finn Arne GangstadMay 10, 2010
  33. Dmitry PotapovMay 10, 2010
  34. Finn Arne GangstadMay 9, 2010
  35. 2/4 Add tests for per-repository eol normalizationEyvind Bernhardsen, May 8, 2010
  36. 3/4 Pass eol conv mode as an argument instead of using global auto_crlfEyvind Bernhardsen, May 8, 2010
  37. 4/4 Add per-repository eol normalizationEyvind Bernhardsen, May 8, 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.