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

fix: unmark scripts as binary files in .gitattributes #979

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

acuteaangle
Copy link
Contributor

This is an alternative to PR #977


The current .gitattributes file marks all bash scripts as binary files, which prevents most git commands like git diff from working properly unless a --text argument is given, and entirely breaks the default merge strategy and conflict markers during manual merges.

This was originally done to ensure bash scripts would keep their LF line-endings on Windows; however, this is better accomplished by the text eol=lf attributes instead. text eol=lf instructs git to always checkout specified text files with LF line-endings, regardless of what line-endings are considered 'native' on the current system.

This commit changes the binary attribute to text eol=lf for shell scripts, continuing to ensure they are checked out with LF line-endings on Windows, while also allowing git utilities like git diff, git log -p, and merges to work as expected.

Closes: gh-977

The current `.gitattributes` file marks all bash scripts as binary
files, which prevents most `git` commands like `git diff` from working
properly unless a `--text` argument is given, and entirely breaks
the default merge strategy and conflict markers during manual merges.

This was originally done to ensure bash scripts would keep their LF
line-endings on Windows; however, this is better accomplished by the
`text eol=lf` attributes instead. `text eol=lf` instructs git to always
checkout specified text files with LF line-endings, regardless of what
line-endings are considered 'native' on the current system.

This commit changes the `binary` attribute to `text eol=lf` for shell
scripts, continuing to ensure they are checked out with LF line-endings
on Windows, while also allowing `git` utilities like `git diff`, `git log
-p`, and merges to work as expected.

Closes: mipopsgh-977
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.

1 participant