Skip to content

fix: line-ending rules in .gitattributes work with upstream's own rules - #239

Merged
thorsten-klein merged 2 commits into
mainfrom
fix/231-line-ending-rules
Nov 29, 2026
Merged

thorsten-klein merged 2 commits into
mainfrom
fix/231-line-ending-rules

Conversation

@thorsten-klein

Copy link
Copy Markdown
Owner

What this changes

The rules that keep a nested repo's files as upstream has them:

  • The rule is now -text -eol. A nested repo's own text (for example * text=auto) wins over the parent's -text. The parent's eol=crlf then still applied.
  • A file gets no rule when the parent's attributes do not change it. git-nested compares the text and eol attributes with those of upstream alone.
  • A pull does not add a rule again. An old -text rule for the same file becomes -text -eol.

Why

The rules had no effect when the nested repo has its own .gitattributes, were added for files that were already correct, and repeated on each pull.

Fixes #231

Checklist

  • uv run poe all passes (ruff, mypy, pyright, bandit, complexipy, and the
    tests at 100% coverage)
  • New behaviour has a test
  • README / --help / the man page updated, if the change is visible to users
  • The PR title reads as a Conventional Commit

…ules

- The rule is now `-text -eol`. Upstream's own `text` wins over the
  parent's `-text`, so the parent's `eol` still applied.
- A file gets no rule when the parent's attributes do not change it.
- A pull does not add a rule again. An old `-text` rule becomes the new one.

Fixes #231
@codecov

codecov Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (15287ab) to head (e6994a5).
⚠️ Report is 3 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##              main      #239   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           51        51           
  Lines         3481      3508   +27     
=========================================
+ Hits          3481      3508   +27     
Files with missing lines Coverage Δ
src/git_nested/content.py 100.00% <100.00%> (ø)

@sonarqubecloud

Copy link
Copy Markdown

@thorsten-klein
thorsten-klein merged commit 6fbea39 into main Nov 29, 2026
15 checks passed
@thorsten-klein
thorsten-klein deleted the fix/231-line-ending-rules branch November 29, 2026 10:37
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.

Line-ending rules for nested repos do not work when the nested repo has its own .gitattributes, and repeat on each pull

1 participant