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

Merged
merged 1 commit into from Jun 26, 2017

Conversation

Projects
None yet
3 participants
@danhunsaker
Collaborator

danhunsaker commented Jun 26, 2017

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.

@unarist

This patch breaks test fixtures. HTTP response includes CRLF, so you shouldn't normalize those files.

Only .gitattributes should appears as a changed file.

@danhunsaker

This comment has been minimized.

Collaborator

danhunsaker commented Jun 26, 2017

Ah. I had wondered about those fixtures. Fixing now.

Add .gitattributes file to avoid unwanted CRLF
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.

@danhunsaker danhunsaker force-pushed the danhunsaker:bugfix/line-endings branch from 28fe111 to 1b37791 Jun 26, 2017

@danhunsaker danhunsaker changed the title from Add .gitattributes file to avoid CRLF to Add .gitattributes file to avoid unwanted CRLF Jun 26, 2017

@danhunsaker

This comment has been minimized.

Collaborator

danhunsaker commented Jun 26, 2017

Commit replaced. I tested the updated .gitattributes file to ensure it won't cause git to normalize those files again, and it was successful.

(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

This comment has been minimized.

@unarist

unarist Jun 26, 2017

Collaborator

!eol seems to be not needed, but it's ok.

This comment has been minimized.

@danhunsaker

danhunsaker Jun 26, 2017

Collaborator

Yeah, spare bit of paranoia. I don't trust git as much as I should...

@Gargron Gargron merged commit 7aeb916 into tootsuite:master Jun 26, 2017

2 checks passed

codeclimate no new or fixed issues
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@danhunsaker danhunsaker deleted the danhunsaker:bugfix/line-endings branch Jun 26, 2017

masarakki added a commit to masarakki/mastodon that referenced this pull request Jul 4, 2017

Add .gitattributes file to avoid unwanted CRLF (tootsuite#3954)
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.

YaQ00 added a commit to YaQ00/mastodon that referenced this pull request Sep 5, 2017

Add .gitattributes file to avoid unwanted CRLF (tootsuite#3954)
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment