2 .\" Title: git-check-attr
3 .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author]
4 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
7 .\" Source: Git 2.36.1.153.gf9b95943b6
10 .TH "GIT\-CHECK\-ATTR" "1" "05/20/2022" "Git 2\&.36\&.1\&.153\&.gf9b959" "Git Manual"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
25 .\" disable justification (adjust text to left margin only)
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
31 git-check-attr \- Display gitattributes information
35 \fIgit check\-attr\fR [\-a | \-\-all | <attr>\&...] [\-\-] <pathname>\&...
36 \fIgit check\-attr\fR \-\-stdin [\-z] [\-a | \-\-all | <attr>\&...]
41 For every pathname, this command will list if each attribute is \fIunspecified\fR, \fIset\fR, or \fIunset\fR as a gitattribute on that pathname\&.
46 List all attributes that are associated with the specified paths\&. If this option is used, then
48 attributes will not be included in the output\&.
54 \fB\&.gitattributes\fR
55 in the index only, ignoring the working tree\&.
60 Read pathnames from the standard input, one per line, instead of from the command\-line\&.
65 The output format is modified to be machine\-parsable\&. If
67 is also given, input paths are separated with a NUL character instead of a linefeed character\&.
72 Interpret all preceding arguments as attributes and all following arguments as path names\&.
75 If none of \fB\-\-stdin\fR, \fB\-\-all\fR, or \fB\-\-\fR is used, the first argument will be treated as an attribute and the rest of the arguments as pathnames\&.
78 The output is of the form: <path> COLON SP <attribute> COLON SP <info> LF
80 unless \fB\-z\fR is in effect, in which case NUL is used as delimiter: <path> NUL <attribute> NUL <info> NUL
82 <path> is the path of a file being queried, <attribute> is an attribute being queried and <info> can be either:
86 when the attribute is not defined for the path\&.
91 when the attribute is defined as false\&.
96 when the attribute is defined as true\&.
101 when a value has been assigned to the attribute\&.
104 Buffering happens as documented under the \fBGIT_FLUSH\fR option in \fBgit\fR(1)\&. The caller is responsible for avoiding deadlocks caused by overfilling an input buffer or reading from an empty output buffer\&.
107 In the examples, the following \fI\&.gitattributes\fR file is used:
113 *\&.java diff=java \-crlf myAttr
114 NoMyAttr\&.java !myAttr
115 README caveat=unspecified
131 Listing a single attribute:
138 $ git check\-attr diff org/example/MyClass\&.java
139 org/example/MyClass\&.java: diff: java
155 Listing multiple attributes for a file:
162 $ git check\-attr crlf diff myAttr \-\- org/example/MyClass\&.java
163 org/example/MyClass\&.java: crlf: unset
164 org/example/MyClass\&.java: diff: java
165 org/example/MyClass\&.java: myAttr: set
181 Listing all attributes for a file:
188 $ git check\-attr \-\-all \-\- org/example/MyClass\&.java
189 org/example/MyClass\&.java: diff: java
190 org/example/MyClass\&.java: myAttr: set
206 Listing an attribute for multiple files:
213 $ git check\-attr myAttr \-\- org/example/MyClass\&.java org/example/NoMyAttr\&.java
214 org/example/MyClass\&.java: myAttr: set
215 org/example/NoMyAttr\&.java: myAttr: unspecified
231 Not all values are equally unambiguous:
238 $ git check\-attr caveat README
239 README: caveat: unspecified
247 \fBgitattributes\fR(5)\&.
250 Part of the \fBgit\fR(1) suite