aboutsummaryrefslogtreecommitdiffstats
path: root/builtin.h
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2007-04-12 01:07:32 -0700
committerJunio C Hamano <junkio@cox.net>2007-04-14 08:57:06 -0700
commitd0bfd026a8241d544c339944976927b388d61a5e (patch)
tree391d50183538ddeb314ffc27c62a52527fe6182e /builtin.h
parentedb4fd79ec34254fc4a1c35e8834df4c92cb3bfd (diff)
downloadgit-d0bfd026a8241d544c339944976927b388d61a5e.tar.gz
Add basic infrastructure to assign attributes to paths
This adds the basic infrastructure to assign attributes to paths, in a way similar to what the exclusion mechanism does based on $GIT_DIR/info/exclude and .gitignore files. An attribute is just a simple string that does not contain any whitespace. They can be specified in $GIT_DIR/info/attributes file, and .gitattributes file in each directory. Each line in these files defines a pattern matching rule. Similar to the exclusion mechanism, a later match overrides an earlier match in the same file, and entries from .gitattributes file in the same directory takes precedence over the ones from parent directories. Lines in $GIT_DIR/info/attributes file are used as the lowest precedence default rules. A line is either a comment (an empty line, or a line that begins with a '#'), or a rule, which is a whitespace separated list of tokens. The first token on the line is a shell glob pattern. The rest are names of attributes, each of which can optionally be prefixed with '!'. Such a line means "if a path matches this glob, this attribute is set (or unset -- if the attribute name is prefixed with '!'). For glob matching, the same "if the pattern does not have a slash in it, the basename of the path is matched with fnmatch(3) against the pattern, otherwise, the path is matched with the pattern with FNM_PATHNAME" rule as the exclusion mechanism is used. This does not define what an attribute means. Tying an attribute to various effects it has on git operation for paths that have it will be specified separately. Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'builtin.h')
-rw-r--r--builtin.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/builtin.h b/builtin.h
index af203e9e36..d3f3a7496e 100644
--- a/builtin.h
+++ b/builtin.h
@@ -22,6 +22,7 @@ extern int cmd_branch(int argc, const char **argv, const char *prefix);
extern int cmd_bundle(int argc, const char **argv, const char *prefix);
extern int cmd_cat_file(int argc, const char **argv, const char *prefix);
extern int cmd_checkout_index(int argc, const char **argv, const char *prefix);
+extern int cmd_check_attr(int argc, const char **argv, const char *prefix);
extern int cmd_check_ref_format(int argc, const char **argv, const char *prefix);
extern int cmd_cherry(int argc, const char **argv, const char *prefix);
extern int cmd_cherry_pick(int argc, const char **argv, const char *prefix);