git-check-attr.1   [plain text]


'\" t
.\"     Title: git-check-attr
.\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
.\"      Date: 06/01/2011
.\"    Manual: Git Manual
.\"    Source: Git 1.7.5.4
.\"  Language: English
.\"
.TH "GIT\-CHECK\-ATTR" "1" "06/01/2011" "Git 1\&.7\&.5\&.4" "Git Manual"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
git-check-attr \- Display gitattributes information
.SH "SYNOPSIS"
.sp
.nf
\fIgit check\-attr\fR attr\&... [\-\-] pathname\&...
\fIgit check\-attr\fR \-\-stdin [\-z] attr\&... < <list\-of\-paths>
.fi
.sp
.SH "DESCRIPTION"
.sp
For every pathname, this command will list if each attribute is \fIunspecified\fR, \fIset\fR, or \fIunset\fR as a gitattribute on that pathname\&.
.SH "OPTIONS"
.PP
\-\-stdin
.RS 4
Read file names from stdin instead of from the command\-line\&.
.RE
.PP
\-z
.RS 4
Only meaningful with
\-\-stdin; paths are separated with a NUL character instead of a linefeed character\&.
.RE
.PP
\-\-
.RS 4
Interpret all preceding arguments as attributes and all following arguments as path names\&. If not supplied, only the first argument will be treated as an attribute\&.
.RE
.SH "OUTPUT"
.sp
The output is of the form: <path> COLON SP <attribute> COLON SP <info> LF
.sp
<path> is the path of a file being queried, <attribute> is an attribute being queried and <info> can be either:
.PP
\fIunspecified\fR
.RS 4
when the attribute is not defined for the path\&.
.RE
.PP
\fIunset\fR
.RS 4
when the attribute is defined as false\&.
.RE
.PP
\fIset\fR
.RS 4
when the attribute is defined as true\&.
.RE
.PP
<value>
.RS 4
when a value has been assigned to the attribute\&.
.RE
.SH "EXAMPLES"
.sp
In the examples, the following \fI\&.gitattributes\fR file is used:
.sp
.if n \{\
.RS 4
.\}
.nf
*\&.java diff=java \-crlf myAttr
NoMyAttr\&.java !myAttr
README caveat=unspecified
.fi
.if n \{\
.RE
.\}
.sp

.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
Listing a single attribute:
.RE
.sp
.if n \{\
.RS 4
.\}
.nf
$ git check\-attr diff org/example/MyClass\&.java
org/example/MyClass\&.java: diff: java
.fi
.if n \{\
.RE
.\}
.sp

.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
Listing multiple attributes for a file:
.RE
.sp
.if n \{\
.RS 4
.\}
.nf
$ 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
.fi
.if n \{\
.RE
.\}
.sp

.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
Listing an attribute for multiple files:
.RE
.sp
.if n \{\
.RS 4
.\}
.nf
$ git check\-attr myAttr \-\- org/example/MyClass\&.java org/example/NoMyAttr\&.java
org/example/MyClass\&.java: myAttr: set
org/example/NoMyAttr\&.java: myAttr: unspecified
.fi
.if n \{\
.RE
.\}
.sp

.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
Not all values are equally unambiguous:
.RE
.sp
.if n \{\
.RS 4
.\}
.nf
$ git check\-attr caveat README
README: caveat: unspecified
.fi
.if n \{\
.RE
.\}
.sp
.SH "SEE ALSO"
.sp
\fBgitattributes\fR(5)\&.
.SH "GIT"
.sp
Part of the \fBgit\fR(1) suite