Autogenerated HTML docs for v1.7.6-rc1
[git/jnareb-git.git] / git-rev-list.html
blobfe647b368c7868273092f4e82066b67f1e70dfc3
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 [ --ignore-missing ]
439 [ --stdin ]
440 [ --quiet ]
441 [ --topo-order ]
442 [ --parents ]
443 [ --timestamp ]
444 [ --left-right ]
445 [ --left-only ]
446 [ --right-only ]
447 [ --cherry-mark ]
448 [ --cherry-pick ]
449 [ --encoding[=&lt;encoding&gt;] ]
450 [ --(author|committer|grep)=&lt;pattern&gt; ]
451 [ --regexp-ignore-case | -i ]
452 [ --extended-regexp | -E ]
453 [ --fixed-strings | -F ]
454 [ --date=(local|relative|default|iso|rfc|short) ]
455 [ [--objects | --objects-edge] [ --unpacked ] ]
456 [ --pretty | --header ]
457 [ --bisect ]
458 [ --bisect-vars ]
459 [ --bisect-all ]
460 [ --merge ]
461 [ --reverse ]
462 [ --walk-reflogs ]
463 [ --no-walk ] [ --do-walk ]
464 &lt;commit&gt;&#8230; [ -- &lt;paths&gt;&#8230; ]</div>
465 <div class="verseblock-attribution">
466 </div></div>
467 </div>
468 <h2 id="_description">DESCRIPTION</h2>
469 <div class="sectionbody">
470 <div class="paragraph"><p>List commits that are reachable by following the <tt>parent</tt> links from the
471 given commit(s), but exclude commits that are reachable from the one(s)
472 given with a <em>&#94;</em> in front of them. The output is given in reverse
473 chronological order by default.</p></div>
474 <div class="paragraph"><p>You can think of this as a set operation. Commits given on the command
475 line form a set of commits that are reachable from any of them, and then
476 commits reachable from any of the ones given with <em>&#94;</em> in front are
477 subtracted from that set. The remaining commits are what comes out in the
478 command&#8217;s output. Various other options and paths parameters can be used
479 to further limit the result.</p></div>
480 <div class="paragraph"><p>Thus, the following command:</p></div>
481 <div class="listingblock">
482 <div class="content">
483 <pre><tt> $ git rev-list foo bar ^baz</tt></pre>
484 </div></div>
485 <div class="paragraph"><p>means "list all the commits which are reachable from <em>foo</em> or <em>bar</em>, but
486 not from <em>baz</em>".</p></div>
487 <div class="paragraph"><p>A special notation "<em>&lt;commit1&gt;</em>..<em>&lt;commit2&gt;</em>" can be used as a
488 short-hand for "&#94;<em>&lt;commit1&gt;</em> <em>&lt;commit2&gt;</em>". For example, either of
489 the following may be used interchangeably:</p></div>
490 <div class="listingblock">
491 <div class="content">
492 <pre><tt> $ git rev-list origin..HEAD
493 $ git rev-list HEAD ^origin</tt></pre>
494 </div></div>
495 <div class="paragraph"><p>Another special notation is "<em>&lt;commit1&gt;</em>&#8230;<em>&lt;commit2&gt;</em>" which is useful
496 for merges. The resulting set of commits is the symmetric difference
497 between the two operands. The following two commands are equivalent:</p></div>
498 <div class="listingblock">
499 <div class="content">
500 <pre><tt> $ git rev-list A B --not $(git merge-base --all A B)
501 $ git rev-list A...B</tt></pre>
502 </div></div>
503 <div class="paragraph"><p><em>rev-list</em> is a very essential git command, since it
504 provides the ability to build and traverse commit ancestry graphs. For
505 this reason, it has a lot of different options that enables it to be
506 used by commands as different as <em>git bisect</em> and
507 <em>git repack</em>.</p></div>
508 </div>
509 <h2 id="_options">OPTIONS</h2>
510 <div class="sectionbody">
511 <h3 id="_commit_limiting">Commit Limiting</h3><div style="clear:left"></div>
512 <div class="paragraph"><p>Besides specifying a range of commits that should be listed using the
513 special notations explained in the description, additional commit
514 limiting may be applied. Note that they are applied before commit
515 ordering and formatting options, such as <em>--reverse</em>.</p></div>
516 <div class="dlist"><dl>
517 <dt class="hdlist1">
518 -n <em>number</em>
519 </dt>
520 <dt class="hdlist1">
521 --max-count=&lt;number&gt;
522 </dt>
523 <dd>
525 Limit the number of commits to output.
526 </p>
527 </dd>
528 <dt class="hdlist1">
529 --skip=&lt;number&gt;
530 </dt>
531 <dd>
533 Skip <em>number</em> commits before starting to show the commit output.
534 </p>
535 </dd>
536 <dt class="hdlist1">
537 --since=&lt;date&gt;
538 </dt>
539 <dt class="hdlist1">
540 --after=&lt;date&gt;
541 </dt>
542 <dd>
544 Show commits more recent than a specific date.
545 </p>
546 </dd>
547 <dt class="hdlist1">
548 --until=&lt;date&gt;
549 </dt>
550 <dt class="hdlist1">
551 --before=&lt;date&gt;
552 </dt>
553 <dd>
555 Show commits older than a specific date.
556 </p>
557 </dd>
558 <dt class="hdlist1">
559 --max-age=&lt;timestamp&gt;
560 </dt>
561 <dt class="hdlist1">
562 --min-age=&lt;timestamp&gt;
563 </dt>
564 <dd>
566 Limit the commits output to specified time range.
567 </p>
568 </dd>
569 <dt class="hdlist1">
570 --author=&lt;pattern&gt;
571 </dt>
572 <dt class="hdlist1">
573 --committer=&lt;pattern&gt;
574 </dt>
575 <dd>
577 Limit the commits output to ones with author/committer
578 header lines that match the specified pattern (regular expression).
579 </p>
580 </dd>
581 <dt class="hdlist1">
582 --grep=&lt;pattern&gt;
583 </dt>
584 <dd>
586 Limit the commits output to ones with log message that
587 matches the specified pattern (regular expression).
588 </p>
589 </dd>
590 <dt class="hdlist1">
591 --all-match
592 </dt>
593 <dd>
595 Limit the commits output to ones that match all given --grep,
596 --author and --committer instead of ones that match at least one.
597 </p>
598 </dd>
599 <dt class="hdlist1">
601 </dt>
602 <dt class="hdlist1">
603 --regexp-ignore-case
604 </dt>
605 <dd>
607 Match the regexp limiting patterns without regard to letters case.
608 </p>
609 </dd>
610 <dt class="hdlist1">
612 </dt>
613 <dt class="hdlist1">
614 --extended-regexp
615 </dt>
616 <dd>
618 Consider the limiting patterns to be extended regular expressions
619 instead of the default basic regular expressions.
620 </p>
621 </dd>
622 <dt class="hdlist1">
624 </dt>
625 <dt class="hdlist1">
626 --fixed-strings
627 </dt>
628 <dd>
630 Consider the limiting patterns to be fixed strings (don&#8217;t interpret
631 pattern as a regular expression).
632 </p>
633 </dd>
634 <dt class="hdlist1">
635 --remove-empty
636 </dt>
637 <dd>
639 Stop when a given path disappears from the tree.
640 </p>
641 </dd>
642 <dt class="hdlist1">
643 --merges
644 </dt>
645 <dd>
647 Print only merge commits. This is exactly the same as <tt>--min-parents=2</tt>.
648 </p>
649 </dd>
650 <dt class="hdlist1">
651 --no-merges
652 </dt>
653 <dd>
655 Do not print commits with more than one parent. This is
656 exactly the same as <tt>--max-parents=1</tt>.
657 </p>
658 </dd>
659 <dt class="hdlist1">
660 --min-parents=&lt;number&gt;
661 </dt>
662 <dt class="hdlist1">
663 --max-parents=&lt;number&gt;
664 </dt>
665 <dt class="hdlist1">
666 --no-min-parents
667 </dt>
668 <dt class="hdlist1">
669 --no-max-parents
670 </dt>
671 <dd>
673 Show only commits which have at least (or at most) that many
674 commits. In particular, <tt>--max-parents=1</tt> is the same as <tt>--no-merges</tt>,
675 <tt>--min-parents=2</tt> is the same as <tt>--merges</tt>. <tt>--max-parents=0</tt>
676 gives all root commits and <tt>--min-parents=3</tt> all octopus merges.
677 </p>
678 <div class="paragraph"><p><tt>--no-min-parents</tt> and <tt>--no-max-parents</tt> reset these limits (to no limit)
679 again. Equivalent forms are <tt>--min-parents=0</tt> (any commit has 0 or more
680 parents) and <tt>--max-parents=-1</tt> (negative numbers denote no upper limit).</p></div>
681 </dd>
682 <dt class="hdlist1">
683 --first-parent
684 </dt>
685 <dd>
687 Follow only the first parent commit upon seeing a merge
688 commit. This option can give a better overview when
689 viewing the evolution of a particular topic branch,
690 because merges into a topic branch tend to be only about
691 adjusting to updated upstream from time to time, and
692 this option allows you to ignore the individual commits
693 brought in to your history by such a merge.
694 </p>
695 </dd>
696 <dt class="hdlist1">
697 --not
698 </dt>
699 <dd>
701 Reverses the meaning of the <em>&#94;</em> prefix (or lack thereof)
702 for all following revision specifiers, up to the next <em>--not</em>.
703 </p>
704 </dd>
705 <dt class="hdlist1">
706 --all
707 </dt>
708 <dd>
710 Pretend as if all the refs in <tt>refs/</tt> are listed on the
711 command line as <em>&lt;commit&gt;</em>.
712 </p>
713 </dd>
714 <dt class="hdlist1">
715 --branches[=&lt;pattern&gt;]
716 </dt>
717 <dd>
719 Pretend as if all the refs in <tt>refs/heads</tt> are listed
720 on the command line as <em>&lt;commit&gt;</em>. If <em>&lt;pattern&gt;</em> is given, limit
721 branches to ones matching given shell glob. If pattern lacks <em>?</em>,
722 <em><strong></em>, or <em>[</em>, <em>/</strong></em> at the end is implied.
723 </p>
724 </dd>
725 <dt class="hdlist1">
726 --tags[=&lt;pattern&gt;]
727 </dt>
728 <dd>
730 Pretend as if all the refs in <tt>refs/tags</tt> are listed
731 on the command line as <em>&lt;commit&gt;</em>. If <em>&lt;pattern&gt;</em> is given, limit
732 tags to ones matching given shell glob. If pattern lacks <em>?</em>, <em><strong></em>,
733 or <em>[</em>, <em>/</strong></em> at the end is implied.
734 </p>
735 </dd>
736 <dt class="hdlist1">
737 --remotes[=&lt;pattern&gt;]
738 </dt>
739 <dd>
741 Pretend as if all the refs in <tt>refs/remotes</tt> are listed
742 on the command line as <em>&lt;commit&gt;</em>. If <em>&lt;pattern&gt;</em> is given, limit
743 remote-tracking branches to ones matching given shell glob.
744 If pattern lacks <em>?</em>, <em><strong></em>, or <em>[</em>, <em>/</strong></em> at the end is implied.
745 </p>
746 </dd>
747 <dt class="hdlist1">
748 --glob=&lt;glob-pattern&gt;
749 </dt>
750 <dd>
752 Pretend as if all the refs matching shell glob <em>&lt;glob-pattern&gt;</em>
753 are listed on the command line as <em>&lt;commit&gt;</em>. Leading <em>refs/</em>,
754 is automatically prepended if missing. If pattern lacks <em>?</em>, <em><strong></em>,
755 or <em>[</em>, <em>/</strong></em> at the end is implied.
756 </p>
757 </dd>
758 <dt class="hdlist1">
759 --ignore-missing
760 </dt>
761 <dd>
763 Upon seeing an invalid object name in the input, pretend as if
764 the bad input was not given.
765 </p>
766 </dd>
767 <dt class="hdlist1">
768 --stdin
769 </dt>
770 <dd>
772 In addition to the <em>&lt;commit&gt;</em> listed on the command
773 line, read them from the standard input. If a <em>--</em> separator is
774 seen, stop reading commits and start reading paths to limit the
775 result.
776 </p>
777 </dd>
778 <dt class="hdlist1">
779 --quiet
780 </dt>
781 <dd>
783 Don&#8217;t print anything to standard output. This form
784 is primarily meant to allow the caller to
785 test the exit status to see if a range of objects is fully
786 connected (or not). It is faster than redirecting stdout
787 to /dev/null as the output does not have to be formatted.
788 </p>
789 </dd>
790 <dt class="hdlist1">
791 --cherry-mark
792 </dt>
793 <dd>
795 Like <tt>--cherry-pick</tt> (see below) but mark equivalent commits
796 with <tt>=</tt> rather than omitting them, and inequivalent ones with <tt>+</tt>.
797 </p>
798 </dd>
799 <dt class="hdlist1">
800 --cherry-pick
801 </dt>
802 <dd>
804 Omit any commit that introduces the same change as
805 another commit on the "other side" when the set of
806 commits are limited with symmetric difference.
807 </p>
808 <div class="paragraph"><p>For example, if you have two branches, <tt>A</tt> and <tt>B</tt>, a usual way
809 to list all commits on only one side of them is with
810 <tt>--left-right</tt> (see the example below in the description of
811 the <tt>--left-right</tt> option). It however shows the commits that were cherry-picked
812 from the other branch (for example, "3rd on b" may be cherry-picked
813 from branch A). With this option, such pairs of commits are
814 excluded from the output.</p></div>
815 </dd>
816 <dt class="hdlist1">
817 --left-only
818 </dt>
819 <dt class="hdlist1">
820 --right-only
821 </dt>
822 <dd>
824 List only commits on the respective side of a symmetric range,
825 i.e. only those which would be marked <tt>&lt;</tt> resp. <tt>&gt;</tt> by
826 <tt>--left-right</tt>.
827 </p>
828 <div class="paragraph"><p>For example, <tt>--cherry-pick --right-only A&#8230;B</tt> omits those
829 commits from <tt>B</tt> which are in <tt>A</tt> or are patch-equivalent to a commit in
830 <tt>A</tt>. In other words, this lists the <tt>&#43;</tt> commits from <tt>git cherry A B</tt>.
831 More precisely, <tt>--cherry-pick --right-only --no-merges</tt> gives the exact
832 list.</p></div>
833 </dd>
834 <dt class="hdlist1">
835 --cherry
836 </dt>
837 <dd>
839 A synonym for <tt>--right-only --cherry-mark --no-merges</tt>; useful to
840 limit the output to the commits on our side and mark those that
841 have been applied to the other side of a forked history with
842 <tt>git log --cherry upstream&#8230;mybranch</tt>, similar to
843 <tt>git cherry upstream mybranch</tt>.
844 </p>
845 </dd>
846 <dt class="hdlist1">
848 </dt>
849 <dt class="hdlist1">
850 --walk-reflogs
851 </dt>
852 <dd>
854 Instead of walking the commit ancestry chain, walk
855 reflog entries from the most recent one to older ones.
856 When this option is used you cannot specify commits to
857 exclude (that is, <em>&#94;commit</em>, <em>commit1..commit2</em>,
858 nor <em>commit1...commit2</em> notations cannot be used).
859 </p>
860 <div class="paragraph"><p>With <em>--pretty</em> format other than oneline (for obvious reasons),
861 this causes the output to have two extra lines of information
862 taken from the reflog. By default, <em>commit@{Nth}</em> notation is
863 used in the output. When the starting commit is specified as
864 <em>commit@{now}</em>, output also uses <em>commit@{timestamp}</em> notation
865 instead. Under <em>--pretty=oneline</em>, the commit message is
866 prefixed with this information on the same line.
867 This option cannot be combined with <em>--reverse</em>.
868 See also <a href="git-reflog.html">git-reflog(1)</a>.</p></div>
869 </dd>
870 <dt class="hdlist1">
871 --merge
872 </dt>
873 <dd>
875 After a failed merge, show refs that touch files having a
876 conflict and don&#8217;t exist on all heads to merge.
877 </p>
878 </dd>
879 <dt class="hdlist1">
880 --boundary
881 </dt>
882 <dd>
884 Output uninteresting commits at the boundary, which are usually
885 not shown.
886 </p>
887 </dd>
888 </dl></div>
889 <h3 id="_history_simplification">History Simplification</h3><div style="clear:left"></div>
890 <div class="paragraph"><p>Sometimes you are only interested in parts of the history, for example the
891 commits modifying a particular &lt;path&gt;. But there are two parts of
892 <em>History Simplification</em>, one part is selecting the commits and the other
893 is how to do it, as there are various strategies to simplify the history.</p></div>
894 <div class="paragraph"><p>The following options select the commits to be shown:</p></div>
895 <div class="dlist"><dl>
896 <dt class="hdlist1">
897 &lt;paths&gt;
898 </dt>
899 <dd>
901 Commits modifying the given &lt;paths&gt; are selected.
902 </p>
903 </dd>
904 <dt class="hdlist1">
905 --simplify-by-decoration
906 </dt>
907 <dd>
909 Commits that are referred by some branch or tag are selected.
910 </p>
911 </dd>
912 </dl></div>
913 <div class="paragraph"><p>Note that extra commits can be shown to give a meaningful history.</p></div>
914 <div class="paragraph"><p>The following options affect the way the simplification is performed:</p></div>
915 <div class="dlist"><dl>
916 <dt class="hdlist1">
917 Default mode
918 </dt>
919 <dd>
921 Simplifies the history to the simplest history explaining the
922 final state of the tree. Simplest because it prunes some side
923 branches if the end result is the same (i.e. merging branches
924 with the same content)
925 </p>
926 </dd>
927 <dt class="hdlist1">
928 --full-history
929 </dt>
930 <dd>
932 As the default mode but does not prune some history.
933 </p>
934 </dd>
935 <dt class="hdlist1">
936 --dense
937 </dt>
938 <dd>
940 Only the selected commits are shown, plus some to have a
941 meaningful history.
942 </p>
943 </dd>
944 <dt class="hdlist1">
945 --sparse
946 </dt>
947 <dd>
949 All commits in the simplified history are shown.
950 </p>
951 </dd>
952 <dt class="hdlist1">
953 --simplify-merges
954 </dt>
955 <dd>
957 Additional option to <em>--full-history</em> to remove some needless
958 merges from the resulting history, as there are no selected
959 commits contributing to this merge.
960 </p>
961 </dd>
962 <dt class="hdlist1">
963 --ancestry-path
964 </dt>
965 <dd>
967 When given a range of commits to display (e.g. <em>commit1..commit2</em>
968 or <em>commit2 &#94;commit1</em>), only display commits that exist
969 directly on the ancestry chain between the <em>commit1</em> and
970 <em>commit2</em>, i.e. commits that are both descendants of <em>commit1</em>,
971 and ancestors of <em>commit2</em>.
972 </p>
973 </dd>
974 </dl></div>
975 <div class="paragraph"><p>A more detailed explanation follows.</p></div>
976 <div class="paragraph"><p>Suppose you specified <tt>foo</tt> as the &lt;paths&gt;. We shall call commits
977 that modify <tt>foo</tt> !TREESAME, and the rest TREESAME. (In a diff
978 filtered for <tt>foo</tt>, they look different and equal, respectively.)</p></div>
979 <div class="paragraph"><p>In the following, we will always refer to the same example history to
980 illustrate the differences between simplification settings. We assume
981 that you are filtering for a file <tt>foo</tt> in this commit graph:</p></div>
982 <div class="listingblock">
983 <div class="content">
984 <pre><tt> .-A---M---N---O---P
985 / / / / /
986 I B C D E
987 \ / / / /
988 `-------------'</tt></pre>
989 </div></div>
990 <div class="paragraph"><p>The horizontal line of history A&#8212;P is taken to be the first parent of
991 each merge. The commits are:</p></div>
992 <div class="ulist"><ul>
993 <li>
995 <tt>I</tt> is the initial commit, in which <tt>foo</tt> exists with contents
996 "asdf", and a file <tt>quux</tt> exists with contents "quux". Initial
997 commits are compared to an empty tree, so <tt>I</tt> is !TREESAME.
998 </p>
999 </li>
1000 <li>
1002 In <tt>A</tt>, <tt>foo</tt> contains just "foo".
1003 </p>
1004 </li>
1005 <li>
1007 <tt>B</tt> contains the same change as <tt>A</tt>. Its merge <tt>M</tt> is trivial and
1008 hence TREESAME to all parents.
1009 </p>
1010 </li>
1011 <li>
1013 <tt>C</tt> does not change <tt>foo</tt>, but its merge <tt>N</tt> changes it to "foobar",
1014 so it is not TREESAME to any parent.
1015 </p>
1016 </li>
1017 <li>
1019 <tt>D</tt> sets <tt>foo</tt> to "baz". Its merge <tt>O</tt> combines the strings from
1020 <tt>N</tt> and <tt>D</tt> to "foobarbaz"; i.e., it is not TREESAME to any parent.
1021 </p>
1022 </li>
1023 <li>
1025 <tt>E</tt> changes <tt>quux</tt> to "xyzzy", and its merge <tt>P</tt> combines the
1026 strings to "quux xyzzy". Despite appearing interesting, <tt>P</tt> is
1027 TREESAME to all parents.
1028 </p>
1029 </li>
1030 </ul></div>
1031 <div class="paragraph"><p><em>rev-list</em> walks backwards through history, including or excluding
1032 commits based on whether <em>--full-history</em> and/or parent rewriting
1033 (via <em>--parents</em> or <em>--children</em>) are used. The following settings
1034 are available.</p></div>
1035 <div class="dlist"><dl>
1036 <dt class="hdlist1">
1037 Default mode
1038 </dt>
1039 <dd>
1041 Commits are included if they are not TREESAME to any parent
1042 (though this can be changed, see <em>--sparse</em> below). If the
1043 commit was a merge, and it was TREESAME to one parent, follow
1044 only that parent. (Even if there are several TREESAME
1045 parents, follow only one of them.) Otherwise, follow all
1046 parents.
1047 </p>
1048 <div class="paragraph"><p>This results in:</p></div>
1049 <div class="listingblock">
1050 <div class="content">
1051 <pre><tt> .-A---N---O
1052 / / /
1053 I---------D</tt></pre>
1054 </div></div>
1055 <div class="paragraph"><p>Note how the rule to only follow the TREESAME parent, if one is
1056 available, removed <tt>B</tt> from consideration entirely. <tt>C</tt> was
1057 considered via <tt>N</tt>, but is TREESAME. Root commits are compared to an
1058 empty tree, so <tt>I</tt> is !TREESAME.</p></div>
1059 <div class="paragraph"><p>Parent/child relations are only visible with --parents, but that does
1060 not affect the commits selected in default mode, so we have shown the
1061 parent lines.</p></div>
1062 </dd>
1063 <dt class="hdlist1">
1064 --full-history without parent rewriting
1065 </dt>
1066 <dd>
1068 This mode differs from the default in one point: always follow
1069 all parents of a merge, even if it is TREESAME to one of them.
1070 Even if more than one side of the merge has commits that are
1071 included, this does not imply that the merge itself is! In
1072 the example, we get
1073 </p>
1074 <div class="listingblock">
1075 <div class="content">
1076 <pre><tt> I A B N D O</tt></pre>
1077 </div></div>
1078 <div class="paragraph"><p><tt>P</tt> and <tt>M</tt> were excluded because they are TREESAME to a parent. <tt>E</tt>,
1079 <tt>C</tt> and <tt>B</tt> were all walked, but only <tt>B</tt> was !TREESAME, so the others
1080 do not appear.</p></div>
1081 <div class="paragraph"><p>Note that without parent rewriting, it is not really possible to talk
1082 about the parent/child relationships between the commits, so we show
1083 them disconnected.</p></div>
1084 </dd>
1085 <dt class="hdlist1">
1086 --full-history with parent rewriting
1087 </dt>
1088 <dd>
1090 Ordinary commits are only included if they are !TREESAME
1091 (though this can be changed, see <em>--sparse</em> below).
1092 </p>
1093 <div class="paragraph"><p>Merges are always included. However, their parent list is rewritten:
1094 Along each parent, prune away commits that are not included
1095 themselves. This results in</p></div>
1096 <div class="listingblock">
1097 <div class="content">
1098 <pre><tt> .-A---M---N---O---P
1099 / / / / /
1100 I B / D /
1101 \ / / / /
1102 `-------------'</tt></pre>
1103 </div></div>
1104 <div class="paragraph"><p>Compare to <em>--full-history</em> without rewriting above. Note that <tt>E</tt>
1105 was pruned away because it is TREESAME, but the parent list of P was
1106 rewritten to contain <tt>E</tt>'s parent <tt>I</tt>. The same happened for <tt>C</tt> and
1107 <tt>N</tt>. Note also that <tt>P</tt> was included despite being TREESAME.</p></div>
1108 </dd>
1109 </dl></div>
1110 <div class="paragraph"><p>In addition to the above settings, you can change whether TREESAME
1111 affects inclusion:</p></div>
1112 <div class="dlist"><dl>
1113 <dt class="hdlist1">
1114 --dense
1115 </dt>
1116 <dd>
1118 Commits that are walked are included if they are not TREESAME
1119 to any parent.
1120 </p>
1121 </dd>
1122 <dt class="hdlist1">
1123 --sparse
1124 </dt>
1125 <dd>
1127 All commits that are walked are included.
1128 </p>
1129 <div class="paragraph"><p>Note that without <em>--full-history</em>, this still simplifies merges: if
1130 one of the parents is TREESAME, we follow only that one, so the other
1131 sides of the merge are never walked.</p></div>
1132 </dd>
1133 <dt class="hdlist1">
1134 --simplify-merges
1135 </dt>
1136 <dd>
1138 First, build a history graph in the same way that
1139 <em>--full-history</em> with parent rewriting does (see above).
1140 </p>
1141 <div class="paragraph"><p>Then simplify each commit &#8216;C` to its replacement <tt>C&#8217;</tt> in the final
1142 history according to the following rules:</p></div>
1143 <div class="ulist"><ul>
1144 <li>
1146 Set &#8216;C&#8217;` to <tt>C</tt>.
1147 </p>
1148 </li>
1149 <li>
1151 Replace each parent &#8216;P` of <tt>C&#8217;</tt> with its simplification &#8216;P&#8217;`. In
1152 the process, drop parents that are ancestors of other parents, and
1153 remove duplicates.
1154 </p>
1155 </li>
1156 <li>
1158 If after this parent rewriting, &#8216;C&#8217;` is a root or merge commit (has
1159 zero or &gt;1 parents), a boundary commit, or !TREESAME, it remains.
1160 Otherwise, it is replaced with its only parent.
1161 </p>
1162 </li>
1163 </ul></div>
1164 <div class="paragraph"><p>The effect of this is best shown by way of comparing to
1165 <em>--full-history</em> with parent rewriting. The example turns into:</p></div>
1166 <div class="listingblock">
1167 <div class="content">
1168 <pre><tt> .-A---M---N---O
1169 / / /
1170 I B D
1171 \ / /
1172 `---------'</tt></pre>
1173 </div></div>
1174 <div class="paragraph"><p>Note the major differences in <tt>N</tt> and <tt>P</tt> over <em>--full-history</em>:</p></div>
1175 <div class="ulist"><ul>
1176 <li>
1178 <tt>N</tt>'s parent list had <tt>I</tt> removed, because it is an ancestor of the
1179 other parent <tt>M</tt>. Still, <tt>N</tt> remained because it is !TREESAME.
1180 </p>
1181 </li>
1182 <li>
1184 <tt>P</tt>'s parent list similarly had <tt>I</tt> removed. <tt>P</tt> was then
1185 removed completely, because it had one parent and is TREESAME.
1186 </p>
1187 </li>
1188 </ul></div>
1189 </dd>
1190 </dl></div>
1191 <div class="paragraph"><p>Finally, there is a fifth simplification mode available:</p></div>
1192 <div class="dlist"><dl>
1193 <dt class="hdlist1">
1194 --ancestry-path
1195 </dt>
1196 <dd>
1198 Limit the displayed commits to those directly on the ancestry
1199 chain between the "from" and "to" commits in the given commit
1200 range. I.e. only display commits that are ancestor of the "to"
1201 commit, and descendants of the "from" commit.
1202 </p>
1203 <div class="paragraph"><p>As an example use case, consider the following commit history:</p></div>
1204 <div class="listingblock">
1205 <div class="content">
1206 <pre><tt> D---E-------F
1207 / \ \
1208 B---C---G---H---I---J
1210 A-------K---------------L--M</tt></pre>
1211 </div></div>
1212 <div class="paragraph"><p>A regular <em>D..M</em> computes the set of commits that are ancestors of <tt>M</tt>,
1213 but excludes the ones that are ancestors of <tt>D</tt>. This is useful to see
1214 what happened to the history leading to <tt>M</tt> since <tt>D</tt>, in the sense
1215 that "what does <tt>M</tt> have that did not exist in <tt>D</tt>". The result in this
1216 example would be all the commits, except <tt>A</tt> and <tt>B</tt> (and <tt>D</tt> itself,
1217 of course).</p></div>
1218 <div class="paragraph"><p>When we want to find out what commits in <tt>M</tt> are contaminated with the
1219 bug introduced by <tt>D</tt> and need fixing, however, we might want to view
1220 only the subset of <em>D..M</em> that are actually descendants of <tt>D</tt>, i.e.
1221 excluding <tt>C</tt> and <tt>K</tt>. This is exactly what the <em>--ancestry-path</em>
1222 option does. Applied to the <em>D..M</em> range, it results in:</p></div>
1223 <div class="listingblock">
1224 <div class="content">
1225 <pre><tt> E-------F
1227 G---H---I---J
1229 L--M</tt></pre>
1230 </div></div>
1231 </dd>
1232 </dl></div>
1233 <div class="paragraph"><p>The <em>--simplify-by-decoration</em> option allows you to view only the
1234 big picture of the topology of the history, by omitting commits
1235 that are not referenced by tags. Commits are marked as !TREESAME
1236 (in other words, kept after history simplification rules described
1237 above) if (1) they are referenced by tags, or (2) they change the
1238 contents of the paths given on the command line. All other
1239 commits are marked as TREESAME (subject to be simplified away).</p></div>
1240 <h3 id="_bisection_helpers">Bisection Helpers</h3><div style="clear:left"></div>
1241 <div class="dlist"><dl>
1242 <dt class="hdlist1">
1243 --bisect
1244 </dt>
1245 <dd>
1247 Limit output to the one commit object which is roughly halfway between
1248 included and excluded commits. Note that the bad bisection ref
1249 <tt>refs/bisect/bad</tt> is added to the included commits (if it
1250 exists) and the good bisection refs <tt>refs/bisect/good-*</tt> are
1251 added to the excluded commits (if they exist). Thus, supposing there
1252 are no refs in <tt>refs/bisect/</tt>, if
1253 </p>
1254 </dd>
1255 </dl></div>
1256 <div class="listingblock">
1257 <div class="content">
1258 <pre><tt> $ git rev-list --bisect foo ^bar ^baz</tt></pre>
1259 </div></div>
1260 <div class="paragraph"><p>outputs <em>midpoint</em>, the output of the two commands</p></div>
1261 <div class="listingblock">
1262 <div class="content">
1263 <pre><tt> $ git rev-list foo ^midpoint
1264 $ git rev-list midpoint ^bar ^baz</tt></pre>
1265 </div></div>
1266 <div class="paragraph"><p>would be of roughly the same length. Finding the change which
1267 introduces a regression is thus reduced to a binary search: repeatedly
1268 generate and test new 'midpoint&#8217;s until the commit chain is of length
1269 one.</p></div>
1270 <div class="dlist"><dl>
1271 <dt class="hdlist1">
1272 --bisect-vars
1273 </dt>
1274 <dd>
1276 This calculates the same as <tt>--bisect</tt>, except that refs in
1277 <tt>refs/bisect/</tt> are not used, and except that this outputs
1278 text ready to be eval&#8217;ed by the shell. These lines will assign the
1279 name of the midpoint revision to the variable <tt>bisect_rev</tt>, and the
1280 expected number of commits to be tested after <tt>bisect_rev</tt> is tested
1281 to <tt>bisect_nr</tt>, the expected number of commits to be tested if
1282 <tt>bisect_rev</tt> turns out to be good to <tt>bisect_good</tt>, the expected
1283 number of commits to be tested if <tt>bisect_rev</tt> turns out to be bad to
1284 <tt>bisect_bad</tt>, and the number of commits we are bisecting right now to
1285 <tt>bisect_all</tt>.
1286 </p>
1287 </dd>
1288 <dt class="hdlist1">
1289 --bisect-all
1290 </dt>
1291 <dd>
1293 This outputs all the commit objects between the included and excluded
1294 commits, ordered by their distance to the included and excluded
1295 commits. Refs in <tt>refs/bisect/</tt> are not used. The farthest
1296 from them is displayed first. (This is the only one displayed by
1297 <tt>--bisect</tt>.)
1298 </p>
1299 <div class="paragraph"><p>This is useful because it makes it easy to choose a good commit to
1300 test when you want to avoid to test some of them for some reason (they
1301 may not compile for example).</p></div>
1302 <div class="paragraph"><p>This option can be used along with <tt>--bisect-vars</tt>, in this case,
1303 after all the sorted commit objects, there will be the same text as if
1304 <tt>--bisect-vars</tt> had been used alone.</p></div>
1305 </dd>
1306 </dl></div>
1307 <h3 id="_commit_ordering">Commit Ordering</h3><div style="clear:left"></div>
1308 <div class="paragraph"><p>By default, the commits are shown in reverse chronological order.</p></div>
1309 <div class="dlist"><dl>
1310 <dt class="hdlist1">
1311 --topo-order
1312 </dt>
1313 <dd>
1315 This option makes them appear in topological order (i.e.
1316 descendant commits are shown before their parents).
1317 </p>
1318 </dd>
1319 <dt class="hdlist1">
1320 --date-order
1321 </dt>
1322 <dd>
1324 This option is similar to <em>--topo-order</em> in the sense that no
1325 parent comes before all of its children, but otherwise things
1326 are still ordered in the commit timestamp order.
1327 </p>
1328 </dd>
1329 <dt class="hdlist1">
1330 --reverse
1331 </dt>
1332 <dd>
1334 Output the commits in reverse order.
1335 Cannot be combined with <em>--walk-reflogs</em>.
1336 </p>
1337 </dd>
1338 </dl></div>
1339 <h3 id="_object_traversal">Object Traversal</h3><div style="clear:left"></div>
1340 <div class="paragraph"><p>These options are mostly targeted for packing of git repositories.</p></div>
1341 <div class="dlist"><dl>
1342 <dt class="hdlist1">
1343 --objects
1344 </dt>
1345 <dd>
1347 Print the object IDs of any object referenced by the listed
1348 commits. <em>--objects foo ^bar</em> thus means "send me
1349 all object IDs which I need to download if I have the commit
1350 object <em>bar</em>, but not <em>foo</em>".
1351 </p>
1352 </dd>
1353 <dt class="hdlist1">
1354 --objects-edge
1355 </dt>
1356 <dd>
1358 Similar to <em>--objects</em>, but also print the IDs of excluded
1359 commits prefixed with a "-" character. This is used by
1360 <a href="git-pack-objects.html">git-pack-objects(1)</a> to build "thin" pack, which records
1361 objects in deltified form based on objects contained in these
1362 excluded commits to reduce network traffic.
1363 </p>
1364 </dd>
1365 <dt class="hdlist1">
1366 --unpacked
1367 </dt>
1368 <dd>
1370 Only useful with <em>--objects</em>; print the object IDs that are not
1371 in packs.
1372 </p>
1373 </dd>
1374 <dt class="hdlist1">
1375 --no-walk
1376 </dt>
1377 <dd>
1379 Only show the given revs, but do not traverse their ancestors.
1380 </p>
1381 </dd>
1382 <dt class="hdlist1">
1383 --do-walk
1384 </dt>
1385 <dd>
1387 Overrides a previous --no-walk.
1388 </p>
1389 </dd>
1390 </dl></div>
1391 <h3 id="_commit_formatting">Commit Formatting</h3><div style="clear:left"></div>
1392 <div class="paragraph"><p>Using these options, <a href="git-rev-list.html">git-rev-list(1)</a> will act similar to the
1393 more specialized family of commit log tools: <a href="git-log.html">git-log(1)</a>,
1394 <a href="git-show.html">git-show(1)</a>, and <a href="git-whatchanged.html">git-whatchanged(1)</a></p></div>
1395 <div class="dlist"><dl>
1396 <dt class="hdlist1">
1397 --pretty[=&lt;format&gt;]
1398 </dt>
1399 <dt class="hdlist1">
1400 --format=&lt;format&gt;
1401 </dt>
1402 <dd>
1404 Pretty-print the contents of the commit logs in a given format,
1405 where <em>&lt;format&gt;</em> can be one of <em>oneline</em>, <em>short</em>, <em>medium</em>,
1406 <em>full</em>, <em>fuller</em>, <em>email</em>, <em>raw</em> and <em>format:&lt;string&gt;</em>. See
1407 the "PRETTY FORMATS" section for some additional details for each
1408 format. When omitted, the format defaults to <em>medium</em>.
1409 </p>
1410 <div class="paragraph"><p>Note: you can specify the default pretty format in the repository
1411 configuration (see <a href="git-config.html">git-config(1)</a>).</p></div>
1412 </dd>
1413 <dt class="hdlist1">
1414 --abbrev-commit
1415 </dt>
1416 <dd>
1418 Instead of showing the full 40-byte hexadecimal commit object
1419 name, show only a partial prefix. Non default number of
1420 digits can be specified with "--abbrev=&lt;n&gt;" (which also modifies
1421 diff output, if it is displayed).
1422 </p>
1423 <div class="paragraph"><p>This should make "--pretty=oneline" a whole lot more readable for
1424 people using 80-column terminals.</p></div>
1425 </dd>
1426 <dt class="hdlist1">
1427 --no-abbrev-commit
1428 </dt>
1429 <dd>
1431 Show the full 40-byte hexadecimal commit object name. This negates
1432 <tt>--abbrev-commit</tt> and those options which imply it such as
1433 "--oneline". It also overrides the <em>log.abbrevCommit</em> variable.
1434 </p>
1435 </dd>
1436 <dt class="hdlist1">
1437 --oneline
1438 </dt>
1439 <dd>
1441 This is a shorthand for "--pretty=oneline --abbrev-commit"
1442 used together.
1443 </p>
1444 </dd>
1445 <dt class="hdlist1">
1446 --encoding[=&lt;encoding&gt;]
1447 </dt>
1448 <dd>
1450 The commit objects record the encoding used for the log message
1451 in their encoding header; this option can be used to tell the
1452 command to re-code the commit log message in the encoding
1453 preferred by the user. For non plumbing commands this
1454 defaults to UTF-8.
1455 </p>
1456 </dd>
1457 <dt class="hdlist1">
1458 --notes[=&lt;ref&gt;]
1459 </dt>
1460 <dd>
1462 Show the notes (see <a href="git-notes.html">git-notes(1)</a>) that annotate the
1463 commit, when showing the commit log message. This is the default
1464 for <tt>git log</tt>, <tt>git show</tt> and <tt>git whatchanged</tt> commands when
1465 there is no <tt>--pretty</tt>, <tt>--format</tt> nor <tt>--oneline</tt> option given
1466 on the command line.
1467 </p>
1468 <div class="paragraph"><p>By default, the notes shown are from the notes refs listed in the
1469 <em>core.notesRef</em> and <em>notes.displayRef</em> variables (or corresponding
1470 environment overrides). See <a href="git-config.html">git-config(1)</a> for more details.</p></div>
1471 <div class="paragraph"><p>With an optional <em>&lt;ref&gt;</em> argument, show this notes ref instead of the
1472 default notes ref(s). The ref is taken to be in <tt>refs/notes/</tt> if it
1473 is not qualified.</p></div>
1474 <div class="paragraph"><p>Multiple --notes options can be combined to control which notes are
1475 being displayed. Examples: "--notes=foo" will show only notes from
1476 "refs/notes/foo"; "--notes=foo --notes" will show both notes from
1477 "refs/notes/foo" and from the default notes ref(s).</p></div>
1478 </dd>
1479 <dt class="hdlist1">
1480 --no-notes
1481 </dt>
1482 <dd>
1484 Do not show notes. This negates the above <tt>--notes</tt> option, by
1485 resetting the list of notes refs from which notes are shown.
1486 Options are parsed in the order given on the command line, so e.g.
1487 "--notes --notes=foo --no-notes --notes=bar" will only show notes
1488 from "refs/notes/bar".
1489 </p>
1490 </dd>
1491 <dt class="hdlist1">
1492 --show-notes[=&lt;ref&gt;]
1493 </dt>
1494 <dt class="hdlist1">
1495 --[no-]standard-notes
1496 </dt>
1497 <dd>
1499 These options are deprecated. Use the above --notes/--no-notes
1500 options instead.
1501 </p>
1502 </dd>
1503 <dt class="hdlist1">
1504 --relative-date
1505 </dt>
1506 <dd>
1508 Synonym for <tt>--date=relative</tt>.
1509 </p>
1510 </dd>
1511 <dt class="hdlist1">
1512 --date=(relative|local|default|iso|rfc|short|raw)
1513 </dt>
1514 <dd>
1516 Only takes effect for dates shown in human-readable format, such
1517 as when using "--pretty". <tt>log.date</tt> config variable sets a default
1518 value for log command&#8217;s --date option.
1519 </p>
1520 <div class="paragraph"><p><tt>--date=relative</tt> shows dates relative to the current time,
1521 e.g. "2 hours ago".</p></div>
1522 <div class="paragraph"><p><tt>--date=local</tt> shows timestamps in user&#8217;s local timezone.</p></div>
1523 <div class="paragraph"><p><tt>--date=iso</tt> (or <tt>--date=iso8601</tt>) shows timestamps in ISO 8601 format.</p></div>
1524 <div class="paragraph"><p><tt>--date=rfc</tt> (or <tt>--date=rfc2822</tt>) shows timestamps in RFC 2822
1525 format, often found in E-mail messages.</p></div>
1526 <div class="paragraph"><p><tt>--date=short</tt> shows only date but not time, in <tt>YYYY-MM-DD</tt> format.</p></div>
1527 <div class="paragraph"><p><tt>--date=raw</tt> shows the date in the internal raw git format <tt>%s %z</tt> format.</p></div>
1528 <div class="paragraph"><p><tt>--date=default</tt> shows timestamps in the original timezone
1529 (either committer&#8217;s or author&#8217;s).</p></div>
1530 </dd>
1531 <dt class="hdlist1">
1532 --header
1533 </dt>
1534 <dd>
1536 Print the contents of the commit in raw-format; each record is
1537 separated with a NUL character.
1538 </p>
1539 </dd>
1540 <dt class="hdlist1">
1541 --parents
1542 </dt>
1543 <dd>
1545 Print also the parents of the commit (in the form "commit parent&#8230;").
1546 Also enables parent rewriting, see <em>History Simplification</em> below.
1547 </p>
1548 </dd>
1549 <dt class="hdlist1">
1550 --children
1551 </dt>
1552 <dd>
1554 Print also the children of the commit (in the form "commit child&#8230;").
1555 Also enables parent rewriting, see <em>History Simplification</em> below.
1556 </p>
1557 </dd>
1558 <dt class="hdlist1">
1559 --timestamp
1560 </dt>
1561 <dd>
1563 Print the raw commit timestamp.
1564 </p>
1565 </dd>
1566 <dt class="hdlist1">
1567 --left-right
1568 </dt>
1569 <dd>
1571 Mark which side of a symmetric diff a commit is reachable from.
1572 Commits from the left side are prefixed with <tt>&lt;</tt> and those from
1573 the right with <tt>&gt;</tt>. If combined with <tt>--boundary</tt>, those
1574 commits are prefixed with <tt>-</tt>.
1575 </p>
1576 <div class="paragraph"><p>For example, if you have this topology:</p></div>
1577 <div class="listingblock">
1578 <div class="content">
1579 <pre><tt> y---b---b branch B
1580 / \ /
1582 / / \
1583 o---x---a---a branch A</tt></pre>
1584 </div></div>
1585 <div class="paragraph"><p>you would get an output like this:</p></div>
1586 <div class="listingblock">
1587 <div class="content">
1588 <pre><tt> $ git rev-list --left-right --boundary --pretty=oneline A...B
1590 &gt;bbbbbbb... 3rd on b
1591 &gt;bbbbbbb... 2nd on b
1592 &lt;aaaaaaa... 3rd on a
1593 &lt;aaaaaaa... 2nd on a
1594 -yyyyyyy... 1st on b
1595 -xxxxxxx... 1st on a</tt></pre>
1596 </div></div>
1597 </dd>
1598 <dt class="hdlist1">
1599 --graph
1600 </dt>
1601 <dd>
1603 Draw a text-based graphical representation of the commit history
1604 on the left hand side of the output. This may cause extra lines
1605 to be printed in between commits, in order for the graph history
1606 to be drawn properly.
1607 </p>
1608 <div class="paragraph"><p>This enables parent rewriting, see <em>History Simplification</em> below.</p></div>
1609 <div class="paragraph"><p>This implies the <em>--topo-order</em> option by default, but the
1610 <em>--date-order</em> option may also be specified.</p></div>
1611 </dd>
1612 <dt class="hdlist1">
1613 --count
1614 </dt>
1615 <dd>
1617 Print a number stating how many commits would have been
1618 listed, and suppress all other output. When used together
1619 with <em>--left-right</em>, instead print the counts for left and
1620 right commits, separated by a tab. When used together with
1621 <em>--cherry-mark</em>, omit patch equivalent commits from these
1622 counts and print the count for equivalent commits separated
1623 by a tab.
1624 </p>
1625 </dd>
1626 </dl></div>
1627 </div>
1628 <h2 id="_pretty_formats">PRETTY FORMATS</h2>
1629 <div class="sectionbody">
1630 <div class="paragraph"><p>If the commit is a merge, and if the pretty-format
1631 is not <em>oneline</em>, <em>email</em> or <em>raw</em>, an additional line is
1632 inserted before the <em>Author:</em> line. This line begins with
1633 "Merge: " and the sha1s of ancestral commits are printed,
1634 separated by spaces. Note that the listed commits may not
1635 necessarily be the list of the <strong>direct</strong> parent commits if you
1636 have limited your view of history: for example, if you are
1637 only interested in changes related to a certain directory or
1638 file.</p></div>
1639 <div class="paragraph"><p>There are several built-in formats, and you can define
1640 additional formats by setting a pretty.&lt;name&gt;
1641 config option to either another format name, or a
1642 <em>format:</em> string, as described below (see
1643 <a href="git-config.html">git-config(1)</a>). Here are the details of the
1644 built-in formats:</p></div>
1645 <div class="ulist"><ul>
1646 <li>
1648 <em>oneline</em>
1649 </p>
1650 <div class="literalblock">
1651 <div class="content">
1652 <pre><tt>&lt;sha1&gt; &lt;title line&gt;</tt></pre>
1653 </div></div>
1654 <div class="paragraph"><p>This is designed to be as compact as possible.</p></div>
1655 </li>
1656 <li>
1658 <em>short</em>
1659 </p>
1660 <div class="literalblock">
1661 <div class="content">
1662 <pre><tt>commit &lt;sha1&gt;
1663 Author: &lt;author&gt;</tt></pre>
1664 </div></div>
1665 <div class="literalblock">
1666 <div class="content">
1667 <pre><tt>&lt;title line&gt;</tt></pre>
1668 </div></div>
1669 </li>
1670 <li>
1672 <em>medium</em>
1673 </p>
1674 <div class="literalblock">
1675 <div class="content">
1676 <pre><tt>commit &lt;sha1&gt;
1677 Author: &lt;author&gt;
1678 Date: &lt;author date&gt;</tt></pre>
1679 </div></div>
1680 <div class="literalblock">
1681 <div class="content">
1682 <pre><tt>&lt;title line&gt;</tt></pre>
1683 </div></div>
1684 <div class="literalblock">
1685 <div class="content">
1686 <pre><tt>&lt;full commit message&gt;</tt></pre>
1687 </div></div>
1688 </li>
1689 <li>
1691 <em>full</em>
1692 </p>
1693 <div class="literalblock">
1694 <div class="content">
1695 <pre><tt>commit &lt;sha1&gt;
1696 Author: &lt;author&gt;
1697 Commit: &lt;committer&gt;</tt></pre>
1698 </div></div>
1699 <div class="literalblock">
1700 <div class="content">
1701 <pre><tt>&lt;title line&gt;</tt></pre>
1702 </div></div>
1703 <div class="literalblock">
1704 <div class="content">
1705 <pre><tt>&lt;full commit message&gt;</tt></pre>
1706 </div></div>
1707 </li>
1708 <li>
1710 <em>fuller</em>
1711 </p>
1712 <div class="literalblock">
1713 <div class="content">
1714 <pre><tt>commit &lt;sha1&gt;
1715 Author: &lt;author&gt;
1716 AuthorDate: &lt;author date&gt;
1717 Commit: &lt;committer&gt;
1718 CommitDate: &lt;committer date&gt;</tt></pre>
1719 </div></div>
1720 <div class="literalblock">
1721 <div class="content">
1722 <pre><tt>&lt;title line&gt;</tt></pre>
1723 </div></div>
1724 <div class="literalblock">
1725 <div class="content">
1726 <pre><tt>&lt;full commit message&gt;</tt></pre>
1727 </div></div>
1728 </li>
1729 <li>
1731 <em>email</em>
1732 </p>
1733 <div class="literalblock">
1734 <div class="content">
1735 <pre><tt>From &lt;sha1&gt; &lt;date&gt;
1736 From: &lt;author&gt;
1737 Date: &lt;author date&gt;
1738 Subject: [PATCH] &lt;title line&gt;</tt></pre>
1739 </div></div>
1740 <div class="literalblock">
1741 <div class="content">
1742 <pre><tt>&lt;full commit message&gt;</tt></pre>
1743 </div></div>
1744 </li>
1745 <li>
1747 <em>raw</em>
1748 </p>
1749 <div class="paragraph"><p>The <em>raw</em> format shows the entire commit exactly as
1750 stored in the commit object. Notably, the SHA1s are
1751 displayed in full, regardless of whether --abbrev or
1752 --no-abbrev are used, and <em>parents</em> information show the
1753 true parent commits, without taking grafts nor history
1754 simplification into account.</p></div>
1755 </li>
1756 <li>
1758 <em>format:&lt;string&gt;</em>
1759 </p>
1760 <div class="paragraph"><p>The <em>format:&lt;string&gt;</em> format allows you to specify which information
1761 you want to show. It works a little bit like printf format,
1762 with the notable exception that you get a newline with <em>%n</em>
1763 instead of <em>\n</em>.</p></div>
1764 <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>
1765 would show something like this:</p></div>
1766 <div class="listingblock">
1767 <div class="content">
1768 <pre><tt>The author of fe6e0ee was Junio C Hamano, 23 hours ago
1769 The title was &gt;&gt;t4119: test autocomputing -p&lt;n&gt; for traditional diff input.&lt;&lt;</tt></pre>
1770 </div></div>
1771 <div class="paragraph"><p>The placeholders are:</p></div>
1772 <div class="ulist"><ul>
1773 <li>
1775 <em>%H</em>: commit hash
1776 </p>
1777 </li>
1778 <li>
1780 <em>%h</em>: abbreviated commit hash
1781 </p>
1782 </li>
1783 <li>
1785 <em>%T</em>: tree hash
1786 </p>
1787 </li>
1788 <li>
1790 <em>%t</em>: abbreviated tree hash
1791 </p>
1792 </li>
1793 <li>
1795 <em>%P</em>: parent hashes
1796 </p>
1797 </li>
1798 <li>
1800 <em>%p</em>: abbreviated parent hashes
1801 </p>
1802 </li>
1803 <li>
1805 <em>%an</em>: author name
1806 </p>
1807 </li>
1808 <li>
1810 <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>)
1811 </p>
1812 </li>
1813 <li>
1815 <em>%ae</em>: author email
1816 </p>
1817 </li>
1818 <li>
1820 <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>)
1821 </p>
1822 </li>
1823 <li>
1825 <em>%ad</em>: author date (format respects --date= option)
1826 </p>
1827 </li>
1828 <li>
1830 <em>%aD</em>: author date, RFC2822 style
1831 </p>
1832 </li>
1833 <li>
1835 <em>%ar</em>: author date, relative
1836 </p>
1837 </li>
1838 <li>
1840 <em>%at</em>: author date, UNIX timestamp
1841 </p>
1842 </li>
1843 <li>
1845 <em>%ai</em>: author date, ISO 8601 format
1846 </p>
1847 </li>
1848 <li>
1850 <em>%cn</em>: committer name
1851 </p>
1852 </li>
1853 <li>
1855 <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>)
1856 </p>
1857 </li>
1858 <li>
1860 <em>%ce</em>: committer email
1861 </p>
1862 </li>
1863 <li>
1865 <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>)
1866 </p>
1867 </li>
1868 <li>
1870 <em>%cd</em>: committer date
1871 </p>
1872 </li>
1873 <li>
1875 <em>%cD</em>: committer date, RFC2822 style
1876 </p>
1877 </li>
1878 <li>
1880 <em>%cr</em>: committer date, relative
1881 </p>
1882 </li>
1883 <li>
1885 <em>%ct</em>: committer date, UNIX timestamp
1886 </p>
1887 </li>
1888 <li>
1890 <em>%ci</em>: committer date, ISO 8601 format
1891 </p>
1892 </li>
1893 <li>
1895 <em>%d</em>: ref names, like the --decorate option of <a href="git-log.html">git-log(1)</a>
1896 </p>
1897 </li>
1898 <li>
1900 <em>%e</em>: encoding
1901 </p>
1902 </li>
1903 <li>
1905 <em>%s</em>: subject
1906 </p>
1907 </li>
1908 <li>
1910 <em>%f</em>: sanitized subject line, suitable for a filename
1911 </p>
1912 </li>
1913 <li>
1915 <em>%b</em>: body
1916 </p>
1917 </li>
1918 <li>
1920 <em>%B</em>: raw body (unwrapped subject and body)
1921 </p>
1922 </li>
1923 <li>
1925 <em>%N</em>: commit notes
1926 </p>
1927 </li>
1928 <li>
1930 <em>%gD</em>: reflog selector, e.g., <tt>refs/stash@{1}</tt>
1931 </p>
1932 </li>
1933 <li>
1935 <em>%gd</em>: shortened reflog selector, e.g., <tt>stash@{1}</tt>
1936 </p>
1937 </li>
1938 <li>
1940 <em>%gs</em>: reflog subject
1941 </p>
1942 </li>
1943 <li>
1945 <em>%Cred</em>: switch color to red
1946 </p>
1947 </li>
1948 <li>
1950 <em>%Cgreen</em>: switch color to green
1951 </p>
1952 </li>
1953 <li>
1955 <em>%Cblue</em>: switch color to blue
1956 </p>
1957 </li>
1958 <li>
1960 <em>%Creset</em>: reset color
1961 </p>
1962 </li>
1963 <li>
1965 <em>%C(&#8230;)</em>: color specification, as described in color.branch.* config option
1966 </p>
1967 </li>
1968 <li>
1970 <em>%m</em>: left, right or boundary mark
1971 </p>
1972 </li>
1973 <li>
1975 <em>%n</em>: newline
1976 </p>
1977 </li>
1978 <li>
1980 <em>%%</em>: a raw <em>%</em>
1981 </p>
1982 </li>
1983 <li>
1985 <em>%x00</em>: print a byte from a hex code
1986 </p>
1987 </li>
1988 <li>
1990 <em>%w([&lt;w&gt;[,&lt;i1&gt;[,&lt;i2&gt;]]])</em>: switch line wrapping, like the -w option of
1991 <a href="git-shortlog.html">git-shortlog(1)</a>.
1992 </p>
1993 </li>
1994 </ul></div>
1995 </li>
1996 </ul></div>
1997 <div class="admonitionblock">
1998 <table><tr>
1999 <td class="icon">
2000 <div class="title">Note</div>
2001 </td>
2002 <td class="content">Some placeholders may depend on other options given to the
2003 revision traversal engine. For example, the <tt>%g*</tt> reflog options will
2004 insert an empty string unless we are traversing reflog entries (e.g., by
2005 <tt>git log -g</tt>). The <tt>%d</tt> placeholder will use the "short" decoration
2006 format if <tt>--decorate</tt> was not already provided on the command line.</td>
2007 </tr></table>
2008 </div>
2009 <div class="paragraph"><p>If you add a <tt>&#43;</tt> (plus sign) after <em>%</em> of a placeholder, a line-feed
2010 is inserted immediately before the expansion if and only if the
2011 placeholder expands to a non-empty string.</p></div>
2012 <div class="paragraph"><p>If you add a <tt>-</tt> (minus sign) after <em>%</em> of a placeholder, line-feeds that
2013 immediately precede the expansion are deleted if and only if the
2014 placeholder expands to an empty string.</p></div>
2015 <div class="paragraph"><p>If you add a ` ` (space) after <em>%</em> of a placeholder, a space
2016 is inserted immediately before the expansion if and only if the
2017 placeholder expands to a non-empty string.</p></div>
2018 <div class="ulist"><ul>
2019 <li>
2021 <em>tformat:</em>
2022 </p>
2023 <div class="paragraph"><p>The <em>tformat:</em> format works exactly like <em>format:</em>, except that it
2024 provides "terminator" semantics instead of "separator" semantics. In
2025 other words, each commit has the message terminator character (usually a
2026 newline) appended, rather than a separator placed between entries.
2027 This means that the final entry of a single-line format will be properly
2028 terminated with a new line, just as the "oneline" format does.
2029 For example:</p></div>
2030 <div class="listingblock">
2031 <div class="content">
2032 <pre><tt>$ git log -2 --pretty=format:%h 4da45bef \
2033 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
2034 4da45be
2035 7134973 -- NO NEWLINE
2037 $ git log -2 --pretty=tformat:%h 4da45bef \
2038 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
2039 4da45be
2040 7134973</tt></pre>
2041 </div></div>
2042 <div class="paragraph"><p>In addition, any unrecognized string that has a <tt>%</tt> in it is interpreted
2043 as if it has <tt>tformat:</tt> in front of it. For example, these two are
2044 equivalent:</p></div>
2045 <div class="listingblock">
2046 <div class="content">
2047 <pre><tt>$ git log -2 --pretty=tformat:%h 4da45bef
2048 $ git log -2 --pretty=%h 4da45bef</tt></pre>
2049 </div></div>
2050 </li>
2051 </ul></div>
2052 </div>
2053 <h2 id="_git">GIT</h2>
2054 <div class="sectionbody">
2055 <div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
2056 </div>
2057 <div id="footer">
2058 <div id="footer-text">
2059 Last updated 2011-05-30 08:13:19 UTC
2060 </div>
2061 </div>
2062 </body>
2063 </html>