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

Re: CRLF problems with Git on Win32

From
CWChrister Weinigel <christer@weinigel.se>
Date
Jan 11, 2008, 19:53 UTC
Message-ID
<20080111205349.00ebccd9@weinigel.se>
In-Reply-To
<alpine.LFD.1.00.0801111005360.3148@woody.linux-foundation.org>

On Fri, 11 Jan 2008 10:10:00 -0800 (PST) Linus Torvalds <torvalds@linux-foundation.org> wrote:

Show 18 quoted lines
> On Fri, 11 Jan 2008, Steffen Prohaska wrote:
> > Ah sorry, I misunderstood you in [1].  I thought your last point
> > "Mixed Windows usage" meant what I have in mind:  A user working
> > in a mixed Windows/Unix environment who creates a file using
> > Windows tools and commits it in the Unix environment.  In this
> > case the CRLF file will be transferred from Windows to Unix
> > without git being involved.  The right thing for git on Unix is
> > to remove CRLF during a commit but still write only LF during
> > check out.  So autocrlf=input is the right choice.
> 
> Oh, ok, I didn't realize.
> 
> But yes, if you use a network share across windows and Unixand
> actually *share* the working tree over it, then yes, you'd want
> "autocrlf=input" on the unix side.
> 
> However, I think that falls under the "0.1%" case, not the "99.9%"
> case.

That's how I work all the time. My Linux box is a Samba server where I check things out from perforce (with the "share" settings for end of line which means that text files are checked out with LF only and CRLF is converted to LF on checkin). Having the data on the Linux box is nice since I can have all the nice Unix tools such as sed, find, grep, and they run fast on a native Linux system, which is not true about cygwin on Windows.

Show 5 quoted lines
> I realize that people probably do that more often with centralized 
> systems, but with a distributed thing, it probably makes a *ton* more 
> sense to have separate trees. But I could kind of see having a shared 
> development directory and accessing it from different types of
> machines too.

We're working in a mixed environment, and even though I do most of my development on Linux I usually want to make sure that things build in Visual Studio before I check in, so the easiest thing to do is to point Visual Studio at the files on the Samba share. Same thing when using Altera's tools to do CPLD development, I run the Altera tools on Windows (their free version is Windows only) but all the files are on the Linux box. My tools that take the SVF file (the "binary image" for the CPLD) and program the CPLD all run under Linux though.

A lot of my colleagues have Windows on the desktop, and when they develop on Linux they usually edit the files locally using the Samba share, and then they have a Putty (ssh) connected to the Linux box where they build and test the software.

So the shared scenario is actually a very common one for us.
Show 6 quoted lines
> I'd also bet that crlf behavior of git itself will be the *least* of
> your problems in that situation. You'd have all the *other* tools to
> worry about, and would probably be very aware indeed of any CRLF
> issues. So  at that point, the "automatic" or default behaviour is
> probably not a big deal, because everything _else_ you do likely
> needs special effort too!

Actually I seldom have any problems with CRLF at all. Sometimes the Xilinx or Altera editors will insert some stray CRLFs in some files, but all the tools I use seem to tolerate that. And as soon as I check in the CRLFs disappear anyway. We just have to make sure to turn on the "share" setting in our Perforce views and everything just works.

  /Christer
Previous: Steffen ProhaskaNext: David Kågedal
Message 73 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.