Skip to content

Fix some annoyances with Git configuration#58

Merged
mlopatkin merged 2 commits into
mainfrom
ml/git-tweaks
Jun 11, 2026
Merged

Fix some annoyances with Git configuration#58
mlopatkin merged 2 commits into
mainfrom
ml/git-tweaks

Conversation

@mlopatkin

Copy link
Copy Markdown
Member

Exclude dotfiles from Git by default

This prevents .DS_Store and other accidental dotfiles from appearing as untracked.

Fix ever-changed gradlew.bat by removing crlf translation

The previous filter was operating under certain assumptions:

  1. The gradlew.bat is stored with LF endings in repo
  2. The content filter translates LF to CRLF during checkout because of the .gitattributes text eol=crlf
  3. The content filter translates CRLF to LF when comparing to the commited version or committing

Dependabot updates bypassed step (3) and commited CRLF-endings directly to the repo. Now (1) doesn't hold; (2) becomes no-op, but (3) still works and compares back-translated version with LF line endings to the store version with CRLF - this obviously doesn't match, hence the always changed file in the checkout.

This commit accommodates for Dependabot's magic. Now we assume that the BAT files are stored with CRLF in the repo, and explicitly disable eol translation for those who have this enabled (otherwise they'd get LF endings because of global translation filter on Linux/macOS).

This has a downside that you have to be careful not to commit LF-ended gradlew.bat, but this shouldn't be too much of an issue, and we don't build on Windows too often anyway.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Updates repository Git configuration to reduce noise from accidental dotfiles and to stabilize checkout/commit behavior for Windows .bat files (notably gradlew.bat) in the presence of Dependabot and line-ending normalization.

Changes:

  • Ignore all dotfiles by default, while explicitly re-including key repo configuration directories/files.
  • Adjust .gitattributes to disable EOL normalization for *.bat and mark *.jar as binary.

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.

File Description
.gitignore Switches to a “ignore dotfiles by default” rule with explicit allow-listing for repo config and CI dirs.
.gitattributes Disables text/EOL normalization for .bat files and adds a binary attribute for .jar files.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .gitattributes Outdated
The previous filter was operating under certain assumptions:
1. The gradlew.bat is stored with LF endings in repo
2. The content filter translates LF to CRLF during checkout because
   of the .gitattributes `text eol=crlf`
3. The content filter translates CRLF to LF when comparing to the
   commited version or committing

Dependabot updates bypassed step (3) and commited CRLF-endings directly
to the repo. Now (1) doesn't hold; (2) becomes no-op, but (3) still
works and compares back-translated version with LF line endings to the
store version with CRLF - this obviously doesn't match, hence the always
changed file in the checkout.

This commit accommodates for Dependabot's magic. Now we assume that the
BAT files are stored with CRLF in the repo, and explicitly disable eol
translation for those who have this enabled (otherwise they'd get LF
endings because of global translation filter on Linux/macOS).

This has a downside that you have to be careful not to commit LF-ended
gradlew.bat, but this shouldn't be too much of an issue, and we don't
build on Windows too often anyway.
@mlopatkin
mlopatkin merged commit da26ac4 into main Jun 11, 2026
3 checks passed
@mlopatkin
mlopatkin deleted the ml/git-tweaks branch June 11, 2026 09:05
@mlopatkin mlopatkin self-assigned this Jun 11, 2026
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