Skip to content

Conversation

@simbabque
Copy link
Contributor

The .gitattributes file was introduced in 179103b and set to force all files into text mode with line-feed line endings. I believe this is the wrong approach. It leads to files with Windows style line endings that have existed in the repository priot to this being added being marked as "wrong" by git and getting converted. For new clones of the repository, they will show up as modified. The same happens for binary files such as the favicons or a font.

This commit does two things:

  • Add exceptions to the .gitattributes to exclude all types of binary files currently in the repository. This will not work if we subsequently add oder ones, such as .jpg files.
  • Change the line endings from crlf to lf in all files that were stil wrong.

More information on this can be found at
https://docs.github.com/en/get-started/getting-started-with-git/configuring-git-to-handle-line-endings.

Please note that this is not about personal preference, but to avoid new contributors getting confused by "changed" files.

Here's what this looked like before my fix when I had just git cloned the repository freshly on a Ubuntu system.

image

I have also discussed this with @KirDE off-band and we think this fix makes sense.

Copy link
Member

@ewoerner ewoerner left a comment

Choose a reason for hiding this comment

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

Looking good, except for the SVG handling.

The .gitattributes file was introduced in 179103b and set to force all
files into text mode with line-feed line endings. I believe this is the
wrong approach. It leads to files with Windows style line endings that
have existed in the repository priot to this being added being marked as
"wrong" by git and getting converted. For new clones of the repository,
they will show up as modified. The same happens for binary files such as
the favicons or a font.

This commit does two things:
- Add exceptions to the .gitattributes to exclude all types of binary
  files currently in the repository. This will not work if we
subsequently add oder ones, such as .jpg files.
- Change the line endings from crlf to lf in all files that were stil
  wrong.

More information on this can be found at
https://docs.github.com/en/get-started/getting-started-with-git/configuring-git-to-handle-line-endings.

Please note that this is not about personal preference, but to avoid new
contributors getting confused by "changed" files.
@ewoerner ewoerner merged commit c18da36 into bannergress:main Mar 31, 2024
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