diff options
| author | Craig Jennings <c@cjennings.net> | 2024-04-07 13:41:34 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2024-04-07 13:41:34 -0500 |
| commit | 754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 (patch) | |
| tree | f1190704f78f04a2b0b4c977d20fe96a828377f1 /devdocs/git/git-check-attr.html | |
new repository
Diffstat (limited to 'devdocs/git/git-check-attr.html')
| -rw-r--r-- | devdocs/git/git-check-attr.html | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/devdocs/git/git-check-attr.html b/devdocs/git/git-check-attr.html new file mode 100644 index 00000000..99961732 --- /dev/null +++ b/devdocs/git/git-check-attr.html @@ -0,0 +1,18 @@ +<h1>git-check-attr</h1> <h2 id="_name">Name</h2> <div class="sectionbody"> <p>git-check-attr - Display gitattributes information</p> </div> <h2 id="_synopsis">Synopsis</h2> <div class="sectionbody"> <div class="verseblock"> <pre class="content" data-language="shell">git check-attr [--source <tree-ish>] [-a | --all | <attr>…] [--] <pathname>… +git check-attr --stdin [-z] [--source <tree-ish>] [-a | --all | <attr>…]</pre> </div> </div> <h2 id="_description">Description</h2> <div class="sectionbody"> <p>For every pathname, this command will list if each attribute is <code>unspecified</code>, <code>set</code>, or <code>unset</code> as a gitattribute on that pathname.</p> </div> <h2 id="_options">Options</h2> <div class="sectionbody"> <div class="dlist"> <dl> <dt class="hdlist1" id="Documentation/git-check-attr.txt--a--all"> -a, --all </dt> <dd> <p>List all attributes that are associated with the specified paths. If this option is used, then <code>unspecified</code> attributes will not be included in the output.</p> </dd> <dt class="hdlist1" id="Documentation/git-check-attr.txt---cached"> --cached </dt> <dd> <p>Consider <code>.gitattributes</code> in the index only, ignoring the working tree.</p> </dd> <dt class="hdlist1" id="Documentation/git-check-attr.txt---stdin"> --stdin </dt> <dd> <p>Read pathnames from the standard input, one per line, instead of from the command line.</p> </dd> <dt class="hdlist1" id="Documentation/git-check-attr.txt--z"> -z </dt> <dd> <p>The output format is modified to be machine-parsable. If <code>--stdin</code> is also given, input paths are separated with a NUL character instead of a linefeed character.</p> </dd> <dt class="hdlist1" id="Documentation/git-check-attr.txt---sourcelttree-ishgt"> --source=<tree-ish> </dt> <dd> <p>Check attributes against the specified tree-ish. It is common to specify the source tree by naming a commit, branch, or tag associated with it.</p> </dd> <dt class="hdlist1" id="Documentation/git-check-attr.txt---"> -- </dt> <dd> <p>Interpret all preceding arguments as attributes and all following arguments as path names.</p> </dd> </dl> </div> <p>If none of <code>--stdin</code>, <code>--all</code>, or <code>--</code> is used, the first argument will be treated as an attribute and the rest of the arguments as pathnames.</p> </div> <h2 id="_output">Output</h2> <div class="sectionbody"> <p>The output is of the form: <path> COLON SP <attribute> COLON SP <info> LF</p> <p>unless <code>-z</code> is in effect, in which case NUL is used as delimiter: <path> NUL <attribute> NUL <info> NUL</p> <p><path> is the path of a file being queried, <attribute> is an attribute being queried, and <info> can be either:</p> <div class="dlist"> <dl> <dt class="hdlist1" id="Documentation/git-check-attr.txt-emunspecifiedem"> <em>unspecified</em> </dt> <dd> <p>when the attribute is not defined for the path.</p> </dd> <dt class="hdlist1" id="Documentation/git-check-attr.txt-emunsetem"> <em>unset</em> </dt> <dd> <p>when the attribute is defined as false.</p> </dd> <dt class="hdlist1" id="Documentation/git-check-attr.txt-emsetem"> <em>set</em> </dt> <dd> <p>when the attribute is defined as true.</p> </dd> <dt class="hdlist1" id="Documentation/git-check-attr.txt-ltvaluegt"> <value> </dt> <dd> <p>when a value has been assigned to the attribute.</p> </dd> </dl> </div> <p>Buffering happens as documented under the <code>GIT_FLUSH</code> option in <a href="git">git[1]</a>. The caller is responsible for avoiding deadlocks caused by overfilling an input buffer or reading from an empty output buffer.</p> </div> <h2 id="_examples">Examples</h2> <div class="sectionbody"> <p>In the examples, the following <code>.gitattributes</code> file is used:</p> <div class="listingblock"> <div class="content"> <pre>*.java diff=java -crlf myAttr +NoMyAttr.java !myAttr +README caveat=unspecified</pre> </div> </div> <div class="ulist"> <ul> <li> <p>Listing a single attribute:</p> </li> </ul> </div> <div class="listingblock"> <div class="content"> <pre data-language="shell-session">$ git check-attr diff org/example/MyClass.java +org/example/MyClass.java: diff: java</pre> </div> </div> <div class="ulist"> <ul> <li> <p>Listing multiple attributes for a file:</p> </li> </ul> </div> <div class="listingblock"> <div class="content"> <pre data-language="shell-session">$ git check-attr crlf diff myAttr -- org/example/MyClass.java +org/example/MyClass.java: crlf: unset +org/example/MyClass.java: diff: java +org/example/MyClass.java: myAttr: set</pre> </div> </div> <div class="ulist"> <ul> <li> <p>Listing all attributes for a file:</p> </li> </ul> </div> <div class="listingblock"> <div class="content"> <pre data-language="shell-session">$ git check-attr --all -- org/example/MyClass.java +org/example/MyClass.java: diff: java +org/example/MyClass.java: myAttr: set</pre> </div> </div> <div class="ulist"> <ul> <li> <p>Listing an attribute for multiple files:</p> </li> </ul> </div> <div class="listingblock"> <div class="content"> <pre data-language="shell-session">$ git check-attr myAttr -- org/example/MyClass.java org/example/NoMyAttr.java +org/example/MyClass.java: myAttr: set +org/example/NoMyAttr.java: myAttr: unspecified</pre> </div> </div> <div class="ulist"> <ul> <li> <p>Not all values are equally unambiguous:</p> </li> </ul> </div> <div class="listingblock"> <div class="content"> <pre data-language="shell-session">$ git check-attr caveat README +README: caveat: unspecified</pre> </div> </div> </div> <h2 id="_see_also">See also</h2> <div class="sectionbody"> <p><a href="gitattributes">gitattributes[5]</a>.</p> </div><div class="_attribution"> + <p class="_attribution-p"> + © 2012–2024 Scott Chacon and others<br>Licensed under the MIT License.<br> + <a href="https://git-scm.com/docs/git-check-attr" class="_attribution-link">https://git-scm.com/docs/git-check-attr</a> + </p> +</div> |
