summaryrefslogtreecommitdiff
path: root/Documentation
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2012-10-15 06:24:39 (GMT)
committerJunio C Hamano <gitster@pobox.com>2012-10-15 21:57:17 (GMT)
commit82dce998c2028b6ee96691921b7037a6e182ec89 (patch)
treec521a6c799d79527e70672291afa0aa1e57da817 /Documentation
parent84460eec8dcc82417840bf4be2eb0c13d14b1c94 (diff)
downloadgit-82dce998c2028b6ee96691921b7037a6e182ec89.zip
git-82dce998c2028b6ee96691921b7037a6e182ec89.tar.gz
git-82dce998c2028b6ee96691921b7037a6e182ec89.tar.bz2
attr: more matching optimizations from .gitignore
.gitattributes and .gitignore share the same pattern syntax but has separate matching implementation. Over the years, ignore's implementation accumulates more optimizations while attr's stays the same. This patch reuses the core matching functions that are also used by excluded_from_list. excluded_from_list and path_matches can't be merged due to differences in exclude and attr, for example: * "!pattern" syntax is forbidden in .gitattributes. As an attribute can be unset (i.e. set to a special value "false") or made back to unspecified (i.e. not even set to "false"), "!pattern attr" is unclear which one it means. * we support attaching attributes to directories, but git-core internally does not currently make use of attributes on directories. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/gitattributes.txt1
1 files changed, 1 insertions, 0 deletions
diff --git a/Documentation/gitattributes.txt b/Documentation/gitattributes.txt
index 80120ea..b7c0e65 100644
--- a/Documentation/gitattributes.txt
+++ b/Documentation/gitattributes.txt
@@ -56,6 +56,7 @@ When more than one pattern matches the path, a later line
overrides an earlier line. This overriding is done per
attribute. The rules how the pattern matches paths are the
same as in `.gitignore` files; see linkgit:gitignore[5].
+Unlike `.gitignore`, negative patterns are forbidden.
When deciding what attributes are assigned to a path, git
consults `$GIT_DIR/info/attributes` file (which has the highest