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