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

Re: CRLF problems with Git on Win32

From
MSMarius Storm-Olsen <mstormo-re5jqeeqqe8avxtiumwx3w@public.gmane.org>
Date
Jan 8, 2008, 08:55 UTC
Message-ID
<47833A66.9080007@gmail.com>
In-Reply-To
<alpine.LFD.1.00.0801071457040.3148-5CScLwifNT1QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org>
Linus Torvalds said the following on 07.01.2008 23:58:
Show 18 quoted lines
> 
> 
> On Mon, 7 Jan 2008, Junio C Hamano wrote:
>> So wouldn't the categorization be more like this?
> 
> Well, one thng we could do is to add a new concept, namely
> 
> 	core.autocrlf = warn
> 
> and make *that* the default.
> 
> It would do the check, but not actually convert anything, just warn about 
> it.
> 
> Then, it's up to the user to set it explicitly to "true" or "false", 
> unless they just like seeing that warning a million times ;)
> 
> That might be acceptable to most people.
I actually would want the default to be
     core.autocrlf = windows

Meaning, it would be true on Windows platforms, and warn on all others. That way it would work as expected in 90% of the time, namely that files are added to the repo with unix line endings. We could then add the following warning when you try to add a CRLF file on non-Windows platforms:

   * CRLF line endings detected for text files: <foo>, <bar>, <baz>
   Consider adding the following to a .gitattributes file to
   maintain the CRLF line endings on all platforms:
     <foo> = -crlf
     <bar> = -crlf
     <baz> = -crlf

Maybe then can we lure non-Windows users to add these required .gitattributes files for files that need to be CRLF on all platforms; instead of shoving the whole burden of maintaining a proper cross-platform repo onto the Windows users alone.

/me braces for the "it's your fault for working on Windows in the first place!" flood ;-)

Of course, setting the core.autocrlf = true|false should not show the warning, for users who don't care about repo portability to Windows anyways.

-- .marius

