fpw / avitab

X-Plane plugin that displays a tablet to aid VR usage
GNU Affero General Public License v3.0
300 stars 59 forks source link

Repo line ending normalization #178

Closed mjh65 closed 11 months ago

mjh65 commented 11 months ago

This is the previously discussed PR to normalize the source files in the repo which had been submitted (at some point in the distant past) with CRLF line endings, and to add a gitattributes file to ensure this does not happen again.

The side-effects of this update are likely to be (at the least) annoying for anyone who has a lot of in-progress development since it will affect diffing and possibly merging. It should be easy to fix this by converting the working tree files to LF endings, but I extend my apologies in advance to anyone affected. I hope that the timing of this PR is in a quiet periodfor the Avitab repo and does not cause too much disruption!

jonaseberle commented 11 months ago

I am not much into this project's development (I am just excited to see what you guys have been doing!) but I understand that at some point with many contributors this becomes necessary so thank you.

Just a remark regarding the approach: Newer Git is very good in deciding what is text.

We have very good experience with just this as .gitattributes at work in a mixed OS environment:

# Enforce consistent line feed for all files that Git considers texty.
* text=auto eol=lf
mjh65 commented 11 months ago

When I was researching this on the web I found far too many different approaches, and many of those were probably historical and outdated.

I think there are some cases where CRLF line endings are required (eg Visual Studio solutions and projects), although currently Avitab does not have any of these files.

In the end I decided to create a rule for each type of file that was in the Avitab repo, as this seemed to guarantee the most predictable result. But I was probably being a little over-pessimistic.

@fpw, do you want me to simplify the gitattributes file, as proposed by @jonasberle?

fpw commented 11 months ago

@fpw, do you want me to simplify the gitattributes file, as proposed by @jonasberle?

Sounds good, that's also the approach I use in professional environments. Thanks for doing this, I should have sanitized this a long time ago.

mjh65 commented 11 months ago

Simplified gitattributes as discussed.