Junio C Hamano | e90436a | 2007-04-22 07:22:13 | [diff] [blame] | 1 | git-check-attr(1) |
| 2 | ================= |
| 3 | |
| 4 | NAME |
| 5 | ---- |
| 6 | git-check-attr - Display gitattributes information. |
| 7 | |
| 8 | |
| 9 | SYNOPSIS |
| 10 | -------- |
Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 11 | 'git check-attr' attr... [--] pathname... |
Junio C Hamano | e90436a | 2007-04-22 07:22:13 | [diff] [blame] | 12 | |
| 13 | DESCRIPTION |
| 14 | ----------- |
| 15 | For every pathname, this command will list if each attr is 'unspecified', |
| 16 | 'set', or 'unset' as a gitattribute on that pathname. |
| 17 | |
| 18 | OPTIONS |
| 19 | ------- |
| 20 | \--:: |
| 21 | Interpret all preceding arguments as attributes, and all following |
| 22 | arguments as path names. If not supplied, only the first argument will |
| 23 | be treated as an attribute. |
| 24 | |
Junio C Hamano | cbb3086 | 2008-10-17 10:03:42 | [diff] [blame^] | 25 | OUTPUT |
| 26 | ------ |
| 27 | |
| 28 | The output is of the form: |
| 29 | <path> COLON SP <attribute> COLON SP <info> LF |
| 30 | |
| 31 | Where <path> is the path of a file being queried, <attribute> is an attribute |
| 32 | being queried and <info> can be either: |
| 33 | |
| 34 | 'unspecified';; when the attribute is not defined for the path. |
| 35 | 'unset';; when the attribute is defined to false. |
| 36 | 'set';; when the attribute is defined to true. |
| 37 | <value>;; when a value has been assigned to the attribute. |
| 38 | |
| 39 | EXAMPLES |
| 40 | -------- |
| 41 | |
| 42 | In the examples, the following '.gitattributes' file is used: |
| 43 | --------------- |
| 44 | *.java diff=java -crlf myAttr |
| 45 | NoMyAttr.java !myAttr |
| 46 | README caveat=unspecified |
| 47 | --------------- |
| 48 | |
| 49 | * Listing a single attribute: |
| 50 | --------------- |
| 51 | $ git check-attr diff org/example/MyClass.java |
| 52 | org/example/MyClass.java: diff: java |
| 53 | --------------- |
| 54 | |
| 55 | * Listing multiple attributes for a file: |
| 56 | --------------- |
| 57 | $ git check-attr crlf diff myAttr -- org/example/MyClass.java |
| 58 | org/example/MyClass.java: crlf: unset |
| 59 | org/example/MyClass.java: diff: java |
| 60 | org/example/MyClass.java: myAttr: set |
| 61 | --------------- |
| 62 | |
| 63 | * Listing attribute for multiple files: |
| 64 | --------------- |
| 65 | $ git check-attr myAttr -- org/example/MyClass.java org/example/NoMyAttr.java |
| 66 | org/example/MyClass.java: myAttr: set |
| 67 | org/example/NoMyAttr.java: myAttr: unspecified |
| 68 | --------------- |
| 69 | |
| 70 | * Not all values are equally unambiguous: |
| 71 | --------------- |
| 72 | $ git check-attr caveat README |
| 73 | README: caveat: unspecified |
| 74 | --------------- |
Junio C Hamano | e90436a | 2007-04-22 07:22:13 | [diff] [blame] | 75 | |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 76 | SEE ALSO |
| 77 | -------- |
Junio C Hamano | 35738e8 | 2008-01-07 07:55:46 | [diff] [blame] | 78 | linkgit:gitattributes[5]. |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 79 | |
| 80 | |
Junio C Hamano | e90436a | 2007-04-22 07:22:13 | [diff] [blame] | 81 | Author |
| 82 | ------ |
Junio C Hamano | 0868a30 | 2008-07-22 09:20:44 | [diff] [blame] | 83 | Written by Junio C Hamano <gitster@pobox.com> |
Junio C Hamano | e90436a | 2007-04-22 07:22:13 | [diff] [blame] | 84 | |
| 85 | Documentation |
| 86 | -------------- |
| 87 | Documentation by James Bowes. |
| 88 | |
| 89 | GIT |
| 90 | --- |
Junio C Hamano | f7c042d | 2008-06-06 22:50:53 | [diff] [blame] | 91 | Part of the linkgit:git[1] suite |