You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Line-ending rules for nested repos do not work when the nested repo has its own .gitattributes, and repeat on each pull #231
Setup: a fork of tdesktop at bf4f714.
Its root .gitattributes has * text=auto and *.bat text eol=crlf.
My fork also has Telegram/ThirdParty/** -text -eol.
I cloned three repos next to their nested copies, so the same parent rules apply:
Each clone added -text rules for its .bat files.
I compared the result with a plain checkout of the same commit, as a submodule would have it:
Nested repo
Its own .gitattributes
Plain checkout
After the clone
Result
lib_base
none
LF
LF
correct
expected-lite
* text=auto
LF
CRLF
wrong: 9 rules, no effect
xxHash
*.bat text eol=crlf
CRLF
CRLF
correct, but 5 rules that are not necessary
1. -text has no effect when the nested repo sets text itself. A deeper .gitattributes wins, so expected-lite's * text=auto overrides the root -text. The root's eol=crlf still applies, so the files stay CRLF. -text -eol works: git check-attr then gives text: auto, eol: unset, and the files are LF.
2. Rules for files that are already correct. xxHash's own *.bat text eol=crlf writes these files with CRLF, the same as in a plain checkout. git-nested still adds -text rules for them.
3. The rules repeat on each pull that changes the repo. The next pull of xxHash-test (pull --force -b 2ec67caeb18ec15ae60c0853174331089acddfc0) added the same 5 lines again, in a new "keep ... files as upstream has them" commit. Now .gitattributes has 10 lines for 5 files. The files still match their rules, so each pull finds them again.
Activity