]>
Commit | Line | Data |
---|---|---|
b568a503 JB |
1 | git-check-attr(1) |
2 | ================= | |
3 | ||
4 | NAME | |
5 | ---- | |
0d641f75 | 6 | git-check-attr - Display gitattributes information |
b568a503 JB |
7 | |
8 | ||
9 | SYNOPSIS | |
10 | -------- | |
e7108fcb | 11 | [verse] |
b1889c36 | 12 | 'git check-attr' attr... [--] pathname... |
e7108fcb | 13 | 'git check-attr' --stdin [-z] attr... < <list-of-paths> |
b568a503 JB |
14 | |
15 | DESCRIPTION | |
16 | ----------- | |
3460a600 | 17 | For every pathname, this command will list if each attribute is 'unspecified', |
b568a503 JB |
18 | 'set', or 'unset' as a gitattribute on that pathname. |
19 | ||
20 | OPTIONS | |
21 | ------- | |
b4666852 DP |
22 | --stdin:: |
23 | Read file names from stdin instead of from the command-line. | |
24 | ||
25 | -z:: | |
3460a600 DM |
26 | Only meaningful with `--stdin`; paths are separated with a |
27 | NUL character instead of a linefeed character. | |
b4666852 | 28 | |
b568a503 | 29 | \--:: |
3460a600 | 30 | Interpret all preceding arguments as attributes and all following |
b568a503 JB |
31 | arguments as path names. If not supplied, only the first argument will |
32 | be treated as an attribute. | |
33 | ||
5782566d JF |
34 | OUTPUT |
35 | ------ | |
36 | ||
37 | The output is of the form: | |
38 | <path> COLON SP <attribute> COLON SP <info> LF | |
39 | ||
3460a600 | 40 | <path> is the path of a file being queried, <attribute> is an attribute |
5782566d JF |
41 | being queried and <info> can be either: |
42 | ||
43 | 'unspecified';; when the attribute is not defined for the path. | |
3460a600 DM |
44 | 'unset';; when the attribute is defined as false. |
45 | 'set';; when the attribute is defined as true. | |
5782566d JF |
46 | <value>;; when a value has been assigned to the attribute. |
47 | ||
48 | EXAMPLES | |
49 | -------- | |
50 | ||
51 | In the examples, the following '.gitattributes' file is used: | |
52 | --------------- | |
53 | *.java diff=java -crlf myAttr | |
54 | NoMyAttr.java !myAttr | |
55 | README caveat=unspecified | |
56 | --------------- | |
57 | ||
58 | * Listing a single attribute: | |
59 | --------------- | |
60 | $ git check-attr diff org/example/MyClass.java | |
61 | org/example/MyClass.java: diff: java | |
62 | --------------- | |
63 | ||
64 | * Listing multiple attributes for a file: | |
65 | --------------- | |
66 | $ git check-attr crlf diff myAttr -- org/example/MyClass.java | |
67 | org/example/MyClass.java: crlf: unset | |
68 | org/example/MyClass.java: diff: java | |
69 | org/example/MyClass.java: myAttr: set | |
70 | --------------- | |
71 | ||
3460a600 | 72 | * Listing an attribute for multiple files: |
5782566d JF |
73 | --------------- |
74 | $ git check-attr myAttr -- org/example/MyClass.java org/example/NoMyAttr.java | |
75 | org/example/MyClass.java: myAttr: set | |
76 | org/example/NoMyAttr.java: myAttr: unspecified | |
77 | --------------- | |
78 | ||
79 | * Not all values are equally unambiguous: | |
80 | --------------- | |
81 | $ git check-attr caveat README | |
82 | README: caveat: unspecified | |
83 | --------------- | |
b568a503 | 84 | |
0e545f75 JH |
85 | SEE ALSO |
86 | -------- | |
5162e697 | 87 | linkgit:gitattributes[5]. |
0e545f75 JH |
88 | |
89 | ||
b568a503 JB |
90 | Author |
91 | ------ | |
59eb68aa | 92 | Written by Junio C Hamano <gitster@pobox.com> |
b568a503 JB |
93 | |
94 | Documentation | |
95 | -------------- | |
96 | Documentation by James Bowes. | |
97 | ||
98 | GIT | |
99 | --- | |
9e1f0a85 | 100 | Part of the linkgit:git[1] suite |