-
-
Notifications
You must be signed in to change notification settings - Fork 90
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
fixed eol config in gitattributes #1123
Conversation
Looks like this is biting us back, the reason we changed it LF was because on windows systems, when running spotless, it would change everything CLRF. The hard fix was forcing LF because nobody reads the docs lol https://mirrors.edge.kernel.org/pub/software/scm/git/docs/gitattributes.html Here's some documentation on .gitattributes Since this is causing issues with other files, consider stealing sections of this:
|
we still want all files LF so the config was fine, except we don't want to edit binary files because it'll make then corrupt. And also want .bat files to be CRLF. And both of those changes are done in this pr |
Yeah, auto normalization to LF is good @surajkumar, no worries. But you have to configure it properly. You can't force everything to LF, some win files won't work properly, and also git is not smart enough for every type of binary, and might corrupt them with changing line endings, so you might need to be explicit what to do with each binary. Also, if there is no file extension, you want to be explicit as well.
Text does normalization to LF automatically.
Auto automatically decides if text or binary, and performs normalization to LF automatically only on text files, unless it's already in git with CRLF ending. (And we obviously don't want LF normalization on binaries, because it makes no sense, and it might corrupt those files) So basically, this line is everything you need. It also does normalization on index (staging area) and doesn't force it in your working directory like eol=lf. Which means people can work with whatever software they prefer, and endings they want, but when committing, it will be normalized. If some binaries are not recognized, or file has no extension, you can manually specify that it is binary with this pattern Example config, since it's smarter to be explicit, and sometimes it is needed:
|
Quality Gate passedIssues Measures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was just an example, but sure.. :D
If it works correctly, without you having to add any extra rules, I'm fine with it.
Of course test it, and apply it to everything with:
git rm -rf --cached .
git reset --hard HEAD```
No description provided.