Update git documentation
[TortoiseGit.git] / doc / source / en / TortoiseGit / git_doc / git-rev-list.xml
blob41c2c101cde5d81c6eb0e9958258b2e206f68069
1 <?xml version="1.0" encoding="UTF-8"?>\r
2 <!DOCTYPE sect2 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">\r
3 \r
4 <sect2 lang="en" id="git-rev-list(1)">\r
5     <title>git-rev-list(1)</title>\r
6 <indexterm>\r
7 <primary>git-rev-list(1)</primary>\r
8 </indexterm>\r
9 <simplesect id="git-rev-list(1)__name">\r
10 <title>NAME</title>\r
11 <simpara>git-rev-list - Lists commit objects in reverse chronological order</simpara>\r
12 </simplesect>\r
13 <simplesect id="git-rev-list(1)__synopsis">\r
14 <title>SYNOPSIS</title>\r
15 <blockquote>\r
16 <literallayout><emphasis>git rev-list</emphasis> [ --max-count=&lt;number&gt; ]\r
17              [ --skip=&lt;number&gt; ]\r
18              [ --max-age=&lt;timestamp&gt; ]\r
19              [ --min-age=&lt;timestamp&gt; ]\r
20              [ --sparse ]\r
21              [ --merges ]\r
22              [ --no-merges ]\r
23              [ --min-parents=&lt;number&gt; ]\r
24              [ --no-min-parents ]\r
25              [ --max-parents=&lt;number&gt; ]\r
26              [ --no-max-parents ]\r
27              [ --first-parent ]\r
28              [ --remove-empty ]\r
29              [ --full-history ]\r
30              [ --not ]\r
31              [ --all ]\r
32              [ --branches[=&lt;pattern&gt;] ]\r
33              [ --tags[=&lt;pattern&gt;] ]\r
34              [ --remotes[=&lt;pattern&gt;] ]\r
35              [ --glob=&lt;glob-pattern&gt; ]\r
36              [ --ignore-missing ]\r
37              [ --stdin ]\r
38              [ --quiet ]\r
39              [ --topo-order ]\r
40              [ --parents ]\r
41              [ --timestamp ]\r
42              [ --left-right ]\r
43              [ --left-only ]\r
44              [ --right-only ]\r
45              [ --cherry-mark ]\r
46              [ --cherry-pick ]\r
47              [ --encoding=&lt;encoding&gt; ]\r
48              [ --(author|committer|grep)=&lt;pattern&gt; ]\r
49              [ --regexp-ignore-case | -i ]\r
50              [ --extended-regexp | -E ]\r
51              [ --fixed-strings | -F ]\r
52              [ --date=&lt;format&gt;]\r
53              [ [ --objects | --objects-edge | --objects-edge-aggressive ]\r
54                [ --unpacked ] ]\r
55              [ --pretty | --header ]\r
56              [ --bisect ]\r
57              [ --bisect-vars ]\r
58              [ --bisect-all ]\r
59              [ --merge ]\r
60              [ --reverse ]\r
61              [ --walk-reflogs ]\r
62              [ --no-walk ] [ --do-walk ]\r
63              [ --count ]\r
64              [ --use-bitmap-index ]\r
65              &lt;commit&gt;&#8230; [ -- &lt;paths&gt;&#8230; ]</literallayout>\r
66 </blockquote>\r
67 </simplesect>\r
68 <simplesect id="git-rev-list(1)__description">\r
69 <title>DESCRIPTION</title>\r
70 <simpara>List commits that are reachable by following the <emphasis>parent</emphasis> links from the\r
71 given commit(s), but exclude commits that are reachable from the one(s)\r
72 given with a <emphasis>&#94;</emphasis> in front of them.  The output is given in reverse\r
73 chronological order by default.</simpara>\r
74 <simpara>You can think of this as a set operation.  Commits given on the command\r
75 line form a set of commits that are reachable from any of them, and then\r
76 commits reachable from any of the ones given with <emphasis>&#94;</emphasis> in front are\r
77 subtracted from that set.  The remaining commits are what comes out in the\r
78 command's output.  Various other options and paths parameters can be used\r
79 to further limit the result.</simpara>\r
80 <simpara>Thus, the following command:</simpara>\r
81 <screen>        $ git rev-list foo bar ^baz</screen>\r
82 <simpara>means "list all the commits which are reachable from <emphasis>foo</emphasis> or <emphasis>bar</emphasis>, but\r
83 not from <emphasis>baz</emphasis>".</simpara>\r
84 <simpara>A special notation "<emphasis>&lt;commit1&gt;</emphasis>..<emphasis>&lt;commit2&gt;</emphasis>" can be used as a\r
85 short-hand for "&#94;'&lt;commit1&gt;' <emphasis>&lt;commit2&gt;</emphasis>". For example, either of\r
86 the following may be used interchangeably:</simpara>\r
87 <screen>        $ git rev-list origin..HEAD\r
88         $ git rev-list HEAD ^origin</screen>\r
89 <simpara>Another special notation is "<emphasis>&lt;commit1&gt;</emphasis>&#8230;<emphasis>&lt;commit2&gt;</emphasis>" which is useful\r
90 for merges.  The resulting set of commits is the symmetric difference\r
91 between the two operands.  The following two commands are equivalent:</simpara>\r
92 <screen>        $ git rev-list A B --not $(git merge-base --all A B)\r
93         $ git rev-list A...B</screen>\r
94 <simpara><emphasis>rev-list</emphasis> is a very essential Git command, since it\r
95 provides the ability to build and traverse commit ancestry graphs. For\r
96 this reason, it has a lot of different options that enables it to be\r
97 used by commands as different as <emphasis>git bisect</emphasis> and\r
98 <emphasis>git repack</emphasis>.</simpara>\r
99 </simplesect>\r
100 <simplesect id="git-rev-list(1)__options">\r
101 <title>OPTIONS</title>\r
102 <section id="git-rev-list(1)__commit_limiting">\r
103 <title>Commit Limiting</title>\r
104 <simpara>Besides specifying a range of commits that should be listed using the\r
105 special notations explained in the description, additional commit\r
106 limiting may be applied.</simpara>\r
107 <simpara>Using more options generally further limits the output (e.g.\r
108 <emphasis>--since=&lt;date1&gt;</emphasis> limits to commits newer than <emphasis>&lt;date1&gt;</emphasis>, and using it\r
109 with <emphasis>--grep=&lt;pattern&gt;</emphasis> further limits to commits whose log message\r
110 has a line that matches <emphasis>&lt;pattern&gt;</emphasis>), unless otherwise noted.</simpara>\r
111 <simpara>Note that these are applied before commit\r
112 ordering and formatting options, such as <emphasis>--reverse</emphasis>.</simpara>\r
113 <variablelist>\r
114 <varlistentry>\r
115 <term>\r
116 -&lt;number&gt;\r
117 </term>\r
118 <term>\r
119 -n &lt;number&gt;\r
120 </term>\r
121 <term>\r
122 --max-count=&lt;number&gt;\r
123 </term>\r
124 <listitem>\r
125 <simpara>\r
126         Limit the number of commits to output.\r
127 </simpara>\r
128 </listitem>\r
129 </varlistentry>\r
130 <varlistentry>\r
131 <term>\r
132 --skip=&lt;number&gt;\r
133 </term>\r
134 <listitem>\r
135 <simpara>\r
136         Skip <emphasis>number</emphasis> commits before starting to show the commit output.\r
137 </simpara>\r
138 </listitem>\r
139 </varlistentry>\r
140 <varlistentry>\r
141 <term>\r
142 --since=&lt;date&gt;\r
143 </term>\r
144 <term>\r
145 --after=&lt;date&gt;\r
146 </term>\r
147 <listitem>\r
148 <simpara>\r
149         Show commits more recent than a specific date.\r
150 </simpara>\r
151 </listitem>\r
152 </varlistentry>\r
153 <varlistentry>\r
154 <term>\r
155 --until=&lt;date&gt;\r
156 </term>\r
157 <term>\r
158 --before=&lt;date&gt;\r
159 </term>\r
160 <listitem>\r
161 <simpara>\r
162         Show commits older than a specific date.\r
163 </simpara>\r
164 </listitem>\r
165 </varlistentry>\r
166 <varlistentry>\r
167 <term>\r
168 --max-age=&lt;timestamp&gt;\r
169 </term>\r
170 <term>\r
171 --min-age=&lt;timestamp&gt;\r
172 </term>\r
173 <listitem>\r
174 <simpara>\r
175         Limit the commits output to specified time range.\r
176 </simpara>\r
177 </listitem>\r
178 </varlistentry>\r
179 <varlistentry>\r
180 <term>\r
181 --author=&lt;pattern&gt;\r
182 </term>\r
183 <term>\r
184 --committer=&lt;pattern&gt;\r
185 </term>\r
186 <listitem>\r
187 <simpara>\r
188         Limit the commits output to ones with author/committer\r
189         header lines that match the specified pattern (regular\r
190         expression).  With more than one <emphasis>--author=&lt;pattern&gt;</emphasis>,\r
191         commits whose author matches any of the given patterns are\r
192         chosen (similarly for multiple <emphasis>--committer=&lt;pattern&gt;</emphasis>).\r
193 </simpara>\r
194 </listitem>\r
195 </varlistentry>\r
196 <varlistentry>\r
197 <term>\r
198 --grep-reflog=&lt;pattern&gt;\r
199 </term>\r
200 <listitem>\r
201 <simpara>\r
202         Limit the commits output to ones with reflog entries that\r
203         match the specified pattern (regular expression). With\r
204         more than one <emphasis>--grep-reflog</emphasis>, commits whose reflog message\r
205         matches any of the given patterns are chosen.  It is an\r
206         error to use this option unless <emphasis>--walk-reflogs</emphasis> is in use.\r
207 </simpara>\r
208 </listitem>\r
209 </varlistentry>\r
210 <varlistentry>\r
211 <term>\r
212 --grep=&lt;pattern&gt;\r
213 </term>\r
214 <listitem>\r
215 <simpara>\r
216         Limit the commits output to ones with log message that\r
217         matches the specified pattern (regular expression).  With\r
218         more than one <emphasis>--grep=&lt;pattern&gt;</emphasis>, commits whose message\r
219         matches any of the given patterns are chosen (but see\r
220         <emphasis>--all-match</emphasis>).\r
221 </simpara>\r
222 </listitem>\r
223 </varlistentry>\r
224 <varlistentry>\r
225 <term>\r
226 --all-match\r
227 </term>\r
228 <listitem>\r
229 <simpara>\r
230         Limit the commits output to ones that match all given <emphasis>--grep</emphasis>,\r
231         instead of ones that match at least one.\r
232 </simpara>\r
233 </listitem>\r
234 </varlistentry>\r
235 <varlistentry>\r
236 <term>\r
237 --invert-grep\r
238 </term>\r
239 <listitem>\r
240 <simpara>\r
241         Limit the commits output to ones with log message that do not\r
242         match the pattern specified with <emphasis>--grep=&lt;pattern&gt;</emphasis>.\r
243 </simpara>\r
244 </listitem>\r
245 </varlistentry>\r
246 <varlistentry>\r
247 <term>\r
248 -i\r
249 </term>\r
250 <term>\r
251 --regexp-ignore-case\r
252 </term>\r
253 <listitem>\r
254 <simpara>\r
255         Match the regular expression limiting patterns without regard to letter\r
256         case.\r
257 </simpara>\r
258 </listitem>\r
259 </varlistentry>\r
260 <varlistentry>\r
261 <term>\r
262 --basic-regexp\r
263 </term>\r
264 <listitem>\r
265 <simpara>\r
266         Consider the limiting patterns to be basic regular expressions;\r
267         this is the default.\r
268 </simpara>\r
269 </listitem>\r
270 </varlistentry>\r
271 <varlistentry>\r
272 <term>\r
273 -E\r
274 </term>\r
275 <term>\r
276 --extended-regexp\r
277 </term>\r
278 <listitem>\r
279 <simpara>\r
280         Consider the limiting patterns to be extended regular expressions\r
281         instead of the default basic regular expressions.\r
282 </simpara>\r
283 </listitem>\r
284 </varlistentry>\r
285 <varlistentry>\r
286 <term>\r
287 -F\r
288 </term>\r
289 <term>\r
290 --fixed-strings\r
291 </term>\r
292 <listitem>\r
293 <simpara>\r
294         Consider the limiting patterns to be fixed strings (don't interpret\r
295         pattern as a regular expression).\r
296 </simpara>\r
297 </listitem>\r
298 </varlistentry>\r
299 <varlistentry>\r
300 <term>\r
301 --perl-regexp\r
302 </term>\r
303 <listitem>\r
304 <simpara>\r
305         Consider the limiting patterns to be Perl-compatible regular expressions.\r
306         Requires libpcre to be compiled in.\r
307 </simpara>\r
308 </listitem>\r
309 </varlistentry>\r
310 <varlistentry>\r
311 <term>\r
312 --remove-empty\r
313 </term>\r
314 <listitem>\r
315 <simpara>\r
316         Stop when a given path disappears from the tree.\r
317 </simpara>\r
318 </listitem>\r
319 </varlistentry>\r
320 <varlistentry>\r
321 <term>\r
322 --merges\r
323 </term>\r
324 <listitem>\r
325 <simpara>\r
326         Print only merge commits. This is exactly the same as <emphasis>--min-parents=2</emphasis>.\r
327 </simpara>\r
328 </listitem>\r
329 </varlistentry>\r
330 <varlistentry>\r
331 <term>\r
332 --no-merges\r
333 </term>\r
334 <listitem>\r
335 <simpara>\r
336         Do not print commits with more than one parent. This is\r
337         exactly the same as <emphasis>--max-parents=1</emphasis>.\r
338 </simpara>\r
339 </listitem>\r
340 </varlistentry>\r
341 <varlistentry>\r
342 <term>\r
343 --min-parents=&lt;number&gt;\r
344 </term>\r
345 <term>\r
346 --max-parents=&lt;number&gt;\r
347 </term>\r
348 <term>\r
349 --no-min-parents\r
350 </term>\r
351 <term>\r
352 --no-max-parents\r
353 </term>\r
354 <listitem>\r
355 <simpara>\r
356         Show only commits which have at least (or at most) that many parent\r
357         commits. In particular, <emphasis>--max-parents=1</emphasis> is the same as <emphasis>--no-merges</emphasis>,\r
358         <emphasis>--min-parents=2</emphasis> is the same as <emphasis>--merges</emphasis>.  <emphasis>--max-parents=0</emphasis>\r
359         gives all root commits and <emphasis>--min-parents=3</emphasis> all octopus merges.\r
360 </simpara>\r
361 <simpara><emphasis>--no-min-parents</emphasis> and <emphasis>--no-max-parents</emphasis> reset these limits (to no limit)\r
362 again.  Equivalent forms are <emphasis>--min-parents=0</emphasis> (any commit has 0 or more\r
363 parents) and <emphasis>--max-parents=-1</emphasis> (negative numbers denote no upper limit).</simpara>\r
364 </listitem>\r
365 </varlistentry>\r
366 <varlistentry>\r
367 <term>\r
368 --first-parent\r
369 </term>\r
370 <listitem>\r
371 <simpara>\r
372         Follow only the first parent commit upon seeing a merge\r
373         commit.  This option can give a better overview when\r
374         viewing the evolution of a particular topic branch,\r
375         because merges into a topic branch tend to be only about\r
376         adjusting to updated upstream from time to time, and\r
377         this option allows you to ignore the individual commits\r
378         brought in to your history by such a merge. Cannot be\r
379         combined with --bisect.\r
380 </simpara>\r
381 </listitem>\r
382 </varlistentry>\r
383 <varlistentry>\r
384 <term>\r
385 --not\r
386 </term>\r
387 <listitem>\r
388 <simpara>\r
389         Reverses the meaning of the <emphasis>&#94;</emphasis> prefix (or lack thereof)\r
390         for all following revision specifiers, up to the next <emphasis>--not</emphasis>.\r
391 </simpara>\r
392 </listitem>\r
393 </varlistentry>\r
394 <varlistentry>\r
395 <term>\r
396 --all\r
397 </term>\r
398 <listitem>\r
399 <simpara>\r
400         Pretend as if all the refs in <emphasis>refs/</emphasis> are listed on the\r
401         command line as <emphasis>&lt;commit&gt;</emphasis>.\r
402 </simpara>\r
403 </listitem>\r
404 </varlistentry>\r
405 <varlistentry>\r
406 <term>\r
407 --branches[=&lt;pattern&gt;]\r
408 </term>\r
409 <listitem>\r
410 <simpara>\r
411         Pretend as if all the refs in <emphasis>refs/heads</emphasis> are listed\r
412         on the command line as <emphasis>&lt;commit&gt;</emphasis>. If <emphasis>&lt;pattern&gt;</emphasis> is given, limit\r
413         branches to ones matching given shell glob. If pattern lacks <emphasis>?</emphasis>,\r
414         <emphasis>&#42;</emphasis>, or <emphasis>[</emphasis>, <emphasis>/&#42;</emphasis> at the end is implied.\r
415 </simpara>\r
416 </listitem>\r
417 </varlistentry>\r
418 <varlistentry>\r
419 <term>\r
420 --tags[=&lt;pattern&gt;]\r
421 </term>\r
422 <listitem>\r
423 <simpara>\r
424         Pretend as if all the refs in <emphasis>refs/tags</emphasis> are listed\r
425         on the command line as <emphasis>&lt;commit&gt;</emphasis>. If <emphasis>&lt;pattern&gt;</emphasis> is given, limit\r
426         tags to ones matching given shell glob. If pattern lacks <emphasis>?</emphasis>, <emphasis>&#42;</emphasis>,\r
427         or <emphasis>[</emphasis>, <emphasis>/&#42;</emphasis> at the end is implied.\r
428 </simpara>\r
429 </listitem>\r
430 </varlistentry>\r
431 <varlistentry>\r
432 <term>\r
433 --remotes[=&lt;pattern&gt;]\r
434 </term>\r
435 <listitem>\r
436 <simpara>\r
437         Pretend as if all the refs in <emphasis>refs/remotes</emphasis> are listed\r
438         on the command line as <emphasis>&lt;commit&gt;</emphasis>. If <emphasis>&lt;pattern&gt;</emphasis> is given, limit\r
439         remote-tracking branches to ones matching given shell glob.\r
440         If pattern lacks <emphasis>?</emphasis>, <emphasis>&#42;</emphasis>, or <emphasis>[</emphasis>, <emphasis>/&#42;</emphasis> at the end is implied.\r
441 </simpara>\r
442 </listitem>\r
443 </varlistentry>\r
444 <varlistentry>\r
445 <term>\r
446 --glob=&lt;glob-pattern&gt;\r
447 </term>\r
448 <listitem>\r
449 <simpara>\r
450         Pretend as if all the refs matching shell glob <emphasis>&lt;glob-pattern&gt;</emphasis>\r
451         are listed on the command line as <emphasis>&lt;commit&gt;</emphasis>. Leading <emphasis>refs/</emphasis>,\r
452         is automatically prepended if missing. If pattern lacks <emphasis>?</emphasis>, <emphasis>&#42;</emphasis>,\r
453         or <emphasis>[</emphasis>, <emphasis>/&#42;</emphasis> at the end is implied.\r
454 </simpara>\r
455 </listitem>\r
456 </varlistentry>\r
457 <varlistentry>\r
458 <term>\r
459 --exclude=&lt;glob-pattern&gt;\r
460 </term>\r
461 <listitem>\r
462 <simpara>\r
463         Do not include refs matching <emphasis>&lt;glob-pattern&gt;</emphasis> that the next <emphasis>--all</emphasis>,\r
464         <emphasis>--branches</emphasis>, <emphasis>--tags</emphasis>, <emphasis>--remotes</emphasis>, or <emphasis>--glob</emphasis> would otherwise\r
465         consider. Repetitions of this option accumulate exclusion patterns\r
466         up to the next <emphasis>--all</emphasis>, <emphasis>--branches</emphasis>, <emphasis>--tags</emphasis>, <emphasis>--remotes</emphasis>, or\r
467         <emphasis>--glob</emphasis> option (other options or arguments do not clear\r
468         accumulated patterns).\r
469 </simpara>\r
470 <simpara>The patterns given should not begin with <emphasis>refs/heads</emphasis>, <emphasis>refs/tags</emphasis>, or\r
471 <emphasis>refs/remotes</emphasis> when applied to <emphasis>--branches</emphasis>, <emphasis>--tags</emphasis>, or <emphasis>--remotes</emphasis>,\r
472 respectively, and they must begin with <emphasis>refs/</emphasis> when applied to <emphasis>--glob</emphasis>\r
473 or <emphasis>--all</emphasis>. If a trailing <emphasis>/&#42;</emphasis> is intended, it must be given\r
474 explicitly.</simpara>\r
475 </listitem>\r
476 </varlistentry>\r
477 <varlistentry>\r
478 <term>\r
479 --reflog\r
480 </term>\r
481 <listitem>\r
482 <simpara>\r
483         Pretend as if all objects mentioned by reflogs are listed on the\r
484         command line as <emphasis>&lt;commit&gt;</emphasis>.\r
485 </simpara>\r
486 </listitem>\r
487 </varlistentry>\r
488 <varlistentry>\r
489 <term>\r
490 --ignore-missing\r
491 </term>\r
492 <listitem>\r
493 <simpara>\r
494         Upon seeing an invalid object name in the input, pretend as if\r
495         the bad input was not given.\r
496 </simpara>\r
497 </listitem>\r
498 </varlistentry>\r
499 <varlistentry>\r
500 <term>\r
501 --stdin\r
502 </term>\r
503 <listitem>\r
504 <simpara>\r
505         In addition to the <emphasis>&lt;commit&gt;</emphasis> listed on the command\r
506         line, read them from the standard input. If a <emphasis>--</emphasis> separator is\r
507         seen, stop reading commits and start reading paths to limit the\r
508         result.\r
509 </simpara>\r
510 </listitem>\r
511 </varlistentry>\r
512 <varlistentry>\r
513 <term>\r
514 --quiet\r
515 </term>\r
516 <listitem>\r
517 <simpara>\r
518         Don't print anything to standard output.  This form\r
519         is primarily meant to allow the caller to\r
520         test the exit status to see if a range of objects is fully\r
521         connected (or not).  It is faster than redirecting stdout\r
522         to <emphasis>/dev/null</emphasis> as the output does not have to be formatted.\r
523 </simpara>\r
524 </listitem>\r
525 </varlistentry>\r
526 <varlistentry>\r
527 <term>\r
528 --cherry-mark\r
529 </term>\r
530 <listitem>\r
531 <simpara>\r
532         Like <emphasis>--cherry-pick</emphasis> (see below) but mark equivalent commits\r
533         with <emphasis>=</emphasis> rather than omitting them, and inequivalent ones with <emphasis>+</emphasis>.\r
534 </simpara>\r
535 </listitem>\r
536 </varlistentry>\r
537 <varlistentry>\r
538 <term>\r
539 --cherry-pick\r
540 </term>\r
541 <listitem>\r
542 <simpara>\r
543         Omit any commit that introduces the same change as\r
544         another commit on the other side when the set of\r
545         commits are limited with symmetric difference.\r
546 </simpara>\r
547 <simpara>For example, if you have two branches, <emphasis>A</emphasis> and <emphasis>B</emphasis>, a usual way\r
548 to list all commits on only one side of them is with\r
549 <emphasis>--left-right</emphasis> (see the example below in the description of\r
550 the <emphasis>--left-right</emphasis> option). However, it shows the commits that were\r
551 cherry-picked from the other branch (for example, 3rd on b may be\r
552 cherry-picked from branch A). With this option, such pairs of commits are\r
553 excluded from the output.</simpara>\r
554 </listitem>\r
555 </varlistentry>\r
556 <varlistentry>\r
557 <term>\r
558 --left-only\r
559 </term>\r
560 <term>\r
561 --right-only\r
562 </term>\r
563 <listitem>\r
564 <simpara>\r
565         List only commits on the respective side of a symmetric range,\r
566         i.e. only those which would be marked <emphasis>&lt;</emphasis> resp. <emphasis>&gt;</emphasis> by\r
567         <emphasis>--left-right</emphasis>.\r
568 </simpara>\r
569 <simpara>For example, <emphasis>--cherry-pick --right-only A...B</emphasis> omits those\r
570 commits from <emphasis>B</emphasis> which are in <emphasis>A</emphasis> or are patch-equivalent to a commit in\r
571 <emphasis>A</emphasis>. In other words, this lists the <emphasis>+</emphasis> commits from <emphasis>git cherry A B</emphasis>.\r
572 More precisely, <emphasis>--cherry-pick --right-only --no-merges</emphasis> gives the exact\r
573 list.</simpara>\r
574 </listitem>\r
575 </varlistentry>\r
576 <varlistentry>\r
577 <term>\r
578 --cherry\r
579 </term>\r
580 <listitem>\r
581 <simpara>\r
582         A synonym for <emphasis>--right-only --cherry-mark --no-merges</emphasis>; useful to\r
583         limit the output to the commits on our side and mark those that\r
584         have been applied to the other side of a forked history with\r
585         <emphasis>git log --cherry upstream...mybranch</emphasis>, similar to\r
586         <emphasis>git cherry upstream mybranch</emphasis>.\r
587 </simpara>\r
588 </listitem>\r
589 </varlistentry>\r
590 <varlistentry>\r
591 <term>\r
592 -g\r
593 </term>\r
594 <term>\r
595 --walk-reflogs\r
596 </term>\r
597 <listitem>\r
598 <simpara>\r
599         Instead of walking the commit ancestry chain, walk\r
600         reflog entries from the most recent one to older ones.\r
601         When this option is used you cannot specify commits to\r
602         exclude (that is, <emphasis>&#94;commit</emphasis>, <emphasis>commit1..commit2</emphasis>,\r
603         and <emphasis>commit1...commit2</emphasis> notations cannot be used).\r
604 </simpara>\r
605 <simpara>With <emphasis>--pretty</emphasis> format other than <emphasis>oneline</emphasis> (for obvious reasons),\r
606 this causes the output to have two extra lines of information\r
607 taken from the reflog.  By default, <emphasis>commit@{Nth}</emphasis> notation is\r
608 used in the output.  When the starting commit is specified as\r
609 <emphasis>commit@{now}</emphasis>, output also uses <emphasis>commit@{timestamp}</emphasis> notation\r
610 instead.  Under <emphasis>--pretty=oneline</emphasis>, the commit message is\r
611 prefixed with this information on the same line.\r
612 This option cannot be combined with <emphasis>--reverse</emphasis>.\r
613 See also <xref linkend="git-reflog(1)" />.</simpara>\r
614 </listitem>\r
615 </varlistentry>\r
616 <varlistentry>\r
617 <term>\r
618 --merge\r
619 </term>\r
620 <listitem>\r
621 <simpara>\r
622         After a failed merge, show refs that touch files having a\r
623         conflict and don't exist on all heads to merge.\r
624 </simpara>\r
625 </listitem>\r
626 </varlistentry>\r
627 <varlistentry>\r
628 <term>\r
629 --boundary\r
630 </term>\r
631 <listitem>\r
632 <simpara>\r
633         Output excluded boundary commits. Boundary commits are\r
634         prefixed with <emphasis>-</emphasis>.\r
635 </simpara>\r
636 </listitem>\r
637 </varlistentry>\r
638 <varlistentry>\r
639 <term>\r
640 --use-bitmap-index\r
641 </term>\r
642 <listitem>\r
643 <simpara>\r
644         Try to speed up the traversal using the pack bitmap index (if\r
645         one is available). Note that when traversing with <emphasis>--objects</emphasis>,\r
646         trees and blobs will not have their associated path printed.\r
647 </simpara>\r
648 </listitem>\r
649 </varlistentry>\r
650 </variablelist>\r
651 </section>\r
652 <section id="git-rev-list(1)__history_simplification">\r
653 <title>History Simplification</title>\r
654 <simpara>Sometimes you are only interested in parts of the history, for example the\r
655 commits modifying a particular &lt;path&gt;. But there are two parts of\r
656 <emphasis>History Simplification</emphasis>, one part is selecting the commits and the other\r
657 is how to do it, as there are various strategies to simplify the history.</simpara>\r
658 <simpara>The following options select the commits to be shown:</simpara>\r
659 <variablelist>\r
660 <varlistentry>\r
661 <term>\r
662 &lt;paths&gt;\r
663 </term>\r
664 <listitem>\r
665 <simpara>\r
666         Commits modifying the given &lt;paths&gt; are selected.\r
667 </simpara>\r
668 </listitem>\r
669 </varlistentry>\r
670 <varlistentry>\r
671 <term>\r
672 --simplify-by-decoration\r
673 </term>\r
674 <listitem>\r
675 <simpara>\r
676         Commits that are referred by some branch or tag are selected.\r
677 </simpara>\r
678 </listitem>\r
679 </varlistentry>\r
680 </variablelist>\r
681 <simpara>Note that extra commits can be shown to give a meaningful history.</simpara>\r
682 <simpara>The following options affect the way the simplification is performed:</simpara>\r
683 <variablelist>\r
684 <varlistentry>\r
685 <term>\r
686 Default mode\r
687 </term>\r
688 <listitem>\r
689 <simpara>\r
690         Simplifies the history to the simplest history explaining the\r
691         final state of the tree. Simplest because it prunes some side\r
692         branches if the end result is the same (i.e. merging branches\r
693         with the same content)\r
694 </simpara>\r
695 </listitem>\r
696 </varlistentry>\r
697 <varlistentry>\r
698 <term>\r
699 --full-history\r
700 </term>\r
701 <listitem>\r
702 <simpara>\r
703         Same as the default mode, but does not prune some history.\r
704 </simpara>\r
705 </listitem>\r
706 </varlistentry>\r
707 <varlistentry>\r
708 <term>\r
709 --dense\r
710 </term>\r
711 <listitem>\r
712 <simpara>\r
713         Only the selected commits are shown, plus some to have a\r
714         meaningful history.\r
715 </simpara>\r
716 </listitem>\r
717 </varlistentry>\r
718 <varlistentry>\r
719 <term>\r
720 --sparse\r
721 </term>\r
722 <listitem>\r
723 <simpara>\r
724         All commits in the simplified history are shown.\r
725 </simpara>\r
726 </listitem>\r
727 </varlistentry>\r
728 <varlistentry>\r
729 <term>\r
730 --simplify-merges\r
731 </term>\r
732 <listitem>\r
733 <simpara>\r
734         Additional option to <emphasis>--full-history</emphasis> to remove some needless\r
735         merges from the resulting history, as there are no selected\r
736         commits contributing to this merge.\r
737 </simpara>\r
738 </listitem>\r
739 </varlistentry>\r
740 <varlistentry>\r
741 <term>\r
742 --ancestry-path\r
743 </term>\r
744 <listitem>\r
745 <simpara>\r
746         When given a range of commits to display (e.g. <emphasis>commit1..commit2</emphasis>\r
747         or <emphasis>commit2 &#94;commit1</emphasis>), only display commits that exist\r
748         directly on the ancestry chain between the <emphasis>commit1</emphasis> and\r
749         <emphasis>commit2</emphasis>, i.e. commits that are both descendants of <emphasis>commit1</emphasis>,\r
750         and ancestors of <emphasis>commit2</emphasis>.\r
751 </simpara>\r
752 </listitem>\r
753 </varlistentry>\r
754 </variablelist>\r
755 <simpara>A more detailed explanation follows.</simpara>\r
756 <simpara>Suppose you specified <emphasis>foo</emphasis> as the &lt;paths&gt;.  We shall call commits\r
757 that modify <emphasis>foo</emphasis> !TREESAME, and the rest TREESAME.  (In a diff\r
758 filtered for <emphasis>foo</emphasis>, they look different and equal, respectively.)</simpara>\r
759 <simpara>In the following, we will always refer to the same example history to\r
760 illustrate the differences between simplification settings.  We assume\r
761 that you are filtering for a file <emphasis>foo</emphasis> in this commit graph:</simpara>\r
762 <screen>          .-A---M---N---O---P---Q\r
763          /     /   /   /   /   /\r
764         I     B   C   D   E   Y\r
765          \   /   /   /   /   /\r
766           `-------------'   X</screen>\r
767 <simpara>The horizontal line of history A---Q is taken to be the first parent of\r
768 each merge.  The commits are:</simpara>\r
769 <itemizedlist>\r
770 <listitem>\r
771 <simpara>\r
772 <emphasis>I</emphasis> is the initial commit, in which <emphasis>foo</emphasis> exists with contents\r
773   asdf, and a file <emphasis>quux</emphasis> exists with contents quux. Initial\r
774   commits are compared to an empty tree, so <emphasis>I</emphasis> is !TREESAME.\r
775 </simpara>\r
776 </listitem>\r
777 <listitem>\r
778 <simpara>\r
779 In <emphasis>A</emphasis>, <emphasis>foo</emphasis> contains just foo.\r
780 </simpara>\r
781 </listitem>\r
782 <listitem>\r
783 <simpara>\r
784 <emphasis>B</emphasis> contains the same change as <emphasis>A</emphasis>.  Its merge <emphasis>M</emphasis> is trivial and\r
785   hence TREESAME to all parents.\r
786 </simpara>\r
787 </listitem>\r
788 <listitem>\r
789 <simpara>\r
790 <emphasis>C</emphasis> does not change <emphasis>foo</emphasis>, but its merge <emphasis>N</emphasis> changes it to foobar,\r
791   so it is not TREESAME to any parent.\r
792 </simpara>\r
793 </listitem>\r
794 <listitem>\r
795 <simpara>\r
796 <emphasis>D</emphasis> sets <emphasis>foo</emphasis> to baz. Its merge <emphasis>O</emphasis> combines the strings from\r
797   <emphasis>N</emphasis> and <emphasis>D</emphasis> to foobarbaz; i.e., it is not TREESAME to any parent.\r
798 </simpara>\r
799 </listitem>\r
800 <listitem>\r
801 <simpara>\r
802 <emphasis>E</emphasis> changes <emphasis>quux</emphasis> to xyzzy, and its merge <emphasis>P</emphasis> combines the\r
803   strings to quux xyzzy. <emphasis>P</emphasis> is TREESAME to <emphasis>O</emphasis>, but not to <emphasis>E</emphasis>.\r
804 </simpara>\r
805 </listitem>\r
806 <listitem>\r
807 <simpara>\r
808 <emphasis>X</emphasis> is an independent root commit that added a new file <emphasis>side</emphasis>, and <emphasis>Y</emphasis>\r
809   modified it. <emphasis>Y</emphasis> is TREESAME to <emphasis>X</emphasis>. Its merge <emphasis>Q</emphasis> added <emphasis>side</emphasis> to <emphasis>P</emphasis>, and\r
810   <emphasis>Q</emphasis> is TREESAME to <emphasis>P</emphasis>, but not to <emphasis>Y</emphasis>.\r
811 </simpara>\r
812 </listitem>\r
813 </itemizedlist>\r
814 <simpara><emphasis>rev-list</emphasis> walks backwards through history, including or excluding\r
815 commits based on whether <emphasis>--full-history</emphasis> and/or parent rewriting\r
816 (via <emphasis>--parents</emphasis> or <emphasis>--children</emphasis>) are used. The following settings\r
817 are available.</simpara>\r
818 <variablelist>\r
819 <varlistentry>\r
820 <term>\r
821 Default mode\r
822 </term>\r
823 <listitem>\r
824 <simpara>\r
825         Commits are included if they are not TREESAME to any parent\r
826         (though this can be changed, see <emphasis>--sparse</emphasis> below).  If the\r
827         commit was a merge, and it was TREESAME to one parent, follow\r
828         only that parent.  (Even if there are several TREESAME\r
829         parents, follow only one of them.)  Otherwise, follow all\r
830         parents.\r
831 </simpara>\r
832 <simpara>This results in:</simpara>\r
833 <screen>          .-A---N---O\r
834          /     /   /\r
835         I---------D</screen>\r
836 <simpara>Note how the rule to only follow the TREESAME parent, if one is\r
837 available, removed <emphasis>B</emphasis> from consideration entirely.  <emphasis>C</emphasis> was\r
838 considered via <emphasis>N</emphasis>, but is TREESAME.  Root commits are compared to an\r
839 empty tree, so <emphasis>I</emphasis> is !TREESAME.</simpara>\r
840 <simpara>Parent/child relations are only visible with <emphasis>--parents</emphasis>, but that does\r
841 not affect the commits selected in default mode, so we have shown the\r
842 parent lines.</simpara>\r
843 </listitem>\r
844 </varlistentry>\r
845 <varlistentry>\r
846 <term>\r
847 --full-history without parent rewriting\r
848 </term>\r
849 <listitem>\r
850 <simpara>\r
851         This mode differs from the default in one point: always follow\r
852         all parents of a merge, even if it is TREESAME to one of them.\r
853         Even if more than one side of the merge has commits that are\r
854         included, this does not imply that the merge itself is!  In\r
855         the example, we get\r
856 </simpara>\r
857 <screen>        I  A  B  N  D  O  P  Q</screen>\r
858 <simpara><emphasis>M</emphasis> was excluded because it is TREESAME to both parents.  <emphasis>E</emphasis>,\r
859 <emphasis>C</emphasis> and <emphasis>B</emphasis> were all walked, but only <emphasis>B</emphasis> was !TREESAME, so the others\r
860 do not appear.</simpara>\r
861 <simpara>Note that without parent rewriting, it is not really possible to talk\r
862 about the parent/child relationships between the commits, so we show\r
863 them disconnected.</simpara>\r
864 </listitem>\r
865 </varlistentry>\r
866 <varlistentry>\r
867 <term>\r
868 --full-history with parent rewriting\r
869 </term>\r
870 <listitem>\r
871 <simpara>\r
872         Ordinary commits are only included if they are !TREESAME\r
873         (though this can be changed, see <emphasis>--sparse</emphasis> below).\r
874 </simpara>\r
875 <simpara>Merges are always included.  However, their parent list is rewritten:\r
876 Along each parent, prune away commits that are not included\r
877 themselves.  This results in</simpara>\r
878 <screen>          .-A---M---N---O---P---Q\r
879          /     /   /   /   /\r
880         I     B   /   D   /\r
881          \   /   /   /   /\r
882           `-------------'</screen>\r
883 <simpara>Compare to <emphasis>--full-history</emphasis> without rewriting above.  Note that <emphasis>E</emphasis>\r
884 was pruned away because it is TREESAME, but the parent list of P was\r
885 rewritten to contain <emphasis>E</emphasis>'s parent <emphasis>I</emphasis>.  The same happened for <emphasis>C</emphasis> and\r
886 <emphasis>N</emphasis>, and <emphasis>X</emphasis>, <emphasis>Y</emphasis> and <emphasis>Q</emphasis>.</simpara>\r
887 </listitem>\r
888 </varlistentry>\r
889 </variablelist>\r
890 <simpara>In addition to the above settings, you can change whether TREESAME\r
891 affects inclusion:</simpara>\r
892 <variablelist>\r
893 <varlistentry>\r
894 <term>\r
895 --dense\r
896 </term>\r
897 <listitem>\r
898 <simpara>\r
899         Commits that are walked are included if they are not TREESAME\r
900         to any parent.\r
901 </simpara>\r
902 </listitem>\r
903 </varlistentry>\r
904 <varlistentry>\r
905 <term>\r
906 --sparse\r
907 </term>\r
908 <listitem>\r
909 <simpara>\r
910         All commits that are walked are included.\r
911 </simpara>\r
912 <simpara>Note that without <emphasis>--full-history</emphasis>, this still simplifies merges: if\r
913 one of the parents is TREESAME, we follow only that one, so the other\r
914 sides of the merge are never walked.</simpara>\r
915 </listitem>\r
916 </varlistentry>\r
917 <varlistentry>\r
918 <term>\r
919 --simplify-merges\r
920 </term>\r
921 <listitem>\r
922 <simpara>\r
923         First, build a history graph in the same way that\r
924         <emphasis>--full-history</emphasis> with parent rewriting does (see above).\r
925 </simpara>\r
926 <simpara>Then simplify each commit <emphasis>C</emphasis> to its replacement <emphasis>C'</emphasis> in the final\r
927 history according to the following rules:</simpara>\r
928 <itemizedlist>\r
929 <listitem>\r
930 <simpara>\r
931 Set <emphasis>C'</emphasis> to <emphasis>C</emphasis>.\r
932 </simpara>\r
933 </listitem>\r
934 <listitem>\r
935 <simpara>\r
936 Replace each parent <emphasis>P</emphasis> of <emphasis>C'</emphasis> with its simplification <emphasis>P'</emphasis>.  In\r
937   the process, drop parents that are ancestors of other parents or that are\r
938   root commits TREESAME to an empty tree, and remove duplicates, but take care\r
939   to never drop all parents that we are TREESAME to.\r
940 </simpara>\r
941 </listitem>\r
942 <listitem>\r
943 <simpara>\r
944 If after this parent rewriting, <emphasis>C'</emphasis> is a root or merge commit (has\r
945   zero or &gt;1 parents), a boundary commit, or !TREESAME, it remains.\r
946   Otherwise, it is replaced with its only parent.\r
947 </simpara>\r
948 </listitem>\r
949 </itemizedlist>\r
950 <simpara>The effect of this is best shown by way of comparing to\r
951 <emphasis>--full-history</emphasis> with parent rewriting.  The example turns into:</simpara>\r
952 <screen>          .-A---M---N---O\r
953          /     /       /\r
954         I     B       D\r
955          \   /       /\r
956           `---------'</screen>\r
957 <simpara>Note the major differences in <emphasis>N</emphasis>, <emphasis>P</emphasis>, and <emphasis>Q</emphasis> over <emphasis>--full-history</emphasis>:</simpara>\r
958 <itemizedlist>\r
959 <listitem>\r
960 <simpara>\r
961 <emphasis>N</emphasis>'s parent list had <emphasis>I</emphasis> removed, because it is an ancestor of the\r
962   other parent <emphasis>M</emphasis>.  Still, <emphasis>N</emphasis> remained because it is !TREESAME.\r
963 </simpara>\r
964 </listitem>\r
965 <listitem>\r
966 <simpara>\r
967 <emphasis>P</emphasis>'s parent list similarly had <emphasis>I</emphasis> removed.  <emphasis>P</emphasis> was then\r
968   removed completely, because it had one parent and is TREESAME.\r
969 </simpara>\r
970 </listitem>\r
971 <listitem>\r
972 <simpara>\r
973 <emphasis>Q</emphasis>'s parent list had <emphasis>Y</emphasis> simplified to <emphasis>X</emphasis>. <emphasis>X</emphasis> was then removed, because it\r
974   was a TREESAME root. <emphasis>Q</emphasis> was then removed completely, because it had one\r
975   parent and is TREESAME.\r
976 </simpara>\r
977 </listitem>\r
978 </itemizedlist>\r
979 </listitem>\r
980 </varlistentry>\r
981 </variablelist>\r
982 <simpara>Finally, there is a fifth simplification mode available:</simpara>\r
983 <variablelist>\r
984 <varlistentry>\r
985 <term>\r
986 --ancestry-path\r
987 </term>\r
988 <listitem>\r
989 <simpara>\r
990         Limit the displayed commits to those directly on the ancestry\r
991         chain between the from and to commits in the given commit\r
992         range. I.e. only display commits that are ancestor of the to\r
993         commit and descendants of the from commit.\r
994 </simpara>\r
995 <simpara>As an example use case, consider the following commit history:</simpara>\r
996 <screen>            D---E-------F\r
997            /     \       \\r
998           B---C---G---H---I---J\r
999          /                     \\r
1000         A-------K---------------L--M</screen>\r
1001 <simpara>A regular <emphasis>D..M</emphasis> computes the set of commits that are ancestors of <emphasis>M</emphasis>,\r
1002 but excludes the ones that are ancestors of <emphasis>D</emphasis>. This is useful to see\r
1003 what happened to the history leading to <emphasis>M</emphasis> since <emphasis>D</emphasis>, in the sense\r
1004 that what does <emphasis>M</emphasis> have that did not exist in <emphasis>D</emphasis>. The result in this\r
1005 example would be all the commits, except <emphasis>A</emphasis> and <emphasis>B</emphasis> (and <emphasis>D</emphasis> itself,\r
1006 of course).</simpara>\r
1007 <simpara>When we want to find out what commits in <emphasis>M</emphasis> are contaminated with the\r
1008 bug introduced by <emphasis>D</emphasis> and need fixing, however, we might want to view\r
1009 only the subset of <emphasis>D..M</emphasis> that are actually descendants of <emphasis>D</emphasis>, i.e.\r
1010 excluding <emphasis>C</emphasis> and <emphasis>K</emphasis>. This is exactly what the <emphasis>--ancestry-path</emphasis>\r
1011 option does. Applied to the <emphasis>D..M</emphasis> range, it results in:</simpara>\r
1012 <screen>                E-------F\r
1013                  \       \\r
1014                   G---H---I---J\r
1015                                \\r
1016                                 L--M</screen>\r
1017 </listitem>\r
1018 </varlistentry>\r
1019 </variablelist>\r
1020 <simpara>The <emphasis>--simplify-by-decoration</emphasis> option allows you to view only the\r
1021 big picture of the topology of the history, by omitting commits\r
1022 that are not referenced by tags.  Commits are marked as !TREESAME\r
1023 (in other words, kept after history simplification rules described\r
1024 above) if (1) they are referenced by tags, or (2) they change the\r
1025 contents of the paths given on the command line.  All other\r
1026 commits are marked as TREESAME (subject to be simplified away).</simpara>\r
1027 </section>\r
1028 <section id="git-rev-list(1)__bisection_helpers">\r
1029 <title>Bisection Helpers</title>\r
1030 <variablelist>\r
1031 <varlistentry>\r
1032 <term>\r
1033 --bisect\r
1034 </term>\r
1035 <listitem>\r
1036 <simpara>\r
1037         Limit output to the one commit object which is roughly halfway between\r
1038         included and excluded commits. Note that the bad bisection ref\r
1039         <emphasis>refs/bisect/bad</emphasis> is added to the included commits (if it\r
1040         exists) and the good bisection refs <emphasis>refs/bisect/good-*</emphasis> are\r
1041         added to the excluded commits (if they exist). Thus, supposing there\r
1042         are no refs in <emphasis>refs/bisect/</emphasis>, if\r
1043 </simpara>\r
1044 <screen>        $ git rev-list --bisect foo ^bar ^baz</screen>\r
1045 <simpara>outputs <emphasis>midpoint</emphasis>, the output of the two commands</simpara>\r
1046 <screen>        $ git rev-list foo ^midpoint\r
1047         $ git rev-list midpoint ^bar ^baz</screen>\r
1048 <simpara>would be of roughly the same length.  Finding the change which\r
1049 introduces a regression is thus reduced to a binary search: repeatedly\r
1050 generate and test new 'midpoint's until the commit chain is of length\r
1051 one. Cannot be combined with --first-parent.</simpara>\r
1052 </listitem>\r
1053 </varlistentry>\r
1054 <varlistentry>\r
1055 <term>\r
1056 --bisect-vars\r
1057 </term>\r
1058 <listitem>\r
1059 <simpara>\r
1060         This calculates the same as <emphasis>--bisect</emphasis>, except that refs in\r
1061         <emphasis>refs/bisect/</emphasis> are not used, and except that this outputs\r
1062         text ready to be eval'ed by the shell. These lines will assign the\r
1063         name of the midpoint revision to the variable <emphasis>bisect_rev</emphasis>, and the\r
1064         expected number of commits to be tested after <emphasis>bisect_rev</emphasis> is tested\r
1065         to <emphasis>bisect_nr</emphasis>, the expected number of commits to be tested if\r
1066         <emphasis>bisect_rev</emphasis> turns out to be good to <emphasis>bisect_good</emphasis>, the expected\r
1067         number of commits to be tested if <emphasis>bisect_rev</emphasis> turns out to be bad to\r
1068         <emphasis>bisect_bad</emphasis>, and the number of commits we are bisecting right now to\r
1069         <emphasis>bisect_all</emphasis>.\r
1070 </simpara>\r
1071 </listitem>\r
1072 </varlistentry>\r
1073 <varlistentry>\r
1074 <term>\r
1075 --bisect-all\r
1076 </term>\r
1077 <listitem>\r
1078 <simpara>\r
1079         This outputs all the commit objects between the included and excluded\r
1080         commits, ordered by their distance to the included and excluded\r
1081         commits. Refs in <emphasis>refs/bisect/</emphasis> are not used. The farthest\r
1082         from them is displayed first. (This is the only one displayed by\r
1083         <emphasis>--bisect</emphasis>.)\r
1084 </simpara>\r
1085 <simpara>This is useful because it makes it easy to choose a good commit to\r
1086 test when you want to avoid to test some of them for some reason (they\r
1087 may not compile for example).</simpara>\r
1088 <simpara>This option can be used along with <emphasis>--bisect-vars</emphasis>, in this case,\r
1089 after all the sorted commit objects, there will be the same text as if\r
1090 <emphasis>--bisect-vars</emphasis> had been used alone.</simpara>\r
1091 </listitem>\r
1092 </varlistentry>\r
1093 </variablelist>\r
1094 </section>\r
1095 <section id="git-rev-list(1)__commit_ordering">\r
1096 <title>Commit Ordering</title>\r
1097 <simpara>By default, the commits are shown in reverse chronological order.</simpara>\r
1098 <variablelist>\r
1099 <varlistentry>\r
1100 <term>\r
1101 --date-order\r
1102 </term>\r
1103 <listitem>\r
1104 <simpara>\r
1105         Show no parents before all of its children are shown, but\r
1106         otherwise show commits in the commit timestamp order.\r
1107 </simpara>\r
1108 </listitem>\r
1109 </varlistentry>\r
1110 <varlistentry>\r
1111 <term>\r
1112 --author-date-order\r
1113 </term>\r
1114 <listitem>\r
1115 <simpara>\r
1116         Show no parents before all of its children are shown, but\r
1117         otherwise show commits in the author timestamp order.\r
1118 </simpara>\r
1119 </listitem>\r
1120 </varlistentry>\r
1121 <varlistentry>\r
1122 <term>\r
1123 --topo-order\r
1124 </term>\r
1125 <listitem>\r
1126 <simpara>\r
1127         Show no parents before all of its children are shown, and\r
1128         avoid showing commits on multiple lines of history\r
1129         intermixed.\r
1130 </simpara>\r
1131 <simpara>For example, in a commit history like this:</simpara>\r
1132 <screen>    ---1----2----4----7\r
1133         \              \\r
1134          3----5----6----8---</screen>\r
1135 <simpara>where the numbers denote the order of commit timestamps, <emphasis>git\r
1136 rev-list</emphasis> and friends with <emphasis>--date-order</emphasis> show the commits in the\r
1137 timestamp order: 8 7 6 5 4 3 2 1.</simpara>\r
1138 <simpara>With <emphasis>--topo-order</emphasis>, they would show 8 6 5 3 7 4 2 1 (or 8 7 4 2 6 5\r
1139 3 1); some older commits are shown before newer ones in order to\r
1140 avoid showing the commits from two parallel development track mixed\r
1141 together.</simpara>\r
1142 </listitem>\r
1143 </varlistentry>\r
1144 <varlistentry>\r
1145 <term>\r
1146 --reverse\r
1147 </term>\r
1148 <listitem>\r
1149 <simpara>\r
1150         Output the commits in reverse order.\r
1151         Cannot be combined with <emphasis>--walk-reflogs</emphasis>.\r
1152 </simpara>\r
1153 </listitem>\r
1154 </varlistentry>\r
1155 </variablelist>\r
1156 </section>\r
1157 <section id="git-rev-list(1)__object_traversal">\r
1158 <title>Object Traversal</title>\r
1159 <simpara>These options are mostly targeted for packing of Git repositories.</simpara>\r
1160 <variablelist>\r
1161 <varlistentry>\r
1162 <term>\r
1163 --objects\r
1164 </term>\r
1165 <listitem>\r
1166 <simpara>\r
1167         Print the object IDs of any object referenced by the listed\r
1168         commits.  <emphasis>--objects foo ^bar</emphasis> thus means send me\r
1169         all object IDs which I need to download if I have the commit\r
1170         object <emphasis>bar</emphasis> but not <emphasis>foo</emphasis>.\r
1171 </simpara>\r
1172 </listitem>\r
1173 </varlistentry>\r
1174 <varlistentry>\r
1175 <term>\r
1176 --objects-edge\r
1177 </term>\r
1178 <listitem>\r
1179 <simpara>\r
1180         Similar to <emphasis>--objects</emphasis>, but also print the IDs of excluded\r
1181         commits prefixed with a - character.  This is used by\r
1182         <xref linkend="git-pack-objects(1)" /> to build a thin pack, which records\r
1183         objects in deltified form based on objects contained in these\r
1184         excluded commits to reduce network traffic.\r
1185 </simpara>\r
1186 </listitem>\r
1187 </varlistentry>\r
1188 <varlistentry>\r
1189 <term>\r
1190 --objects-edge-aggressive\r
1191 </term>\r
1192 <listitem>\r
1193 <simpara>\r
1194         Similar to <emphasis>--objects-edge</emphasis>, but it tries harder to find excluded\r
1195         commits at the cost of increased time.  This is used instead of\r
1196         <emphasis>--objects-edge</emphasis> to build thin packs for shallow repositories.\r
1197 </simpara>\r
1198 </listitem>\r
1199 </varlistentry>\r
1200 <varlistentry>\r
1201 <term>\r
1202 --indexed-objects\r
1203 </term>\r
1204 <listitem>\r
1205 <simpara>\r
1206         Pretend as if all trees and blobs used by the index are listed\r
1207         on the command line.  Note that you probably want to use\r
1208         <emphasis>--objects</emphasis>, too.\r
1209 </simpara>\r
1210 </listitem>\r
1211 </varlistentry>\r
1212 <varlistentry>\r
1213 <term>\r
1214 --unpacked\r
1215 </term>\r
1216 <listitem>\r
1217 <simpara>\r
1218         Only useful with <emphasis>--objects</emphasis>; print the object IDs that are not\r
1219         in packs.\r
1220 </simpara>\r
1221 </listitem>\r
1222 </varlistentry>\r
1223 <varlistentry>\r
1224 <term>\r
1225 --no-walk[=(sorted|unsorted)]\r
1226 </term>\r
1227 <listitem>\r
1228 <simpara>\r
1229         Only show the given commits, but do not traverse their ancestors.\r
1230         This has no effect if a range is specified. If the argument\r
1231         <emphasis>unsorted</emphasis> is given, the commits are shown in the order they were\r
1232         given on the command line. Otherwise (if <emphasis>sorted</emphasis> or no argument\r
1233         was given), the commits are shown in reverse chronological order\r
1234         by commit time.\r
1235         Cannot be combined with <emphasis>--graph</emphasis>.\r
1236 </simpara>\r
1237 </listitem>\r
1238 </varlistentry>\r
1239 <varlistentry>\r
1240 <term>\r
1241 --do-walk\r
1242 </term>\r
1243 <listitem>\r
1244 <simpara>\r
1245         Overrides a previous <emphasis>--no-walk</emphasis>.\r
1246 </simpara>\r
1247 </listitem>\r
1248 </varlistentry>\r
1249 </variablelist>\r
1250 </section>\r
1251 <section id="git-rev-list(1)__commit_formatting">\r
1252 <title>Commit Formatting</title>\r
1253 <simpara>Using these options, <xref linkend="git-rev-list(1)" /> will act similar to the\r
1254 more specialized family of commit log tools: <xref linkend="git-log(1)" />,\r
1255 <xref linkend="git-show(1)" />, and <xref linkend="git-whatchanged(1)" /></simpara>\r
1256 <variablelist>\r
1257 <varlistentry>\r
1258 <term>\r
1259 --pretty[=&lt;format&gt;]\r
1260 </term>\r
1261 <term>\r
1262 --format=&lt;format&gt;\r
1263 </term>\r
1264 <listitem>\r
1265 <simpara>\r
1266         Pretty-print the contents of the commit logs in a given format,\r
1267         where <emphasis>&lt;format&gt;</emphasis> can be one of <emphasis>oneline</emphasis>, <emphasis>short</emphasis>, <emphasis>medium</emphasis>,\r
1268         <emphasis>full</emphasis>, <emphasis>fuller</emphasis>, <emphasis>email</emphasis>, <emphasis>raw</emphasis>, <emphasis>format:&lt;string&gt;</emphasis>\r
1269         and <emphasis>tformat:&lt;string&gt;</emphasis>.  When <emphasis>&lt;format&gt;</emphasis> is none of the above,\r
1270         and has <emphasis>%placeholder</emphasis> in it, it acts as if\r
1271         <emphasis>--pretty=tformat:&lt;format&gt;</emphasis> were given.\r
1272 </simpara>\r
1273 <simpara>See the "PRETTY FORMATS" section for some additional details for each\r
1274 format.  When <emphasis>=&lt;format&gt;</emphasis> part is omitted, it defaults to <emphasis>medium</emphasis>.</simpara>\r
1275 <simpara>Note: you can specify the default pretty format in the repository\r
1276 configuration (see <xref linkend="git-config(1)" />).</simpara>\r
1277 </listitem>\r
1278 </varlistentry>\r
1279 <varlistentry>\r
1280 <term>\r
1281 --abbrev-commit\r
1282 </term>\r
1283 <listitem>\r
1284 <simpara>\r
1285         Instead of showing the full 40-byte hexadecimal commit object\r
1286         name, show only a partial prefix.  Non default number of\r
1287         digits can be specified with "--abbrev=&lt;n&gt;" (which also modifies\r
1288         diff output, if it is displayed).\r
1289 </simpara>\r
1290 <simpara>This should make "--pretty=oneline" a whole lot more readable for\r
1291 people using 80-column terminals.</simpara>\r
1292 </listitem>\r
1293 </varlistentry>\r
1294 <varlistentry>\r
1295 <term>\r
1296 --no-abbrev-commit\r
1297 </term>\r
1298 <listitem>\r
1299 <simpara>\r
1300         Show the full 40-byte hexadecimal commit object name. This negates\r
1301         <emphasis>--abbrev-commit</emphasis> and those options which imply it such as\r
1302         "--oneline". It also overrides the <emphasis>log.abbrevCommit</emphasis> variable.\r
1303 </simpara>\r
1304 </listitem>\r
1305 </varlistentry>\r
1306 <varlistentry>\r
1307 <term>\r
1308 --oneline\r
1309 </term>\r
1310 <listitem>\r
1311 <simpara>\r
1312         This is a shorthand for "--pretty=oneline --abbrev-commit"\r
1313         used together.\r
1314 </simpara>\r
1315 </listitem>\r
1316 </varlistentry>\r
1317 <varlistentry>\r
1318 <term>\r
1319 --encoding=&lt;encoding&gt;\r
1320 </term>\r
1321 <listitem>\r
1322 <simpara>\r
1323         The commit objects record the encoding used for the log message\r
1324         in their encoding header; this option can be used to tell the\r
1325         command to re-code the commit log message in the encoding\r
1326         preferred by the user.  For non plumbing commands this\r
1327         defaults to UTF-8. Note that if an object claims to be encoded\r
1328         in <emphasis>X</emphasis> and we are outputting in <emphasis>X</emphasis>, we will output the object\r
1329         verbatim; this means that invalid sequences in the original\r
1330         commit may be copied to the output.\r
1331 </simpara>\r
1332 </listitem>\r
1333 </varlistentry>\r
1334 <varlistentry>\r
1335 <term>\r
1336 --expand-tabs=&lt;n&gt;\r
1337 </term>\r
1338 <term>\r
1339 --expand-tabs\r
1340 </term>\r
1341 <term>\r
1342 --no-expand-tabs\r
1343 </term>\r
1344 <listitem>\r
1345 <simpara>\r
1346         Perform a tab expansion (replace each tab with enough spaces\r
1347         to fill to the next display column that is multiple of <emphasis>&lt;n&gt;</emphasis>)\r
1348         in the log message before showing it in the output.\r
1349         <emphasis>--expand-tabs</emphasis> is a short-hand for <emphasis>--expand-tabs=8</emphasis>, and\r
1350         <emphasis>--no-expand-tabs</emphasis> is a short-hand for <emphasis>--expand-tabs=0</emphasis>,\r
1351         which disables tab expansion.\r
1352 </simpara>\r
1353 <simpara>By default, tabs are expanded in pretty formats that indent the log\r
1354 message by 4 spaces (i.e.  <emphasis>medium</emphasis>, which is the default, <emphasis>full</emphasis>,\r
1355 and <emphasis>fuller</emphasis>).</simpara>\r
1356 </listitem>\r
1357 </varlistentry>\r
1358 <varlistentry>\r
1359 <term>\r
1360 --show-signature\r
1361 </term>\r
1362 <listitem>\r
1363 <simpara>\r
1364         Check the validity of a signed commit object by passing the signature\r
1365         to <emphasis>gpg --verify</emphasis> and show the output.\r
1366 </simpara>\r
1367 </listitem>\r
1368 </varlistentry>\r
1369 <varlistentry>\r
1370 <term>\r
1371 --relative-date\r
1372 </term>\r
1373 <listitem>\r
1374 <simpara>\r
1375         Synonym for <emphasis>--date=relative</emphasis>.\r
1376 </simpara>\r
1377 </listitem>\r
1378 </varlistentry>\r
1379 <varlistentry>\r
1380 <term>\r
1381 --date=&lt;format&gt;\r
1382 </term>\r
1383 <listitem>\r
1384 <simpara>\r
1385         Only takes effect for dates shown in human-readable format, such\r
1386         as when using <emphasis>--pretty</emphasis>. <emphasis>log.date</emphasis> config variable sets a default\r
1387         value for the log command's <emphasis>--date</emphasis> option. By default, dates\r
1388         are shown in the original time zone (either committer's or\r
1389         author's). If <emphasis>-local</emphasis> is appended to the format (e.g.,\r
1390         <emphasis>iso-local</emphasis>), the user's local time zone is used instead.\r
1391 </simpara>\r
1392 <simpara><emphasis>--date=relative</emphasis> shows dates relative to the current time,\r
1393 e.g. 2 hours ago. The <emphasis>-local</emphasis> option cannot be used with\r
1394 <emphasis>--raw</emphasis> or <emphasis>--relative</emphasis>.</simpara>\r
1395 <simpara><emphasis>--date=local</emphasis> is an alias for <emphasis>--date=default-local</emphasis>.</simpara>\r
1396 <simpara><emphasis>--date=iso</emphasis> (or <emphasis>--date=iso8601</emphasis>) shows timestamps in a ISO 8601-like format.\r
1397 The differences to the strict ISO 8601 format are:</simpara>\r
1398 <itemizedlist>\r
1399 <listitem>\r
1400 <simpara>\r
1401 a space instead of the <emphasis>T</emphasis> date/time delimiter\r
1402 </simpara>\r
1403 </listitem>\r
1404 <listitem>\r
1405 <simpara>\r
1406 a space between time and time zone\r
1407 </simpara>\r
1408 </listitem>\r
1409 <listitem>\r
1410 <simpara>\r
1411 no colon between hours and minutes of the time zone\r
1412 </simpara>\r
1413 </listitem>\r
1414 </itemizedlist>\r
1415 <simpara><emphasis>--date=iso-strict</emphasis> (or <emphasis>--date=iso8601-strict</emphasis>) shows timestamps in strict\r
1416 ISO 8601 format.</simpara>\r
1417 <simpara><emphasis>--date=rfc</emphasis> (or <emphasis>--date=rfc2822</emphasis>) shows timestamps in RFC 2822\r
1418 format, often found in email messages.</simpara>\r
1419 <simpara><emphasis>--date=short</emphasis> shows only the date, but not the time, in <emphasis>YYYY-MM-DD</emphasis> format.</simpara>\r
1420 <simpara><emphasis>--date=raw</emphasis> shows the date in the internal raw Git format <emphasis>%s %z</emphasis> format.</simpara>\r
1421 <simpara><emphasis>--date=format:...</emphasis> feeds the format <emphasis>...</emphasis> to your system <emphasis>strftime</emphasis>.\r
1422 Use <emphasis>--date=format:%c</emphasis> to show the date in your system locale's\r
1423 preferred format.  See the <emphasis>strftime</emphasis> manual for a complete list of\r
1424 format placeholders. When using <emphasis>-local</emphasis>, the correct syntax is\r
1425 <emphasis>--date=format-local:...</emphasis>.</simpara>\r
1426 <simpara><emphasis>--date=default</emphasis> is the default format, and is similar to\r
1427 <emphasis>--date=rfc2822</emphasis>, with a few exceptions:</simpara>\r
1428 <itemizedlist>\r
1429 <listitem>\r
1430 <simpara>\r
1431 there is no comma after the day-of-week\r
1432 </simpara>\r
1433 </listitem>\r
1434 <listitem>\r
1435 <simpara>\r
1436 the time zone is omitted when the local time zone is used\r
1437 </simpara>\r
1438 </listitem>\r
1439 </itemizedlist>\r
1440 </listitem>\r
1441 </varlistentry>\r
1442 <varlistentry>\r
1443 <term>\r
1444 --header\r
1445 </term>\r
1446 <listitem>\r
1447 <simpara>\r
1448         Print the contents of the commit in raw-format; each record is\r
1449         separated with a NUL character.\r
1450 </simpara>\r
1451 </listitem>\r
1452 </varlistentry>\r
1453 <varlistentry>\r
1454 <term>\r
1455 --parents\r
1456 </term>\r
1457 <listitem>\r
1458 <simpara>\r
1459         Print also the parents of the commit (in the form "commit parent&#8230;").\r
1460         Also enables parent rewriting, see <emphasis>History Simplification</emphasis> below.\r
1461 </simpara>\r
1462 </listitem>\r
1463 </varlistentry>\r
1464 <varlistentry>\r
1465 <term>\r
1466 --children\r
1467 </term>\r
1468 <listitem>\r
1469 <simpara>\r
1470         Print also the children of the commit (in the form "commit child&#8230;").\r
1471         Also enables parent rewriting, see <emphasis>History Simplification</emphasis> below.\r
1472 </simpara>\r
1473 </listitem>\r
1474 </varlistentry>\r
1475 <varlistentry>\r
1476 <term>\r
1477 --timestamp\r
1478 </term>\r
1479 <listitem>\r
1480 <simpara>\r
1481         Print the raw commit timestamp.\r
1482 </simpara>\r
1483 </listitem>\r
1484 </varlistentry>\r
1485 <varlistentry>\r
1486 <term>\r
1487 --left-right\r
1488 </term>\r
1489 <listitem>\r
1490 <simpara>\r
1491         Mark which side of a symmetric diff a commit is reachable from.\r
1492         Commits from the left side are prefixed with <emphasis>&lt;</emphasis> and those from\r
1493         the right with <emphasis>&gt;</emphasis>.  If combined with <emphasis>--boundary</emphasis>, those\r
1494         commits are prefixed with <emphasis>-</emphasis>.\r
1495 </simpara>\r
1496 <simpara>For example, if you have this topology:</simpara>\r
1497 <screen>             y---b---b  branch B\r
1498             / \ /\r
1499            /   .\r
1500           /   / \\r
1501          o---x---a---a  branch A</screen>\r
1502 <simpara>you would get an output like this:</simpara>\r
1503 <screen>        $ git rev-list --left-right --boundary --pretty=oneline A...B\r
1505         &gt;bbbbbbb... 3rd on b\r
1506         &gt;bbbbbbb... 2nd on b\r
1507         &lt;aaaaaaa... 3rd on a\r
1508         &lt;aaaaaaa... 2nd on a\r
1509         -yyyyyyy... 1st on b\r
1510         -xxxxxxx... 1st on a</screen>\r
1511 </listitem>\r
1512 </varlistentry>\r
1513 <varlistentry>\r
1514 <term>\r
1515 --graph\r
1516 </term>\r
1517 <listitem>\r
1518 <simpara>\r
1519         Draw a text-based graphical representation of the commit history\r
1520         on the left hand side of the output.  This may cause extra lines\r
1521         to be printed in between commits, in order for the graph history\r
1522         to be drawn properly.\r
1523         Cannot be combined with <emphasis>--no-walk</emphasis>.\r
1524 </simpara>\r
1525 <simpara>This enables parent rewriting, see <emphasis>History Simplification</emphasis> below.</simpara>\r
1526 <simpara>This implies the <emphasis>--topo-order</emphasis> option by default, but the\r
1527 <emphasis>--date-order</emphasis> option may also be specified.</simpara>\r
1528 </listitem>\r
1529 </varlistentry>\r
1530 <varlistentry>\r
1531 <term>\r
1532 --show-linear-break[=&lt;barrier&gt;]\r
1533 </term>\r
1534 <listitem>\r
1535 <simpara>\r
1536         When --graph is not used, all history branches are flattened\r
1537         which can make it hard to see that the two consecutive commits\r
1538         do not belong to a linear branch. This option puts a barrier\r
1539         in between them in that case. If <emphasis>&lt;barrier&gt;</emphasis> is specified, it\r
1540         is the string that will be shown instead of the default one.\r
1541 </simpara>\r
1542 </listitem>\r
1543 </varlistentry>\r
1544 <varlistentry>\r
1545 <term>\r
1546 --count\r
1547 </term>\r
1548 <listitem>\r
1549 <simpara>\r
1550         Print a number stating how many commits would have been\r
1551         listed, and suppress all other output.  When used together\r
1552         with <emphasis>--left-right</emphasis>, instead print the counts for left and\r
1553         right commits, separated by a tab. When used together with\r
1554         <emphasis>--cherry-mark</emphasis>, omit patch equivalent commits from these\r
1555         counts and print the count for equivalent commits separated\r
1556         by a tab.\r
1557 </simpara>\r
1558 </listitem>\r
1559 </varlistentry>\r
1560 </variablelist>\r
1561 </section>\r
1562 </simplesect>\r
1563 <simplesect id="git-rev-list(1)__pretty_formats">\r
1564 <title>PRETTY FORMATS</title>\r
1565 <simpara>If the commit is a merge, and if the pretty-format\r
1566 is not <emphasis>oneline</emphasis>, <emphasis>email</emphasis> or <emphasis>raw</emphasis>, an additional line is\r
1567 inserted before the <emphasis>Author:</emphasis> line.  This line begins with\r
1568 "Merge: " and the sha1s of ancestral commits are printed,\r
1569 separated by spaces.  Note that the listed commits may not\r
1570 necessarily be the list of the <emphasis role="strong">direct</emphasis> parent commits if you\r
1571 have limited your view of history: for example, if you are\r
1572 only interested in changes related to a certain directory or\r
1573 file.</simpara>\r
1574 <simpara>There are several built-in formats, and you can define\r
1575 additional formats by setting a pretty.&lt;name&gt;\r
1576 config option to either another format name, or a\r
1577 <emphasis>format:</emphasis> string, as described below (see\r
1578 <xref linkend="git-config(1)" />). Here are the details of the\r
1579 built-in formats:</simpara>\r
1580 <itemizedlist>\r
1581 <listitem>\r
1582 <simpara>\r
1583 <emphasis>oneline</emphasis>\r
1584 </simpara>\r
1585 <literallayout class="monospaced">&lt;sha1&gt; &lt;title line&gt;</literallayout>\r
1586 <simpara>This is designed to be as compact as possible.</simpara>\r
1587 </listitem>\r
1588 <listitem>\r
1589 <simpara>\r
1590 <emphasis>short</emphasis>\r
1591 </simpara>\r
1592 <literallayout class="monospaced">commit &lt;sha1&gt;\r
1593 Author: &lt;author&gt;</literallayout>\r
1594 <literallayout class="monospaced">&lt;title line&gt;</literallayout>\r
1595 </listitem>\r
1596 <listitem>\r
1597 <simpara>\r
1598 <emphasis>medium</emphasis>\r
1599 </simpara>\r
1600 <literallayout class="monospaced">commit &lt;sha1&gt;\r
1601 Author: &lt;author&gt;\r
1602 Date:   &lt;author date&gt;</literallayout>\r
1603 <literallayout class="monospaced">&lt;title line&gt;</literallayout>\r
1604 <literallayout class="monospaced">&lt;full commit message&gt;</literallayout>\r
1605 </listitem>\r
1606 <listitem>\r
1607 <simpara>\r
1608 <emphasis>full</emphasis>\r
1609 </simpara>\r
1610 <literallayout class="monospaced">commit &lt;sha1&gt;\r
1611 Author: &lt;author&gt;\r
1612 Commit: &lt;committer&gt;</literallayout>\r
1613 <literallayout class="monospaced">&lt;title line&gt;</literallayout>\r
1614 <literallayout class="monospaced">&lt;full commit message&gt;</literallayout>\r
1615 </listitem>\r
1616 <listitem>\r
1617 <simpara>\r
1618 <emphasis>fuller</emphasis>\r
1619 </simpara>\r
1620 <literallayout class="monospaced">commit &lt;sha1&gt;\r
1621 Author:     &lt;author&gt;\r
1622 AuthorDate: &lt;author date&gt;\r
1623 Commit:     &lt;committer&gt;\r
1624 CommitDate: &lt;committer date&gt;</literallayout>\r
1625 <literallayout class="monospaced">&lt;title line&gt;</literallayout>\r
1626 <literallayout class="monospaced">&lt;full commit message&gt;</literallayout>\r
1627 </listitem>\r
1628 <listitem>\r
1629 <simpara>\r
1630 <emphasis>email</emphasis>\r
1631 </simpara>\r
1632 <literallayout class="monospaced">From &lt;sha1&gt; &lt;date&gt;\r
1633 From: &lt;author&gt;\r
1634 Date: &lt;author date&gt;\r
1635 Subject: [PATCH] &lt;title line&gt;</literallayout>\r
1636 <literallayout class="monospaced">&lt;full commit message&gt;</literallayout>\r
1637 </listitem>\r
1638 <listitem>\r
1639 <simpara>\r
1640 <emphasis>raw</emphasis>\r
1641 </simpara>\r
1642 <simpara>The <emphasis>raw</emphasis> format shows the entire commit exactly as\r
1643 stored in the commit object.  Notably, the SHA-1s are\r
1644 displayed in full, regardless of whether --abbrev or\r
1645 --no-abbrev are used, and <emphasis>parents</emphasis> information show the\r
1646 true parent commits, without taking grafts or history\r
1647 simplification into account. Note that this format affects the way\r
1648 commits are displayed, but not the way the diff is shown e.g. with\r
1649 <emphasis>git log --raw</emphasis>. To get full object names in a raw diff format,\r
1650 use <emphasis>--no-abbrev</emphasis>.</simpara>\r
1651 </listitem>\r
1652 <listitem>\r
1653 <simpara>\r
1654 <emphasis>format:&lt;string&gt;</emphasis>\r
1655 </simpara>\r
1656 <simpara>The <emphasis>format:&lt;string&gt;</emphasis> format allows you to specify which information\r
1657 you want to show. It works a little bit like printf format,\r
1658 with the notable exception that you get a newline with <emphasis>%n</emphasis>\r
1659 instead of <emphasis>\n</emphasis>.</simpara>\r
1660 <simpara>E.g, <emphasis>format:"The author of %h was %an, %ar%nThe title was &gt;&gt;%s&lt;&lt;%n"</emphasis>\r
1661 would show something like this:</simpara>\r
1662 <screen>The author of fe6e0ee was Junio C Hamano, 23 hours ago\r
1663 The title was &gt;&gt;t4119: test autocomputing -p&lt;n&gt; for traditional diff input.&lt;&lt;</screen>\r
1664 <simpara>The placeholders are:</simpara>\r
1665 <itemizedlist>\r
1666 <listitem>\r
1667 <simpara>\r
1668 <emphasis>%H</emphasis>: commit hash\r
1669 </simpara>\r
1670 </listitem>\r
1671 <listitem>\r
1672 <simpara>\r
1673 <emphasis>%h</emphasis>: abbreviated commit hash\r
1674 </simpara>\r
1675 </listitem>\r
1676 <listitem>\r
1677 <simpara>\r
1678 <emphasis>%T</emphasis>: tree hash\r
1679 </simpara>\r
1680 </listitem>\r
1681 <listitem>\r
1682 <simpara>\r
1683 <emphasis>%t</emphasis>: abbreviated tree hash\r
1684 </simpara>\r
1685 </listitem>\r
1686 <listitem>\r
1687 <simpara>\r
1688 <emphasis>%P</emphasis>: parent hashes\r
1689 </simpara>\r
1690 </listitem>\r
1691 <listitem>\r
1692 <simpara>\r
1693 <emphasis>%p</emphasis>: abbreviated parent hashes\r
1694 </simpara>\r
1695 </listitem>\r
1696 <listitem>\r
1697 <simpara>\r
1698 <emphasis>%an</emphasis>: author name\r
1699 </simpara>\r
1700 </listitem>\r
1701 <listitem>\r
1702 <simpara>\r
1703 <emphasis>%aN</emphasis>: author name (respecting .mailmap, see <xref linkend="git-shortlog(1)" />\r
1704   or <xref linkend="git-blame(1)" />)\r
1705 </simpara>\r
1706 </listitem>\r
1707 <listitem>\r
1708 <simpara>\r
1709 <emphasis>%ae</emphasis>: author email\r
1710 </simpara>\r
1711 </listitem>\r
1712 <listitem>\r
1713 <simpara>\r
1714 <emphasis>%aE</emphasis>: author email (respecting .mailmap, see\r
1715   <xref linkend="git-shortlog(1)" /> or <xref linkend="git-blame(1)" />)\r
1716 </simpara>\r
1717 </listitem>\r
1718 <listitem>\r
1719 <simpara>\r
1720 <emphasis>%ad</emphasis>: author date (format respects --date= option)\r
1721 </simpara>\r
1722 </listitem>\r
1723 <listitem>\r
1724 <simpara>\r
1725 <emphasis>%aD</emphasis>: author date, RFC2822 style\r
1726 </simpara>\r
1727 </listitem>\r
1728 <listitem>\r
1729 <simpara>\r
1730 <emphasis>%ar</emphasis>: author date, relative\r
1731 </simpara>\r
1732 </listitem>\r
1733 <listitem>\r
1734 <simpara>\r
1735 <emphasis>%at</emphasis>: author date, UNIX timestamp\r
1736 </simpara>\r
1737 </listitem>\r
1738 <listitem>\r
1739 <simpara>\r
1740 <emphasis>%ai</emphasis>: author date, ISO 8601-like format\r
1741 </simpara>\r
1742 </listitem>\r
1743 <listitem>\r
1744 <simpara>\r
1745 <emphasis>%aI</emphasis>: author date, strict ISO 8601 format\r
1746 </simpara>\r
1747 </listitem>\r
1748 <listitem>\r
1749 <simpara>\r
1750 <emphasis>%cn</emphasis>: committer name\r
1751 </simpara>\r
1752 </listitem>\r
1753 <listitem>\r
1754 <simpara>\r
1755 <emphasis>%cN</emphasis>: committer name (respecting .mailmap, see\r
1756   <xref linkend="git-shortlog(1)" /> or <xref linkend="git-blame(1)" />)\r
1757 </simpara>\r
1758 </listitem>\r
1759 <listitem>\r
1760 <simpara>\r
1761 <emphasis>%ce</emphasis>: committer email\r
1762 </simpara>\r
1763 </listitem>\r
1764 <listitem>\r
1765 <simpara>\r
1766 <emphasis>%cE</emphasis>: committer email (respecting .mailmap, see\r
1767   <xref linkend="git-shortlog(1)" /> or <xref linkend="git-blame(1)" />)\r
1768 </simpara>\r
1769 </listitem>\r
1770 <listitem>\r
1771 <simpara>\r
1772 <emphasis>%cd</emphasis>: committer date (format respects --date= option)\r
1773 </simpara>\r
1774 </listitem>\r
1775 <listitem>\r
1776 <simpara>\r
1777 <emphasis>%cD</emphasis>: committer date, RFC2822 style\r
1778 </simpara>\r
1779 </listitem>\r
1780 <listitem>\r
1781 <simpara>\r
1782 <emphasis>%cr</emphasis>: committer date, relative\r
1783 </simpara>\r
1784 </listitem>\r
1785 <listitem>\r
1786 <simpara>\r
1787 <emphasis>%ct</emphasis>: committer date, UNIX timestamp\r
1788 </simpara>\r
1789 </listitem>\r
1790 <listitem>\r
1791 <simpara>\r
1792 <emphasis>%ci</emphasis>: committer date, ISO 8601-like format\r
1793 </simpara>\r
1794 </listitem>\r
1795 <listitem>\r
1796 <simpara>\r
1797 <emphasis>%cI</emphasis>: committer date, strict ISO 8601 format\r
1798 </simpara>\r
1799 </listitem>\r
1800 <listitem>\r
1801 <simpara>\r
1802 <emphasis>%d</emphasis>: ref names, like the --decorate option of <xref linkend="git-log(1)" />\r
1803 </simpara>\r
1804 </listitem>\r
1805 <listitem>\r
1806 <simpara>\r
1807 <emphasis>%D</emphasis>: ref names without the " (", ")" wrapping.\r
1808 </simpara>\r
1809 </listitem>\r
1810 <listitem>\r
1811 <simpara>\r
1812 <emphasis>%e</emphasis>: encoding\r
1813 </simpara>\r
1814 </listitem>\r
1815 <listitem>\r
1816 <simpara>\r
1817 <emphasis>%s</emphasis>: subject\r
1818 </simpara>\r
1819 </listitem>\r
1820 <listitem>\r
1821 <simpara>\r
1822 <emphasis>%f</emphasis>: sanitized subject line, suitable for a filename\r
1823 </simpara>\r
1824 </listitem>\r
1825 <listitem>\r
1826 <simpara>\r
1827 <emphasis>%b</emphasis>: body\r
1828 </simpara>\r
1829 </listitem>\r
1830 <listitem>\r
1831 <simpara>\r
1832 <emphasis>%B</emphasis>: raw body (unwrapped subject and body)\r
1833 </simpara>\r
1834 </listitem>\r
1835 <listitem>\r
1836 <simpara>\r
1837 <emphasis>%GG</emphasis>: raw verification message from GPG for a signed commit\r
1838 </simpara>\r
1839 </listitem>\r
1840 <listitem>\r
1841 <simpara>\r
1842 <emphasis>%G?</emphasis>: show "G" for a Good signature, "B" for a Bad signature, "U" for a good,\r
1843   untrusted signature and "N" for no signature\r
1844 </simpara>\r
1845 </listitem>\r
1846 <listitem>\r
1847 <simpara>\r
1848 <emphasis>%GS</emphasis>: show the name of the signer for a signed commit\r
1849 </simpara>\r
1850 </listitem>\r
1851 <listitem>\r
1852 <simpara>\r
1853 <emphasis>%GK</emphasis>: show the key used to sign a signed commit\r
1854 </simpara>\r
1855 </listitem>\r
1856 <listitem>\r
1857 <simpara>\r
1858 <emphasis>%gD</emphasis>: reflog selector, e.g., <emphasis>refs/stash@{1}</emphasis>\r
1859 </simpara>\r
1860 </listitem>\r
1861 <listitem>\r
1862 <simpara>\r
1863 <emphasis>%gd</emphasis>: shortened reflog selector, e.g., <emphasis>stash@{1}</emphasis>\r
1864 </simpara>\r
1865 </listitem>\r
1866 <listitem>\r
1867 <simpara>\r
1868 <emphasis>%gn</emphasis>: reflog identity name\r
1869 </simpara>\r
1870 </listitem>\r
1871 <listitem>\r
1872 <simpara>\r
1873 <emphasis>%gN</emphasis>: reflog identity name (respecting .mailmap, see\r
1874   <xref linkend="git-shortlog(1)" /> or <xref linkend="git-blame(1)" />)\r
1875 </simpara>\r
1876 </listitem>\r
1877 <listitem>\r
1878 <simpara>\r
1879 <emphasis>%ge</emphasis>: reflog identity email\r
1880 </simpara>\r
1881 </listitem>\r
1882 <listitem>\r
1883 <simpara>\r
1884 <emphasis>%gE</emphasis>: reflog identity email (respecting .mailmap, see\r
1885   <xref linkend="git-shortlog(1)" /> or <xref linkend="git-blame(1)" />)\r
1886 </simpara>\r
1887 </listitem>\r
1888 <listitem>\r
1889 <simpara>\r
1890 <emphasis>%gs</emphasis>: reflog subject\r
1891 </simpara>\r
1892 </listitem>\r
1893 <listitem>\r
1894 <simpara>\r
1895 <emphasis>%Cred</emphasis>: switch color to red\r
1896 </simpara>\r
1897 </listitem>\r
1898 <listitem>\r
1899 <simpara>\r
1900 <emphasis>%Cgreen</emphasis>: switch color to green\r
1901 </simpara>\r
1902 </listitem>\r
1903 <listitem>\r
1904 <simpara>\r
1905 <emphasis>%Cblue</emphasis>: switch color to blue\r
1906 </simpara>\r
1907 </listitem>\r
1908 <listitem>\r
1909 <simpara>\r
1910 <emphasis>%Creset</emphasis>: reset color\r
1911 </simpara>\r
1912 </listitem>\r
1913 <listitem>\r
1914 <simpara>\r
1915 <emphasis>%C(&#8230;)</emphasis>: color specification, as described in color.branch.* config option;\r
1916   adding <emphasis>auto,</emphasis> at the beginning will emit color only when colors are\r
1917   enabled for log output (by <emphasis>color.diff</emphasis>, <emphasis>color.ui</emphasis>, or <emphasis>--color</emphasis>, and\r
1918   respecting the <emphasis>auto</emphasis> settings of the former if we are going to a\r
1919   terminal). <emphasis>auto</emphasis> alone (i.e. <emphasis>%C(auto)</emphasis>) will turn on auto coloring\r
1920   on the next placeholders until the color is switched again.\r
1921 </simpara>\r
1922 </listitem>\r
1923 <listitem>\r
1924 <simpara>\r
1925 <emphasis>%m</emphasis>: left, right or boundary mark\r
1926 </simpara>\r
1927 </listitem>\r
1928 <listitem>\r
1929 <simpara>\r
1930 <emphasis>%n</emphasis>: newline\r
1931 </simpara>\r
1932 </listitem>\r
1933 <listitem>\r
1934 <simpara>\r
1935 <emphasis>%%</emphasis>: a raw <emphasis>%</emphasis>\r
1936 </simpara>\r
1937 </listitem>\r
1938 <listitem>\r
1939 <simpara>\r
1940 <emphasis>%x00</emphasis>: print a byte from a hex code\r
1941 </simpara>\r
1942 </listitem>\r
1943 <listitem>\r
1944 <simpara>\r
1945 <emphasis>%w([&lt;w&gt;[,&lt;i1&gt;[,&lt;i2&gt;]]])</emphasis>: switch line wrapping, like the -w option of\r
1946   <xref linkend="git-shortlog(1)" />.\r
1947 </simpara>\r
1948 </listitem>\r
1949 <listitem>\r
1950 <simpara>\r
1951 <emphasis>%&lt;(&lt;N&gt;[,trunc|ltrunc|mtrunc])</emphasis>: make the next placeholder take at\r
1952   least N columns, padding spaces on the right if necessary.\r
1953   Optionally truncate at the beginning (ltrunc), the middle (mtrunc)\r
1954   or the end (trunc) if the output is longer than N columns.\r
1955   Note that truncating only works correctly with N &gt;= 2.\r
1956 </simpara>\r
1957 </listitem>\r
1958 <listitem>\r
1959 <simpara>\r
1960 <emphasis>%&lt;|(&lt;N&gt;)</emphasis>: make the next placeholder take at least until Nth\r
1961   columns, padding spaces on the right if necessary\r
1962 </simpara>\r
1963 </listitem>\r
1964 <listitem>\r
1965 <simpara>\r
1966 <emphasis>%&gt;(&lt;N&gt;)</emphasis>, <emphasis>%&gt;|(&lt;N&gt;)</emphasis>: similar to <emphasis>%&lt;(&lt;N&gt;)</emphasis>, <emphasis>%&lt;|(&lt;N&gt;)</emphasis>\r
1967   respectively, but padding spaces on the left\r
1968 </simpara>\r
1969 </listitem>\r
1970 <listitem>\r
1971 <simpara>\r
1972 <emphasis>%&gt;&gt;(&lt;N&gt;)</emphasis>, <emphasis>%&gt;&gt;|(&lt;N&gt;)</emphasis>: similar to <emphasis>%&gt;(&lt;N&gt;)</emphasis>, <emphasis>%&gt;|(&lt;N&gt;)</emphasis>\r
1973   respectively, except that if the next placeholder takes more spaces\r
1974   than given and there are spaces on its left, use those spaces\r
1975 </simpara>\r
1976 </listitem>\r
1977 <listitem>\r
1978 <simpara>\r
1979 <emphasis>%&gt;&lt;(&lt;N&gt;)</emphasis>, <emphasis>%&gt;&lt;|(&lt;N&gt;)</emphasis>: similar to <emphasis>% &lt;(&lt;N&gt;)</emphasis>, <emphasis>%&lt;|(&lt;N&gt;)</emphasis>\r
1980   respectively, but padding both sides (i.e. the text is centered)\r
1981 </simpara>\r
1982 </listitem>\r
1983 </itemizedlist>\r
1984 </listitem>\r
1985 </itemizedlist>\r
1986 <note><simpara>Some placeholders may depend on other options given to the\r
1987 revision traversal engine. For example, the <emphasis>%g*</emphasis> reflog options will\r
1988 insert an empty string unless we are traversing reflog entries (e.g., by\r
1989 <emphasis>git log -g</emphasis>). The <emphasis>%d</emphasis> and <emphasis>%D</emphasis> placeholders will use the "short"\r
1990 decoration format if <emphasis>--decorate</emphasis> was not already provided on the command\r
1991 line.</simpara></note>\r
1992 <simpara>If you add a <emphasis>+</emphasis> (plus sign) after <emphasis>%</emphasis> of a placeholder, a line-feed\r
1993 is inserted immediately before the expansion if and only if the\r
1994 placeholder expands to a non-empty string.</simpara>\r
1995 <simpara>If you add a <emphasis>-</emphasis> (minus sign) after <emphasis>%</emphasis> of a placeholder, line-feeds that\r
1996 immediately precede the expansion are deleted if and only if the\r
1997 placeholder expands to an empty string.</simpara>\r
1998 <simpara>If you add a ` ` (space) after <emphasis>%</emphasis> of a placeholder, a space\r
1999 is inserted immediately before the expansion if and only if the\r
2000 placeholder expands to a non-empty string.</simpara>\r
2001 <itemizedlist>\r
2002 <listitem>\r
2003 <simpara>\r
2004 <emphasis>tformat:</emphasis>\r
2005 </simpara>\r
2006 <simpara>The <emphasis>tformat:</emphasis> format works exactly like <emphasis>format:</emphasis>, except that it\r
2007 provides "terminator" semantics instead of "separator" semantics. In\r
2008 other words, each commit has the message terminator character (usually a\r
2009 newline) appended, rather than a separator placed between entries.\r
2010 This means that the final entry of a single-line format will be properly\r
2011 terminated with a new line, just as the "oneline" format does.\r
2012 For example:</simpara>\r
2013 <screen>$ git log -2 --pretty=format:%h 4da45bef \\r
2014   | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'\r
2015 4da45be\r
2016 7134973 -- NO NEWLINE\r
2018 $ git log -2 --pretty=tformat:%h 4da45bef \\r
2019   | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'\r
2020 4da45be\r
2021 7134973</screen>\r
2022 <simpara>In addition, any unrecognized string that has a <emphasis>%</emphasis> in it is interpreted\r
2023 as if it has <emphasis>tformat:</emphasis> in front of it.  For example, these two are\r
2024 equivalent:</simpara>\r
2025 <screen>$ git log -2 --pretty=tformat:%h 4da45bef\r
2026 $ git log -2 --pretty=%h 4da45bef</screen>\r
2027 </listitem>\r
2028 </itemizedlist>\r
2029 </simplesect>\r
2030 <simplesect id="git-rev-list(1)__git">\r
2031 <title>GIT</title>\r
2032 <simpara>Part of the <xref linkend="git(1)" /> suite</simpara>\r
2033 </simplesect>\r
2034 </sect2>\r