Autogenerated HTML docs for v2.45.1-204-gd8ab1
[git-htmldocs.git] / git-rev-list.html
blob71ef8c4d68c10c0fea3987acf1d9143397627b1d
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
3 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
4 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
5 <head>
6 <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
7 <meta name="generator" content="AsciiDoc 10.2.0" />
8 <title>git-rev-list(1)</title>
9 <style type="text/css">
10 /* Shared CSS for AsciiDoc xhtml11 and html5 backends */
12 /* Default font. */
13 body {
14 font-family: Georgia,serif;
17 /* Title font. */
18 h1, h2, h3, h4, h5, h6,
19 div.title, caption.title,
20 thead, p.table.header,
21 #toctitle,
22 #author, #revnumber, #revdate, #revremark,
23 #footer {
24 font-family: Arial,Helvetica,sans-serif;
27 body {
28 margin: 1em 5% 1em 5%;
31 a {
32 color: blue;
33 text-decoration: underline;
35 a:visited {
36 color: fuchsia;
39 em {
40 font-style: italic;
41 color: navy;
44 strong {
45 font-weight: bold;
46 color: #083194;
49 h1, h2, h3, h4, h5, h6 {
50 color: #527bbd;
51 margin-top: 1.2em;
52 margin-bottom: 0.5em;
53 line-height: 1.3;
56 h1, h2, h3 {
57 border-bottom: 2px solid silver;
59 h2 {
60 padding-top: 0.5em;
62 h3 {
63 float: left;
65 h3 + * {
66 clear: left;
68 h5 {
69 font-size: 1.0em;
72 div.sectionbody {
73 margin-left: 0;
76 hr {
77 border: 1px solid silver;
80 p {
81 margin-top: 0.5em;
82 margin-bottom: 0.5em;
85 ul, ol, li > p {
86 margin-top: 0;
88 ul > li { color: #aaa; }
89 ul > li > * { color: black; }
91 .monospaced, code, pre {
92 font-family: "Courier New", Courier, monospace;
93 font-size: inherit;
94 color: navy;
95 padding: 0;
96 margin: 0;
98 pre {
99 white-space: pre-wrap;
102 #author {
103 color: #527bbd;
104 font-weight: bold;
105 font-size: 1.1em;
107 #email {
109 #revnumber, #revdate, #revremark {
112 #footer {
113 font-size: small;
114 border-top: 2px solid silver;
115 padding-top: 0.5em;
116 margin-top: 4.0em;
118 #footer-text {
119 float: left;
120 padding-bottom: 0.5em;
122 #footer-badges {
123 float: right;
124 padding-bottom: 0.5em;
127 #preamble {
128 margin-top: 1.5em;
129 margin-bottom: 1.5em;
131 div.imageblock, div.exampleblock, div.verseblock,
132 div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
133 div.admonitionblock {
134 margin-top: 1.0em;
135 margin-bottom: 1.5em;
137 div.admonitionblock {
138 margin-top: 2.0em;
139 margin-bottom: 2.0em;
140 margin-right: 10%;
141 color: #606060;
144 div.content { /* Block element content. */
145 padding: 0;
148 /* Block element titles. */
149 div.title, caption.title {
150 color: #527bbd;
151 font-weight: bold;
152 text-align: left;
153 margin-top: 1.0em;
154 margin-bottom: 0.5em;
156 div.title + * {
157 margin-top: 0;
160 td div.title:first-child {
161 margin-top: 0.0em;
163 div.content div.title:first-child {
164 margin-top: 0.0em;
166 div.content + div.title {
167 margin-top: 0.0em;
170 div.sidebarblock > div.content {
171 background: #ffffee;
172 border: 1px solid #dddddd;
173 border-left: 4px solid #f0f0f0;
174 padding: 0.5em;
177 div.listingblock > div.content {
178 border: 1px solid #dddddd;
179 border-left: 5px solid #f0f0f0;
180 background: #f8f8f8;
181 padding: 0.5em;
184 div.quoteblock, div.verseblock {
185 padding-left: 1.0em;
186 margin-left: 1.0em;
187 margin-right: 10%;
188 border-left: 5px solid #f0f0f0;
189 color: #888;
192 div.quoteblock > div.attribution {
193 padding-top: 0.5em;
194 text-align: right;
197 div.verseblock > pre.content {
198 font-family: inherit;
199 font-size: inherit;
201 div.verseblock > div.attribution {
202 padding-top: 0.75em;
203 text-align: left;
205 /* DEPRECATED: Pre version 8.2.7 verse style literal block. */
206 div.verseblock + div.attribution {
207 text-align: left;
210 div.admonitionblock .icon {
211 vertical-align: top;
212 font-size: 1.1em;
213 font-weight: bold;
214 text-decoration: underline;
215 color: #527bbd;
216 padding-right: 0.5em;
218 div.admonitionblock td.content {
219 padding-left: 0.5em;
220 border-left: 3px solid #dddddd;
223 div.exampleblock > div.content {
224 border-left: 3px solid #dddddd;
225 padding-left: 0.5em;
228 div.imageblock div.content { padding-left: 0; }
229 span.image img { border-style: none; vertical-align: text-bottom; }
230 a.image:visited { color: white; }
232 dl {
233 margin-top: 0.8em;
234 margin-bottom: 0.8em;
236 dt {
237 margin-top: 0.5em;
238 margin-bottom: 0;
239 font-style: normal;
240 color: navy;
242 dd > *:first-child {
243 margin-top: 0.1em;
246 ul, ol {
247 list-style-position: outside;
249 ol.arabic {
250 list-style-type: decimal;
252 ol.loweralpha {
253 list-style-type: lower-alpha;
255 ol.upperalpha {
256 list-style-type: upper-alpha;
258 ol.lowerroman {
259 list-style-type: lower-roman;
261 ol.upperroman {
262 list-style-type: upper-roman;
265 div.compact ul, div.compact ol,
266 div.compact p, div.compact p,
267 div.compact div, div.compact div {
268 margin-top: 0.1em;
269 margin-bottom: 0.1em;
272 tfoot {
273 font-weight: bold;
275 td > div.verse {
276 white-space: pre;
279 div.hdlist {
280 margin-top: 0.8em;
281 margin-bottom: 0.8em;
283 div.hdlist tr {
284 padding-bottom: 15px;
286 dt.hdlist1.strong, td.hdlist1.strong {
287 font-weight: bold;
289 td.hdlist1 {
290 vertical-align: top;
291 font-style: normal;
292 padding-right: 0.8em;
293 color: navy;
295 td.hdlist2 {
296 vertical-align: top;
298 div.hdlist.compact tr {
299 margin: 0;
300 padding-bottom: 0;
303 .comment {
304 background: yellow;
307 .footnote, .footnoteref {
308 font-size: 0.8em;
311 span.footnote, span.footnoteref {
312 vertical-align: super;
315 #footnotes {
316 margin: 20px 0 20px 0;
317 padding: 7px 0 0 0;
320 #footnotes div.footnote {
321 margin: 0 0 5px 0;
324 #footnotes hr {
325 border: none;
326 border-top: 1px solid silver;
327 height: 1px;
328 text-align: left;
329 margin-left: 0;
330 width: 20%;
331 min-width: 100px;
334 div.colist td {
335 padding-right: 0.5em;
336 padding-bottom: 0.3em;
337 vertical-align: top;
339 div.colist td img {
340 margin-top: 0.3em;
343 @media print {
344 #footer-badges { display: none; }
347 #toc {
348 margin-bottom: 2.5em;
351 #toctitle {
352 color: #527bbd;
353 font-size: 1.1em;
354 font-weight: bold;
355 margin-top: 1.0em;
356 margin-bottom: 0.1em;
359 div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
360 margin-top: 0;
361 margin-bottom: 0;
363 div.toclevel2 {
364 margin-left: 2em;
365 font-size: 0.9em;
367 div.toclevel3 {
368 margin-left: 4em;
369 font-size: 0.9em;
371 div.toclevel4 {
372 margin-left: 6em;
373 font-size: 0.9em;
376 span.aqua { color: aqua; }
377 span.black { color: black; }
378 span.blue { color: blue; }
379 span.fuchsia { color: fuchsia; }
380 span.gray { color: gray; }
381 span.green { color: green; }
382 span.lime { color: lime; }
383 span.maroon { color: maroon; }
384 span.navy { color: navy; }
385 span.olive { color: olive; }
386 span.purple { color: purple; }
387 span.red { color: red; }
388 span.silver { color: silver; }
389 span.teal { color: teal; }
390 span.white { color: white; }
391 span.yellow { color: yellow; }
393 span.aqua-background { background: aqua; }
394 span.black-background { background: black; }
395 span.blue-background { background: blue; }
396 span.fuchsia-background { background: fuchsia; }
397 span.gray-background { background: gray; }
398 span.green-background { background: green; }
399 span.lime-background { background: lime; }
400 span.maroon-background { background: maroon; }
401 span.navy-background { background: navy; }
402 span.olive-background { background: olive; }
403 span.purple-background { background: purple; }
404 span.red-background { background: red; }
405 span.silver-background { background: silver; }
406 span.teal-background { background: teal; }
407 span.white-background { background: white; }
408 span.yellow-background { background: yellow; }
410 span.big { font-size: 2em; }
411 span.small { font-size: 0.6em; }
413 span.underline { text-decoration: underline; }
414 span.overline { text-decoration: overline; }
415 span.line-through { text-decoration: line-through; }
417 div.unbreakable { page-break-inside: avoid; }
421 * xhtml11 specific
423 * */
425 div.tableblock {
426 margin-top: 1.0em;
427 margin-bottom: 1.5em;
429 div.tableblock > table {
430 border: 3px solid #527bbd;
432 thead, p.table.header {
433 font-weight: bold;
434 color: #527bbd;
436 p.table {
437 margin-top: 0;
439 /* Because the table frame attribute is overridden by CSS in most browsers. */
440 div.tableblock > table[frame="void"] {
441 border-style: none;
443 div.tableblock > table[frame="hsides"] {
444 border-left-style: none;
445 border-right-style: none;
447 div.tableblock > table[frame="vsides"] {
448 border-top-style: none;
449 border-bottom-style: none;
454 * html5 specific
456 * */
458 table.tableblock {
459 margin-top: 1.0em;
460 margin-bottom: 1.5em;
462 thead, p.tableblock.header {
463 font-weight: bold;
464 color: #527bbd;
466 p.tableblock {
467 margin-top: 0;
469 table.tableblock {
470 border-width: 3px;
471 border-spacing: 0px;
472 border-style: solid;
473 border-color: #527bbd;
474 border-collapse: collapse;
476 th.tableblock, td.tableblock {
477 border-width: 1px;
478 padding: 4px;
479 border-style: solid;
480 border-color: #527bbd;
483 table.tableblock.frame-topbot {
484 border-left-style: hidden;
485 border-right-style: hidden;
487 table.tableblock.frame-sides {
488 border-top-style: hidden;
489 border-bottom-style: hidden;
491 table.tableblock.frame-none {
492 border-style: hidden;
495 th.tableblock.halign-left, td.tableblock.halign-left {
496 text-align: left;
498 th.tableblock.halign-center, td.tableblock.halign-center {
499 text-align: center;
501 th.tableblock.halign-right, td.tableblock.halign-right {
502 text-align: right;
505 th.tableblock.valign-top, td.tableblock.valign-top {
506 vertical-align: top;
508 th.tableblock.valign-middle, td.tableblock.valign-middle {
509 vertical-align: middle;
511 th.tableblock.valign-bottom, td.tableblock.valign-bottom {
512 vertical-align: bottom;
517 * manpage specific
519 * */
521 body.manpage h1 {
522 padding-top: 0.5em;
523 padding-bottom: 0.5em;
524 border-top: 2px solid silver;
525 border-bottom: 2px solid silver;
527 body.manpage h2 {
528 border-style: none;
530 body.manpage div.sectionbody {
531 margin-left: 3em;
534 @media print {
535 body.manpage div#toc { display: none; }
539 </style>
540 <script type="text/javascript">
541 /*<![CDATA[*/
542 var asciidoc = { // Namespace.
544 /////////////////////////////////////////////////////////////////////
545 // Table Of Contents generator
546 /////////////////////////////////////////////////////////////////////
548 /* Author: Mihai Bazon, September 2002
549 * http://students.infoiasi.ro/~mishoo
551 * Table Of Content generator
552 * Version: 0.4
554 * Feel free to use this script under the terms of the GNU General Public
555 * License, as long as you do not remove or alter this notice.
558 /* modified by Troy D. Hanson, September 2006. License: GPL */
559 /* modified by Stuart Rackham, 2006, 2009. License: GPL */
561 // toclevels = 1..4.
562 toc: function (toclevels) {
564 function getText(el) {
565 var text = "";
566 for (var i = el.firstChild; i != null; i = i.nextSibling) {
567 if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
568 text += i.data;
569 else if (i.firstChild != null)
570 text += getText(i);
572 return text;
575 function TocEntry(el, text, toclevel) {
576 this.element = el;
577 this.text = text;
578 this.toclevel = toclevel;
581 function tocEntries(el, toclevels) {
582 var result = new Array;
583 var re = new RegExp('[hH]([1-'+(toclevels+1)+'])');
584 // Function that scans the DOM tree for header elements (the DOM2
585 // nodeIterator API would be a better technique but not supported by all
586 // browsers).
587 var iterate = function (el) {
588 for (var i = el.firstChild; i != null; i = i.nextSibling) {
589 if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
590 var mo = re.exec(i.tagName);
591 if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
592 result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
594 iterate(i);
598 iterate(el);
599 return result;
602 var toc = document.getElementById("toc");
603 if (!toc) {
604 return;
607 // Delete existing TOC entries in case we're reloading the TOC.
608 var tocEntriesToRemove = [];
609 var i;
610 for (i = 0; i < toc.childNodes.length; i++) {
611 var entry = toc.childNodes[i];
612 if (entry.nodeName.toLowerCase() == 'div'
613 && entry.getAttribute("class")
614 && entry.getAttribute("class").match(/^toclevel/))
615 tocEntriesToRemove.push(entry);
617 for (i = 0; i < tocEntriesToRemove.length; i++) {
618 toc.removeChild(tocEntriesToRemove[i]);
621 // Rebuild TOC entries.
622 var entries = tocEntries(document.getElementById("content"), toclevels);
623 for (var i = 0; i < entries.length; ++i) {
624 var entry = entries[i];
625 if (entry.element.id == "")
626 entry.element.id = "_toc_" + i;
627 var a = document.createElement("a");
628 a.href = "#" + entry.element.id;
629 a.appendChild(document.createTextNode(entry.text));
630 var div = document.createElement("div");
631 div.appendChild(a);
632 div.className = "toclevel" + entry.toclevel;
633 toc.appendChild(div);
635 if (entries.length == 0)
636 toc.parentNode.removeChild(toc);
640 /////////////////////////////////////////////////////////////////////
641 // Footnotes generator
642 /////////////////////////////////////////////////////////////////////
644 /* Based on footnote generation code from:
645 * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
648 footnotes: function () {
649 // Delete existing footnote entries in case we're reloading the footnodes.
650 var i;
651 var noteholder = document.getElementById("footnotes");
652 if (!noteholder) {
653 return;
655 var entriesToRemove = [];
656 for (i = 0; i < noteholder.childNodes.length; i++) {
657 var entry = noteholder.childNodes[i];
658 if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote")
659 entriesToRemove.push(entry);
661 for (i = 0; i < entriesToRemove.length; i++) {
662 noteholder.removeChild(entriesToRemove[i]);
665 // Rebuild footnote entries.
666 var cont = document.getElementById("content");
667 var spans = cont.getElementsByTagName("span");
668 var refs = {};
669 var n = 0;
670 for (i=0; i<spans.length; i++) {
671 if (spans[i].className == "footnote") {
672 n++;
673 var note = spans[i].getAttribute("data-note");
674 if (!note) {
675 // Use [\s\S] in place of . so multi-line matches work.
676 // Because JavaScript has no s (dotall) regex flag.
677 note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
678 spans[i].innerHTML =
679 "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
680 "' title='View footnote' class='footnote'>" + n + "</a>]";
681 spans[i].setAttribute("data-note", note);
683 noteholder.innerHTML +=
684 "<div class='footnote' id='_footnote_" + n + "'>" +
685 "<a href='#_footnoteref_" + n + "' title='Return to text'>" +
686 n + "</a>. " + note + "</div>";
687 var id =spans[i].getAttribute("id");
688 if (id != null) refs["#"+id] = n;
691 if (n == 0)
692 noteholder.parentNode.removeChild(noteholder);
693 else {
694 // Process footnoterefs.
695 for (i=0; i<spans.length; i++) {
696 if (spans[i].className == "footnoteref") {
697 var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
698 href = href.match(/#.*/)[0]; // Because IE return full URL.
699 n = refs[href];
700 spans[i].innerHTML =
701 "[<a href='#_footnote_" + n +
702 "' title='View footnote' class='footnote'>" + n + "</a>]";
708 install: function(toclevels) {
709 var timerId;
711 function reinstall() {
712 asciidoc.footnotes();
713 if (toclevels) {
714 asciidoc.toc(toclevels);
718 function reinstallAndRemoveTimer() {
719 clearInterval(timerId);
720 reinstall();
723 timerId = setInterval(reinstall, 500);
724 if (document.addEventListener)
725 document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false);
726 else
727 window.onload = reinstallAndRemoveTimer;
731 asciidoc.install();
732 /*]]>*/
733 </script>
734 </head>
735 <body class="manpage">
736 <div id="header">
737 <h1>
738 git-rev-list(1) Manual Page
739 </h1>
740 <h2>NAME</h2>
741 <div class="sectionbody">
742 <p>git-rev-list -
743 Lists commit objects in reverse chronological order
744 </p>
745 </div>
746 </div>
747 <div id="content">
748 <div class="sect1">
749 <h2 id="_synopsis">SYNOPSIS</h2>
750 <div class="sectionbody">
751 <div class="verseblock">
752 <pre class="content"><em>git rev-list</em> [&lt;options&gt;] &lt;commit&gt;&#8230; [--] [&lt;path&gt;&#8230;]</pre>
753 <div class="attribution">
754 </div></div>
755 </div>
756 </div>
757 <div class="sect1">
758 <h2 id="_description">DESCRIPTION</h2>
759 <div class="sectionbody">
760 <div class="paragraph"><p>List commits that are reachable by following the <code>parent</code> links from the
761 given commit(s), but exclude commits that are reachable from the one(s)
762 given with a <em>&#94;</em> in front of them. The output is given in reverse
763 chronological order by default.</p></div>
764 <div class="paragraph"><p>You can think of this as a set operation. Commits reachable from any of
765 the commits given on the command line form a set, and then commits reachable
766 from any of the ones given with <em>&#94;</em> in front are subtracted from that
767 set. The remaining commits are what comes out in the command&#8217;s output.
768 Various other options and paths parameters can be used to further limit the
769 result.</p></div>
770 <div class="paragraph"><p>Thus, the following command:</p></div>
771 <div class="listingblock">
772 <div class="content">
773 <pre><code>$ git rev-list foo bar ^baz</code></pre>
774 </div></div>
775 <div class="paragraph"><p>means "list all the commits which are reachable from <em>foo</em> or <em>bar</em>, but
776 not from <em>baz</em>".</p></div>
777 <div class="paragraph"><p>A special notation "<em>&lt;commit1&gt;</em>..<em>&lt;commit2&gt;</em>" can be used as a
778 short-hand for "^<em>&lt;commit1&gt;</em> <em>&lt;commit2&gt;</em>". For example, either of
779 the following may be used interchangeably:</p></div>
780 <div class="listingblock">
781 <div class="content">
782 <pre><code>$ git rev-list origin..HEAD
783 $ git rev-list HEAD ^origin</code></pre>
784 </div></div>
785 <div class="paragraph"><p>Another special notation is "<em>&lt;commit1&gt;</em>&#8230;<em>&lt;commit2&gt;</em>" which is useful
786 for merges. The resulting set of commits is the symmetric difference
787 between the two operands. The following two commands are equivalent:</p></div>
788 <div class="listingblock">
789 <div class="content">
790 <pre><code>$ git rev-list A B --not $(git merge-base --all A B)
791 $ git rev-list A...B</code></pre>
792 </div></div>
793 <div class="paragraph"><p><em>rev-list</em> is an essential Git command, since it
794 provides the ability to build and traverse commit ancestry graphs. For
795 this reason, it has a lot of different options that enable it to be
796 used by commands as different as <em>git bisect</em> and
797 <em>git repack</em>.</p></div>
798 </div>
799 </div>
800 <div class="sect1">
801 <h2 id="_options">OPTIONS</h2>
802 <div class="sectionbody">
803 <div class="sect2">
804 <h3 id="_commit_limiting">Commit Limiting</h3>
805 <div class="paragraph"><p>Besides specifying a range of commits that should be listed using the
806 special notations explained in the description, additional commit
807 limiting may be applied.</p></div>
808 <div class="paragraph"><p>Using more options generally further limits the output (e.g.
809 <code>--since=&lt;date1&gt;</code> limits to commits newer than <code>&lt;date1&gt;</code>, and using it
810 with <code>--grep=&lt;pattern&gt;</code> further limits to commits whose log message
811 has a line that matches <code>&lt;pattern&gt;</code>), unless otherwise noted.</p></div>
812 <div class="paragraph"><p>Note that these are applied before commit
813 ordering and formatting options, such as <code>--reverse</code>.</p></div>
814 <div class="dlist"><dl>
815 <dt class="hdlist1">
816 -&lt;number&gt;
817 </dt>
818 <dt class="hdlist1">
819 -n &lt;number&gt;
820 </dt>
821 <dt class="hdlist1">
822 --max-count=&lt;number&gt;
823 </dt>
824 <dd>
826 Limit the number of commits to output.
827 </p>
828 </dd>
829 <dt class="hdlist1">
830 --skip=&lt;number&gt;
831 </dt>
832 <dd>
834 Skip <em>number</em> commits before starting to show the commit output.
835 </p>
836 </dd>
837 <dt class="hdlist1">
838 --since=&lt;date&gt;
839 </dt>
840 <dt class="hdlist1">
841 --after=&lt;date&gt;
842 </dt>
843 <dd>
845 Show commits more recent than a specific date.
846 </p>
847 </dd>
848 <dt class="hdlist1">
849 --since-as-filter=&lt;date&gt;
850 </dt>
851 <dd>
853 Show all commits more recent than a specific date. This visits
854 all commits in the range, rather than stopping at the first commit which
855 is older than a specific date.
856 </p>
857 </dd>
858 <dt class="hdlist1">
859 --until=&lt;date&gt;
860 </dt>
861 <dt class="hdlist1">
862 --before=&lt;date&gt;
863 </dt>
864 <dd>
866 Show commits older than a specific date.
867 </p>
868 </dd>
869 <dt class="hdlist1">
870 --max-age=&lt;timestamp&gt;
871 </dt>
872 <dt class="hdlist1">
873 --min-age=&lt;timestamp&gt;
874 </dt>
875 <dd>
877 Limit the commits output to specified time range.
878 </p>
879 </dd>
880 <dt class="hdlist1">
881 --author=&lt;pattern&gt;
882 </dt>
883 <dt class="hdlist1">
884 --committer=&lt;pattern&gt;
885 </dt>
886 <dd>
888 Limit the commits output to ones with author/committer
889 header lines that match the specified pattern (regular
890 expression). With more than one <code>--author=&lt;pattern&gt;</code>,
891 commits whose author matches any of the given patterns are
892 chosen (similarly for multiple <code>--committer=&lt;pattern&gt;</code>).
893 </p>
894 </dd>
895 <dt class="hdlist1">
896 --grep-reflog=&lt;pattern&gt;
897 </dt>
898 <dd>
900 Limit the commits output to ones with reflog entries that
901 match the specified pattern (regular expression). With
902 more than one <code>--grep-reflog</code>, commits whose reflog message
903 matches any of the given patterns are chosen. It is an
904 error to use this option unless <code>--walk-reflogs</code> is in use.
905 </p>
906 </dd>
907 <dt class="hdlist1">
908 --grep=&lt;pattern&gt;
909 </dt>
910 <dd>
912 Limit the commits output to ones with a log message that
913 matches the specified pattern (regular expression). With
914 more than one <code>--grep=&lt;pattern&gt;</code>, commits whose message
915 matches any of the given patterns are chosen (but see
916 <code>--all-match</code>).
917 </p>
918 </dd>
919 <dt class="hdlist1">
920 --all-match
921 </dt>
922 <dd>
924 Limit the commits output to ones that match all given <code>--grep</code>,
925 instead of ones that match at least one.
926 </p>
927 </dd>
928 <dt class="hdlist1">
929 --invert-grep
930 </dt>
931 <dd>
933 Limit the commits output to ones with a log message that do not
934 match the pattern specified with <code>--grep=&lt;pattern&gt;</code>.
935 </p>
936 </dd>
937 <dt class="hdlist1">
939 </dt>
940 <dt class="hdlist1">
941 --regexp-ignore-case
942 </dt>
943 <dd>
945 Match the regular expression limiting patterns without regard to letter
946 case.
947 </p>
948 </dd>
949 <dt class="hdlist1">
950 --basic-regexp
951 </dt>
952 <dd>
954 Consider the limiting patterns to be basic regular expressions;
955 this is the default.
956 </p>
957 </dd>
958 <dt class="hdlist1">
960 </dt>
961 <dt class="hdlist1">
962 --extended-regexp
963 </dt>
964 <dd>
966 Consider the limiting patterns to be extended regular expressions
967 instead of the default basic regular expressions.
968 </p>
969 </dd>
970 <dt class="hdlist1">
972 </dt>
973 <dt class="hdlist1">
974 --fixed-strings
975 </dt>
976 <dd>
978 Consider the limiting patterns to be fixed strings (don&#8217;t interpret
979 pattern as a regular expression).
980 </p>
981 </dd>
982 <dt class="hdlist1">
984 </dt>
985 <dt class="hdlist1">
986 --perl-regexp
987 </dt>
988 <dd>
990 Consider the limiting patterns to be Perl-compatible regular
991 expressions.
992 </p>
993 <div class="paragraph"><p>Support for these types of regular expressions is an optional
994 compile-time dependency. If Git wasn&#8217;t compiled with support for them
995 providing this option will cause it to die.</p></div>
996 </dd>
997 <dt class="hdlist1">
998 --remove-empty
999 </dt>
1000 <dd>
1002 Stop when a given path disappears from the tree.
1003 </p>
1004 </dd>
1005 <dt class="hdlist1">
1006 --merges
1007 </dt>
1008 <dd>
1010 Print only merge commits. This is exactly the same as <code>--min-parents=2</code>.
1011 </p>
1012 </dd>
1013 <dt class="hdlist1">
1014 --no-merges
1015 </dt>
1016 <dd>
1018 Do not print commits with more than one parent. This is
1019 exactly the same as <code>--max-parents=1</code>.
1020 </p>
1021 </dd>
1022 <dt class="hdlist1">
1023 --min-parents=&lt;number&gt;
1024 </dt>
1025 <dt class="hdlist1">
1026 --max-parents=&lt;number&gt;
1027 </dt>
1028 <dt class="hdlist1">
1029 --no-min-parents
1030 </dt>
1031 <dt class="hdlist1">
1032 --no-max-parents
1033 </dt>
1034 <dd>
1036 Show only commits which have at least (or at most) that many parent
1037 commits. In particular, <code>--max-parents=1</code> is the same as <code>--no-merges</code>,
1038 <code>--min-parents=2</code> is the same as <code>--merges</code>. <code>--max-parents=0</code>
1039 gives all root commits and <code>--min-parents=3</code> all octopus merges.
1040 </p>
1041 <div class="paragraph"><p><code>--no-min-parents</code> and <code>--no-max-parents</code> reset these limits (to no limit)
1042 again. Equivalent forms are <code>--min-parents=0</code> (any commit has 0 or more
1043 parents) and <code>--max-parents=-1</code> (negative numbers denote no upper limit).</p></div>
1044 </dd>
1045 <dt class="hdlist1">
1046 --first-parent
1047 </dt>
1048 <dd>
1050 When finding commits to include, follow only the first
1051 parent commit upon seeing a merge commit. This option
1052 can give a better overview when viewing the evolution of
1053 a particular topic branch, because merges into a topic
1054 branch tend to be only about adjusting to updated upstream
1055 from time to time, and this option allows you to ignore
1056 the individual commits brought in to your history by such
1057 a merge.
1058 </p>
1059 </dd>
1060 <dt class="hdlist1">
1061 --exclude-first-parent-only
1062 </dt>
1063 <dd>
1065 When finding commits to exclude (with a <em>&#94;</em>), follow only
1066 the first parent commit upon seeing a merge commit.
1067 This can be used to find the set of changes in a topic branch
1068 from the point where it diverged from the remote branch, given
1069 that arbitrary merges can be valid topic branch changes.
1070 </p>
1071 </dd>
1072 <dt class="hdlist1">
1073 --not
1074 </dt>
1075 <dd>
1077 Reverses the meaning of the <em>&#94;</em> prefix (or lack thereof)
1078 for all following revision specifiers, up to the next <code>--not</code>.
1079 When used on the command line before --stdin, the revisions passed
1080 through stdin will not be affected by it. Conversely, when passed
1081 via standard input, the revisions passed on the command line will
1082 not be affected by it.
1083 </p>
1084 </dd>
1085 <dt class="hdlist1">
1086 --all
1087 </dt>
1088 <dd>
1090 Pretend as if all the refs in <code>refs/</code>, along with <code>HEAD</code>, are
1091 listed on the command line as <em>&lt;commit&gt;</em>.
1092 </p>
1093 </dd>
1094 <dt class="hdlist1">
1095 --branches[=&lt;pattern&gt;]
1096 </dt>
1097 <dd>
1099 Pretend as if all the refs in <code>refs/heads</code> are listed
1100 on the command line as <em>&lt;commit&gt;</em>. If <em>&lt;pattern&gt;</em> is given, limit
1101 branches to ones matching given shell glob. If pattern lacks <em>?</em>,
1102 <em>&#42;</em>, or <em>[</em>, <em>/&#42;</em> at the end is implied.
1103 </p>
1104 </dd>
1105 <dt class="hdlist1">
1106 --tags[=&lt;pattern&gt;]
1107 </dt>
1108 <dd>
1110 Pretend as if all the refs in <code>refs/tags</code> are listed
1111 on the command line as <em>&lt;commit&gt;</em>. If <em>&lt;pattern&gt;</em> is given, limit
1112 tags to ones matching given shell glob. If pattern lacks <em>?</em>, <em>&#42;</em>,
1113 or <em>[</em>, <em>/&#42;</em> at the end is implied.
1114 </p>
1115 </dd>
1116 <dt class="hdlist1">
1117 --remotes[=&lt;pattern&gt;]
1118 </dt>
1119 <dd>
1121 Pretend as if all the refs in <code>refs/remotes</code> are listed
1122 on the command line as <em>&lt;commit&gt;</em>. If <em>&lt;pattern&gt;</em> is given, limit
1123 remote-tracking branches to ones matching given shell glob.
1124 If pattern lacks <em>?</em>, <em>&#42;</em>, or <em>[</em>, <em>/&#42;</em> at the end is implied.
1125 </p>
1126 </dd>
1127 <dt class="hdlist1">
1128 --glob=&lt;glob-pattern&gt;
1129 </dt>
1130 <dd>
1132 Pretend as if all the refs matching shell glob <em>&lt;glob-pattern&gt;</em>
1133 are listed on the command line as <em>&lt;commit&gt;</em>. Leading <em>refs/</em>,
1134 is automatically prepended if missing. If pattern lacks <em>?</em>, <em>&#42;</em>,
1135 or <em>[</em>, <em>/&#42;</em> at the end is implied.
1136 </p>
1137 </dd>
1138 <dt class="hdlist1">
1139 --exclude=&lt;glob-pattern&gt;
1140 </dt>
1141 <dd>
1143 Do not include refs matching <em>&lt;glob-pattern&gt;</em> that the next <code>--all</code>,
1144 <code>--branches</code>, <code>--tags</code>, <code>--remotes</code>, or <code>--glob</code> would otherwise
1145 consider. Repetitions of this option accumulate exclusion patterns
1146 up to the next <code>--all</code>, <code>--branches</code>, <code>--tags</code>, <code>--remotes</code>, or
1147 <code>--glob</code> option (other options or arguments do not clear
1148 accumulated patterns).
1149 </p>
1150 <div class="paragraph"><p>The patterns given should not begin with <code>refs/heads</code>, <code>refs/tags</code>, or
1151 <code>refs/remotes</code> when applied to <code>--branches</code>, <code>--tags</code>, or <code>--remotes</code>,
1152 respectively, and they must begin with <code>refs/</code> when applied to <code>--glob</code>
1153 or <code>--all</code>. If a trailing <em>/&#42;</em> is intended, it must be given
1154 explicitly.</p></div>
1155 </dd>
1156 <dt class="hdlist1">
1157 --exclude-hidden=[fetch|receive|uploadpack]
1158 </dt>
1159 <dd>
1161 Do not include refs that would be hidden by <code>git-fetch</code>,
1162 <code>git-receive-pack</code> or <code>git-upload-pack</code> by consulting the appropriate
1163 <code>fetch.hideRefs</code>, <code>receive.hideRefs</code> or <code>uploadpack.hideRefs</code>
1164 configuration along with <code>transfer.hideRefs</code> (see
1165 <a href="git-config.html">git-config(1)</a>). This option affects the next pseudo-ref option
1166 <code>--all</code> or <code>--glob</code> and is cleared after processing them.
1167 </p>
1168 </dd>
1169 <dt class="hdlist1">
1170 --reflog
1171 </dt>
1172 <dd>
1174 Pretend as if all objects mentioned by reflogs are listed on the
1175 command line as <code>&lt;commit&gt;</code>.
1176 </p>
1177 </dd>
1178 <dt class="hdlist1">
1179 --alternate-refs
1180 </dt>
1181 <dd>
1183 Pretend as if all objects mentioned as ref tips of alternate
1184 repositories were listed on the command line. An alternate
1185 repository is any repository whose object directory is specified
1186 in <code>objects/info/alternates</code>. The set of included objects may
1187 be modified by <code>core.alternateRefsCommand</code>, etc. See
1188 <a href="git-config.html">git-config(1)</a>.
1189 </p>
1190 </dd>
1191 <dt class="hdlist1">
1192 --single-worktree
1193 </dt>
1194 <dd>
1196 By default, all working trees will be examined by the
1197 following options when there are more than one (see
1198 <a href="git-worktree.html">git-worktree(1)</a>): <code>--all</code>, <code>--reflog</code> and
1199 <code>--indexed-objects</code>.
1200 This option forces them to examine the current working tree
1201 only.
1202 </p>
1203 </dd>
1204 <dt class="hdlist1">
1205 --ignore-missing
1206 </dt>
1207 <dd>
1209 Upon seeing an invalid object name in the input, pretend as if
1210 the bad input was not given.
1211 </p>
1212 </dd>
1213 <dt class="hdlist1">
1214 --stdin
1215 </dt>
1216 <dd>
1218 In addition to getting arguments from the command line, read
1219 them from standard input as well. This accepts commits and
1220 pseudo-options like <code>--all</code> and <code>--glob=</code>. When a <code>--</code> separator
1221 is seen, the following input is treated as paths and used to
1222 limit the result. Flags like <code>--not</code> which are read via standard input
1223 are only respected for arguments passed in the same way and will not
1224 influence any subsequent command line arguments.
1225 </p>
1226 </dd>
1227 <dt class="hdlist1">
1228 --quiet
1229 </dt>
1230 <dd>
1232 Don&#8217;t print anything to standard output. This form
1233 is primarily meant to allow the caller to
1234 test the exit status to see if a range of objects is fully
1235 connected (or not). It is faster than redirecting stdout
1236 to <code>/dev/null</code> as the output does not have to be formatted.
1237 </p>
1238 </dd>
1239 <dt class="hdlist1">
1240 --disk-usage
1241 </dt>
1242 <dt class="hdlist1">
1243 --disk-usage=human
1244 </dt>
1245 <dd>
1247 Suppress normal output; instead, print the sum of the bytes used
1248 for on-disk storage by the selected commits or objects. This is
1249 equivalent to piping the output into <code>git cat-file
1250 --batch-check='%(objectsize:disk)'</code>, except that it runs much
1251 faster (especially with <code>--use-bitmap-index</code>). See the <code>CAVEATS</code>
1252 section in <a href="git-cat-file.html">git-cat-file(1)</a> for the limitations of what
1253 "on-disk storage" means.
1254 With the optional value <code>human</code>, on-disk storage size is shown
1255 in human-readable string(e.g. 12.24 Kib, 3.50 Mib).
1256 </p>
1257 </dd>
1258 <dt class="hdlist1">
1259 --cherry-mark
1260 </dt>
1261 <dd>
1263 Like <code>--cherry-pick</code> (see below) but mark equivalent commits
1264 with <code>=</code> rather than omitting them, and inequivalent ones with <code>+</code>.
1265 </p>
1266 </dd>
1267 <dt class="hdlist1">
1268 --cherry-pick
1269 </dt>
1270 <dd>
1272 Omit any commit that introduces the same change as
1273 another commit on the &#8220;other side&#8221; when the set of
1274 commits are limited with symmetric difference.
1275 </p>
1276 <div class="paragraph"><p>For example, if you have two branches, <code>A</code> and <code>B</code>, a usual way
1277 to list all commits on only one side of them is with
1278 <code>--left-right</code> (see the example below in the description of
1279 the <code>--left-right</code> option). However, it shows the commits that were
1280 cherry-picked from the other branch (for example, &#8220;3rd on b&#8221; may be
1281 cherry-picked from branch A). With this option, such pairs of commits are
1282 excluded from the output.</p></div>
1283 </dd>
1284 <dt class="hdlist1">
1285 --left-only
1286 </dt>
1287 <dt class="hdlist1">
1288 --right-only
1289 </dt>
1290 <dd>
1292 List only commits on the respective side of a symmetric difference,
1293 i.e. only those which would be marked <code>&lt;</code> resp. <code>&gt;</code> by
1294 <code>--left-right</code>.
1295 </p>
1296 <div class="paragraph"><p>For example, <code>--cherry-pick --right-only A...B</code> omits those
1297 commits from <code>B</code> which are in <code>A</code> or are patch-equivalent to a commit in
1298 <code>A</code>. In other words, this lists the <code>+</code> commits from <code>git cherry A B</code>.
1299 More precisely, <code>--cherry-pick --right-only --no-merges</code> gives the exact
1300 list.</p></div>
1301 </dd>
1302 <dt class="hdlist1">
1303 --cherry
1304 </dt>
1305 <dd>
1307 A synonym for <code>--right-only --cherry-mark --no-merges</code>; useful to
1308 limit the output to the commits on our side and mark those that
1309 have been applied to the other side of a forked history with
1310 <code>git log --cherry upstream...mybranch</code>, similar to
1311 <code>git cherry upstream mybranch</code>.
1312 </p>
1313 </dd>
1314 <dt class="hdlist1">
1316 </dt>
1317 <dt class="hdlist1">
1318 --walk-reflogs
1319 </dt>
1320 <dd>
1322 Instead of walking the commit ancestry chain, walk
1323 reflog entries from the most recent one to older ones.
1324 When this option is used you cannot specify commits to
1325 exclude (that is, <em>&#94;commit</em>, <em>commit1..commit2</em>,
1326 and <em>commit1...commit2</em> notations cannot be used).
1327 </p>
1328 <div class="paragraph"><p>With <code>--pretty</code> format other than <code>oneline</code> and <code>reference</code> (for obvious reasons),
1329 this causes the output to have two extra lines of information
1330 taken from the reflog. The reflog designator in the output may be shown
1331 as <code>ref@{&lt;Nth&gt;}</code> (where <em>&lt;Nth&gt;</em> is the reverse-chronological index in the
1332 reflog) or as <code>ref@{&lt;timestamp&gt;}</code> (with the <em>&lt;timestamp&gt;</em> for that entry),
1333 depending on a few rules:</p></div>
1334 <div class="openblock">
1335 <div class="content">
1336 <div class="olist arabic"><ol class="arabic">
1337 <li>
1339 If the starting point is specified as <code>ref@{&lt;Nth&gt;}</code>, show the index
1340 format.
1341 </p>
1342 </li>
1343 <li>
1345 If the starting point was specified as <code>ref@{now}</code>, show the
1346 timestamp format.
1347 </p>
1348 </li>
1349 <li>
1351 If neither was used, but <code>--date</code> was given on the command line, show
1352 the timestamp in the format requested by <code>--date</code>.
1353 </p>
1354 </li>
1355 <li>
1357 Otherwise, show the index format.
1358 </p>
1359 </li>
1360 </ol></div>
1361 </div></div>
1362 <div class="paragraph"><p>Under <code>--pretty=oneline</code>, the commit message is
1363 prefixed with this information on the same line.
1364 This option cannot be combined with <code>--reverse</code>.
1365 See also <a href="git-reflog.html">git-reflog(1)</a>.</p></div>
1366 <div class="paragraph"><p>Under <code>--pretty=reference</code>, this information will not be shown at all.</p></div>
1367 </dd>
1368 <dt class="hdlist1">
1369 --merge
1370 </dt>
1371 <dd>
1373 Show commits touching conflicted paths in the range <code>HEAD...&lt;other&gt;</code>,
1374 where <code>&lt;other&gt;</code> is the first existing pseudoref in <code>MERGE_HEAD</code>,
1375 <code>CHERRY_PICK_HEAD</code>, <code>REVERT_HEAD</code> or <code>REBASE_HEAD</code>. Only works
1376 when the index has unmerged entries. This option can be used to show
1377 relevant commits when resolving conflicts from a 3-way merge.
1378 </p>
1379 </dd>
1380 <dt class="hdlist1">
1381 --boundary
1382 </dt>
1383 <dd>
1385 Output excluded boundary commits. Boundary commits are
1386 prefixed with <code>-</code>.
1387 </p>
1388 </dd>
1389 <dt class="hdlist1">
1390 --use-bitmap-index
1391 </dt>
1392 <dd>
1394 Try to speed up the traversal using the pack bitmap index (if
1395 one is available). Note that when traversing with <code>--objects</code>,
1396 trees and blobs will not have their associated path printed.
1397 </p>
1398 </dd>
1399 <dt class="hdlist1">
1400 --progress=&lt;header&gt;
1401 </dt>
1402 <dd>
1404 Show progress reports on stderr as objects are considered. The
1405 <code>&lt;header&gt;</code> text will be printed with each progress update.
1406 </p>
1407 </dd>
1408 </dl></div>
1409 </div>
1410 <div class="sect2">
1411 <h3 id="_history_simplification">History Simplification</h3>
1412 <div class="paragraph"><p>Sometimes you are only interested in parts of the history, for example the
1413 commits modifying a particular &lt;path&gt;. But there are two parts of
1414 <em>History Simplification</em>, one part is selecting the commits and the other
1415 is how to do it, as there are various strategies to simplify the history.</p></div>
1416 <div class="paragraph"><p>The following options select the commits to be shown:</p></div>
1417 <div class="dlist"><dl>
1418 <dt class="hdlist1">
1419 &lt;paths&gt;
1420 </dt>
1421 <dd>
1423 Commits modifying the given &lt;paths&gt; are selected.
1424 </p>
1425 </dd>
1426 <dt class="hdlist1">
1427 --simplify-by-decoration
1428 </dt>
1429 <dd>
1431 Commits that are referred by some branch or tag are selected.
1432 </p>
1433 </dd>
1434 </dl></div>
1435 <div class="paragraph"><p>Note that extra commits can be shown to give a meaningful history.</p></div>
1436 <div class="paragraph"><p>The following options affect the way the simplification is performed:</p></div>
1437 <div class="dlist"><dl>
1438 <dt class="hdlist1">
1439 Default mode
1440 </dt>
1441 <dd>
1443 Simplifies the history to the simplest history explaining the
1444 final state of the tree. Simplest because it prunes some side
1445 branches if the end result is the same (i.e. merging branches
1446 with the same content)
1447 </p>
1448 </dd>
1449 <dt class="hdlist1">
1450 --show-pulls
1451 </dt>
1452 <dd>
1454 Include all commits from the default mode, but also any merge
1455 commits that are not TREESAME to the first parent but are
1456 TREESAME to a later parent. This mode is helpful for showing
1457 the merge commits that "first introduced" a change to a branch.
1458 </p>
1459 </dd>
1460 <dt class="hdlist1">
1461 --full-history
1462 </dt>
1463 <dd>
1465 Same as the default mode, but does not prune some history.
1466 </p>
1467 </dd>
1468 <dt class="hdlist1">
1469 --dense
1470 </dt>
1471 <dd>
1473 Only the selected commits are shown, plus some to have a
1474 meaningful history.
1475 </p>
1476 </dd>
1477 <dt class="hdlist1">
1478 --sparse
1479 </dt>
1480 <dd>
1482 All commits in the simplified history are shown.
1483 </p>
1484 </dd>
1485 <dt class="hdlist1">
1486 --simplify-merges
1487 </dt>
1488 <dd>
1490 Additional option to <code>--full-history</code> to remove some needless
1491 merges from the resulting history, as there are no selected
1492 commits contributing to this merge.
1493 </p>
1494 </dd>
1495 <dt class="hdlist1">
1496 --ancestry-path[=&lt;commit&gt;]
1497 </dt>
1498 <dd>
1500 When given a range of commits to display (e.g. <em>commit1..commit2</em>
1501 or <em>commit2 &#94;commit1</em>), only display commits in that range
1502 that are ancestors of &lt;commit&gt;, descendants of &lt;commit&gt;, or
1503 &lt;commit&gt; itself. If no commit is specified, use <em>commit1</em> (the
1504 excluded part of the range) as &lt;commit&gt;. Can be passed multiple
1505 times; if so, a commit is included if it is any of the commits
1506 given or if it is an ancestor or descendant of one of them.
1507 </p>
1508 </dd>
1509 </dl></div>
1510 <div class="paragraph"><p>A more detailed explanation follows.</p></div>
1511 <div class="paragraph"><p>Suppose you specified <code>foo</code> as the &lt;paths&gt;. We shall call commits
1512 that modify <code>foo</code> !TREESAME, and the rest TREESAME. (In a diff
1513 filtered for <code>foo</code>, they look different and equal, respectively.)</p></div>
1514 <div class="paragraph"><p>In the following, we will always refer to the same example history to
1515 illustrate the differences between simplification settings. We assume
1516 that you are filtering for a file <code>foo</code> in this commit graph:</p></div>
1517 <div class="listingblock">
1518 <div class="content">
1519 <pre><code> .-A---M---N---O---P---Q
1520 / / / / / /
1521 I B C D E Y
1522 \ / / / / /
1523 `-------------' X</code></pre>
1524 </div></div>
1525 <div class="paragraph"><p>The horizontal line of history A---Q is taken to be the first parent of
1526 each merge. The commits are:</p></div>
1527 <div class="ulist"><ul>
1528 <li>
1530 <code>I</code> is the initial commit, in which <code>foo</code> exists with contents
1531 &#8220;asdf&#8221;, and a file <code>quux</code> exists with contents &#8220;quux&#8221;. Initial
1532 commits are compared to an empty tree, so <code>I</code> is !TREESAME.
1533 </p>
1534 </li>
1535 <li>
1537 In <code>A</code>, <code>foo</code> contains just &#8220;foo&#8221;.
1538 </p>
1539 </li>
1540 <li>
1542 <code>B</code> contains the same change as <code>A</code>. Its merge <code>M</code> is trivial and
1543 hence TREESAME to all parents.
1544 </p>
1545 </li>
1546 <li>
1548 <code>C</code> does not change <code>foo</code>, but its merge <code>N</code> changes it to &#8220;foobar&#8221;,
1549 so it is not TREESAME to any parent.
1550 </p>
1551 </li>
1552 <li>
1554 <code>D</code> sets <code>foo</code> to &#8220;baz&#8221;. Its merge <code>O</code> combines the strings from
1555 <code>N</code> and <code>D</code> to &#8220;foobarbaz&#8221;; i.e., it is not TREESAME to any parent.
1556 </p>
1557 </li>
1558 <li>
1560 <code>E</code> changes <code>quux</code> to &#8220;xyzzy&#8221;, and its merge <code>P</code> combines the
1561 strings to &#8220;quux xyzzy&#8221;. <code>P</code> is TREESAME to <code>O</code>, but not to <code>E</code>.
1562 </p>
1563 </li>
1564 <li>
1566 <code>X</code> is an independent root commit that added a new file <code>side</code>, and <code>Y</code>
1567 modified it. <code>Y</code> is TREESAME to <code>X</code>. Its merge <code>Q</code> added <code>side</code> to <code>P</code>, and
1568 <code>Q</code> is TREESAME to <code>P</code>, but not to <code>Y</code>.
1569 </p>
1570 </li>
1571 </ul></div>
1572 <div class="paragraph"><p><code>rev-list</code> walks backwards through history, including or excluding
1573 commits based on whether <code>--full-history</code> and/or parent rewriting
1574 (via <code>--parents</code> or <code>--children</code>) are used. The following settings
1575 are available.</p></div>
1576 <div class="dlist"><dl>
1577 <dt class="hdlist1">
1578 Default mode
1579 </dt>
1580 <dd>
1582 Commits are included if they are not TREESAME to any parent
1583 (though this can be changed, see <code>--sparse</code> below). If the
1584 commit was a merge, and it was TREESAME to one parent, follow
1585 only that parent. (Even if there are several TREESAME
1586 parents, follow only one of them.) Otherwise, follow all
1587 parents.
1588 </p>
1589 <div class="paragraph"><p>This results in:</p></div>
1590 <div class="listingblock">
1591 <div class="content">
1592 <pre><code> .-A---N---O
1593 / / /
1594 I---------D</code></pre>
1595 </div></div>
1596 <div class="paragraph"><p>Note how the rule to only follow the TREESAME parent, if one is
1597 available, removed <code>B</code> from consideration entirely. <code>C</code> was
1598 considered via <code>N</code>, but is TREESAME. Root commits are compared to an
1599 empty tree, so <code>I</code> is !TREESAME.</p></div>
1600 <div class="paragraph"><p>Parent/child relations are only visible with <code>--parents</code>, but that does
1601 not affect the commits selected in default mode, so we have shown the
1602 parent lines.</p></div>
1603 </dd>
1604 <dt class="hdlist1">
1605 --full-history without parent rewriting
1606 </dt>
1607 <dd>
1609 This mode differs from the default in one point: always follow
1610 all parents of a merge, even if it is TREESAME to one of them.
1611 Even if more than one side of the merge has commits that are
1612 included, this does not imply that the merge itself is! In
1613 the example, we get
1614 </p>
1615 <div class="listingblock">
1616 <div class="content">
1617 <pre><code> I A B N D O P Q</code></pre>
1618 </div></div>
1619 <div class="paragraph"><p><code>M</code> was excluded because it is TREESAME to both parents. <code>E</code>,
1620 <code>C</code> and <code>B</code> were all walked, but only <code>B</code> was !TREESAME, so the others
1621 do not appear.</p></div>
1622 <div class="paragraph"><p>Note that without parent rewriting, it is not really possible to talk
1623 about the parent/child relationships between the commits, so we show
1624 them disconnected.</p></div>
1625 </dd>
1626 <dt class="hdlist1">
1627 --full-history with parent rewriting
1628 </dt>
1629 <dd>
1631 Ordinary commits are only included if they are !TREESAME
1632 (though this can be changed, see <code>--sparse</code> below).
1633 </p>
1634 <div class="paragraph"><p>Merges are always included. However, their parent list is rewritten:
1635 Along each parent, prune away commits that are not included
1636 themselves. This results in</p></div>
1637 <div class="listingblock">
1638 <div class="content">
1639 <pre><code> .-A---M---N---O---P---Q
1640 / / / / /
1641 I B / D /
1642 \ / / / /
1643 `-------------'</code></pre>
1644 </div></div>
1645 <div class="paragraph"><p>Compare to <code>--full-history</code> without rewriting above. Note that <code>E</code>
1646 was pruned away because it is TREESAME, but the parent list of P was
1647 rewritten to contain <code>E</code>'s parent <code>I</code>. The same happened for <code>C</code> and
1648 <code>N</code>, and <code>X</code>, <code>Y</code> and <code>Q</code>.</p></div>
1649 </dd>
1650 </dl></div>
1651 <div class="paragraph"><p>In addition to the above settings, you can change whether TREESAME
1652 affects inclusion:</p></div>
1653 <div class="dlist"><dl>
1654 <dt class="hdlist1">
1655 --dense
1656 </dt>
1657 <dd>
1659 Commits that are walked are included if they are not TREESAME
1660 to any parent.
1661 </p>
1662 </dd>
1663 <dt class="hdlist1">
1664 --sparse
1665 </dt>
1666 <dd>
1668 All commits that are walked are included.
1669 </p>
1670 <div class="paragraph"><p>Note that without <code>--full-history</code>, this still simplifies merges: if
1671 one of the parents is TREESAME, we follow only that one, so the other
1672 sides of the merge are never walked.</p></div>
1673 </dd>
1674 <dt class="hdlist1">
1675 --simplify-merges
1676 </dt>
1677 <dd>
1679 First, build a history graph in the same way that
1680 <code>--full-history</code> with parent rewriting does (see above).
1681 </p>
1682 <div class="paragraph"><p>Then simplify each commit <code>C</code> to its replacement <code>C'</code> in the final
1683 history according to the following rules:</p></div>
1684 <div class="openblock">
1685 <div class="content">
1686 <div class="ulist"><ul>
1687 <li>
1689 Set <code>C'</code> to <code>C</code>.
1690 </p>
1691 </li>
1692 <li>
1694 Replace each parent <code>P</code> of <code>C'</code> with its simplification <code>P'</code>. In
1695 the process, drop parents that are ancestors of other parents or that are
1696 root commits TREESAME to an empty tree, and remove duplicates, but take care
1697 to never drop all parents that we are TREESAME to.
1698 </p>
1699 </li>
1700 <li>
1702 If after this parent rewriting, <code>C'</code> is a root or merge commit (has
1703 zero or &gt;1 parents), a boundary commit, or !TREESAME, it remains.
1704 Otherwise, it is replaced with its only parent.
1705 </p>
1706 </li>
1707 </ul></div>
1708 </div></div>
1709 <div class="paragraph"><p>The effect of this is best shown by way of comparing to
1710 <code>--full-history</code> with parent rewriting. The example turns into:</p></div>
1711 <div class="listingblock">
1712 <div class="content">
1713 <pre><code> .-A---M---N---O
1714 / / /
1715 I B D
1716 \ / /
1717 `---------'</code></pre>
1718 </div></div>
1719 <div class="paragraph"><p>Note the major differences in <code>N</code>, <code>P</code>, and <code>Q</code> over <code>--full-history</code>:</p></div>
1720 <div class="openblock">
1721 <div class="content">
1722 <div class="ulist"><ul>
1723 <li>
1725 <code>N</code>'s parent list had <code>I</code> removed, because it is an ancestor of the
1726 other parent <code>M</code>. Still, <code>N</code> remained because it is !TREESAME.
1727 </p>
1728 </li>
1729 <li>
1731 <code>P</code>'s parent list similarly had <code>I</code> removed. <code>P</code> was then
1732 removed completely, because it had one parent and is TREESAME.
1733 </p>
1734 </li>
1735 <li>
1737 <code>Q</code>'s parent list had <code>Y</code> simplified to <code>X</code>. <code>X</code> was then removed, because it
1738 was a TREESAME root. <code>Q</code> was then removed completely, because it had one
1739 parent and is TREESAME.
1740 </p>
1741 </li>
1742 </ul></div>
1743 </div></div>
1744 </dd>
1745 </dl></div>
1746 <div class="paragraph"><p>There is another simplification mode available:</p></div>
1747 <div class="dlist"><dl>
1748 <dt class="hdlist1">
1749 --ancestry-path[=&lt;commit&gt;]
1750 </dt>
1751 <dd>
1753 Limit the displayed commits to those which are an ancestor of
1754 &lt;commit&gt;, or which are a descendant of &lt;commit&gt;, or are &lt;commit&gt;
1755 itself.
1756 </p>
1757 <div class="paragraph"><p>As an example use case, consider the following commit history:</p></div>
1758 <div class="listingblock">
1759 <div class="content">
1760 <pre><code> D---E-------F
1761 / \ \
1762 B---C---G---H---I---J
1764 A-------K---------------L--M</code></pre>
1765 </div></div>
1766 <div class="paragraph"><p>A regular <em>D..M</em> computes the set of commits that are ancestors of <code>M</code>,
1767 but excludes the ones that are ancestors of <code>D</code>. This is useful to see
1768 what happened to the history leading to <code>M</code> since <code>D</code>, in the sense
1769 that &#8220;what does <code>M</code> have that did not exist in <code>D</code>&#8221;. The result in this
1770 example would be all the commits, except <code>A</code> and <code>B</code> (and <code>D</code> itself,
1771 of course).</p></div>
1772 <div class="paragraph"><p>When we want to find out what commits in <code>M</code> are contaminated with the
1773 bug introduced by <code>D</code> and need fixing, however, we might want to view
1774 only the subset of <em>D..M</em> that are actually descendants of <code>D</code>, i.e.
1775 excluding <code>C</code> and <code>K</code>. This is exactly what the <code>--ancestry-path</code>
1776 option does. Applied to the <em>D..M</em> range, it results in:</p></div>
1777 <div class="listingblock">
1778 <div class="content">
1779 <pre><code> E-------F
1781 G---H---I---J
1783 L--M</code></pre>
1784 </div></div>
1785 <div class="paragraph"><p>We can also use <code>--ancestry-path=D</code> instead of <code>--ancestry-path</code> which
1786 means the same thing when applied to the <em>D..M</em> range but is just more
1787 explicit.</p></div>
1788 <div class="paragraph"><p>If we instead are interested in a given topic within this range, and all
1789 commits affected by that topic, we may only want to view the subset of
1790 <code>D..M</code> which contain that topic in their ancestry path. So, using
1791 <code>--ancestry-path=H D..M</code> for example would result in:</p></div>
1792 <div class="listingblock">
1793 <div class="content">
1794 <pre><code> E
1796 G---H---I---J
1798 L--M</code></pre>
1799 </div></div>
1800 <div class="paragraph"><p>Whereas <code>--ancestry-path=K D..M</code> would result in</p></div>
1801 <div class="listingblock">
1802 <div class="content">
1803 <pre><code> K---------------L--M</code></pre>
1804 </div></div>
1805 </dd>
1806 </dl></div>
1807 <div class="paragraph"><p>Before discussing another option, <code>--show-pulls</code>, we need to
1808 create a new example history.</p></div>
1809 <div class="paragraph"><p>A common problem users face when looking at simplified history is that a
1810 commit they know changed a file somehow does not appear in the file&#8217;s
1811 simplified history. Let&#8217;s demonstrate a new example and show how options
1812 such as <code>--full-history</code> and <code>--simplify-merges</code> works in that case:</p></div>
1813 <div class="listingblock">
1814 <div class="content">
1815 <pre><code> .-A---M-----C--N---O---P
1816 / / \ \ \/ / /
1817 I B \ R-'`-Z' /
1818 \ / \/ /
1819 \ / /\ /
1820 `---X--' `---Y--'</code></pre>
1821 </div></div>
1822 <div class="paragraph"><p>For this example, suppose <code>I</code> created <code>file.txt</code> which was modified by
1823 <code>A</code>, <code>B</code>, and <code>X</code> in different ways. The single-parent commits <code>C</code>, <code>Z</code>,
1824 and <code>Y</code> do not change <code>file.txt</code>. The merge commit <code>M</code> was created by
1825 resolving the merge conflict to include both changes from <code>A</code> and <code>B</code>
1826 and hence is not TREESAME to either. The merge commit <code>R</code>, however, was
1827 created by ignoring the contents of <code>file.txt</code> at <code>M</code> and taking only
1828 the contents of <code>file.txt</code> at <code>X</code>. Hence, <code>R</code> is TREESAME to <code>X</code> but not
1829 <code>M</code>. Finally, the natural merge resolution to create <code>N</code> is to take the
1830 contents of <code>file.txt</code> at <code>R</code>, so <code>N</code> is TREESAME to <code>R</code> but not <code>C</code>.
1831 The merge commits <code>O</code> and <code>P</code> are TREESAME to their first parents, but
1832 not to their second parents, <code>Z</code> and <code>Y</code> respectively.</p></div>
1833 <div class="paragraph"><p>When using the default mode, <code>N</code> and <code>R</code> both have a TREESAME parent, so
1834 those edges are walked and the others are ignored. The resulting history
1835 graph is:</p></div>
1836 <div class="listingblock">
1837 <div class="content">
1838 <pre><code> I---X</code></pre>
1839 </div></div>
1840 <div class="paragraph"><p>When using <code>--full-history</code>, Git walks every edge. This will discover
1841 the commits <code>A</code> and <code>B</code> and the merge <code>M</code>, but also will reveal the
1842 merge commits <code>O</code> and <code>P</code>. With parent rewriting, the resulting graph is:</p></div>
1843 <div class="listingblock">
1844 <div class="content">
1845 <pre><code> .-A---M--------N---O---P
1846 / / \ \ \/ / /
1847 I B \ R-'`--' /
1848 \ / \/ /
1849 \ / /\ /
1850 `---X--' `------'</code></pre>
1851 </div></div>
1852 <div class="paragraph"><p>Here, the merge commits <code>O</code> and <code>P</code> contribute extra noise, as they did
1853 not actually contribute a change to <code>file.txt</code>. They only merged a topic
1854 that was based on an older version of <code>file.txt</code>. This is a common
1855 issue in repositories using a workflow where many contributors work in
1856 parallel and merge their topic branches along a single trunk: many
1857 unrelated merges appear in the <code>--full-history</code> results.</p></div>
1858 <div class="paragraph"><p>When using the <code>--simplify-merges</code> option, the commits <code>O</code> and <code>P</code>
1859 disappear from the results. This is because the rewritten second parents
1860 of <code>O</code> and <code>P</code> are reachable from their first parents. Those edges are
1861 removed and then the commits look like single-parent commits that are
1862 TREESAME to their parent. This also happens to the commit <code>N</code>, resulting
1863 in a history view as follows:</p></div>
1864 <div class="listingblock">
1865 <div class="content">
1866 <pre><code> .-A---M--.
1867 / / \
1868 I B R
1869 \ / /
1870 \ / /
1871 `---X--'</code></pre>
1872 </div></div>
1873 <div class="paragraph"><p>In this view, we see all of the important single-parent changes from
1874 <code>A</code>, <code>B</code>, and <code>X</code>. We also see the carefully-resolved merge <code>M</code> and the
1875 not-so-carefully-resolved merge <code>R</code>. This is usually enough information
1876 to determine why the commits <code>A</code> and <code>B</code> "disappeared" from history in
1877 the default view. However, there are a few issues with this approach.</p></div>
1878 <div class="paragraph"><p>The first issue is performance. Unlike any previous option, the
1879 <code>--simplify-merges</code> option requires walking the entire commit history
1880 before returning a single result. This can make the option difficult to
1881 use for very large repositories.</p></div>
1882 <div class="paragraph"><p>The second issue is one of auditing. When many contributors are working
1883 on the same repository, it is important which merge commits introduced
1884 a change into an important branch. The problematic merge <code>R</code> above is
1885 not likely to be the merge commit that was used to merge into an
1886 important branch. Instead, the merge <code>N</code> was used to merge <code>R</code> and <code>X</code>
1887 into the important branch. This commit may have information about why
1888 the change <code>X</code> came to override the changes from <code>A</code> and <code>B</code> in its
1889 commit message.</p></div>
1890 <div class="dlist"><dl>
1891 <dt class="hdlist1">
1892 --show-pulls
1893 </dt>
1894 <dd>
1896 In addition to the commits shown in the default history, show
1897 each merge commit that is not TREESAME to its first parent but
1898 is TREESAME to a later parent.
1899 </p>
1900 <div class="paragraph"><p>When a merge commit is included by <code>--show-pulls</code>, the merge is
1901 treated as if it "pulled" the change from another branch. When using
1902 <code>--show-pulls</code> on this example (and no other options) the resulting
1903 graph is:</p></div>
1904 <div class="listingblock">
1905 <div class="content">
1906 <pre><code> I---X---R---N</code></pre>
1907 </div></div>
1908 <div class="paragraph"><p>Here, the merge commits <code>R</code> and <code>N</code> are included because they pulled
1909 the commits <code>X</code> and <code>R</code> into the base branch, respectively. These
1910 merges are the reason the commits <code>A</code> and <code>B</code> do not appear in the
1911 default history.</p></div>
1912 <div class="paragraph"><p>When <code>--show-pulls</code> is paired with <code>--simplify-merges</code>, the
1913 graph includes all of the necessary information:</p></div>
1914 <div class="listingblock">
1915 <div class="content">
1916 <pre><code> .-A---M--. N
1917 / / \ /
1918 I B R
1919 \ / /
1920 \ / /
1921 `---X--'</code></pre>
1922 </div></div>
1923 <div class="paragraph"><p>Notice that since <code>M</code> is reachable from <code>R</code>, the edge from <code>N</code> to <code>M</code>
1924 was simplified away. However, <code>N</code> still appears in the history as an
1925 important commit because it "pulled" the change <code>R</code> into the main
1926 branch.</p></div>
1927 </dd>
1928 </dl></div>
1929 <div class="paragraph"><p>The <code>--simplify-by-decoration</code> option allows you to view only the
1930 big picture of the topology of the history, by omitting commits
1931 that are not referenced by tags. Commits are marked as !TREESAME
1932 (in other words, kept after history simplification rules described
1933 above) if (1) they are referenced by tags, or (2) they change the
1934 contents of the paths given on the command line. All other
1935 commits are marked as TREESAME (subject to be simplified away).</p></div>
1936 </div>
1937 <div class="sect2">
1938 <h3 id="_bisection_helpers">Bisection Helpers</h3>
1939 <div class="dlist"><dl>
1940 <dt class="hdlist1">
1941 --bisect
1942 </dt>
1943 <dd>
1945 Limit output to the one commit object which is roughly halfway between
1946 included and excluded commits. Note that the bad bisection ref
1947 <code>refs/bisect/bad</code> is added to the included commits (if it
1948 exists) and the good bisection refs <code>refs/bisect/good-*</code> are
1949 added to the excluded commits (if they exist). Thus, supposing there
1950 are no refs in <code>refs/bisect/</code>, if
1951 </p>
1952 <div class="listingblock">
1953 <div class="content">
1954 <pre><code> $ git rev-list --bisect foo ^bar ^baz</code></pre>
1955 </div></div>
1956 <div class="paragraph"><p>outputs <em>midpoint</em>, the output of the two commands</p></div>
1957 <div class="listingblock">
1958 <div class="content">
1959 <pre><code> $ git rev-list foo ^midpoint
1960 $ git rev-list midpoint ^bar ^baz</code></pre>
1961 </div></div>
1962 <div class="paragraph"><p>would be of roughly the same length. Finding the change which
1963 introduces a regression is thus reduced to a binary search: repeatedly
1964 generate and test new 'midpoint&#8217;s until the commit chain is of length
1965 one.</p></div>
1966 </dd>
1967 <dt class="hdlist1">
1968 --bisect-vars
1969 </dt>
1970 <dd>
1972 This calculates the same as <code>--bisect</code>, except that refs in
1973 <code>refs/bisect/</code> are not used, and except that this outputs
1974 text ready to be eval&#8217;ed by the shell. These lines will assign the
1975 name of the midpoint revision to the variable <code>bisect_rev</code>, and the
1976 expected number of commits to be tested after <code>bisect_rev</code> is tested
1977 to <code>bisect_nr</code>, the expected number of commits to be tested if
1978 <code>bisect_rev</code> turns out to be good to <code>bisect_good</code>, the expected
1979 number of commits to be tested if <code>bisect_rev</code> turns out to be bad to
1980 <code>bisect_bad</code>, and the number of commits we are bisecting right now to
1981 <code>bisect_all</code>.
1982 </p>
1983 </dd>
1984 <dt class="hdlist1">
1985 --bisect-all
1986 </dt>
1987 <dd>
1989 This outputs all the commit objects between the included and excluded
1990 commits, ordered by their distance to the included and excluded
1991 commits. Refs in <code>refs/bisect/</code> are not used. The farthest
1992 from them is displayed first. (This is the only one displayed by
1993 <code>--bisect</code>.)
1994 </p>
1995 <div class="paragraph"><p>This is useful because it makes it easy to choose a good commit to
1996 test when you want to avoid to test some of them for some reason (they
1997 may not compile for example).</p></div>
1998 <div class="paragraph"><p>This option can be used along with <code>--bisect-vars</code>, in this case,
1999 after all the sorted commit objects, there will be the same text as if
2000 <code>--bisect-vars</code> had been used alone.</p></div>
2001 </dd>
2002 </dl></div>
2003 </div>
2004 <div class="sect2">
2005 <h3 id="_commit_ordering">Commit Ordering</h3>
2006 <div class="paragraph"><p>By default, the commits are shown in reverse chronological order.</p></div>
2007 <div class="dlist"><dl>
2008 <dt class="hdlist1">
2009 --date-order
2010 </dt>
2011 <dd>
2013 Show no parents before all of its children are shown, but
2014 otherwise show commits in the commit timestamp order.
2015 </p>
2016 </dd>
2017 <dt class="hdlist1">
2018 --author-date-order
2019 </dt>
2020 <dd>
2022 Show no parents before all of its children are shown, but
2023 otherwise show commits in the author timestamp order.
2024 </p>
2025 </dd>
2026 <dt class="hdlist1">
2027 --topo-order
2028 </dt>
2029 <dd>
2031 Show no parents before all of its children are shown, and
2032 avoid showing commits on multiple lines of history
2033 intermixed.
2034 </p>
2035 <div class="paragraph"><p>For example, in a commit history like this:</p></div>
2036 <div class="listingblock">
2037 <div class="content">
2038 <pre><code> ---1----2----4----7
2040 3----5----6----8---</code></pre>
2041 </div></div>
2042 <div class="paragraph"><p>where the numbers denote the order of commit timestamps, <code>git
2043 rev-list</code> and friends with <code>--date-order</code> show the commits in the
2044 timestamp order: 8 7 6 5 4 3 2 1.</p></div>
2045 <div class="paragraph"><p>With <code>--topo-order</code>, they would show 8 6 5 3 7 4 2 1 (or 8 7 4 2 6 5
2046 3 1); some older commits are shown before newer ones in order to
2047 avoid showing the commits from two parallel development track mixed
2048 together.</p></div>
2049 </dd>
2050 <dt class="hdlist1">
2051 --reverse
2052 </dt>
2053 <dd>
2055 Output the commits chosen to be shown (see Commit Limiting
2056 section above) in reverse order. Cannot be combined with
2057 <code>--walk-reflogs</code>.
2058 </p>
2059 </dd>
2060 </dl></div>
2061 </div>
2062 <div class="sect2">
2063 <h3 id="_object_traversal">Object Traversal</h3>
2064 <div class="paragraph"><p>These options are mostly targeted for packing of Git repositories.</p></div>
2065 <div class="dlist"><dl>
2066 <dt class="hdlist1">
2067 --objects
2068 </dt>
2069 <dd>
2071 Print the object IDs of any object referenced by the listed
2072 commits. <code>--objects foo ^bar</code> thus means &#8220;send me
2073 all object IDs which I need to download if I have the commit
2074 object <em>bar</em> but not <em>foo</em>&#8221;. See also <code>--object-names</code> below.
2075 </p>
2076 </dd>
2077 <dt class="hdlist1">
2078 --in-commit-order
2079 </dt>
2080 <dd>
2082 Print tree and blob ids in order of the commits. The tree
2083 and blob ids are printed after they are first referenced
2084 by a commit.
2085 </p>
2086 </dd>
2087 <dt class="hdlist1">
2088 --objects-edge
2089 </dt>
2090 <dd>
2092 Similar to <code>--objects</code>, but also print the IDs of excluded
2093 commits prefixed with a &#8220;-&#8221; character. This is used by
2094 <a href="git-pack-objects.html">git-pack-objects(1)</a> to build a &#8220;thin&#8221; pack, which records
2095 objects in deltified form based on objects contained in these
2096 excluded commits to reduce network traffic.
2097 </p>
2098 </dd>
2099 <dt class="hdlist1">
2100 --objects-edge-aggressive
2101 </dt>
2102 <dd>
2104 Similar to <code>--objects-edge</code>, but it tries harder to find excluded
2105 commits at the cost of increased time. This is used instead of
2106 <code>--objects-edge</code> to build &#8220;thin&#8221; packs for shallow repositories.
2107 </p>
2108 </dd>
2109 <dt class="hdlist1">
2110 --indexed-objects
2111 </dt>
2112 <dd>
2114 Pretend as if all trees and blobs used by the index are listed
2115 on the command line. Note that you probably want to use
2116 <code>--objects</code>, too.
2117 </p>
2118 </dd>
2119 <dt class="hdlist1">
2120 --unpacked
2121 </dt>
2122 <dd>
2124 Only useful with <code>--objects</code>; print the object IDs that are not
2125 in packs.
2126 </p>
2127 </dd>
2128 <dt class="hdlist1">
2129 --object-names
2130 </dt>
2131 <dd>
2133 Only useful with <code>--objects</code>; print the names of the object IDs
2134 that are found. This is the default behavior. Note that the
2135 "name" of each object is ambiguous, and mostly intended as a
2136 hint for packing objects. In particular: no distinction is made between
2137 the names of tags, trees, and blobs; path names may be modified
2138 to remove newlines; and if an object would appear multiple times
2139 with different names, only one name is shown.
2140 </p>
2141 </dd>
2142 <dt class="hdlist1">
2143 --no-object-names
2144 </dt>
2145 <dd>
2147 Only useful with <code>--objects</code>; does not print the names of the object
2148 IDs that are found. This inverts <code>--object-names</code>. This flag allows
2149 the output to be more easily parsed by commands such as
2150 <a href="git-cat-file.html">git-cat-file(1)</a>.
2151 </p>
2152 </dd>
2153 <dt class="hdlist1">
2154 --filter=&lt;filter-spec&gt;
2155 </dt>
2156 <dd>
2158 Only useful with one of the <code>--objects*</code>; omits objects (usually
2159 blobs) from the list of printed objects. The <em>&lt;filter-spec&gt;</em>
2160 may be one of the following:
2161 </p>
2162 <div class="paragraph"><p>The form <em>--filter=blob:none</em> omits all blobs.</p></div>
2163 <div class="paragraph"><p>The form <em>--filter=blob:limit=&lt;n&gt;[kmg]</em> omits blobs of size at least n
2164 bytes or units. n may be zero. The suffixes k, m, and g can be used
2165 to name units in KiB, MiB, or GiB. For example, <em>blob:limit=1k</em>
2166 is the same as <em>blob:limit=1024</em>.</p></div>
2167 <div class="paragraph"><p>The form <em>--filter=object:type=(tag|commit|tree|blob)</em> omits all objects
2168 which are not of the requested type.</p></div>
2169 <div class="paragraph"><p>The form <em>--filter=sparse:oid=&lt;blob-ish&gt;</em> uses a sparse-checkout
2170 specification contained in the blob (or blob-expression) <em>&lt;blob-ish&gt;</em>
2171 to omit blobs that would not be required for a sparse checkout on
2172 the requested refs.</p></div>
2173 <div class="paragraph"><p>The form <em>--filter=tree:&lt;depth&gt;</em> omits all blobs and trees whose depth
2174 from the root tree is &gt;= &lt;depth&gt; (minimum depth if an object is located
2175 at multiple depths in the commits traversed). &lt;depth&gt;=0 will not include
2176 any trees or blobs unless included explicitly in the command-line (or
2177 standard input when --stdin is used). &lt;depth&gt;=1 will include only the
2178 tree and blobs which are referenced directly by a commit reachable from
2179 &lt;commit&gt; or an explicitly-given object. &lt;depth&gt;=2 is like &lt;depth&gt;=1
2180 while also including trees and blobs one more level removed from an
2181 explicitly-given commit or tree.</p></div>
2182 <div class="paragraph"><p>Note that the form <em>--filter=sparse:path=&lt;path&gt;</em> that wants to read
2183 from an arbitrary path on the filesystem has been dropped for security
2184 reasons.</p></div>
2185 <div class="paragraph"><p>Multiple <em>--filter=</em> flags can be specified to combine filters. Only
2186 objects which are accepted by every filter are included.</p></div>
2187 <div class="paragraph"><p>The form <em>--filter=combine:&lt;filter1&gt;+&lt;filter2&gt;+&#8230;&lt;filterN&gt;</em> can also be
2188 used to combined several filters, but this is harder than just repeating
2189 the <em>--filter</em> flag and is usually not necessary. Filters are joined by
2190 <em>&#43;</em> and individual filters are %-encoded (i.e. URL-encoded).
2191 Besides the <em>&#43;</em> and <em>%</em> characters, the following characters are
2192 reserved and also must be encoded: <code>~!@#$^&amp;*()[]{}\;",&lt;&gt;?</code><code>&#39;&#96;</code>
2193 as well as all characters with ASCII code &lt;= <code>0x20</code>, which includes
2194 space and newline.</p></div>
2195 <div class="paragraph"><p>Other arbitrary characters can also be encoded. For instance,
2196 <em>combine:tree:3+blob:none</em> and <em>combine:tree%3A3+blob%3Anone</em> are
2197 equivalent.</p></div>
2198 </dd>
2199 <dt class="hdlist1">
2200 --no-filter
2201 </dt>
2202 <dd>
2204 Turn off any previous <code>--filter=</code> argument.
2205 </p>
2206 </dd>
2207 <dt class="hdlist1">
2208 --filter-provided-objects
2209 </dt>
2210 <dd>
2212 Filter the list of explicitly provided objects, which would otherwise
2213 always be printed even if they did not match any of the filters. Only
2214 useful with <code>--filter=</code>.
2215 </p>
2216 </dd>
2217 <dt class="hdlist1">
2218 --filter-print-omitted
2219 </dt>
2220 <dd>
2222 Only useful with <code>--filter=</code>; prints a list of the objects omitted
2223 by the filter. Object IDs are prefixed with a &#8220;~&#8221; character.
2224 </p>
2225 </dd>
2226 <dt class="hdlist1">
2227 --missing=&lt;missing-action&gt;
2228 </dt>
2229 <dd>
2231 A debug option to help with future "partial clone" development.
2232 This option specifies how missing objects are handled.
2233 </p>
2234 <div class="paragraph"><p>The form <em>--missing=error</em> requests that rev-list stop with an error if
2235 a missing object is encountered. This is the default action.</p></div>
2236 <div class="paragraph"><p>The form <em>--missing=allow-any</em> will allow object traversal to continue
2237 if a missing object is encountered. Missing objects will silently be
2238 omitted from the results.</p></div>
2239 <div class="paragraph"><p>The form <em>--missing=allow-promisor</em> is like <em>allow-any</em>, but will only
2240 allow object traversal to continue for EXPECTED promisor missing objects.
2241 Unexpected missing objects will raise an error.</p></div>
2242 <div class="paragraph"><p>The form <em>--missing=print</em> is like <em>allow-any</em>, but will also print a
2243 list of the missing objects. Object IDs are prefixed with a &#8220;?&#8221; character.</p></div>
2244 <div class="paragraph"><p>If some tips passed to the traversal are missing, they will be
2245 considered as missing too, and the traversal will ignore them. In case
2246 we cannot get their Object ID though, an error will be raised.</p></div>
2247 </dd>
2248 <dt class="hdlist1">
2249 --exclude-promisor-objects
2250 </dt>
2251 <dd>
2253 (For internal use only.) Prefilter object traversal at
2254 promisor boundary. This is used with partial clone. This is
2255 stronger than <code>--missing=allow-promisor</code> because it limits the
2256 traversal, rather than just silencing errors about missing
2257 objects.
2258 </p>
2259 </dd>
2260 <dt class="hdlist1">
2261 --no-walk[=(sorted|unsorted)]
2262 </dt>
2263 <dd>
2265 Only show the given commits, but do not traverse their ancestors.
2266 This has no effect if a range is specified. If the argument
2267 <code>unsorted</code> is given, the commits are shown in the order they were
2268 given on the command line. Otherwise (if <code>sorted</code> or no argument
2269 was given), the commits are shown in reverse chronological order
2270 by commit time.
2271 Cannot be combined with <code>--graph</code>.
2272 </p>
2273 </dd>
2274 <dt class="hdlist1">
2275 --do-walk
2276 </dt>
2277 <dd>
2279 Overrides a previous <code>--no-walk</code>.
2280 </p>
2281 </dd>
2282 </dl></div>
2283 </div>
2284 <div class="sect2">
2285 <h3 id="_commit_formatting">Commit Formatting</h3>
2286 <div class="paragraph"><p>Using these options, <a href="git-rev-list.html">git-rev-list(1)</a> will act similar to the
2287 more specialized family of commit log tools: <a href="git-log.html">git-log(1)</a>,
2288 <a href="git-show.html">git-show(1)</a>, and <a href="git-whatchanged.html">git-whatchanged(1)</a></p></div>
2289 <div class="dlist"><dl>
2290 <dt class="hdlist1">
2291 --pretty[=&lt;format&gt;]
2292 </dt>
2293 <dt class="hdlist1">
2294 --format=&lt;format&gt;
2295 </dt>
2296 <dd>
2298 Pretty-print the contents of the commit logs in a given format,
2299 where <em>&lt;format&gt;</em> can be one of <em>oneline</em>, <em>short</em>, <em>medium</em>,
2300 <em>full</em>, <em>fuller</em>, <em>reference</em>, <em>email</em>, <em>raw</em>, <em>format:&lt;string&gt;</em>
2301 and <em>tformat:&lt;string&gt;</em>. When <em>&lt;format&gt;</em> is none of the above,
2302 and has <em>%placeholder</em> in it, it acts as if
2303 <em>--pretty=tformat:&lt;format&gt;</em> were given.
2304 </p>
2305 <div class="paragraph"><p>See the "PRETTY FORMATS" section for some additional details for each
2306 format. When <em>=&lt;format&gt;</em> part is omitted, it defaults to <em>medium</em>.</p></div>
2307 <div class="paragraph"><p>Note: you can specify the default pretty format in the repository
2308 configuration (see <a href="git-config.html">git-config(1)</a>).</p></div>
2309 </dd>
2310 <dt class="hdlist1">
2311 --abbrev-commit
2312 </dt>
2313 <dd>
2315 Instead of showing the full 40-byte hexadecimal commit object
2316 name, show a prefix that names the object uniquely.
2317 "--abbrev=&lt;n&gt;" (which also modifies diff output, if it is displayed)
2318 option can be used to specify the minimum length of the prefix.
2319 </p>
2320 <div class="paragraph"><p>This should make "--pretty=oneline" a whole lot more readable for
2321 people using 80-column terminals.</p></div>
2322 </dd>
2323 <dt class="hdlist1">
2324 --no-abbrev-commit
2325 </dt>
2326 <dd>
2328 Show the full 40-byte hexadecimal commit object name. This negates
2329 <code>--abbrev-commit</code>, either explicit or implied by other options such
2330 as "--oneline". It also overrides the <code>log.abbrevCommit</code> variable.
2331 </p>
2332 </dd>
2333 <dt class="hdlist1">
2334 --oneline
2335 </dt>
2336 <dd>
2338 This is a shorthand for "--pretty=oneline --abbrev-commit"
2339 used together.
2340 </p>
2341 </dd>
2342 <dt class="hdlist1">
2343 --encoding=&lt;encoding&gt;
2344 </dt>
2345 <dd>
2347 Commit objects record the character encoding used for the log message
2348 in their encoding header; this option can be used to tell the
2349 command to re-code the commit log message in the encoding
2350 preferred by the user. For non plumbing commands this
2351 defaults to UTF-8. Note that if an object claims to be encoded
2352 in <code>X</code> and we are outputting in <code>X</code>, we will output the object
2353 verbatim; this means that invalid sequences in the original
2354 commit may be copied to the output. Likewise, if iconv(3) fails
2355 to convert the commit, we will quietly output the original
2356 object verbatim.
2357 </p>
2358 </dd>
2359 <dt class="hdlist1">
2360 --expand-tabs=&lt;n&gt;
2361 </dt>
2362 <dt class="hdlist1">
2363 --expand-tabs
2364 </dt>
2365 <dt class="hdlist1">
2366 --no-expand-tabs
2367 </dt>
2368 <dd>
2370 Perform a tab expansion (replace each tab with enough spaces
2371 to fill to the next display column that is a multiple of <em>&lt;n&gt;</em>)
2372 in the log message before showing it in the output.
2373 <code>--expand-tabs</code> is a short-hand for <code>--expand-tabs=8</code>, and
2374 <code>--no-expand-tabs</code> is a short-hand for <code>--expand-tabs=0</code>,
2375 which disables tab expansion.
2376 </p>
2377 <div class="paragraph"><p>By default, tabs are expanded in pretty formats that indent the log
2378 message by 4 spaces (i.e. <em>medium</em>, which is the default, <em>full</em>,
2379 and <em>fuller</em>).</p></div>
2380 </dd>
2381 <dt class="hdlist1">
2382 --show-signature
2383 </dt>
2384 <dd>
2386 Check the validity of a signed commit object by passing the signature
2387 to <code>gpg --verify</code> and show the output.
2388 </p>
2389 </dd>
2390 <dt class="hdlist1">
2391 --relative-date
2392 </dt>
2393 <dd>
2395 Synonym for <code>--date=relative</code>.
2396 </p>
2397 </dd>
2398 <dt class="hdlist1">
2399 --date=&lt;format&gt;
2400 </dt>
2401 <dd>
2403 Only takes effect for dates shown in human-readable format, such
2404 as when using <code>--pretty</code>. <code>log.date</code> config variable sets a default
2405 value for the log command&#8217;s <code>--date</code> option. By default, dates
2406 are shown in the original time zone (either committer&#8217;s or
2407 author&#8217;s). If <code>-local</code> is appended to the format (e.g.,
2408 <code>iso-local</code>), the user&#8217;s local time zone is used instead.
2409 </p>
2410 <div class="openblock">
2411 <div class="content">
2412 <div class="paragraph"><p><code>--date=relative</code> shows dates relative to the current time,
2413 e.g. &#8220;2 hours ago&#8221;. The <code>-local</code> option has no effect for
2414 <code>--date=relative</code>.</p></div>
2415 <div class="paragraph"><p><code>--date=local</code> is an alias for <code>--date=default-local</code>.</p></div>
2416 <div class="paragraph"><p><code>--date=iso</code> (or <code>--date=iso8601</code>) shows timestamps in a ISO 8601-like format.
2417 The differences to the strict ISO 8601 format are:</p></div>
2418 <div class="ulist"><ul>
2419 <li>
2421 a space instead of the <code>T</code> date/time delimiter
2422 </p>
2423 </li>
2424 <li>
2426 a space between time and time zone
2427 </p>
2428 </li>
2429 <li>
2431 no colon between hours and minutes of the time zone
2432 </p>
2433 </li>
2434 </ul></div>
2435 <div class="paragraph"><p><code>--date=iso-strict</code> (or <code>--date=iso8601-strict</code>) shows timestamps in strict
2436 ISO 8601 format.</p></div>
2437 <div class="paragraph"><p><code>--date=rfc</code> (or <code>--date=rfc2822</code>) shows timestamps in RFC 2822
2438 format, often found in email messages.</p></div>
2439 <div class="paragraph"><p><code>--date=short</code> shows only the date, but not the time, in <code>YYYY-MM-DD</code> format.</p></div>
2440 <div class="paragraph"><p><code>--date=raw</code> shows the date as seconds since the epoch (1970-01-01
2441 00:00:00 UTC), followed by a space, and then the timezone as an offset
2442 from UTC (a <code>+</code> or <code>-</code> with four digits; the first two are hours, and
2443 the second two are minutes). I.e., as if the timestamp were formatted
2444 with <code>strftime("%s %z")</code>).
2445 Note that the <code>-local</code> option does not affect the seconds-since-epoch
2446 value (which is always measured in UTC), but does switch the accompanying
2447 timezone value.</p></div>
2448 <div class="paragraph"><p><code>--date=human</code> shows the timezone if the timezone does not match the
2449 current time-zone, and doesn&#8217;t print the whole date if that matches
2450 (ie skip printing year for dates that are "this year", but also skip
2451 the whole date itself if it&#8217;s in the last few days and we can just say
2452 what weekday it was). For older dates the hour and minute is also
2453 omitted.</p></div>
2454 <div class="paragraph"><p><code>--date=unix</code> shows the date as a Unix epoch timestamp (seconds since
2455 1970). As with <code>--raw</code>, this is always in UTC and therefore <code>-local</code>
2456 has no effect.</p></div>
2457 <div class="paragraph"><p><code>--date=format:...</code> feeds the format <code>...</code> to your system <code>strftime</code>,
2458 except for %s, %z, and %Z, which are handled internally.
2459 Use <code>--date=format:%c</code> to show the date in your system locale&#8217;s
2460 preferred format. See the <code>strftime</code> manual for a complete list of
2461 format placeholders. When using <code>-local</code>, the correct syntax is
2462 <code>--date=format-local:...</code>.</p></div>
2463 <div class="paragraph"><p><code>--date=default</code> is the default format, and is based on ctime(3)
2464 output. It shows a single line with three-letter day of the week,
2465 three-letter month, day-of-month, hour-minute-seconds in "HH:MM:SS"
2466 format, followed by 4-digit year, plus timezone information, unless
2467 the local time zone is used, e.g. <code>Thu Jan 1 00:00:00 1970 +0000</code>.</p></div>
2468 </div></div>
2469 </dd>
2470 <dt class="hdlist1">
2471 --header
2472 </dt>
2473 <dd>
2475 Print the contents of the commit in raw-format; each record is
2476 separated with a NUL character.
2477 </p>
2478 </dd>
2479 <dt class="hdlist1">
2480 --no-commit-header
2481 </dt>
2482 <dd>
2484 Suppress the header line containing "commit" and the object ID printed before
2485 the specified format. This has no effect on the built-in formats; only custom
2486 formats are affected.
2487 </p>
2488 </dd>
2489 <dt class="hdlist1">
2490 --commit-header
2491 </dt>
2492 <dd>
2494 Overrides a previous <code>--no-commit-header</code>.
2495 </p>
2496 </dd>
2497 <dt class="hdlist1">
2498 --parents
2499 </dt>
2500 <dd>
2502 Print also the parents of the commit (in the form "commit parent&#8230;").
2503 Also enables parent rewriting, see <em>History Simplification</em> above.
2504 </p>
2505 </dd>
2506 <dt class="hdlist1">
2507 --children
2508 </dt>
2509 <dd>
2511 Print also the children of the commit (in the form "commit child&#8230;").
2512 Also enables parent rewriting, see <em>History Simplification</em> above.
2513 </p>
2514 </dd>
2515 <dt class="hdlist1">
2516 --timestamp
2517 </dt>
2518 <dd>
2520 Print the raw commit timestamp.
2521 </p>
2522 </dd>
2523 <dt class="hdlist1">
2524 --left-right
2525 </dt>
2526 <dd>
2528 Mark which side of a symmetric difference a commit is reachable from.
2529 Commits from the left side are prefixed with <code>&lt;</code> and those from
2530 the right with <code>&gt;</code>. If combined with <code>--boundary</code>, those
2531 commits are prefixed with <code>-</code>.
2532 </p>
2533 <div class="paragraph"><p>For example, if you have this topology:</p></div>
2534 <div class="listingblock">
2535 <div class="content">
2536 <pre><code> y---b---b branch B
2537 / \ /
2539 / / \
2540 o---x---a---a branch A</code></pre>
2541 </div></div>
2542 <div class="paragraph"><p>you would get an output like this:</p></div>
2543 <div class="listingblock">
2544 <div class="content">
2545 <pre><code> $ git rev-list --left-right --boundary --pretty=oneline A...B
2547 &gt;bbbbbbb... 3rd on b
2548 &gt;bbbbbbb... 2nd on b
2549 &lt;aaaaaaa... 3rd on a
2550 &lt;aaaaaaa... 2nd on a
2551 -yyyyyyy... 1st on b
2552 -xxxxxxx... 1st on a</code></pre>
2553 </div></div>
2554 </dd>
2555 <dt class="hdlist1">
2556 --graph
2557 </dt>
2558 <dd>
2560 Draw a text-based graphical representation of the commit history
2561 on the left hand side of the output. This may cause extra lines
2562 to be printed in between commits, in order for the graph history
2563 to be drawn properly.
2564 Cannot be combined with <code>--no-walk</code>.
2565 </p>
2566 <div class="paragraph"><p>This enables parent rewriting, see <em>History Simplification</em> above.</p></div>
2567 <div class="paragraph"><p>This implies the <code>--topo-order</code> option by default, but the
2568 <code>--date-order</code> option may also be specified.</p></div>
2569 </dd>
2570 <dt class="hdlist1">
2571 --show-linear-break[=&lt;barrier&gt;]
2572 </dt>
2573 <dd>
2575 When --graph is not used, all history branches are flattened
2576 which can make it hard to see that the two consecutive commits
2577 do not belong to a linear branch. This option puts a barrier
2578 in between them in that case. If <code>&lt;barrier&gt;</code> is specified, it
2579 is the string that will be shown instead of the default one.
2580 </p>
2581 </dd>
2582 <dt class="hdlist1">
2583 --count
2584 </dt>
2585 <dd>
2587 Print a number stating how many commits would have been
2588 listed, and suppress all other output. When used together
2589 with <code>--left-right</code>, instead print the counts for left and
2590 right commits, separated by a tab. When used together with
2591 <code>--cherry-mark</code>, omit patch equivalent commits from these
2592 counts and print the count for equivalent commits separated
2593 by a tab.
2594 </p>
2595 </dd>
2596 </dl></div>
2597 </div>
2598 </div>
2599 </div>
2600 <div class="sect1">
2601 <h2 id="_pretty_formats">PRETTY FORMATS</h2>
2602 <div class="sectionbody">
2603 <div class="paragraph"><p>If the commit is a merge, and if the pretty-format
2604 is not <em>oneline</em>, <em>email</em> or <em>raw</em>, an additional line is
2605 inserted before the <em>Author:</em> line. This line begins with
2606 "Merge: " and the hashes of ancestral commits are printed,
2607 separated by spaces. Note that the listed commits may not
2608 necessarily be the list of the <strong>direct</strong> parent commits if you
2609 have limited your view of history: for example, if you are
2610 only interested in changes related to a certain directory or
2611 file.</p></div>
2612 <div class="paragraph"><p>There are several built-in formats, and you can define
2613 additional formats by setting a pretty.&lt;name&gt;
2614 config option to either another format name, or a
2615 <em>format:</em> string, as described below (see
2616 <a href="git-config.html">git-config(1)</a>). Here are the details of the
2617 built-in formats:</p></div>
2618 <div class="ulist"><ul>
2619 <li>
2621 <em>oneline</em>
2622 </p>
2623 <div class="literalblock">
2624 <div class="content">
2625 <pre><code>&lt;hash&gt; &lt;title-line&gt;</code></pre>
2626 </div></div>
2627 <div class="paragraph"><p>This is designed to be as compact as possible.</p></div>
2628 </li>
2629 <li>
2631 <em>short</em>
2632 </p>
2633 <div class="literalblock">
2634 <div class="content">
2635 <pre><code>commit &lt;hash&gt;
2636 Author: &lt;author&gt;</code></pre>
2637 </div></div>
2638 <div class="literalblock">
2639 <div class="content">
2640 <pre><code>&lt;title-line&gt;</code></pre>
2641 </div></div>
2642 </li>
2643 <li>
2645 <em>medium</em>
2646 </p>
2647 <div class="literalblock">
2648 <div class="content">
2649 <pre><code>commit &lt;hash&gt;
2650 Author: &lt;author&gt;
2651 Date: &lt;author-date&gt;</code></pre>
2652 </div></div>
2653 <div class="literalblock">
2654 <div class="content">
2655 <pre><code>&lt;title-line&gt;</code></pre>
2656 </div></div>
2657 <div class="literalblock">
2658 <div class="content">
2659 <pre><code>&lt;full-commit-message&gt;</code></pre>
2660 </div></div>
2661 </li>
2662 <li>
2664 <em>full</em>
2665 </p>
2666 <div class="literalblock">
2667 <div class="content">
2668 <pre><code>commit &lt;hash&gt;
2669 Author: &lt;author&gt;
2670 Commit: &lt;committer&gt;</code></pre>
2671 </div></div>
2672 <div class="literalblock">
2673 <div class="content">
2674 <pre><code>&lt;title-line&gt;</code></pre>
2675 </div></div>
2676 <div class="literalblock">
2677 <div class="content">
2678 <pre><code>&lt;full-commit-message&gt;</code></pre>
2679 </div></div>
2680 </li>
2681 <li>
2683 <em>fuller</em>
2684 </p>
2685 <div class="literalblock">
2686 <div class="content">
2687 <pre><code>commit &lt;hash&gt;
2688 Author: &lt;author&gt;
2689 AuthorDate: &lt;author-date&gt;
2690 Commit: &lt;committer&gt;
2691 CommitDate: &lt;committer-date&gt;</code></pre>
2692 </div></div>
2693 <div class="literalblock">
2694 <div class="content">
2695 <pre><code>&lt;title-line&gt;</code></pre>
2696 </div></div>
2697 <div class="literalblock">
2698 <div class="content">
2699 <pre><code>&lt;full-commit-message&gt;</code></pre>
2700 </div></div>
2701 </li>
2702 <li>
2704 <em>reference</em>
2705 </p>
2706 <div class="literalblock">
2707 <div class="content">
2708 <pre><code>&lt;abbrev-hash&gt; (&lt;title-line&gt;, &lt;short-author-date&gt;)</code></pre>
2709 </div></div>
2710 <div class="paragraph"><p>This format is used to refer to another commit in a commit message and
2711 is the same as <code>--pretty='format:%C(auto)%h (%s, %ad)'</code>. By default,
2712 the date is formatted with <code>--date=short</code> unless another <code>--date</code> option
2713 is explicitly specified. As with any <code>format:</code> with format
2714 placeholders, its output is not affected by other options like
2715 <code>--decorate</code> and <code>--walk-reflogs</code>.</p></div>
2716 </li>
2717 <li>
2719 <em>email</em>
2720 </p>
2721 <div class="literalblock">
2722 <div class="content">
2723 <pre><code>From &lt;hash&gt; &lt;date&gt;
2724 From: &lt;author&gt;
2725 Date: &lt;author-date&gt;
2726 Subject: [PATCH] &lt;title-line&gt;</code></pre>
2727 </div></div>
2728 <div class="literalblock">
2729 <div class="content">
2730 <pre><code>&lt;full-commit-message&gt;</code></pre>
2731 </div></div>
2732 </li>
2733 <li>
2735 <em>mboxrd</em>
2736 </p>
2737 <div class="paragraph"><p>Like <em>email</em>, but lines in the commit message starting with "From "
2738 (preceded by zero or more "&gt;") are quoted with "&gt;" so they aren&#8217;t
2739 confused as starting a new commit.</p></div>
2740 </li>
2741 <li>
2743 <em>raw</em>
2744 </p>
2745 <div class="paragraph"><p>The <em>raw</em> format shows the entire commit exactly as
2746 stored in the commit object. Notably, the hashes are
2747 displayed in full, regardless of whether --abbrev or
2748 --no-abbrev are used, and <em>parents</em> information show the
2749 true parent commits, without taking grafts or history
2750 simplification into account. Note that this format affects the way
2751 commits are displayed, but not the way the diff is shown e.g. with
2752 <code>git log --raw</code>. To get full object names in a raw diff format,
2753 use <code>--no-abbrev</code>.</p></div>
2754 </li>
2755 <li>
2757 <em>format:&lt;format-string&gt;</em>
2758 </p>
2759 <div class="paragraph"><p>The <em>format:&lt;format-string&gt;</em> format allows you to specify which information
2760 you want to show. It works a little bit like printf format,
2761 with the notable exception that you get a newline with <em>%n</em>
2762 instead of <em>\n</em>.</p></div>
2763 <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>
2764 would show something like this:</p></div>
2765 <div class="listingblock">
2766 <div class="content">
2767 <pre><code>The author of fe6e0ee was Junio C Hamano, 23 hours ago
2768 The title was &gt;&gt;t4119: test autocomputing -p&lt;n&gt; for traditional diff input.&lt;&lt;</code></pre>
2769 </div></div>
2770 <div class="paragraph"><p>The placeholders are:</p></div>
2771 <div class="ulist"><ul>
2772 <li>
2774 Placeholders that expand to a single literal character:
2775 </p>
2776 <div class="dlist"><dl>
2777 <dt class="hdlist1">
2778 <em>%n</em>
2779 </dt>
2780 <dd>
2782 newline
2783 </p>
2784 </dd>
2785 <dt class="hdlist1">
2786 <em>%%</em>
2787 </dt>
2788 <dd>
2790 a raw <em>%</em>
2791 </p>
2792 </dd>
2793 <dt class="hdlist1">
2794 <em>%x00</em>
2795 </dt>
2796 <dd>
2798 <em>%x</em> followed by two hexadecimal digits is replaced with a
2799 byte with the hexadecimal digits' value (we will call this
2800 "literal formatting code" in the rest of this document).
2801 </p>
2802 </dd>
2803 </dl></div>
2804 </li>
2805 <li>
2807 Placeholders that affect formatting of later placeholders:
2808 </p>
2809 <div class="dlist"><dl>
2810 <dt class="hdlist1">
2811 <em>%Cred</em>
2812 </dt>
2813 <dd>
2815 switch color to red
2816 </p>
2817 </dd>
2818 <dt class="hdlist1">
2819 <em>%Cgreen</em>
2820 </dt>
2821 <dd>
2823 switch color to green
2824 </p>
2825 </dd>
2826 <dt class="hdlist1">
2827 <em>%Cblue</em>
2828 </dt>
2829 <dd>
2831 switch color to blue
2832 </p>
2833 </dd>
2834 <dt class="hdlist1">
2835 <em>%Creset</em>
2836 </dt>
2837 <dd>
2839 reset color
2840 </p>
2841 </dd>
2842 <dt class="hdlist1">
2843 <em>%C(&#8230;)</em>
2844 </dt>
2845 <dd>
2847 color specification, as described under Values in the
2848 "CONFIGURATION FILE" section of <a href="git-config.html">git-config(1)</a>. By
2849 default, colors are shown only when enabled for log output
2850 (by <code>color.diff</code>, <code>color.ui</code>, or <code>--color</code>, and respecting
2851 the <code>auto</code> settings of the former if we are going to a
2852 terminal). <code>%C(auto,...)</code> is accepted as a historical
2853 synonym for the default (e.g., <code>%C(auto,red)</code>). Specifying
2854 <code>%C(always,...)</code> will show the colors even when color is
2855 not otherwise enabled (though consider just using
2856 <code>--color=always</code> to enable color for the whole output,
2857 including this format and anything else git might color).
2858 <code>auto</code> alone (i.e. <code>%C(auto)</code>) will turn on auto coloring
2859 on the next placeholders until the color is switched
2860 again.
2861 </p>
2862 </dd>
2863 <dt class="hdlist1">
2864 <em>%m</em>
2865 </dt>
2866 <dd>
2868 left (<code>&lt;</code>), right (<code>&gt;</code>) or boundary (<code>-</code>) mark
2869 </p>
2870 </dd>
2871 <dt class="hdlist1">
2872 <em>%w([&lt;w&gt;[,&lt;i1&gt;[,&lt;i2&gt;]]])</em>
2873 </dt>
2874 <dd>
2876 switch line wrapping, like the -w option of
2877 <a href="git-shortlog.html">git-shortlog(1)</a>.
2878 </p>
2879 </dd>
2880 <dt class="hdlist1">
2881 <em>%&lt;( &lt;N&gt; [,trunc|ltrunc|mtrunc])</em>
2882 </dt>
2883 <dd>
2885 make the next placeholder take at
2886 least N column widths, padding spaces on
2887 the right if necessary. Optionally
2888 truncate (with ellipsis <em>..</em>) at the left (ltrunc) <code>..ft</code>,
2889 the middle (mtrunc) <code>mi..le</code>, or the end
2890 (trunc) <code>rig..</code>, if the output is longer than
2891 N columns.
2892 Note 1: that truncating
2893 only works correctly with N &gt;= 2.
2894 Note 2: spaces around the N and M (see below)
2895 values are optional.
2896 Note 3: Emojis and other wide characters
2897 will take two display columns, which may
2898 over-run column boundaries.
2899 Note 4: decomposed character combining marks
2900 may be misplaced at padding boundaries.
2901 </p>
2902 </dd>
2903 <dt class="hdlist1">
2904 <em>%&lt;|( &lt;M&gt; )</em>
2905 </dt>
2906 <dd>
2908 make the next placeholder take at least until Mth
2909 display column, padding spaces on the right if necessary.
2910 Use negative M values for column positions measured
2911 from the right hand edge of the terminal window.
2912 </p>
2913 </dd>
2914 <dt class="hdlist1">
2915 <em>%&gt;( &lt;N&gt; )</em>, <em>%&gt;|( &lt;M&gt; )</em>
2916 </dt>
2917 <dd>
2919 similar to <em>%&lt;( &lt;N&gt; )</em>, <em>%&lt;|( &lt;M&gt; )</em> respectively,
2920 but padding spaces on the left
2921 </p>
2922 </dd>
2923 <dt class="hdlist1">
2924 <em>%&gt;&gt;( &lt;N&gt; )</em>, <em>%&gt;&gt;|( &lt;M&gt; )</em>
2925 </dt>
2926 <dd>
2928 similar to <em>%&gt;( &lt;N&gt; )</em>, <em>%&gt;|( &lt;M&gt; )</em>
2929 respectively, except that if the next
2930 placeholder takes more spaces than given and
2931 there are spaces on its left, use those
2932 spaces
2933 </p>
2934 </dd>
2935 <dt class="hdlist1">
2936 <em>%&gt;&lt;( &lt;N&gt; )</em>, <em>%&gt;&lt;|( &lt;M&gt; )</em>
2937 </dt>
2938 <dd>
2940 similar to <em>%&lt;( &lt;N&gt; )</em>, <em>%&lt;|( &lt;M&gt; )</em>
2941 respectively, but padding both sides
2942 (i.e. the text is centered)
2943 </p>
2944 </dd>
2945 </dl></div>
2946 </li>
2947 <li>
2949 Placeholders that expand to information extracted from the commit:
2950 </p>
2951 <div class="dlist"><dl>
2952 <dt class="hdlist1">
2953 <em>%H</em>
2954 </dt>
2955 <dd>
2957 commit hash
2958 </p>
2959 </dd>
2960 <dt class="hdlist1">
2961 <em>%h</em>
2962 </dt>
2963 <dd>
2965 abbreviated commit hash
2966 </p>
2967 </dd>
2968 <dt class="hdlist1">
2969 <em>%T</em>
2970 </dt>
2971 <dd>
2973 tree hash
2974 </p>
2975 </dd>
2976 <dt class="hdlist1">
2977 <em>%t</em>
2978 </dt>
2979 <dd>
2981 abbreviated tree hash
2982 </p>
2983 </dd>
2984 <dt class="hdlist1">
2985 <em>%P</em>
2986 </dt>
2987 <dd>
2989 parent hashes
2990 </p>
2991 </dd>
2992 <dt class="hdlist1">
2993 <em>%p</em>
2994 </dt>
2995 <dd>
2997 abbreviated parent hashes
2998 </p>
2999 </dd>
3000 <dt class="hdlist1">
3001 <em>%an</em>
3002 </dt>
3003 <dd>
3005 author name
3006 </p>
3007 </dd>
3008 <dt class="hdlist1">
3009 <em>%aN</em>
3010 </dt>
3011 <dd>
3013 author name (respecting .mailmap, see <a href="git-shortlog.html">git-shortlog(1)</a>
3014 or <a href="git-blame.html">git-blame(1)</a>)
3015 </p>
3016 </dd>
3017 <dt class="hdlist1">
3018 <em>%ae</em>
3019 </dt>
3020 <dd>
3022 author email
3023 </p>
3024 </dd>
3025 <dt class="hdlist1">
3026 <em>%aE</em>
3027 </dt>
3028 <dd>
3030 author email (respecting .mailmap, see <a href="git-shortlog.html">git-shortlog(1)</a>
3031 or <a href="git-blame.html">git-blame(1)</a>)
3032 </p>
3033 </dd>
3034 <dt class="hdlist1">
3035 <em>%al</em>
3036 </dt>
3037 <dd>
3039 author email local-part (the part before the <em>@</em> sign)
3040 </p>
3041 </dd>
3042 <dt class="hdlist1">
3043 <em>%aL</em>
3044 </dt>
3045 <dd>
3047 author local-part (see <em>%al</em>) respecting .mailmap, see
3048 <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)
3049 </p>
3050 </dd>
3051 <dt class="hdlist1">
3052 <em>%ad</em>
3053 </dt>
3054 <dd>
3056 author date (format respects --date= option)
3057 </p>
3058 </dd>
3059 <dt class="hdlist1">
3060 <em>%aD</em>
3061 </dt>
3062 <dd>
3064 author date, RFC2822 style
3065 </p>
3066 </dd>
3067 <dt class="hdlist1">
3068 <em>%ar</em>
3069 </dt>
3070 <dd>
3072 author date, relative
3073 </p>
3074 </dd>
3075 <dt class="hdlist1">
3076 <em>%at</em>
3077 </dt>
3078 <dd>
3080 author date, UNIX timestamp
3081 </p>
3082 </dd>
3083 <dt class="hdlist1">
3084 <em>%ai</em>
3085 </dt>
3086 <dd>
3088 author date, ISO 8601-like format
3089 </p>
3090 </dd>
3091 <dt class="hdlist1">
3092 <em>%aI</em>
3093 </dt>
3094 <dd>
3096 author date, strict ISO 8601 format
3097 </p>
3098 </dd>
3099 <dt class="hdlist1">
3100 <em>%as</em>
3101 </dt>
3102 <dd>
3104 author date, short format (<code>YYYY-MM-DD</code>)
3105 </p>
3106 </dd>
3107 <dt class="hdlist1">
3108 <em>%ah</em>
3109 </dt>
3110 <dd>
3112 author date, human style (like the <code>--date=human</code> option of
3113 <a href="git-rev-list.html">git-rev-list(1)</a>)
3114 </p>
3115 </dd>
3116 <dt class="hdlist1">
3117 <em>%cn</em>
3118 </dt>
3119 <dd>
3121 committer name
3122 </p>
3123 </dd>
3124 <dt class="hdlist1">
3125 <em>%cN</em>
3126 </dt>
3127 <dd>
3129 committer name (respecting .mailmap, see
3130 <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)
3131 </p>
3132 </dd>
3133 <dt class="hdlist1">
3134 <em>%ce</em>
3135 </dt>
3136 <dd>
3138 committer email
3139 </p>
3140 </dd>
3141 <dt class="hdlist1">
3142 <em>%cE</em>
3143 </dt>
3144 <dd>
3146 committer email (respecting .mailmap, see
3147 <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)
3148 </p>
3149 </dd>
3150 <dt class="hdlist1">
3151 <em>%cl</em>
3152 </dt>
3153 <dd>
3155 committer email local-part (the part before the <em>@</em> sign)
3156 </p>
3157 </dd>
3158 <dt class="hdlist1">
3159 <em>%cL</em>
3160 </dt>
3161 <dd>
3163 committer local-part (see <em>%cl</em>) respecting .mailmap, see
3164 <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)
3165 </p>
3166 </dd>
3167 <dt class="hdlist1">
3168 <em>%cd</em>
3169 </dt>
3170 <dd>
3172 committer date (format respects --date= option)
3173 </p>
3174 </dd>
3175 <dt class="hdlist1">
3176 <em>%cD</em>
3177 </dt>
3178 <dd>
3180 committer date, RFC2822 style
3181 </p>
3182 </dd>
3183 <dt class="hdlist1">
3184 <em>%cr</em>
3185 </dt>
3186 <dd>
3188 committer date, relative
3189 </p>
3190 </dd>
3191 <dt class="hdlist1">
3192 <em>%ct</em>
3193 </dt>
3194 <dd>
3196 committer date, UNIX timestamp
3197 </p>
3198 </dd>
3199 <dt class="hdlist1">
3200 <em>%ci</em>
3201 </dt>
3202 <dd>
3204 committer date, ISO 8601-like format
3205 </p>
3206 </dd>
3207 <dt class="hdlist1">
3208 <em>%cI</em>
3209 </dt>
3210 <dd>
3212 committer date, strict ISO 8601 format
3213 </p>
3214 </dd>
3215 <dt class="hdlist1">
3216 <em>%cs</em>
3217 </dt>
3218 <dd>
3220 committer date, short format (<code>YYYY-MM-DD</code>)
3221 </p>
3222 </dd>
3223 <dt class="hdlist1">
3224 <em>%ch</em>
3225 </dt>
3226 <dd>
3228 committer date, human style (like the <code>--date=human</code> option of
3229 <a href="git-rev-list.html">git-rev-list(1)</a>)
3230 </p>
3231 </dd>
3232 <dt class="hdlist1">
3233 <em>%d</em>
3234 </dt>
3235 <dd>
3237 ref names, like the --decorate option of <a href="git-log.html">git-log(1)</a>
3238 </p>
3239 </dd>
3240 <dt class="hdlist1">
3241 <em>%D</em>
3242 </dt>
3243 <dd>
3245 ref names without the " (", ")" wrapping.
3246 </p>
3247 </dd>
3248 <dt class="hdlist1">
3249 <em>%(decorate[:&lt;options&gt;])</em>
3250 </dt>
3251 <dd>
3253 ref names with custom decorations. The <code>decorate</code> string may be followed by a
3254 colon and zero or more comma-separated options. Option values may contain
3255 literal formatting codes. These must be used for commas (<code>%x2C</code>) and closing
3256 parentheses (<code>%x29</code>), due to their role in the option syntax.
3257 </p>
3258 <div class="ulist"><ul>
3259 <li>
3261 <em>prefix=&lt;value&gt;</em>: Shown before the list of ref names. Defaults to "&#160;<code>(</code>".
3262 </p>
3263 </li>
3264 <li>
3266 <em>suffix=&lt;value&gt;</em>: Shown after the list of ref names. Defaults to "<code>)</code>".
3267 </p>
3268 </li>
3269 <li>
3271 <em>separator=&lt;value&gt;</em>: Shown between ref names. Defaults to "<code>,</code>&#160;".
3272 </p>
3273 </li>
3274 <li>
3276 <em>pointer=&lt;value&gt;</em>: Shown between HEAD and the branch it points to, if any.
3277 Defaults to "&#160;<code>-&gt;</code>&#160;".
3278 </p>
3279 </li>
3280 <li>
3282 <em>tag=&lt;value&gt;</em>: Shown before tag names. Defaults to "<code>tag:</code>&#160;".
3283 </p>
3284 </li>
3285 </ul></div>
3286 <div class="paragraph"><p>For example, to produce decorations with no wrapping
3287 or tag annotations, and spaces as separators:</p></div>
3288 <div class="paragraph"><p><code>%(decorate:prefix=,suffix=,tag=,separator= )</code></p></div>
3289 </dd>
3290 <dt class="hdlist1">
3291 <em>%(describe[:&lt;options&gt;])</em>
3292 </dt>
3293 <dd>
3295 human-readable name, like <a href="git-describe.html">git-describe(1)</a>; empty string for
3296 undescribable commits. The <code>describe</code> string may be followed by a colon and
3297 zero or more comma-separated options. Descriptions can be inconsistent when
3298 tags are added or removed at the same time.
3299 </p>
3300 <div class="ulist"><ul>
3301 <li>
3303 <em>tags[=&lt;bool-value&gt;]</em>: Instead of only considering annotated tags,
3304 consider lightweight tags as well.
3305 </p>
3306 </li>
3307 <li>
3309 <em>abbrev=&lt;number&gt;</em>: Instead of using the default number of hexadecimal digits
3310 (which will vary according to the number of objects in the repository with a
3311 default of 7) of the abbreviated object name, use &lt;number&gt; digits, or as many
3312 digits as needed to form a unique object name.
3313 </p>
3314 </li>
3315 <li>
3317 <em>match=&lt;pattern&gt;</em>: Only consider tags matching the given
3318 <code>glob(7)</code> pattern, excluding the "refs/tags/" prefix.
3319 </p>
3320 </li>
3321 <li>
3323 <em>exclude=&lt;pattern&gt;</em>: Do not consider tags matching the given
3324 <code>glob(7)</code> pattern, excluding the "refs/tags/" prefix.
3325 </p>
3326 </li>
3327 </ul></div>
3328 </dd>
3329 <dt class="hdlist1">
3330 <em>%S</em>
3331 </dt>
3332 <dd>
3334 ref name given on the command line by which the commit was reached
3335 (like <code>git log --source</code>), only works with <code>git log</code>
3336 </p>
3337 </dd>
3338 <dt class="hdlist1">
3339 <em>%e</em>
3340 </dt>
3341 <dd>
3343 encoding
3344 </p>
3345 </dd>
3346 <dt class="hdlist1">
3347 <em>%s</em>
3348 </dt>
3349 <dd>
3351 subject
3352 </p>
3353 </dd>
3354 <dt class="hdlist1">
3355 <em>%f</em>
3356 </dt>
3357 <dd>
3359 sanitized subject line, suitable for a filename
3360 </p>
3361 </dd>
3362 <dt class="hdlist1">
3363 <em>%b</em>
3364 </dt>
3365 <dd>
3367 body
3368 </p>
3369 </dd>
3370 <dt class="hdlist1">
3371 <em>%B</em>
3372 </dt>
3373 <dd>
3375 raw body (unwrapped subject and body)
3376 </p>
3377 </dd>
3378 <dt class="hdlist1">
3379 <em>%GG</em>
3380 </dt>
3381 <dd>
3383 raw verification message from GPG for a signed commit
3384 </p>
3385 </dd>
3386 <dt class="hdlist1">
3387 <em>%G?</em>
3388 </dt>
3389 <dd>
3391 show "G" for a good (valid) signature,
3392 "B" for a bad signature,
3393 "U" for a good signature with unknown validity,
3394 "X" for a good signature that has expired,
3395 "Y" for a good signature made by an expired key,
3396 "R" for a good signature made by a revoked key,
3397 "E" if the signature cannot be checked (e.g. missing key)
3398 and "N" for no signature
3399 </p>
3400 </dd>
3401 <dt class="hdlist1">
3402 <em>%GS</em>
3403 </dt>
3404 <dd>
3406 show the name of the signer for a signed commit
3407 </p>
3408 </dd>
3409 <dt class="hdlist1">
3410 <em>%GK</em>
3411 </dt>
3412 <dd>
3414 show the key used to sign a signed commit
3415 </p>
3416 </dd>
3417 <dt class="hdlist1">
3418 <em>%GF</em>
3419 </dt>
3420 <dd>
3422 show the fingerprint of the key used to sign a signed commit
3423 </p>
3424 </dd>
3425 <dt class="hdlist1">
3426 <em>%GP</em>
3427 </dt>
3428 <dd>
3430 show the fingerprint of the primary key whose subkey was used
3431 to sign a signed commit
3432 </p>
3433 </dd>
3434 <dt class="hdlist1">
3435 <em>%GT</em>
3436 </dt>
3437 <dd>
3439 show the trust level for the key used to sign a signed commit
3440 </p>
3441 </dd>
3442 <dt class="hdlist1">
3443 <em>%gD</em>
3444 </dt>
3445 <dd>
3447 reflog selector, e.g., <code>refs/stash@{1}</code> or <code>refs/stash@{2
3448 minutes ago}</code>; the format follows the rules described for the
3449 <code>-g</code> option. The portion before the <code>@</code> is the refname as
3450 given on the command line (so <code>git log -g refs/heads/master</code>
3451 would yield <code>refs/heads/master@{0}</code>).
3452 </p>
3453 </dd>
3454 <dt class="hdlist1">
3455 <em>%gd</em>
3456 </dt>
3457 <dd>
3459 shortened reflog selector; same as <code>%gD</code>, but the refname
3460 portion is shortened for human readability (so
3461 <code>refs/heads/master</code> becomes just <code>master</code>).
3462 </p>
3463 </dd>
3464 <dt class="hdlist1">
3465 <em>%gn</em>
3466 </dt>
3467 <dd>
3469 reflog identity name
3470 </p>
3471 </dd>
3472 <dt class="hdlist1">
3473 <em>%gN</em>
3474 </dt>
3475 <dd>
3477 reflog identity name (respecting .mailmap, see
3478 <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)
3479 </p>
3480 </dd>
3481 <dt class="hdlist1">
3482 <em>%ge</em>
3483 </dt>
3484 <dd>
3486 reflog identity email
3487 </p>
3488 </dd>
3489 <dt class="hdlist1">
3490 <em>%gE</em>
3491 </dt>
3492 <dd>
3494 reflog identity email (respecting .mailmap, see
3495 <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)
3496 </p>
3497 </dd>
3498 <dt class="hdlist1">
3499 <em>%gs</em>
3500 </dt>
3501 <dd>
3503 reflog subject
3504 </p>
3505 </dd>
3506 <dt class="hdlist1">
3507 <em>%(trailers[:&lt;options&gt;])</em>
3508 </dt>
3509 <dd>
3511 display the trailers of the body as interpreted by
3512 <a href="git-interpret-trailers.html">git-interpret-trailers(1)</a>. The <code>trailers</code> string may be followed by
3513 a colon and zero or more comma-separated options. If any option is provided
3514 multiple times, the last occurrence wins.
3515 </p>
3516 <div class="ulist"><ul>
3517 <li>
3519 <em>key=&lt;key&gt;</em>: only show trailers with specified &lt;key&gt;. Matching is done
3520 case-insensitively and trailing colon is optional. If option is
3521 given multiple times trailer lines matching any of the keys are
3522 shown. This option automatically enables the <code>only</code> option so that
3523 non-trailer lines in the trailer block are hidden. If that is not
3524 desired it can be disabled with <code>only=false</code>. E.g.,
3525 <code>%(trailers:key=Reviewed-by)</code> shows trailer lines with key
3526 <code>Reviewed-by</code>.
3527 </p>
3528 </li>
3529 <li>
3531 <em>only[=&lt;bool&gt;]</em>: select whether non-trailer lines from the trailer
3532 block should be included.
3533 </p>
3534 </li>
3535 <li>
3537 <em>separator=&lt;sep&gt;</em>: specify the separator inserted between trailer
3538 lines. Defaults to a line feed character. The string &lt;sep&gt; may contain
3539 the literal formatting codes described above. To use comma as
3540 separator one must use <code>%x2C</code> as it would otherwise be parsed as
3541 next option. E.g., <code>%(trailers:key=Ticket,separator=%x2C )</code>
3542 shows all trailer lines whose key is "Ticket" separated by a comma
3543 and a space.
3544 </p>
3545 </li>
3546 <li>
3548 <em>unfold[=&lt;bool&gt;]</em>: make it behave as if interpret-trailer&#8217;s <code>--unfold</code>
3549 option was given. E.g.,
3550 <code>%(trailers:only,unfold=true)</code> unfolds and shows all trailer lines.
3551 </p>
3552 </li>
3553 <li>
3555 <em>keyonly[=&lt;bool&gt;]</em>: only show the key part of the trailer.
3556 </p>
3557 </li>
3558 <li>
3560 <em>valueonly[=&lt;bool&gt;]</em>: only show the value part of the trailer.
3561 </p>
3562 </li>
3563 <li>
3565 <em>key_value_separator=&lt;sep&gt;</em>: specify the separator inserted between
3566 the key and value of each trailer. Defaults to ": ". Otherwise it
3567 shares the same semantics as <em>separator=&lt;sep&gt;</em> above.
3568 </p>
3569 </li>
3570 </ul></div>
3571 </dd>
3572 </dl></div>
3573 </li>
3574 </ul></div>
3575 </li>
3576 </ul></div>
3577 <div class="admonitionblock">
3578 <table><tr>
3579 <td class="icon">
3580 <div class="title">Note</div>
3581 </td>
3582 <td class="content">Some placeholders may depend on other options given to the
3583 revision traversal engine. For example, the <code>%g*</code> reflog options will
3584 insert an empty string unless we are traversing reflog entries (e.g., by
3585 <code>git log -g</code>). The <code>%d</code> and <code>%D</code> placeholders will use the "short"
3586 decoration format if <code>--decorate</code> was not already provided on the command
3587 line.</td>
3588 </tr></table>
3589 </div>
3590 <div class="paragraph"><p>The boolean options accept an optional value <code>[=&lt;bool-value&gt;]</code>. The values
3591 <code>true</code>, <code>false</code>, <code>on</code>, <code>off</code> etc. are all accepted. See the "boolean"
3592 sub-section in "EXAMPLES" in <a href="git-config.html">git-config(1)</a>. If a boolean
3593 option is given with no value, it&#8217;s enabled.</p></div>
3594 <div class="paragraph"><p>If you add a <code>+</code> (plus sign) after <em>%</em> of a placeholder, a line-feed
3595 is inserted immediately before the expansion if and only if the
3596 placeholder expands to a non-empty string.</p></div>
3597 <div class="paragraph"><p>If you add a <code>-</code> (minus sign) after <em>%</em> of a placeholder, all consecutive
3598 line-feeds immediately preceding the expansion are deleted if and only if the
3599 placeholder expands to an empty string.</p></div>
3600 <div class="paragraph"><p>If you add a ` ` (space) after <em>%</em> of a placeholder, a space
3601 is inserted immediately before the expansion if and only if the
3602 placeholder expands to a non-empty string.</p></div>
3603 <div class="ulist"><ul>
3604 <li>
3606 <em>tformat:</em>
3607 </p>
3608 <div class="paragraph"><p>The <em>tformat:</em> format works exactly like <em>format:</em>, except that it
3609 provides "terminator" semantics instead of "separator" semantics. In
3610 other words, each commit has the message terminator character (usually a
3611 newline) appended, rather than a separator placed between entries.
3612 This means that the final entry of a single-line format will be properly
3613 terminated with a new line, just as the "oneline" format does.
3614 For example:</p></div>
3615 <div class="listingblock">
3616 <div class="content">
3617 <pre><code>$ git log -2 --pretty=format:%h 4da45bef \
3618 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
3619 4da45be
3620 7134973 -- NO NEWLINE
3622 $ git log -2 --pretty=tformat:%h 4da45bef \
3623 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
3624 4da45be
3625 7134973</code></pre>
3626 </div></div>
3627 <div class="paragraph"><p>In addition, any unrecognized string that has a <code>%</code> in it is interpreted
3628 as if it has <code>tformat:</code> in front of it. For example, these two are
3629 equivalent:</p></div>
3630 <div class="listingblock">
3631 <div class="content">
3632 <pre><code>$ git log -2 --pretty=tformat:%h 4da45bef
3633 $ git log -2 --pretty=%h 4da45bef</code></pre>
3634 </div></div>
3635 </li>
3636 </ul></div>
3637 </div>
3638 </div>
3639 <div class="sect1">
3640 <h2 id="_examples">EXAMPLES</h2>
3641 <div class="sectionbody">
3642 <div class="ulist"><ul>
3643 <li>
3645 Print the list of commits reachable from the current branch.
3646 </p>
3647 <div class="listingblock">
3648 <div class="content">
3649 <pre><code>git rev-list HEAD</code></pre>
3650 </div></div>
3651 </li>
3652 <li>
3654 Print the list of commits on this branch, but not present in the
3655 upstream branch.
3656 </p>
3657 <div class="listingblock">
3658 <div class="content">
3659 <pre><code>git rev-list @{upstream}..HEAD</code></pre>
3660 </div></div>
3661 </li>
3662 <li>
3664 Format commits with their author and commit message (see also the
3665 porcelain <a href="git-log.html">git-log(1)</a>).
3666 </p>
3667 <div class="listingblock">
3668 <div class="content">
3669 <pre><code>git rev-list --format=medium HEAD</code></pre>
3670 </div></div>
3671 </li>
3672 <li>
3674 Format commits along with their diffs (see also the porcelain
3675 <a href="git-log.html">git-log(1)</a>, which can do this in a single process).
3676 </p>
3677 <div class="listingblock">
3678 <div class="content">
3679 <pre><code>git rev-list HEAD |
3680 git diff-tree --stdin --format=medium -p</code></pre>
3681 </div></div>
3682 </li>
3683 <li>
3685 Print the list of commits on the current branch that touched any
3686 file in the <code>Documentation</code> directory.
3687 </p>
3688 <div class="listingblock">
3689 <div class="content">
3690 <pre><code>git rev-list HEAD -- Documentation/</code></pre>
3691 </div></div>
3692 </li>
3693 <li>
3695 Print the list of commits authored by you in the past year, on
3696 any branch, tag, or other ref.
3697 </p>
3698 <div class="listingblock">
3699 <div class="content">
3700 <pre><code>git rev-list --author=you@example.com --since=1.year.ago --all</code></pre>
3701 </div></div>
3702 </li>
3703 <li>
3705 Print the list of objects reachable from the current branch (i.e., all
3706 commits and the blobs and trees they contain).
3707 </p>
3708 <div class="listingblock">
3709 <div class="content">
3710 <pre><code>git rev-list --objects HEAD</code></pre>
3711 </div></div>
3712 </li>
3713 <li>
3715 Compare the disk size of all reachable objects, versus those
3716 reachable from reflogs, versus the total packed size. This can tell
3717 you whether running <code>git repack -ad</code> might reduce the repository size
3718 (by dropping unreachable objects), and whether expiring reflogs might
3719 help.
3720 </p>
3721 <div class="listingblock">
3722 <div class="content">
3723 <pre><code># reachable objects
3724 git rev-list --disk-usage --objects --all
3725 # plus reflogs
3726 git rev-list --disk-usage --objects --all --reflog
3727 # total disk size used
3728 du -c .git/objects/pack/*.pack .git/objects/??/*
3729 # alternative to du: add up "size" and "size-pack" fields
3730 git count-objects -v</code></pre>
3731 </div></div>
3732 </li>
3733 <li>
3735 Report the disk size of each branch, not including objects used by the
3736 current branch. This can find outliers that are contributing to a
3737 bloated repository size (e.g., because somebody accidentally committed
3738 large build artifacts).
3739 </p>
3740 <div class="listingblock">
3741 <div class="content">
3742 <pre><code>git for-each-ref --format='%(refname)' |
3743 while read branch
3745 size=$(git rev-list --disk-usage --objects HEAD..$branch)
3746 echo "$size $branch"
3747 done |
3748 sort -n</code></pre>
3749 </div></div>
3750 </li>
3751 <li>
3753 Compare the on-disk size of branches in one group of refs, excluding
3754 another. If you co-mingle objects from multiple remotes in a single
3755 repository, this can show which remotes are contributing to the
3756 repository size (taking the size of <code>origin</code> as a baseline).
3757 </p>
3758 <div class="listingblock">
3759 <div class="content">
3760 <pre><code>git rev-list --disk-usage --objects --remotes=$suspect --not --remotes=origin</code></pre>
3761 </div></div>
3762 </li>
3763 </ul></div>
3764 </div>
3765 </div>
3766 <div class="sect1">
3767 <h2 id="_git">GIT</h2>
3768 <div class="sectionbody">
3769 <div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
3770 </div>
3771 </div>
3772 </div>
3773 <div id="footnotes"><hr /></div>
3774 <div id="footer">
3775 <div id="footer-text">
3776 Last updated
3777 2023-10-23 14:43:46 PDT
3778 </div>
3779 </div>
3780 </body>
3781 </html>