Setup .gitattributes for eol normalization #429

Merged
merged 1 commit into from Dec 7, 2012

Projects

None yet

2 participants

@ryenus
Contributor
ryenus commented Dec 6, 2012

This will work automatically for future commits.

For existing files, we have to manually normalize
them once and only once, with following command:

find . \( -path './.git' -o -path './build*' -o \
-path './src_gen' \) -prune -o -type f -print |\
xargs dos2unix

One caveat of dos2unix is, even though it claims
by default only convert line breaks and skip
binary files, it actually depends, e.g., some
UTF-16 files could be messed up; and the BOM in
some UTF-8 files could be removed unexpectedly.

Therefore, after running the above command, make
sure to use git diff to see if there's any such
kind of unexpected change, and those files can be
restored via git checkout.

@ryenus ryenus Setup .gitattributes for eol normalization
This will work automatically for future commits.

For existing files, we have to manually normalize
them once and only once, with following command:

find . \( -path './.git' -o -path './build*' -o \
-path './src_gen' \) -prune -o -type f -print |\
xargs dos2unix

One caveat of dos2unix is, even though it claims
by default only convert line breaks and skip
binary files, it actually depends, e.g., some
UTF-16 files could be messed up; and the BOM in
some UTF-8 files could be removed unexpectedly.

Therefore, after running the above command, make
sure to use git diff to see if there's any such
kind of unexpected change, and those files can be
restored via git checkout.
b111911
@ryenus
Contributor
ryenus commented Dec 6, 2012

@headius: in your commit which removed the .gitattributes file, you mentioned that

Author: Charles Oliver Nutter headius@headius.com
Date: 2012-08-06 12:00:30 -0500

Remove .gitattributes

Unfortunately, due to some crlf line endings in MRI's test suite
this was causing a few files to be constantly rewritten. The
rewritten files show up as modified and can't be reverted because
reverting causes them to get rewritten again. We'll need a
a different solution.

Could you please let me know which files are problematic?

Anyway, I think the problem should be gone because now I've normalized all existing problematic files (should have done this with my initial commit). With this supplemental modification, I've successfully applied the same change to a dozen of intranet projects and everything is alright.

Also, as for JRuby, I've adjusted the .gitattributes file accordingly to work with a few JRuby specific files.

With this new commit the problems mentioned in your previous commit should be gone. Hopefully you can give it a try and let me know the result.

Thanks

@headius
Member
headius commented Dec 7, 2012

We'll give it a shot again. I remember it was some test files, but I don't remember specifics.

@headius headius merged commit 37fe6d2 into jruby:master Dec 7, 2012

1 check passed

default The Travis build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment