Skip to content
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 and fix line endings #159

Merged

Conversation

marcoveeneman
Copy link
Contributor

Line endings were not automatically handled by git yet, causing files in the repository to not have consistent line endings. This can cause annoying problems with pull requests. By adding the .gitattributes file to the repository this problem will be solved since all clients will now treat line endings the same way.

See https://docs.github.com/en/free-pro-team@latest/github/using-git/configuring-git-to-handle-line-endings for more information regarding .gitattributes.

@WouterJD
Copy link
Owner

Marco

I have investigated this and discussed with you already some time ago.
We know that there are open branches outside, so I have tried to write down a working-instruction how to handle that

https://github.com/WouterJD/FortiusANT/wiki/FortiusANT-development-guidelines#new-lines

Please check whether that is correct.

My idea is:

  • Treat master as described, then master is done (I assume this PR is running behind, with exception of .gitattributes)
  • From that moment, no branches can be merged if they do not have the .gitattributes defined
  • I will have to handle my Please implement Bluetooth support #103 branch as described
  • Same for you for your working-branches, as well as e.g. @switchabl, I will send him a separate note

Perhaps would be good to have @SwitchaBLE and @cyclingflow approve this PR

Is that the way to go to avoid issues?

Also, would it be "safer" to exclude all files that we definitely want untouched:

# See https://git-scm.com/docs/gitattributes

# https://git-scm.com/docs/gitattributes#_text

*       text=auto
*.txt   text

# Declare files that will always have CRLF line endings on checkout.
# https://git-scm.com/docs/gitattributes#_eol
*.bat   text eol=crlf

# Declare files that must be untouched
*.hex   -text
*.ico   -text
*.jpg   -text
*.pdf   -text
*.xls*  -text

@marcoveeneman
Copy link
Contributor Author

@WouterJD i read the page and it looks good to me. Just one remark: When a branch does not have the .gitattributes yet, but master does, the branch must not commit it. This way, you get the line endings up-to-date and prevent a merge conflict on the .gitattributes file.

Indeed this branch is outdated, i'll update it to master.

@marcoveeneman marcoveeneman force-pushed the add-gitattributes-and-fix-line-endings branch from b0a72c6 to f4c37e9 Compare December 23, 2020 16:34
@marcoveeneman
Copy link
Contributor Author

Branch should be up to date with master now. I included your suggestion regarding binary files, however i replaced -text by binary, which is the preferred way to indicate a binary file.

@marcoveeneman
Copy link
Contributor Author

Marco

I have investigated this and discussed with you already some time ago.
We know that there are open branches outside, so I have tried to write down a working-instruction how to handle that

https://github.com/WouterJD/FortiusANT/wiki/FortiusANT-development-guidelines#new-lines

Please check whether that is correct.

My idea is:

  • Treat master as described, then master is done (I assume this PR is running behind, with exception of .gitattributes)
  • From that moment, no branches can be merged if they do not have the .gitattributes defined
  • I will have to handle my Please implement Bluetooth support #103 branch as described
  • Same for you for your working-branches, as well as e.g. @switchabl, I will send him a separate note

Perhaps would be good to have @SwitchaBLE and @cyclingflow approve this PR

Is that the way to go to avoid issues?

Also, would it be "safer" to exclude all files that we definitely want untouched:

# See https://git-scm.com/docs/gitattributes

# https://git-scm.com/docs/gitattributes#_text

*       text=auto
*.txt   text

# Declare files that will always have CRLF line endings on checkout.
# https://git-scm.com/docs/gitattributes#_eol
*.bat   text eol=crlf

# Declare files that must be untouched
*.hex   -text
*.ico   -text
*.jpg   -text
*.pdf   -text
*.xls*  -text

Regarding the wiki page, did you also have a look at this? https://docs.github.com/en/free-pro-team@latest/github/building-a-strong-community/setting-guidelines-for-repository-contributors

@WouterJD WouterJD merged commit b5b8c3e into WouterJD:master Dec 24, 2020
@switchabl
Copy link
Contributor

Fixing the line breaks seems like a good idea to me. Now that master branch is fixed, I will fix my development branches as well.

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.

3 participants