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 all line separators to linux #1769

Merged
merged 1 commit into from
Jun 30, 2024

Conversation

merks
Copy link
Contributor

@merks merks commented Jun 30, 2024

  • Convert all line separators that have been committed with \r\n to be just \n.

- Convert all line separators that have been committed with \r\n to be
just \n.
@merks
Copy link
Contributor Author

merks commented Jun 30, 2024

@speckyspooky @wimjongman

This is a commit from hell. The comments I saw the other day about strange diffs made me wonder to what extend files have been committed to the repository with Windows line endings. Apparently this is a very common mistake that as accumulated over the years. This commit normalizes them all.

As an example, if you save this file:

https://raw.githubusercontent.com/eclipse-birt/birt/master/build/birt-packages/birt-epp/category.xml

and view it in an editor that displays the line endings:

image

you should see no Windows line endings, but here we see a mixture of such things.

I've done this type of fix in other projects, e.g., in all the Eclipse TLP's repositories...

I assume you guys are okay with this massive corrective action...

@merks merks self-assigned this Jun 30, 2024
@speckyspooky
Copy link
Contributor

Wow, lot of changes over the whole stuff - there are inldued all kind of files, .txt, .msg, .html, .rptdesign, xml, .java and so on.
But we cannot avoid that we will get again windows-line breaks.

@merks
Copy link
Contributor Author

merks commented Jun 30, 2024

The Oomph setup configures the repository via autocrlf to convert \r\n to \n while committing and \n to \r\n when creating the working tree:

image

Sometimes folks get it into their heads that they should have this set to false, but anything other than setting it to input or true can and will cause problems:

https://stackoverflow.com/questions/3206843/how-line-ending-conversions-work-with-git-core-autocrlf-between-different-operat

So we can and should avoid this by minimally configuring autocrlf to input.

And we should notice bad diffs when we commit changes and see that the whole file has changed for no apparent reason.

Copy link
Contributor

@wimjongman wimjongman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, great.

@merks merks merged commit 5f739e7 into eclipse-birt:master Jun 30, 2024
3 checks passed
@merks merks deleted the pr-fix-line-separators branch June 30, 2024 18:36
@speckyspooky speckyspooky added this to the 4.17 milestone Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants