Skip to content

normalize line ending - #96

Merged
mathieucarbou merged 5 commits into
mathieucarbou:masterfrom
McFoggy:clean-lf
Apr 25, 2016
Merged

mathieucarbou merged 5 commits into
mathieucarbou:masterfrom
McFoggy:clean-lf

Conversation

@McFoggy

@McFoggy McFoggy commented Feb 2, 2016

Copy link
Copy Markdown
Contributor

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

mathieucarbou commented Apr 25, 2016 •

Copy link
Copy Markdown
Owner

@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

McFoggy commented Apr 25, 2016

Copy link
Copy Markdown
Contributor Author

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