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
Add .gitattributes file to avoid unwanted CRLF #3954
Conversation
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.
This patch breaks test fixtures. HTTP response includes CRLF, so you shouldn't normalize those files.
Only .gitattributes
should appears as a changed file.
Ah. I had wondered about those fixtures. Fixing now. |
When Windows checks out files, it defaults to changing line endings to CRLF. If these files are then copied to a Linux system to be run, and the endings aren't changed at some point in that process, things break. This file forces git to use LF for all text files on all systems (except the request testing specfiles) to prevent issues everywhere.
28fe111
to
1b37791
Compare
Commit replaced. I tested the updated (Thought about forcing them all to CRLF, but decided against that; leaving them untouched across systems, as though they were binary files, allows more flexibility in writing tests...) |
*.webm -text | ||
*.woff -text | ||
*.woff2 -text | ||
spec/fixtures/requests/** -text !eol |
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.
!eol
seems to be not needed, but it's ok.
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.
Yeah, spare bit of paranoia. I don't trust git as much as I should...
When Windows checks out files, it defaults to changing line endings to CRLF. If these files are then copied to a Linux system to be run, and the endings aren't changed at some point in that process, things break. This file forces git to use LF for all text files on all systems (except the request testing specfiles) to prevent issues everywhere.