Previous: Gregory JefferisNext: J. Bruce Fields
Message 47 of 113 in “CRLF problems with Git on Win32”
  1. Peter KarlssonJan 7, 2008
  2. Steffen ProhaskaJan 7, 2008
  3. Junio C HamanoJan 7, 2008
  4. Steffen ProhaskaJan 7, 2008
  5. Jeff KingJan 7, 2008
  6. Robin RosenbergJan 7, 2008
  7. Johannes SchindelinJan 7, 2008
  8. Robin RosenbergJan 7, 2008
  9. Johannes SchindelinJan 7, 2008
  10. Steffen ProhaskaJan 7, 2008
  11. Linus TorvaldsJan 7, 2008
  12. Peter KarlssonJan 8, 2008
  13. Johannes SchindelinJan 9, 2008
  14. Steffen ProhaskaJan 9, 2008
  15. Gregory JefferisJan 9, 2008
  16. Johannes SchindelinJan 9, 2008
  17. Dmitry PotapovJan 9, 2008
  18. Dmitry PotapovJan 9, 2008
  19. Gregory JefferisJan 9, 2008
  20. Dmitry PotapovJan 9, 2008
  21. Thomas NeumannJan 7, 2008
  22. Peter KarlssonJan 8, 2008
  23. Jeff KingJan 8, 2008
  24. Johannes SchindelinJan 8, 2008
  25. Johannes SchindelinJan 8, 2008
  26. Peter HarrisJan 8, 2008
  27. Peter KarlssonJan 8, 2008
  28. Kelvie WongJan 8, 2008
  29. Dmitry PotapovJan 8, 2008
  30. Jan HudecJan 9, 2008
  31. Peter KlavinsJan 7, 2008
  32. Steffen ProhaskaJan 7, 2008
  33. Peter KarlssonJan 7, 2008
  34. Peter KlavinsJan 7, 2008
  35. Steffen ProhaskaJan 7, 2008
  36. Junio C HamanoJan 7, 2008
  37. Linus TorvaldsJan 7, 2008
  38. Gregory JefferisJan 7, 2008
  39. git and unicodeGonzalo Garramuño, Jan 8, 2008
  40. Remi VanicatJan 8, 2008
  41. Robin RosenbergJan 8, 2008
  42. Steffen ProhaskaJan 8, 2008
  43. Junio C HamanoJan 8, 2008
  44. Jeff KingJan 8, 2008
  45. Junio C HamanoJan 8, 2008
  46. Gregory JefferisJan 8, 2008
  47. Marius Storm-OlsenJan 8, 2008
  48. J. Bruce FieldsJan 8, 2008
  49. Steffen ProhaskaJan 8, 2008
  50. Junio C HamanoJan 8, 2008
  51. Junio C HamanoJan 8, 2008
  52. Gregory JefferisJan 10, 2008
  53. Linus TorvaldsJan 10, 2008
  54. Gregory JefferisJan 10, 2008
  55. Dmitry PotapovJan 10, 2008
  56. Linus TorvaldsJan 11, 2008
  57. Junio C HamanoJan 11, 2008
  58. Steffen ProhaskaJan 11, 2008
  59. Linus TorvaldsJan 11, 2008
  60. Steffen ProhaskaJan 11, 2008
  61. Linus TorvaldsJan 11, 2008
  62. Steffen ProhaskaJan 11, 2008
  63. Linus TorvaldsJan 11, 2008
  64. Steffen ProhaskaJan 11, 2008
  65. Linus TorvaldsJan 11, 2008
  66. Sam RavnborgJan 11, 2008
  67. Johannes SchindelinJan 11, 2008
  68. Sam RavnborgJan 11, 2008
  69. Dmitry PotapovJan 12, 2008
  70. [WIP] safecrlf: Add mechanism to warn about irreversible crlf conversionsSteffen Prohaska, Jan 12, 2008
  71. Dmitry PotapovJan 12, 2008
  72. [WIP v2] safecrlf: Add mechanism to warn about irreversible crlf conversionsSteffen Prohaska, Jan 13, 2008
  73. Christer WeinigelJan 11, 2008
  74. David KågedalJan 14, 2008
  75. Gregory JefferisJan 11, 2008
  76. Dmitry PotapovJan 12, 2008
  77. Rogan DawesJan 10, 2008
  78. Gregory JefferisJan 10, 2008
  79. Junio C HamanoJan 11, 2008
  80. Steffen ProhaskaJan 8, 2008
  81. J. Bruce FieldsJan 8, 2008
  82. Junio C HamanoJan 8, 2008
  83. Steffen ProhaskaJan 8, 2008
  84. Junio C HamanoJan 8, 2008
  85. Dmitry PotapovJan 8, 2008
  86. Steffen ProhaskaJan 8, 2008
  87. Junio C HamanoJan 8, 2008
  88. Steffen ProhaskaJan 8, 2008
  89. Steffen ProhaskaJan 8, 2008
  90. Linus TorvaldsJan 8, 2008
  91. Junio C HamanoJan 9, 2008
  92. Junio C HamanoJan 8, 2008
  93. Robin RosenbergJan 8, 2008
  94. Linus TorvaldsJan 8, 2008
  95. SeanJan 8, 2008
  96. Dmitry PotapovJan 8, 2008
  97. Linus TorvaldsJan 9, 2008
  98. Abdelrazak YounesJan 9, 2008
  99. Johannes SchindelinJan 9, 2008
  100. Junio C HamanoJan 9, 2008
  101. Johannes SchindelinJan 9, 2008
  102. Steffen ProhaskaJan 9, 2008
  103. Johannes SchindelinJan 9, 2008
  104. Johannes SchindelinJan 9, 2008
  105. Steffen ProhaskaJan 9, 2008
  106. Peter KarlssonJan 10, 2008
  107. Johannes SchindelinJan 10, 2008
  108. Miles BaderJan 11, 2008
  109. Miles BaderJan 11, 2008
  110. Peter KarlssonJan 10, 2008
  111. Peter HarrisJan 10, 2008
  112. Peter KarlssonJan 11, 2008
  113. Peter HarrisJan 11, 2008

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.