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

Default line endings for text files #64

Merged
merged 1 commit into from
Jun 2, 2022
Merged

Conversation

seriema
Copy link
Contributor

@seriema seriema commented Jun 2, 2022

From what I recall, .gitattributes, is checked recursively upwards until one is found and if none is found then it uses a default. Since there is a .gitattributes file here it's used, but it's missing the line ending setting so what file endings are used in the files stored in git can be whatever the author had it to (making it platform dependent).

When working on multiple platforms, you can get issues where your IDE doesn't understand the extra characters.

I've added the most common default. You can take it from there and maybe set up some specific things for images and fonts.

As an example, the React repo uses this same default:
https://github.com/facebook/react/blob/main/.gitattributes

Note: Expect to see some extra file changes in the commits after this. It'll happen until all files has had their line endings normalized.
You can also do a giant commit changing all of them, and then ignoring that commit when looking at the history with https://www.moxio.com/blog/43/ignoring-bulk-change-commits-with-git-blame

From what I recall, `.gitattributes`, is checked recursively upwards until one is found and if none is found then it uses a default. Since there is a `.gitattributes` file here it's used, but it's missing the line ending setting so what file endings are used in the files stored in git can be whatever the author had it to (making it platform dependent).

When working on multiple platforms, you can get issues where your IDE doesn't understand the extra characters.

I've added the most common default. You can take it from there and maybe set up some specific things for images and fonts.

As an example, the React repo uses this same default:
https://github.com/facebook/react/blob/main/.gitattributes
@pirelenito
Copy link
Member

Thank you ❤

@pirelenito pirelenito merged commit ea8c89b into Mojang:main Jun 2, 2022
@seriema seriema deleted the patch-1 branch June 3, 2022 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants