git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 2/7] Document struct match_attr

From
Michael Haggerty <mhagger@alum.mit.edu>
Date
Aug 12, 2011, 21:43 UTC
Message-ID
<1313185390-19724-3-git-send-email-mhagger@alum.mit.edu>
In-Reply-To
<1313185390-19724-1-git-send-email-mhagger@alum.mit.edu>
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
---
 attr.c |   14 ++++++++++++++
 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;
-- 
1.7.6.8.gd2879
Previous: Michael HaggertyNext: Michael Haggerty
Message 3 of 8 in “Comments and refactoring in attr.c”
  1. 0/7 Comments and refactoring in attr.cMichael Haggerty, Aug 12, 2011
  2. 1/7 Add a file commentMichael Haggerty, Aug 12, 2011
  3. 2/7 Document struct match_attrMichael Haggerty, Aug 12, 2011
  4. 3/7 Increment num_attr in parse_attr_line(), not parse_attr()Michael Haggerty, Aug 12, 2011
  5. 4/7 Change parse_attr() to take a pointer to struct attr_stateMichael Haggerty, Aug 12, 2011
  6. 5/7 Determine the start of the states outside of the pass loopMichael Haggerty, Aug 12, 2011
  7. 6/7 Change while loop into for loopMichael Haggerty, Aug 12, 2011
  8. 7/7 Unroll the loop over passesMichael Haggerty, Aug 12, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.