Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

normalize line ending #96

Merged
merged 5 commits into from
Apr 25, 2016
Merged

Conversation

McFoggy
Copy link
Contributor

@McFoggy McFoggy commented Feb 2, 2016

this PR answers the line ending problems raised in #76

As the project, and its tests, need special line ending to be green I do not think that the project can afford to introduce line ending normalization. By doing this normalization and by specifying concrete line ends where it matters the project is build-able and tests pass regardless of the configuration of line ending on the client machine that checkouts the project.

The work done:

  • normalize line endings in source code, no need to mix CRLF with LF in sources
  • use LF as default normalization: as most of the tests check for a LF it was easier to define LF as default and just express on which files CRLF was needed
  • identify files for which CRLF was mandatory
  • provide .gitattributes file answering the above points

Usage:

  • on a clean working copy: just git clone and you are done (regardless of any core.autocrlfsettings value)
  • on an existing working copy:
    • merge the PR
    • delete everything except .git directory
    • on linux using bash you could execute the following commands
shopt -s extglob
rm -f !(.git)
rm -r -f !(.git)
git reset --hard

Using this version you should be able to have all tests green regardless of any git settings you could use on your machine. This normalization also ensures that even if someone try to push bad line endings where not expected, then those ones will be normalized by the rules in .gitattributes.

If requested I can squash the PR. I kept it until now with several commits to show how I ended in the final state.

readings:

@mathieucarbou mathieucarbou self-assigned this Apr 25, 2016
@mathieucarbou mathieucarbou added this to the 2.12 milestone Apr 25, 2016
@mathieucarbou mathieucarbou added the is:enhancement Enhancement to an existing feature label Apr 25, 2016
@mathieucarbou
Copy link
Owner

mathieucarbou commented Apr 25, 2016

@McFoggy : sorry I just saw that I was too busy... I had a look.
Did you tried a mvn clean install on both linux/mac and windows ?

Update: I can test on windows and mac on my side. Should be enough. Let me know!

@mathieucarbou mathieucarbou merged commit c27b272 into mathieucarbou:master Apr 25, 2016
@McFoggy
Copy link
Contributor Author

McFoggy commented Apr 25, 2016

at the time of the PR, I tried, windows & linux with different core.autocrlf settings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
is:enhancement Enhancement to an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants