git-check-attr: Add an --all option to show all attributes
[git/jnareb-git.git] / Documentation / git-check-attr.txt
blob798e5d5b4f740bf7d579f37df787b315164bffb6
1 git-check-attr(1)
2 =================
4 NAME
5 ----
6 git-check-attr - Display gitattributes information
9 SYNOPSIS
10 --------
11 [verse]
12 'git check-attr' [-a | --all | attr...] [--] pathname...
13 'git check-attr' --stdin [-z] [-a | --all | attr...] < <list-of-paths>
15 DESCRIPTION
16 -----------
17 For every pathname, this command will list if each attribute is 'unspecified',
18 'set', or 'unset' as a gitattribute on that pathname.
20 OPTIONS
21 -------
22 -a, --all::
23         List all attributes that are associated with the specified
24         paths.  If this option is used, then 'unspecified' attributes
25         will not be included in the output.
27 --stdin::
28         Read file names from stdin instead of from the command-line.
30 -z::
31         Only meaningful with `--stdin`; paths are separated with a
32         NUL character instead of a linefeed character.
34 \--::
35         Interpret all preceding arguments as attributes and all following
36         arguments as path names. If not supplied, only the first argument will
37         be treated as an attribute.
39 OUTPUT
40 ------
42 The output is of the form:
43 <path> COLON SP <attribute> COLON SP <info> LF
45 <path> is the path of a file being queried, <attribute> is an attribute
46 being queried and <info> can be either:
48 'unspecified';; when the attribute is not defined for the path.
49 'unset';;       when the attribute is defined as false.
50 'set';;         when the attribute is defined as true.
51 <value>;;       when a value has been assigned to the attribute.
53 EXAMPLES
54 --------
56 In the examples, the following '.gitattributes' file is used:
57 ---------------
58 *.java diff=java -crlf myAttr
59 NoMyAttr.java !myAttr
60 README caveat=unspecified
61 ---------------
63 * Listing a single attribute:
64 ---------------
65 $ git check-attr diff org/example/MyClass.java
66 org/example/MyClass.java: diff: java
67 ---------------
69 * Listing multiple attributes for a file:
70 ---------------
71 $ git check-attr crlf diff myAttr -- org/example/MyClass.java
72 org/example/MyClass.java: crlf: unset
73 org/example/MyClass.java: diff: java
74 org/example/MyClass.java: myAttr: set
75 ---------------
77 * Listing all attributes for a file:
78 ---------------
79 $ git check-attr --all -- org/example/MyClass.java
80 org/example/MyClass.java: diff: java
81 org/example/MyClass.java: myAttr: set
82 ---------------
84 * Listing an attribute for multiple files:
85 ---------------
86 $ git check-attr myAttr -- org/example/MyClass.java org/example/NoMyAttr.java
87 org/example/MyClass.java: myAttr: set
88 org/example/NoMyAttr.java: myAttr: unspecified
89 ---------------
91 * Not all values are equally unambiguous:
92 ---------------
93 $ git check-attr caveat README
94 README: caveat: unspecified
95 ---------------
97 SEE ALSO
98 --------
99 linkgit:gitattributes[5].
103 Part of the linkgit:git[1] suite