Commit db8a5f5
committed
Anchor the .gitattributes entries to the repo root
Copilot: the six entries were unanchored basename patterns, so git applied
them at any depth. Measured before the fix:
some/deep/dir/.pylintrc text: set
.codex/skills/ruleset.xml text: set
sub/.bandit text: set
That directly contradicts this PR's own claim -- "no pattern, so no file
outside the named six can be affected." A .gitattributes pattern with no
slash is a basename match, exactly like .gitignore. Which is the same trap
I documented in #953 one PR earlier, in the other direction.
Each entry now carries a leading slash. Verified after:
root .bandit/.pylintrc/.remarkrc/.shellcheckrc/.stylelintrc/ruleset.xml
text: set (unchanged)
some/deep/dir/.pylintrc text: unspecified (was: set)
.codex/skills/ruleset.xml text: unspecified (was: set)
sub/.bandit text: unspecified (was: set)
RSS.xml text: unspecified (unchanged)
The comment now explains the anchoring alongside the `*.xml` note, since
the two traps have the same root cause: git pattern matching is
path-anchored only when the pattern contains a slash.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EBV6TkrwsZhcwkh1b6NUHs1 parent 5079057 commit db8a5f5
1 file changed
Lines changed: 10 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
117 | 121 | | |
118 | 122 | | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
0 commit comments