[CLJ-1026] Mixed end-of-line endings in the source code Created: 17/Jul/12 Updated: 30/Mar/13
While examining some of the Clojure source code, I discovered that some files had mixed line endings, or CRLF line endings on a non-Windows box. Using .gitattributes, we can correct that so that files have the right endings for the platform that it's on.
|Comment by John Szakmeister [ 17/Jul/12 2:26 PM ]|
Patch to fix line endings and introduce .gitattributes.
|Comment by Stuart Halloway [ 20/Jul/12 4:47 PM ]|
This looks like a change to every line in the world, which makes it hard to vet. Also: will it render incompatible all other outstanding patches at the time it is applied?
|Comment by John Szakmeister [ 21/Jul/12 6:52 AM ]|
You can use git diff -w $(git merge-base HEAD master) to see the actual diff minus the line ending change. Here it is inline:
Also, no, it won't render all the outstanding patches incompatible. For one, it seems like the files that have the eols mixed or in CRLF aren't touched much. I also went through the majority of outstanding patches and couldn't fix one that conflicts. Secondly, format-patch emits the patch inline and is intended to be sent via email. SMTP says that all lines must end with CRLF, so line endings are effectively lost. So git will convert it to the right line ending on application.
It can conflict with any outstanding branches that you may have. Supplying the renormalization option on merge can help:
Or, you can enable this by default for your repository:
If you think it's too much trouble, let's just drop it though.
|Comment by Stuart Halloway [ 10/Aug/12 1:15 PM ]|
Patch does not apply on my working copy of Clojure. I am using
I am willing to do this, just inept.
|Comment by Andy Fingerhut [ 10/Aug/12 1:21 PM ]|
Stuart, I updated this page http://dev.clojure.org/display/design/JIRA+workflow a while back when I had trouble applying some patches involving files with carriage return line endings. I did some Googling on git docs and found the option '--keep-cr' that seems to help in such cases. Try that out.