Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 1 | --pretty[='<format>']:: |
| 2 | |
| 3 | Pretty-prints the details of a commit. `--pretty` |
| 4 | without an explicit `=<format>` defaults to 'medium'. |
| 5 | If the commit is a merge, and if the pretty-format |
| 6 | is not 'oneline', 'email' or 'raw', an additional line is |
| 7 | inserted before the 'Author:' line. This line begins with |
| 8 | "Merge: " and the sha1s of ancestral commits are printed, |
| 9 | separated by spaces. Note that the listed commits may not |
| 10 | necessarily be the list of the *direct* parent commits if you |
| 11 | have limited your view of history: for example, if you are |
| 12 | only interested in changes related to a certain directory or |
| 13 | file. Here are some additional details for each format: |
| 14 | |
| 15 | * 'oneline' |
| 16 | |
| 17 | <sha1> <title line> |
| 18 | + |
| 19 | This is designed to be as compact as possible. |
| 20 | |
| 21 | * 'short' |
| 22 | |
| 23 | commit <sha1> |
| 24 | Author: <author> |
| 25 | |
| 26 | <title line> |
| 27 | |
| 28 | * 'medium' |
| 29 | |
| 30 | commit <sha1> |
| 31 | Author: <author> |
| 32 | Date: <date> |
| 33 | |
| 34 | <title line> |
| 35 | |
| 36 | <full commit message> |
| 37 | |
| 38 | * 'full' |
| 39 | |
| 40 | commit <sha1> |
| 41 | Author: <author> |
| 42 | Commit: <committer> |
| 43 | |
| 44 | <title line> |
| 45 | |
| 46 | <full commit message> |
| 47 | |
| 48 | * 'fuller' |
| 49 | |
| 50 | commit <sha1> |
| 51 | Author: <author> |
| 52 | AuthorDate: <date & time> |
| 53 | Commit: <committer> |
| 54 | CommitDate: <date & time> |
| 55 | |
| 56 | <title line> |
| 57 | |
| 58 | <full commit message> |
| 59 | |
| 60 | |
| 61 | * 'email' |
| 62 | |
| 63 | From <sha1> <date> |
| 64 | From: <author> |
| 65 | Date: <date & time> |
| 66 | Subject: [PATCH] <title line> |
| 67 | |
| 68 | full commit message> |
| 69 | |
| 70 | |
| 71 | * 'raw' |
| 72 | + |
| 73 | The 'raw' format shows the entire commit exactly as |
| 74 | stored in the commit object. Notably, the SHA1s are |
| 75 | displayed in full, regardless of whether --abbrev or |
| 76 | --no-abbrev are used, and 'parents' information show the |
| 77 | true parent commits, without taking grafts nor history |
| 78 | simplification into account. |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 79 | |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame^] | 80 | * 'format:' |
| 81 | + |
| 82 | The 'format:' format allows you to specify which information |
| 83 | you want to show. It works a little bit like printf format, |
| 84 | with the notable exception that you get a newline with '%n' |
| 85 | instead of '\n'. |
| 86 | |
| 87 | E.g, 'format:"The author of %h was %an, %ar%nThe title was >>%s<<"' |
| 88 | would show something like this: |
| 89 | |
| 90 | The author of fe6e0ee was Junio C Hamano, 23 hours ago |
| 91 | The title was >>t4119: test autocomputing -p<n> for traditional diff input.<< |
| 92 | |
| 93 | The placeholders are: |
| 94 | |
| 95 | - '%H': commit hash |
| 96 | - '%h': abbreviated commit hash |
| 97 | - '%T': tree hash |
| 98 | - '%t': abbreviated tree hash |
| 99 | - '%P': parent hashes |
| 100 | - '%p': abbreviated parent hashes |
| 101 | - '%an': author name |
| 102 | - '%ae': author email |
| 103 | - '%ad': author date |
| 104 | - '%aD': author date, RFC2822 style |
| 105 | - '%ar': author date, relative |
| 106 | - '%at': author date, UNIX timestamp |
| 107 | - '%cn': committer name |
| 108 | - '%ce': committer email |
| 109 | - '%cd': committer date |
| 110 | - '%cD': committer date, RFC2822 style |
| 111 | - '%cr': committer date, relative |
| 112 | - '%ct': committer date, UNIX timestamp |
| 113 | - '%e': encoding |
| 114 | - '%s': subject |
| 115 | - '%b': body |
| 116 | - '%Cred': switch color to red |
| 117 | - '%Cgreen': switch color to green |
| 118 | - '%Cblue': switch color to blue |
| 119 | - '%Creset': reset color |
| 120 | - '%n': newline |
| 121 | |
| 122 | |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 123 | --encoding[=<encoding>]:: |
| 124 | The commit objects record the encoding used for the log message |
| 125 | in their encoding header; this option can be used to tell the |
| 126 | command to re-code the commit log message in the encoding |
| 127 | preferred by the user. For non plumbing commands this |
| 128 | defaults to UTF-8. |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame^] | 129 | |