Autogenerated HTML docs for v2.42.0-241-g6bdb5
[git-htmldocs.git] / git-rev-list.html
blob3075e7a1d96fee223a16961be04771508a50ebf7
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 a very 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 enables 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 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 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 </p>
1080 </dd>
1081 <dt class="hdlist1">
1082 --all
1083 </dt>
1084 <dd>
1086 Pretend as if all the refs in <code>refs/</code>, along with <code>HEAD</code>, are
1087 listed on the command line as <em>&lt;commit&gt;</em>.
1088 </p>
1089 </dd>
1090 <dt class="hdlist1">
1091 --branches[=&lt;pattern&gt;]
1092 </dt>
1093 <dd>
1095 Pretend as if all the refs in <code>refs/heads</code> are listed
1096 on the command line as <em>&lt;commit&gt;</em>. If <em>&lt;pattern&gt;</em> is given, limit
1097 branches to ones matching given shell glob. If pattern lacks <em>?</em>,
1098 <em>&#42;</em>, or <em>[</em>, <em>/&#42;</em> at the end is implied.
1099 </p>
1100 </dd>
1101 <dt class="hdlist1">
1102 --tags[=&lt;pattern&gt;]
1103 </dt>
1104 <dd>
1106 Pretend as if all the refs in <code>refs/tags</code> are listed
1107 on the command line as <em>&lt;commit&gt;</em>. If <em>&lt;pattern&gt;</em> is given, limit
1108 tags to ones matching given shell glob. If pattern lacks <em>?</em>, <em>&#42;</em>,
1109 or <em>[</em>, <em>/&#42;</em> at the end is implied.
1110 </p>
1111 </dd>
1112 <dt class="hdlist1">
1113 --remotes[=&lt;pattern&gt;]
1114 </dt>
1115 <dd>
1117 Pretend as if all the refs in <code>refs/remotes</code> are listed
1118 on the command line as <em>&lt;commit&gt;</em>. If <em>&lt;pattern&gt;</em> is given, limit
1119 remote-tracking branches to ones matching given shell glob.
1120 If pattern lacks <em>?</em>, <em>&#42;</em>, or <em>[</em>, <em>/&#42;</em> at the end is implied.
1121 </p>
1122 </dd>
1123 <dt class="hdlist1">
1124 --glob=&lt;glob-pattern&gt;
1125 </dt>
1126 <dd>
1128 Pretend as if all the refs matching shell glob <em>&lt;glob-pattern&gt;</em>
1129 are listed on the command line as <em>&lt;commit&gt;</em>. Leading <em>refs/</em>,
1130 is automatically prepended if missing. If pattern lacks <em>?</em>, <em>&#42;</em>,
1131 or <em>[</em>, <em>/&#42;</em> at the end is implied.
1132 </p>
1133 </dd>
1134 <dt class="hdlist1">
1135 --exclude=&lt;glob-pattern&gt;
1136 </dt>
1137 <dd>
1139 Do not include refs matching <em>&lt;glob-pattern&gt;</em> that the next <code>--all</code>,
1140 <code>--branches</code>, <code>--tags</code>, <code>--remotes</code>, or <code>--glob</code> would otherwise
1141 consider. Repetitions of this option accumulate exclusion patterns
1142 up to the next <code>--all</code>, <code>--branches</code>, <code>--tags</code>, <code>--remotes</code>, or
1143 <code>--glob</code> option (other options or arguments do not clear
1144 accumulated patterns).
1145 </p>
1146 <div class="paragraph"><p>The patterns given should not begin with <code>refs/heads</code>, <code>refs/tags</code>, or
1147 <code>refs/remotes</code> when applied to <code>--branches</code>, <code>--tags</code>, or <code>--remotes</code>,
1148 respectively, and they must begin with <code>refs/</code> when applied to <code>--glob</code>
1149 or <code>--all</code>. If a trailing <em>/&#42;</em> is intended, it must be given
1150 explicitly.</p></div>
1151 </dd>
1152 <dt class="hdlist1">
1153 --exclude-hidden=[fetch|receive|uploadpack]
1154 </dt>
1155 <dd>
1157 Do not include refs that would be hidden by <code>git-fetch</code>,
1158 <code>git-receive-pack</code> or <code>git-upload-pack</code> by consulting the appropriate
1159 <code>fetch.hideRefs</code>, <code>receive.hideRefs</code> or <code>uploadpack.hideRefs</code>
1160 configuration along with <code>transfer.hideRefs</code> (see
1161 <a href="git-config.html">git-config(1)</a>). This option affects the next pseudo-ref option
1162 <code>--all</code> or <code>--glob</code> and is cleared after processing them.
1163 </p>
1164 </dd>
1165 <dt class="hdlist1">
1166 --reflog
1167 </dt>
1168 <dd>
1170 Pretend as if all objects mentioned by reflogs are listed on the
1171 command line as <code>&lt;commit&gt;</code>.
1172 </p>
1173 </dd>
1174 <dt class="hdlist1">
1175 --alternate-refs
1176 </dt>
1177 <dd>
1179 Pretend as if all objects mentioned as ref tips of alternate
1180 repositories were listed on the command line. An alternate
1181 repository is any repository whose object directory is specified
1182 in <code>objects/info/alternates</code>. The set of included objects may
1183 be modified by <code>core.alternateRefsCommand</code>, etc. See
1184 <a href="git-config.html">git-config(1)</a>.
1185 </p>
1186 </dd>
1187 <dt class="hdlist1">
1188 --single-worktree
1189 </dt>
1190 <dd>
1192 By default, all working trees will be examined by the
1193 following options when there are more than one (see
1194 <a href="git-worktree.html">git-worktree(1)</a>): <code>--all</code>, <code>--reflog</code> and
1195 <code>--indexed-objects</code>.
1196 This option forces them to examine the current working tree
1197 only.
1198 </p>
1199 </dd>
1200 <dt class="hdlist1">
1201 --ignore-missing
1202 </dt>
1203 <dd>
1205 Upon seeing an invalid object name in the input, pretend as if
1206 the bad input was not given.
1207 </p>
1208 </dd>
1209 <dt class="hdlist1">
1210 --stdin
1211 </dt>
1212 <dd>
1214 In addition to getting arguments from the command line, read
1215 them from standard input as well. This accepts commits and
1216 pseudo-options like <code>--all</code> and <code>--glob=</code>. When a <code>--</code> separator
1217 is seen, the following input is treated as paths and used to
1218 limit the result.
1219 </p>
1220 </dd>
1221 <dt class="hdlist1">
1222 --quiet
1223 </dt>
1224 <dd>
1226 Don&#8217;t print anything to standard output. This form
1227 is primarily meant to allow the caller to
1228 test the exit status to see if a range of objects is fully
1229 connected (or not). It is faster than redirecting stdout
1230 to <code>/dev/null</code> as the output does not have to be formatted.
1231 </p>
1232 </dd>
1233 <dt class="hdlist1">
1234 --disk-usage
1235 </dt>
1236 <dt class="hdlist1">
1237 --disk-usage=human
1238 </dt>
1239 <dd>
1241 Suppress normal output; instead, print the sum of the bytes used
1242 for on-disk storage by the selected commits or objects. This is
1243 equivalent to piping the output into <code>git cat-file
1244 --batch-check='%(objectsize:disk)'</code>, except that it runs much
1245 faster (especially with <code>--use-bitmap-index</code>). See the <code>CAVEATS</code>
1246 section in <a href="git-cat-file.html">git-cat-file(1)</a> for the limitations of what
1247 "on-disk storage" means.
1248 With the optional value <code>human</code>, on-disk storage size is shown
1249 in human-readable string(e.g. 12.24 Kib, 3.50 Mib).
1250 </p>
1251 </dd>
1252 <dt class="hdlist1">
1253 --cherry-mark
1254 </dt>
1255 <dd>
1257 Like <code>--cherry-pick</code> (see below) but mark equivalent commits
1258 with <code>=</code> rather than omitting them, and inequivalent ones with <code>+</code>.
1259 </p>
1260 </dd>
1261 <dt class="hdlist1">
1262 --cherry-pick
1263 </dt>
1264 <dd>
1266 Omit any commit that introduces the same change as
1267 another commit on the &#8220;other side&#8221; when the set of
1268 commits are limited with symmetric difference.
1269 </p>
1270 <div class="paragraph"><p>For example, if you have two branches, <code>A</code> and <code>B</code>, a usual way
1271 to list all commits on only one side of them is with
1272 <code>--left-right</code> (see the example below in the description of
1273 the <code>--left-right</code> option). However, it shows the commits that were
1274 cherry-picked from the other branch (for example, &#8220;3rd on b&#8221; may be
1275 cherry-picked from branch A). With this option, such pairs of commits are
1276 excluded from the output.</p></div>
1277 </dd>
1278 <dt class="hdlist1">
1279 --left-only
1280 </dt>
1281 <dt class="hdlist1">
1282 --right-only
1283 </dt>
1284 <dd>
1286 List only commits on the respective side of a symmetric difference,
1287 i.e. only those which would be marked <code>&lt;</code> resp. <code>&gt;</code> by
1288 <code>--left-right</code>.
1289 </p>
1290 <div class="paragraph"><p>For example, <code>--cherry-pick --right-only A...B</code> omits those
1291 commits from <code>B</code> which are in <code>A</code> or are patch-equivalent to a commit in
1292 <code>A</code>. In other words, this lists the <code>+</code> commits from <code>git cherry A B</code>.
1293 More precisely, <code>--cherry-pick --right-only --no-merges</code> gives the exact
1294 list.</p></div>
1295 </dd>
1296 <dt class="hdlist1">
1297 --cherry
1298 </dt>
1299 <dd>
1301 A synonym for <code>--right-only --cherry-mark --no-merges</code>; useful to
1302 limit the output to the commits on our side and mark those that
1303 have been applied to the other side of a forked history with
1304 <code>git log --cherry upstream...mybranch</code>, similar to
1305 <code>git cherry upstream mybranch</code>.
1306 </p>
1307 </dd>
1308 <dt class="hdlist1">
1310 </dt>
1311 <dt class="hdlist1">
1312 --walk-reflogs
1313 </dt>
1314 <dd>
1316 Instead of walking the commit ancestry chain, walk
1317 reflog entries from the most recent one to older ones.
1318 When this option is used you cannot specify commits to
1319 exclude (that is, <em>&#94;commit</em>, <em>commit1..commit2</em>,
1320 and <em>commit1...commit2</em> notations cannot be used).
1321 </p>
1322 <div class="paragraph"><p>With <code>--pretty</code> format other than <code>oneline</code> and <code>reference</code> (for obvious reasons),
1323 this causes the output to have two extra lines of information
1324 taken from the reflog. The reflog designator in the output may be shown
1325 as <code>ref@{Nth}</code> (where <code>Nth</code> is the reverse-chronological index in the
1326 reflog) or as <code>ref@{timestamp}</code> (with the timestamp for that entry),
1327 depending on a few rules:</p></div>
1328 <div class="openblock">
1329 <div class="content">
1330 <div class="olist arabic"><ol class="arabic">
1331 <li>
1333 If the starting point is specified as <code>ref@{Nth}</code>, show the index
1334 format.
1335 </p>
1336 </li>
1337 <li>
1339 If the starting point was specified as <code>ref@{now}</code>, show the
1340 timestamp format.
1341 </p>
1342 </li>
1343 <li>
1345 If neither was used, but <code>--date</code> was given on the command line, show
1346 the timestamp in the format requested by <code>--date</code>.
1347 </p>
1348 </li>
1349 <li>
1351 Otherwise, show the index format.
1352 </p>
1353 </li>
1354 </ol></div>
1355 </div></div>
1356 <div class="paragraph"><p>Under <code>--pretty=oneline</code>, the commit message is
1357 prefixed with this information on the same line.
1358 This option cannot be combined with <code>--reverse</code>.
1359 See also <a href="git-reflog.html">git-reflog(1)</a>.</p></div>
1360 <div class="paragraph"><p>Under <code>--pretty=reference</code>, this information will not be shown at all.</p></div>
1361 </dd>
1362 <dt class="hdlist1">
1363 --merge
1364 </dt>
1365 <dd>
1367 After a failed merge, show refs that touch files having a
1368 conflict and don&#8217;t exist on all heads to merge.
1369 </p>
1370 </dd>
1371 <dt class="hdlist1">
1372 --boundary
1373 </dt>
1374 <dd>
1376 Output excluded boundary commits. Boundary commits are
1377 prefixed with <code>-</code>.
1378 </p>
1379 </dd>
1380 <dt class="hdlist1">
1381 --use-bitmap-index
1382 </dt>
1383 <dd>
1385 Try to speed up the traversal using the pack bitmap index (if
1386 one is available). Note that when traversing with <code>--objects</code>,
1387 trees and blobs will not have their associated path printed.
1388 </p>
1389 </dd>
1390 <dt class="hdlist1">
1391 --progress=&lt;header&gt;
1392 </dt>
1393 <dd>
1395 Show progress reports on stderr as objects are considered. The
1396 <code>&lt;header&gt;</code> text will be printed with each progress update.
1397 </p>
1398 </dd>
1399 </dl></div>
1400 </div>
1401 <div class="sect2">
1402 <h3 id="_history_simplification">History Simplification</h3>
1403 <div class="paragraph"><p>Sometimes you are only interested in parts of the history, for example the
1404 commits modifying a particular &lt;path&gt;. But there are two parts of
1405 <em>History Simplification</em>, one part is selecting the commits and the other
1406 is how to do it, as there are various strategies to simplify the history.</p></div>
1407 <div class="paragraph"><p>The following options select the commits to be shown:</p></div>
1408 <div class="dlist"><dl>
1409 <dt class="hdlist1">
1410 &lt;paths&gt;
1411 </dt>
1412 <dd>
1414 Commits modifying the given &lt;paths&gt; are selected.
1415 </p>
1416 </dd>
1417 <dt class="hdlist1">
1418 --simplify-by-decoration
1419 </dt>
1420 <dd>
1422 Commits that are referred by some branch or tag are selected.
1423 </p>
1424 </dd>
1425 </dl></div>
1426 <div class="paragraph"><p>Note that extra commits can be shown to give a meaningful history.</p></div>
1427 <div class="paragraph"><p>The following options affect the way the simplification is performed:</p></div>
1428 <div class="dlist"><dl>
1429 <dt class="hdlist1">
1430 Default mode
1431 </dt>
1432 <dd>
1434 Simplifies the history to the simplest history explaining the
1435 final state of the tree. Simplest because it prunes some side
1436 branches if the end result is the same (i.e. merging branches
1437 with the same content)
1438 </p>
1439 </dd>
1440 <dt class="hdlist1">
1441 --show-pulls
1442 </dt>
1443 <dd>
1445 Include all commits from the default mode, but also any merge
1446 commits that are not TREESAME to the first parent but are
1447 TREESAME to a later parent. This mode is helpful for showing
1448 the merge commits that "first introduced" a change to a branch.
1449 </p>
1450 </dd>
1451 <dt class="hdlist1">
1452 --full-history
1453 </dt>
1454 <dd>
1456 Same as the default mode, but does not prune some history.
1457 </p>
1458 </dd>
1459 <dt class="hdlist1">
1460 --dense
1461 </dt>
1462 <dd>
1464 Only the selected commits are shown, plus some to have a
1465 meaningful history.
1466 </p>
1467 </dd>
1468 <dt class="hdlist1">
1469 --sparse
1470 </dt>
1471 <dd>
1473 All commits in the simplified history are shown.
1474 </p>
1475 </dd>
1476 <dt class="hdlist1">
1477 --simplify-merges
1478 </dt>
1479 <dd>
1481 Additional option to <code>--full-history</code> to remove some needless
1482 merges from the resulting history, as there are no selected
1483 commits contributing to this merge.
1484 </p>
1485 </dd>
1486 <dt class="hdlist1">
1487 --ancestry-path[=&lt;commit&gt;]
1488 </dt>
1489 <dd>
1491 When given a range of commits to display (e.g. <em>commit1..commit2</em>
1492 or <em>commit2 &#94;commit1</em>), only display commits in that range
1493 that are ancestors of &lt;commit&gt;, descendants of &lt;commit&gt;, or
1494 &lt;commit&gt; itself. If no commit is specified, use <em>commit1</em> (the
1495 excluded part of the range) as &lt;commit&gt;. Can be passed multiple
1496 times; if so, a commit is included if it is any of the commits
1497 given or if it is an ancestor or descendant of one of them.
1498 </p>
1499 </dd>
1500 </dl></div>
1501 <div class="paragraph"><p>A more detailed explanation follows.</p></div>
1502 <div class="paragraph"><p>Suppose you specified <code>foo</code> as the &lt;paths&gt;. We shall call commits
1503 that modify <code>foo</code> !TREESAME, and the rest TREESAME. (In a diff
1504 filtered for <code>foo</code>, they look different and equal, respectively.)</p></div>
1505 <div class="paragraph"><p>In the following, we will always refer to the same example history to
1506 illustrate the differences between simplification settings. We assume
1507 that you are filtering for a file <code>foo</code> in this commit graph:</p></div>
1508 <div class="listingblock">
1509 <div class="content">
1510 <pre><code> .-A---M---N---O---P---Q
1511 / / / / / /
1512 I B C D E Y
1513 \ / / / / /
1514 `-------------' X</code></pre>
1515 </div></div>
1516 <div class="paragraph"><p>The horizontal line of history A---Q is taken to be the first parent of
1517 each merge. The commits are:</p></div>
1518 <div class="ulist"><ul>
1519 <li>
1521 <code>I</code> is the initial commit, in which <code>foo</code> exists with contents
1522 &#8220;asdf&#8221;, and a file <code>quux</code> exists with contents &#8220;quux&#8221;. Initial
1523 commits are compared to an empty tree, so <code>I</code> is !TREESAME.
1524 </p>
1525 </li>
1526 <li>
1528 In <code>A</code>, <code>foo</code> contains just &#8220;foo&#8221;.
1529 </p>
1530 </li>
1531 <li>
1533 <code>B</code> contains the same change as <code>A</code>. Its merge <code>M</code> is trivial and
1534 hence TREESAME to all parents.
1535 </p>
1536 </li>
1537 <li>
1539 <code>C</code> does not change <code>foo</code>, but its merge <code>N</code> changes it to &#8220;foobar&#8221;,
1540 so it is not TREESAME to any parent.
1541 </p>
1542 </li>
1543 <li>
1545 <code>D</code> sets <code>foo</code> to &#8220;baz&#8221;. Its merge <code>O</code> combines the strings from
1546 <code>N</code> and <code>D</code> to &#8220;foobarbaz&#8221;; i.e., it is not TREESAME to any parent.
1547 </p>
1548 </li>
1549 <li>
1551 <code>E</code> changes <code>quux</code> to &#8220;xyzzy&#8221;, and its merge <code>P</code> combines the
1552 strings to &#8220;quux xyzzy&#8221;. <code>P</code> is TREESAME to <code>O</code>, but not to <code>E</code>.
1553 </p>
1554 </li>
1555 <li>
1557 <code>X</code> is an independent root commit that added a new file <code>side</code>, and <code>Y</code>
1558 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
1559 <code>Q</code> is TREESAME to <code>P</code>, but not to <code>Y</code>.
1560 </p>
1561 </li>
1562 </ul></div>
1563 <div class="paragraph"><p><code>rev-list</code> walks backwards through history, including or excluding
1564 commits based on whether <code>--full-history</code> and/or parent rewriting
1565 (via <code>--parents</code> or <code>--children</code>) are used. The following settings
1566 are available.</p></div>
1567 <div class="dlist"><dl>
1568 <dt class="hdlist1">
1569 Default mode
1570 </dt>
1571 <dd>
1573 Commits are included if they are not TREESAME to any parent
1574 (though this can be changed, see <code>--sparse</code> below). If the
1575 commit was a merge, and it was TREESAME to one parent, follow
1576 only that parent. (Even if there are several TREESAME
1577 parents, follow only one of them.) Otherwise, follow all
1578 parents.
1579 </p>
1580 <div class="paragraph"><p>This results in:</p></div>
1581 <div class="listingblock">
1582 <div class="content">
1583 <pre><code> .-A---N---O
1584 / / /
1585 I---------D</code></pre>
1586 </div></div>
1587 <div class="paragraph"><p>Note how the rule to only follow the TREESAME parent, if one is
1588 available, removed <code>B</code> from consideration entirely. <code>C</code> was
1589 considered via <code>N</code>, but is TREESAME. Root commits are compared to an
1590 empty tree, so <code>I</code> is !TREESAME.</p></div>
1591 <div class="paragraph"><p>Parent/child relations are only visible with <code>--parents</code>, but that does
1592 not affect the commits selected in default mode, so we have shown the
1593 parent lines.</p></div>
1594 </dd>
1595 <dt class="hdlist1">
1596 --full-history without parent rewriting
1597 </dt>
1598 <dd>
1600 This mode differs from the default in one point: always follow
1601 all parents of a merge, even if it is TREESAME to one of them.
1602 Even if more than one side of the merge has commits that are
1603 included, this does not imply that the merge itself is! In
1604 the example, we get
1605 </p>
1606 <div class="listingblock">
1607 <div class="content">
1608 <pre><code> I A B N D O P Q</code></pre>
1609 </div></div>
1610 <div class="paragraph"><p><code>M</code> was excluded because it is TREESAME to both parents. <code>E</code>,
1611 <code>C</code> and <code>B</code> were all walked, but only <code>B</code> was !TREESAME, so the others
1612 do not appear.</p></div>
1613 <div class="paragraph"><p>Note that without parent rewriting, it is not really possible to talk
1614 about the parent/child relationships between the commits, so we show
1615 them disconnected.</p></div>
1616 </dd>
1617 <dt class="hdlist1">
1618 --full-history with parent rewriting
1619 </dt>
1620 <dd>
1622 Ordinary commits are only included if they are !TREESAME
1623 (though this can be changed, see <code>--sparse</code> below).
1624 </p>
1625 <div class="paragraph"><p>Merges are always included. However, their parent list is rewritten:
1626 Along each parent, prune away commits that are not included
1627 themselves. This results in</p></div>
1628 <div class="listingblock">
1629 <div class="content">
1630 <pre><code> .-A---M---N---O---P---Q
1631 / / / / /
1632 I B / D /
1633 \ / / / /
1634 `-------------'</code></pre>
1635 </div></div>
1636 <div class="paragraph"><p>Compare to <code>--full-history</code> without rewriting above. Note that <code>E</code>
1637 was pruned away because it is TREESAME, but the parent list of P was
1638 rewritten to contain <code>E</code>'s parent <code>I</code>. The same happened for <code>C</code> and
1639 <code>N</code>, and <code>X</code>, <code>Y</code> and <code>Q</code>.</p></div>
1640 </dd>
1641 </dl></div>
1642 <div class="paragraph"><p>In addition to the above settings, you can change whether TREESAME
1643 affects inclusion:</p></div>
1644 <div class="dlist"><dl>
1645 <dt class="hdlist1">
1646 --dense
1647 </dt>
1648 <dd>
1650 Commits that are walked are included if they are not TREESAME
1651 to any parent.
1652 </p>
1653 </dd>
1654 <dt class="hdlist1">
1655 --sparse
1656 </dt>
1657 <dd>
1659 All commits that are walked are included.
1660 </p>
1661 <div class="paragraph"><p>Note that without <code>--full-history</code>, this still simplifies merges: if
1662 one of the parents is TREESAME, we follow only that one, so the other
1663 sides of the merge are never walked.</p></div>
1664 </dd>
1665 <dt class="hdlist1">
1666 --simplify-merges
1667 </dt>
1668 <dd>
1670 First, build a history graph in the same way that
1671 <code>--full-history</code> with parent rewriting does (see above).
1672 </p>
1673 <div class="paragraph"><p>Then simplify each commit <code>C</code> to its replacement <code>C'</code> in the final
1674 history according to the following rules:</p></div>
1675 <div class="openblock">
1676 <div class="content">
1677 <div class="ulist"><ul>
1678 <li>
1680 Set <code>C'</code> to <code>C</code>.
1681 </p>
1682 </li>
1683 <li>
1685 Replace each parent <code>P</code> of <code>C'</code> with its simplification <code>P'</code>. In
1686 the process, drop parents that are ancestors of other parents or that are
1687 root commits TREESAME to an empty tree, and remove duplicates, but take care
1688 to never drop all parents that we are TREESAME to.
1689 </p>
1690 </li>
1691 <li>
1693 If after this parent rewriting, <code>C'</code> is a root or merge commit (has
1694 zero or &gt;1 parents), a boundary commit, or !TREESAME, it remains.
1695 Otherwise, it is replaced with its only parent.
1696 </p>
1697 </li>
1698 </ul></div>
1699 </div></div>
1700 <div class="paragraph"><p>The effect of this is best shown by way of comparing to
1701 <code>--full-history</code> with parent rewriting. The example turns into:</p></div>
1702 <div class="listingblock">
1703 <div class="content">
1704 <pre><code> .-A---M---N---O
1705 / / /
1706 I B D
1707 \ / /
1708 `---------'</code></pre>
1709 </div></div>
1710 <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>
1711 <div class="openblock">
1712 <div class="content">
1713 <div class="ulist"><ul>
1714 <li>
1716 <code>N</code>'s parent list had <code>I</code> removed, because it is an ancestor of the
1717 other parent <code>M</code>. Still, <code>N</code> remained because it is !TREESAME.
1718 </p>
1719 </li>
1720 <li>
1722 <code>P</code>'s parent list similarly had <code>I</code> removed. <code>P</code> was then
1723 removed completely, because it had one parent and is TREESAME.
1724 </p>
1725 </li>
1726 <li>
1728 <code>Q</code>'s parent list had <code>Y</code> simplified to <code>X</code>. <code>X</code> was then removed, because it
1729 was a TREESAME root. <code>Q</code> was then removed completely, because it had one
1730 parent and is TREESAME.
1731 </p>
1732 </li>
1733 </ul></div>
1734 </div></div>
1735 </dd>
1736 </dl></div>
1737 <div class="paragraph"><p>There is another simplification mode available:</p></div>
1738 <div class="dlist"><dl>
1739 <dt class="hdlist1">
1740 --ancestry-path[=&lt;commit&gt;]
1741 </dt>
1742 <dd>
1744 Limit the displayed commits to those which are an ancestor of
1745 &lt;commit&gt;, or which are a descendant of &lt;commit&gt;, or are &lt;commit&gt;
1746 itself.
1747 </p>
1748 <div class="paragraph"><p>As an example use case, consider the following commit history:</p></div>
1749 <div class="listingblock">
1750 <div class="content">
1751 <pre><code> D---E-------F
1752 / \ \
1753 B---C---G---H---I---J
1755 A-------K---------------L--M</code></pre>
1756 </div></div>
1757 <div class="paragraph"><p>A regular <em>D..M</em> computes the set of commits that are ancestors of <code>M</code>,
1758 but excludes the ones that are ancestors of <code>D</code>. This is useful to see
1759 what happened to the history leading to <code>M</code> since <code>D</code>, in the sense
1760 that &#8220;what does <code>M</code> have that did not exist in <code>D</code>&#8221;. The result in this
1761 example would be all the commits, except <code>A</code> and <code>B</code> (and <code>D</code> itself,
1762 of course).</p></div>
1763 <div class="paragraph"><p>When we want to find out what commits in <code>M</code> are contaminated with the
1764 bug introduced by <code>D</code> and need fixing, however, we might want to view
1765 only the subset of <em>D..M</em> that are actually descendants of <code>D</code>, i.e.
1766 excluding <code>C</code> and <code>K</code>. This is exactly what the <code>--ancestry-path</code>
1767 option does. Applied to the <em>D..M</em> range, it results in:</p></div>
1768 <div class="listingblock">
1769 <div class="content">
1770 <pre><code> E-------F
1772 G---H---I---J
1774 L--M</code></pre>
1775 </div></div>
1776 <div class="paragraph"><p>We can also use <code>--ancestry-path=D</code> instead of <code>--ancestry-path</code> which
1777 means the same thing when applied to the <em>D..M</em> range but is just more
1778 explicit.</p></div>
1779 <div class="paragraph"><p>If we instead are interested in a given topic within this range, and all
1780 commits affected by that topic, we may only want to view the subset of
1781 <code>D..M</code> which contain that topic in their ancestry path. So, using
1782 <code>--ancestry-path=H D..M</code> for example would result in:</p></div>
1783 <div class="listingblock">
1784 <div class="content">
1785 <pre><code> E
1787 G---H---I---J
1789 L--M</code></pre>
1790 </div></div>
1791 <div class="paragraph"><p>Whereas <code>--ancestry-path=K D..M</code> would result in</p></div>
1792 <div class="listingblock">
1793 <div class="content">
1794 <pre><code> K---------------L--M</code></pre>
1795 </div></div>
1796 </dd>
1797 </dl></div>
1798 <div class="paragraph"><p>Before discussing another option, <code>--show-pulls</code>, we need to
1799 create a new example history.</p></div>
1800 <div class="paragraph"><p>A common problem users face when looking at simplified history is that a
1801 commit they know changed a file somehow does not appear in the file&#8217;s
1802 simplified history. Let&#8217;s demonstrate a new example and show how options
1803 such as <code>--full-history</code> and <code>--simplify-merges</code> works in that case:</p></div>
1804 <div class="listingblock">
1805 <div class="content">
1806 <pre><code> .-A---M-----C--N---O---P
1807 / / \ \ \/ / /
1808 I B \ R-'`-Z' /
1809 \ / \/ /
1810 \ / /\ /
1811 `---X--' `---Y--'</code></pre>
1812 </div></div>
1813 <div class="paragraph"><p>For this example, suppose <code>I</code> created <code>file.txt</code> which was modified by
1814 <code>A</code>, <code>B</code>, and <code>X</code> in different ways. The single-parent commits <code>C</code>, <code>Z</code>,
1815 and <code>Y</code> do not change <code>file.txt</code>. The merge commit <code>M</code> was created by
1816 resolving the merge conflict to include both changes from <code>A</code> and <code>B</code>
1817 and hence is not TREESAME to either. The merge commit <code>R</code>, however, was
1818 created by ignoring the contents of <code>file.txt</code> at <code>M</code> and taking only
1819 the contents of <code>file.txt</code> at <code>X</code>. Hence, <code>R</code> is TREESAME to <code>X</code> but not
1820 <code>M</code>. Finally, the natural merge resolution to create <code>N</code> is to take the
1821 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>.
1822 The merge commits <code>O</code> and <code>P</code> are TREESAME to their first parents, but
1823 not to their second parents, <code>Z</code> and <code>Y</code> respectively.</p></div>
1824 <div class="paragraph"><p>When using the default mode, <code>N</code> and <code>R</code> both have a TREESAME parent, so
1825 those edges are walked and the others are ignored. The resulting history
1826 graph is:</p></div>
1827 <div class="listingblock">
1828 <div class="content">
1829 <pre><code> I---X</code></pre>
1830 </div></div>
1831 <div class="paragraph"><p>When using <code>--full-history</code>, Git walks every edge. This will discover
1832 the commits <code>A</code> and <code>B</code> and the merge <code>M</code>, but also will reveal the
1833 merge commits <code>O</code> and <code>P</code>. With parent rewriting, the resulting graph is:</p></div>
1834 <div class="listingblock">
1835 <div class="content">
1836 <pre><code> .-A---M--------N---O---P
1837 / / \ \ \/ / /
1838 I B \ R-'`--' /
1839 \ / \/ /
1840 \ / /\ /
1841 `---X--' `------'</code></pre>
1842 </div></div>
1843 <div class="paragraph"><p>Here, the merge commits <code>O</code> and <code>P</code> contribute extra noise, as they did
1844 not actually contribute a change to <code>file.txt</code>. They only merged a topic
1845 that was based on an older version of <code>file.txt</code>. This is a common
1846 issue in repositories using a workflow where many contributors work in
1847 parallel and merge their topic branches along a single trunk: many
1848 unrelated merges appear in the <code>--full-history</code> results.</p></div>
1849 <div class="paragraph"><p>When using the <code>--simplify-merges</code> option, the commits <code>O</code> and <code>P</code>
1850 disappear from the results. This is because the rewritten second parents
1851 of <code>O</code> and <code>P</code> are reachable from their first parents. Those edges are
1852 removed and then the commits look like single-parent commits that are
1853 TREESAME to their parent. This also happens to the commit <code>N</code>, resulting
1854 in a history view as follows:</p></div>
1855 <div class="listingblock">
1856 <div class="content">
1857 <pre><code> .-A---M--.
1858 / / \
1859 I B R
1860 \ / /
1861 \ / /
1862 `---X--'</code></pre>
1863 </div></div>
1864 <div class="paragraph"><p>In this view, we see all of the important single-parent changes from
1865 <code>A</code>, <code>B</code>, and <code>X</code>. We also see the carefully-resolved merge <code>M</code> and the
1866 not-so-carefully-resolved merge <code>R</code>. This is usually enough information
1867 to determine why the commits <code>A</code> and <code>B</code> "disappeared" from history in
1868 the default view. However, there are a few issues with this approach.</p></div>
1869 <div class="paragraph"><p>The first issue is performance. Unlike any previous option, the
1870 <code>--simplify-merges</code> option requires walking the entire commit history
1871 before returning a single result. This can make the option difficult to
1872 use for very large repositories.</p></div>
1873 <div class="paragraph"><p>The second issue is one of auditing. When many contributors are working
1874 on the same repository, it is important which merge commits introduced
1875 a change into an important branch. The problematic merge <code>R</code> above is
1876 not likely to be the merge commit that was used to merge into an
1877 important branch. Instead, the merge <code>N</code> was used to merge <code>R</code> and <code>X</code>
1878 into the important branch. This commit may have information about why
1879 the change <code>X</code> came to override the changes from <code>A</code> and <code>B</code> in its
1880 commit message.</p></div>
1881 <div class="dlist"><dl>
1882 <dt class="hdlist1">
1883 --show-pulls
1884 </dt>
1885 <dd>
1887 In addition to the commits shown in the default history, show
1888 each merge commit that is not TREESAME to its first parent but
1889 is TREESAME to a later parent.
1890 </p>
1891 <div class="paragraph"><p>When a merge commit is included by <code>--show-pulls</code>, the merge is
1892 treated as if it "pulled" the change from another branch. When using
1893 <code>--show-pulls</code> on this example (and no other options) the resulting
1894 graph is:</p></div>
1895 <div class="listingblock">
1896 <div class="content">
1897 <pre><code> I---X---R---N</code></pre>
1898 </div></div>
1899 <div class="paragraph"><p>Here, the merge commits <code>R</code> and <code>N</code> are included because they pulled
1900 the commits <code>X</code> and <code>R</code> into the base branch, respectively. These
1901 merges are the reason the commits <code>A</code> and <code>B</code> do not appear in the
1902 default history.</p></div>
1903 <div class="paragraph"><p>When <code>--show-pulls</code> is paired with <code>--simplify-merges</code>, the
1904 graph includes all of the necessary information:</p></div>
1905 <div class="listingblock">
1906 <div class="content">
1907 <pre><code> .-A---M--. N
1908 / / \ /
1909 I B R
1910 \ / /
1911 \ / /
1912 `---X--'</code></pre>
1913 </div></div>
1914 <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>
1915 was simplified away. However, <code>N</code> still appears in the history as an
1916 important commit because it "pulled" the change <code>R</code> into the main
1917 branch.</p></div>
1918 </dd>
1919 </dl></div>
1920 <div class="paragraph"><p>The <code>--simplify-by-decoration</code> option allows you to view only the
1921 big picture of the topology of the history, by omitting commits
1922 that are not referenced by tags. Commits are marked as !TREESAME
1923 (in other words, kept after history simplification rules described
1924 above) if (1) they are referenced by tags, or (2) they change the
1925 contents of the paths given on the command line. All other
1926 commits are marked as TREESAME (subject to be simplified away).</p></div>
1927 </div>
1928 <div class="sect2">
1929 <h3 id="_bisection_helpers">Bisection Helpers</h3>
1930 <div class="dlist"><dl>
1931 <dt class="hdlist1">
1932 --bisect
1933 </dt>
1934 <dd>
1936 Limit output to the one commit object which is roughly halfway between
1937 included and excluded commits. Note that the bad bisection ref
1938 <code>refs/bisect/bad</code> is added to the included commits (if it
1939 exists) and the good bisection refs <code>refs/bisect/good-*</code> are
1940 added to the excluded commits (if they exist). Thus, supposing there
1941 are no refs in <code>refs/bisect/</code>, if
1942 </p>
1943 <div class="listingblock">
1944 <div class="content">
1945 <pre><code> $ git rev-list --bisect foo ^bar ^baz</code></pre>
1946 </div></div>
1947 <div class="paragraph"><p>outputs <em>midpoint</em>, the output of the two commands</p></div>
1948 <div class="listingblock">
1949 <div class="content">
1950 <pre><code> $ git rev-list foo ^midpoint
1951 $ git rev-list midpoint ^bar ^baz</code></pre>
1952 </div></div>
1953 <div class="paragraph"><p>would be of roughly the same length. Finding the change which
1954 introduces a regression is thus reduced to a binary search: repeatedly
1955 generate and test new 'midpoint&#8217;s until the commit chain is of length
1956 one.</p></div>
1957 </dd>
1958 <dt class="hdlist1">
1959 --bisect-vars
1960 </dt>
1961 <dd>
1963 This calculates the same as <code>--bisect</code>, except that refs in
1964 <code>refs/bisect/</code> are not used, and except that this outputs
1965 text ready to be eval&#8217;ed by the shell. These lines will assign the
1966 name of the midpoint revision to the variable <code>bisect_rev</code>, and the
1967 expected number of commits to be tested after <code>bisect_rev</code> is tested
1968 to <code>bisect_nr</code>, the expected number of commits to be tested if
1969 <code>bisect_rev</code> turns out to be good to <code>bisect_good</code>, the expected
1970 number of commits to be tested if <code>bisect_rev</code> turns out to be bad to
1971 <code>bisect_bad</code>, and the number of commits we are bisecting right now to
1972 <code>bisect_all</code>.
1973 </p>
1974 </dd>
1975 <dt class="hdlist1">
1976 --bisect-all
1977 </dt>
1978 <dd>
1980 This outputs all the commit objects between the included and excluded
1981 commits, ordered by their distance to the included and excluded
1982 commits. Refs in <code>refs/bisect/</code> are not used. The farthest
1983 from them is displayed first. (This is the only one displayed by
1984 <code>--bisect</code>.)
1985 </p>
1986 <div class="paragraph"><p>This is useful because it makes it easy to choose a good commit to
1987 test when you want to avoid to test some of them for some reason (they
1988 may not compile for example).</p></div>
1989 <div class="paragraph"><p>This option can be used along with <code>--bisect-vars</code>, in this case,
1990 after all the sorted commit objects, there will be the same text as if
1991 <code>--bisect-vars</code> had been used alone.</p></div>
1992 </dd>
1993 </dl></div>
1994 </div>
1995 <div class="sect2">
1996 <h3 id="_commit_ordering">Commit Ordering</h3>
1997 <div class="paragraph"><p>By default, the commits are shown in reverse chronological order.</p></div>
1998 <div class="dlist"><dl>
1999 <dt class="hdlist1">
2000 --date-order
2001 </dt>
2002 <dd>
2004 Show no parents before all of its children are shown, but
2005 otherwise show commits in the commit timestamp order.
2006 </p>
2007 </dd>
2008 <dt class="hdlist1">
2009 --author-date-order
2010 </dt>
2011 <dd>
2013 Show no parents before all of its children are shown, but
2014 otherwise show commits in the author timestamp order.
2015 </p>
2016 </dd>
2017 <dt class="hdlist1">
2018 --topo-order
2019 </dt>
2020 <dd>
2022 Show no parents before all of its children are shown, and
2023 avoid showing commits on multiple lines of history
2024 intermixed.
2025 </p>
2026 <div class="paragraph"><p>For example, in a commit history like this:</p></div>
2027 <div class="listingblock">
2028 <div class="content">
2029 <pre><code> ---1----2----4----7
2031 3----5----6----8---</code></pre>
2032 </div></div>
2033 <div class="paragraph"><p>where the numbers denote the order of commit timestamps, <code>git
2034 rev-list</code> and friends with <code>--date-order</code> show the commits in the
2035 timestamp order: 8 7 6 5 4 3 2 1.</p></div>
2036 <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
2037 3 1); some older commits are shown before newer ones in order to
2038 avoid showing the commits from two parallel development track mixed
2039 together.</p></div>
2040 </dd>
2041 <dt class="hdlist1">
2042 --reverse
2043 </dt>
2044 <dd>
2046 Output the commits chosen to be shown (see Commit Limiting
2047 section above) in reverse order. Cannot be combined with
2048 <code>--walk-reflogs</code>.
2049 </p>
2050 </dd>
2051 </dl></div>
2052 </div>
2053 <div class="sect2">
2054 <h3 id="_object_traversal">Object Traversal</h3>
2055 <div class="paragraph"><p>These options are mostly targeted for packing of Git repositories.</p></div>
2056 <div class="dlist"><dl>
2057 <dt class="hdlist1">
2058 --objects
2059 </dt>
2060 <dd>
2062 Print the object IDs of any object referenced by the listed
2063 commits. <code>--objects foo ^bar</code> thus means &#8220;send me
2064 all object IDs which I need to download if I have the commit
2065 object <em>bar</em> but not <em>foo</em>&#8221;. See also <code>--object-names</code> below.
2066 </p>
2067 </dd>
2068 <dt class="hdlist1">
2069 --in-commit-order
2070 </dt>
2071 <dd>
2073 Print tree and blob ids in order of the commits. The tree
2074 and blob ids are printed after they are first referenced
2075 by a commit.
2076 </p>
2077 </dd>
2078 <dt class="hdlist1">
2079 --objects-edge
2080 </dt>
2081 <dd>
2083 Similar to <code>--objects</code>, but also print the IDs of excluded
2084 commits prefixed with a &#8220;-&#8221; character. This is used by
2085 <a href="git-pack-objects.html">git-pack-objects(1)</a> to build a &#8220;thin&#8221; pack, which records
2086 objects in deltified form based on objects contained in these
2087 excluded commits to reduce network traffic.
2088 </p>
2089 </dd>
2090 <dt class="hdlist1">
2091 --objects-edge-aggressive
2092 </dt>
2093 <dd>
2095 Similar to <code>--objects-edge</code>, but it tries harder to find excluded
2096 commits at the cost of increased time. This is used instead of
2097 <code>--objects-edge</code> to build &#8220;thin&#8221; packs for shallow repositories.
2098 </p>
2099 </dd>
2100 <dt class="hdlist1">
2101 --indexed-objects
2102 </dt>
2103 <dd>
2105 Pretend as if all trees and blobs used by the index are listed
2106 on the command line. Note that you probably want to use
2107 <code>--objects</code>, too.
2108 </p>
2109 </dd>
2110 <dt class="hdlist1">
2111 --unpacked
2112 </dt>
2113 <dd>
2115 Only useful with <code>--objects</code>; print the object IDs that are not
2116 in packs.
2117 </p>
2118 </dd>
2119 <dt class="hdlist1">
2120 --object-names
2121 </dt>
2122 <dd>
2124 Only useful with <code>--objects</code>; print the names of the object IDs
2125 that are found. This is the default behavior. Note that the
2126 "name" of each object is ambiguous, and mostly intended as a
2127 hint for packing objects. In particular: no distinction is made between
2128 the names of tags, trees, and blobs; path names may be modified
2129 to remove newlines; and if an object would appear multiple times
2130 with different names, only one name is shown.
2131 </p>
2132 </dd>
2133 <dt class="hdlist1">
2134 --no-object-names
2135 </dt>
2136 <dd>
2138 Only useful with <code>--objects</code>; does not print the names of the object
2139 IDs that are found. This inverts <code>--object-names</code>. This flag allows
2140 the output to be more easily parsed by commands such as
2141 <a href="git-cat-file.html">git-cat-file(1)</a>.
2142 </p>
2143 </dd>
2144 <dt class="hdlist1">
2145 --filter=&lt;filter-spec&gt;
2146 </dt>
2147 <dd>
2149 Only useful with one of the <code>--objects*</code>; omits objects (usually
2150 blobs) from the list of printed objects. The <em>&lt;filter-spec&gt;</em>
2151 may be one of the following:
2152 </p>
2153 <div class="paragraph"><p>The form <em>--filter=blob:none</em> omits all blobs.</p></div>
2154 <div class="paragraph"><p>The form <em>--filter=blob:limit=&lt;n&gt;[kmg]</em> omits blobs larger than n bytes
2155 or units. n may be zero. The suffixes k, m, and g can be used to name
2156 units in KiB, MiB, or GiB. For example, <em>blob:limit=1k</em> is the same
2157 as <em>blob:limit=1024</em>.</p></div>
2158 <div class="paragraph"><p>The form <em>--filter=object:type=(tag|commit|tree|blob)</em> omits all objects
2159 which are not of the requested type.</p></div>
2160 <div class="paragraph"><p>The form <em>--filter=sparse:oid=&lt;blob-ish&gt;</em> uses a sparse-checkout
2161 specification contained in the blob (or blob-expression) <em>&lt;blob-ish&gt;</em>
2162 to omit blobs that would not be required for a sparse checkout on
2163 the requested refs.</p></div>
2164 <div class="paragraph"><p>The form <em>--filter=tree:&lt;depth&gt;</em> omits all blobs and trees whose depth
2165 from the root tree is &gt;= &lt;depth&gt; (minimum depth if an object is located
2166 at multiple depths in the commits traversed). &lt;depth&gt;=0 will not include
2167 any trees or blobs unless included explicitly in the command-line (or
2168 standard input when --stdin is used). &lt;depth&gt;=1 will include only the
2169 tree and blobs which are referenced directly by a commit reachable from
2170 &lt;commit&gt; or an explicitly-given object. &lt;depth&gt;=2 is like &lt;depth&gt;=1
2171 while also including trees and blobs one more level removed from an
2172 explicitly-given commit or tree.</p></div>
2173 <div class="paragraph"><p>Note that the form <em>--filter=sparse:path=&lt;path&gt;</em> that wants to read
2174 from an arbitrary path on the filesystem has been dropped for security
2175 reasons.</p></div>
2176 <div class="paragraph"><p>Multiple <em>--filter=</em> flags can be specified to combine filters. Only
2177 objects which are accepted by every filter are included.</p></div>
2178 <div class="paragraph"><p>The form <em>--filter=combine:&lt;filter1&gt;+&lt;filter2&gt;+&#8230;&lt;filterN&gt;</em> can also be
2179 used to combined several filters, but this is harder than just repeating
2180 the <em>--filter</em> flag and is usually not necessary. Filters are joined by
2181 <em>&#43;</em> and individual filters are %-encoded (i.e. URL-encoded).
2182 Besides the <em>&#43;</em> and <em>%</em> characters, the following characters are
2183 reserved and also must be encoded: <code>~!@#$^&amp;*()[]{}\;",&lt;&gt;?</code><code>&#39;&#96;</code>
2184 as well as all characters with ASCII code &lt;= <code>0x20</code>, which includes
2185 space and newline.</p></div>
2186 <div class="paragraph"><p>Other arbitrary characters can also be encoded. For instance,
2187 <em>combine:tree:3+blob:none</em> and <em>combine:tree%3A3+blob%3Anone</em> are
2188 equivalent.</p></div>
2189 </dd>
2190 <dt class="hdlist1">
2191 --no-filter
2192 </dt>
2193 <dd>
2195 Turn off any previous <code>--filter=</code> argument.
2196 </p>
2197 </dd>
2198 <dt class="hdlist1">
2199 --filter-provided-objects
2200 </dt>
2201 <dd>
2203 Filter the list of explicitly provided objects, which would otherwise
2204 always be printed even if they did not match any of the filters. Only
2205 useful with <code>--filter=</code>.
2206 </p>
2207 </dd>
2208 <dt class="hdlist1">
2209 --filter-print-omitted
2210 </dt>
2211 <dd>
2213 Only useful with <code>--filter=</code>; prints a list of the objects omitted
2214 by the filter. Object IDs are prefixed with a &#8220;~&#8221; character.
2215 </p>
2216 </dd>
2217 <dt class="hdlist1">
2218 --missing=&lt;missing-action&gt;
2219 </dt>
2220 <dd>
2222 A debug option to help with future "partial clone" development.
2223 This option specifies how missing objects are handled.
2224 </p>
2225 <div class="paragraph"><p>The form <em>--missing=error</em> requests that rev-list stop with an error if
2226 a missing object is encountered. This is the default action.</p></div>
2227 <div class="paragraph"><p>The form <em>--missing=allow-any</em> will allow object traversal to continue
2228 if a missing object is encountered. Missing objects will silently be
2229 omitted from the results.</p></div>
2230 <div class="paragraph"><p>The form <em>--missing=allow-promisor</em> is like <em>allow-any</em>, but will only
2231 allow object traversal to continue for EXPECTED promisor missing objects.
2232 Unexpected missing objects will raise an error.</p></div>
2233 <div class="paragraph"><p>The form <em>--missing=print</em> is like <em>allow-any</em>, but will also print a
2234 list of the missing objects. Object IDs are prefixed with a &#8220;?&#8221; character.</p></div>
2235 </dd>
2236 <dt class="hdlist1">
2237 --exclude-promisor-objects
2238 </dt>
2239 <dd>
2241 (For internal use only.) Prefilter object traversal at
2242 promisor boundary. This is used with partial clone. This is
2243 stronger than <code>--missing=allow-promisor</code> because it limits the
2244 traversal, rather than just silencing errors about missing
2245 objects.
2246 </p>
2247 </dd>
2248 <dt class="hdlist1">
2249 --no-walk[=(sorted|unsorted)]
2250 </dt>
2251 <dd>
2253 Only show the given commits, but do not traverse their ancestors.
2254 This has no effect if a range is specified. If the argument
2255 <code>unsorted</code> is given, the commits are shown in the order they were
2256 given on the command line. Otherwise (if <code>sorted</code> or no argument
2257 was given), the commits are shown in reverse chronological order
2258 by commit time.
2259 Cannot be combined with <code>--graph</code>.
2260 </p>
2261 </dd>
2262 <dt class="hdlist1">
2263 --do-walk
2264 </dt>
2265 <dd>
2267 Overrides a previous <code>--no-walk</code>.
2268 </p>
2269 </dd>
2270 </dl></div>
2271 </div>
2272 <div class="sect2">
2273 <h3 id="_commit_formatting">Commit Formatting</h3>
2274 <div class="paragraph"><p>Using these options, <a href="git-rev-list.html">git-rev-list(1)</a> will act similar to the
2275 more specialized family of commit log tools: <a href="git-log.html">git-log(1)</a>,
2276 <a href="git-show.html">git-show(1)</a>, and <a href="git-whatchanged.html">git-whatchanged(1)</a></p></div>
2277 <div class="dlist"><dl>
2278 <dt class="hdlist1">
2279 --pretty[=&lt;format&gt;]
2280 </dt>
2281 <dt class="hdlist1">
2282 --format=&lt;format&gt;
2283 </dt>
2284 <dd>
2286 Pretty-print the contents of the commit logs in a given format,
2287 where <em>&lt;format&gt;</em> can be one of <em>oneline</em>, <em>short</em>, <em>medium</em>,
2288 <em>full</em>, <em>fuller</em>, <em>reference</em>, <em>email</em>, <em>raw</em>, <em>format:&lt;string&gt;</em>
2289 and <em>tformat:&lt;string&gt;</em>. When <em>&lt;format&gt;</em> is none of the above,
2290 and has <em>%placeholder</em> in it, it acts as if
2291 <em>--pretty=tformat:&lt;format&gt;</em> were given.
2292 </p>
2293 <div class="paragraph"><p>See the "PRETTY FORMATS" section for some additional details for each
2294 format. When <em>=&lt;format&gt;</em> part is omitted, it defaults to <em>medium</em>.</p></div>
2295 <div class="paragraph"><p>Note: you can specify the default pretty format in the repository
2296 configuration (see <a href="git-config.html">git-config(1)</a>).</p></div>
2297 </dd>
2298 <dt class="hdlist1">
2299 --abbrev-commit
2300 </dt>
2301 <dd>
2303 Instead of showing the full 40-byte hexadecimal commit object
2304 name, show a prefix that names the object uniquely.
2305 "--abbrev=&lt;n&gt;" (which also modifies diff output, if it is displayed)
2306 option can be used to specify the minimum length of the prefix.
2307 </p>
2308 <div class="paragraph"><p>This should make "--pretty=oneline" a whole lot more readable for
2309 people using 80-column terminals.</p></div>
2310 </dd>
2311 <dt class="hdlist1">
2312 --no-abbrev-commit
2313 </dt>
2314 <dd>
2316 Show the full 40-byte hexadecimal commit object name. This negates
2317 <code>--abbrev-commit</code>, either explicit or implied by other options such
2318 as "--oneline". It also overrides the <code>log.abbrevCommit</code> variable.
2319 </p>
2320 </dd>
2321 <dt class="hdlist1">
2322 --oneline
2323 </dt>
2324 <dd>
2326 This is a shorthand for "--pretty=oneline --abbrev-commit"
2327 used together.
2328 </p>
2329 </dd>
2330 <dt class="hdlist1">
2331 --encoding=&lt;encoding&gt;
2332 </dt>
2333 <dd>
2335 Commit objects record the character encoding used for the log message
2336 in their encoding header; this option can be used to tell the
2337 command to re-code the commit log message in the encoding
2338 preferred by the user. For non plumbing commands this
2339 defaults to UTF-8. Note that if an object claims to be encoded
2340 in <code>X</code> and we are outputting in <code>X</code>, we will output the object
2341 verbatim; this means that invalid sequences in the original
2342 commit may be copied to the output. Likewise, if iconv(3) fails
2343 to convert the commit, we will quietly output the original
2344 object verbatim.
2345 </p>
2346 </dd>
2347 <dt class="hdlist1">
2348 --expand-tabs=&lt;n&gt;
2349 </dt>
2350 <dt class="hdlist1">
2351 --expand-tabs
2352 </dt>
2353 <dt class="hdlist1">
2354 --no-expand-tabs
2355 </dt>
2356 <dd>
2358 Perform a tab expansion (replace each tab with enough spaces
2359 to fill to the next display column that is multiple of <em>&lt;n&gt;</em>)
2360 in the log message before showing it in the output.
2361 <code>--expand-tabs</code> is a short-hand for <code>--expand-tabs=8</code>, and
2362 <code>--no-expand-tabs</code> is a short-hand for <code>--expand-tabs=0</code>,
2363 which disables tab expansion.
2364 </p>
2365 <div class="paragraph"><p>By default, tabs are expanded in pretty formats that indent the log
2366 message by 4 spaces (i.e. <em>medium</em>, which is the default, <em>full</em>,
2367 and <em>fuller</em>).</p></div>
2368 </dd>
2369 <dt class="hdlist1">
2370 --show-signature
2371 </dt>
2372 <dd>
2374 Check the validity of a signed commit object by passing the signature
2375 to <code>gpg --verify</code> and show the output.
2376 </p>
2377 </dd>
2378 <dt class="hdlist1">
2379 --relative-date
2380 </dt>
2381 <dd>
2383 Synonym for <code>--date=relative</code>.
2384 </p>
2385 </dd>
2386 <dt class="hdlist1">
2387 --date=&lt;format&gt;
2388 </dt>
2389 <dd>
2391 Only takes effect for dates shown in human-readable format, such
2392 as when using <code>--pretty</code>. <code>log.date</code> config variable sets a default
2393 value for the log command&#8217;s <code>--date</code> option. By default, dates
2394 are shown in the original time zone (either committer&#8217;s or
2395 author&#8217;s). If <code>-local</code> is appended to the format (e.g.,
2396 <code>iso-local</code>), the user&#8217;s local time zone is used instead.
2397 </p>
2398 <div class="openblock">
2399 <div class="content">
2400 <div class="paragraph"><p><code>--date=relative</code> shows dates relative to the current time,
2401 e.g. &#8220;2 hours ago&#8221;. The <code>-local</code> option has no effect for
2402 <code>--date=relative</code>.</p></div>
2403 <div class="paragraph"><p><code>--date=local</code> is an alias for <code>--date=default-local</code>.</p></div>
2404 <div class="paragraph"><p><code>--date=iso</code> (or <code>--date=iso8601</code>) shows timestamps in a ISO 8601-like format.
2405 The differences to the strict ISO 8601 format are:</p></div>
2406 <div class="ulist"><ul>
2407 <li>
2409 a space instead of the <code>T</code> date/time delimiter
2410 </p>
2411 </li>
2412 <li>
2414 a space between time and time zone
2415 </p>
2416 </li>
2417 <li>
2419 no colon between hours and minutes of the time zone
2420 </p>
2421 </li>
2422 </ul></div>
2423 <div class="paragraph"><p><code>--date=iso-strict</code> (or <code>--date=iso8601-strict</code>) shows timestamps in strict
2424 ISO 8601 format.</p></div>
2425 <div class="paragraph"><p><code>--date=rfc</code> (or <code>--date=rfc2822</code>) shows timestamps in RFC 2822
2426 format, often found in email messages.</p></div>
2427 <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>
2428 <div class="paragraph"><p><code>--date=raw</code> shows the date as seconds since the epoch (1970-01-01
2429 00:00:00 UTC), followed by a space, and then the timezone as an offset
2430 from UTC (a <code>+</code> or <code>-</code> with four digits; the first two are hours, and
2431 the second two are minutes). I.e., as if the timestamp were formatted
2432 with <code>strftime("%s %z")</code>).
2433 Note that the <code>-local</code> option does not affect the seconds-since-epoch
2434 value (which is always measured in UTC), but does switch the accompanying
2435 timezone value.</p></div>
2436 <div class="paragraph"><p><code>--date=human</code> shows the timezone if the timezone does not match the
2437 current time-zone, and doesn&#8217;t print the whole date if that matches
2438 (ie skip printing year for dates that are "this year", but also skip
2439 the whole date itself if it&#8217;s in the last few days and we can just say
2440 what weekday it was). For older dates the hour and minute is also
2441 omitted.</p></div>
2442 <div class="paragraph"><p><code>--date=unix</code> shows the date as a Unix epoch timestamp (seconds since
2443 1970). As with <code>--raw</code>, this is always in UTC and therefore <code>-local</code>
2444 has no effect.</p></div>
2445 <div class="paragraph"><p><code>--date=format:...</code> feeds the format <code>...</code> to your system <code>strftime</code>,
2446 except for %s, %z, and %Z, which are handled internally.
2447 Use <code>--date=format:%c</code> to show the date in your system locale&#8217;s
2448 preferred format. See the <code>strftime</code> manual for a complete list of
2449 format placeholders. When using <code>-local</code>, the correct syntax is
2450 <code>--date=format-local:...</code>.</p></div>
2451 <div class="paragraph"><p><code>--date=default</code> is the default format, and is based on ctime(3)
2452 output. It shows a single line with three-letter day of the week,
2453 three-letter month, day-of-month, hour-minute-seconds in "HH:MM:SS"
2454 format, followed by 4-digit year, plus timezone information, unless
2455 the local time zone is used, e.g. <code>Thu Jan 1 00:00:00 1970 +0000</code>.</p></div>
2456 </div></div>
2457 </dd>
2458 <dt class="hdlist1">
2459 --header
2460 </dt>
2461 <dd>
2463 Print the contents of the commit in raw-format; each record is
2464 separated with a NUL character.
2465 </p>
2466 </dd>
2467 <dt class="hdlist1">
2468 --no-commit-header
2469 </dt>
2470 <dd>
2472 Suppress the header line containing "commit" and the object ID printed before
2473 the specified format. This has no effect on the built-in formats; only custom
2474 formats are affected.
2475 </p>
2476 </dd>
2477 <dt class="hdlist1">
2478 --commit-header
2479 </dt>
2480 <dd>
2482 Overrides a previous <code>--no-commit-header</code>.
2483 </p>
2484 </dd>
2485 <dt class="hdlist1">
2486 --parents
2487 </dt>
2488 <dd>
2490 Print also the parents of the commit (in the form "commit parent&#8230;").
2491 Also enables parent rewriting, see <em>History Simplification</em> above.
2492 </p>
2493 </dd>
2494 <dt class="hdlist1">
2495 --children
2496 </dt>
2497 <dd>
2499 Print also the children of the commit (in the form "commit child&#8230;").
2500 Also enables parent rewriting, see <em>History Simplification</em> above.
2501 </p>
2502 </dd>
2503 <dt class="hdlist1">
2504 --timestamp
2505 </dt>
2506 <dd>
2508 Print the raw commit timestamp.
2509 </p>
2510 </dd>
2511 <dt class="hdlist1">
2512 --left-right
2513 </dt>
2514 <dd>
2516 Mark which side of a symmetric difference a commit is reachable from.
2517 Commits from the left side are prefixed with <code>&lt;</code> and those from
2518 the right with <code>&gt;</code>. If combined with <code>--boundary</code>, those
2519 commits are prefixed with <code>-</code>.
2520 </p>
2521 <div class="paragraph"><p>For example, if you have this topology:</p></div>
2522 <div class="listingblock">
2523 <div class="content">
2524 <pre><code> y---b---b branch B
2525 / \ /
2527 / / \
2528 o---x---a---a branch A</code></pre>
2529 </div></div>
2530 <div class="paragraph"><p>you would get an output like this:</p></div>
2531 <div class="listingblock">
2532 <div class="content">
2533 <pre><code> $ git rev-list --left-right --boundary --pretty=oneline A...B
2535 &gt;bbbbbbb... 3rd on b
2536 &gt;bbbbbbb... 2nd on b
2537 &lt;aaaaaaa... 3rd on a
2538 &lt;aaaaaaa... 2nd on a
2539 -yyyyyyy... 1st on b
2540 -xxxxxxx... 1st on a</code></pre>
2541 </div></div>
2542 </dd>
2543 <dt class="hdlist1">
2544 --graph
2545 </dt>
2546 <dd>
2548 Draw a text-based graphical representation of the commit history
2549 on the left hand side of the output. This may cause extra lines
2550 to be printed in between commits, in order for the graph history
2551 to be drawn properly.
2552 Cannot be combined with <code>--no-walk</code>.
2553 </p>
2554 <div class="paragraph"><p>This enables parent rewriting, see <em>History Simplification</em> above.</p></div>
2555 <div class="paragraph"><p>This implies the <code>--topo-order</code> option by default, but the
2556 <code>--date-order</code> option may also be specified.</p></div>
2557 </dd>
2558 <dt class="hdlist1">
2559 --show-linear-break[=&lt;barrier&gt;]
2560 </dt>
2561 <dd>
2563 When --graph is not used, all history branches are flattened
2564 which can make it hard to see that the two consecutive commits
2565 do not belong to a linear branch. This option puts a barrier
2566 in between them in that case. If <code>&lt;barrier&gt;</code> is specified, it
2567 is the string that will be shown instead of the default one.
2568 </p>
2569 </dd>
2570 <dt class="hdlist1">
2571 --count
2572 </dt>
2573 <dd>
2575 Print a number stating how many commits would have been
2576 listed, and suppress all other output. When used together
2577 with <code>--left-right</code>, instead print the counts for left and
2578 right commits, separated by a tab. When used together with
2579 <code>--cherry-mark</code>, omit patch equivalent commits from these
2580 counts and print the count for equivalent commits separated
2581 by a tab.
2582 </p>
2583 </dd>
2584 </dl></div>
2585 </div>
2586 </div>
2587 </div>
2588 <div class="sect1">
2589 <h2 id="_pretty_formats">PRETTY FORMATS</h2>
2590 <div class="sectionbody">
2591 <div class="paragraph"><p>If the commit is a merge, and if the pretty-format
2592 is not <em>oneline</em>, <em>email</em> or <em>raw</em>, an additional line is
2593 inserted before the <em>Author:</em> line. This line begins with
2594 "Merge: " and the hashes of ancestral commits are printed,
2595 separated by spaces. Note that the listed commits may not
2596 necessarily be the list of the <strong>direct</strong> parent commits if you
2597 have limited your view of history: for example, if you are
2598 only interested in changes related to a certain directory or
2599 file.</p></div>
2600 <div class="paragraph"><p>There are several built-in formats, and you can define
2601 additional formats by setting a pretty.&lt;name&gt;
2602 config option to either another format name, or a
2603 <em>format:</em> string, as described below (see
2604 <a href="git-config.html">git-config(1)</a>). Here are the details of the
2605 built-in formats:</p></div>
2606 <div class="ulist"><ul>
2607 <li>
2609 <em>oneline</em>
2610 </p>
2611 <div class="literalblock">
2612 <div class="content">
2613 <pre><code>&lt;hash&gt; &lt;title-line&gt;</code></pre>
2614 </div></div>
2615 <div class="paragraph"><p>This is designed to be as compact as possible.</p></div>
2616 </li>
2617 <li>
2619 <em>short</em>
2620 </p>
2621 <div class="literalblock">
2622 <div class="content">
2623 <pre><code>commit &lt;hash&gt;
2624 Author: &lt;author&gt;</code></pre>
2625 </div></div>
2626 <div class="literalblock">
2627 <div class="content">
2628 <pre><code>&lt;title-line&gt;</code></pre>
2629 </div></div>
2630 </li>
2631 <li>
2633 <em>medium</em>
2634 </p>
2635 <div class="literalblock">
2636 <div class="content">
2637 <pre><code>commit &lt;hash&gt;
2638 Author: &lt;author&gt;
2639 Date: &lt;author-date&gt;</code></pre>
2640 </div></div>
2641 <div class="literalblock">
2642 <div class="content">
2643 <pre><code>&lt;title-line&gt;</code></pre>
2644 </div></div>
2645 <div class="literalblock">
2646 <div class="content">
2647 <pre><code>&lt;full-commit-message&gt;</code></pre>
2648 </div></div>
2649 </li>
2650 <li>
2652 <em>full</em>
2653 </p>
2654 <div class="literalblock">
2655 <div class="content">
2656 <pre><code>commit &lt;hash&gt;
2657 Author: &lt;author&gt;
2658 Commit: &lt;committer&gt;</code></pre>
2659 </div></div>
2660 <div class="literalblock">
2661 <div class="content">
2662 <pre><code>&lt;title-line&gt;</code></pre>
2663 </div></div>
2664 <div class="literalblock">
2665 <div class="content">
2666 <pre><code>&lt;full-commit-message&gt;</code></pre>
2667 </div></div>
2668 </li>
2669 <li>
2671 <em>fuller</em>
2672 </p>
2673 <div class="literalblock">
2674 <div class="content">
2675 <pre><code>commit &lt;hash&gt;
2676 Author: &lt;author&gt;
2677 AuthorDate: &lt;author-date&gt;
2678 Commit: &lt;committer&gt;
2679 CommitDate: &lt;committer-date&gt;</code></pre>
2680 </div></div>
2681 <div class="literalblock">
2682 <div class="content">
2683 <pre><code>&lt;title-line&gt;</code></pre>
2684 </div></div>
2685 <div class="literalblock">
2686 <div class="content">
2687 <pre><code>&lt;full-commit-message&gt;</code></pre>
2688 </div></div>
2689 </li>
2690 <li>
2692 <em>reference</em>
2693 </p>
2694 <div class="literalblock">
2695 <div class="content">
2696 <pre><code>&lt;abbrev-hash&gt; (&lt;title-line&gt;, &lt;short-author-date&gt;)</code></pre>
2697 </div></div>
2698 <div class="paragraph"><p>This format is used to refer to another commit in a commit message and
2699 is the same as <code>--pretty='format:%C(auto)%h (%s, %ad)'</code>. By default,
2700 the date is formatted with <code>--date=short</code> unless another <code>--date</code> option
2701 is explicitly specified. As with any <code>format:</code> with format
2702 placeholders, its output is not affected by other options like
2703 <code>--decorate</code> and <code>--walk-reflogs</code>.</p></div>
2704 </li>
2705 <li>
2707 <em>email</em>
2708 </p>
2709 <div class="literalblock">
2710 <div class="content">
2711 <pre><code>From &lt;hash&gt; &lt;date&gt;
2712 From: &lt;author&gt;
2713 Date: &lt;author-date&gt;
2714 Subject: [PATCH] &lt;title-line&gt;</code></pre>
2715 </div></div>
2716 <div class="literalblock">
2717 <div class="content">
2718 <pre><code>&lt;full-commit-message&gt;</code></pre>
2719 </div></div>
2720 </li>
2721 <li>
2723 <em>mboxrd</em>
2724 </p>
2725 <div class="paragraph"><p>Like <em>email</em>, but lines in the commit message starting with "From "
2726 (preceded by zero or more "&gt;") are quoted with "&gt;" so they aren&#8217;t
2727 confused as starting a new commit.</p></div>
2728 </li>
2729 <li>
2731 <em>raw</em>
2732 </p>
2733 <div class="paragraph"><p>The <em>raw</em> format shows the entire commit exactly as
2734 stored in the commit object. Notably, the hashes are
2735 displayed in full, regardless of whether --abbrev or
2736 --no-abbrev are used, and <em>parents</em> information show the
2737 true parent commits, without taking grafts or history
2738 simplification into account. Note that this format affects the way
2739 commits are displayed, but not the way the diff is shown e.g. with
2740 <code>git log --raw</code>. To get full object names in a raw diff format,
2741 use <code>--no-abbrev</code>.</p></div>
2742 </li>
2743 <li>
2745 <em>format:&lt;format-string&gt;</em>
2746 </p>
2747 <div class="paragraph"><p>The <em>format:&lt;format-string&gt;</em> format allows you to specify which information
2748 you want to show. It works a little bit like printf format,
2749 with the notable exception that you get a newline with <em>%n</em>
2750 instead of <em>\n</em>.</p></div>
2751 <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>
2752 would show something like this:</p></div>
2753 <div class="listingblock">
2754 <div class="content">
2755 <pre><code>The author of fe6e0ee was Junio C Hamano, 23 hours ago
2756 The title was &gt;&gt;t4119: test autocomputing -p&lt;n&gt; for traditional diff input.&lt;&lt;</code></pre>
2757 </div></div>
2758 <div class="paragraph"><p>The placeholders are:</p></div>
2759 <div class="ulist"><ul>
2760 <li>
2762 Placeholders that expand to a single literal character:
2763 </p>
2764 <div class="dlist"><dl>
2765 <dt class="hdlist1">
2766 <em>%n</em>
2767 </dt>
2768 <dd>
2770 newline
2771 </p>
2772 </dd>
2773 <dt class="hdlist1">
2774 <em>%%</em>
2775 </dt>
2776 <dd>
2778 a raw <em>%</em>
2779 </p>
2780 </dd>
2781 <dt class="hdlist1">
2782 <em>%x00</em>
2783 </dt>
2784 <dd>
2786 <em>%x</em> followed by two hexadecimal digits is replaced with a
2787 byte with the hexadecimal digits' value (we will call this
2788 "literal formatting code" in the rest of this document).
2789 </p>
2790 </dd>
2791 </dl></div>
2792 </li>
2793 <li>
2795 Placeholders that affect formatting of later placeholders:
2796 </p>
2797 <div class="dlist"><dl>
2798 <dt class="hdlist1">
2799 <em>%Cred</em>
2800 </dt>
2801 <dd>
2803 switch color to red
2804 </p>
2805 </dd>
2806 <dt class="hdlist1">
2807 <em>%Cgreen</em>
2808 </dt>
2809 <dd>
2811 switch color to green
2812 </p>
2813 </dd>
2814 <dt class="hdlist1">
2815 <em>%Cblue</em>
2816 </dt>
2817 <dd>
2819 switch color to blue
2820 </p>
2821 </dd>
2822 <dt class="hdlist1">
2823 <em>%Creset</em>
2824 </dt>
2825 <dd>
2827 reset color
2828 </p>
2829 </dd>
2830 <dt class="hdlist1">
2831 <em>%C(&#8230;)</em>
2832 </dt>
2833 <dd>
2835 color specification, as described under Values in the
2836 "CONFIGURATION FILE" section of <a href="git-config.html">git-config(1)</a>. By
2837 default, colors are shown only when enabled for log output
2838 (by <code>color.diff</code>, <code>color.ui</code>, or <code>--color</code>, and respecting
2839 the <code>auto</code> settings of the former if we are going to a
2840 terminal). <code>%C(auto,...)</code> is accepted as a historical
2841 synonym for the default (e.g., <code>%C(auto,red)</code>). Specifying
2842 <code>%C(always,...)</code> will show the colors even when color is
2843 not otherwise enabled (though consider just using
2844 <code>--color=always</code> to enable color for the whole output,
2845 including this format and anything else git might color).
2846 <code>auto</code> alone (i.e. <code>%C(auto)</code>) will turn on auto coloring
2847 on the next placeholders until the color is switched
2848 again.
2849 </p>
2850 </dd>
2851 <dt class="hdlist1">
2852 <em>%m</em>
2853 </dt>
2854 <dd>
2856 left (<code>&lt;</code>), right (<code>&gt;</code>) or boundary (<code>-</code>) mark
2857 </p>
2858 </dd>
2859 <dt class="hdlist1">
2860 <em>%w([&lt;w&gt;[,&lt;i1&gt;[,&lt;i2&gt;]]])</em>
2861 </dt>
2862 <dd>
2864 switch line wrapping, like the -w option of
2865 <a href="git-shortlog.html">git-shortlog(1)</a>.
2866 </p>
2867 </dd>
2868 <dt class="hdlist1">
2869 <em>%&lt;( &lt;N&gt; [,trunc|ltrunc|mtrunc])</em>
2870 </dt>
2871 <dd>
2873 make the next placeholder take at
2874 least N column widths, padding spaces on
2875 the right if necessary. Optionally
2876 truncate (with ellipsis <em>..</em>) at the left (ltrunc) <code>..ft</code>,
2877 the middle (mtrunc) <code>mi..le</code>, or the end
2878 (trunc) <code>rig..</code>, if the output is longer than
2879 N columns.
2880 Note 1: that truncating
2881 only works correctly with N &gt;= 2.
2882 Note 2: spaces around the N and M (see below)
2883 values are optional.
2884 Note 3: Emojis and other wide characters
2885 will take two display columns, which may
2886 over-run column boundaries.
2887 Note 4: decomposed character combining marks
2888 may be misplaced at padding boundaries.
2889 </p>
2890 </dd>
2891 <dt class="hdlist1">
2892 <em>%&lt;|( &lt;M&gt; )</em>
2893 </dt>
2894 <dd>
2896 make the next placeholder take at least until Mth
2897 display column, padding spaces on the right if necessary.
2898 Use negative M values for column positions measured
2899 from the right hand edge of the terminal window.
2900 </p>
2901 </dd>
2902 <dt class="hdlist1">
2903 <em>%&gt;( &lt;N&gt; )</em>, <em>%&gt;|( &lt;M&gt; )</em>
2904 </dt>
2905 <dd>
2907 similar to <em>%&lt;( &lt;N&gt; )</em>, <em>%&lt;|( &lt;M&gt; )</em> respectively,
2908 but padding spaces on the left
2909 </p>
2910 </dd>
2911 <dt class="hdlist1">
2912 <em>%&gt;&gt;( &lt;N&gt; )</em>, <em>%&gt;&gt;|( &lt;M&gt; )</em>
2913 </dt>
2914 <dd>
2916 similar to <em>%&gt;( &lt;N&gt; )</em>, <em>%&gt;|( &lt;M&gt; )</em>
2917 respectively, except that if the next
2918 placeholder takes more spaces than given and
2919 there are spaces on its left, use those
2920 spaces
2921 </p>
2922 </dd>
2923 <dt class="hdlist1">
2924 <em>%&gt;&lt;( &lt;N&gt; )</em>, <em>%&gt;&lt;|( &lt;M&gt; )</em>
2925 </dt>
2926 <dd>
2928 similar to <em>%&lt;( &lt;N&gt; )</em>, <em>%&lt;|( &lt;M&gt; )</em>
2929 respectively, but padding both sides
2930 (i.e. the text is centered)
2931 </p>
2932 </dd>
2933 </dl></div>
2934 </li>
2935 <li>
2937 Placeholders that expand to information extracted from the commit:
2938 </p>
2939 <div class="dlist"><dl>
2940 <dt class="hdlist1">
2941 <em>%H</em>
2942 </dt>
2943 <dd>
2945 commit hash
2946 </p>
2947 </dd>
2948 <dt class="hdlist1">
2949 <em>%h</em>
2950 </dt>
2951 <dd>
2953 abbreviated commit hash
2954 </p>
2955 </dd>
2956 <dt class="hdlist1">
2957 <em>%T</em>
2958 </dt>
2959 <dd>
2961 tree hash
2962 </p>
2963 </dd>
2964 <dt class="hdlist1">
2965 <em>%t</em>
2966 </dt>
2967 <dd>
2969 abbreviated tree hash
2970 </p>
2971 </dd>
2972 <dt class="hdlist1">
2973 <em>%P</em>
2974 </dt>
2975 <dd>
2977 parent hashes
2978 </p>
2979 </dd>
2980 <dt class="hdlist1">
2981 <em>%p</em>
2982 </dt>
2983 <dd>
2985 abbreviated parent hashes
2986 </p>
2987 </dd>
2988 <dt class="hdlist1">
2989 <em>%an</em>
2990 </dt>
2991 <dd>
2993 author name
2994 </p>
2995 </dd>
2996 <dt class="hdlist1">
2997 <em>%aN</em>
2998 </dt>
2999 <dd>
3001 author name (respecting .mailmap, see <a href="git-shortlog.html">git-shortlog(1)</a>
3002 or <a href="git-blame.html">git-blame(1)</a>)
3003 </p>
3004 </dd>
3005 <dt class="hdlist1">
3006 <em>%ae</em>
3007 </dt>
3008 <dd>
3010 author email
3011 </p>
3012 </dd>
3013 <dt class="hdlist1">
3014 <em>%aE</em>
3015 </dt>
3016 <dd>
3018 author email (respecting .mailmap, see <a href="git-shortlog.html">git-shortlog(1)</a>
3019 or <a href="git-blame.html">git-blame(1)</a>)
3020 </p>
3021 </dd>
3022 <dt class="hdlist1">
3023 <em>%al</em>
3024 </dt>
3025 <dd>
3027 author email local-part (the part before the <em>@</em> sign)
3028 </p>
3029 </dd>
3030 <dt class="hdlist1">
3031 <em>%aL</em>
3032 </dt>
3033 <dd>
3035 author local-part (see <em>%al</em>) respecting .mailmap, see
3036 <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)
3037 </p>
3038 </dd>
3039 <dt class="hdlist1">
3040 <em>%ad</em>
3041 </dt>
3042 <dd>
3044 author date (format respects --date= option)
3045 </p>
3046 </dd>
3047 <dt class="hdlist1">
3048 <em>%aD</em>
3049 </dt>
3050 <dd>
3052 author date, RFC2822 style
3053 </p>
3054 </dd>
3055 <dt class="hdlist1">
3056 <em>%ar</em>
3057 </dt>
3058 <dd>
3060 author date, relative
3061 </p>
3062 </dd>
3063 <dt class="hdlist1">
3064 <em>%at</em>
3065 </dt>
3066 <dd>
3068 author date, UNIX timestamp
3069 </p>
3070 </dd>
3071 <dt class="hdlist1">
3072 <em>%ai</em>
3073 </dt>
3074 <dd>
3076 author date, ISO 8601-like format
3077 </p>
3078 </dd>
3079 <dt class="hdlist1">
3080 <em>%aI</em>
3081 </dt>
3082 <dd>
3084 author date, strict ISO 8601 format
3085 </p>
3086 </dd>
3087 <dt class="hdlist1">
3088 <em>%as</em>
3089 </dt>
3090 <dd>
3092 author date, short format (<code>YYYY-MM-DD</code>)
3093 </p>
3094 </dd>
3095 <dt class="hdlist1">
3096 <em>%ah</em>
3097 </dt>
3098 <dd>
3100 author date, human style (like the <code>--date=human</code> option of
3101 <a href="git-rev-list.html">git-rev-list(1)</a>)
3102 </p>
3103 </dd>
3104 <dt class="hdlist1">
3105 <em>%cn</em>
3106 </dt>
3107 <dd>
3109 committer name
3110 </p>
3111 </dd>
3112 <dt class="hdlist1">
3113 <em>%cN</em>
3114 </dt>
3115 <dd>
3117 committer name (respecting .mailmap, see
3118 <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)
3119 </p>
3120 </dd>
3121 <dt class="hdlist1">
3122 <em>%ce</em>
3123 </dt>
3124 <dd>
3126 committer email
3127 </p>
3128 </dd>
3129 <dt class="hdlist1">
3130 <em>%cE</em>
3131 </dt>
3132 <dd>
3134 committer email (respecting .mailmap, see
3135 <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)
3136 </p>
3137 </dd>
3138 <dt class="hdlist1">
3139 <em>%cl</em>
3140 </dt>
3141 <dd>
3143 committer email local-part (the part before the <em>@</em> sign)
3144 </p>
3145 </dd>
3146 <dt class="hdlist1">
3147 <em>%cL</em>
3148 </dt>
3149 <dd>
3151 committer local-part (see <em>%cl</em>) respecting .mailmap, see
3152 <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)
3153 </p>
3154 </dd>
3155 <dt class="hdlist1">
3156 <em>%cd</em>
3157 </dt>
3158 <dd>
3160 committer date (format respects --date= option)
3161 </p>
3162 </dd>
3163 <dt class="hdlist1">
3164 <em>%cD</em>
3165 </dt>
3166 <dd>
3168 committer date, RFC2822 style
3169 </p>
3170 </dd>
3171 <dt class="hdlist1">
3172 <em>%cr</em>
3173 </dt>
3174 <dd>
3176 committer date, relative
3177 </p>
3178 </dd>
3179 <dt class="hdlist1">
3180 <em>%ct</em>
3181 </dt>
3182 <dd>
3184 committer date, UNIX timestamp
3185 </p>
3186 </dd>
3187 <dt class="hdlist1">
3188 <em>%ci</em>
3189 </dt>
3190 <dd>
3192 committer date, ISO 8601-like format
3193 </p>
3194 </dd>
3195 <dt class="hdlist1">
3196 <em>%cI</em>
3197 </dt>
3198 <dd>
3200 committer date, strict ISO 8601 format
3201 </p>
3202 </dd>
3203 <dt class="hdlist1">
3204 <em>%cs</em>
3205 </dt>
3206 <dd>
3208 committer date, short format (<code>YYYY-MM-DD</code>)
3209 </p>
3210 </dd>
3211 <dt class="hdlist1">
3212 <em>%ch</em>
3213 </dt>
3214 <dd>
3216 committer date, human style (like the <code>--date=human</code> option of
3217 <a href="git-rev-list.html">git-rev-list(1)</a>)
3218 </p>
3219 </dd>
3220 <dt class="hdlist1">
3221 <em>%d</em>
3222 </dt>
3223 <dd>
3225 ref names, like the --decorate option of <a href="git-log.html">git-log(1)</a>
3226 </p>
3227 </dd>
3228 <dt class="hdlist1">
3229 <em>%D</em>
3230 </dt>
3231 <dd>
3233 ref names without the " (", ")" wrapping.
3234 </p>
3235 </dd>
3236 <dt class="hdlist1">
3237 <em>%(decorate[:&lt;options&gt;])</em>
3238 </dt>
3239 <dd>
3241 ref names with custom decorations. The <code>decorate</code> string may be followed by a
3242 colon and zero or more comma-separated options. Option values may contain
3243 literal formatting codes. These must be used for commas (<code>%x2C</code>) and closing
3244 parentheses (<code>%x29</code>), due to their role in the option syntax.
3245 </p>
3246 <div class="ulist"><ul>
3247 <li>
3249 <em>prefix=&lt;value&gt;</em>: Shown before the list of ref names. Defaults to "&#160;<code>(</code>".
3250 </p>
3251 </li>
3252 <li>
3254 <em>suffix=&lt;value&gt;</em>: Shown after the list of ref names. Defaults to "<code>)</code>".
3255 </p>
3256 </li>
3257 <li>
3259 <em>separator=&lt;value&gt;</em>: Shown between ref names. Defaults to "<code>,</code>&#160;".
3260 </p>
3261 </li>
3262 <li>
3264 <em>pointer=&lt;value&gt;</em>: Shown between HEAD and the branch it points to, if any.
3265 Defaults to "&#160;<code>-&gt;</code>&#160;".
3266 </p>
3267 </li>
3268 <li>
3270 <em>tag=&lt;value&gt;</em>: Shown before tag names. Defaults to "<code>tag:</code>&#160;".
3271 </p>
3272 </li>
3273 </ul></div>
3274 <div class="paragraph"><p>For example, to produce decorations with no wrapping
3275 or tag annotations, and spaces as separators:</p></div>
3276 <div class="paragraph"><p><code>%(decorate:prefix=,suffix=,tag=,separator= )</code></p></div>
3277 </dd>
3278 <dt class="hdlist1">
3279 <em>%(describe[:&lt;options&gt;])</em>
3280 </dt>
3281 <dd>
3283 human-readable name, like <a href="git-describe.html">git-describe(1)</a>; empty string for
3284 undescribable commits. The <code>describe</code> string may be followed by a colon and
3285 zero or more comma-separated options. Descriptions can be inconsistent when
3286 tags are added or removed at the same time.
3287 </p>
3288 <div class="ulist"><ul>
3289 <li>
3291 <em>tags[=&lt;bool-value&gt;]</em>: Instead of only considering annotated tags,
3292 consider lightweight tags as well.
3293 </p>
3294 </li>
3295 <li>
3297 <em>abbrev=&lt;number&gt;</em>: Instead of using the default number of hexadecimal digits
3298 (which will vary according to the number of objects in the repository with a
3299 default of 7) of the abbreviated object name, use &lt;number&gt; digits, or as many
3300 digits as needed to form a unique object name.
3301 </p>
3302 </li>
3303 <li>
3305 <em>match=&lt;pattern&gt;</em>: Only consider tags matching the given
3306 <code>glob(7)</code> pattern, excluding the "refs/tags/" prefix.
3307 </p>
3308 </li>
3309 <li>
3311 <em>exclude=&lt;pattern&gt;</em>: Do not consider tags matching the given
3312 <code>glob(7)</code> pattern, excluding the "refs/tags/" prefix.
3313 </p>
3314 </li>
3315 </ul></div>
3316 </dd>
3317 <dt class="hdlist1">
3318 <em>%S</em>
3319 </dt>
3320 <dd>
3322 ref name given on the command line by which the commit was reached
3323 (like <code>git log --source</code>), only works with <code>git log</code>
3324 </p>
3325 </dd>
3326 <dt class="hdlist1">
3327 <em>%e</em>
3328 </dt>
3329 <dd>
3331 encoding
3332 </p>
3333 </dd>
3334 <dt class="hdlist1">
3335 <em>%s</em>
3336 </dt>
3337 <dd>
3339 subject
3340 </p>
3341 </dd>
3342 <dt class="hdlist1">
3343 <em>%f</em>
3344 </dt>
3345 <dd>
3347 sanitized subject line, suitable for a filename
3348 </p>
3349 </dd>
3350 <dt class="hdlist1">
3351 <em>%b</em>
3352 </dt>
3353 <dd>
3355 body
3356 </p>
3357 </dd>
3358 <dt class="hdlist1">
3359 <em>%B</em>
3360 </dt>
3361 <dd>
3363 raw body (unwrapped subject and body)
3364 </p>
3365 </dd>
3366 <dt class="hdlist1">
3367 <em>%GG</em>
3368 </dt>
3369 <dd>
3371 raw verification message from GPG for a signed commit
3372 </p>
3373 </dd>
3374 <dt class="hdlist1">
3375 <em>%G?</em>
3376 </dt>
3377 <dd>
3379 show "G" for a good (valid) signature,
3380 "B" for a bad signature,
3381 "U" for a good signature with unknown validity,
3382 "X" for a good signature that has expired,
3383 "Y" for a good signature made by an expired key,
3384 "R" for a good signature made by a revoked key,
3385 "E" if the signature cannot be checked (e.g. missing key)
3386 and "N" for no signature
3387 </p>
3388 </dd>
3389 <dt class="hdlist1">
3390 <em>%GS</em>
3391 </dt>
3392 <dd>
3394 show the name of the signer for a signed commit
3395 </p>
3396 </dd>
3397 <dt class="hdlist1">
3398 <em>%GK</em>
3399 </dt>
3400 <dd>
3402 show the key used to sign a signed commit
3403 </p>
3404 </dd>
3405 <dt class="hdlist1">
3406 <em>%GF</em>
3407 </dt>
3408 <dd>
3410 show the fingerprint of the key used to sign a signed commit
3411 </p>
3412 </dd>
3413 <dt class="hdlist1">
3414 <em>%GP</em>
3415 </dt>
3416 <dd>
3418 show the fingerprint of the primary key whose subkey was used
3419 to sign a signed commit
3420 </p>
3421 </dd>
3422 <dt class="hdlist1">
3423 <em>%GT</em>
3424 </dt>
3425 <dd>
3427 show the trust level for the key used to sign a signed commit
3428 </p>
3429 </dd>
3430 <dt class="hdlist1">
3431 <em>%gD</em>
3432 </dt>
3433 <dd>
3435 reflog selector, e.g., <code>refs/stash@{1}</code> or <code>refs/stash@{2
3436 minutes ago}</code>; the format follows the rules described for the
3437 <code>-g</code> option. The portion before the <code>@</code> is the refname as
3438 given on the command line (so <code>git log -g refs/heads/master</code>
3439 would yield <code>refs/heads/master@{0}</code>).
3440 </p>
3441 </dd>
3442 <dt class="hdlist1">
3443 <em>%gd</em>
3444 </dt>
3445 <dd>
3447 shortened reflog selector; same as <code>%gD</code>, but the refname
3448 portion is shortened for human readability (so
3449 <code>refs/heads/master</code> becomes just <code>master</code>).
3450 </p>
3451 </dd>
3452 <dt class="hdlist1">
3453 <em>%gn</em>
3454 </dt>
3455 <dd>
3457 reflog identity name
3458 </p>
3459 </dd>
3460 <dt class="hdlist1">
3461 <em>%gN</em>
3462 </dt>
3463 <dd>
3465 reflog identity name (respecting .mailmap, see
3466 <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)
3467 </p>
3468 </dd>
3469 <dt class="hdlist1">
3470 <em>%ge</em>
3471 </dt>
3472 <dd>
3474 reflog identity email
3475 </p>
3476 </dd>
3477 <dt class="hdlist1">
3478 <em>%gE</em>
3479 </dt>
3480 <dd>
3482 reflog identity email (respecting .mailmap, see
3483 <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)
3484 </p>
3485 </dd>
3486 <dt class="hdlist1">
3487 <em>%gs</em>
3488 </dt>
3489 <dd>
3491 reflog subject
3492 </p>
3493 </dd>
3494 <dt class="hdlist1">
3495 <em>%(trailers[:&lt;options&gt;])</em>
3496 </dt>
3497 <dd>
3499 display the trailers of the body as interpreted by
3500 <a href="git-interpret-trailers.html">git-interpret-trailers(1)</a>. The <code>trailers</code> string may be followed by
3501 a colon and zero or more comma-separated options. If any option is provided
3502 multiple times, the last occurrence wins.
3503 </p>
3504 <div class="ulist"><ul>
3505 <li>
3507 <em>key=&lt;key&gt;</em>: only show trailers with specified &lt;key&gt;. Matching is done
3508 case-insensitively and trailing colon is optional. If option is
3509 given multiple times trailer lines matching any of the keys are
3510 shown. This option automatically enables the <code>only</code> option so that
3511 non-trailer lines in the trailer block are hidden. If that is not
3512 desired it can be disabled with <code>only=false</code>. E.g.,
3513 <code>%(trailers:key=Reviewed-by)</code> shows trailer lines with key
3514 <code>Reviewed-by</code>.
3515 </p>
3516 </li>
3517 <li>
3519 <em>only[=&lt;bool&gt;]</em>: select whether non-trailer lines from the trailer
3520 block should be included.
3521 </p>
3522 </li>
3523 <li>
3525 <em>separator=&lt;sep&gt;</em>: specify a separator inserted between trailer
3526 lines. When this option is not given each trailer line is
3527 terminated with a line feed character. The string &lt;sep&gt; may contain
3528 the literal formatting codes described above. To use comma as
3529 separator one must use <code>%x2C</code> as it would otherwise be parsed as
3530 next option. E.g., <code>%(trailers:key=Ticket,separator=%x2C )</code>
3531 shows all trailer lines whose key is "Ticket" separated by a comma
3532 and a space.
3533 </p>
3534 </li>
3535 <li>
3537 <em>unfold[=&lt;bool&gt;]</em>: make it behave as if interpret-trailer&#8217;s <code>--unfold</code>
3538 option was given. E.g.,
3539 <code>%(trailers:only,unfold=true)</code> unfolds and shows all trailer lines.
3540 </p>
3541 </li>
3542 <li>
3544 <em>keyonly[=&lt;bool&gt;]</em>: only show the key part of the trailer.
3545 </p>
3546 </li>
3547 <li>
3549 <em>valueonly[=&lt;bool&gt;]</em>: only show the value part of the trailer.
3550 </p>
3551 </li>
3552 <li>
3554 <em>key_value_separator=&lt;sep&gt;</em>: specify a separator inserted between
3555 trailer lines. When this option is not given each trailer key-value
3556 pair is separated by ": ". Otherwise it shares the same semantics
3557 as <em>separator=&lt;sep&gt;</em> above.
3558 </p>
3559 </li>
3560 </ul></div>
3561 </dd>
3562 </dl></div>
3563 </li>
3564 </ul></div>
3565 </li>
3566 </ul></div>
3567 <div class="admonitionblock">
3568 <table><tr>
3569 <td class="icon">
3570 <div class="title">Note</div>
3571 </td>
3572 <td class="content">Some placeholders may depend on other options given to the
3573 revision traversal engine. For example, the <code>%g*</code> reflog options will
3574 insert an empty string unless we are traversing reflog entries (e.g., by
3575 <code>git log -g</code>). The <code>%d</code> and <code>%D</code> placeholders will use the "short"
3576 decoration format if <code>--decorate</code> was not already provided on the command
3577 line.</td>
3578 </tr></table>
3579 </div>
3580 <div class="paragraph"><p>The boolean options accept an optional value <code>[=&lt;bool-value&gt;]</code>. The values
3581 <code>true</code>, <code>false</code>, <code>on</code>, <code>off</code> etc. are all accepted. See the "boolean"
3582 sub-section in "EXAMPLES" in <a href="git-config.html">git-config(1)</a>. If a boolean
3583 option is given with no value, it&#8217;s enabled.</p></div>
3584 <div class="paragraph"><p>If you add a <code>+</code> (plus sign) after <em>%</em> of a placeholder, a line-feed
3585 is inserted immediately before the expansion if and only if the
3586 placeholder expands to a non-empty string.</p></div>
3587 <div class="paragraph"><p>If you add a <code>-</code> (minus sign) after <em>%</em> of a placeholder, all consecutive
3588 line-feeds immediately preceding the expansion are deleted if and only if the
3589 placeholder expands to an empty string.</p></div>
3590 <div class="paragraph"><p>If you add a ` ` (space) after <em>%</em> of a placeholder, a space
3591 is inserted immediately before the expansion if and only if the
3592 placeholder expands to a non-empty string.</p></div>
3593 <div class="ulist"><ul>
3594 <li>
3596 <em>tformat:</em>
3597 </p>
3598 <div class="paragraph"><p>The <em>tformat:</em> format works exactly like <em>format:</em>, except that it
3599 provides "terminator" semantics instead of "separator" semantics. In
3600 other words, each commit has the message terminator character (usually a
3601 newline) appended, rather than a separator placed between entries.
3602 This means that the final entry of a single-line format will be properly
3603 terminated with a new line, just as the "oneline" format does.
3604 For example:</p></div>
3605 <div class="listingblock">
3606 <div class="content">
3607 <pre><code>$ git log -2 --pretty=format:%h 4da45bef \
3608 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
3609 4da45be
3610 7134973 -- NO NEWLINE
3612 $ git log -2 --pretty=tformat:%h 4da45bef \
3613 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
3614 4da45be
3615 7134973</code></pre>
3616 </div></div>
3617 <div class="paragraph"><p>In addition, any unrecognized string that has a <code>%</code> in it is interpreted
3618 as if it has <code>tformat:</code> in front of it. For example, these two are
3619 equivalent:</p></div>
3620 <div class="listingblock">
3621 <div class="content">
3622 <pre><code>$ git log -2 --pretty=tformat:%h 4da45bef
3623 $ git log -2 --pretty=%h 4da45bef</code></pre>
3624 </div></div>
3625 </li>
3626 </ul></div>
3627 </div>
3628 </div>
3629 <div class="sect1">
3630 <h2 id="_examples">EXAMPLES</h2>
3631 <div class="sectionbody">
3632 <div class="ulist"><ul>
3633 <li>
3635 Print the list of commits reachable from the current branch.
3636 </p>
3637 <div class="listingblock">
3638 <div class="content">
3639 <pre><code>git rev-list HEAD</code></pre>
3640 </div></div>
3641 </li>
3642 <li>
3644 Print the list of commits on this branch, but not present in the
3645 upstream branch.
3646 </p>
3647 <div class="listingblock">
3648 <div class="content">
3649 <pre><code>git rev-list @{upstream}..HEAD</code></pre>
3650 </div></div>
3651 </li>
3652 <li>
3654 Format commits with their author and commit message (see also the
3655 porcelain <a href="git-log.html">git-log(1)</a>).
3656 </p>
3657 <div class="listingblock">
3658 <div class="content">
3659 <pre><code>git rev-list --format=medium HEAD</code></pre>
3660 </div></div>
3661 </li>
3662 <li>
3664 Format commits along with their diffs (see also the porcelain
3665 <a href="git-log.html">git-log(1)</a>, which can do this in a single process).
3666 </p>
3667 <div class="listingblock">
3668 <div class="content">
3669 <pre><code>git rev-list HEAD |
3670 git diff-tree --stdin --format=medium -p</code></pre>
3671 </div></div>
3672 </li>
3673 <li>
3675 Print the list of commits on the current branch that touched any
3676 file in the <code>Documentation</code> directory.
3677 </p>
3678 <div class="listingblock">
3679 <div class="content">
3680 <pre><code>git rev-list HEAD -- Documentation/</code></pre>
3681 </div></div>
3682 </li>
3683 <li>
3685 Print the list of commits authored by you in the past year, on
3686 any branch, tag, or other ref.
3687 </p>
3688 <div class="listingblock">
3689 <div class="content">
3690 <pre><code>git rev-list --author=you@example.com --since=1.year.ago --all</code></pre>
3691 </div></div>
3692 </li>
3693 <li>
3695 Print the list of objects reachable from the current branch (i.e., all
3696 commits and the blobs and trees they contain).
3697 </p>
3698 <div class="listingblock">
3699 <div class="content">
3700 <pre><code>git rev-list --objects HEAD</code></pre>
3701 </div></div>
3702 </li>
3703 <li>
3705 Compare the disk size of all reachable objects, versus those
3706 reachable from reflogs, versus the total packed size. This can tell
3707 you whether running <code>git repack -ad</code> might reduce the repository size
3708 (by dropping unreachable objects), and whether expiring reflogs might
3709 help.
3710 </p>
3711 <div class="listingblock">
3712 <div class="content">
3713 <pre><code># reachable objects
3714 git rev-list --disk-usage --objects --all
3715 # plus reflogs
3716 git rev-list --disk-usage --objects --all --reflog
3717 # total disk size used
3718 du -c .git/objects/pack/*.pack .git/objects/??/*
3719 # alternative to du: add up "size" and "size-pack" fields
3720 git count-objects -v</code></pre>
3721 </div></div>
3722 </li>
3723 <li>
3725 Report the disk size of each branch, not including objects used by the
3726 current branch. This can find outliers that are contributing to a
3727 bloated repository size (e.g., because somebody accidentally committed
3728 large build artifacts).
3729 </p>
3730 <div class="listingblock">
3731 <div class="content">
3732 <pre><code>git for-each-ref --format='%(refname)' |
3733 while read branch
3735 size=$(git rev-list --disk-usage --objects HEAD..$branch)
3736 echo "$size $branch"
3737 done |
3738 sort -n</code></pre>
3739 </div></div>
3740 </li>
3741 <li>
3743 Compare the on-disk size of branches in one group of refs, excluding
3744 another. If you co-mingle objects from multiple remotes in a single
3745 repository, this can show which remotes are contributing to the
3746 repository size (taking the size of <code>origin</code> as a baseline).
3747 </p>
3748 <div class="listingblock">
3749 <div class="content">
3750 <pre><code>git rev-list --disk-usage --objects --remotes=$suspect --not --remotes=origin</code></pre>
3751 </div></div>
3752 </li>
3753 </ul></div>
3754 </div>
3755 </div>
3756 <div class="sect1">
3757 <h2 id="_git">GIT</h2>
3758 <div class="sectionbody">
3759 <div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
3760 </div>
3761 </div>
3762 </div>
3763 <div id="footnotes"><hr /></div>
3764 <div id="footer">
3765 <div id="footer-text">
3766 Last updated
3767 2022-10-28 11:53:56 PDT
3768 </div>
3769 </div>
3770 </body>
3771 </html>