man-pages/man1/git-check-attr.1.html
2021-03-31 01:06:50 +01:00

315 lines
5.2 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of GIT-CHECK-ATTR</TITLE>
</HEAD><BODY>
<H1>GIT-CHECK-ATTR</H1>
Section: Git Manual (1)<BR>Updated: 03/04/2021<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
git-check-attr - Display gitattributes information
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<P>
<PRE>
<I>git check-attr</I> [-a | --all | &lt;attr&gt;...] [--] &lt;pathname&gt;...
<I>git check-attr</I> --stdin [-z] [-a | --all | &lt;attr&gt;...]
</PRE>
<P>
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
<P>
For every pathname, this command will list if each attribute is <I>unspecified</I>, <I>set</I>, or <I>unset</I> as a gitattribute on that pathname.
<A NAME="lbAE">&nbsp;</A>
<H2>OPTIONS</H2>
<P>
-a, --all
<DL COMPACT><DT id="1"><DD>
List all attributes that are associated with the specified paths. If this option is used, then
<I>unspecified</I>
attributes will not be included in the output.
</DL>
<P>
--cached
<DL COMPACT><DT id="2"><DD>
Consider
<B>.gitattributes</B>
in the index only, ignoring the working tree.
</DL>
<P>
--stdin
<DL COMPACT><DT id="3"><DD>
Read pathnames from the standard input, one per line, instead of from the command-line.
</DL>
<P>
-z
<DL COMPACT><DT id="4"><DD>
The output format is modified to be machine-parsable. If
<B>--stdin</B>
is also given, input paths are separated with a NUL character instead of a linefeed character.
</DL>
<P>
--
<DL COMPACT><DT id="5"><DD>
Interpret all preceding arguments as attributes and all following arguments as path names.
</DL>
<P>
If none of <B>--stdin</B>, <B>--all</B>, or <B>--</B> is used, the first argument will be treated as an attribute and the rest of the arguments as pathnames.
<A NAME="lbAF">&nbsp;</A>
<H2>OUTPUT</H2>
<P>
The output is of the form: &lt;path&gt; COLON SP &lt;attribute&gt; COLON SP &lt;info&gt; LF
<P>
unless <B>-z</B> is in effect, in which case NUL is used as delimiter: &lt;path&gt; NUL &lt;attribute&gt; NUL &lt;info&gt; NUL
<P>
&lt;path&gt; is the path of a file being queried, &lt;attribute&gt; is an attribute being queried and &lt;info&gt; can be either:
<P>
<I>unspecified</I>
<DL COMPACT><DT id="6"><DD>
when the attribute is not defined for the path.
</DL>
<P>
<I>unset</I>
<DL COMPACT><DT id="7"><DD>
when the attribute is defined as false.
</DL>
<P>
<I>set</I>
<DL COMPACT><DT id="8"><DD>
when the attribute is defined as true.
</DL>
<P>
&lt;value&gt;
<DL COMPACT><DT id="9"><DD>
when a value has been assigned to the attribute.
</DL>
<P>
Buffering happens as documented under the <B>GIT_FLUSH</B> option in <B><A HREF="/cgi-bin/man/man2html?1+git">git</A></B>(1). The caller is responsible for avoiding deadlocks caused by overfilling an input buffer or reading from an empty output buffer.
<A NAME="lbAG">&nbsp;</A>
<H2>EXAMPLES</H2>
<P>
In the examples, the following <I>.gitattributes</I> file is used:
<P>
<DL COMPACT><DT id="10"><DD>
<PRE>
*.java diff=java -crlf myAttr
NoMyAttr.java !myAttr
README caveat=unspecified
</PRE>
</DL>
<P>
<P>
<P>
<DL COMPACT><DT id="11"><DD>
&bull;
Listing a single attribute:
</DL>
<P>
<DL COMPACT><DT id="12"><DD>
<PRE>
$ git check-attr diff org/example/MyClass.java
org/example/MyClass.java: diff: java
</PRE>
</DL>
<P>
<P>
<P>
<DL COMPACT><DT id="13"><DD>
&bull;
Listing multiple attributes for a file:
</DL>
<P>
<DL COMPACT><DT id="14"><DD>
<PRE>
$ 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>
</DL>
<P>
<P>
<P>
<DL COMPACT><DT id="15"><DD>
&bull;
Listing all attributes for a file:
</DL>
<P>
<DL COMPACT><DT id="16"><DD>
<PRE>
$ git check-attr --all -- org/example/MyClass.java
org/example/MyClass.java: diff: java
org/example/MyClass.java: myAttr: set
</PRE>
</DL>
<P>
<P>
<P>
<DL COMPACT><DT id="17"><DD>
&bull;
Listing an attribute for multiple files:
</DL>
<P>
<DL COMPACT><DT id="18"><DD>
<PRE>
$ 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>
</DL>
<P>
<P>
<P>
<DL COMPACT><DT id="19"><DD>
&bull;
Not all values are equally unambiguous:
</DL>
<P>
<DL COMPACT><DT id="20"><DD>
<PRE>
$ git check-attr caveat README
README: caveat: unspecified
</PRE>
</DL>
<P>
<A NAME="lbAH">&nbsp;</A>
<H2>SEE ALSO</H2>
<P>
<B><A HREF="/cgi-bin/man/man2html?5+gitattributes">gitattributes</A></B>(5).
<A NAME="lbAI">&nbsp;</A>
<H2>GIT</H2>
<P>
Part of the <B><A HREF="/cgi-bin/man/man2html?1+git">git</A></B>(1) suite
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="21"><A HREF="#lbAB">NAME</A><DD>
<DT id="22"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="23"><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT id="24"><A HREF="#lbAE">OPTIONS</A><DD>
<DT id="25"><A HREF="#lbAF">OUTPUT</A><DD>
<DT id="26"><A HREF="#lbAG">EXAMPLES</A><DD>
<DT id="27"><A HREF="#lbAH">SEE ALSO</A><DD>
<DT id="28"><A HREF="#lbAI">GIT</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:05:13 GMT, March 31, 2021
</BODY>
</HTML>