logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

git-check-attr.1 (5415B)


  1. '\" t
  2. .\" Title: git-check-attr
  3. .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author]
  4. .\" Generator: DocBook XSL Stylesheets v1.79.2 <http://docbook.sf.net/>
  5. .\" Date: 2025-03-14
  6. .\" Manual: Git Manual
  7. .\" Source: Git 2.49.0
  8. .\" Language: English
  9. .\"
  10. .TH "GIT\-CHECK\-ATTR" "1" "2025-03-14" "Git 2\&.49\&.0" "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. .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  18. .ie \n(.g .ds Aq \(aq
  19. .el .ds Aq '
  20. .\" -----------------------------------------------------------------
  21. .\" * set default formatting
  22. .\" -----------------------------------------------------------------
  23. .\" disable hyphenation
  24. .nh
  25. .\" disable justification (adjust text to left margin only)
  26. .ad l
  27. .\" -----------------------------------------------------------------
  28. .\" * MAIN CONTENT STARTS HERE *
  29. .\" -----------------------------------------------------------------
  30. .SH "NAME"
  31. git-check-attr \- Display gitattributes information
  32. .SH "SYNOPSIS"
  33. .sp
  34. .nf
  35. \fIgit check\-attr\fR [\-\-source <tree\-ish>] [\-a | \-\-all | <attr>\&...\:] [\-\-] <pathname>\&...\:
  36. \fIgit check\-attr\fR \-\-stdin [\-z] [\-\-source <tree\-ish>] [\-a | \-\-all | <attr>\&...\:]
  37. .fi
  38. .SH "DESCRIPTION"
  39. .sp
  40. For every pathname, this command will list if each attribute is \fIunspecified\fR, \fIset\fR, or \fIunset\fR as a gitattribute on that pathname\&.
  41. .SH "OPTIONS"
  42. .PP
  43. \-a, \-\-all
  44. .RS 4
  45. List all attributes that are associated with the specified paths\&. If this option is used, then
  46. \fIunspecified\fR
  47. attributes will not be included in the output\&.
  48. .RE
  49. .PP
  50. \-\-cached
  51. .RS 4
  52. Consider \&.\fBgitattributes\fR
  53. in the index only, ignoring the working tree\&.
  54. .RE
  55. .PP
  56. \-\-stdin
  57. .RS 4
  58. Read pathnames from the standard input, one per line, instead of from the command line\&.
  59. .RE
  60. .PP
  61. \-z
  62. .RS 4
  63. The output format is modified to be machine\-parsable\&. If
  64. \fB\-\-stdin\fR
  65. is also given, input paths are separated with a NUL character instead of a linefeed character\&.
  66. .RE
  67. .PP
  68. \-\-source=<tree\-ish>
  69. .RS 4
  70. 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\&.
  71. .RE
  72. .PP
  73. \-\-
  74. .RS 4
  75. Interpret all preceding arguments as attributes and all following arguments as path names\&.
  76. .RE
  77. .sp
  78. 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\&.
  79. .SH "OUTPUT"
  80. .sp
  81. The output is of the form: <path> COLON SP <attribute> COLON SP <info> LF
  82. .sp
  83. unless \fB\-z\fR is in effect, in which case NUL is used as delimiter: <path> NUL <attribute> NUL <info> NUL
  84. .sp
  85. <path> is the path of a file being queried, <attribute> is an attribute being queried, and <info> can be either:
  86. .PP
  87. \fIunspecified\fR
  88. .RS 4
  89. when the attribute is not defined for the path\&.
  90. .RE
  91. .PP
  92. \fIunset\fR
  93. .RS 4
  94. when the attribute is defined as false\&.
  95. .RE
  96. .PP
  97. \fIset\fR
  98. .RS 4
  99. when the attribute is defined as true\&.
  100. .RE
  101. .PP
  102. <value>
  103. .RS 4
  104. when a value has been assigned to the attribute\&.
  105. .RE
  106. .sp
  107. 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\&.
  108. .SH "EXAMPLES"
  109. .sp
  110. In the examples, the following \fI\&.gitattributes\fR file is used:
  111. .sp
  112. .if n \{\
  113. .RS 4
  114. .\}
  115. .nf
  116. *\&.java diff=java \-crlf myAttr
  117. NoMyAttr\&.java !myAttr
  118. README caveat=unspecified
  119. .fi
  120. .if n \{\
  121. .RE
  122. .\}
  123. .sp
  124. .RS 4
  125. .ie n \{\
  126. \h'-04'\(bu\h'+03'\c
  127. .\}
  128. .el \{\
  129. .sp -1
  130. .IP \(bu 2.3
  131. .\}
  132. Listing a single attribute:
  133. .RE
  134. .sp
  135. .if n \{\
  136. .RS 4
  137. .\}
  138. .nf
  139. $ git check\-attr diff org/example/MyClass\&.java
  140. org/example/MyClass\&.java: diff: java
  141. .fi
  142. .if n \{\
  143. .RE
  144. .\}
  145. .sp
  146. .RS 4
  147. .ie n \{\
  148. \h'-04'\(bu\h'+03'\c
  149. .\}
  150. .el \{\
  151. .sp -1
  152. .IP \(bu 2.3
  153. .\}
  154. Listing multiple attributes for a file:
  155. .RE
  156. .sp
  157. .if n \{\
  158. .RS 4
  159. .\}
  160. .nf
  161. $ git check\-attr crlf diff myAttr \-\- org/example/MyClass\&.java
  162. org/example/MyClass\&.java: crlf: unset
  163. org/example/MyClass\&.java: diff: java
  164. org/example/MyClass\&.java: myAttr: set
  165. .fi
  166. .if n \{\
  167. .RE
  168. .\}
  169. .sp
  170. .RS 4
  171. .ie n \{\
  172. \h'-04'\(bu\h'+03'\c
  173. .\}
  174. .el \{\
  175. .sp -1
  176. .IP \(bu 2.3
  177. .\}
  178. Listing all attributes for a file:
  179. .RE
  180. .sp
  181. .if n \{\
  182. .RS 4
  183. .\}
  184. .nf
  185. $ git check\-attr \-\-all \-\- org/example/MyClass\&.java
  186. org/example/MyClass\&.java: diff: java
  187. org/example/MyClass\&.java: myAttr: set
  188. .fi
  189. .if n \{\
  190. .RE
  191. .\}
  192. .sp
  193. .RS 4
  194. .ie n \{\
  195. \h'-04'\(bu\h'+03'\c
  196. .\}
  197. .el \{\
  198. .sp -1
  199. .IP \(bu 2.3
  200. .\}
  201. Listing an attribute for multiple files:
  202. .RE
  203. .sp
  204. .if n \{\
  205. .RS 4
  206. .\}
  207. .nf
  208. $ git check\-attr myAttr \-\- org/example/MyClass\&.java org/example/NoMyAttr\&.java
  209. org/example/MyClass\&.java: myAttr: set
  210. org/example/NoMyAttr\&.java: myAttr: unspecified
  211. .fi
  212. .if n \{\
  213. .RE
  214. .\}
  215. .sp
  216. .RS 4
  217. .ie n \{\
  218. \h'-04'\(bu\h'+03'\c
  219. .\}
  220. .el \{\
  221. .sp -1
  222. .IP \(bu 2.3
  223. .\}
  224. Not all values are equally unambiguous:
  225. .RE
  226. .sp
  227. .if n \{\
  228. .RS 4
  229. .\}
  230. .nf
  231. $ git check\-attr caveat README
  232. README: caveat: unspecified
  233. .fi
  234. .if n \{\
  235. .RE
  236. .\}
  237. .SH "SEE ALSO"
  238. .sp
  239. \fBgitattributes\fR(5)\&.
  240. .SH "GIT"
  241. .sp
  242. Part of the \fBgit\fR(1) suite