Skip to content

chore: enforce linefeeds at eols in the .gitattributes file [skip ci] #28

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

Merged
merged 1 commit into from
Sep 27, 2022

Conversation

RaisinTen
Copy link
Member

We should avoid making changes to the global git config if we can help it. This change stops setting the value for core.autocrlf globally on CI by moving it to the .gitattributes file which is local to a git repository.

This should help out with removing this change from
https://github.com/postmanlabs/postject/pull/8/files#diff-78a8a19706dbd2a4425dd72bdab0502ed7a2cef16365ab7030a5a0588927bf47R68-R69.

Refs: https://stackoverflow.com/a/52996849
Signed-off-by: Darshan Sen raisinten@gmail.com

@dsanders11
Copy link
Contributor

Should we narrow the scope of this? Just to avoid unintended side effects. Both Chromium and Electron change it on a per-file type basis rather than everything, for example. We could limit it to the file types we care about:

*.c text eol=lf
*.cc text eol=lf
*.h text eol=lf
*.js text eol=lf
*.markdown text eol=lf
*.mjs text eol=lf

Also, can we change the commit message? I think mentioning core.autocrlf is misleading since it isn't changed. Also, semantic commit message would be great. 🙂

@RaisinTen RaisinTen force-pushed the add-.gitattributes-file branch from a5a5316 to 8ea3b71 Compare September 26, 2022 05:25
@RaisinTen RaisinTen changed the title [skip ci] Set core.autocrlf to false in the .gitattributes file [skip ci] chore: enforce linefeeds at eols in the .gitattributes file Sep 26, 2022
@RaisinTen
Copy link
Member Author

@dsanders11 done, PTAL!

We should avoid making changes to the global git config if we can help
it. This change stops setting the value for core.autocrlf globally on CI
by moving it to the .gitattributes file which is local to a git
repository.

This should help out with removing this change from
https://github.com/postmanlabs/postject/pull/8/files#diff-78a8a19706dbd2a4425dd72bdab0502ed7a2cef16365ab7030a5a0588927bf47R68-R69.

Refs: https://stackoverflow.com/a/52996849
Signed-off-by: Darshan Sen <raisinten@gmail.com>
@dsanders11 dsanders11 force-pushed the add-.gitattributes-file branch from 8ea3b71 to fb92d80 Compare September 27, 2022 04:03
@dsanders11 dsanders11 changed the title [skip ci] chore: enforce linefeeds at eols in the .gitattributes file chore: enforce linefeeds at eols in the .gitattributes file [skip ci] Sep 27, 2022
Copy link
Contributor

@dsanders11 dsanders11 left a comment

Choose a reason for hiding this comment

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

@RaisinTen, LGTM. I rebased it to test the semantic commit check (worked as expected) and then moved [skip ci] to the end of the commit message to make the check happy, which also worked as expected.

@dsanders11 dsanders11 merged commit cda803a into main Sep 27, 2022
@RaisinTen RaisinTen deleted the add-.gitattributes-file branch September 27, 2022 04:51
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