Re: CRLF problems with Git on Win32
- From
Steffen Prohaska <prohaska@zib.de>
- Date
- Jan 11, 2008, 17:56 UTC
- Message-ID
- <930EC77A-73D1-4DDD-81D4-BF22B248FCB6@zib.de>
- In-Reply-To
- <alpine.LFD.1.00.0801110924380.3148@woody.linux-foundation.org>
On Jan 11, 2008, at 6:25 PM, Linus Torvalds wrote:
Show 18 quoted lines
> > > On Fri, 11 Jan 2008, Steffen Prohaska wrote: >>> >>> No. What would it help? >> >> You may later decide that you want to check out your project on >> Windows. >> In this case your repository should not contain CRLF. autocrlf=input >> ensures this. > > But under Unix, it would never do that *anyway*, unless the file > for some > reason really needs it (which I cannot imagine, but I've never seen > anything so craptastically stupid that some crazy person hasn't > done it) > > So your argument is bogus.
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.
[1] http://article.gmane.org/gmane.comp.version-control.git/70082
It happens that people working in a mixed environment do such things. They just copy files from Windows to Unix and commit there. Not very often, but it happens. So it would be nice if git would handle this situation and it actually can by setting autocrlf=input.
My point is that perfect support for mixed environments requires that git removes CRLF from any input on any platform. However, git should behave differently during checkout. In this case the native line ending should be written (LF on Unix, CRLF on Windows). The difference happens during check out; commit should be handled identically.
Steffen