* mh/check-attr-relative: (29 commits)
test-path-utils: Add subcommand "prefix_path"
test-path-utils: Add subcommand "absolute_path"
git-check-attr: Normalize paths
git-check-attr: Demonstrate problems with relative paths
git-check-attr: Demonstrate problems with unnormalized paths
git-check-attr: test that no output is written to stderr
Rename git_checkattr() to git_check_attr()
git-check-attr: Fix command-line handling to match docs
git-check-attr: Drive two tests using the same raw data
git-check-attr: Add an --all option to show all attributes
git-check-attr: Error out if no pathnames are specified
git-check-attr: Process command-line args more systematically
git-check-attr: Handle each error separately
git-check-attr: Extract a function error_with_usage()
git-check-attr: Introduce a new variable
git-check-attr: Extract a function output_attr()
Allow querying all attributes on a file
Remove redundant check
Remove redundant call to bootstrap_attr_stack()
Extract a function collect_all_attrs()
...
@ -19,6 +19,11 @@ For every pathname, this command will list if each attribute is 'unspecified',
@@ -19,6 +19,11 @@ For every pathname, this command will list if each attribute is 'unspecified',
OPTIONS
-------
-a, --all::
List all attributes that are associated with the specified
paths. If this option is used, then 'unspecified' attributes
will not be included in the output.
--stdin::
Read file names from stdin instead of from the command-line.
@ -11,27 +11,15 @@ Data Structure
@@ -11,27 +11,15 @@ Data Structure
`struct git_attr`::
An attribute is an opaque object that is identified by its name.
Pass the name and its length to `git_attr()` function to obtain
the object of this type. The internal representation of this
structure is of no interest to the calling programs.
Pass the name to `git_attr()` function to obtain the object of
this type. The internal representation of this structure is
of no interest to the calling programs. The name of the
attribute can be retrieved by calling `git_attr_name()`.
`struct git_attr_check`::
This structure represents a set of attributes to check in a call
to `git_checkattr()` function, and receives the results.
Calling Sequence
----------------
* Prepare an array of `struct git_attr_check` to define the list of
attributes you would want to check. To populate this array, you would
need to define necessary attributes by calling `git_attr()` function.
* Call git_checkattr() to check the attributes for the path.
* Inspect `git_attr_check` structure to see how each of the attribute in
the array is defined for the path.
to `git_check_attr()` function, and receives the results.
Attribute Values
@ -57,6 +45,19 @@ If none of the above returns true, `.value` member points at a string
@@ -57,6 +45,19 @@ If none of the above returns true, `.value` member points at a string
value of the attribute for the path.
Querying Specific Attributes
----------------------------
* Prepare an array of `struct git_attr_check` to define the list of
attributes you would want to check. To populate this array, you would
need to define necessary attributes by calling `git_attr()` function.
* Call `git_check_attr()` to check the attributes for the path.
* Inspect `git_attr_check` structure to see how each of the attribute in