Autogenerated HTML docs for v1.7.5-185-g0b9dee
[git/jnareb-git.git] / git-rev-list.html
blobbd34f7cc35023c2bd14163020e6e2be0a2e9298e
1 <!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" />
6 <meta name="generator" content="AsciiDoc 8.4.5" />
7 <title>git-rev-list(1)</title>
8 <style type="text/css">
9 /* Debug borders */
10 p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {
12 border: 1px solid red;
16 body {
17 margin: 1em 5% 1em 5%;
20 a {
21 color: blue;
22 text-decoration: underline;
24 a:visited {
25 color: fuchsia;
28 em {
29 font-style: italic;
30 color: navy;
33 strong {
34 font-weight: bold;
35 color: #083194;
38 tt {
39 color: navy;
42 h1, h2, h3, h4, h5, h6 {
43 color: #527bbd;
44 font-family: sans-serif;
45 margin-top: 1.2em;
46 margin-bottom: 0.5em;
47 line-height: 1.3;
50 h1, h2, h3 {
51 border-bottom: 2px solid silver;
53 h2 {
54 padding-top: 0.5em;
56 h3 {
57 float: left;
59 h3 + * {
60 clear: left;
63 div.sectionbody {
64 font-family: serif;
65 margin-left: 0;
68 hr {
69 border: 1px solid silver;
72 p {
73 margin-top: 0.5em;
74 margin-bottom: 0.5em;
77 ul, ol, li > p {
78 margin-top: 0;
81 pre {
82 padding: 0;
83 margin: 0;
86 span#author {
87 color: #527bbd;
88 font-family: sans-serif;
89 font-weight: bold;
90 font-size: 1.1em;
92 span#email {
94 span#revnumber, span#revdate, span#revremark {
95 font-family: sans-serif;
98 div#footer {
99 font-family: sans-serif;
100 font-size: small;
101 border-top: 2px solid silver;
102 padding-top: 0.5em;
103 margin-top: 4.0em;
105 div#footer-text {
106 float: left;
107 padding-bottom: 0.5em;
109 div#footer-badges {
110 float: right;
111 padding-bottom: 0.5em;
114 div#preamble {
115 margin-top: 1.5em;
116 margin-bottom: 1.5em;
118 div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
119 div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
120 div.admonitionblock {
121 margin-top: 1.5em;
122 margin-bottom: 1.5em;
124 div.admonitionblock {
125 margin-top: 2.5em;
126 margin-bottom: 2.5em;
129 div.content { /* Block element content. */
130 padding: 0;
133 /* Block element titles. */
134 div.title, caption.title {
135 color: #527bbd;
136 font-family: sans-serif;
137 font-weight: bold;
138 text-align: left;
139 margin-top: 1.0em;
140 margin-bottom: 0.5em;
142 div.title + * {
143 margin-top: 0;
146 td div.title:first-child {
147 margin-top: 0.0em;
149 div.content div.title:first-child {
150 margin-top: 0.0em;
152 div.content + div.title {
153 margin-top: 0.0em;
156 div.sidebarblock > div.content {
157 background: #ffffee;
158 border: 1px solid silver;
159 padding: 0.5em;
162 div.listingblock > div.content {
163 border: 1px solid silver;
164 background: #f4f4f4;
165 padding: 0.5em;
168 div.quoteblock {
169 padding-left: 2.0em;
170 margin-right: 10%;
172 div.quoteblock > div.attribution {
173 padding-top: 0.5em;
174 text-align: right;
177 div.verseblock {
178 padding-left: 2.0em;
179 margin-right: 10%;
181 div.verseblock > div.content {
182 white-space: pre;
184 div.verseblock > div.attribution {
185 padding-top: 0.75em;
186 text-align: left;
188 /* DEPRECATED: Pre version 8.2.7 verse style literal block. */
189 div.verseblock + div.attribution {
190 text-align: left;
193 div.admonitionblock .icon {
194 vertical-align: top;
195 font-size: 1.1em;
196 font-weight: bold;
197 text-decoration: underline;
198 color: #527bbd;
199 padding-right: 0.5em;
201 div.admonitionblock td.content {
202 padding-left: 0.5em;
203 border-left: 2px solid silver;
206 div.exampleblock > div.content {
207 border-left: 2px solid silver;
208 padding: 0.5em;
211 div.imageblock div.content { padding-left: 0; }
212 span.image img { border-style: none; }
213 a.image:visited { color: white; }
215 dl {
216 margin-top: 0.8em;
217 margin-bottom: 0.8em;
219 dt {
220 margin-top: 0.5em;
221 margin-bottom: 0;
222 font-style: normal;
223 color: navy;
225 dd > *:first-child {
226 margin-top: 0.1em;
229 ul, ol {
230 list-style-position: outside;
232 ol.arabic {
233 list-style-type: decimal;
235 ol.loweralpha {
236 list-style-type: lower-alpha;
238 ol.upperalpha {
239 list-style-type: upper-alpha;
241 ol.lowerroman {
242 list-style-type: lower-roman;
244 ol.upperroman {
245 list-style-type: upper-roman;
248 div.compact ul, div.compact ol,
249 div.compact p, div.compact p,
250 div.compact div, div.compact div {
251 margin-top: 0.1em;
252 margin-bottom: 0.1em;
255 div.tableblock > table {
256 border: 3px solid #527bbd;
258 thead {
259 font-family: sans-serif;
260 font-weight: bold;
262 tfoot {
263 font-weight: bold;
265 td > div.verse {
266 white-space: pre;
268 p.table {
269 margin-top: 0;
271 /* Because the table frame attribute is overriden by CSS in most browsers. */
272 div.tableblock > table[frame="void"] {
273 border-style: none;
275 div.tableblock > table[frame="hsides"] {
276 border-left-style: none;
277 border-right-style: none;
279 div.tableblock > table[frame="vsides"] {
280 border-top-style: none;
281 border-bottom-style: none;
285 div.hdlist {
286 margin-top: 0.8em;
287 margin-bottom: 0.8em;
289 div.hdlist tr {
290 padding-bottom: 15px;
292 dt.hdlist1.strong, td.hdlist1.strong {
293 font-weight: bold;
295 td.hdlist1 {
296 vertical-align: top;
297 font-style: normal;
298 padding-right: 0.8em;
299 color: navy;
301 td.hdlist2 {
302 vertical-align: top;
304 div.hdlist.compact tr {
305 margin: 0;
306 padding-bottom: 0;
309 .comment {
310 background: yellow;
313 @media print {
314 div#footer-badges { display: none; }
317 div#toctitle {
318 color: #527bbd;
319 font-family: sans-serif;
320 font-size: 1.1em;
321 font-weight: bold;
322 margin-top: 1.0em;
323 margin-bottom: 0.1em;
326 div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
327 margin-top: 0;
328 margin-bottom: 0;
330 div.toclevel2 {
331 margin-left: 2em;
332 font-size: 0.9em;
334 div.toclevel3 {
335 margin-left: 4em;
336 font-size: 0.9em;
338 div.toclevel4 {
339 margin-left: 6em;
340 font-size: 0.9em;
342 /* Overrides for manpage documents */
343 h1 {
344 padding-top: 0.5em;
345 padding-bottom: 0.5em;
346 border-top: 2px solid silver;
347 border-bottom: 2px solid silver;
349 h2 {
350 border-style: none;
352 div.sectionbody {
353 margin-left: 5%;
356 @media print {
357 div#toc { display: none; }
360 /* Workarounds for IE6's broken and incomplete CSS2. */
362 div.sidebar-content {
363 background: #ffffee;
364 border: 1px solid silver;
365 padding: 0.5em;
367 div.sidebar-title, div.image-title {
368 color: #527bbd;
369 font-family: sans-serif;
370 font-weight: bold;
371 margin-top: 0.0em;
372 margin-bottom: 0.5em;
375 div.listingblock div.content {
376 border: 1px solid silver;
377 background: #f4f4f4;
378 padding: 0.5em;
381 div.quoteblock-attribution {
382 padding-top: 0.5em;
383 text-align: right;
386 div.verseblock-content {
387 white-space: pre;
389 div.verseblock-attribution {
390 padding-top: 0.75em;
391 text-align: left;
394 div.exampleblock-content {
395 border-left: 2px solid silver;
396 padding-left: 0.5em;
399 /* IE6 sets dynamically generated links as visited. */
400 div#toc a:visited { color: blue; }
401 </style>
402 </head>
403 <body>
404 <div id="header">
405 <h1>
406 git-rev-list(1) Manual Page
407 </h1>
408 <h2>NAME</h2>
409 <div class="sectionbody">
410 <p>git-rev-list -
411 Lists commit objects in reverse chronological order
412 </p>
413 </div>
414 </div>
415 <h2 id="_synopsis">SYNOPSIS</h2>
416 <div class="sectionbody">
417 <div class="verseblock">
418 <div class="verseblock-content"><em>git rev-list</em> [ --max-count=&lt;number&gt; ]
419 [ --skip=&lt;number&gt; ]
420 [ --max-age=&lt;timestamp&gt; ]
421 [ --min-age=&lt;timestamp&gt; ]
422 [ --sparse ]
423 [ --merges ]
424 [ --no-merges ]
425 [ --min-parents=&lt;number&gt; ]
426 [ --no-min-parents ]
427 [ --max-parents=&lt;number&gt; ]
428 [ --no-max-parents ]
429 [ --first-parent ]
430 [ --remove-empty ]
431 [ --full-history ]
432 [ --not ]
433 [ --all ]
434 [ --branches[=&lt;pattern&gt;] ]
435 [ --tags[=&lt;pattern&gt;] ]
436 [ --remotes[=&lt;pattern&gt;] ]
437 [ --glob=&lt;glob-pattern&gt; ]
438 [ --stdin ]
439 [ --quiet ]
440 [ --topo-order ]
441 [ --parents ]
442 [ --timestamp ]
443 [ --left-right ]
444 [ --left-only ]
445 [ --right-only ]
446 [ --cherry-mark ]
447 [ --cherry-pick ]
448 [ --encoding[=&lt;encoding&gt;] ]
449 [ --(author|committer|grep)=&lt;pattern&gt; ]
450 [ --regexp-ignore-case | -i ]
451 [ --extended-regexp | -E ]
452 [ --fixed-strings | -F ]
453 [ --date=(local|relative|default|iso|rfc|short) ]
454 [ [--objects | --objects-edge] [ --unpacked ] ]
455 [ --pretty | --header ]
456 [ --bisect ]
457 [ --bisect-vars ]
458 [ --bisect-all ]
459 [ --merge ]
460 [ --reverse ]
461 [ --walk-reflogs ]
462 [ --no-walk ] [ --do-walk ]
463 &lt;commit&gt;&#8230; [ -- &lt;paths&gt;&#8230; ]</div>
464 <div class="verseblock-attribution">
465 </div></div>
466 </div>
467 <h2 id="_description">DESCRIPTION</h2>
468 <div class="sectionbody">
469 <div class="paragraph"><p>List commits that are reachable by following the <tt>parent</tt> links from the
470 given commit(s), but exclude commits that are reachable from the one(s)
471 given with a <em>&#94;</em> in front of them. The output is given in reverse
472 chronological order by default.</p></div>
473 <div class="paragraph"><p>You can think of this as a set operation. Commits given on the command
474 line form a set of commits that are reachable from any of them, and then
475 commits reachable from any of the ones given with <em>&#94;</em> in front are
476 subtracted from that set. The remaining commits are what comes out in the
477 command&#8217;s output. Various other options and paths parameters can be used
478 to further limit the result.</p></div>
479 <div class="paragraph"><p>Thus, the following command:</p></div>
480 <div class="listingblock">
481 <div class="content">
482 <pre><tt> $ git rev-list foo bar ^baz</tt></pre>
483 </div></div>
484 <div class="paragraph"><p>means "list all the commits which are reachable from <em>foo</em> or <em>bar</em>, but
485 not from <em>baz</em>".</p></div>
486 <div class="paragraph"><p>A special notation "<em>&lt;commit1&gt;</em>..<em>&lt;commit2&gt;</em>" can be used as a
487 short-hand for "&#94;<em>&lt;commit1&gt;</em> <em>&lt;commit2&gt;</em>". For example, either of
488 the following may be used interchangeably:</p></div>
489 <div class="listingblock">
490 <div class="content">
491 <pre><tt> $ git rev-list origin..HEAD
492 $ git rev-list HEAD ^origin</tt></pre>
493 </div></div>
494 <div class="paragraph"><p>Another special notation is "<em>&lt;commit1&gt;</em>&#8230;<em>&lt;commit2&gt;</em>" which is useful
495 for merges. The resulting set of commits is the symmetric difference
496 between the two operands. The following two commands are equivalent:</p></div>
497 <div class="listingblock">
498 <div class="content">
499 <pre><tt> $ git rev-list A B --not $(git merge-base --all A B)
500 $ git rev-list A...B</tt></pre>
501 </div></div>
502 <div class="paragraph"><p><em>rev-list</em> is a very essential git command, since it
503 provides the ability to build and traverse commit ancestry graphs. For
504 this reason, it has a lot of different options that enables it to be
505 used by commands as different as <em>git bisect</em> and
506 <em>git repack</em>.</p></div>
507 </div>
508 <h2 id="_options">OPTIONS</h2>
509 <div class="sectionbody">
510 <h3 id="_commit_limiting">Commit Limiting</h3><div style="clear:left"></div>
511 <div class="paragraph"><p>Besides specifying a range of commits that should be listed using the
512 special notations explained in the description, additional commit
513 limiting may be applied. Note that they are applied before commit
514 ordering and formatting options, such as <em>--reverse</em>.</p></div>
515 <div class="dlist"><dl>
516 <dt class="hdlist1">
517 -n <em>number</em>
518 </dt>
519 <dt class="hdlist1">
520 --max-count=&lt;number&gt;
521 </dt>
522 <dd>
524 Limit the number of commits to output.
525 </p>
526 </dd>
527 <dt class="hdlist1">
528 --skip=&lt;number&gt;
529 </dt>
530 <dd>
532 Skip <em>number</em> commits before starting to show the commit output.
533 </p>
534 </dd>
535 <dt class="hdlist1">
536 --since=&lt;date&gt;
537 </dt>
538 <dt class="hdlist1">
539 --after=&lt;date&gt;
540 </dt>
541 <dd>
543 Show commits more recent than a specific date.
544 </p>
545 </dd>
546 <dt class="hdlist1">
547 --until=&lt;date&gt;
548 </dt>
549 <dt class="hdlist1">
550 --before=&lt;date&gt;
551 </dt>
552 <dd>
554 Show commits older than a specific date.
555 </p>
556 </dd>
557 <dt class="hdlist1">
558 --max-age=&lt;timestamp&gt;
559 </dt>
560 <dt class="hdlist1">
561 --min-age=&lt;timestamp&gt;
562 </dt>
563 <dd>
565 Limit the commits output to specified time range.
566 </p>
567 </dd>
568 <dt class="hdlist1">
569 --author=&lt;pattern&gt;
570 </dt>
571 <dt class="hdlist1">
572 --committer=&lt;pattern&gt;
573 </dt>
574 <dd>
576 Limit the commits output to ones with author/committer
577 header lines that match the specified pattern (regular expression).
578 </p>
579 </dd>
580 <dt class="hdlist1">
581 --grep=&lt;pattern&gt;
582 </dt>
583 <dd>
585 Limit the commits output to ones with log message that
586 matches the specified pattern (regular expression).
587 </p>
588 </dd>
589 <dt class="hdlist1">
590 --all-match
591 </dt>
592 <dd>
594 Limit the commits output to ones that match all given --grep,
595 --author and --committer instead of ones that match at least one.
596 </p>
597 </dd>
598 <dt class="hdlist1">
600 </dt>
601 <dt class="hdlist1">
602 --regexp-ignore-case
603 </dt>
604 <dd>
606 Match the regexp limiting patterns without regard to letters case.
607 </p>
608 </dd>
609 <dt class="hdlist1">
611 </dt>
612 <dt class="hdlist1">
613 --extended-regexp
614 </dt>
615 <dd>
617 Consider the limiting patterns to be extended regular expressions
618 instead of the default basic regular expressions.
619 </p>
620 </dd>
621 <dt class="hdlist1">
623 </dt>
624 <dt class="hdlist1">
625 --fixed-strings
626 </dt>
627 <dd>
629 Consider the limiting patterns to be fixed strings (don&#8217;t interpret
630 pattern as a regular expression).
631 </p>
632 </dd>
633 <dt class="hdlist1">
634 --remove-empty
635 </dt>
636 <dd>
638 Stop when a given path disappears from the tree.
639 </p>
640 </dd>
641 <dt class="hdlist1">
642 --merges
643 </dt>
644 <dd>
646 Print only merge commits. This is exactly the same as <tt>--min-parents=2</tt>.
647 </p>
648 </dd>
649 <dt class="hdlist1">
650 --no-merges
651 </dt>
652 <dd>
654 Do not print commits with more than one parent. This is
655 exactly the same as <tt>--max-parents=1</tt>.
656 </p>
657 </dd>
658 <dt class="hdlist1">
659 --min-parents=&lt;number&gt;
660 </dt>
661 <dt class="hdlist1">
662 --max-parents=&lt;number&gt;
663 </dt>
664 <dt class="hdlist1">
665 --no-min-parents
666 </dt>
667 <dt class="hdlist1">
668 --no-max-parents
669 </dt>
670 <dd>
672 Show only commits which have at least (or at most) that many
673 commits. In particular, <tt>--max-parents=1</tt> is the same as <tt>--no-merges</tt>,
674 <tt>--min-parents=2</tt> is the same as <tt>--merges</tt>. <tt>--max-parents=0</tt>
675 gives all root commits and <tt>--min-parents=3</tt> all octopus merges.
676 </p>
677 <div class="paragraph"><p><tt>--no-min-parents</tt> and <tt>--no-max-parents</tt> reset these limits (to no limit)
678 again. Equivalent forms are <tt>--min-parents=0</tt> (any commit has 0 or more
679 parents) and <tt>--max-parents=-1</tt> (negative numbers denote no upper limit).</p></div>
680 </dd>
681 <dt class="hdlist1">
682 --first-parent
683 </dt>
684 <dd>
686 Follow only the first parent commit upon seeing a merge
687 commit. This option can give a better overview when
688 viewing the evolution of a particular topic branch,
689 because merges into a topic branch tend to be only about
690 adjusting to updated upstream from time to time, and
691 this option allows you to ignore the individual commits
692 brought in to your history by such a merge.
693 </p>
694 </dd>
695 <dt class="hdlist1">
696 --not
697 </dt>
698 <dd>
700 Reverses the meaning of the <em>&#94;</em> prefix (or lack thereof)
701 for all following revision specifiers, up to the next <em>--not</em>.
702 </p>
703 </dd>
704 <dt class="hdlist1">
705 --all
706 </dt>
707 <dd>
709 Pretend as if all the refs in <tt>refs/</tt> are listed on the
710 command line as <em>&lt;commit&gt;</em>.
711 </p>
712 </dd>
713 <dt class="hdlist1">
714 --branches[=&lt;pattern&gt;]
715 </dt>
716 <dd>
718 Pretend as if all the refs in <tt>refs/heads</tt> are listed
719 on the command line as <em>&lt;commit&gt;</em>. If <em>&lt;pattern&gt;</em> is given, limit
720 branches to ones matching given shell glob. If pattern lacks <em>?</em>,
721 <em><strong></em>, or <em>[</em>, <em>/</strong></em> at the end is implied.
722 </p>
723 </dd>
724 <dt class="hdlist1">
725 --tags[=&lt;pattern&gt;]
726 </dt>
727 <dd>
729 Pretend as if all the refs in <tt>refs/tags</tt> are listed
730 on the command line as <em>&lt;commit&gt;</em>. If <em>&lt;pattern&gt;</em> is given, limit
731 tags to ones matching given shell glob. If pattern lacks <em>?</em>, <em><strong></em>,
732 or <em>[</em>, <em>/</strong></em> at the end is implied.
733 </p>
734 </dd>
735 <dt class="hdlist1">
736 --remotes[=&lt;pattern&gt;]
737 </dt>
738 <dd>
740 Pretend as if all the refs in <tt>refs/remotes</tt> are listed
741 on the command line as <em>&lt;commit&gt;</em>. If <em>&lt;pattern&gt;</em> is given, limit
742 remote-tracking branches to ones matching given shell glob.
743 If pattern lacks <em>?</em>, <em><strong></em>, or <em>[</em>, <em>/</strong></em> at the end is implied.
744 </p>
745 </dd>
746 <dt class="hdlist1">
747 --glob=&lt;glob-pattern&gt;
748 </dt>
749 <dd>
751 Pretend as if all the refs matching shell glob <em>&lt;glob-pattern&gt;</em>
752 are listed on the command line as <em>&lt;commit&gt;</em>. Leading <em>refs/</em>,
753 is automatically prepended if missing. If pattern lacks <em>?</em>, <em><strong></em>,
754 or <em>[</em>, <em>/</strong></em> at the end is implied.
755 </p>
756 </dd>
757 <dt class="hdlist1">
758 --stdin
759 </dt>
760 <dd>
762 In addition to the <em>&lt;commit&gt;</em> listed on the command
763 line, read them from the standard input. If a <em>--</em> separator is
764 seen, stop reading commits and start reading paths to limit the
765 result.
766 </p>
767 </dd>
768 <dt class="hdlist1">
769 --quiet
770 </dt>
771 <dd>
773 Don&#8217;t print anything to standard output. This form
774 is primarily meant to allow the caller to
775 test the exit status to see if a range of objects is fully
776 connected (or not). It is faster than redirecting stdout
777 to /dev/null as the output does not have to be formatted.
778 </p>
779 </dd>
780 <dt class="hdlist1">
781 --cherry-mark
782 </dt>
783 <dd>
785 Like <tt>--cherry-pick</tt> (see below) but mark equivalent commits
786 with <tt>=</tt> rather than omitting them, and inequivalent ones with <tt>+</tt>.
787 </p>
788 </dd>
789 <dt class="hdlist1">
790 --cherry-pick
791 </dt>
792 <dd>
794 Omit any commit that introduces the same change as
795 another commit on the "other side" when the set of
796 commits are limited with symmetric difference.
797 </p>
798 <div class="paragraph"><p>For example, if you have two branches, <tt>A</tt> and <tt>B</tt>, a usual way
799 to list all commits on only one side of them is with
800 <tt>--left-right</tt> (see the example below in the description of
801 the <tt>--left-right</tt> option). It however shows the commits that were cherry-picked
802 from the other branch (for example, "3rd on b" may be cherry-picked
803 from branch A). With this option, such pairs of commits are
804 excluded from the output.</p></div>
805 </dd>
806 <dt class="hdlist1">
807 --left-only
808 </dt>
809 <dt class="hdlist1">
810 --right-only
811 </dt>
812 <dd>
814 List only commits on the respective side of a symmetric range,
815 i.e. only those which would be marked <tt>&lt;</tt> resp. <tt>&gt;</tt> by
816 <tt>--left-right</tt>.
817 </p>
818 <div class="paragraph"><p>For example, <tt>--cherry-pick --right-only A&#8230;B</tt> omits those
819 commits from <tt>B</tt> which are in <tt>A</tt> or are patch-equivalent to a commit in
820 <tt>A</tt>. In other words, this lists the <tt>&#43;</tt> commits from <tt>git cherry A B</tt>.
821 More precisely, <tt>--cherry-pick --right-only --no-merges</tt> gives the exact
822 list.</p></div>
823 </dd>
824 <dt class="hdlist1">
825 --cherry
826 </dt>
827 <dd>
829 A synonym for <tt>--right-only --cherry-mark --no-merges</tt>; useful to
830 limit the output to the commits on our side and mark those that
831 have been applied to the other side of a forked history with
832 <tt>git log --cherry upstream&#8230;mybranch</tt>, similar to
833 <tt>git cherry upstream mybranch</tt>.
834 </p>
835 </dd>
836 <dt class="hdlist1">
838 </dt>
839 <dt class="hdlist1">
840 --walk-reflogs
841 </dt>
842 <dd>
844 Instead of walking the commit ancestry chain, walk
845 reflog entries from the most recent one to older ones.
846 When this option is used you cannot specify commits to
847 exclude (that is, <em>&#94;commit</em>, <em>commit1..commit2</em>,
848 nor <em>commit1...commit2</em> notations cannot be used).
849 </p>
850 <div class="paragraph"><p>With <em>--pretty</em> format other than oneline (for obvious reasons),
851 this causes the output to have two extra lines of information
852 taken from the reflog. By default, <em>commit@{Nth}</em> notation is
853 used in the output. When the starting commit is specified as
854 <em>commit@{now}</em>, output also uses <em>commit@{timestamp}</em> notation
855 instead. Under <em>--pretty=oneline</em>, the commit message is
856 prefixed with this information on the same line.
857 This option cannot be combined with <em>--reverse</em>.
858 See also <a href="git-reflog.html">git-reflog(1)</a>.</p></div>
859 </dd>
860 <dt class="hdlist1">
861 --merge
862 </dt>
863 <dd>
865 After a failed merge, show refs that touch files having a
866 conflict and don&#8217;t exist on all heads to merge.
867 </p>
868 </dd>
869 <dt class="hdlist1">
870 --boundary
871 </dt>
872 <dd>
874 Output uninteresting commits at the boundary, which are usually
875 not shown.
876 </p>
877 </dd>
878 </dl></div>
879 <h3 id="_history_simplification">History Simplification</h3><div style="clear:left"></div>
880 <div class="paragraph"><p>Sometimes you are only interested in parts of the history, for example the
881 commits modifying a particular &lt;path&gt;. But there are two parts of
882 <em>History Simplification</em>, one part is selecting the commits and the other
883 is how to do it, as there are various strategies to simplify the history.</p></div>
884 <div class="paragraph"><p>The following options select the commits to be shown:</p></div>
885 <div class="dlist"><dl>
886 <dt class="hdlist1">
887 &lt;paths&gt;
888 </dt>
889 <dd>
891 Commits modifying the given &lt;paths&gt; are selected.
892 </p>
893 </dd>
894 <dt class="hdlist1">
895 --simplify-by-decoration
896 </dt>
897 <dd>
899 Commits that are referred by some branch or tag are selected.
900 </p>
901 </dd>
902 </dl></div>
903 <div class="paragraph"><p>Note that extra commits can be shown to give a meaningful history.</p></div>
904 <div class="paragraph"><p>The following options affect the way the simplification is performed:</p></div>
905 <div class="dlist"><dl>
906 <dt class="hdlist1">
907 Default mode
908 </dt>
909 <dd>
911 Simplifies the history to the simplest history explaining the
912 final state of the tree. Simplest because it prunes some side
913 branches if the end result is the same (i.e. merging branches
914 with the same content)
915 </p>
916 </dd>
917 <dt class="hdlist1">
918 --full-history
919 </dt>
920 <dd>
922 As the default mode but does not prune some history.
923 </p>
924 </dd>
925 <dt class="hdlist1">
926 --dense
927 </dt>
928 <dd>
930 Only the selected commits are shown, plus some to have a
931 meaningful history.
932 </p>
933 </dd>
934 <dt class="hdlist1">
935 --sparse
936 </dt>
937 <dd>
939 All commits in the simplified history are shown.
940 </p>
941 </dd>
942 <dt class="hdlist1">
943 --simplify-merges
944 </dt>
945 <dd>
947 Additional option to <em>--full-history</em> to remove some needless
948 merges from the resulting history, as there are no selected
949 commits contributing to this merge.
950 </p>
951 </dd>
952 <dt class="hdlist1">
953 --ancestry-path
954 </dt>
955 <dd>
957 When given a range of commits to display (e.g. <em>commit1..commit2</em>
958 or <em>commit2 &#94;commit1</em>), only display commits that exist
959 directly on the ancestry chain between the <em>commit1</em> and
960 <em>commit2</em>, i.e. commits that are both descendants of <em>commit1</em>,
961 and ancestors of <em>commit2</em>.
962 </p>
963 </dd>
964 </dl></div>
965 <div class="paragraph"><p>A more detailed explanation follows.</p></div>
966 <div class="paragraph"><p>Suppose you specified <tt>foo</tt> as the &lt;paths&gt;. We shall call commits
967 that modify <tt>foo</tt> !TREESAME, and the rest TREESAME. (In a diff
968 filtered for <tt>foo</tt>, they look different and equal, respectively.)</p></div>
969 <div class="paragraph"><p>In the following, we will always refer to the same example history to
970 illustrate the differences between simplification settings. We assume
971 that you are filtering for a file <tt>foo</tt> in this commit graph:</p></div>
972 <div class="listingblock">
973 <div class="content">
974 <pre><tt> .-A---M---N---O---P
975 / / / / /
976 I B C D E
977 \ / / / /
978 `-------------'</tt></pre>
979 </div></div>
980 <div class="paragraph"><p>The horizontal line of history A&#8212;P is taken to be the first parent of
981 each merge. The commits are:</p></div>
982 <div class="ulist"><ul>
983 <li>
985 <tt>I</tt> is the initial commit, in which <tt>foo</tt> exists with contents
986 "asdf", and a file <tt>quux</tt> exists with contents "quux". Initial
987 commits are compared to an empty tree, so <tt>I</tt> is !TREESAME.
988 </p>
989 </li>
990 <li>
992 In <tt>A</tt>, <tt>foo</tt> contains just "foo".
993 </p>
994 </li>
995 <li>
997 <tt>B</tt> contains the same change as <tt>A</tt>. Its merge <tt>M</tt> is trivial and
998 hence TREESAME to all parents.
999 </p>
1000 </li>
1001 <li>
1003 <tt>C</tt> does not change <tt>foo</tt>, but its merge <tt>N</tt> changes it to "foobar",
1004 so it is not TREESAME to any parent.
1005 </p>
1006 </li>
1007 <li>
1009 <tt>D</tt> sets <tt>foo</tt> to "baz". Its merge <tt>O</tt> combines the strings from
1010 <tt>N</tt> and <tt>D</tt> to "foobarbaz"; i.e., it is not TREESAME to any parent.
1011 </p>
1012 </li>
1013 <li>
1015 <tt>E</tt> changes <tt>quux</tt> to "xyzzy", and its merge <tt>P</tt> combines the
1016 strings to "quux xyzzy". Despite appearing interesting, <tt>P</tt> is
1017 TREESAME to all parents.
1018 </p>
1019 </li>
1020 </ul></div>
1021 <div class="paragraph"><p><em>rev-list</em> walks backwards through history, including or excluding
1022 commits based on whether <em>--full-history</em> and/or parent rewriting
1023 (via <em>--parents</em> or <em>--children</em>) are used. The following settings
1024 are available.</p></div>
1025 <div class="dlist"><dl>
1026 <dt class="hdlist1">
1027 Default mode
1028 </dt>
1029 <dd>
1031 Commits are included if they are not TREESAME to any parent
1032 (though this can be changed, see <em>--sparse</em> below). If the
1033 commit was a merge, and it was TREESAME to one parent, follow
1034 only that parent. (Even if there are several TREESAME
1035 parents, follow only one of them.) Otherwise, follow all
1036 parents.
1037 </p>
1038 <div class="paragraph"><p>This results in:</p></div>
1039 <div class="listingblock">
1040 <div class="content">
1041 <pre><tt> .-A---N---O
1042 / / /
1043 I---------D</tt></pre>
1044 </div></div>
1045 <div class="paragraph"><p>Note how the rule to only follow the TREESAME parent, if one is
1046 available, removed <tt>B</tt> from consideration entirely. <tt>C</tt> was
1047 considered via <tt>N</tt>, but is TREESAME. Root commits are compared to an
1048 empty tree, so <tt>I</tt> is !TREESAME.</p></div>
1049 <div class="paragraph"><p>Parent/child relations are only visible with --parents, but that does
1050 not affect the commits selected in default mode, so we have shown the
1051 parent lines.</p></div>
1052 </dd>
1053 <dt class="hdlist1">
1054 --full-history without parent rewriting
1055 </dt>
1056 <dd>
1058 This mode differs from the default in one point: always follow
1059 all parents of a merge, even if it is TREESAME to one of them.
1060 Even if more than one side of the merge has commits that are
1061 included, this does not imply that the merge itself is! In
1062 the example, we get
1063 </p>
1064 <div class="listingblock">
1065 <div class="content">
1066 <pre><tt> I A B N D O</tt></pre>
1067 </div></div>
1068 <div class="paragraph"><p><tt>P</tt> and <tt>M</tt> were excluded because they are TREESAME to a parent. <tt>E</tt>,
1069 <tt>C</tt> and <tt>B</tt> were all walked, but only <tt>B</tt> was !TREESAME, so the others
1070 do not appear.</p></div>
1071 <div class="paragraph"><p>Note that without parent rewriting, it is not really possible to talk
1072 about the parent/child relationships between the commits, so we show
1073 them disconnected.</p></div>
1074 </dd>
1075 <dt class="hdlist1">
1076 --full-history with parent rewriting
1077 </dt>
1078 <dd>
1080 Ordinary commits are only included if they are !TREESAME
1081 (though this can be changed, see <em>--sparse</em> below).
1082 </p>
1083 <div class="paragraph"><p>Merges are always included. However, their parent list is rewritten:
1084 Along each parent, prune away commits that are not included
1085 themselves. This results in</p></div>
1086 <div class="listingblock">
1087 <div class="content">
1088 <pre><tt> .-A---M---N---O---P
1089 / / / / /
1090 I B / D /
1091 \ / / / /
1092 `-------------'</tt></pre>
1093 </div></div>
1094 <div class="paragraph"><p>Compare to <em>--full-history</em> without rewriting above. Note that <tt>E</tt>
1095 was pruned away because it is TREESAME, but the parent list of P was
1096 rewritten to contain <tt>E</tt>'s parent <tt>I</tt>. The same happened for <tt>C</tt> and
1097 <tt>N</tt>. Note also that <tt>P</tt> was included despite being TREESAME.</p></div>
1098 </dd>
1099 </dl></div>
1100 <div class="paragraph"><p>In addition to the above settings, you can change whether TREESAME
1101 affects inclusion:</p></div>
1102 <div class="dlist"><dl>
1103 <dt class="hdlist1">
1104 --dense
1105 </dt>
1106 <dd>
1108 Commits that are walked are included if they are not TREESAME
1109 to any parent.
1110 </p>
1111 </dd>
1112 <dt class="hdlist1">
1113 --sparse
1114 </dt>
1115 <dd>
1117 All commits that are walked are included.
1118 </p>
1119 <div class="paragraph"><p>Note that without <em>--full-history</em>, this still simplifies merges: if
1120 one of the parents is TREESAME, we follow only that one, so the other
1121 sides of the merge are never walked.</p></div>
1122 </dd>
1123 <dt class="hdlist1">
1124 --simplify-merges
1125 </dt>
1126 <dd>
1128 First, build a history graph in the same way that
1129 <em>--full-history</em> with parent rewriting does (see above).
1130 </p>
1131 <div class="paragraph"><p>Then simplify each commit &#8216;C` to its replacement <tt>C&#8217;</tt> in the final
1132 history according to the following rules:</p></div>
1133 <div class="ulist"><ul>
1134 <li>
1136 Set &#8216;C&#8217;` to <tt>C</tt>.
1137 </p>
1138 </li>
1139 <li>
1141 Replace each parent &#8216;P` of <tt>C&#8217;</tt> with its simplification &#8216;P&#8217;`. In
1142 the process, drop parents that are ancestors of other parents, and
1143 remove duplicates.
1144 </p>
1145 </li>
1146 <li>
1148 If after this parent rewriting, &#8216;C&#8217;` is a root or merge commit (has
1149 zero or &gt;1 parents), a boundary commit, or !TREESAME, it remains.
1150 Otherwise, it is replaced with its only parent.
1151 </p>
1152 </li>
1153 </ul></div>
1154 <div class="paragraph"><p>The effect of this is best shown by way of comparing to
1155 <em>--full-history</em> with parent rewriting. The example turns into:</p></div>
1156 <div class="listingblock">
1157 <div class="content">
1158 <pre><tt> .-A---M---N---O
1159 / / /
1160 I B D
1161 \ / /
1162 `---------'</tt></pre>
1163 </div></div>
1164 <div class="paragraph"><p>Note the major differences in <tt>N</tt> and <tt>P</tt> over <em>--full-history</em>:</p></div>
1165 <div class="ulist"><ul>
1166 <li>
1168 <tt>N</tt>'s parent list had <tt>I</tt> removed, because it is an ancestor of the
1169 other parent <tt>M</tt>. Still, <tt>N</tt> remained because it is !TREESAME.
1170 </p>
1171 </li>
1172 <li>
1174 <tt>P</tt>'s parent list similarly had <tt>I</tt> removed. <tt>P</tt> was then
1175 removed completely, because it had one parent and is TREESAME.
1176 </p>
1177 </li>
1178 </ul></div>
1179 </dd>
1180 </dl></div>
1181 <div class="paragraph"><p>Finally, there is a fifth simplification mode available:</p></div>
1182 <div class="dlist"><dl>
1183 <dt class="hdlist1">
1184 --ancestry-path
1185 </dt>
1186 <dd>
1188 Limit the displayed commits to those directly on the ancestry
1189 chain between the "from" and "to" commits in the given commit
1190 range. I.e. only display commits that are ancestor of the "to"
1191 commit, and descendants of the "from" commit.
1192 </p>
1193 <div class="paragraph"><p>As an example use case, consider the following commit history:</p></div>
1194 <div class="listingblock">
1195 <div class="content">
1196 <pre><tt> D---E-------F
1197 / \ \
1198 B---C---G---H---I---J
1200 A-------K---------------L--M</tt></pre>
1201 </div></div>
1202 <div class="paragraph"><p>A regular <em>D..M</em> computes the set of commits that are ancestors of <tt>M</tt>,
1203 but excludes the ones that are ancestors of <tt>D</tt>. This is useful to see
1204 what happened to the history leading to <tt>M</tt> since <tt>D</tt>, in the sense
1205 that "what does <tt>M</tt> have that did not exist in <tt>D</tt>". The result in this
1206 example would be all the commits, except <tt>A</tt> and <tt>B</tt> (and <tt>D</tt> itself,
1207 of course).</p></div>
1208 <div class="paragraph"><p>When we want to find out what commits in <tt>M</tt> are contaminated with the
1209 bug introduced by <tt>D</tt> and need fixing, however, we might want to view
1210 only the subset of <em>D..M</em> that are actually descendants of <tt>D</tt>, i.e.
1211 excluding <tt>C</tt> and <tt>K</tt>. This is exactly what the <em>--ancestry-path</em>
1212 option does. Applied to the <em>D..M</em> range, it results in:</p></div>
1213 <div class="listingblock">
1214 <div class="content">
1215 <pre><tt> E-------F
1217 G---H---I---J
1219 L--M</tt></pre>
1220 </div></div>
1221 </dd>
1222 </dl></div>
1223 <div class="paragraph"><p>The <em>--simplify-by-decoration</em> option allows you to view only the
1224 big picture of the topology of the history, by omitting commits
1225 that are not referenced by tags. Commits are marked as !TREESAME
1226 (in other words, kept after history simplification rules described
1227 above) if (1) they are referenced by tags, or (2) they change the
1228 contents of the paths given on the command line. All other
1229 commits are marked as TREESAME (subject to be simplified away).</p></div>
1230 <h3 id="_bisection_helpers">Bisection Helpers</h3><div style="clear:left"></div>
1231 <div class="dlist"><dl>
1232 <dt class="hdlist1">
1233 --bisect
1234 </dt>
1235 <dd>
1237 Limit output to the one commit object which is roughly halfway between
1238 included and excluded commits. Note that the bad bisection ref
1239 <tt>refs/bisect/bad</tt> is added to the included commits (if it
1240 exists) and the good bisection refs <tt>refs/bisect/good-*</tt> are
1241 added to the excluded commits (if they exist). Thus, supposing there
1242 are no refs in <tt>refs/bisect/</tt>, if
1243 </p>
1244 </dd>
1245 </dl></div>
1246 <div class="listingblock">
1247 <div class="content">
1248 <pre><tt> $ git rev-list --bisect foo ^bar ^baz</tt></pre>
1249 </div></div>
1250 <div class="paragraph"><p>outputs <em>midpoint</em>, the output of the two commands</p></div>
1251 <div class="listingblock">
1252 <div class="content">
1253 <pre><tt> $ git rev-list foo ^midpoint
1254 $ git rev-list midpoint ^bar ^baz</tt></pre>
1255 </div></div>
1256 <div class="paragraph"><p>would be of roughly the same length. Finding the change which
1257 introduces a regression is thus reduced to a binary search: repeatedly
1258 generate and test new 'midpoint&#8217;s until the commit chain is of length
1259 one.</p></div>
1260 <div class="dlist"><dl>
1261 <dt class="hdlist1">
1262 --bisect-vars
1263 </dt>
1264 <dd>
1266 This calculates the same as <tt>--bisect</tt>, except that refs in
1267 <tt>refs/bisect/</tt> are not used, and except that this outputs
1268 text ready to be eval&#8217;ed by the shell. These lines will assign the
1269 name of the midpoint revision to the variable <tt>bisect_rev</tt>, and the
1270 expected number of commits to be tested after <tt>bisect_rev</tt> is tested
1271 to <tt>bisect_nr</tt>, the expected number of commits to be tested if
1272 <tt>bisect_rev</tt> turns out to be good to <tt>bisect_good</tt>, the expected
1273 number of commits to be tested if <tt>bisect_rev</tt> turns out to be bad to
1274 <tt>bisect_bad</tt>, and the number of commits we are bisecting right now to
1275 <tt>bisect_all</tt>.
1276 </p>
1277 </dd>
1278 <dt class="hdlist1">
1279 --bisect-all
1280 </dt>
1281 <dd>
1283 This outputs all the commit objects between the included and excluded
1284 commits, ordered by their distance to the included and excluded
1285 commits. Refs in <tt>refs/bisect/</tt> are not used. The farthest
1286 from them is displayed first. (This is the only one displayed by
1287 <tt>--bisect</tt>.)
1288 </p>
1289 <div class="paragraph"><p>This is useful because it makes it easy to choose a good commit to
1290 test when you want to avoid to test some of them for some reason (they
1291 may not compile for example).</p></div>
1292 <div class="paragraph"><p>This option can be used along with <tt>--bisect-vars</tt>, in this case,
1293 after all the sorted commit objects, there will be the same text as if
1294 <tt>--bisect-vars</tt> had been used alone.</p></div>
1295 </dd>
1296 </dl></div>
1297 <h3 id="_commit_ordering">Commit Ordering</h3><div style="clear:left"></div>
1298 <div class="paragraph"><p>By default, the commits are shown in reverse chronological order.</p></div>
1299 <div class="dlist"><dl>
1300 <dt class="hdlist1">
1301 --topo-order
1302 </dt>
1303 <dd>
1305 This option makes them appear in topological order (i.e.
1306 descendant commits are shown before their parents).
1307 </p>
1308 </dd>
1309 <dt class="hdlist1">
1310 --date-order
1311 </dt>
1312 <dd>
1314 This option is similar to <em>--topo-order</em> in the sense that no
1315 parent comes before all of its children, but otherwise things
1316 are still ordered in the commit timestamp order.
1317 </p>
1318 </dd>
1319 <dt class="hdlist1">
1320 --reverse
1321 </dt>
1322 <dd>
1324 Output the commits in reverse order.
1325 Cannot be combined with <em>--walk-reflogs</em>.
1326 </p>
1327 </dd>
1328 </dl></div>
1329 <h3 id="_object_traversal">Object Traversal</h3><div style="clear:left"></div>
1330 <div class="paragraph"><p>These options are mostly targeted for packing of git repositories.</p></div>
1331 <div class="dlist"><dl>
1332 <dt class="hdlist1">
1333 --objects
1334 </dt>
1335 <dd>
1337 Print the object IDs of any object referenced by the listed
1338 commits. <em>--objects foo ^bar</em> thus means "send me
1339 all object IDs which I need to download if I have the commit
1340 object <em>bar</em>, but not <em>foo</em>".
1341 </p>
1342 </dd>
1343 <dt class="hdlist1">
1344 --objects-edge
1345 </dt>
1346 <dd>
1348 Similar to <em>--objects</em>, but also print the IDs of excluded
1349 commits prefixed with a "-" character. This is used by
1350 <a href="git-pack-objects.html">git-pack-objects(1)</a> to build "thin" pack, which records
1351 objects in deltified form based on objects contained in these
1352 excluded commits to reduce network traffic.
1353 </p>
1354 </dd>
1355 <dt class="hdlist1">
1356 --unpacked
1357 </dt>
1358 <dd>
1360 Only useful with <em>--objects</em>; print the object IDs that are not
1361 in packs.
1362 </p>
1363 </dd>
1364 <dt class="hdlist1">
1365 --no-walk
1366 </dt>
1367 <dd>
1369 Only show the given revs, but do not traverse their ancestors.
1370 </p>
1371 </dd>
1372 <dt class="hdlist1">
1373 --do-walk
1374 </dt>
1375 <dd>
1377 Overrides a previous --no-walk.
1378 </p>
1379 </dd>
1380 </dl></div>
1381 <h3 id="_commit_formatting">Commit Formatting</h3><div style="clear:left"></div>
1382 <div class="paragraph"><p>Using these options, <a href="git-rev-list.html">git-rev-list(1)</a> will act similar to the
1383 more specialized family of commit log tools: <a href="git-log.html">git-log(1)</a>,
1384 <a href="git-show.html">git-show(1)</a>, and <a href="git-whatchanged.html">git-whatchanged(1)</a></p></div>
1385 <div class="dlist"><dl>
1386 <dt class="hdlist1">
1387 --pretty[=&lt;format&gt;]
1388 </dt>
1389 <dt class="hdlist1">
1390 --format=&lt;format&gt;
1391 </dt>
1392 <dd>
1394 Pretty-print the contents of the commit logs in a given format,
1395 where <em>&lt;format&gt;</em> can be one of <em>oneline</em>, <em>short</em>, <em>medium</em>,
1396 <em>full</em>, <em>fuller</em>, <em>email</em>, <em>raw</em> and <em>format:&lt;string&gt;</em>. See
1397 the "PRETTY FORMATS" section for some additional details for each
1398 format. When omitted, the format defaults to <em>medium</em>.
1399 </p>
1400 <div class="paragraph"><p>Note: you can specify the default pretty format in the repository
1401 configuration (see <a href="git-config.html">git-config(1)</a>).</p></div>
1402 </dd>
1403 <dt class="hdlist1">
1404 --abbrev-commit
1405 </dt>
1406 <dd>
1408 Instead of showing the full 40-byte hexadecimal commit object
1409 name, show only a partial prefix. Non default number of
1410 digits can be specified with "--abbrev=&lt;n&gt;" (which also modifies
1411 diff output, if it is displayed).
1412 </p>
1413 <div class="paragraph"><p>This should make "--pretty=oneline" a whole lot more readable for
1414 people using 80-column terminals.</p></div>
1415 </dd>
1416 <dt class="hdlist1">
1417 --oneline
1418 </dt>
1419 <dd>
1421 This is a shorthand for "--pretty=oneline --abbrev-commit"
1422 used together.
1423 </p>
1424 </dd>
1425 <dt class="hdlist1">
1426 --encoding[=&lt;encoding&gt;]
1427 </dt>
1428 <dd>
1430 The commit objects record the encoding used for the log message
1431 in their encoding header; this option can be used to tell the
1432 command to re-code the commit log message in the encoding
1433 preferred by the user. For non plumbing commands this
1434 defaults to UTF-8.
1435 </p>
1436 </dd>
1437 <dt class="hdlist1">
1438 --notes[=&lt;ref&gt;]
1439 </dt>
1440 <dd>
1442 Show the notes (see <a href="git-notes.html">git-notes(1)</a>) that annotate the
1443 commit, when showing the commit log message. This is the default
1444 for <tt>git log</tt>, <tt>git show</tt> and <tt>git whatchanged</tt> commands when
1445 there is no <tt>--pretty</tt>, <tt>--format</tt> nor <tt>--oneline</tt> option given
1446 on the command line.
1447 </p>
1448 <div class="paragraph"><p>By default, the notes shown are from the notes refs listed in the
1449 <em>core.notesRef</em> and <em>notes.displayRef</em> variables (or corresponding
1450 environment overrides). See <a href="git-config.html">git-config(1)</a> for more details.</p></div>
1451 <div class="paragraph"><p>With an optional <em>&lt;ref&gt;</em> argument, show this notes ref instead of the
1452 default notes ref(s). The ref is taken to be in <tt>refs/notes/</tt> if it
1453 is not qualified.</p></div>
1454 <div class="paragraph"><p>Multiple --notes options can be combined to control which notes are
1455 being displayed. Examples: "--notes=foo" will show only notes from
1456 "refs/notes/foo"; "--notes=foo --notes" will show both notes from
1457 "refs/notes/foo" and from the default notes ref(s).</p></div>
1458 </dd>
1459 <dt class="hdlist1">
1460 --no-notes
1461 </dt>
1462 <dd>
1464 Do not show notes. This negates the above <tt>--notes</tt> option, by
1465 resetting the list of notes refs from which notes are shown.
1466 Options are parsed in the order given on the command line, so e.g.
1467 "--notes --notes=foo --no-notes --notes=bar" will only show notes
1468 from "refs/notes/bar".
1469 </p>
1470 </dd>
1471 <dt class="hdlist1">
1472 --show-notes[=&lt;ref&gt;]
1473 </dt>
1474 <dt class="hdlist1">
1475 --[no-]standard-notes
1476 </dt>
1477 <dd>
1479 These options are deprecated. Use the above --notes/--no-notes
1480 options instead.
1481 </p>
1482 </dd>
1483 <dt class="hdlist1">
1484 --relative-date
1485 </dt>
1486 <dd>
1488 Synonym for <tt>--date=relative</tt>.
1489 </p>
1490 </dd>
1491 <dt class="hdlist1">
1492 --date=(relative|local|default|iso|rfc|short|raw)
1493 </dt>
1494 <dd>
1496 Only takes effect for dates shown in human-readable format, such
1497 as when using "--pretty". <tt>log.date</tt> config variable sets a default
1498 value for log command&#8217;s --date option.
1499 </p>
1500 <div class="paragraph"><p><tt>--date=relative</tt> shows dates relative to the current time,
1501 e.g. "2 hours ago".</p></div>
1502 <div class="paragraph"><p><tt>--date=local</tt> shows timestamps in user&#8217;s local timezone.</p></div>
1503 <div class="paragraph"><p><tt>--date=iso</tt> (or <tt>--date=iso8601</tt>) shows timestamps in ISO 8601 format.</p></div>
1504 <div class="paragraph"><p><tt>--date=rfc</tt> (or <tt>--date=rfc2822</tt>) shows timestamps in RFC 2822
1505 format, often found in E-mail messages.</p></div>
1506 <div class="paragraph"><p><tt>--date=short</tt> shows only date but not time, in <tt>YYYY-MM-DD</tt> format.</p></div>
1507 <div class="paragraph"><p><tt>--date=raw</tt> shows the date in the internal raw git format <tt>%s %z</tt> format.</p></div>
1508 <div class="paragraph"><p><tt>--date=default</tt> shows timestamps in the original timezone
1509 (either committer&#8217;s or author&#8217;s).</p></div>
1510 </dd>
1511 <dt class="hdlist1">
1512 --header
1513 </dt>
1514 <dd>
1516 Print the contents of the commit in raw-format; each record is
1517 separated with a NUL character.
1518 </p>
1519 </dd>
1520 <dt class="hdlist1">
1521 --parents
1522 </dt>
1523 <dd>
1525 Print also the parents of the commit (in the form "commit parent&#8230;").
1526 Also enables parent rewriting, see <em>History Simplification</em> below.
1527 </p>
1528 </dd>
1529 <dt class="hdlist1">
1530 --children
1531 </dt>
1532 <dd>
1534 Print also the children of the commit (in the form "commit child&#8230;").
1535 Also enables parent rewriting, see <em>History Simplification</em> below.
1536 </p>
1537 </dd>
1538 <dt class="hdlist1">
1539 --timestamp
1540 </dt>
1541 <dd>
1543 Print the raw commit timestamp.
1544 </p>
1545 </dd>
1546 <dt class="hdlist1">
1547 --left-right
1548 </dt>
1549 <dd>
1551 Mark which side of a symmetric diff a commit is reachable from.
1552 Commits from the left side are prefixed with <tt>&lt;</tt> and those from
1553 the right with <tt>&gt;</tt>. If combined with <tt>--boundary</tt>, those
1554 commits are prefixed with <tt>-</tt>.
1555 </p>
1556 <div class="paragraph"><p>For example, if you have this topology:</p></div>
1557 <div class="listingblock">
1558 <div class="content">
1559 <pre><tt> y---b---b branch B
1560 / \ /
1562 / / \
1563 o---x---a---a branch A</tt></pre>
1564 </div></div>
1565 <div class="paragraph"><p>you would get an output like this:</p></div>
1566 <div class="listingblock">
1567 <div class="content">
1568 <pre><tt> $ git rev-list --left-right --boundary --pretty=oneline A...B
1570 &gt;bbbbbbb... 3rd on b
1571 &gt;bbbbbbb... 2nd on b
1572 &lt;aaaaaaa... 3rd on a
1573 &lt;aaaaaaa... 2nd on a
1574 -yyyyyyy... 1st on b
1575 -xxxxxxx... 1st on a</tt></pre>
1576 </div></div>
1577 </dd>
1578 <dt class="hdlist1">
1579 --graph
1580 </dt>
1581 <dd>
1583 Draw a text-based graphical representation of the commit history
1584 on the left hand side of the output. This may cause extra lines
1585 to be printed in between commits, in order for the graph history
1586 to be drawn properly.
1587 </p>
1588 <div class="paragraph"><p>This enables parent rewriting, see <em>History Simplification</em> below.</p></div>
1589 <div class="paragraph"><p>This implies the <em>--topo-order</em> option by default, but the
1590 <em>--date-order</em> option may also be specified.</p></div>
1591 </dd>
1592 <dt class="hdlist1">
1593 --count
1594 </dt>
1595 <dd>
1597 Print a number stating how many commits would have been
1598 listed, and suppress all other output. When used together
1599 with <em>--left-right</em>, instead print the counts for left and
1600 right commits, separated by a tab.
1601 </p>
1602 </dd>
1603 </dl></div>
1604 </div>
1605 <h2 id="_pretty_formats">PRETTY FORMATS</h2>
1606 <div class="sectionbody">
1607 <div class="paragraph"><p>If the commit is a merge, and if the pretty-format
1608 is not <em>oneline</em>, <em>email</em> or <em>raw</em>, an additional line is
1609 inserted before the <em>Author:</em> line. This line begins with
1610 "Merge: " and the sha1s of ancestral commits are printed,
1611 separated by spaces. Note that the listed commits may not
1612 necessarily be the list of the <strong>direct</strong> parent commits if you
1613 have limited your view of history: for example, if you are
1614 only interested in changes related to a certain directory or
1615 file.</p></div>
1616 <div class="paragraph"><p>There are several built-in formats, and you can define
1617 additional formats by setting a pretty.&lt;name&gt;
1618 config option to either another format name, or a
1619 <em>format:</em> string, as described below (see
1620 <a href="git-config.html">git-config(1)</a>). Here are the details of the
1621 built-in formats:</p></div>
1622 <div class="ulist"><ul>
1623 <li>
1625 <em>oneline</em>
1626 </p>
1627 <div class="literalblock">
1628 <div class="content">
1629 <pre><tt>&lt;sha1&gt; &lt;title line&gt;</tt></pre>
1630 </div></div>
1631 <div class="paragraph"><p>This is designed to be as compact as possible.</p></div>
1632 </li>
1633 <li>
1635 <em>short</em>
1636 </p>
1637 <div class="literalblock">
1638 <div class="content">
1639 <pre><tt>commit &lt;sha1&gt;
1640 Author: &lt;author&gt;</tt></pre>
1641 </div></div>
1642 <div class="literalblock">
1643 <div class="content">
1644 <pre><tt>&lt;title line&gt;</tt></pre>
1645 </div></div>
1646 </li>
1647 <li>
1649 <em>medium</em>
1650 </p>
1651 <div class="literalblock">
1652 <div class="content">
1653 <pre><tt>commit &lt;sha1&gt;
1654 Author: &lt;author&gt;
1655 Date: &lt;author date&gt;</tt></pre>
1656 </div></div>
1657 <div class="literalblock">
1658 <div class="content">
1659 <pre><tt>&lt;title line&gt;</tt></pre>
1660 </div></div>
1661 <div class="literalblock">
1662 <div class="content">
1663 <pre><tt>&lt;full commit message&gt;</tt></pre>
1664 </div></div>
1665 </li>
1666 <li>
1668 <em>full</em>
1669 </p>
1670 <div class="literalblock">
1671 <div class="content">
1672 <pre><tt>commit &lt;sha1&gt;
1673 Author: &lt;author&gt;
1674 Commit: &lt;committer&gt;</tt></pre>
1675 </div></div>
1676 <div class="literalblock">
1677 <div class="content">
1678 <pre><tt>&lt;title line&gt;</tt></pre>
1679 </div></div>
1680 <div class="literalblock">
1681 <div class="content">
1682 <pre><tt>&lt;full commit message&gt;</tt></pre>
1683 </div></div>
1684 </li>
1685 <li>
1687 <em>fuller</em>
1688 </p>
1689 <div class="literalblock">
1690 <div class="content">
1691 <pre><tt>commit &lt;sha1&gt;
1692 Author: &lt;author&gt;
1693 AuthorDate: &lt;author date&gt;
1694 Commit: &lt;committer&gt;
1695 CommitDate: &lt;committer date&gt;</tt></pre>
1696 </div></div>
1697 <div class="literalblock">
1698 <div class="content">
1699 <pre><tt>&lt;title line&gt;</tt></pre>
1700 </div></div>
1701 <div class="literalblock">
1702 <div class="content">
1703 <pre><tt>&lt;full commit message&gt;</tt></pre>
1704 </div></div>
1705 </li>
1706 <li>
1708 <em>email</em>
1709 </p>
1710 <div class="literalblock">
1711 <div class="content">
1712 <pre><tt>From &lt;sha1&gt; &lt;date&gt;
1713 From: &lt;author&gt;
1714 Date: &lt;author date&gt;
1715 Subject: [PATCH] &lt;title line&gt;</tt></pre>
1716 </div></div>
1717 <div class="literalblock">
1718 <div class="content">
1719 <pre><tt>&lt;full commit message&gt;</tt></pre>
1720 </div></div>
1721 </li>
1722 <li>
1724 <em>raw</em>
1725 </p>
1726 <div class="paragraph"><p>The <em>raw</em> format shows the entire commit exactly as
1727 stored in the commit object. Notably, the SHA1s are
1728 displayed in full, regardless of whether --abbrev or
1729 --no-abbrev are used, and <em>parents</em> information show the
1730 true parent commits, without taking grafts nor history
1731 simplification into account.</p></div>
1732 </li>
1733 <li>
1735 <em>format:&lt;string&gt;</em>
1736 </p>
1737 <div class="paragraph"><p>The <em>format:&lt;string&gt;</em> format allows you to specify which information
1738 you want to show. It works a little bit like printf format,
1739 with the notable exception that you get a newline with <em>%n</em>
1740 instead of <em>\n</em>.</p></div>
1741 <div class="paragraph"><p>E.g, <em>format:"The author of %h was %an, %ar%nThe title was &gt;&gt;%s&lt;&lt;%n"</em>
1742 would show something like this:</p></div>
1743 <div class="listingblock">
1744 <div class="content">
1745 <pre><tt>The author of fe6e0ee was Junio C Hamano, 23 hours ago
1746 The title was &gt;&gt;t4119: test autocomputing -p&lt;n&gt; for traditional diff input.&lt;&lt;</tt></pre>
1747 </div></div>
1748 <div class="paragraph"><p>The placeholders are:</p></div>
1749 <div class="ulist"><ul>
1750 <li>
1752 <em>%H</em>: commit hash
1753 </p>
1754 </li>
1755 <li>
1757 <em>%h</em>: abbreviated commit hash
1758 </p>
1759 </li>
1760 <li>
1762 <em>%T</em>: tree hash
1763 </p>
1764 </li>
1765 <li>
1767 <em>%t</em>: abbreviated tree hash
1768 </p>
1769 </li>
1770 <li>
1772 <em>%P</em>: parent hashes
1773 </p>
1774 </li>
1775 <li>
1777 <em>%p</em>: abbreviated parent hashes
1778 </p>
1779 </li>
1780 <li>
1782 <em>%an</em>: author name
1783 </p>
1784 </li>
1785 <li>
1787 <em>%aN</em>: author name (respecting .mailmap, see <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)
1788 </p>
1789 </li>
1790 <li>
1792 <em>%ae</em>: author email
1793 </p>
1794 </li>
1795 <li>
1797 <em>%aE</em>: author email (respecting .mailmap, see <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)
1798 </p>
1799 </li>
1800 <li>
1802 <em>%ad</em>: author date (format respects --date= option)
1803 </p>
1804 </li>
1805 <li>
1807 <em>%aD</em>: author date, RFC2822 style
1808 </p>
1809 </li>
1810 <li>
1812 <em>%ar</em>: author date, relative
1813 </p>
1814 </li>
1815 <li>
1817 <em>%at</em>: author date, UNIX timestamp
1818 </p>
1819 </li>
1820 <li>
1822 <em>%ai</em>: author date, ISO 8601 format
1823 </p>
1824 </li>
1825 <li>
1827 <em>%cn</em>: committer name
1828 </p>
1829 </li>
1830 <li>
1832 <em>%cN</em>: committer name (respecting .mailmap, see <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)
1833 </p>
1834 </li>
1835 <li>
1837 <em>%ce</em>: committer email
1838 </p>
1839 </li>
1840 <li>
1842 <em>%cE</em>: committer email (respecting .mailmap, see <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)
1843 </p>
1844 </li>
1845 <li>
1847 <em>%cd</em>: committer date
1848 </p>
1849 </li>
1850 <li>
1852 <em>%cD</em>: committer date, RFC2822 style
1853 </p>
1854 </li>
1855 <li>
1857 <em>%cr</em>: committer date, relative
1858 </p>
1859 </li>
1860 <li>
1862 <em>%ct</em>: committer date, UNIX timestamp
1863 </p>
1864 </li>
1865 <li>
1867 <em>%ci</em>: committer date, ISO 8601 format
1868 </p>
1869 </li>
1870 <li>
1872 <em>%d</em>: ref names, like the --decorate option of <a href="git-log.html">git-log(1)</a>
1873 </p>
1874 </li>
1875 <li>
1877 <em>%e</em>: encoding
1878 </p>
1879 </li>
1880 <li>
1882 <em>%s</em>: subject
1883 </p>
1884 </li>
1885 <li>
1887 <em>%f</em>: sanitized subject line, suitable for a filename
1888 </p>
1889 </li>
1890 <li>
1892 <em>%b</em>: body
1893 </p>
1894 </li>
1895 <li>
1897 <em>%B</em>: raw body (unwrapped subject and body)
1898 </p>
1899 </li>
1900 <li>
1902 <em>%N</em>: commit notes
1903 </p>
1904 </li>
1905 <li>
1907 <em>%gD</em>: reflog selector, e.g., <tt>refs/stash@{1}</tt>
1908 </p>
1909 </li>
1910 <li>
1912 <em>%gd</em>: shortened reflog selector, e.g., <tt>stash@{1}</tt>
1913 </p>
1914 </li>
1915 <li>
1917 <em>%gs</em>: reflog subject
1918 </p>
1919 </li>
1920 <li>
1922 <em>%Cred</em>: switch color to red
1923 </p>
1924 </li>
1925 <li>
1927 <em>%Cgreen</em>: switch color to green
1928 </p>
1929 </li>
1930 <li>
1932 <em>%Cblue</em>: switch color to blue
1933 </p>
1934 </li>
1935 <li>
1937 <em>%Creset</em>: reset color
1938 </p>
1939 </li>
1940 <li>
1942 <em>%C(&#8230;)</em>: color specification, as described in color.branch.* config option
1943 </p>
1944 </li>
1945 <li>
1947 <em>%m</em>: left, right or boundary mark
1948 </p>
1949 </li>
1950 <li>
1952 <em>%n</em>: newline
1953 </p>
1954 </li>
1955 <li>
1957 <em>%%</em>: a raw <em>%</em>
1958 </p>
1959 </li>
1960 <li>
1962 <em>%x00</em>: print a byte from a hex code
1963 </p>
1964 </li>
1965 <li>
1967 <em>%w([&lt;w&gt;[,&lt;i1&gt;[,&lt;i2&gt;]]])</em>: switch line wrapping, like the -w option of
1968 <a href="git-shortlog.html">git-shortlog(1)</a>.
1969 </p>
1970 </li>
1971 </ul></div>
1972 </li>
1973 </ul></div>
1974 <div class="admonitionblock">
1975 <table><tr>
1976 <td class="icon">
1977 <div class="title">Note</div>
1978 </td>
1979 <td class="content">Some placeholders may depend on other options given to the
1980 revision traversal engine. For example, the <tt>%g*</tt> reflog options will
1981 insert an empty string unless we are traversing reflog entries (e.g., by
1982 <tt>git log -g</tt>). The <tt>%d</tt> placeholder will use the "short" decoration
1983 format if <tt>--decorate</tt> was not already provided on the command line.</td>
1984 </tr></table>
1985 </div>
1986 <div class="paragraph"><p>If you add a <tt>&#43;</tt> (plus sign) after <em>%</em> of a placeholder, a line-feed
1987 is inserted immediately before the expansion if and only if the
1988 placeholder expands to a non-empty string.</p></div>
1989 <div class="paragraph"><p>If you add a <tt>-</tt> (minus sign) after <em>%</em> of a placeholder, line-feeds that
1990 immediately precede the expansion are deleted if and only if the
1991 placeholder expands to an empty string.</p></div>
1992 <div class="paragraph"><p>If you add a ` ` (space) after <em>%</em> of a placeholder, a space
1993 is inserted immediately before the expansion if and only if the
1994 placeholder expands to a non-empty string.</p></div>
1995 <div class="ulist"><ul>
1996 <li>
1998 <em>tformat:</em>
1999 </p>
2000 <div class="paragraph"><p>The <em>tformat:</em> format works exactly like <em>format:</em>, except that it
2001 provides "terminator" semantics instead of "separator" semantics. In
2002 other words, each commit has the message terminator character (usually a
2003 newline) appended, rather than a separator placed between entries.
2004 This means that the final entry of a single-line format will be properly
2005 terminated with a new line, just as the "oneline" format does.
2006 For example:</p></div>
2007 <div class="listingblock">
2008 <div class="content">
2009 <pre><tt>$ git log -2 --pretty=format:%h 4da45bef \
2010 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
2011 4da45be
2012 7134973 -- NO NEWLINE
2014 $ git log -2 --pretty=tformat:%h 4da45bef \
2015 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
2016 4da45be
2017 7134973</tt></pre>
2018 </div></div>
2019 <div class="paragraph"><p>In addition, any unrecognized string that has a <tt>%</tt> in it is interpreted
2020 as if it has <tt>tformat:</tt> in front of it. For example, these two are
2021 equivalent:</p></div>
2022 <div class="listingblock">
2023 <div class="content">
2024 <pre><tt>$ git log -2 --pretty=tformat:%h 4da45bef
2025 $ git log -2 --pretty=%h 4da45bef</tt></pre>
2026 </div></div>
2027 </li>
2028 </ul></div>
2029 </div>
2030 <h2 id="_git">GIT</h2>
2031 <div class="sectionbody">
2032 <div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
2033 </div>
2034 <div id="footer">
2035 <div id="footer-text">
2036 Last updated 2011-03-27 07:10:12 UTC
2037 </div>
2038 </div>
2039 </body>
2040 </html>