Not really. I'd rather see a handful of test cases added to t0003 to help
interested parties to see what is broken and what is not.
Quoting from Marcin's other message, assuming that "Patterns" are stored
in either .gitattributes at the top level or .git/info/attributes:
No slashes, so it should match anywhere (correct).
With slashes, so this is anchored at the toplevel of the working tree, and
the path should match (correct).
The same as above;, the leading '/' is only to make it explicit that it is
anchored at the level
Should match.
Should match.
This shouldn't match unless it appears in d1/.gitattributes.
The presense of '/' makes the pattern anchored to the directory it appear
in, and .git/info/attributes is taken as being at the top level.
These shouldn't for the same reason.
We somehow don't do leading path match like we do for gitignore, but I do
not think this was intended. My gut feeling is that these should match.
The thinking back, when we wrote the code, could have been that, unlike
gitignore that maintains only one bit (either "ignored" or "not"),
attributes are richer and giving the same attribute (say "whitespace
checking criteria") to files inside a directory and the containing
directory itself was nonsensical. But if that was the reason, it is
faulty, as we do not track directories anyway.
Wouldn't it be sufficient to teach attr.c:path_matches() that a pattern
could also match with leading path? That would automatically cover the
case where a pattern is terminated with a slash, as pattern "d/e/" would
never match path "d/e" but does match "d/e/f"?
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html