blob: f399313429f8993064ec261b6178740fe888b441 [file] [log] [blame]
Junio C Hamano1a4e8412005-12-27 08:17:231<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
2 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
4<head>
5<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
Junio C Hamanoba4b9282008-07-06 05:20:316<meta name="generator" content="AsciiDoc 8.2.5" />
Junio C Hamano1a4e8412005-12-27 08:17:237<style type="text/css">
8/* Debug borders */
9p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {
10/*
11 border: 1px solid red;
12*/
13}
14
15body {
16 margin: 1em 5% 1em 5%;
17}
18
Junio C Hamanoba4b9282008-07-06 05:20:3119a {
20 color: blue;
21 text-decoration: underline;
22}
23a:visited {
24 color: fuchsia;
25}
Junio C Hamano1a4e8412005-12-27 08:17:2326
27em {
28 font-style: italic;
29}
30
31strong {
32 font-weight: bold;
33}
34
35tt {
36 color: navy;
37}
38
39h1, h2, h3, h4, h5, h6 {
40 color: #527bbd;
41 font-family: sans-serif;
42 margin-top: 1.2em;
43 margin-bottom: 0.5em;
44 line-height: 1.3;
45}
46
Junio C Hamanoba4b9282008-07-06 05:20:3147h1, h2, h3 {
Junio C Hamano1a4e8412005-12-27 08:17:2348 border-bottom: 2px solid silver;
49}
50h2 {
Junio C Hamano1a4e8412005-12-27 08:17:2351 padding-top: 0.5em;
52}
Junio C Hamanoba4b9282008-07-06 05:20:3153h3 {
54 float: left;
55}
56h3 + * {
57 clear: left;
58}
Junio C Hamano1a4e8412005-12-27 08:17:2359
60div.sectionbody {
61 font-family: serif;
62 margin-left: 0;
63}
64
65hr {
66 border: 1px solid silver;
67}
68
69p {
70 margin-top: 0.5em;
71 margin-bottom: 0.5em;
72}
73
74pre {
75 padding: 0;
76 margin: 0;
77}
78
79span#author {
80 color: #527bbd;
81 font-family: sans-serif;
82 font-weight: bold;
Junio C Hamanoba4b9282008-07-06 05:20:3183 font-size: 1.1em;
Junio C Hamano1a4e8412005-12-27 08:17:2384}
85span#email {
86}
87span#revision {
88 font-family: sans-serif;
89}
90
91div#footer {
92 font-family: sans-serif;
93 font-size: small;
94 border-top: 2px solid silver;
95 padding-top: 0.5em;
96 margin-top: 4.0em;
97}
98div#footer-text {
99 float: left;
100 padding-bottom: 0.5em;
101}
102div#footer-badges {
103 float: right;
104 padding-bottom: 0.5em;
105}
106
107div#preamble,
108div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
109div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
110div.admonitionblock {
111 margin-right: 10%;
112 margin-top: 1.5em;
113 margin-bottom: 1.5em;
114}
115div.admonitionblock {
116 margin-top: 2.5em;
117 margin-bottom: 2.5em;
118}
119
120div.content { /* Block element content. */
121 padding: 0;
122}
123
124/* Block element titles. */
125div.title, caption.title {
126 font-family: sans-serif;
127 font-weight: bold;
128 text-align: left;
129 margin-top: 1.0em;
130 margin-bottom: 0.5em;
131}
132div.title + * {
133 margin-top: 0;
134}
135
136td div.title:first-child {
137 margin-top: 0.0em;
138}
139div.content div.title:first-child {
140 margin-top: 0.0em;
141}
142div.content + div.title {
143 margin-top: 0.0em;
144}
145
146div.sidebarblock > div.content {
147 background: #ffffee;
148 border: 1px solid silver;
149 padding: 0.5em;
150}
151
Junio C Hamanoba4b9282008-07-06 05:20:31152div.listingblock {
153 margin-right: 0%;
154}
Junio C Hamano1a4e8412005-12-27 08:17:23155div.listingblock > div.content {
156 border: 1px solid silver;
157 background: #f4f4f4;
158 padding: 0.5em;
159}
160
161div.quoteblock > div.content {
162 padding-left: 2.0em;
163}
Junio C Hamanoba4b9282008-07-06 05:20:31164
165div.attribution {
Junio C Hamano1a4e8412005-12-27 08:17:23166 text-align: right;
167}
Junio C Hamanoba4b9282008-07-06 05:20:31168div.verseblock + div.attribution {
169 text-align: left;
170}
Junio C Hamano1a4e8412005-12-27 08:17:23171
172div.admonitionblock .icon {
173 vertical-align: top;
174 font-size: 1.1em;
175 font-weight: bold;
176 text-decoration: underline;
177 color: #527bbd;
178 padding-right: 0.5em;
179}
180div.admonitionblock td.content {
181 padding-left: 0.5em;
182 border-left: 2px solid silver;
183}
184
185div.exampleblock > div.content {
186 border-left: 2px solid silver;
187 padding: 0.5em;
188}
189
190div.verseblock div.content {
191 white-space: pre;
192}
193
194div.imageblock div.content { padding-left: 0; }
195div.imageblock img { border: 1px solid silver; }
196span.image img { border-style: none; }
197
198dl {
199 margin-top: 0.8em;
200 margin-bottom: 0.8em;
201}
202dt {
203 margin-top: 0.5em;
204 margin-bottom: 0;
205 font-style: italic;
206}
207dd > *:first-child {
208 margin-top: 0;
209}
210
211ul, ol {
212 list-style-position: outside;
213}
Junio C Hamanoba4b9282008-07-06 05:20:31214div.olist2 ol {
Junio C Hamano1a4e8412005-12-27 08:17:23215 list-style-type: lower-alpha;
216}
217
218div.tableblock > table {
Junio C Hamanoba4b9282008-07-06 05:20:31219 border: 3px solid #527bbd;
Junio C Hamano1a4e8412005-12-27 08:17:23220}
221thead {
222 font-family: sans-serif;
223 font-weight: bold;
224}
225tfoot {
226 font-weight: bold;
227}
228
229div.hlist {
230 margin-top: 0.8em;
231 margin-bottom: 0.8em;
232}
Junio C Hamanoba4b9282008-07-06 05:20:31233div.hlist td {
234 padding-bottom: 5px;
235}
Junio C Hamano1a4e8412005-12-27 08:17:23236td.hlist1 {
237 vertical-align: top;
238 font-style: italic;
239 padding-right: 0.8em;
240}
241td.hlist2 {
242 vertical-align: top;
243}
244
245@media print {
246 div#footer-badges { display: none; }
247}
Junio C Hamanoba4b9282008-07-06 05:20:31248
249div#toctitle {
250 color: #527bbd;
251 font-family: sans-serif;
252 font-size: 1.1em;
253 font-weight: bold;
254 margin-top: 1.0em;
255 margin-bottom: 0.1em;
256}
257
258div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
259 margin-top: 0;
260 margin-bottom: 0;
261}
262div.toclevel2 {
263 margin-left: 2em;
264 font-size: 0.9em;
265}
266div.toclevel3 {
267 margin-left: 4em;
268 font-size: 0.9em;
269}
270div.toclevel4 {
271 margin-left: 6em;
272 font-size: 0.9em;
273}
274include1::./stylesheets/xhtml11-manpage.css[]
Junio C Hamano1a4e8412005-12-27 08:17:23275/* Workarounds for IE6's broken and incomplete CSS2. */
276
277div.sidebar-content {
278 background: #ffffee;
279 border: 1px solid silver;
280 padding: 0.5em;
281}
282div.sidebar-title, div.image-title {
283 font-family: sans-serif;
284 font-weight: bold;
285 margin-top: 0.0em;
286 margin-bottom: 0.5em;
287}
288
289div.listingblock div.content {
290 border: 1px solid silver;
291 background: #f4f4f4;
292 padding: 0.5em;
293}
294
295div.quoteblock-content {
296 padding-left: 2.0em;
297}
298
299div.exampleblock-content {
300 border-left: 2px solid silver;
301 padding-left: 0.5em;
302}
Junio C Hamanoba4b9282008-07-06 05:20:31303
304/* IE6 sets dynamically generated links as visited. */
305div#toc a:visited { color: blue; }
Junio C Hamano1a4e8412005-12-27 08:17:23306</style>
307<title>git-rev-list(1)</title>
308</head>
309<body>
310<div id="header">
311<h1>
312git-rev-list(1) Manual Page
313</h1>
314<h2>NAME</h2>
315<div class="sectionbody">
316<p>git-rev-list -
317 Lists commit objects in reverse chronological order
318</p>
319</div>
320</div>
321<h2>SYNOPSIS</h2>
322<div class="sectionbody">
Junio C Hamano235a91e2006-01-07 01:13:58323<div class="verseblock">
324<div class="content"><em>git-rev-list</em> [ --max-count=number ]
Junio C Hamano17bbaca2006-12-25 11:36:31325 [ --skip=number ]
Junio C Hamano235a91e2006-01-07 01:13:58326 [ --max-age=timestamp ]
327 [ --min-age=timestamp ]
328 [ --sparse ]
329 [ --no-merges ]
Junio C Hamano554da792007-12-27 03:29:58330 [ --first-parent ]
Junio C Hamano9be18972006-01-28 08:54:57331 [ --remove-empty ]
Junio C Hamanoee695f22007-06-21 00:35:36332 [ --full-history ]
Junio C Hamano872c5682006-07-07 06:05:40333 [ --not ]
Junio C Hamano235a91e2006-01-07 01:13:58334 [ --all ]
Junio C Hamano40f54d32008-02-29 09:21:50335 [ --branches ]
336 [ --tags ]
337 [ --remotes ]
Junio C Hamanoc9245d92006-09-06 09:35:46338 [ --stdin ]
Junio C Hamano8c5802d2007-11-15 00:13:36339 [ --quiet ]
Junio C Hamanodecf50e2006-03-05 10:51:14340 [ --topo-order ]
Junio C Hamano235a91e2006-01-07 01:13:58341 [ --parents ]
Junio C Hamanoee695f22007-06-21 00:35:36342 [ --timestamp ]
Junio C Hamano5678d692007-04-06 00:51:43343 [ --left-right ]
Junio C Hamanod9e0e5d2007-04-14 16:22:04344 [ --cherry-pick ]
Junio C Hamano775a0f42006-12-31 01:19:14345 [ --encoding[=&lt;encoding&gt;] ]
Junio C Hamano47c1e3c2006-09-25 04:45:55346 [ --(author|committer|grep)=&lt;pattern&gt; ]
Junio C Hamanoa476efa2008-10-10 15:31:42347 [ --regexp-ignore-case | -i ]
348 [ --extended-regexp | -E ]
349 [ --fixed-strings | -F ]
Junio C Hamano02f130b2007-07-14 08:26:56350 [ --date={local|relative|default|iso|rfc|short} ]
Junio C Hamano5f327762006-03-02 09:14:51351 [ [--objects | --objects-edge] [ --unpacked ] ]
Junio C Hamano235a91e2006-01-07 01:13:58352 [ --pretty | --header ]
353 [ --bisect ]
Junio C Hamano20f64da2007-04-04 18:38:30354 [ --bisect-vars ]
Junio C Hamano1974bf22007-10-31 05:57:20355 [ --bisect-all ]
Junio C Hamano859f3b42006-08-04 10:04:30356 [ --merge ]
Junio C Hamano053827f2007-02-14 07:23:58357 [ --reverse ]
Junio C Hamanodb450ba2007-01-21 08:57:14358 [ --walk-reflogs ]
Junio C Hamanoa196f6d2007-07-24 08:10:27359 [ --no-walk ] [ --do-walk ]
Junio C Hamano235a91e2006-01-07 01:13:58360 &lt;commit&gt;&#8230; [ -- &lt;paths&gt;&#8230; ]</div></div>
Junio C Hamano1a4e8412005-12-27 08:17:23361</div>
Junio C Hamanoba4b9282008-07-06 05:20:31362<h2 id="_description">DESCRIPTION</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23363<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:31364<div class="para"><p>Lists commit objects in reverse chronological order starting at the
Junio C Hamano1a4e8412005-12-27 08:17:23365given commit(s), taking ancestry relationship into account. This is
Junio C Hamanoba4b9282008-07-06 05:20:31366useful to produce human-readable log output.</p></div>
367<div class="para"><p>Commits which are stated with a preceding <em>&#94;</em> cause listing to
Junio C Hamano89e135d2006-09-03 06:18:25368stop at that point. Their parents are implied. Thus the following
Junio C Hamanoba4b9282008-07-06 05:20:31369command:</p></div>
Junio C Hamano89e135d2006-09-03 06:18:25370<div class="listingblock">
371<div class="content">
Junio C Hamanofce7c7e2008-07-02 03:06:38372<pre><tt> $ git rev-list foo bar ^baz</tt></pre>
Junio C Hamano89e135d2006-09-03 06:18:25373</div></div>
Junio C Hamanoba4b9282008-07-06 05:20:31374<div class="para"><p>means "list all the commits which are included in <em>foo</em> and <em>bar</em>, but
375not in <em>baz</em>".</p></div>
376<div class="para"><p>A special notation "<em>&lt;commit1&gt;</em>..<em>&lt;commit2&gt;</em>" can be used as a
Junio C Hamano6926bef2007-06-16 09:54:05377short-hand for "&#94;<em>&lt;commit1&gt;</em> <em>&lt;commit2&gt;</em>". For example, either of
Junio C Hamanoba4b9282008-07-06 05:20:31378the following may be used interchangeably:</p></div>
Junio C Hamano89e135d2006-09-03 06:18:25379<div class="listingblock">
380<div class="content">
Junio C Hamanofce7c7e2008-07-02 03:06:38381<pre><tt> $ git rev-list origin..HEAD
382 $ git rev-list HEAD ^origin</tt></pre>
Junio C Hamano89e135d2006-09-03 06:18:25383</div></div>
Junio C Hamanoba4b9282008-07-06 05:20:31384<div class="para"><p>Another special notation is "<em>&lt;commit1&gt;</em>&#8230;<em>&lt;commit2&gt;</em>" which is useful
Junio C Hamano89e135d2006-09-03 06:18:25385for merges. The resulting set of commits is the symmetric difference
Junio C Hamanoba4b9282008-07-06 05:20:31386between the two operands. The following two commands are equivalent:</p></div>
Junio C Hamano872c5682006-07-07 06:05:40387<div class="listingblock">
388<div class="content">
Junio C Hamanofce7c7e2008-07-02 03:06:38389<pre><tt> $ git rev-list A B --not $(git merge-base --all A B)
390 $ git rev-list A...B</tt></pre>
Junio C Hamano872c5682006-07-07 06:05:40391</div></div>
Junio C Hamanoba4b9282008-07-06 05:20:31392<div class="para"><p><em>git-rev-list</em> is a very essential git program, since it
Junio C Hamano89e135d2006-09-03 06:18:25393provides the ability to build and traverse commit ancestry graphs. For
394this reason, it has a lot of different options that enables it to be
Junio C Hamanoba4b9282008-07-06 05:20:31395used by commands as different as <em>git-bisect</em> and
396<em>git-repack</em>.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:23397</div>
Junio C Hamanoba4b9282008-07-06 05:20:31398<h2 id="_options">OPTIONS</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23399<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:31400<h3 id="_commit_formatting">Commit Formatting</h3><div style="clear:left"></div>
401<div class="para"><p>Using these options, <a href="git-rev-list.html">git-rev-list(1)</a> will act similar to the
Junio C Hamano89e135d2006-09-03 06:18:25402more specialized family of commit log tools: <a href="git-log.html">git-log(1)</a>,
Junio C Hamanoba4b9282008-07-06 05:20:31403<a href="git-show.html">git-show(1)</a>, and <a href="git-whatchanged.html">git-whatchanged(1)</a></p></div>
404<div class="vlist"><dl>
Junio C Hamano1a4e8412005-12-27 08:17:23405<dt>
Junio C Hamano89e135d2006-09-03 06:18:25406--pretty[=<em>&lt;format&gt;</em>]
Junio C Hamano1a4e8412005-12-27 08:17:23407</dt>
408<dd>
409<p>
Junio C Hamanoa3770f92007-07-25 08:53:33410 Pretty-print the contents of the commit logs in a given format,
Junio C Hamano0430e3a2007-05-15 03:13:17411 where <em>&lt;format&gt;</em> can be one of <em>oneline</em>, <em>short</em>, <em>medium</em>,
412 <em>full</em>, <em>fuller</em>, <em>email</em>, <em>raw</em> and <em>format:&lt;string&gt;</em>.
Junio C Hamanoa3770f92007-07-25 08:53:33413 When omitted, the format defaults to <em>medium</em>.
Junio C Hamano89e135d2006-09-03 06:18:25414</p>
Junio C Hamanoba4b9282008-07-06 05:20:31415<div class="para"><p>Note: you can specify the default pretty format in the repository
416configuration (see <a href="git-config.html">git-config(1)</a>).</p></div>
Junio C Hamano89e135d2006-09-03 06:18:25417</dd>
418<dt>
Junio C Hamanoee695f22007-06-21 00:35:36419--abbrev-commit
420</dt>
421<dd>
422<p>
423 Instead of showing the full 40-byte hexadecimal commit object
424 name, show only handful hexdigits prefix. Non default number of
425 digits can be specified with "--abbrev=&lt;n&gt;" (which also modifies
426 diff output, if it is displayed).
427</p>
Junio C Hamanoba4b9282008-07-06 05:20:31428<div class="para"><p>This should make "--pretty=oneline" a whole lot more readable for
429people using 80-column terminals.</p></div>
Junio C Hamanoee695f22007-06-21 00:35:36430</dd>
431<dt>
Junio C Hamano775a0f42006-12-31 01:19:14432--encoding[=&lt;encoding&gt;]
433</dt>
434<dd>
435<p>
436 The commit objects record the encoding used for the log message
437 in their encoding header; this option can be used to tell the
438 command to re-code the commit log message in the encoding
439 preferred by the user. For non plumbing commands this
440 defaults to UTF-8.
441</p>
442</dd>
443<dt>
Junio C Hamano89e135d2006-09-03 06:18:25444--relative-date
445</dt>
446<dd>
447<p>
Junio C Hamano45889b42007-04-26 07:20:04448 Synonym for <tt>--date=relative</tt>.
449</p>
450</dd>
451<dt>
Junio C Hamanob713ff12008-05-24 01:12:30452--date={relative,local,default,iso,rfc,short}
Junio C Hamano45889b42007-04-26 07:20:04453</dt>
454<dd>
455<p>
Junio C Hamano89e135d2006-09-03 06:18:25456 Only takes effect for dates shown in human-readable format, such
Junio C Hamanob713ff12008-05-24 01:12:30457 as when using "--pretty". <tt>log.date</tt> config variable sets a default
458 value for log command's --date option.
Junio C Hamano1a4e8412005-12-27 08:17:23459</p>
Junio C Hamanoba4b9282008-07-06 05:20:31460<div class="para"><p><tt>--date=relative</tt> shows dates relative to the current time,
461e.g. "2 hours ago".</p></div>
462<div class="para"><p><tt>--date=local</tt> shows timestamps in user's local timezone.</p></div>
463<div class="para"><p><tt>--date=iso</tt> (or <tt>--date=iso8601</tt>) shows timestamps in ISO 8601 format.</p></div>
464<div class="para"><p><tt>--date=rfc</tt> (or <tt>--date=rfc2822</tt>) shows timestamps in RFC 2822
465format, often found in E-mail messages.</p></div>
466<div class="para"><p><tt>--date=short</tt> shows only date but not time, in <tt>YYYY-MM-DD</tt> format.</p></div>
467<div class="para"><p><tt>--date=default</tt> shows timestamps in the original timezone
468(either committer's or author's).</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:23469</dd>
470<dt>
471--header
472</dt>
473<dd>
474<p>
Junio C Hamano89e135d2006-09-03 06:18:25475 Print the contents of the commit in raw-format; each record is
476 separated with a NUL character.
Junio C Hamano1a4e8412005-12-27 08:17:23477</p>
478</dd>
479<dt>
Junio C Hamano7ccb9fd2006-07-15 01:38:40480--parents
481</dt>
482<dd>
483<p>
Junio C Hamanoa76cb0d2008-08-13 20:04:10484 Print the parents of the commit. Also enables parent
485 rewriting, see <em>History Simplification</em> below.
Junio C Hamano7ccb9fd2006-07-15 01:38:40486</p>
487</dd>
Junio C Hamano5678d692007-04-06 00:51:43488<dt>
Junio C Hamano46a38aa2008-07-14 03:13:27489--children
490</dt>
491<dd>
492<p>
Junio C Hamanoa76cb0d2008-08-13 20:04:10493 Print the children of the commit. Also enables parent
494 rewriting, see <em>History Simplification</em> below.
Junio C Hamano46a38aa2008-07-14 03:13:27495</p>
496</dd>
497<dt>
Junio C Hamanoee695f22007-06-21 00:35:36498--timestamp
499</dt>
500<dd>
501<p>
502 Print the raw commit timestamp.
503</p>
504</dd>
505<dt>
Junio C Hamano5678d692007-04-06 00:51:43506--left-right
507</dt>
508<dd>
509<p>
510 Mark which side of a symmetric diff a commit is reachable from.
511 Commits from the left side are prefixed with <tt>&lt;</tt> and those from
512 the right with <tt>&gt;</tt>. If combined with <tt>--boundary</tt>, those
513 commits are prefixed with <tt>-</tt>.
514</p>
Junio C Hamanoba4b9282008-07-06 05:20:31515<div class="para"><p>For example, if you have this topology:</p></div>
Junio C Hamano5678d692007-04-06 00:51:43516<div class="listingblock">
517<div class="content">
518<pre><tt> y---b---b branch B
519 / \ /
520 / .
521 / / \
522 o---x---a---a branch A</tt></pre>
523</div></div>
Junio C Hamanoc96fb5a2008-08-12 06:59:38524<div class="para"><p>you would get an output like this:</p></div>
Junio C Hamano5678d692007-04-06 00:51:43525<div class="listingblock">
526<div class="content">
527<pre><tt> $ git rev-list --left-right --boundary --pretty=oneline A...B
528
529 &gt;bbbbbbb... 3rd on b
530 &gt;bbbbbbb... 2nd on b
531 &lt;aaaaaaa... 3rd on a
532 &lt;aaaaaaa... 2nd on a
533 -yyyyyyy... 1st on b
534 -xxxxxxx... 1st on a</tt></pre>
535</div></div>
536</dd>
Junio C Hamanofeeb1be2008-05-22 00:53:35537<dt>
538--graph
539</dt>
540<dd>
541<p>
542 Draw a text-based graphical representation of the commit history
543 on the left hand side of the output. This may cause extra lines
544 to be printed in between commits, in order for the graph history
545 to be drawn properly.
546</p>
Junio C Hamanoba4b9282008-07-06 05:20:31547<div class="para"><p>This implies the <em>--topo-order</em> option by default, but the
548<em>--date-order</em> option may also be specified.</p></div>
Junio C Hamanofeeb1be2008-05-22 00:53:35549</dd>
Junio C Hamanoba4b9282008-07-06 05:20:31550</dl></div>
Junio C Hamanoba4b9282008-07-06 05:20:31551<h3 id="_commit_limiting">Commit Limiting</h3><div style="clear:left"></div>
552<div class="para"><p>Besides specifying a range of commits that should be listed using the
Junio C Hamano89e135d2006-09-03 06:18:25553special notations explained in the description, additional commit
Junio C Hamanoba4b9282008-07-06 05:20:31554limiting may be applied.</p></div>
555<div class="vlist"><dl>
Junio C Hamano1a4e8412005-12-27 08:17:23556<dt>
Junio C Hamanoeb415992008-06-08 22:49:47557-n <em>number</em>
558</dt>
559<dt>
560--max-count=<em>number</em>
Junio C Hamano1a4e8412005-12-27 08:17:23561</dt>
562<dd>
563<p>
564 Limit the number of commits output.
565</p>
566</dd>
567<dt>
Junio C Hamano17bbaca2006-12-25 11:36:31568--skip=<em>number</em>
569</dt>
570<dd>
571<p>
572 Skip <em>number</em> commits before starting to show the commit output.
573</p>
574</dd>
575<dt>
Junio C Hamanoeb415992008-06-08 22:49:47576--since=<em>date</em>
577</dt>
578<dt>
579--after=<em>date</em>
Junio C Hamano89e135d2006-09-03 06:18:25580</dt>
581<dd>
582<p>
583 Show commits more recent than a specific date.
584</p>
585</dd>
586<dt>
Junio C Hamanoeb415992008-06-08 22:49:47587--until=<em>date</em>
588</dt>
589<dt>
590--before=<em>date</em>
Junio C Hamano89e135d2006-09-03 06:18:25591</dt>
592<dd>
593<p>
594 Show commits older than a specific date.
595</p>
596</dd>
597<dt>
Junio C Hamanoeb415992008-06-08 22:49:47598--max-age=<em>timestamp</em>
599</dt>
600<dt>
601--min-age=<em>timestamp</em>
Junio C Hamano1a4e8412005-12-27 08:17:23602</dt>
603<dd>
604<p>
605 Limit the commits output to specified time range.
606</p>
607</dd>
608<dt>
Junio C Hamanoeb415992008-06-08 22:49:47609--author=<em>pattern</em>
610</dt>
611<dt>
612--committer=<em>pattern</em>
Junio C Hamano47c1e3c2006-09-25 04:45:55613</dt>
614<dd>
615<p>
616 Limit the commits output to ones with author/committer
Junio C Hamano75485c82007-05-19 04:20:33617 header lines that match the specified pattern (regular expression).
Junio C Hamano47c1e3c2006-09-25 04:45:55618</p>
619</dd>
620<dt>
621--grep=<em>pattern</em>
622</dt>
623<dd>
624<p>
625 Limit the commits output to ones with log message that
Junio C Hamano75485c82007-05-19 04:20:33626 matches the specified pattern (regular expression).
Junio C Hamano47c1e3c2006-09-25 04:45:55627</p>
628</dd>
629<dt>
Junio C Hamanoeb415992008-06-08 22:49:47630-i
631</dt>
632<dt>
633--regexp-ignore-case
Junio C Hamanoa5c02c52007-05-21 06:14:27634</dt>
635<dd>
636<p>
637 Match the regexp limiting patterns without regard to letters case.
638</p>
639</dd>
640<dt>
Junio C Hamanoeb415992008-06-08 22:49:47641-E
642</dt>
643<dt>
644--extended-regexp
Junio C Hamanoa5c02c52007-05-21 06:14:27645</dt>
646<dd>
647<p>
648 Consider the limiting patterns to be extended regular expressions
649 instead of the default basic regular expressions.
650</p>
651</dd>
652<dt>
Junio C Hamanoeb415992008-06-08 22:49:47653-F
654</dt>
655<dt>
656--fixed-strings
Junio C Hamano24bc09a2008-02-28 00:27:44657</dt>
658<dd>
659<p>
660 Consider the limiting patterns to be fixed strings (don't interpret
661 pattern as a regular expression).
662</p>
663</dd>
664<dt>
Junio C Hamano9be18972006-01-28 08:54:57665--remove-empty
666</dt>
667<dd>
668<p>
669 Stop when a given path disappears from the tree.
670</p>
671</dd>
672<dt>
Junio C Hamano7ccb9fd2006-07-15 01:38:40673--no-merges
674</dt>
675<dd>
676<p>
677 Do not print commits with more than one parent.
678</p>
679</dd>
680<dt>
Junio C Hamano554da792007-12-27 03:29:58681--first-parent
682</dt>
683<dd>
684<p>
685 Follow only the first parent commit upon seeing a merge
686 commit. This option can give a better overview when
687 viewing the evolution of a particular topic branch,
688 because merges into a topic branch tend to be only about
689 adjusting to updated upstream from time to time, and
690 this option allows you to ignore the individual commits
691 brought in to your history by such a merge.
692</p>
693</dd>
694<dt>
Junio C Hamano872c5682006-07-07 06:05:40695--not
696</dt>
697<dd>
698<p>
Junio C Hamano6926bef2007-06-16 09:54:05699 Reverses the meaning of the <em>&#94;</em> prefix (or lack thereof)
Junio C Hamano89e135d2006-09-03 06:18:25700 for all following revision specifiers, up to the next <em>--not</em>.
Junio C Hamano872c5682006-07-07 06:05:40701</p>
702</dd>
703<dt>
Junio C Hamano1a4e8412005-12-27 08:17:23704--all
705</dt>
706<dd>
707<p>
Junio C Hamano89e135d2006-09-03 06:18:25708 Pretend as if all the refs in <tt>$GIT_DIR/refs/</tt> are listed on the
709 command line as <em>&lt;commit&gt;</em>.
Junio C Hamano1a4e8412005-12-27 08:17:23710</p>
711</dd>
Junio C Hamano859f3b42006-08-04 10:04:30712<dt>
Junio C Hamanoc9245d92006-09-06 09:35:46713--stdin
714</dt>
715<dd>
716<p>
717 In addition to the <em>&lt;commit&gt;</em> listed on the command
718 line, read them from the standard input.
719</p>
720</dd>
721<dt>
Junio C Hamano8c5802d2007-11-15 00:13:36722--quiet
723</dt>
724<dd>
725<p>
Junio C Hamanob0e02952008-01-19 08:02:00726 Don't print anything to standard output. This form
727 is primarily meant to allow the caller to
Junio C Hamano8c5802d2007-11-15 00:13:36728 test the exit status to see if a range of objects is fully
729 connected (or not). It is faster than redirecting stdout
730 to /dev/null as the output does not have to be formatted.
731</p>
732</dd>
733<dt>
Junio C Hamanod9e0e5d2007-04-14 16:22:04734--cherry-pick
735</dt>
736<dd>
737<p>
738 Omit any commit that introduces the same change as
739 another commit on the "other side" when the set of
740 commits are limited with symmetric difference.<br />
741For example, if you have two branches, <tt>A</tt> and <tt>B</tt>, a usual way
742to list all commits on only one side of them is with
743<tt>--left-right</tt>, like the example above in the description of
744that option. It however shows the commits that were cherry-picked
745from the other branch (for example, "3rd on b" may be cherry-picked
746from branch A). With this option, such pairs of commits are
747excluded from the output.
748</p>
749</dd>
750<dt>
Junio C Hamanoeb415992008-06-08 22:49:47751-g
752</dt>
753<dt>
754--walk-reflogs
Junio C Hamanodb450ba2007-01-21 08:57:14755</dt>
756<dd>
757<p>
758 Instead of walking the commit ancestry chain, walk
759 reflog entries from the most recent one to older ones.
760 When this option is used you cannot specify commits to
Junio C Hamano6926bef2007-06-16 09:54:05761 exclude (that is, <em>&#94;commit</em>, <em>commit1..commit2</em>,
Junio C Hamanodb450ba2007-01-21 08:57:14762 nor <em>commit1&#8230;commit2</em> notations cannot be used).<br />
763With <em>--pretty</em> format other than oneline (for obvious reasons),
764this causes the output to have two extra lines of information
Junio C Hamano1d90cb02007-07-03 07:05:31765taken from the reflog. By default, <em>commit@{Nth}</em> notation is
Junio C Hamanodb450ba2007-01-21 08:57:14766used in the output. When the starting commit is specified as
Junio C Hamano1d368882008-08-11 22:03:10767<em>commit@{now}</em>, output also uses <em>commit@{timestamp}</em> notation
Junio C Hamanodb450ba2007-01-21 08:57:14768instead. Under <em>--pretty=oneline</em>, the commit message is
Junio C Hamanobdebabb2007-08-23 00:25:09769prefixed with this information on the same line.
Junio C Hamano1d368882008-08-11 22:03:10770This option cannot be combined with <em>--reverse</em>.
771See also <a href="git-reflog.html">git-reflog(1)</a>.
Junio C Hamanodb450ba2007-01-21 08:57:14772</p>
773</dd>
774<dt>
Junio C Hamano859f3b42006-08-04 10:04:30775--merge
776</dt>
777<dd>
778<p>
779 After a failed merge, show refs that touch files having a
780 conflict and don't exist on all heads to merge.
781</p>
782</dd>
Junio C Hamanoa0778c92006-08-29 04:03:11783<dt>
Junio C Hamano89e135d2006-09-03 06:18:25784--boundary
Junio C Hamanoa0778c92006-08-29 04:03:11785</dt>
786<dd>
787<p>
Junio C Hamano89e135d2006-09-03 06:18:25788 Output uninteresting commits at the boundary, which are usually
789 not shown.
790</p>
791</dd>
Junio C Hamanoa76cb0d2008-08-13 20:04:10792</dl></div>
793<h3 id="_history_simplification">History Simplification</h3><div style="clear:left"></div>
794<div class="para"><p>When optional paths are given, <em>git-rev-list</em> simplifies commits with
795various strategies, according to the options you have selected.</p></div>
796<div class="para"><p>Suppose you specified <tt>foo</tt> as the &lt;paths&gt;. We shall call commits
797that modify <tt>foo</tt> !TREESAME, and the rest TREESAME. (In a diff
798filtered for <tt>foo</tt>, they look different and equal, respectively.)</p></div>
799<div class="para"><p>In the following, we will always refer to the same example history to
800illustrate the differences between simplification settings. We assume
801that you are filtering for a file <tt>foo</tt> in this commit graph:</p></div>
802<div class="listingblock">
803<div class="content">
804<pre><tt> .-A---M---N---O---P
805 / / / / /
806 I B C D E
807 \ / / / /
808 `-------------'</tt></pre>
809</div></div>
810<div class="para"><p>The horizontal line of history A--P is taken to be the first parent of
811each merge. The commits are:</p></div>
812<div class="ilist"><ul>
813<li>
814<p>
815<tt>I</tt> is the initial commit, in which <tt>foo</tt> exists with contents
816 "asdf", and a file <tt>quux</tt> exists with contents "quux". Initial
817 commits are compared to an empty tree, so <tt>I</tt> is !TREESAME.
818</p>
819</li>
820<li>
821<p>
822In <tt>A</tt>, <tt>foo</tt> contains just "foo".
823</p>
824</li>
825<li>
826<p>
827<tt>B</tt> contains the same change as <tt>A</tt>. Its merge <tt>M</tt> is trivial and
828 hence TREESAME to all parents.
829</p>
830</li>
831<li>
832<p>
833<tt>C</tt> does not change <tt>foo</tt>, but its merge <tt>N</tt> changes it to "foobar",
834 so it is not TREESAME to any parent.
835</p>
836</li>
837<li>
838<p>
839<tt>D</tt> sets <tt>foo</tt> to "baz". Its merge <tt>O</tt> combines the strings from
840 <tt>N</tt> and <tt>D</tt> to "foobarbaz"; i.e., it is not TREESAME to any parent.
841</p>
842</li>
843<li>
844<p>
845<tt>E</tt> changes <tt>quux</tt> to "xyzzy", and its merge <tt>P</tt> combines the
846 strings to "quux xyzzy". Despite appearing interesting, <tt>P</tt> is
847 TREESAME to all parents.
848</p>
849</li>
850</ul></div>
851<div class="para"><p><em>rev-list</em> walks backwards through history, including or excluding
852commits based on whether <em>--full-history</em> and/or parent rewriting
853(via <em>--parents</em> or <em>--children</em>) are used. The following settings
854are available.</p></div>
855<div class="vlist"><dl>
856<dt>
857Default mode
858</dt>
859<dd>
860<p>
861 Commits are included if they are not TREESAME to any parent
862 (though this can be changed, see <em>--sparse</em> below). If the
863 commit was a merge, and it was TREESAME to one parent, follow
864 only that parent. (Even if there are several TREESAME
865 parents, follow only one of them.) Otherwise, follow all
866 parents.
867</p>
868<div class="para"><p>This results in:</p></div>
869<div class="listingblock">
870<div class="content">
871<pre><tt> .-A---N---O
872 / /
873 I---------D</tt></pre>
874</div></div>
875<div class="para"><p>Note how the rule to only follow the TREESAME parent, if one is
876available, removed <tt>B</tt> from consideration entirely. <tt>C</tt> was
877considered via <tt>N</tt>, but is TREESAME. Root commits are compared to an
878empty tree, so <tt>I</tt> is !TREESAME.</p></div>
879<div class="para"><p>Parent/child relations are only visible with --parents, but that does
880not affect the commits selected in default mode, so we have shown the
881parent lines.</p></div>
882</dd>
883<dt>
884--full-history without parent rewriting
885</dt>
886<dd>
887<p>
888 This mode differs from the default in one point: always follow
889 all parents of a merge, even if it is TREESAME to one of them.
890 Even if more than one side of the merge has commits that are
891 included, this does not imply that the merge itself is! In
892 the example, we get
893</p>
894<div class="listingblock">
895<div class="content">
896<pre><tt> I A B N D O</tt></pre>
897</div></div>
898<div class="para"><p><tt>P</tt> and <tt>M</tt> were excluded because they are TREESAME to a parent. <tt>E</tt>,
899<tt>C</tt> and <tt>B</tt> were all walked, but only <tt>B</tt> was !TREESAME, so the others
900do not appear.</p></div>
901<div class="para"><p>Note that without parent rewriting, it is not really possible to talk
902about the parent/child relationships between the commits, so we show
903them disconnected.</p></div>
904</dd>
905<dt>
906--full-history with parent rewriting
907</dt>
908<dd>
909<p>
910 Ordinary commits are only included if they are !TREESAME
911 (though this can be changed, see <em>--sparse</em> below).
912</p>
913<div class="para"><p>Merges are always included. However, their parent list is rewritten:
914Along each parent, prune away commits that are not included
915themselves. This results in</p></div>
916<div class="listingblock">
917<div class="content">
918<pre><tt> .-A---M---N---O---P
919 / / / / /
920 I B / D /
921 \ / / / /
922 `-------------'</tt></pre>
923</div></div>
924<div class="para"><p>Compare to <em>--full-history</em> without rewriting above. Note that <tt>E</tt>
925was pruned away because it is TREESAME, but the parent list of P was
926rewritten to contain <tt>E</tt>'s parent <tt>I</tt>. The same happened for <tt>C</tt> and
927<tt>N</tt>. Note also that <tt>P</tt> was included despite being TREESAME.</p></div>
928</dd>
929</dl></div>
930<div class="para"><p>In addition to the above settings, you can change whether TREESAME
931affects inclusion:</p></div>
932<div class="vlist"><dl>
Junio C Hamano89e135d2006-09-03 06:18:25933<dt>
Junio C Hamanoeb415992008-06-08 22:49:47934--dense
935</dt>
Junio C Hamanoa76cb0d2008-08-13 20:04:10936<dd>
937<p>
938 Commits that are walked are included if they are not TREESAME
939 to any parent.
940</p>
941</dd>
Junio C Hamanoeb415992008-06-08 22:49:47942<dt>
943--sparse
Junio C Hamano89e135d2006-09-03 06:18:25944</dt>
945<dd>
946<p>
Junio C Hamanoa76cb0d2008-08-13 20:04:10947 All commits that are walked are included.
Junio C Hamano89e135d2006-09-03 06:18:25948</p>
Junio C Hamanoa76cb0d2008-08-13 20:04:10949<div class="para"><p>Note that without <em>--full-history</em>, this still simplifies merges: if
950one of the parents is TREESAME, we follow only that one, so the other
951sides of the merge are never walked.</p></div>
Junio C Hamano89e135d2006-09-03 06:18:25952</dd>
Junio C Hamanoa76cb0d2008-08-13 20:04:10953</dl></div>
Junio C Hamanoa2f46622008-09-03 05:20:31954<div class="para"><p>Finally, there is a fourth simplification mode available:</p></div>
955<div class="vlist"><dl>
956<dt>
957--simplify-merges
958</dt>
959<dd>
960<p>
961 First, build a history graph in the same way that
962 <em>--full-history</em> with parent rewriting does (see above).
963</p>
964<div class="para"><p>Then simplify each commit <tt>C</tt> to its replacement <tt>C'</tt> in the final
965history according to the following rules:</p></div>
966<div class="ilist"><ul>
967<li>
968<p>
969Set <tt>C'</tt> to <tt>C</tt>.<br />
970</p>
971</li>
972<li>
973<p>
974Replace each parent <tt>P</tt> of <tt>C'</tt> with its simplification <tt>P'</tt>. In
975 the process, drop parents that are ancestors of other parents, and
976 remove duplicates.<br />
977</p>
978</li>
979<li>
980<p>
981If after this parent rewriting, <tt>C'</tt> is a root or merge commit (has
982 zero or &gt;1 parents), a boundary commit, or !TREESAME, it remains.
983 Otherwise, it is replaced with its only parent.
984</p>
985</li>
986</ul></div>
987<div class="para"><p>The effect of this is best shown by way of comparing to
988<em>--full-history</em> with parent rewriting. The example turns into:</p></div>
989<div class="listingblock">
990<div class="content">
991<pre><tt> .-A---M---N---O
992 / / /
993 I B D
994 \ / /
995 `---------'</tt></pre>
996</div></div>
997<div class="para"><p>Note the major differences in <tt>N</tt> and <tt>P</tt> over <em>--full-history</em>:</p></div>
998<div class="ilist"><ul>
999<li>
1000<p>
1001<tt>N</tt>'s parent list had <tt>I</tt> removed, because it is an ancestor of the
1002 other parent <tt>M</tt>. Still, <tt>N</tt> remained because it is !TREESAME.<br />
1003</p>
1004</li>
1005<li>
1006<p>
1007<tt>P</tt>'s parent list similarly had <tt>I</tt> removed. <tt>P</tt> was then
1008 removed completely, because it had one parent and is TREESAME.
1009</p>
1010</li>
1011</ul></div>
1012</dd>
1013</dl></div>
Junio C Hamanoa76cb0d2008-08-13 20:04:101014<h3 id="_bisection_helpers">Bisection Helpers</h3><div style="clear:left"></div>
1015<div class="vlist"><dl>
Junio C Hamano89e135d2006-09-03 06:18:251016<dt>
1017--bisect
1018</dt>
1019<dd>
1020<p>
1021Limit output to the one commit object which is roughly halfway between
1022the included and excluded commits. Thus, if
1023</p>
Junio C Hamanoa76cb0d2008-08-13 20:04:101024</dd>
1025</dl></div>
Junio C Hamano89e135d2006-09-03 06:18:251026<div class="listingblock">
1027<div class="content">
1028<pre><tt> $ git-rev-list --bisect foo ^bar ^baz</tt></pre>
1029</div></div>
Junio C Hamanoba4b9282008-07-06 05:20:311030<div class="para"><p>outputs <em>midpoint</em>, the output of the two commands</p></div>
Junio C Hamano89e135d2006-09-03 06:18:251031<div class="listingblock">
1032<div class="content">
1033<pre><tt> $ git-rev-list foo ^midpoint
1034 $ git-rev-list midpoint ^bar ^baz</tt></pre>
1035</div></div>
Junio C Hamanoba4b9282008-07-06 05:20:311036<div class="para"><p>would be of roughly the same length. Finding the change which
Junio C Hamano89e135d2006-09-03 06:18:251037introduces a regression is thus reduced to a binary search: repeatedly
1038generate and test new 'midpoint's until the commit chain is of length
Junio C Hamanoba4b9282008-07-06 05:20:311039one.</p></div>
Junio C Hamanoa76cb0d2008-08-13 20:04:101040<div class="vlist"><dl>
Junio C Hamano20f64da2007-04-04 18:38:301041<dt>
1042--bisect-vars
1043</dt>
1044<dd>
1045<p>
1046This calculates the same as <tt>--bisect</tt>, but outputs text ready
1047to be eval'ed by the shell. These lines will assign the name of
1048the midpoint revision to the variable <tt>bisect_rev</tt>, and the
1049expected number of commits to be tested after <tt>bisect_rev</tt> is
1050tested to <tt>bisect_nr</tt>, the expected number of commits to be
1051tested if <tt>bisect_rev</tt> turns out to be good to <tt>bisect_good</tt>,
1052the expected number of commits to be tested if <tt>bisect_rev</tt>
1053turns out to be bad to <tt>bisect_bad</tt>, and the number of commits
1054we are bisecting right now to <tt>bisect_all</tt>.
1055</p>
1056</dd>
Junio C Hamano1974bf22007-10-31 05:57:201057<dt>
1058--bisect-all
1059</dt>
1060<dd>
1061<p>
1062This outputs all the commit objects between the included and excluded
1063commits, ordered by their distance to the included and excluded
1064commits. The farthest from them is displayed first. (This is the only
1065one displayed by <tt>--bisect</tt>.)
1066</p>
Junio C Hamanoa76cb0d2008-08-13 20:04:101067</dd>
1068</dl></div>
Junio C Hamanoba4b9282008-07-06 05:20:311069<div class="para"><p>This is useful because it makes it easy to choose a good commit to
Junio C Hamano1974bf22007-10-31 05:57:201070test when you want to avoid to test some of them for some reason (they
Junio C Hamanoba4b9282008-07-06 05:20:311071may not compile for example).</p></div>
1072<div class="para"><p>This option can be used along with <tt>--bisect-vars</tt>, in this case,
Junio C Hamano1974bf22007-10-31 05:57:201073after all the sorted commit objects, there will be the same text as if
Junio C Hamanoba4b9282008-07-06 05:20:311074<tt>--bisect-vars</tt> had been used alone.</p></div>
Junio C Hamanoba4b9282008-07-06 05:20:311075<h3 id="_commit_ordering">Commit Ordering</h3><div style="clear:left"></div>
1076<div class="para"><p>By default, the commits are shown in reverse chronological order.</p></div>
1077<div class="vlist"><dl>
Junio C Hamano89e135d2006-09-03 06:18:251078<dt>
1079--topo-order
1080</dt>
1081<dd>
1082<p>
1083 This option makes them appear in topological order (i.e.
1084 descendant commits are shown before their parents).
1085</p>
1086</dd>
1087<dt>
1088--date-order
1089</dt>
1090<dd>
1091<p>
1092 This option is similar to <em>--topo-order</em> in the sense that no
1093 parent comes before all of its children, but otherwise things
1094 are still ordered in the commit timestamp order.
1095</p>
1096</dd>
Junio C Hamano053827f2007-02-14 07:23:581097<dt>
1098--reverse
1099</dt>
1100<dd>
1101<p>
1102 Output the commits in reverse order.
Junio C Hamanobdebabb2007-08-23 00:25:091103 Cannot be combined with <em>--walk-reflogs</em>.
Junio C Hamano053827f2007-02-14 07:23:581104</p>
1105</dd>
Junio C Hamanoba4b9282008-07-06 05:20:311106</dl></div>
1107<h3 id="_object_traversal">Object Traversal</h3><div style="clear:left"></div>
1108<div class="para"><p>These options are mostly targeted for packing of git repositories.</p></div>
1109<div class="vlist"><dl>
Junio C Hamano89e135d2006-09-03 06:18:251110<dt>
1111--objects
1112</dt>
1113<dd>
1114<p>
1115 Print the object IDs of any object referenced by the listed
Junio C Hamanob0e02952008-01-19 08:02:001116 commits. <em>--objects foo ^bar</em> thus means "send me
Junio C Hamano89e135d2006-09-03 06:18:251117 all object IDs which I need to download if I have the commit
1118 object <em>bar</em>, but not <em>foo</em>".
1119</p>
1120</dd>
1121<dt>
1122--objects-edge
1123</dt>
1124<dd>
1125<p>
1126 Similar to <em>--objects</em>, but also print the IDs of excluded
1127 commits prefixed with a "-" character. This is used by
1128 <a href="git-pack-objects.html">git-pack-objects(1)</a> to build "thin" pack, which records
1129 objects in deltified form based on objects contained in these
1130 excluded commits to reduce network traffic.
1131</p>
1132</dd>
1133<dt>
1134--unpacked
1135</dt>
1136<dd>
1137<p>
1138 Only useful with <em>--objects</em>; print the object IDs that are not
1139 in packs.
Junio C Hamanoa0778c92006-08-29 04:03:111140</p>
1141</dd>
Junio C Hamanoa196f6d2007-07-24 08:10:271142<dt>
1143--no-walk
1144</dt>
1145<dd>
1146<p>
1147 Only show the given revs, but do not traverse their ancestors.
1148</p>
1149</dd>
1150<dt>
1151--do-walk
1152</dt>
1153<dd>
1154<p>
1155 Overrides a previous --no-walk.
1156</p>
1157</dd>
Junio C Hamanoba4b9282008-07-06 05:20:311158</dl></div>
Junio C Hamano1a4e8412005-12-27 08:17:231159</div>
Junio C Hamanoba4b9282008-07-06 05:20:311160<h2 id="_pretty_formats">PRETTY FORMATS</h2>
Junio C Hamano0430e3a2007-05-15 03:13:171161<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:311162<div class="para"><p>If the commit is a merge, and if the pretty-format
Junio C Hamano0430e3a2007-05-15 03:13:171163is not <em>oneline</em>, <em>email</em> or <em>raw</em>, an additional line is
1164inserted before the <em>Author:</em> line. This line begins with
1165"Merge: " and the sha1s of ancestral commits are printed,
1166separated by spaces. Note that the listed commits may not
1167necessarily be the list of the <strong>direct</strong> parent commits if you
1168have limited your view of history: for example, if you are
1169only interested in changes related to a certain directory or
Junio C Hamanoba4b9282008-07-06 05:20:311170file.</p></div>
1171<div class="para"><p>Here are some additional details for each format:</p></div>
1172<div class="ilist"><ul>
Junio C Hamano0430e3a2007-05-15 03:13:171173<li>
1174<p>
1175<em>oneline</em>
1176</p>
1177<div class="literalblock">
1178<div class="content">
1179<pre><tt>&lt;sha1&gt; &lt;title line&gt;</tt></pre>
1180</div></div>
Junio C Hamanoba4b9282008-07-06 05:20:311181<div class="para"><p>This is designed to be as compact as possible.</p></div>
Junio C Hamano0430e3a2007-05-15 03:13:171182</li>
1183<li>
1184<p>
1185<em>short</em>
1186</p>
1187<div class="literalblock">
1188<div class="content">
1189<pre><tt>commit &lt;sha1&gt;
1190Author: &lt;author&gt;</tt></pre>
1191</div></div>
1192<div class="literalblock">
1193<div class="content">
1194<pre><tt>&lt;title line&gt;</tt></pre>
1195</div></div>
1196</li>
1197<li>
1198<p>
1199<em>medium</em>
1200</p>
1201<div class="literalblock">
1202<div class="content">
1203<pre><tt>commit &lt;sha1&gt;
1204Author: &lt;author&gt;
Junio C Hamanoba4b9282008-07-06 05:20:311205Date: &lt;author date&gt;</tt></pre>
Junio C Hamano0430e3a2007-05-15 03:13:171206</div></div>
1207<div class="literalblock">
1208<div class="content">
1209<pre><tt>&lt;title line&gt;</tt></pre>
1210</div></div>
1211<div class="literalblock">
1212<div class="content">
1213<pre><tt>&lt;full commit message&gt;</tt></pre>
1214</div></div>
1215</li>
1216<li>
1217<p>
1218<em>full</em>
1219</p>
1220<div class="literalblock">
1221<div class="content">
1222<pre><tt>commit &lt;sha1&gt;
1223Author: &lt;author&gt;
1224Commit: &lt;committer&gt;</tt></pre>
1225</div></div>
1226<div class="literalblock">
1227<div class="content">
1228<pre><tt>&lt;title line&gt;</tt></pre>
1229</div></div>
1230<div class="literalblock">
1231<div class="content">
1232<pre><tt>&lt;full commit message&gt;</tt></pre>
1233</div></div>
1234</li>
1235<li>
1236<p>
1237<em>fuller</em>
1238</p>
1239<div class="literalblock">
1240<div class="content">
1241<pre><tt>commit &lt;sha1&gt;
1242Author: &lt;author&gt;
Junio C Hamanoba4b9282008-07-06 05:20:311243AuthorDate: &lt;author date&gt;
Junio C Hamano0430e3a2007-05-15 03:13:171244Commit: &lt;committer&gt;
Junio C Hamanoba4b9282008-07-06 05:20:311245CommitDate: &lt;committer date&gt;</tt></pre>
Junio C Hamano0430e3a2007-05-15 03:13:171246</div></div>
1247<div class="literalblock">
1248<div class="content">
1249<pre><tt>&lt;title line&gt;</tt></pre>
1250</div></div>
1251<div class="literalblock">
1252<div class="content">
1253<pre><tt>&lt;full commit message&gt;</tt></pre>
1254</div></div>
1255</li>
1256<li>
1257<p>
1258<em>email</em>
1259</p>
1260<div class="literalblock">
1261<div class="content">
1262<pre><tt>From &lt;sha1&gt; &lt;date&gt;
1263From: &lt;author&gt;
Junio C Hamanoba4b9282008-07-06 05:20:311264Date: &lt;author date&gt;
Junio C Hamano0430e3a2007-05-15 03:13:171265Subject: [PATCH] &lt;title line&gt;</tt></pre>
1266</div></div>
1267<div class="literalblock">
1268<div class="content">
1269<pre><tt>&lt;full commit message&gt;</tt></pre>
1270</div></div>
1271</li>
1272<li>
1273<p>
1274<em>raw</em>
1275</p>
Junio C Hamanoba4b9282008-07-06 05:20:311276<div class="para"><p>The <em>raw</em> format shows the entire commit exactly as
Junio C Hamano0430e3a2007-05-15 03:13:171277stored in the commit object. Notably, the SHA1s are
1278displayed in full, regardless of whether --abbrev or
1279--no-abbrev are used, and <em>parents</em> information show the
1280true parent commits, without taking grafts nor history
Junio C Hamanoba4b9282008-07-06 05:20:311281simplification into account.</p></div>
Junio C Hamano0430e3a2007-05-15 03:13:171282</li>
1283<li>
1284<p>
1285<em>format:</em>
1286</p>
Junio C Hamanoba4b9282008-07-06 05:20:311287<div class="para"><p>The <em>format:</em> format allows you to specify which information
Junio C Hamano0430e3a2007-05-15 03:13:171288you want to show. It works a little bit like printf format,
1289with the notable exception that you get a newline with <em>%n</em>
Junio C Hamanoba4b9282008-07-06 05:20:311290instead of <em>\n</em>.</p></div>
1291<div class="para"><p>E.g, <em>format:"The author of %h was %an, %ar%nThe title was &gt;&gt;%s&lt;&lt;%n"</em>
1292would show something like this:</p></div>
Junio C Hamano0430e3a2007-05-15 03:13:171293<div class="listingblock">
1294<div class="content">
1295<pre><tt>The author of fe6e0ee was Junio C Hamano, 23 hours ago
1296The title was &gt;&gt;t4119: test autocomputing -p&lt;n&gt; for traditional diff input.&lt;&lt;
1297</tt></pre>
1298</div></div>
Junio C Hamanoba4b9282008-07-06 05:20:311299<div class="para"><p>The placeholders are:</p></div>
1300<div class="ilist"><ul>
Junio C Hamano0430e3a2007-05-15 03:13:171301<li>
1302<p>
1303<em>%H</em>: commit hash
1304</p>
1305</li>
1306<li>
1307<p>
1308<em>%h</em>: abbreviated commit hash
1309</p>
1310</li>
1311<li>
1312<p>
1313<em>%T</em>: tree hash
1314</p>
1315</li>
1316<li>
1317<p>
1318<em>%t</em>: abbreviated tree hash
1319</p>
1320</li>
1321<li>
1322<p>
1323<em>%P</em>: parent hashes
1324</p>
1325</li>
1326<li>
1327<p>
1328<em>%p</em>: abbreviated parent hashes
1329</p>
1330</li>
1331<li>
1332<p>
1333<em>%an</em>: author name
1334</p>
1335</li>
1336<li>
1337<p>
Junio C Hamanof5a93622008-07-16 03:23:571338<em>%aN</em>: author name (respecting .mailmap)
1339</p>
1340</li>
1341<li>
1342<p>
Junio C Hamano0430e3a2007-05-15 03:13:171343<em>%ae</em>: author email
1344</p>
1345</li>
1346<li>
1347<p>
Junio C Hamanoa387df32008-08-29 08:56:581348<em>%ad</em>: author date (format respects --date= option)
Junio C Hamano0430e3a2007-05-15 03:13:171349</p>
1350</li>
1351<li>
1352<p>
1353<em>%aD</em>: author date, RFC2822 style
1354</p>
1355</li>
1356<li>
1357<p>
1358<em>%ar</em>: author date, relative
1359</p>
1360</li>
1361<li>
1362<p>
1363<em>%at</em>: author date, UNIX timestamp
1364</p>
1365</li>
1366<li>
1367<p>
Junio C Hamano02f130b2007-07-14 08:26:561368<em>%ai</em>: author date, ISO 8601 format
1369</p>
1370</li>
1371<li>
1372<p>
Junio C Hamano0430e3a2007-05-15 03:13:171373<em>%cn</em>: committer name
1374</p>
1375</li>
1376<li>
1377<p>
Junio C Hamanof5a93622008-07-16 03:23:571378<em>%cN</em>: committer name (respecting .mailmap)
1379</p>
1380</li>
1381<li>
1382<p>
Junio C Hamano0430e3a2007-05-15 03:13:171383<em>%ce</em>: committer email
1384</p>
1385</li>
1386<li>
1387<p>
1388<em>%cd</em>: committer date
1389</p>
1390</li>
1391<li>
1392<p>
1393<em>%cD</em>: committer date, RFC2822 style
1394</p>
1395</li>
1396<li>
1397<p>
1398<em>%cr</em>: committer date, relative
1399</p>
1400</li>
1401<li>
1402<p>
1403<em>%ct</em>: committer date, UNIX timestamp
1404</p>
1405</li>
1406<li>
1407<p>
Junio C Hamano02f130b2007-07-14 08:26:561408<em>%ci</em>: committer date, ISO 8601 format
1409</p>
1410</li>
1411<li>
1412<p>
Junio C Hamano5e4d8de2008-09-19 06:27:021413<em>%d</em>: ref names, like the --decorate option of <a href="git-log.html">git-log(1)</a>
1414</p>
1415</li>
1416<li>
1417<p>
Junio C Hamano0430e3a2007-05-15 03:13:171418<em>%e</em>: encoding
1419</p>
1420</li>
1421<li>
1422<p>
1423<em>%s</em>: subject
1424</p>
1425</li>
1426<li>
1427<p>
1428<em>%b</em>: body
1429</p>
1430</li>
1431<li>
1432<p>
1433<em>%Cred</em>: switch color to red
1434</p>
1435</li>
1436<li>
1437<p>
1438<em>%Cgreen</em>: switch color to green
1439</p>
1440</li>
1441<li>
1442<p>
1443<em>%Cblue</em>: switch color to blue
1444</p>
1445</li>
1446<li>
1447<p>
1448<em>%Creset</em>: reset color
1449</p>
1450</li>
1451<li>
1452<p>
1453<em>%m</em>: left, right or boundary mark
1454</p>
1455</li>
1456<li>
1457<p>
1458<em>%n</em>: newline
1459</p>
1460</li>
Junio C Hamanob78d2592008-04-09 09:39:081461<li>
1462<p>
1463<em>%x00</em>: print a byte from a hex code
1464</p>
1465</li>
Junio C Hamanoba4b9282008-07-06 05:20:311466</ul></div>
Junio C Hamano0430e3a2007-05-15 03:13:171467</li>
Junio C Hamano6fb124c2008-06-13 10:04:011468<li>
1469<p>
1470<em>tformat:</em>
1471</p>
Junio C Hamanoba4b9282008-07-06 05:20:311472<div class="para"><p>The <em>tformat:</em> format works exactly like <em>format:</em>, except that it
Junio C Hamano6fb124c2008-06-13 10:04:011473provides "terminator" semantics instead of "separator" semantics. In
1474other words, each commit has the message terminator character (usually a
1475newline) appended, rather than a separator placed between entries.
1476This means that the final entry of a single-line format will be properly
1477terminated with a new line, just as the "oneline" format does.
Junio C Hamanoba4b9282008-07-06 05:20:311478For example:</p></div>
Junio C Hamano6fb124c2008-06-13 10:04:011479<div class="listingblock">
1480<div class="content">
1481<pre><tt>$ git log -2 --pretty=format:%h 4da45bef \
1482 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
14834da45be
14847134973 -- NO NEWLINE
1485
1486$ git log -2 --pretty=tformat:%h 4da45bef \
1487 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
14884da45be
14897134973</tt></pre>
1490</div></div>
1491</li>
Junio C Hamanoba4b9282008-07-06 05:20:311492</ul></div>
Junio C Hamano0430e3a2007-05-15 03:13:171493</div>
Junio C Hamanoba4b9282008-07-06 05:20:311494<h2 id="_author">Author</h2>
Junio C Hamano1a4e8412005-12-27 08:17:231495<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:311496<div class="para"><p>Written by Linus Torvalds &lt;torvalds@osdl.org&gt;</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231497</div>
Junio C Hamanoba4b9282008-07-06 05:20:311498<h2 id="_documentation">Documentation</h2>
Junio C Hamano1a4e8412005-12-27 08:17:231499<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:311500<div class="para"><p>Documentation by David Greaves, Junio C Hamano, Jonas Fonseca
1501and the git-list &lt;git@vger.kernel.org&gt;.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231502</div>
Junio C Hamanoba4b9282008-07-06 05:20:311503<h2 id="_git">GIT</h2>
Junio C Hamano1a4e8412005-12-27 08:17:231504<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:311505<div class="para"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231506</div>
1507<div id="footer">
1508<div id="footer-text">
Junio C Hamanoa476efa2008-10-10 15:31:421509Last updated 2008-10-10 15:30:49 UTC
Junio C Hamano1a4e8412005-12-27 08:17:231510</div>
1511</div>
1512</body>
1513</html>