summaryrefslogtreecommitdiff
path: root/attr.c
diff options
context:
space:
mode:
authorMichael Haggerty <mhagger@alum.mit.edu>2011-08-12 21:43:05 (GMT)
committerJunio C Hamano <gitster@pobox.com>2011-08-14 22:01:58 (GMT)
commitba845b755078a043312119609c1ddd7406b20979 (patch)
treeeed7d6b063b68c468c8933a9d59a73d6ee75a687 /attr.c
parent86ab7f0ccaed279271d562049c923a6264d2fc70 (diff)
downloadgit-ba845b755078a043312119609c1ddd7406b20979.zip
git-ba845b755078a043312119609c1ddd7406b20979.tar.gz
git-ba845b755078a043312119609c1ddd7406b20979.tar.bz2
Document struct match_attr
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'attr.c')
-rw-r--r--attr.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/attr.c b/attr.c
index 6bc7ae9..c33e413 100644
--- a/attr.c
+++ b/attr.c
@@ -113,6 +113,20 @@ struct attr_state {
const char *setto;
};
+/*
+ * One rule, as from a .gitattributes file.
+ *
+ * If is_macro is true, then u.attr is a pointer to the git_attr being
+ * defined.
+ *
+ * If is_macro is false, then u.pattern points at the filename pattern
+ * to which the rule applies. (The memory pointed to is part of the
+ * memory block allocated for the match_attr instance.)
+ *
+ * In either case, num_attr is the number of attributes affected by
+ * this rule, and state is an array listing them. The attributes are
+ * listed as they appear in the file (macros unexpanded).
+ */
struct match_attr {
union {
char *pattern;