Skip to content

Commit 5782566

Browse files
jonasgitster
authored andcommitted
git-check-attr(1): add output and example sections
Plumbing tools should document what output can be expected. Signed-off-by: Jonas Fonseca <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 563d5a2 commit 5782566

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

Documentation/git-check-attr.txt

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,56 @@ OPTIONS
2222
arguments as path names. If not supplied, only the first argument will
2323
be treated as an attribute.
2424

25+
OUTPUT
26+
------
27+
28+
The output is of the form:
29+
<path> COLON SP <attribute> COLON SP <info> LF
30+
31+
Where <path> is the path of a file being queried, <attribute> is an attribute
32+
being queried and <info> can be either:
33+
34+
'unspecified';; when the attribute is not defined for the path.
35+
'unset';; when the attribute is defined to false.
36+
'set';; when the attribute is defined to true.
37+
<value>;; when a value has been assigned to the attribute.
38+
39+
EXAMPLES
40+
--------
41+
42+
In the examples, the following '.gitattributes' file is used:
43+
---------------
44+
*.java diff=java -crlf myAttr
45+
NoMyAttr.java !myAttr
46+
README caveat=unspecified
47+
---------------
48+
49+
* Listing a single attribute:
50+
---------------
51+
$ git check-attr diff org/example/MyClass.java
52+
org/example/MyClass.java: diff: java
53+
---------------
54+
55+
* Listing multiple attributes for a file:
56+
---------------
57+
$ git check-attr crlf diff myAttr -- org/example/MyClass.java
58+
org/example/MyClass.java: crlf: unset
59+
org/example/MyClass.java: diff: java
60+
org/example/MyClass.java: myAttr: set
61+
---------------
62+
63+
* Listing attribute for multiple files:
64+
---------------
65+
$ git check-attr myAttr -- org/example/MyClass.java org/example/NoMyAttr.java
66+
org/example/MyClass.java: myAttr: set
67+
org/example/NoMyAttr.java: myAttr: unspecified
68+
---------------
69+
70+
* Not all values are equally unambiguous:
71+
---------------
72+
$ git check-attr caveat README
73+
README: caveat: unspecified
74+
---------------
2575

2676
SEE ALSO
2777
--------

0 commit comments

Comments
 (0)