blob: cc7191e6717f50690bd27fb5c394847eb4079738 [file] [log] [blame]
Junio C Hamano1a4e8412005-12-27 08:17:231<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
2 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
4<head>
Junio C Hamano9629d4f2012-12-19 00:28:275<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
Junio C Hamanoac12f0e2014-09-19 22:32:516<meta name="generator" content="AsciiDoc 8.6.9" />
Junio C Hamano68cf15a2010-11-06 01:01:597<title>git-log(1)</title>
Junio C Hamano1a4e8412005-12-27 08:17:238<style type="text/css">
Junio C Hamano9629d4f2012-12-19 00:28:279/* Shared CSS for AsciiDoc xhtml11 and html5 backends */
10
11/* Default font. */
12body {
13 font-family: Georgia,serif;
14}
15
16/* Title font. */
17h1, h2, h3, h4, h5, h6,
18div.title, caption.title,
19thead, p.table.header,
20#toctitle,
21#author, #revnumber, #revdate, #revremark,
22#footer {
23 font-family: Arial,Helvetica,sans-serif;
Junio C Hamano1a4e8412005-12-27 08:17:2324}
25
26body {
27 margin: 1em 5% 1em 5%;
28}
29
Junio C Hamanoba4b9282008-07-06 05:20:3130a {
31 color: blue;
32 text-decoration: underline;
33}
34a:visited {
35 color: fuchsia;
36}
Junio C Hamano1a4e8412005-12-27 08:17:2337
38em {
39 font-style: italic;
Junio C Hamano68cf15a2010-11-06 01:01:5940 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:2341}
42
43strong {
44 font-weight: bold;
Junio C Hamano68cf15a2010-11-06 01:01:5945 color: #083194;
Junio C Hamano1a4e8412005-12-27 08:17:2346}
47
Junio C Hamano1a4e8412005-12-27 08:17:2348h1, h2, h3, h4, h5, h6 {
49 color: #527bbd;
Junio C Hamano1a4e8412005-12-27 08:17:2350 margin-top: 1.2em;
51 margin-bottom: 0.5em;
52 line-height: 1.3;
53}
54
Junio C Hamanoba4b9282008-07-06 05:20:3155h1, h2, h3 {
Junio C Hamano1a4e8412005-12-27 08:17:2356 border-bottom: 2px solid silver;
57}
58h2 {
Junio C Hamano1a4e8412005-12-27 08:17:2359 padding-top: 0.5em;
60}
Junio C Hamanoba4b9282008-07-06 05:20:3161h3 {
62 float: left;
63}
64h3 + * {
65 clear: left;
66}
Junio C Hamano9629d4f2012-12-19 00:28:2767h5 {
68 font-size: 1.0em;
69}
Junio C Hamano1a4e8412005-12-27 08:17:2370
71div.sectionbody {
Junio C Hamano1a4e8412005-12-27 08:17:2372 margin-left: 0;
73}
74
75hr {
76 border: 1px solid silver;
77}
78
79p {
80 margin-top: 0.5em;
81 margin-bottom: 0.5em;
82}
83
Junio C Hamano68cf15a2010-11-06 01:01:5984ul, ol, li > p {
85 margin-top: 0;
86}
Junio C Hamano9629d4f2012-12-19 00:28:2787ul > li { color: #aaa; }
88ul > li > * { color: black; }
Junio C Hamano68cf15a2010-11-06 01:01:5989
Junio C Hamanoac12f0e2014-09-19 22:32:5190.monospaced, code, pre {
91 font-family: "Courier New", Courier, monospace;
92 font-size: inherit;
93 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:2394 padding: 0;
95 margin: 0;
96}
Junio C Hamanoac12f0e2014-09-19 22:32:5197pre {
98 white-space: pre-wrap;
99}
Junio C Hamano1a4e8412005-12-27 08:17:23100
Junio C Hamano9629d4f2012-12-19 00:28:27101#author {
Junio C Hamano1a4e8412005-12-27 08:17:23102 color: #527bbd;
Junio C Hamano1a4e8412005-12-27 08:17:23103 font-weight: bold;
Junio C Hamanoba4b9282008-07-06 05:20:31104 font-size: 1.1em;
Junio C Hamano1a4e8412005-12-27 08:17:23105}
Junio C Hamano9629d4f2012-12-19 00:28:27106#email {
Junio C Hamano1a4e8412005-12-27 08:17:23107}
Junio C Hamano9629d4f2012-12-19 00:28:27108#revnumber, #revdate, #revremark {
Junio C Hamano1a4e8412005-12-27 08:17:23109}
110
Junio C Hamano9629d4f2012-12-19 00:28:27111#footer {
Junio C Hamano1a4e8412005-12-27 08:17:23112 font-size: small;
113 border-top: 2px solid silver;
114 padding-top: 0.5em;
115 margin-top: 4.0em;
116}
Junio C Hamano9629d4f2012-12-19 00:28:27117#footer-text {
Junio C Hamano1a4e8412005-12-27 08:17:23118 float: left;
119 padding-bottom: 0.5em;
120}
Junio C Hamano9629d4f2012-12-19 00:28:27121#footer-badges {
Junio C Hamano1a4e8412005-12-27 08:17:23122 float: right;
123 padding-bottom: 0.5em;
124}
125
Junio C Hamano9629d4f2012-12-19 00:28:27126#preamble {
Junio C Hamano68cf15a2010-11-06 01:01:59127 margin-top: 1.5em;
128 margin-bottom: 1.5em;
129}
Junio C Hamano9629d4f2012-12-19 00:28:27130div.imageblock, div.exampleblock, div.verseblock,
Junio C Hamano1a4e8412005-12-27 08:17:23131div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
132div.admonitionblock {
Junio C Hamano7bd050f2011-09-22 06:32:22133 margin-top: 1.0em;
Junio C Hamano1a4e8412005-12-27 08:17:23134 margin-bottom: 1.5em;
135}
136div.admonitionblock {
Junio C Hamano7bd050f2011-09-22 06:32:22137 margin-top: 2.0em;
138 margin-bottom: 2.0em;
139 margin-right: 10%;
140 color: #606060;
Junio C Hamano1a4e8412005-12-27 08:17:23141}
142
143div.content { /* Block element content. */
144 padding: 0;
145}
146
147/* Block element titles. */
148div.title, caption.title {
Junio C Hamano68cf15a2010-11-06 01:01:59149 color: #527bbd;
Junio C Hamano1a4e8412005-12-27 08:17:23150 font-weight: bold;
151 text-align: left;
152 margin-top: 1.0em;
153 margin-bottom: 0.5em;
154}
155div.title + * {
156 margin-top: 0;
157}
158
159td div.title:first-child {
160 margin-top: 0.0em;
161}
162div.content div.title:first-child {
163 margin-top: 0.0em;
164}
165div.content + div.title {
166 margin-top: 0.0em;
167}
168
169div.sidebarblock > div.content {
170 background: #ffffee;
Junio C Hamano9629d4f2012-12-19 00:28:27171 border: 1px solid #dddddd;
172 border-left: 4px solid #f0f0f0;
Junio C Hamano1a4e8412005-12-27 08:17:23173 padding: 0.5em;
174}
175
176div.listingblock > div.content {
Junio C Hamano9629d4f2012-12-19 00:28:27177 border: 1px solid #dddddd;
178 border-left: 5px solid #f0f0f0;
179 background: #f8f8f8;
Junio C Hamano1a4e8412005-12-27 08:17:23180 padding: 0.5em;
181}
182
Junio C Hamano7bd050f2011-09-22 06:32:22183div.quoteblock, div.verseblock {
184 padding-left: 1.0em;
185 margin-left: 1.0em;
Junio C Hamano68cf15a2010-11-06 01:01:59186 margin-right: 10%;
Junio C Hamano9629d4f2012-12-19 00:28:27187 border-left: 5px solid #f0f0f0;
188 color: #888;
Junio C Hamano1a4e8412005-12-27 08:17:23189}
Junio C Hamano7bd050f2011-09-22 06:32:22190
Junio C Hamano68cf15a2010-11-06 01:01:59191div.quoteblock > div.attribution {
192 padding-top: 0.5em;
Junio C Hamano1a4e8412005-12-27 08:17:23193 text-align: right;
194}
Junio C Hamano68cf15a2010-11-06 01:01:59195
Junio C Hamano9629d4f2012-12-19 00:28:27196div.verseblock > pre.content {
197 font-family: inherit;
198 font-size: inherit;
Junio C Hamano68cf15a2010-11-06 01:01:59199}
200div.verseblock > div.attribution {
201 padding-top: 0.75em;
202 text-align: left;
203}
204/* DEPRECATED: Pre version 8.2.7 verse style literal block. */
Junio C Hamanoba4b9282008-07-06 05:20:31205div.verseblock + div.attribution {
206 text-align: left;
207}
Junio C Hamano1a4e8412005-12-27 08:17:23208
209div.admonitionblock .icon {
210 vertical-align: top;
211 font-size: 1.1em;
212 font-weight: bold;
213 text-decoration: underline;
214 color: #527bbd;
215 padding-right: 0.5em;
216}
217div.admonitionblock td.content {
218 padding-left: 0.5em;
Junio C Hamano7bd050f2011-09-22 06:32:22219 border-left: 3px solid #dddddd;
Junio C Hamano1a4e8412005-12-27 08:17:23220}
221
222div.exampleblock > div.content {
Junio C Hamano7bd050f2011-09-22 06:32:22223 border-left: 3px solid #dddddd;
224 padding-left: 0.5em;
Junio C Hamano1a4e8412005-12-27 08:17:23225}
226
Junio C Hamano1a4e8412005-12-27 08:17:23227div.imageblock div.content { padding-left: 0; }
Junio C Hamanoac12f0e2014-09-19 22:32:51228span.image img { border-style: none; vertical-align: text-bottom; }
Junio C Hamano68cf15a2010-11-06 01:01:59229a.image:visited { color: white; }
Junio C Hamano1a4e8412005-12-27 08:17:23230
231dl {
232 margin-top: 0.8em;
233 margin-bottom: 0.8em;
234}
235dt {
236 margin-top: 0.5em;
237 margin-bottom: 0;
Junio C Hamano68cf15a2010-11-06 01:01:59238 font-style: normal;
239 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:23240}
241dd > *:first-child {
Junio C Hamano68cf15a2010-11-06 01:01:59242 margin-top: 0.1em;
Junio C Hamano1a4e8412005-12-27 08:17:23243}
244
245ul, ol {
246 list-style-position: outside;
247}
Junio C Hamano68cf15a2010-11-06 01:01:59248ol.arabic {
249 list-style-type: decimal;
250}
251ol.loweralpha {
Junio C Hamano1a4e8412005-12-27 08:17:23252 list-style-type: lower-alpha;
253}
Junio C Hamano68cf15a2010-11-06 01:01:59254ol.upperalpha {
255 list-style-type: upper-alpha;
256}
257ol.lowerroman {
258 list-style-type: lower-roman;
259}
260ol.upperroman {
261 list-style-type: upper-roman;
262}
263
264div.compact ul, div.compact ol,
265div.compact p, div.compact p,
266div.compact div, div.compact div {
267 margin-top: 0.1em;
268 margin-bottom: 0.1em;
269}
Junio C Hamano1a4e8412005-12-27 08:17:23270
Junio C Hamano1a4e8412005-12-27 08:17:23271tfoot {
272 font-weight: bold;
273}
Junio C Hamano68cf15a2010-11-06 01:01:59274td > div.verse {
275 white-space: pre;
276}
Junio C Hamano68cf15a2010-11-06 01:01:59277
278div.hdlist {
Junio C Hamano1a4e8412005-12-27 08:17:23279 margin-top: 0.8em;
280 margin-bottom: 0.8em;
281}
Junio C Hamano68cf15a2010-11-06 01:01:59282div.hdlist tr {
283 padding-bottom: 15px;
Junio C Hamanoba4b9282008-07-06 05:20:31284}
Junio C Hamano68cf15a2010-11-06 01:01:59285dt.hdlist1.strong, td.hdlist1.strong {
286 font-weight: bold;
287}
288td.hdlist1 {
Junio C Hamano1a4e8412005-12-27 08:17:23289 vertical-align: top;
Junio C Hamano68cf15a2010-11-06 01:01:59290 font-style: normal;
Junio C Hamano1a4e8412005-12-27 08:17:23291 padding-right: 0.8em;
Junio C Hamano68cf15a2010-11-06 01:01:59292 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:23293}
Junio C Hamano68cf15a2010-11-06 01:01:59294td.hdlist2 {
Junio C Hamano1a4e8412005-12-27 08:17:23295 vertical-align: top;
296}
Junio C Hamano68cf15a2010-11-06 01:01:59297div.hdlist.compact tr {
298 margin: 0;
299 padding-bottom: 0;
300}
301
302.comment {
303 background: yellow;
304}
Junio C Hamano1a4e8412005-12-27 08:17:23305
Junio C Hamano7bd050f2011-09-22 06:32:22306.footnote, .footnoteref {
307 font-size: 0.8em;
308}
309
310span.footnote, span.footnoteref {
311 vertical-align: super;
312}
313
314#footnotes {
315 margin: 20px 0 20px 0;
316 padding: 7px 0 0 0;
317}
318
319#footnotes div.footnote {
320 margin: 0 0 5px 0;
321}
322
323#footnotes hr {
324 border: none;
325 border-top: 1px solid silver;
326 height: 1px;
327 text-align: left;
328 margin-left: 0;
329 width: 20%;
330 min-width: 100px;
331}
332
Junio C Hamano9629d4f2012-12-19 00:28:27333div.colist td {
334 padding-right: 0.5em;
335 padding-bottom: 0.3em;
336 vertical-align: top;
337}
338div.colist td img {
339 margin-top: 0.3em;
Junio C Hamano1a4e8412005-12-27 08:17:23340}
Junio C Hamanoba4b9282008-07-06 05:20:31341
Junio C Hamano9629d4f2012-12-19 00:28:27342@media print {
343 #footer-badges { display: none; }
344}
345
346#toc {
Junio C Hamano7bd050f2011-09-22 06:32:22347 margin-bottom: 2.5em;
348}
349
Junio C Hamano9629d4f2012-12-19 00:28:27350#toctitle {
Junio C Hamanoba4b9282008-07-06 05:20:31351 color: #527bbd;
Junio C Hamanoba4b9282008-07-06 05:20:31352 font-size: 1.1em;
353 font-weight: bold;
354 margin-top: 1.0em;
355 margin-bottom: 0.1em;
356}
357
Junio C Hamanoac12f0e2014-09-19 22:32:51358div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
Junio C Hamanoba4b9282008-07-06 05:20:31359 margin-top: 0;
360 margin-bottom: 0;
361}
362div.toclevel2 {
363 margin-left: 2em;
364 font-size: 0.9em;
365}
366div.toclevel3 {
367 margin-left: 4em;
368 font-size: 0.9em;
369}
370div.toclevel4 {
371 margin-left: 6em;
372 font-size: 0.9em;
373}
Junio C Hamano9629d4f2012-12-19 00:28:27374
375span.aqua { color: aqua; }
376span.black { color: black; }
377span.blue { color: blue; }
378span.fuchsia { color: fuchsia; }
379span.gray { color: gray; }
380span.green { color: green; }
381span.lime { color: lime; }
382span.maroon { color: maroon; }
383span.navy { color: navy; }
384span.olive { color: olive; }
385span.purple { color: purple; }
386span.red { color: red; }
387span.silver { color: silver; }
388span.teal { color: teal; }
389span.white { color: white; }
390span.yellow { color: yellow; }
391
392span.aqua-background { background: aqua; }
393span.black-background { background: black; }
394span.blue-background { background: blue; }
395span.fuchsia-background { background: fuchsia; }
396span.gray-background { background: gray; }
397span.green-background { background: green; }
398span.lime-background { background: lime; }
399span.maroon-background { background: maroon; }
400span.navy-background { background: navy; }
401span.olive-background { background: olive; }
402span.purple-background { background: purple; }
403span.red-background { background: red; }
404span.silver-background { background: silver; }
405span.teal-background { background: teal; }
406span.white-background { background: white; }
407span.yellow-background { background: yellow; }
408
409span.big { font-size: 2em; }
410span.small { font-size: 0.6em; }
411
412span.underline { text-decoration: underline; }
413span.overline { text-decoration: overline; }
414span.line-through { text-decoration: line-through; }
415
Junio C Hamanoac12f0e2014-09-19 22:32:51416div.unbreakable { page-break-inside: avoid; }
417
Junio C Hamano9629d4f2012-12-19 00:28:27418
419/*
420 * xhtml11 specific
421 *
422 * */
423
424div.tableblock {
425 margin-top: 1.0em;
426 margin-bottom: 1.5em;
427}
428div.tableblock > table {
429 border: 3px solid #527bbd;
430}
431thead, p.table.header {
432 font-weight: bold;
433 color: #527bbd;
434}
435p.table {
436 margin-top: 0;
437}
438/* Because the table frame attribute is overriden by CSS in most browsers. */
439div.tableblock > table[frame="void"] {
440 border-style: none;
441}
442div.tableblock > table[frame="hsides"] {
443 border-left-style: none;
444 border-right-style: none;
445}
446div.tableblock > table[frame="vsides"] {
447 border-top-style: none;
448 border-bottom-style: none;
449}
450
451
452/*
453 * html5 specific
454 *
455 * */
456
457table.tableblock {
458 margin-top: 1.0em;
459 margin-bottom: 1.5em;
460}
461thead, p.tableblock.header {
462 font-weight: bold;
463 color: #527bbd;
464}
465p.tableblock {
466 margin-top: 0;
467}
468table.tableblock {
469 border-width: 3px;
470 border-spacing: 0px;
471 border-style: solid;
472 border-color: #527bbd;
473 border-collapse: collapse;
474}
475th.tableblock, td.tableblock {
476 border-width: 1px;
477 padding: 4px;
478 border-style: solid;
479 border-color: #527bbd;
480}
481
482table.tableblock.frame-topbot {
483 border-left-style: hidden;
484 border-right-style: hidden;
485}
486table.tableblock.frame-sides {
487 border-top-style: hidden;
488 border-bottom-style: hidden;
489}
490table.tableblock.frame-none {
491 border-style: hidden;
492}
493
494th.tableblock.halign-left, td.tableblock.halign-left {
495 text-align: left;
496}
497th.tableblock.halign-center, td.tableblock.halign-center {
498 text-align: center;
499}
500th.tableblock.halign-right, td.tableblock.halign-right {
501 text-align: right;
502}
503
504th.tableblock.valign-top, td.tableblock.valign-top {
505 vertical-align: top;
506}
507th.tableblock.valign-middle, td.tableblock.valign-middle {
508 vertical-align: middle;
509}
510th.tableblock.valign-bottom, td.tableblock.valign-bottom {
511 vertical-align: bottom;
512}
513
514
515/*
516 * manpage specific
517 *
518 * */
519
520body.manpage h1 {
Junio C Hamano68cf15a2010-11-06 01:01:59521 padding-top: 0.5em;
522 padding-bottom: 0.5em;
523 border-top: 2px solid silver;
524 border-bottom: 2px solid silver;
525}
Junio C Hamano9629d4f2012-12-19 00:28:27526body.manpage h2 {
Junio C Hamano68cf15a2010-11-06 01:01:59527 border-style: none;
528}
Junio C Hamano9629d4f2012-12-19 00:28:27529body.manpage div.sectionbody {
530 margin-left: 3em;
Junio C Hamano68cf15a2010-11-06 01:01:59531}
532
533@media print {
Junio C Hamano9629d4f2012-12-19 00:28:27534 body.manpage div#toc { display: none; }
Junio C Hamano68cf15a2010-11-06 01:01:59535}
Junio C Hamanoac12f0e2014-09-19 22:32:51536
537
Junio C Hamano1a4e8412005-12-27 08:17:23538</style>
Junio C Hamano7bd050f2011-09-22 06:32:22539<script type="text/javascript">
540/*<![CDATA[*/
Junio C Hamano7bd050f2011-09-22 06:32:22541var asciidoc = { // Namespace.
542
543/////////////////////////////////////////////////////////////////////
544// Table Of Contents generator
545/////////////////////////////////////////////////////////////////////
546
547/* Author: Mihai Bazon, September 2002
548 * http://students.infoiasi.ro/~mishoo
549 *
550 * Table Of Content generator
551 * Version: 0.4
552 *
553 * Feel free to use this script under the terms of the GNU General Public
554 * License, as long as you do not remove or alter this notice.
555 */
556
557 /* modified by Troy D. Hanson, September 2006. License: GPL */
558 /* modified by Stuart Rackham, 2006, 2009. License: GPL */
559
560// toclevels = 1..4.
561toc: function (toclevels) {
562
563 function getText(el) {
564 var text = "";
565 for (var i = el.firstChild; i != null; i = i.nextSibling) {
566 if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
567 text += i.data;
568 else if (i.firstChild != null)
569 text += getText(i);
570 }
571 return text;
572 }
573
574 function TocEntry(el, text, toclevel) {
575 this.element = el;
576 this.text = text;
577 this.toclevel = toclevel;
578 }
579
580 function tocEntries(el, toclevels) {
581 var result = new Array;
Junio C Hamanoac12f0e2014-09-19 22:32:51582 var re = new RegExp('[hH]([1-'+(toclevels+1)+'])');
Junio C Hamano7bd050f2011-09-22 06:32:22583 // Function that scans the DOM tree for header elements (the DOM2
584 // nodeIterator API would be a better technique but not supported by all
585 // browsers).
586 var iterate = function (el) {
587 for (var i = el.firstChild; i != null; i = i.nextSibling) {
588 if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
589 var mo = re.exec(i.tagName);
590 if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
591 result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
592 }
593 iterate(i);
594 }
595 }
596 }
597 iterate(el);
598 return result;
599 }
600
601 var toc = document.getElementById("toc");
Junio C Hamano9629d4f2012-12-19 00:28:27602 if (!toc) {
603 return;
604 }
605
606 // Delete existing TOC entries in case we're reloading the TOC.
607 var tocEntriesToRemove = [];
608 var i;
609 for (i = 0; i < toc.childNodes.length; i++) {
610 var entry = toc.childNodes[i];
Junio C Hamanoac12f0e2014-09-19 22:32:51611 if (entry.nodeName.toLowerCase() == 'div'
Junio C Hamano9629d4f2012-12-19 00:28:27612 && entry.getAttribute("class")
613 && entry.getAttribute("class").match(/^toclevel/))
614 tocEntriesToRemove.push(entry);
615 }
616 for (i = 0; i < tocEntriesToRemove.length; i++) {
617 toc.removeChild(tocEntriesToRemove[i]);
618 }
619
620 // Rebuild TOC entries.
Junio C Hamano7bd050f2011-09-22 06:32:22621 var entries = tocEntries(document.getElementById("content"), toclevels);
622 for (var i = 0; i < entries.length; ++i) {
623 var entry = entries[i];
624 if (entry.element.id == "")
625 entry.element.id = "_toc_" + i;
626 var a = document.createElement("a");
627 a.href = "#" + entry.element.id;
628 a.appendChild(document.createTextNode(entry.text));
629 var div = document.createElement("div");
630 div.appendChild(a);
631 div.className = "toclevel" + entry.toclevel;
632 toc.appendChild(div);
633 }
634 if (entries.length == 0)
635 toc.parentNode.removeChild(toc);
636},
637
638
639/////////////////////////////////////////////////////////////////////
640// Footnotes generator
641/////////////////////////////////////////////////////////////////////
642
643/* Based on footnote generation code from:
644 * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
645 */
646
647footnotes: function () {
Junio C Hamano9629d4f2012-12-19 00:28:27648 // Delete existing footnote entries in case we're reloading the footnodes.
649 var i;
Junio C Hamano7bd050f2011-09-22 06:32:22650 var noteholder = document.getElementById("footnotes");
Junio C Hamano9629d4f2012-12-19 00:28:27651 if (!noteholder) {
652 return;
653 }
654 var entriesToRemove = [];
655 for (i = 0; i < noteholder.childNodes.length; i++) {
656 var entry = noteholder.childNodes[i];
Junio C Hamanoac12f0e2014-09-19 22:32:51657 if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote")
Junio C Hamano9629d4f2012-12-19 00:28:27658 entriesToRemove.push(entry);
659 }
660 for (i = 0; i < entriesToRemove.length; i++) {
661 noteholder.removeChild(entriesToRemove[i]);
662 }
663
664 // Rebuild footnote entries.
665 var cont = document.getElementById("content");
Junio C Hamano7bd050f2011-09-22 06:32:22666 var spans = cont.getElementsByTagName("span");
667 var refs = {};
668 var n = 0;
669 for (i=0; i<spans.length; i++) {
670 if (spans[i].className == "footnote") {
671 n++;
Junio C Hamano9629d4f2012-12-19 00:28:27672 var note = spans[i].getAttribute("data-note");
673 if (!note) {
674 // Use [\s\S] in place of . so multi-line matches work.
675 // Because JavaScript has no s (dotall) regex flag.
676 note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
677 spans[i].innerHTML =
678 "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
679 "' title='View footnote' class='footnote'>" + n + "</a>]";
680 spans[i].setAttribute("data-note", note);
681 }
Junio C Hamano7bd050f2011-09-22 06:32:22682 noteholder.innerHTML +=
683 "<div class='footnote' id='_footnote_" + n + "'>" +
684 "<a href='#_footnoteref_" + n + "' title='Return to text'>" +
685 n + "</a>. " + note + "</div>";
Junio C Hamano7bd050f2011-09-22 06:32:22686 var id =spans[i].getAttribute("id");
687 if (id != null) refs["#"+id] = n;
688 }
689 }
690 if (n == 0)
691 noteholder.parentNode.removeChild(noteholder);
692 else {
693 // Process footnoterefs.
694 for (i=0; i<spans.length; i++) {
695 if (spans[i].className == "footnoteref") {
696 var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
697 href = href.match(/#.*/)[0]; // Because IE return full URL.
698 n = refs[href];
699 spans[i].innerHTML =
700 "[<a href='#_footnote_" + n +
701 "' title='View footnote' class='footnote'>" + n + "</a>]";
702 }
703 }
704 }
Junio C Hamano9629d4f2012-12-19 00:28:27705},
706
707install: function(toclevels) {
708 var timerId;
709
710 function reinstall() {
711 asciidoc.footnotes();
712 if (toclevels) {
713 asciidoc.toc(toclevels);
714 }
715 }
716
717 function reinstallAndRemoveTimer() {
718 clearInterval(timerId);
719 reinstall();
720 }
721
722 timerId = setInterval(reinstall, 500);
723 if (document.addEventListener)
724 document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false);
725 else
726 window.onload = reinstallAndRemoveTimer;
Junio C Hamano7bd050f2011-09-22 06:32:22727}
728
729}
Junio C Hamano9629d4f2012-12-19 00:28:27730asciidoc.install();
Junio C Hamano7bd050f2011-09-22 06:32:22731/*]]>*/
732</script>
Junio C Hamano1a4e8412005-12-27 08:17:23733</head>
Junio C Hamano9629d4f2012-12-19 00:28:27734<body class="manpage">
Junio C Hamano1a4e8412005-12-27 08:17:23735<div id="header">
736<h1>
737git-log(1) Manual Page
738</h1>
739<h2>NAME</h2>
740<div class="sectionbody">
741<p>git-log -
742 Show commit logs
743</p>
744</div>
745</div>
Junio C Hamano7bd050f2011-09-22 06:32:22746<div id="content">
Junio C Hamano9629d4f2012-12-19 00:28:27747<div class="sect1">
Junio C Hamano68cf15a2010-11-06 01:01:59748<h2 id="_synopsis">SYNOPSIS</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23749<div class="sectionbody">
Junio C Hamano15567bc2011-07-23 00:51:59750<div class="verseblock">
Junio C Hamanof26c77e2013-04-27 00:06:04751<pre class="content"><em>git log</em> [&lt;options&gt;] [&lt;revision range&gt;] [[--] &lt;path&gt;&#8230;]</pre>
Junio C Hamano9629d4f2012-12-19 00:28:27752<div class="attribution">
Junio C Hamano15567bc2011-07-23 00:51:59753</div></div>
Junio C Hamano1a4e8412005-12-27 08:17:23754</div>
Junio C Hamano9629d4f2012-12-19 00:28:27755</div>
756<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:31757<h2 id="_description">DESCRIPTION</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23758<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:59759<div class="paragraph"><p>Shows the commit logs.</p></div>
Junio C Hamanoac12f0e2014-09-19 22:32:51760<div class="paragraph"><p>The command takes options applicable to the <code>git rev-list</code>
Junio C Hamanoba7c8d82006-04-15 06:17:42761command to control what is shown and how, and options applicable to
Junio C Hamanoac12f0e2014-09-19 22:32:51762the <code>git diff-*</code> commands to control how the changes
Junio C Hamanoba4b9282008-07-06 05:20:31763each commit introduces are shown.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:23764</div>
Junio C Hamano9629d4f2012-12-19 00:28:27765</div>
766<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:31767<h2 id="_options">OPTIONS</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23768<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:59769<div class="dlist"><dl>
770<dt class="hdlist1">
Junio C Hamano78e3a782010-07-15 22:24:45771--follow
772</dt>
773<dd>
774<p>
775 Continue listing the history of a file beyond renames
776 (works only for a single file).
777</p>
778</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59779<dt class="hdlist1">
Junio C Hamano78e3a782010-07-15 22:24:45780--no-decorate
781</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59782<dt class="hdlist1">
Junio C Hamano37cf4082016-05-30 01:22:14783--decorate[=short|full|auto|no]
Junio C Hamano78e3a782010-07-15 22:24:45784</dt>
785<dd>
786<p>
787 Print out the ref names of any commits that are shown. If <em>short</em> is
788 specified, the ref name prefixes <em>refs/heads/</em>, <em>refs/tags/</em> and
789 <em>refs/remotes/</em> will not be printed. If <em>full</em> is specified, the
Junio C Hamano37cf4082016-05-30 01:22:14790 full ref name (including prefix) will be printed. If <em>auto</em> is
791 specified, then if the output is going to a terminal, the ref names
792 are shown as if <em>short</em> were given, otherwise no ref names are
793 shown. The default option is <em>short</em>.
Junio C Hamano78e3a782010-07-15 22:24:45794</p>
795</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59796<dt class="hdlist1">
Junio C Hamano371470a2017-12-13 22:26:40797--decorate-refs=&lt;pattern&gt;
798</dt>
799<dt class="hdlist1">
800--decorate-refs-exclude=&lt;pattern&gt;
801</dt>
802<dd>
803<p>
804 If no <code>--decorate-refs</code> is given, pretend as if all refs were
805 included. For each candidate, do not use it for decoration if it
806 matches any patterns given to <code>--decorate-refs-exclude</code> or if it
807 doesn&#8217;t match any of the patterns given to <code>--decorate-refs</code>.
808</p>
809</dd>
810<dt class="hdlist1">
Junio C Hamano78e3a782010-07-15 22:24:45811--source
812</dt>
813<dd>
814<p>
815 Print out the ref name given on the command line by which each
816 commit was reached.
817</p>
818</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59819<dt class="hdlist1">
Junio C Hamanoce836cc2013-01-21 02:01:53820--use-mailmap
821</dt>
822<dd>
823<p>
824 Use mailmap file to map author and committer names and email
Junio C Hamanob73af6c2013-12-03 22:07:11825 addresses to canonical real names and email addresses. See
Junio C Hamanoce836cc2013-01-21 02:01:53826 <a href="git-shortlog.html">git-shortlog(1)</a>.
827</p>
828</dd>
829<dt class="hdlist1">
Junio C Hamano78e3a782010-07-15 22:24:45830--full-diff
831</dt>
832<dd>
833<p>
Junio C Hamanoac12f0e2014-09-19 22:32:51834 Without this flag, <code>git log -p &lt;path&gt;...</code> shows commits that
Junio C Hamano78e3a782010-07-15 22:24:45835 touch the specified paths, and diffs about the same specified
836 paths. With this, the full diff is shown for commits that touch
837 the specified paths; this means that "&lt;path&gt;&#8230;" limits only
Junio C Hamano68cf15a2010-11-06 01:01:59838 commits, and doesn&#8217;t limit diff for those commits.
Junio C Hamano78e3a782010-07-15 22:24:45839</p>
Junio C Hamano68cf15a2010-11-06 01:01:59840<div class="paragraph"><p>Note that this affects all diff-based output types, e.g. those
Junio C Hamanoac12f0e2014-09-19 22:32:51841produced by <code>--stat</code>, etc.</p></div>
Junio C Hamano78e3a782010-07-15 22:24:45842</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59843<dt class="hdlist1">
Junio C Hamano78e3a782010-07-15 22:24:45844--log-size
845</dt>
846<dd>
847<p>
Junio C Hamanob73af6c2013-12-03 22:07:11848 Include a line &#8220;log size &lt;number&gt;&#8221; in the output for each commit,
849 where &lt;number&gt; is the length of that commit&#8217;s message in bytes.
Junio C Hamanoac12f0e2014-09-19 22:32:51850 Intended to speed up tools that read log messages from <code>git log</code>
Junio C Hamanob73af6c2013-12-03 22:07:11851 output by allowing them to allocate space in advance.
Junio C Hamano78e3a782010-07-15 22:24:45852</p>
853</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59854<dt class="hdlist1">
Junio C Hamano8eac2682013-09-09 22:35:20855-L &lt;start&gt;,&lt;end&gt;:&lt;file&gt;
856</dt>
857<dt class="hdlist1">
Junio C Hamanodd5004a2015-05-06 19:33:32858-L :&lt;funcname&gt;:&lt;file&gt;
Junio C Hamano7e590a12013-06-02 23:46:52859</dt>
860<dd>
861<p>
862 Trace the evolution of the line range given by "&lt;start&gt;,&lt;end&gt;"
Junio C Hamanodd5004a2015-05-06 19:33:32863 (or the function name regex &lt;funcname&gt;) within the &lt;file&gt;. You may
Junio C Hamano7e590a12013-06-02 23:46:52864 not give any pathspec limiters. This is currently limited to
865 a walk starting from a single revision, i.e., you may only
866 give zero or one positive revision arguments.
867 You can specify this option more than once.
868</p>
869<div class="paragraph"><p>&lt;start&gt; and &lt;end&gt; can take one of these forms:</p></div>
870<div class="ulist"><ul>
871<li>
872<p>
873number
874</p>
875<div class="paragraph"><p>If &lt;start&gt; or &lt;end&gt; is a number, it specifies an
876absolute line number (lines count from 1).</p></div>
877</li>
878<li>
879<p>
880/regex/
881</p>
882<div class="paragraph"><p>This form will use the first line matching the given
Junio C Hamano8eac2682013-09-09 22:35:20883POSIX regex. If &lt;start&gt; is a regex, it will search from the end of
Junio C Hamanoac12f0e2014-09-19 22:32:51884the previous <code>-L</code> range, if any, otherwise from the start of file.
Junio C Hamano8eac2682013-09-09 22:35:20885If &lt;start&gt; is &#8220;^/regex/&#8221;, it will search from the start of file.
886If &lt;end&gt; is a regex, it will search
Junio C Hamano7e590a12013-06-02 23:46:52887starting at the line given by &lt;start&gt;.</p></div>
888</li>
889<li>
890<p>
891+offset or -offset
892</p>
893<div class="paragraph"><p>This is only valid for &lt;end&gt; and will specify a number
894of lines before or after the line given by &lt;start&gt;.</p></div>
895</li>
Junio C Hamano7e590a12013-06-02 23:46:52896</ul></div>
Junio C Hamanodd5004a2015-05-06 19:33:32897<div class="paragraph"><p>If &#8220;:&lt;funcname&gt;&#8221; is given in place of &lt;start&gt; and &lt;end&gt;, it is a
898regular expression that denotes the range from the first funcname line
899that matches &lt;funcname&gt;, up to the next funcname line. &#8220;:&lt;funcname&gt;&#8221;
900searches from the end of the previous <code>-L</code> range, if any, otherwise
901from the start of file. &#8220;^:&lt;funcname&gt;&#8221; searches from the start of
902file.</p></div>
Junio C Hamano7e590a12013-06-02 23:46:52903</dd>
904<dt class="hdlist1">
Junio C Hamanof26c77e2013-04-27 00:06:04905&lt;revision range&gt;
906</dt>
907<dd>
908<p>
909 Show only commits in the specified revision range. When no
Junio C Hamanoac12f0e2014-09-19 22:32:51910 &lt;revision range&gt; is specified, it defaults to <code>HEAD</code> (i.e. the
911 whole history leading to the current commit). <code>origin..HEAD</code>
Junio C Hamanof26c77e2013-04-27 00:06:04912 specifies all the commits reachable from the current commit
Junio C Hamanoac12f0e2014-09-19 22:32:51913 (i.e. <code>HEAD</code>), but not from <code>origin</code>. For a complete list of
Junio C Hamanob73af6c2013-12-03 22:07:11914 ways to spell &lt;revision range&gt;, see the <em>Specifying Ranges</em>
Junio C Hamanof26c77e2013-04-27 00:06:04915 section of <a href="gitrevisions.html">gitrevisions(7)</a>.
916</p>
917</dd>
918<dt class="hdlist1">
Junio C Hamano78e3a782010-07-15 22:24:45919[--] &lt;path&gt;&#8230;
920</dt>
921<dd>
922<p>
Junio C Hamano5723afa2011-08-31 00:49:23923 Show only commits that are enough to explain how the files
Junio C Hamanob73af6c2013-12-03 22:07:11924 that match the specified paths came to be. See <em>History
925 Simplification</em> below for details and other simplification
Junio C Hamano5723afa2011-08-31 00:49:23926 modes.
Junio C Hamano78e3a782010-07-15 22:24:45927</p>
Junio C Hamanob73af6c2013-12-03 22:07:11928<div class="paragraph"><p>Paths may need to be prefixed with &#8216;`-- '&#8217; to separate them from
Junio C Hamanof26c77e2013-04-27 00:06:04929options or the revision range, when confusion arises.</p></div>
Junio C Hamano78e3a782010-07-15 22:24:45930</dd>
931</dl></div>
Junio C Hamano9629d4f2012-12-19 00:28:27932<div class="sect2">
933<h3 id="_commit_limiting">Commit Limiting</h3>
Junio C Hamano68cf15a2010-11-06 01:01:59934<div class="paragraph"><p>Besides specifying a range of commits that should be listed using the
Junio C Hamanob0e02952008-01-19 08:02:00935special notations explained in the description, additional commit
Junio C Hamano8ce35d72012-09-18 22:30:42936limiting may be applied.</p></div>
937<div class="paragraph"><p>Using more options generally further limits the output (e.g.
Junio C Hamanoac12f0e2014-09-19 22:32:51938<code>--since=&lt;date1&gt;</code> limits to commits newer than <code>&lt;date1&gt;</code>, and using it
939with <code>--grep=&lt;pattern&gt;</code> further limits to commits whose log message
940has a line that matches <code>&lt;pattern&gt;</code>), unless otherwise noted.</p></div>
Junio C Hamano8ce35d72012-09-18 22:30:42941<div class="paragraph"><p>Note that these are applied before commit
Junio C Hamanoac12f0e2014-09-19 22:32:51942ordering and formatting options, such as <code>--reverse</code>.</p></div>
Junio C Hamano9629d4f2012-12-19 00:28:27943<div class="openblock">
944<div class="content">
Junio C Hamano68cf15a2010-11-06 01:01:59945<div class="dlist"><dl>
946<dt class="hdlist1">
Junio C Hamano693e7092012-09-12 22:56:53947-&lt;number&gt;
948</dt>
949<dt class="hdlist1">
950-n &lt;number&gt;
Junio C Hamanoeb415992008-06-08 22:49:47951</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59952<dt class="hdlist1">
Junio C Hamanob4a9ede2009-04-08 07:36:32953--max-count=&lt;number&gt;
Junio C Hamanob0e02952008-01-19 08:02:00954</dt>
955<dd>
956<p>
Junio C Hamanoc5be4cc2011-03-09 07:20:43957 Limit the number of commits to output.
Junio C Hamanob0e02952008-01-19 08:02:00958</p>
959</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59960<dt class="hdlist1">
Junio C Hamanob4a9ede2009-04-08 07:36:32961--skip=&lt;number&gt;
Junio C Hamanob0e02952008-01-19 08:02:00962</dt>
963<dd>
964<p>
965 Skip <em>number</em> commits before starting to show the commit output.
966</p>
967</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59968<dt class="hdlist1">
Junio C Hamanob4a9ede2009-04-08 07:36:32969--since=&lt;date&gt;
Junio C Hamanoeb415992008-06-08 22:49:47970</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59971<dt class="hdlist1">
Junio C Hamanob4a9ede2009-04-08 07:36:32972--after=&lt;date&gt;
Junio C Hamanob0e02952008-01-19 08:02:00973</dt>
974<dd>
975<p>
976 Show commits more recent than a specific date.
977</p>
978</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59979<dt class="hdlist1">
Junio C Hamanob4a9ede2009-04-08 07:36:32980--until=&lt;date&gt;
Junio C Hamanoeb415992008-06-08 22:49:47981</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59982<dt class="hdlist1">
Junio C Hamanob4a9ede2009-04-08 07:36:32983--before=&lt;date&gt;
Junio C Hamanob0e02952008-01-19 08:02:00984</dt>
985<dd>
986<p>
987 Show commits older than a specific date.
988</p>
989</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59990<dt class="hdlist1">
Junio C Hamanob4a9ede2009-04-08 07:36:32991--author=&lt;pattern&gt;
Junio C Hamanoeb415992008-06-08 22:49:47992</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59993<dt class="hdlist1">
Junio C Hamanob4a9ede2009-04-08 07:36:32994--committer=&lt;pattern&gt;
Junio C Hamanob0e02952008-01-19 08:02:00995</dt>
996<dd>
997<p>
998 Limit the commits output to ones with author/committer
Junio C Hamano8ce35d72012-09-18 22:30:42999 header lines that match the specified pattern (regular
Junio C Hamanoac12f0e2014-09-19 22:32:511000 expression). With more than one <code>--author=&lt;pattern&gt;</code>,
Junio C Hamano8ce35d72012-09-18 22:30:421001 commits whose author matches any of the given patterns are
Junio C Hamanoac12f0e2014-09-19 22:32:511002 chosen (similarly for multiple <code>--committer=&lt;pattern&gt;</code>).
Junio C Hamanob0e02952008-01-19 08:02:001003</p>
1004</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591005<dt class="hdlist1">
Junio C Hamano9954ed72012-10-03 04:54:001006--grep-reflog=&lt;pattern&gt;
1007</dt>
1008<dd>
1009<p>
1010 Limit the commits output to ones with reflog entries that
1011 match the specified pattern (regular expression). With
Junio C Hamanoac12f0e2014-09-19 22:32:511012 more than one <code>--grep-reflog</code>, commits whose reflog message
Junio C Hamano9954ed72012-10-03 04:54:001013 matches any of the given patterns are chosen. It is an
Junio C Hamanoac12f0e2014-09-19 22:32:511014 error to use this option unless <code>--walk-reflogs</code> is in use.
Junio C Hamano9954ed72012-10-03 04:54:001015</p>
1016</dd>
1017<dt class="hdlist1">
Junio C Hamanob4a9ede2009-04-08 07:36:321018--grep=&lt;pattern&gt;
Junio C Hamanob0e02952008-01-19 08:02:001019</dt>
1020<dd>
1021<p>
1022 Limit the commits output to ones with log message that
Junio C Hamano8ce35d72012-09-18 22:30:421023 matches the specified pattern (regular expression). With
Junio C Hamanoac12f0e2014-09-19 22:32:511024 more than one <code>--grep=&lt;pattern&gt;</code>, commits whose message
Junio C Hamano8ce35d72012-09-18 22:30:421025 matches any of the given patterns are chosen (but see
Junio C Hamanoac12f0e2014-09-19 22:32:511026 <code>--all-match</code>).
Junio C Hamanob0e02952008-01-19 08:02:001027</p>
Junio C Hamano8152abf2015-04-28 22:48:021028<div class="paragraph"><p>When <code>--show-notes</code> is in effect, the message from the notes is
1029matched as if it were part of the log message.</p></div>
Junio C Hamanob0e02952008-01-19 08:02:001030</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591031<dt class="hdlist1">
Junio C Hamanoaa17c7c2008-11-03 04:36:581032--all-match
1033</dt>
1034<dd>
1035<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511036 Limit the commits output to ones that match all given <code>--grep</code>,
Junio C Hamano8ce35d72012-09-18 22:30:421037 instead of ones that match at least one.
Junio C Hamanoaa17c7c2008-11-03 04:36:581038</p>
1039</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591040<dt class="hdlist1">
Junio C Hamano6bb32e62015-02-17 22:11:261041--invert-grep
1042</dt>
1043<dd>
1044<p>
1045 Limit the commits output to ones with log message that do not
1046 match the pattern specified with <code>--grep=&lt;pattern&gt;</code>.
1047</p>
1048</dd>
1049<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471050-i
1051</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591052<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471053--regexp-ignore-case
Junio C Hamanob0e02952008-01-19 08:02:001054</dt>
1055<dd>
1056<p>
Junio C Hamanob73af6c2013-12-03 22:07:111057 Match the regular expression limiting patterns without regard to letter
1058 case.
Junio C Hamanob0e02952008-01-19 08:02:001059</p>
1060</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591061<dt class="hdlist1">
Junio C Hamanoa1295452012-11-13 22:32:041062--basic-regexp
1063</dt>
1064<dd>
1065<p>
1066 Consider the limiting patterns to be basic regular expressions;
1067 this is the default.
1068</p>
1069</dd>
1070<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471071-E
1072</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591073<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471074--extended-regexp
Junio C Hamanob0e02952008-01-19 08:02:001075</dt>
1076<dd>
1077<p>
1078 Consider the limiting patterns to be extended regular expressions
1079 instead of the default basic regular expressions.
1080</p>
1081</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591082<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471083-F
1084</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591085<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471086--fixed-strings
Junio C Hamano24bc09a2008-02-28 00:27:441087</dt>
1088<dd>
1089<p>
Junio C Hamano68cf15a2010-11-06 01:01:591090 Consider the limiting patterns to be fixed strings (don&#8217;t interpret
Junio C Hamano24bc09a2008-02-28 00:27:441091 pattern as a regular expression).
1092</p>
1093</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591094<dt class="hdlist1">
Junio C Hamanoa275c1f2017-06-19 20:10:121095-P
1096</dt>
1097<dt class="hdlist1">
Junio C Hamanoa1295452012-11-13 22:32:041098--perl-regexp
1099</dt>
1100<dd>
1101<p>
Junio C Hamano222ed822017-06-02 06:24:061102 Consider the limiting patterns to be Perl-compatible regular
1103 expressions.
Junio C Hamanoa1295452012-11-13 22:32:041104</p>
Junio C Hamano222ed822017-06-02 06:24:061105<div class="paragraph"><p>Support for these types of regular expressions is an optional
1106compile-time dependency. If Git wasn&#8217;t compiled with support for them
1107providing this option will cause it to die.</p></div>
Junio C Hamanoa1295452012-11-13 22:32:041108</dd>
1109<dt class="hdlist1">
Junio C Hamanob0e02952008-01-19 08:02:001110--remove-empty
1111</dt>
1112<dd>
1113<p>
1114 Stop when a given path disappears from the tree.
1115</p>
1116</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591117<dt class="hdlist1">
Junio C Hamano934e1782009-07-16 06:59:151118--merges
1119</dt>
1120<dd>
1121<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511122 Print only merge commits. This is exactly the same as <code>--min-parents=2</code>.
Junio C Hamano934e1782009-07-16 06:59:151123</p>
1124</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591125<dt class="hdlist1">
Junio C Hamanob0e02952008-01-19 08:02:001126--no-merges
1127</dt>
1128<dd>
1129<p>
Junio C Hamanof32ce262011-03-27 07:35:111130 Do not print commits with more than one parent. This is
Junio C Hamanoac12f0e2014-09-19 22:32:511131 exactly the same as <code>--max-parents=1</code>.
Junio C Hamanob0e02952008-01-19 08:02:001132</p>
1133</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591134<dt class="hdlist1">
Junio C Hamanof32ce262011-03-27 07:35:111135--min-parents=&lt;number&gt;
1136</dt>
1137<dt class="hdlist1">
1138--max-parents=&lt;number&gt;
1139</dt>
1140<dt class="hdlist1">
1141--no-min-parents
1142</dt>
1143<dt class="hdlist1">
1144--no-max-parents
1145</dt>
1146<dd>
1147<p>
Junio C Hamanoc5bb3b32013-08-05 22:43:361148 Show only commits which have at least (or at most) that many parent
Junio C Hamanoac12f0e2014-09-19 22:32:511149 commits. In particular, <code>--max-parents=1</code> is the same as <code>--no-merges</code>,
1150 <code>--min-parents=2</code> is the same as <code>--merges</code>. <code>--max-parents=0</code>
1151 gives all root commits and <code>--min-parents=3</code> all octopus merges.
Junio C Hamanof32ce262011-03-27 07:35:111152</p>
Junio C Hamanoac12f0e2014-09-19 22:32:511153<div class="paragraph"><p><code>--no-min-parents</code> and <code>--no-max-parents</code> reset these limits (to no limit)
1154again. Equivalent forms are <code>--min-parents=0</code> (any commit has 0 or more
1155parents) and <code>--max-parents=-1</code> (negative numbers denote no upper limit).</p></div>
Junio C Hamanof32ce262011-03-27 07:35:111156</dd>
1157<dt class="hdlist1">
Junio C Hamanob0e02952008-01-19 08:02:001158--first-parent
1159</dt>
1160<dd>
1161<p>
1162 Follow only the first parent commit upon seeing a merge
1163 commit. This option can give a better overview when
1164 viewing the evolution of a particular topic branch,
1165 because merges into a topic branch tend to be only about
1166 adjusting to updated upstream from time to time, and
1167 this option allows you to ignore the individual commits
Junio C Hamanoef57d1e2015-03-25 21:23:001168 brought in to your history by such a merge. Cannot be
1169 combined with --bisect.
Junio C Hamanob0e02952008-01-19 08:02:001170</p>
1171</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591172<dt class="hdlist1">
Junio C Hamanob0e02952008-01-19 08:02:001173--not
1174</dt>
1175<dd>
1176<p>
1177 Reverses the meaning of the <em>&#94;</em> prefix (or lack thereof)
Junio C Hamanoac12f0e2014-09-19 22:32:511178 for all following revision specifiers, up to the next <code>--not</code>.
Junio C Hamanob0e02952008-01-19 08:02:001179</p>
1180</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591181<dt class="hdlist1">
Junio C Hamanob0e02952008-01-19 08:02:001182--all
1183</dt>
1184<dd>
1185<p>
Junio C Hamanoe89102f2017-02-15 23:18:151186 Pretend as if all the refs in <code>refs/</code>, along with <code>HEAD</code>, are
1187 listed on the command line as <em>&lt;commit&gt;</em>.
Junio C Hamanob0e02952008-01-19 08:02:001188</p>
1189</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591190<dt class="hdlist1">
Junio C Hamanod2179ef2010-10-22 04:12:171191--branches[=&lt;pattern&gt;]
Junio C Hamano50819852008-11-19 02:07:561192</dt>
1193<dd>
1194<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511195 Pretend as if all the refs in <code>refs/heads</code> are listed
Junio C Hamanod2179ef2010-10-22 04:12:171196 on the command line as <em>&lt;commit&gt;</em>. If <em>&lt;pattern&gt;</em> is given, limit
Junio C Hamano57827fb2010-01-23 03:02:501197 branches to ones matching given shell glob. If pattern lacks <em>?</em>,
Junio C Hamano81d540a2012-03-02 19:52:471198 <em>&#42;</em>, or <em>[</em>, <em>/&#42;</em> at the end is implied.
Junio C Hamano50819852008-11-19 02:07:561199</p>
1200</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591201<dt class="hdlist1">
Junio C Hamanod2179ef2010-10-22 04:12:171202--tags[=&lt;pattern&gt;]
Junio C Hamano50819852008-11-19 02:07:561203</dt>
1204<dd>
1205<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511206 Pretend as if all the refs in <code>refs/tags</code> are listed
Junio C Hamanod2179ef2010-10-22 04:12:171207 on the command line as <em>&lt;commit&gt;</em>. If <em>&lt;pattern&gt;</em> is given, limit
Junio C Hamano81d540a2012-03-02 19:52:471208 tags to ones matching given shell glob. If pattern lacks <em>?</em>, <em>&#42;</em>,
1209 or <em>[</em>, <em>/&#42;</em> at the end is implied.
Junio C Hamano50819852008-11-19 02:07:561210</p>
1211</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591212<dt class="hdlist1">
Junio C Hamanod2179ef2010-10-22 04:12:171213--remotes[=&lt;pattern&gt;]
Junio C Hamano50819852008-11-19 02:07:561214</dt>
1215<dd>
1216<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511217 Pretend as if all the refs in <code>refs/remotes</code> are listed
Junio C Hamanod2179ef2010-10-22 04:12:171218 on the command line as <em>&lt;commit&gt;</em>. If <em>&lt;pattern&gt;</em> is given, limit
Junio C Hamano97bcb482010-11-25 03:16:071219 remote-tracking branches to ones matching given shell glob.
Junio C Hamano81d540a2012-03-02 19:52:471220 If pattern lacks <em>?</em>, <em>&#42;</em>, or <em>[</em>, <em>/&#42;</em> at the end is implied.
Junio C Hamano57827fb2010-01-23 03:02:501221</p>
1222</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591223<dt class="hdlist1">
Junio C Hamanod2179ef2010-10-22 04:12:171224--glob=&lt;glob-pattern&gt;
Junio C Hamano57827fb2010-01-23 03:02:501225</dt>
1226<dd>
1227<p>
Junio C Hamanod2179ef2010-10-22 04:12:171228 Pretend as if all the refs matching shell glob <em>&lt;glob-pattern&gt;</em>
Junio C Hamano57827fb2010-01-23 03:02:501229 are listed on the command line as <em>&lt;commit&gt;</em>. Leading <em>refs/</em>,
Junio C Hamano81d540a2012-03-02 19:52:471230 is automatically prepended if missing. If pattern lacks <em>?</em>, <em>&#42;</em>,
1231 or <em>[</em>, <em>/&#42;</em> at the end is implied.
Junio C Hamano50819852008-11-19 02:07:561232</p>
1233</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591234<dt class="hdlist1">
Junio C Hamanof079f702013-12-06 23:43:181235--exclude=&lt;glob-pattern&gt;
1236</dt>
1237<dd>
1238<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511239 Do not include refs matching <em>&lt;glob-pattern&gt;</em> that the next <code>--all</code>,
1240 <code>--branches</code>, <code>--tags</code>, <code>--remotes</code>, or <code>--glob</code> would otherwise
Junio C Hamanof079f702013-12-06 23:43:181241 consider. Repetitions of this option accumulate exclusion patterns
Junio C Hamanoac12f0e2014-09-19 22:32:511242 up to the next <code>--all</code>, <code>--branches</code>, <code>--tags</code>, <code>--remotes</code>, or
1243 <code>--glob</code> option (other options or arguments do not clear
Junio C Hamanofb5ffde2014-11-04 22:38:561244 accumulated patterns).
Junio C Hamanof079f702013-12-06 23:43:181245</p>
Junio C Hamanoac12f0e2014-09-19 22:32:511246<div class="paragraph"><p>The patterns given should not begin with <code>refs/heads</code>, <code>refs/tags</code>, or
1247<code>refs/remotes</code> when applied to <code>--branches</code>, <code>--tags</code>, or <code>--remotes</code>,
1248respectively, and they must begin with <code>refs/</code> when applied to <code>--glob</code>
1249or <code>--all</code>. If a trailing <em>/&#42;</em> is intended, it must be given
Junio C Hamanof079f702013-12-06 23:43:181250explicitly.</p></div>
1251</dd>
1252<dt class="hdlist1">
Junio C Hamano2a4bcbc2014-10-29 20:07:391253--reflog
1254</dt>
1255<dd>
1256<p>
1257 Pretend as if all objects mentioned by reflogs are listed on the
1258 command line as <code>&lt;commit&gt;</code>.
1259</p>
1260</dd>
1261<dt class="hdlist1">
Junio C Hamano8d57fa92017-09-19 05:01:081262--single-worktree
1263</dt>
1264<dd>
1265<p>
1266 By default, all working trees will be examined by the
1267 following options when there are more than one (see
1268 <a href="git-worktree.html">git-worktree(1)</a>): <code>--all</code>, <code>--reflog</code> and
1269 <code>--indexed-objects</code>.
1270 This option forces them to examine the current working tree
1271 only.
1272</p>
1273</dd>
1274<dt class="hdlist1">
Junio C Hamano084228c2011-05-30 08:13:521275--ignore-missing
1276</dt>
1277<dd>
1278<p>
1279 Upon seeing an invalid object name in the input, pretend as if
1280 the bad input was not given.
1281</p>
1282</dd>
1283<dt class="hdlist1">
Junio C Hamano5706e0b2009-11-24 10:54:161284--bisect
1285</dt>
1286<dd>
1287<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511288 Pretend as if the bad bisection ref <code>refs/bisect/bad</code>
1289 was listed and as if it was followed by <code>--not</code> and the good
1290 bisection refs <code>refs/bisect/good-*</code> on the command
Junio C Hamanoef57d1e2015-03-25 21:23:001291 line. Cannot be combined with --first-parent.
Junio C Hamano5706e0b2009-11-24 10:54:161292</p>
1293</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591294<dt class="hdlist1">
Junio C Hamano5706e0b2009-11-24 10:54:161295--stdin
1296</dt>
1297<dd>
1298<p>
1299 In addition to the <em>&lt;commit&gt;</em> listed on the command
Junio C Hamano92d80372016-07-13 22:00:051300 line, read them from the standard input. If a <code>--</code> separator is
Junio C Hamano5706e0b2009-11-24 10:54:161301 seen, stop reading commits and start reading paths to limit the
1302 result.
1303</p>
1304</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591305<dt class="hdlist1">
Junio C Hamano9a2fb2d2011-03-23 05:40:151306--cherry-mark
1307</dt>
1308<dd>
1309<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511310 Like <code>--cherry-pick</code> (see below) but mark equivalent commits
1311 with <code>=</code> rather than omitting them, and inequivalent ones with <code>+</code>.
Junio C Hamano9a2fb2d2011-03-23 05:40:151312</p>
1313</dd>
1314<dt class="hdlist1">
Junio C Hamanob0e02952008-01-19 08:02:001315--cherry-pick
1316</dt>
1317<dd>
1318<p>
1319 Omit any commit that introduces the same change as
Junio C Hamanob73af6c2013-12-03 22:07:111320 another commit on the &#8220;other side&#8221; when the set of
Junio C Hamano68cf15a2010-11-06 01:01:591321 commits are limited with symmetric difference.
1322</p>
Junio C Hamanoac12f0e2014-09-19 22:32:511323<div class="paragraph"><p>For example, if you have two branches, <code>A</code> and <code>B</code>, a usual way
Junio C Hamanob0e02952008-01-19 08:02:001324to list all commits on only one side of them is with
Junio C Hamanoac12f0e2014-09-19 22:32:511325<code>--left-right</code> (see the example below in the description of
1326the <code>--left-right</code> option). However, it shows the commits that were
Junio C Hamanob73af6c2013-12-03 22:07:111327cherry-picked from the other branch (for example, &#8220;3rd on b&#8221; may be
1328cherry-picked from branch A). With this option, such pairs of commits are
Junio C Hamano68cf15a2010-11-06 01:01:591329excluded from the output.</p></div>
Junio C Hamanob0e02952008-01-19 08:02:001330</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591331<dt class="hdlist1">
Junio C Hamano9a2fb2d2011-03-23 05:40:151332--left-only
1333</dt>
1334<dt class="hdlist1">
1335--right-only
1336</dt>
1337<dd>
1338<p>
Junio C Hamanocd451662016-09-13 00:54:091339 List only commits on the respective side of a symmetric difference,
Junio C Hamanoac12f0e2014-09-19 22:32:511340 i.e. only those which would be marked <code>&lt;</code> resp. <code>&gt;</code> by
1341 <code>--left-right</code>.
Junio C Hamano9a2fb2d2011-03-23 05:40:151342</p>
Junio C Hamanoac12f0e2014-09-19 22:32:511343<div class="paragraph"><p>For example, <code>--cherry-pick --right-only A...B</code> omits those
1344commits from <code>B</code> which are in <code>A</code> or are patch-equivalent to a commit in
1345<code>A</code>. In other words, this lists the <code>+</code> commits from <code>git cherry A B</code>.
1346More precisely, <code>--cherry-pick --right-only --no-merges</code> gives the exact
Junio C Hamano9a2fb2d2011-03-23 05:40:151347list.</p></div>
1348</dd>
1349<dt class="hdlist1">
1350--cherry
1351</dt>
1352<dd>
1353<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511354 A synonym for <code>--right-only --cherry-mark --no-merges</code>; useful to
Junio C Hamano9a2fb2d2011-03-23 05:40:151355 limit the output to the commits on our side and mark those that
1356 have been applied to the other side of a forked history with
Junio C Hamanoac12f0e2014-09-19 22:32:511357 <code>git log --cherry upstream...mybranch</code>, similar to
1358 <code>git cherry upstream mybranch</code>.
Junio C Hamano9a2fb2d2011-03-23 05:40:151359</p>
1360</dd>
1361<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471362-g
1363</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591364<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471365--walk-reflogs
Junio C Hamanob0e02952008-01-19 08:02:001366</dt>
1367<dd>
1368<p>
1369 Instead of walking the commit ancestry chain, walk
1370 reflog entries from the most recent one to older ones.
1371 When this option is used you cannot specify commits to
1372 exclude (that is, <em>&#94;commit</em>, <em>commit1..commit2</em>,
Junio C Hamanod75148a2014-04-08 19:48:381373 and <em>commit1...commit2</em> notations cannot be used).
Junio C Hamano68cf15a2010-11-06 01:01:591374</p>
Junio C Hamanoac12f0e2014-09-19 22:32:511375<div class="paragraph"><p>With <code>--pretty</code> format other than <code>oneline</code> (for obvious reasons),
Junio C Hamanob0e02952008-01-19 08:02:001376this causes the output to have two extra lines of information
Junio C Hamanoe548d1b2016-08-08 22:26:491377taken from the reflog. The reflog designator in the output may be shown
1378as <code>ref@{Nth}</code> (where <code>Nth</code> is the reverse-chronological index in the
1379reflog) or as <code>ref@{timestamp}</code> (with the timestamp for that entry),
1380depending on a few rules:</p></div>
1381<div class="openblock">
1382<div class="content">
1383<div class="olist arabic"><ol class="arabic">
1384<li>
1385<p>
1386If the starting point is specified as <code>ref@{Nth}</code>, show the index
1387format.
1388</p>
1389</li>
1390<li>
1391<p>
1392If the starting point was specified as <code>ref@{now}</code>, show the
1393timestamp format.
1394</p>
1395</li>
1396<li>
1397<p>
1398If neither was used, but <code>--date</code> was given on the command line, show
1399the timestamp in the format requested by <code>--date</code>.
1400</p>
1401</li>
1402<li>
1403<p>
1404Otherwise, show the index format.
1405</p>
1406</li>
1407</ol></div>
1408</div></div>
1409<div class="paragraph"><p>Under <code>--pretty=oneline</code>, the commit message is
Junio C Hamanob0e02952008-01-19 08:02:001410prefixed with this information on the same line.
Junio C Hamanoac12f0e2014-09-19 22:32:511411This option cannot be combined with <code>--reverse</code>.
Junio C Hamanoa28a9202012-06-21 07:08:231412See also <a href="git-reflog.html">git-reflog(1)</a>.</p></div>
Junio C Hamanob0e02952008-01-19 08:02:001413</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591414<dt class="hdlist1">
Junio C Hamanob0e02952008-01-19 08:02:001415--merge
1416</dt>
1417<dd>
1418<p>
1419 After a failed merge, show refs that touch files having a
Junio C Hamano68cf15a2010-11-06 01:01:591420 conflict and don&#8217;t exist on all heads to merge.
Junio C Hamanob0e02952008-01-19 08:02:001421</p>
1422</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591423<dt class="hdlist1">
Junio C Hamanob0e02952008-01-19 08:02:001424--boundary
1425</dt>
1426<dd>
1427<p>
Junio C Hamano27159f82013-06-14 17:19:221428 Output excluded boundary commits. Boundary commits are
Junio C Hamanoac12f0e2014-09-19 22:32:511429 prefixed with <code>-</code>.
Junio C Hamanob0e02952008-01-19 08:02:001430</p>
1431</dd>
Junio C Hamanoa76cb0d2008-08-13 20:04:101432</dl></div>
Junio C Hamano9629d4f2012-12-19 00:28:271433</div></div>
1434</div>
1435<div class="sect2">
1436<h3 id="_history_simplification">History Simplification</h3>
Junio C Hamano68cf15a2010-11-06 01:01:591437<div class="paragraph"><p>Sometimes you are only interested in parts of the history, for example the
Junio C Hamano28363492008-11-14 08:26:311438commits modifying a particular &lt;path&gt;. But there are two parts of
1439<em>History Simplification</em>, one part is selecting the commits and the other
1440is how to do it, as there are various strategies to simplify the history.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591441<div class="paragraph"><p>The following options select the commits to be shown:</p></div>
1442<div class="dlist"><dl>
1443<dt class="hdlist1">
Junio C Hamano28363492008-11-14 08:26:311444&lt;paths&gt;
1445</dt>
1446<dd>
1447<p>
1448 Commits modifying the given &lt;paths&gt; are selected.
1449</p>
1450</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591451<dt class="hdlist1">
Junio C Hamano28363492008-11-14 08:26:311452--simplify-by-decoration
1453</dt>
1454<dd>
1455<p>
1456 Commits that are referred by some branch or tag are selected.
1457</p>
1458</dd>
1459</dl></div>
Junio C Hamano68cf15a2010-11-06 01:01:591460<div class="paragraph"><p>Note that extra commits can be shown to give a meaningful history.</p></div>
1461<div class="paragraph"><p>The following options affect the way the simplification is performed:</p></div>
1462<div class="dlist"><dl>
1463<dt class="hdlist1">
Junio C Hamano28363492008-11-14 08:26:311464Default mode
1465</dt>
1466<dd>
1467<p>
1468 Simplifies the history to the simplest history explaining the
1469 final state of the tree. Simplest because it prunes some side
1470 branches if the end result is the same (i.e. merging branches
1471 with the same content)
1472</p>
1473</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591474<dt class="hdlist1">
Junio C Hamano28363492008-11-14 08:26:311475--full-history
1476</dt>
1477<dd>
1478<p>
Junio C Hamano15567bc2011-07-23 00:51:591479 Same as the default mode, but does not prune some history.
Junio C Hamano28363492008-11-14 08:26:311480</p>
1481</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591482<dt class="hdlist1">
Junio C Hamano28363492008-11-14 08:26:311483--dense
1484</dt>
1485<dd>
1486<p>
1487 Only the selected commits are shown, plus some to have a
1488 meaningful history.
1489</p>
1490</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591491<dt class="hdlist1">
Junio C Hamano28363492008-11-14 08:26:311492--sparse
1493</dt>
1494<dd>
1495<p>
1496 All commits in the simplified history are shown.
1497</p>
1498</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591499<dt class="hdlist1">
Junio C Hamano28363492008-11-14 08:26:311500--simplify-merges
1501</dt>
1502<dd>
1503<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511504 Additional option to <code>--full-history</code> to remove some needless
Junio C Hamano28363492008-11-14 08:26:311505 merges from the resulting history, as there are no selected
1506 commits contributing to this merge.
1507</p>
1508</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591509<dt class="hdlist1">
Junio C Hamano89a57342010-06-22 23:22:551510--ancestry-path
1511</dt>
1512<dd>
1513<p>
1514 When given a range of commits to display (e.g. <em>commit1..commit2</em>
1515 or <em>commit2 &#94;commit1</em>), only display commits that exist
1516 directly on the ancestry chain between the <em>commit1</em> and
1517 <em>commit2</em>, i.e. commits that are both descendants of <em>commit1</em>,
1518 and ancestors of <em>commit2</em>.
1519</p>
1520</dd>
Junio C Hamano28363492008-11-14 08:26:311521</dl></div>
Junio C Hamano68cf15a2010-11-06 01:01:591522<div class="paragraph"><p>A more detailed explanation follows.</p></div>
Junio C Hamanoac12f0e2014-09-19 22:32:511523<div class="paragraph"><p>Suppose you specified <code>foo</code> as the &lt;paths&gt;. We shall call commits
1524that modify <code>foo</code> !TREESAME, and the rest TREESAME. (In a diff
1525filtered for <code>foo</code>, they look different and equal, respectively.)</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591526<div class="paragraph"><p>In the following, we will always refer to the same example history to
Junio C Hamanoa76cb0d2008-08-13 20:04:101527illustrate the differences between simplification settings. We assume
Junio C Hamanoac12f0e2014-09-19 22:32:511528that you are filtering for a file <code>foo</code> in this commit graph:</p></div>
Junio C Hamanoa76cb0d2008-08-13 20:04:101529<div class="listingblock">
1530<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:511531<pre><code> .-A---M---N---O---P---Q
Junio C Hamano27159f82013-06-14 17:19:221532 / / / / / /
1533 I B C D E Y
1534 \ / / / / /
Junio C Hamanoac12f0e2014-09-19 22:32:511535 `-------------' X</code></pre>
Junio C Hamanoa76cb0d2008-08-13 20:04:101536</div></div>
Junio C Hamano27159f82013-06-14 17:19:221537<div class="paragraph"><p>The horizontal line of history A---Q is taken to be the first parent of
Junio C Hamanoa76cb0d2008-08-13 20:04:101538each merge. The commits are:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591539<div class="ulist"><ul>
Junio C Hamanoa76cb0d2008-08-13 20:04:101540<li>
1541<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511542<code>I</code> is the initial commit, in which <code>foo</code> exists with contents
1543 &#8220;asdf&#8221;, and a file <code>quux</code> exists with contents &#8220;quux&#8221;. Initial
1544 commits are compared to an empty tree, so <code>I</code> is !TREESAME.
Junio C Hamanoa76cb0d2008-08-13 20:04:101545</p>
1546</li>
1547<li>
1548<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511549In <code>A</code>, <code>foo</code> contains just &#8220;foo&#8221;.
Junio C Hamanoa76cb0d2008-08-13 20:04:101550</p>
1551</li>
1552<li>
1553<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511554<code>B</code> contains the same change as <code>A</code>. Its merge <code>M</code> is trivial and
Junio C Hamanoa76cb0d2008-08-13 20:04:101555 hence TREESAME to all parents.
1556</p>
1557</li>
1558<li>
1559<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511560<code>C</code> does not change <code>foo</code>, but its merge <code>N</code> changes it to &#8220;foobar&#8221;,
Junio C Hamanoa76cb0d2008-08-13 20:04:101561 so it is not TREESAME to any parent.
1562</p>
1563</li>
1564<li>
1565<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511566<code>D</code> sets <code>foo</code> to &#8220;baz&#8221;. Its merge <code>O</code> combines the strings from
1567 <code>N</code> and <code>D</code> to &#8220;foobarbaz&#8221;; i.e., it is not TREESAME to any parent.
Junio C Hamanoa76cb0d2008-08-13 20:04:101568</p>
1569</li>
1570<li>
1571<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511572<code>E</code> changes <code>quux</code> to &#8220;xyzzy&#8221;, and its merge <code>P</code> combines the
1573 strings to &#8220;quux xyzzy&#8221;. <code>P</code> is TREESAME to <code>O</code>, but not to <code>E</code>.
Junio C Hamano27159f82013-06-14 17:19:221574</p>
1575</li>
1576<li>
1577<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511578<code>X</code> is an independent root commit that added a new file <code>side</code>, and <code>Y</code>
1579 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
1580 <code>Q</code> is TREESAME to <code>P</code>, but not to <code>Y</code>.
Junio C Hamanoa76cb0d2008-08-13 20:04:101581</p>
1582</li>
1583</ul></div>
Junio C Hamanoac12f0e2014-09-19 22:32:511584<div class="paragraph"><p><code>rev-list</code> walks backwards through history, including or excluding
1585commits based on whether <code>--full-history</code> and/or parent rewriting
1586(via <code>--parents</code> or <code>--children</code>) are used. The following settings
Junio C Hamanoa76cb0d2008-08-13 20:04:101587are available.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591588<div class="dlist"><dl>
1589<dt class="hdlist1">
Junio C Hamanoa76cb0d2008-08-13 20:04:101590Default mode
1591</dt>
1592<dd>
1593<p>
1594 Commits are included if they are not TREESAME to any parent
Junio C Hamanoac12f0e2014-09-19 22:32:511595 (though this can be changed, see <code>--sparse</code> below). If the
Junio C Hamanoa76cb0d2008-08-13 20:04:101596 commit was a merge, and it was TREESAME to one parent, follow
1597 only that parent. (Even if there are several TREESAME
1598 parents, follow only one of them.) Otherwise, follow all
1599 parents.
1600</p>
Junio C Hamano68cf15a2010-11-06 01:01:591601<div class="paragraph"><p>This results in:</p></div>
Junio C Hamanoa76cb0d2008-08-13 20:04:101602<div class="listingblock">
1603<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:511604<pre><code> .-A---N---O
Junio C Hamano89a57342010-06-22 23:22:551605 / / /
Junio C Hamanoac12f0e2014-09-19 22:32:511606 I---------D</code></pre>
Junio C Hamanoa76cb0d2008-08-13 20:04:101607</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591608<div class="paragraph"><p>Note how the rule to only follow the TREESAME parent, if one is
Junio C Hamanoac12f0e2014-09-19 22:32:511609available, removed <code>B</code> from consideration entirely. <code>C</code> was
1610considered via <code>N</code>, but is TREESAME. Root commits are compared to an
1611empty tree, so <code>I</code> is !TREESAME.</p></div>
1612<div class="paragraph"><p>Parent/child relations are only visible with <code>--parents</code>, but that does
Junio C Hamanoa76cb0d2008-08-13 20:04:101613not affect the commits selected in default mode, so we have shown the
1614parent lines.</p></div>
1615</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591616<dt class="hdlist1">
Junio C Hamanoa76cb0d2008-08-13 20:04:101617--full-history without parent rewriting
1618</dt>
1619<dd>
1620<p>
1621 This mode differs from the default in one point: always follow
1622 all parents of a merge, even if it is TREESAME to one of them.
1623 Even if more than one side of the merge has commits that are
1624 included, this does not imply that the merge itself is! In
1625 the example, we get
1626</p>
1627<div class="listingblock">
1628<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:511629<pre><code> I A B N D O P Q</code></pre>
Junio C Hamanoa76cb0d2008-08-13 20:04:101630</div></div>
Junio C Hamanoac12f0e2014-09-19 22:32:511631<div class="paragraph"><p><code>M</code> was excluded because it is TREESAME to both parents. <code>E</code>,
1632<code>C</code> and <code>B</code> were all walked, but only <code>B</code> was !TREESAME, so the others
Junio C Hamanoa76cb0d2008-08-13 20:04:101633do not appear.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591634<div class="paragraph"><p>Note that without parent rewriting, it is not really possible to talk
Junio C Hamanoa76cb0d2008-08-13 20:04:101635about the parent/child relationships between the commits, so we show
1636them disconnected.</p></div>
1637</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591638<dt class="hdlist1">
Junio C Hamanoa76cb0d2008-08-13 20:04:101639--full-history with parent rewriting
1640</dt>
1641<dd>
1642<p>
1643 Ordinary commits are only included if they are !TREESAME
Junio C Hamanoac12f0e2014-09-19 22:32:511644 (though this can be changed, see <code>--sparse</code> below).
Junio C Hamanoa76cb0d2008-08-13 20:04:101645</p>
Junio C Hamano68cf15a2010-11-06 01:01:591646<div class="paragraph"><p>Merges are always included. However, their parent list is rewritten:
Junio C Hamanoa76cb0d2008-08-13 20:04:101647Along each parent, prune away commits that are not included
1648themselves. This results in</p></div>
1649<div class="listingblock">
1650<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:511651<pre><code> .-A---M---N---O---P---Q
Junio C Hamanoa76cb0d2008-08-13 20:04:101652 / / / / /
1653 I B / D /
1654 \ / / / /
Junio C Hamanoac12f0e2014-09-19 22:32:511655 `-------------'</code></pre>
Junio C Hamanoa76cb0d2008-08-13 20:04:101656</div></div>
Junio C Hamanoac12f0e2014-09-19 22:32:511657<div class="paragraph"><p>Compare to <code>--full-history</code> without rewriting above. Note that <code>E</code>
Junio C Hamanoa76cb0d2008-08-13 20:04:101658was pruned away because it is TREESAME, but the parent list of P was
Junio C Hamanoac12f0e2014-09-19 22:32:511659rewritten to contain <code>E</code>'s parent <code>I</code>. The same happened for <code>C</code> and
1660<code>N</code>, and <code>X</code>, <code>Y</code> and <code>Q</code>.</p></div>
Junio C Hamanoa76cb0d2008-08-13 20:04:101661</dd>
1662</dl></div>
Junio C Hamano68cf15a2010-11-06 01:01:591663<div class="paragraph"><p>In addition to the above settings, you can change whether TREESAME
Junio C Hamanoa76cb0d2008-08-13 20:04:101664affects inclusion:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591665<div class="dlist"><dl>
1666<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471667--dense
1668</dt>
Junio C Hamanoa76cb0d2008-08-13 20:04:101669<dd>
1670<p>
1671 Commits that are walked are included if they are not TREESAME
1672 to any parent.
1673</p>
1674</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591675<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471676--sparse
Junio C Hamanob0e02952008-01-19 08:02:001677</dt>
1678<dd>
1679<p>
Junio C Hamanoa76cb0d2008-08-13 20:04:101680 All commits that are walked are included.
Junio C Hamanob0e02952008-01-19 08:02:001681</p>
Junio C Hamanoac12f0e2014-09-19 22:32:511682<div class="paragraph"><p>Note that without <code>--full-history</code>, this still simplifies merges: if
Junio C Hamanoa76cb0d2008-08-13 20:04:101683one of the parents is TREESAME, we follow only that one, so the other
1684sides of the merge are never walked.</p></div>
Junio C Hamanob0e02952008-01-19 08:02:001685</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591686<dt class="hdlist1">
Junio C Hamanoa2f46622008-09-03 05:20:311687--simplify-merges
1688</dt>
1689<dd>
1690<p>
1691 First, build a history graph in the same way that
Junio C Hamanoac12f0e2014-09-19 22:32:511692 <code>--full-history</code> with parent rewriting does (see above).
Junio C Hamanoa2f46622008-09-03 05:20:311693</p>
Junio C Hamanoac12f0e2014-09-19 22:32:511694<div class="paragraph"><p>Then simplify each commit <code>C</code> to its replacement <code>C'</code> in the final
Junio C Hamanoa2f46622008-09-03 05:20:311695history according to the following rules:</p></div>
Junio C Hamano9629d4f2012-12-19 00:28:271696<div class="openblock">
1697<div class="content">
Junio C Hamano68cf15a2010-11-06 01:01:591698<div class="ulist"><ul>
Junio C Hamanoa2f46622008-09-03 05:20:311699<li>
1700<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511701Set <code>C'</code> to <code>C</code>.
Junio C Hamanoa2f46622008-09-03 05:20:311702</p>
1703</li>
1704<li>
1705<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511706Replace each parent <code>P</code> of <code>C'</code> with its simplification <code>P'</code>. In
Junio C Hamano27159f82013-06-14 17:19:221707 the process, drop parents that are ancestors of other parents or that are
1708 root commits TREESAME to an empty tree, and remove duplicates, but take care
1709 to never drop all parents that we are TREESAME to.
Junio C Hamanoa2f46622008-09-03 05:20:311710</p>
1711</li>
1712<li>
1713<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511714If after this parent rewriting, <code>C'</code> is a root or merge commit (has
Junio C Hamanoa2f46622008-09-03 05:20:311715 zero or &gt;1 parents), a boundary commit, or !TREESAME, it remains.
1716 Otherwise, it is replaced with its only parent.
1717</p>
1718</li>
1719</ul></div>
Junio C Hamano9629d4f2012-12-19 00:28:271720</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591721<div class="paragraph"><p>The effect of this is best shown by way of comparing to
Junio C Hamanoac12f0e2014-09-19 22:32:511722<code>--full-history</code> with parent rewriting. The example turns into:</p></div>
Junio C Hamanoa2f46622008-09-03 05:20:311723<div class="listingblock">
1724<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:511725<pre><code> .-A---M---N---O
Junio C Hamanoa2f46622008-09-03 05:20:311726 / / /
1727 I B D
1728 \ / /
Junio C Hamanoac12f0e2014-09-19 22:32:511729 `---------'</code></pre>
Junio C Hamanoa2f46622008-09-03 05:20:311730</div></div>
Junio C Hamanoac12f0e2014-09-19 22:32:511731<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>
Junio C Hamano9629d4f2012-12-19 00:28:271732<div class="openblock">
1733<div class="content">
Junio C Hamano68cf15a2010-11-06 01:01:591734<div class="ulist"><ul>
Junio C Hamanoa2f46622008-09-03 05:20:311735<li>
1736<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511737<code>N</code>'s parent list had <code>I</code> removed, because it is an ancestor of the
1738 other parent <code>M</code>. Still, <code>N</code> remained because it is !TREESAME.
Junio C Hamanoa2f46622008-09-03 05:20:311739</p>
1740</li>
1741<li>
1742<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511743<code>P</code>'s parent list similarly had <code>I</code> removed. <code>P</code> was then
Junio C Hamanoa2f46622008-09-03 05:20:311744 removed completely, because it had one parent and is TREESAME.
1745</p>
1746</li>
Junio C Hamano27159f82013-06-14 17:19:221747<li>
1748<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511749<code>Q</code>'s parent list had <code>Y</code> simplified to <code>X</code>. <code>X</code> was then removed, because it
1750 was a TREESAME root. <code>Q</code> was then removed completely, because it had one
Junio C Hamano27159f82013-06-14 17:19:221751 parent and is TREESAME.
1752</p>
1753</li>
Junio C Hamanoa2f46622008-09-03 05:20:311754</ul></div>
Junio C Hamano9629d4f2012-12-19 00:28:271755</div></div>
Junio C Hamanoa2f46622008-09-03 05:20:311756</dd>
1757</dl></div>
Junio C Hamano68cf15a2010-11-06 01:01:591758<div class="paragraph"><p>Finally, there is a fifth simplification mode available:</p></div>
1759<div class="dlist"><dl>
1760<dt class="hdlist1">
Junio C Hamano89a57342010-06-22 23:22:551761--ancestry-path
1762</dt>
1763<dd>
1764<p>
1765 Limit the displayed commits to those directly on the ancestry
Junio C Hamanob73af6c2013-12-03 22:07:111766 chain between the &#8220;from&#8221; and &#8220;to&#8221; commits in the given commit
1767 range. I.e. only display commits that are ancestor of the &#8220;to&#8221;
1768 commit and descendants of the &#8220;from&#8221; commit.
Junio C Hamano89a57342010-06-22 23:22:551769</p>
Junio C Hamano68cf15a2010-11-06 01:01:591770<div class="paragraph"><p>As an example use case, consider the following commit history:</p></div>
Junio C Hamano89a57342010-06-22 23:22:551771<div class="listingblock">
1772<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:511773<pre><code> D---E-------F
Junio C Hamano89a57342010-06-22 23:22:551774 / \ \
1775 B---C---G---H---I---J
1776 / \
Junio C Hamanoac12f0e2014-09-19 22:32:511777 A-------K---------------L--M</code></pre>
Junio C Hamano89a57342010-06-22 23:22:551778</div></div>
Junio C Hamanoac12f0e2014-09-19 22:32:511779<div class="paragraph"><p>A regular <em>D..M</em> computes the set of commits that are ancestors of <code>M</code>,
1780but excludes the ones that are ancestors of <code>D</code>. This is useful to see
1781what happened to the history leading to <code>M</code> since <code>D</code>, in the sense
1782that &#8220;what does <code>M</code> have that did not exist in <code>D</code>&#8221;. The result in this
1783example would be all the commits, except <code>A</code> and <code>B</code> (and <code>D</code> itself,
Junio C Hamano89a57342010-06-22 23:22:551784of course).</p></div>
Junio C Hamanoac12f0e2014-09-19 22:32:511785<div class="paragraph"><p>When we want to find out what commits in <code>M</code> are contaminated with the
1786bug introduced by <code>D</code> and need fixing, however, we might want to view
1787only the subset of <em>D..M</em> that are actually descendants of <code>D</code>, i.e.
1788excluding <code>C</code> and <code>K</code>. This is exactly what the <code>--ancestry-path</code>
Junio C Hamano89a57342010-06-22 23:22:551789option does. Applied to the <em>D..M</em> range, it results in:</p></div>
1790<div class="listingblock">
1791<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:511792<pre><code> E-------F
Junio C Hamano89a57342010-06-22 23:22:551793 \ \
1794 G---H---I---J
1795 \
Junio C Hamanoac12f0e2014-09-19 22:32:511796 L--M</code></pre>
Junio C Hamano89a57342010-06-22 23:22:551797</div></div>
1798</dd>
1799</dl></div>
Junio C Hamanoac12f0e2014-09-19 22:32:511800<div class="paragraph"><p>The <code>--simplify-by-decoration</code> option allows you to view only the
Junio C Hamano28363492008-11-14 08:26:311801big picture of the topology of the history, by omitting commits
1802that are not referenced by tags. Commits are marked as !TREESAME
1803(in other words, kept after history simplification rules described
1804above) if (1) they are referenced by tags, or (2) they change the
1805contents of the paths given on the command line. All other
1806commits are marked as TREESAME (subject to be simplified away).</p></div>
Junio C Hamano9629d4f2012-12-19 00:28:271807</div>
1808<div class="sect2">
1809<h3 id="_commit_ordering">Commit Ordering</h3>
Junio C Hamano68cf15a2010-11-06 01:01:591810<div class="paragraph"><p>By default, the commits are shown in reverse chronological order.</p></div>
1811<div class="dlist"><dl>
1812<dt class="hdlist1">
Junio C Hamanob0e02952008-01-19 08:02:001813--date-order
1814</dt>
1815<dd>
1816<p>
Junio C Hamanod0316112012-08-22 19:55:291817 Show no parents before all of its children are shown, but
1818 otherwise show commits in the commit timestamp order.
Junio C Hamanob0e02952008-01-19 08:02:001819</p>
1820</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591821<dt class="hdlist1">
Junio C Hamanoa1952302013-07-01 21:31:181822--author-date-order
1823</dt>
1824<dd>
1825<p>
1826 Show no parents before all of its children are shown, but
1827 otherwise show commits in the author timestamp order.
1828</p>
1829</dd>
1830<dt class="hdlist1">
Junio C Hamanod0316112012-08-22 19:55:291831--topo-order
1832</dt>
1833<dd>
1834<p>
1835 Show no parents before all of its children are shown, and
1836 avoid showing commits on multiple lines of history
1837 intermixed.
1838</p>
1839<div class="paragraph"><p>For example, in a commit history like this:</p></div>
1840<div class="listingblock">
1841<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:511842<pre><code> ---1----2----4----7
Junio C Hamanod0316112012-08-22 19:55:291843 \ \
Junio C Hamanoac12f0e2014-09-19 22:32:511844 3----5----6----8---</code></pre>
Junio C Hamanod0316112012-08-22 19:55:291845</div></div>
Junio C Hamanoac12f0e2014-09-19 22:32:511846<div class="paragraph"><p>where the numbers denote the order of commit timestamps, <code>git
1847rev-list</code> and friends with <code>--date-order</code> show the commits in the
Junio C Hamanod0316112012-08-22 19:55:291848timestamp order: 8 7 6 5 4 3 2 1.</p></div>
Junio C Hamanoac12f0e2014-09-19 22:32:511849<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
Junio C Hamanod0316112012-08-22 19:55:2918503 1); some older commits are shown before newer ones in order to
1851avoid showing the commits from two parallel development track mixed
1852together.</p></div>
1853</dd>
1854<dt class="hdlist1">
Junio C Hamanob0e02952008-01-19 08:02:001855--reverse
1856</dt>
1857<dd>
1858<p>
Junio C Hamanof3ca7b82016-10-03 22:27:021859 Output the commits chosen to be shown (see Commit Limiting
1860 section above) in reverse order. Cannot be combined with
1861 <code>--walk-reflogs</code>.
Junio C Hamanob0e02952008-01-19 08:02:001862</p>
1863</dd>
Junio C Hamanoba4b9282008-07-06 05:20:311864</dl></div>
Junio C Hamano9629d4f2012-12-19 00:28:271865</div>
1866<div class="sect2">
1867<h3 id="_object_traversal">Object Traversal</h3>
Junio C Hamano076ffcc2013-02-06 05:13:211868<div class="paragraph"><p>These options are mostly targeted for packing of Git repositories.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591869<div class="dlist"><dl>
1870<dt class="hdlist1">
Junio C Hamano640779d2018-02-14 01:29:141871--exclude-promisor-objects
1872</dt>
1873<dd>
1874<p>
1875 (For internal use only.) Prefilter object traversal at
1876 promisor boundary. This is used with partial clone. This is
1877 stronger than <code>--missing=allow-promisor</code> because it limits the
1878 traversal, rather than just silencing errors about missing
1879 objects.
1880</p>
1881</dd>
1882<dt class="hdlist1">
Junio C Hamanoeccdd4a2012-09-10 23:28:171883--no-walk[=(sorted|unsorted)]
Junio C Hamanob0e02952008-01-19 08:02:001884</dt>
1885<dd>
1886<p>
Junio C Hamanoeccdd4a2012-09-10 23:28:171887 Only show the given commits, but do not traverse their ancestors.
1888 This has no effect if a range is specified. If the argument
Junio C Hamanoac12f0e2014-09-19 22:32:511889 <code>unsorted</code> is given, the commits are shown in the order they were
1890 given on the command line. Otherwise (if <code>sorted</code> or no argument
Junio C Hamanob73af6c2013-12-03 22:07:111891 was given), the commits are shown in reverse chronological order
Junio C Hamanoeccdd4a2012-09-10 23:28:171892 by commit time.
Junio C Hamanoef57d1e2015-03-25 21:23:001893 Cannot be combined with <code>--graph</code>.
Junio C Hamanob0e02952008-01-19 08:02:001894</p>
1895</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591896<dt class="hdlist1">
Junio C Hamanob0e02952008-01-19 08:02:001897--do-walk
1898</dt>
1899<dd>
1900<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511901 Overrides a previous <code>--no-walk</code>.
Junio C Hamanob0e02952008-01-19 08:02:001902</p>
1903</dd>
Junio C Hamanoba4b9282008-07-06 05:20:311904</dl></div>
Junio C Hamano9629d4f2012-12-19 00:28:271905</div>
1906<div class="sect2">
1907<h3 id="_commit_formatting">Commit Formatting</h3>
Junio C Hamanod2c978f2011-03-20 19:42:221908<div class="dlist"><dl>
1909<dt class="hdlist1">
1910--pretty[=&lt;format&gt;]
1911</dt>
1912<dt class="hdlist1">
1913--format=&lt;format&gt;
1914</dt>
1915<dd>
1916<p>
1917 Pretty-print the contents of the commit logs in a given format,
1918 where <em>&lt;format&gt;</em> can be one of <em>oneline</em>, <em>short</em>, <em>medium</em>,
Junio C Hamano6bb32e62015-02-17 22:11:261919 <em>full</em>, <em>fuller</em>, <em>email</em>, <em>raw</em>, <em>format:&lt;string&gt;</em>
1920 and <em>tformat:&lt;string&gt;</em>. When <em>&lt;format&gt;</em> is none of the above,
1921 and has <em>%placeholder</em> in it, it acts as if
1922 <em>--pretty=tformat:&lt;format&gt;</em> were given.
Junio C Hamanod2c978f2011-03-20 19:42:221923</p>
Junio C Hamano6bb32e62015-02-17 22:11:261924<div class="paragraph"><p>See the "PRETTY FORMATS" section for some additional details for each
1925format. When <em>=&lt;format&gt;</em> part is omitted, it defaults to <em>medium</em>.</p></div>
Junio C Hamanod2c978f2011-03-20 19:42:221926<div class="paragraph"><p>Note: you can specify the default pretty format in the repository
Junio C Hamanoa28a9202012-06-21 07:08:231927configuration (see <a href="git-config.html">git-config(1)</a>).</p></div>
Junio C Hamanod2c978f2011-03-20 19:42:221928</dd>
1929<dt class="hdlist1">
1930--abbrev-commit
1931</dt>
1932<dd>
1933<p>
1934 Instead of showing the full 40-byte hexadecimal commit object
1935 name, show only a partial prefix. Non default number of
1936 digits can be specified with "--abbrev=&lt;n&gt;" (which also modifies
1937 diff output, if it is displayed).
1938</p>
1939<div class="paragraph"><p>This should make "--pretty=oneline" a whole lot more readable for
1940people using 80-column terminals.</p></div>
1941</dd>
1942<dt class="hdlist1">
Junio C Hamanof93530e2011-05-25 23:59:591943--no-abbrev-commit
1944</dt>
1945<dd>
1946<p>
1947 Show the full 40-byte hexadecimal commit object name. This negates
Junio C Hamanoac12f0e2014-09-19 22:32:511948 <code>--abbrev-commit</code> and those options which imply it such as
Junio C Hamano042f2142016-06-27 18:05:051949 "--oneline". It also overrides the <code>log.abbrevCommit</code> variable.
Junio C Hamanof93530e2011-05-25 23:59:591950</p>
1951</dd>
1952<dt class="hdlist1">
Junio C Hamanod2c978f2011-03-20 19:42:221953--oneline
1954</dt>
1955<dd>
1956<p>
1957 This is a shorthand for "--pretty=oneline --abbrev-commit"
1958 used together.
1959</p>
1960</dd>
1961<dt class="hdlist1">
Junio C Hamanoc5bb3b32013-08-05 22:43:361962--encoding=&lt;encoding&gt;
Junio C Hamanod2c978f2011-03-20 19:42:221963</dt>
1964<dd>
1965<p>
1966 The commit objects record the encoding used for the log message
1967 in their encoding header; this option can be used to tell the
1968 command to re-code the commit log message in the encoding
1969 preferred by the user. For non plumbing commands this
Junio C Hamano823eebb2015-07-10 22:29:341970 defaults to UTF-8. Note that if an object claims to be encoded
1971 in <code>X</code> and we are outputting in <code>X</code>, we will output the object
1972 verbatim; this means that invalid sequences in the original
1973 commit may be copied to the output.
Junio C Hamanod2c978f2011-03-20 19:42:221974</p>
1975</dd>
1976<dt class="hdlist1">
Junio C Hamano5996b672016-04-13 22:01:411977--expand-tabs=&lt;n&gt;
1978</dt>
1979<dt class="hdlist1">
1980--expand-tabs
1981</dt>
1982<dt class="hdlist1">
1983--no-expand-tabs
1984</dt>
1985<dd>
1986<p>
1987 Perform a tab expansion (replace each tab with enough spaces
1988 to fill to the next display column that is multiple of <em>&lt;n&gt;</em>)
1989 in the log message before showing it in the output.
1990 <code>--expand-tabs</code> is a short-hand for <code>--expand-tabs=8</code>, and
1991 <code>--no-expand-tabs</code> is a short-hand for <code>--expand-tabs=0</code>,
1992 which disables tab expansion.
1993</p>
1994<div class="paragraph"><p>By default, tabs are expanded in pretty formats that indent the log
1995message by 4 spaces (i.e. <em>medium</em>, which is the default, <em>full</em>,
1996and <em>fuller</em>).</p></div>
1997</dd>
1998<dt class="hdlist1">
Junio C Hamano4e6ba272016-01-20 23:23:191999--notes[=&lt;treeish&gt;]
Junio C Hamanod2c978f2011-03-20 19:42:222000</dt>
2001<dd>
2002<p>
Junio C Hamanoa28a9202012-06-21 07:08:232003 Show the notes (see <a href="git-notes.html">git-notes(1)</a>) that annotate the
Junio C Hamanod2c978f2011-03-20 19:42:222004 commit, when showing the commit log message. This is the default
Junio C Hamanoac12f0e2014-09-19 22:32:512005 for <code>git log</code>, <code>git show</code> and <code>git whatchanged</code> commands when
2006 there is no <code>--pretty</code>, <code>--format</code>, or <code>--oneline</code> option given
Junio C Hamano60033462011-05-03 00:48:432007 on the command line.
Junio C Hamanod2c978f2011-03-20 19:42:222008</p>
Junio C Hamano60033462011-05-03 00:48:432009<div class="paragraph"><p>By default, the notes shown are from the notes refs listed in the
Junio C Hamano042f2142016-06-27 18:05:052010<code>core.notesRef</code> and <code>notes.displayRef</code> variables (or corresponding
Junio C Hamanoa28a9202012-06-21 07:08:232011environment overrides). See <a href="git-config.html">git-config(1)</a> for more details.</p></div>
Junio C Hamano4e6ba272016-01-20 23:23:192012<div class="paragraph"><p>With an optional <em>&lt;treeish&gt;</em> argument, use the treeish to find the notes
2013to display. The treeish can specify the full refname when it begins
Junio C Hamano1f7c4a52015-10-14 22:15:512014with <code>refs/notes/</code>; when it begins with <code>notes/</code>, <code>refs/</code> and otherwise
2015<code>refs/notes/</code> is prefixed to form a full name of the ref.</p></div>
Junio C Hamano60033462011-05-03 00:48:432016<div class="paragraph"><p>Multiple --notes options can be combined to control which notes are
2017being displayed. Examples: "--notes=foo" will show only notes from
2018"refs/notes/foo"; "--notes=foo --notes" will show both notes from
2019"refs/notes/foo" and from the default notes ref(s).</p></div>
Junio C Hamanod2c978f2011-03-20 19:42:222020</dd>
2021<dt class="hdlist1">
Junio C Hamano60033462011-05-03 00:48:432022--no-notes
2023</dt>
2024<dd>
2025<p>
Junio C Hamanoac12f0e2014-09-19 22:32:512026 Do not show notes. This negates the above <code>--notes</code> option, by
Junio C Hamano60033462011-05-03 00:48:432027 resetting the list of notes refs from which notes are shown.
2028 Options are parsed in the order given on the command line, so e.g.
2029 "--notes --notes=foo --no-notes --notes=bar" will only show notes
2030 from "refs/notes/bar".
2031</p>
2032</dd>
2033<dt class="hdlist1">
Junio C Hamano4e6ba272016-01-20 23:23:192034--show-notes[=&lt;treeish&gt;]
Junio C Hamano60033462011-05-03 00:48:432035</dt>
2036<dt class="hdlist1">
Junio C Hamanod2c978f2011-03-20 19:42:222037--[no-]standard-notes
2038</dt>
2039<dd>
2040<p>
Junio C Hamano60033462011-05-03 00:48:432041 These options are deprecated. Use the above --notes/--no-notes
2042 options instead.
Junio C Hamanod2c978f2011-03-20 19:42:222043</p>
2044</dd>
2045<dt class="hdlist1">
Junio C Hamano0acb1ae2012-09-24 21:28:132046--show-signature
2047</dt>
2048<dd>
2049<p>
2050 Check the validity of a signed commit object by passing the signature
Junio C Hamanoac12f0e2014-09-19 22:32:512051 to <code>gpg --verify</code> and show the output.
Junio C Hamano0acb1ae2012-09-24 21:28:132052</p>
2053</dd>
2054<dt class="hdlist1">
Junio C Hamanod2c978f2011-03-20 19:42:222055--relative-date
2056</dt>
2057<dd>
2058<p>
Junio C Hamanoac12f0e2014-09-19 22:32:512059 Synonym for <code>--date=relative</code>.
Junio C Hamanod2c978f2011-03-20 19:42:222060</p>
2061</dd>
2062<dt class="hdlist1">
Junio C Hamano1eb56092015-10-05 20:39:532063--date=&lt;format&gt;
Junio C Hamanod2c978f2011-03-20 19:42:222064</dt>
2065<dd>
2066<p>
2067 Only takes effect for dates shown in human-readable format, such
Junio C Hamanoac12f0e2014-09-19 22:32:512068 as when using <code>--pretty</code>. <code>log.date</code> config variable sets a default
Junio C Hamano1eb56092015-10-05 20:39:532069 value for the log command&#8217;s <code>--date</code> option. By default, dates
2070 are shown in the original time zone (either committer&#8217;s or
2071 author&#8217;s). If <code>-local</code> is appended to the format (e.g.,
2072 <code>iso-local</code>), the user&#8217;s local time zone is used instead.
Junio C Hamanod2c978f2011-03-20 19:42:222073</p>
Junio C Hamanoac12f0e2014-09-19 22:32:512074<div class="paragraph"><p><code>--date=relative</code> shows dates relative to the current time,
Junio C Hamanoe548d1b2016-08-08 22:26:492075e.g. &#8220;2 hours ago&#8221;. The <code>-local</code> option has no effect for
2076<code>--date=relative</code>.</p></div>
Junio C Hamano1eb56092015-10-05 20:39:532077<div class="paragraph"><p><code>--date=local</code> is an alias for <code>--date=default-local</code>.</p></div>
Junio C Hamanoac12f0e2014-09-19 22:32:512078<div class="paragraph"><p><code>--date=iso</code> (or <code>--date=iso8601</code>) shows timestamps in a ISO 8601-like format.
2079The differences to the strict ISO 8601 format are:</p></div>
2080<div class="ulist"><ul>
2081<li>
2082<p>
2083a space instead of the <code>T</code> date/time delimiter
2084</p>
2085</li>
2086<li>
2087<p>
2088a space between time and time zone
2089</p>
2090</li>
2091<li>
2092<p>
2093no colon between hours and minutes of the time zone
2094</p>
2095</li>
2096</ul></div>
2097<div class="paragraph"><p><code>--date=iso-strict</code> (or <code>--date=iso8601-strict</code>) shows timestamps in strict
2098ISO 8601 format.</p></div>
2099<div class="paragraph"><p><code>--date=rfc</code> (or <code>--date=rfc2822</code>) shows timestamps in RFC 2822
Junio C Hamanob73af6c2013-12-03 22:07:112100format, often found in email messages.</p></div>
Junio C Hamanoac12f0e2014-09-19 22:32:512101<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>
Junio C Hamanoe548d1b2016-08-08 22:26:492102<div class="paragraph"><p><code>--date=raw</code> shows the date as seconds since the epoch (1970-01-01
210300:00:00 UTC), followed by a space, and then the timezone as an offset
2104from UTC (a <code>+</code> or <code>-</code> with four digits; the first two are hours, and
2105the second two are minutes). I.e., as if the timestamp were formatted
2106with <code>strftime("%s %z")</code>).
2107Note that the <code>-local</code> option does not affect the seconds-since-epoch
2108value (which is always measured in UTC), but does switch the accompanying
2109timezone value.</p></div>
2110<div class="paragraph"><p><code>--date=unix</code> shows the date as a Unix epoch timestamp (seconds since
21111970). As with <code>--raw</code>, this is always in UTC and therefore <code>-local</code>
2112has no effect.</p></div>
Junio C Hamano55d91912017-06-22 22:32:462113<div class="paragraph"><p><code>--date=format:...</code> feeds the format <code>...</code> to your system <code>strftime</code>,
2114except for %z and %Z, which are handled internally.
Junio C Hamanod7ed4042015-08-03 19:43:002115Use <code>--date=format:%c</code> to show the date in your system locale&#8217;s
2116preferred format. See the <code>strftime</code> manual for a complete list of
Junio C Hamano1eb56092015-10-05 20:39:532117format placeholders. When using <code>-local</code>, the correct syntax is
2118<code>--date=format-local:...</code>.</p></div>
2119<div class="paragraph"><p><code>--date=default</code> is the default format, and is similar to
2120<code>--date=rfc2822</code>, with a few exceptions:</p></div>
2121<div class="ulist"><ul>
2122<li>
2123<p>
2124there is no comma after the day-of-week
2125</p>
2126</li>
2127<li>
2128<p>
2129the time zone is omitted when the local time zone is used
2130</p>
2131</li>
2132</ul></div>
Junio C Hamanod2c978f2011-03-20 19:42:222133</dd>
2134<dt class="hdlist1">
2135--parents
2136</dt>
2137<dd>
2138<p>
2139 Print also the parents of the commit (in the form "commit parent&#8230;").
Junio C Hamanoce019c02017-10-30 05:57:462140 Also enables parent rewriting, see <em>History Simplification</em> above.
Junio C Hamanod2c978f2011-03-20 19:42:222141</p>
2142</dd>
2143<dt class="hdlist1">
2144--children
2145</dt>
2146<dd>
2147<p>
2148 Print also the children of the commit (in the form "commit child&#8230;").
Junio C Hamanoce019c02017-10-30 05:57:462149 Also enables parent rewriting, see <em>History Simplification</em> above.
Junio C Hamanod2c978f2011-03-20 19:42:222150</p>
2151</dd>
2152<dt class="hdlist1">
2153--left-right
2154</dt>
2155<dd>
2156<p>
Junio C Hamanocd451662016-09-13 00:54:092157 Mark which side of a symmetric difference a commit is reachable from.
Junio C Hamanoac12f0e2014-09-19 22:32:512158 Commits from the left side are prefixed with <code>&lt;</code> and those from
2159 the right with <code>&gt;</code>. If combined with <code>--boundary</code>, those
2160 commits are prefixed with <code>-</code>.
Junio C Hamanod2c978f2011-03-20 19:42:222161</p>
2162<div class="paragraph"><p>For example, if you have this topology:</p></div>
2163<div class="listingblock">
2164<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512165<pre><code> y---b---b branch B
Junio C Hamanod2c978f2011-03-20 19:42:222166 / \ /
2167 / .
2168 / / \
Junio C Hamanoac12f0e2014-09-19 22:32:512169 o---x---a---a branch A</code></pre>
Junio C Hamanod2c978f2011-03-20 19:42:222170</div></div>
2171<div class="paragraph"><p>you would get an output like this:</p></div>
2172<div class="listingblock">
2173<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512174<pre><code> $ git rev-list --left-right --boundary --pretty=oneline A...B
Junio C Hamanod2c978f2011-03-20 19:42:222175
2176 &gt;bbbbbbb... 3rd on b
2177 &gt;bbbbbbb... 2nd on b
2178 &lt;aaaaaaa... 3rd on a
2179 &lt;aaaaaaa... 2nd on a
2180 -yyyyyyy... 1st on b
Junio C Hamanoac12f0e2014-09-19 22:32:512181 -xxxxxxx... 1st on a</code></pre>
Junio C Hamanod2c978f2011-03-20 19:42:222182</div></div>
2183</dd>
2184<dt class="hdlist1">
2185--graph
2186</dt>
2187<dd>
2188<p>
2189 Draw a text-based graphical representation of the commit history
2190 on the left hand side of the output. This may cause extra lines
2191 to be printed in between commits, in order for the graph history
2192 to be drawn properly.
Junio C Hamanoef57d1e2015-03-25 21:23:002193 Cannot be combined with <code>--no-walk</code>.
Junio C Hamanod2c978f2011-03-20 19:42:222194</p>
Junio C Hamanoce019c02017-10-30 05:57:462195<div class="paragraph"><p>This enables parent rewriting, see <em>History Simplification</em> above.</p></div>
Junio C Hamanoac12f0e2014-09-19 22:32:512196<div class="paragraph"><p>This implies the <code>--topo-order</code> option by default, but the
2197<code>--date-order</code> option may also be specified.</p></div>
Junio C Hamanod2c978f2011-03-20 19:42:222198</dd>
Junio C Hamano624dd4c2014-04-03 21:56:302199<dt class="hdlist1">
2200--show-linear-break[=&lt;barrier&gt;]
2201</dt>
2202<dd>
2203<p>
2204 When --graph is not used, all history branches are flattened
2205 which can make it hard to see that the two consecutive commits
2206 do not belong to a linear branch. This option puts a barrier
Junio C Hamanoac12f0e2014-09-19 22:32:512207 in between them in that case. If <code>&lt;barrier&gt;</code> is specified, it
Junio C Hamano624dd4c2014-04-03 21:56:302208 is the string that will be shown instead of the default one.
2209</p>
2210</dd>
Junio C Hamanod2c978f2011-03-20 19:42:222211</dl></div>
Junio C Hamano9629d4f2012-12-19 00:28:272212</div>
2213<div class="sect2">
2214<h3 id="_diff_formatting">Diff Formatting</h3>
Junio C Hamanob73af6c2013-12-03 22:07:112215<div class="paragraph"><p>Listed below are options that control the formatting of diff output.
Junio C Hamanoa28a9202012-06-21 07:08:232216Some of them are specific to <a href="git-rev-list.html">git-rev-list(1)</a>, however other diff
2217options may be given. See <a href="git-diff-files.html">git-diff-files(1)</a> for more options.</p></div>
Junio C Hamanod2c978f2011-03-20 19:42:222218<div class="dlist"><dl>
2219<dt class="hdlist1">
2220-c
2221</dt>
2222<dd>
2223<p>
2224 With this option, diff output for a merge commit
2225 shows the differences from each of the parents to the merge result
2226 simultaneously instead of showing pairwise diff between a parent
2227 and the result one at a time. Furthermore, it lists only files
2228 which were modified from all parents.
2229</p>
2230</dd>
2231<dt class="hdlist1">
2232--cc
2233</dt>
2234<dd>
2235<p>
Junio C Hamanoac12f0e2014-09-19 22:32:512236 This flag implies the <code>-c</code> option and further compresses the
Junio C Hamanod2c978f2011-03-20 19:42:222237 patch output by omitting uninteresting hunks whose contents in
2238 the parents have only two variants and the merge result picks
2239 one of them without modification.
2240</p>
2241</dd>
2242<dt class="hdlist1">
2243-m
2244</dt>
2245<dd>
2246<p>
2247 This flag makes the merge commits show the full diff like
2248 regular commits; for each merge parent, a separate log entry
2249 and diff is generated. An exception is that only diff against
Junio C Hamanoac12f0e2014-09-19 22:32:512250 the first parent is shown when <code>--first-parent</code> option is given;
Junio C Hamanod2c978f2011-03-20 19:42:222251 in that case, the output represents the changes the merge
2252 brought <em>into</em> the then-current branch.
2253</p>
2254</dd>
2255<dt class="hdlist1">
2256-r
2257</dt>
2258<dd>
2259<p>
2260 Show recursive diffs.
2261</p>
2262</dd>
2263<dt class="hdlist1">
2264-t
2265</dt>
2266<dd>
2267<p>
Junio C Hamanoac12f0e2014-09-19 22:32:512268 Show the tree objects in the diff output. This implies <code>-r</code>.
Junio C Hamanod2c978f2011-03-20 19:42:222269</p>
2270</dd>
Junio C Hamanod2c978f2011-03-20 19:42:222271</dl></div>
Junio C Hamano0430e3a2007-05-15 03:13:172272</div>
Junio C Hamano9629d4f2012-12-19 00:28:272273</div>
2274</div>
2275<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:312276<h2 id="_pretty_formats">PRETTY FORMATS</h2>
Junio C Hamano0430e3a2007-05-15 03:13:172277<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:592278<div class="paragraph"><p>If the commit is a merge, and if the pretty-format
Junio C Hamano0430e3a2007-05-15 03:13:172279is not <em>oneline</em>, <em>email</em> or <em>raw</em>, an additional line is
2280inserted before the <em>Author:</em> line. This line begins with
2281"Merge: " and the sha1s of ancestral commits are printed,
2282separated by spaces. Note that the listed commits may not
2283necessarily be the list of the <strong>direct</strong> parent commits if you
2284have limited your view of history: for example, if you are
2285only interested in changes related to a certain directory or
Junio C Hamanoba4b9282008-07-06 05:20:312286file.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592287<div class="paragraph"><p>There are several built-in formats, and you can define
Junio C Hamanoa574a092010-06-13 19:57:102288additional formats by setting a pretty.&lt;name&gt;
2289config option to either another format name, or a
2290<em>format:</em> string, as described below (see
Junio C Hamanoa28a9202012-06-21 07:08:232291<a href="git-config.html">git-config(1)</a>). Here are the details of the
Junio C Hamanoa574a092010-06-13 19:57:102292built-in formats:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592293<div class="ulist"><ul>
Junio C Hamanoa340aaa2006-11-23 02:47:332294<li>
2295<p>
2296<em>oneline</em>
2297</p>
2298<div class="literalblock">
2299<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512300<pre><code>&lt;sha1&gt; &lt;title line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332301</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592302<div class="paragraph"><p>This is designed to be as compact as possible.</p></div>
Junio C Hamanoa340aaa2006-11-23 02:47:332303</li>
2304<li>
2305<p>
2306<em>short</em>
2307</p>
2308<div class="literalblock">
2309<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512310<pre><code>commit &lt;sha1&gt;
2311Author: &lt;author&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332312</div></div>
2313<div class="literalblock">
2314<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512315<pre><code>&lt;title line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332316</div></div>
2317</li>
2318<li>
2319<p>
2320<em>medium</em>
2321</p>
2322<div class="literalblock">
2323<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512324<pre><code>commit &lt;sha1&gt;
Junio C Hamanoa340aaa2006-11-23 02:47:332325Author: &lt;author&gt;
Junio C Hamanoac12f0e2014-09-19 22:32:512326Date: &lt;author date&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332327</div></div>
2328<div class="literalblock">
2329<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512330<pre><code>&lt;title line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332331</div></div>
2332<div class="literalblock">
2333<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512334<pre><code>&lt;full commit message&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332335</div></div>
2336</li>
2337<li>
2338<p>
2339<em>full</em>
2340</p>
2341<div class="literalblock">
2342<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512343<pre><code>commit &lt;sha1&gt;
Junio C Hamanoa340aaa2006-11-23 02:47:332344Author: &lt;author&gt;
Junio C Hamanoac12f0e2014-09-19 22:32:512345Commit: &lt;committer&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332346</div></div>
2347<div class="literalblock">
2348<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512349<pre><code>&lt;title line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332350</div></div>
2351<div class="literalblock">
2352<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512353<pre><code>&lt;full commit message&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332354</div></div>
2355</li>
2356<li>
2357<p>
2358<em>fuller</em>
2359</p>
2360<div class="literalblock">
2361<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512362<pre><code>commit &lt;sha1&gt;
Junio C Hamano6a3c8272008-12-19 21:38:182363Author: &lt;author&gt;
Junio C Hamanoba4b9282008-07-06 05:20:312364AuthorDate: &lt;author date&gt;
Junio C Hamano6a3c8272008-12-19 21:38:182365Commit: &lt;committer&gt;
Junio C Hamanoac12f0e2014-09-19 22:32:512366CommitDate: &lt;committer date&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332367</div></div>
2368<div class="literalblock">
2369<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512370<pre><code>&lt;title line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332371</div></div>
2372<div class="literalblock">
2373<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512374<pre><code>&lt;full commit message&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332375</div></div>
2376</li>
2377<li>
2378<p>
2379<em>email</em>
2380</p>
2381<div class="literalblock">
2382<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512383<pre><code>From &lt;sha1&gt; &lt;date&gt;
Junio C Hamanoa340aaa2006-11-23 02:47:332384From: &lt;author&gt;
Junio C Hamanoba4b9282008-07-06 05:20:312385Date: &lt;author date&gt;
Junio C Hamanoac12f0e2014-09-19 22:32:512386Subject: [PATCH] &lt;title line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332387</div></div>
2388<div class="literalblock">
2389<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512390<pre><code>&lt;full commit message&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332391</div></div>
2392</li>
2393<li>
2394<p>
2395<em>raw</em>
2396</p>
Junio C Hamano68cf15a2010-11-06 01:01:592397<div class="paragraph"><p>The <em>raw</em> format shows the entire commit exactly as
Junio C Hamanoe3f080d2013-04-22 02:27:132398stored in the commit object. Notably, the SHA-1s are
Junio C Hamanoa340aaa2006-11-23 02:47:332399displayed in full, regardless of whether --abbrev or
2400--no-abbrev are used, and <em>parents</em> information show the
Junio C Hamanod75148a2014-04-08 19:48:382401true parent commits, without taking grafts or history
Junio C Hamano85f1fde2015-06-01 20:37:322402simplification into account. Note that this format affects the way
2403commits are displayed, but not the way the diff is shown e.g. with
2404<code>git log --raw</code>. To get full object names in a raw diff format,
2405use <code>--no-abbrev</code>.</p></div>
Junio C Hamanoa340aaa2006-11-23 02:47:332406</li>
Junio C Hamanoa3fd83c2007-03-02 10:34:362407<li>
2408<p>
Junio C Hamanoe32ec8b2010-06-02 23:32:312409<em>format:&lt;string&gt;</em>
Junio C Hamanoa3fd83c2007-03-02 10:34:362410</p>
Junio C Hamano68cf15a2010-11-06 01:01:592411<div class="paragraph"><p>The <em>format:&lt;string&gt;</em> format allows you to specify which information
Junio C Hamanoa3fd83c2007-03-02 10:34:362412you want to show. It works a little bit like printf format,
2413with the notable exception that you get a newline with <em>%n</em>
Junio C Hamanoba4b9282008-07-06 05:20:312414instead of <em>\n</em>.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592415<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>
Junio C Hamanoba4b9282008-07-06 05:20:312416would show something like this:</p></div>
Junio C Hamano0430e3a2007-05-15 03:13:172417<div class="listingblock">
2418<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512419<pre><code>The author of fe6e0ee was Junio C Hamano, 23 hours ago
2420The title was &gt;&gt;t4119: test autocomputing -p&lt;n&gt; for traditional diff input.&lt;&lt;</code></pre>
Junio C Hamano0430e3a2007-05-15 03:13:172421</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592422<div class="paragraph"><p>The placeholders are:</p></div>
2423<div class="ulist"><ul>
Junio C Hamanoa3fd83c2007-03-02 10:34:362424<li>
2425<p>
2426<em>%H</em>: commit hash
2427</p>
2428</li>
2429<li>
2430<p>
2431<em>%h</em>: abbreviated commit hash
2432</p>
2433</li>
2434<li>
2435<p>
2436<em>%T</em>: tree hash
2437</p>
2438</li>
2439<li>
2440<p>
2441<em>%t</em>: abbreviated tree hash
2442</p>
2443</li>
2444<li>
2445<p>
2446<em>%P</em>: parent hashes
2447</p>
2448</li>
2449<li>
2450<p>
2451<em>%p</em>: abbreviated parent hashes
2452</p>
2453</li>
2454<li>
2455<p>
2456<em>%an</em>: author name
2457</p>
2458</li>
2459<li>
2460<p>
Junio C Hamano04e768d2013-04-23 19:19:262461<em>%aN</em>: author name (respecting .mailmap, see <a href="git-shortlog.html">git-shortlog(1)</a>
2462 or <a href="git-blame.html">git-blame(1)</a>)
Junio C Hamanof5a93622008-07-16 03:23:572463</p>
2464</li>
2465<li>
2466<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:362467<em>%ae</em>: author email
2468</p>
2469</li>
2470<li>
2471<p>
Junio C Hamano04e768d2013-04-23 19:19:262472<em>%aE</em>: author email (respecting .mailmap, see
2473 <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)
Junio C Hamano8bc410e2009-02-15 10:38:192474</p>
2475</li>
2476<li>
2477<p>
Junio C Hamanoa387df32008-08-29 08:56:582478<em>%ad</em>: author date (format respects --date= option)
Junio C Hamanoa3fd83c2007-03-02 10:34:362479</p>
2480</li>
2481<li>
2482<p>
2483<em>%aD</em>: author date, RFC2822 style
2484</p>
2485</li>
2486<li>
2487<p>
2488<em>%ar</em>: author date, relative
2489</p>
2490</li>
2491<li>
2492<p>
2493<em>%at</em>: author date, UNIX timestamp
2494</p>
2495</li>
2496<li>
2497<p>
Junio C Hamanoac12f0e2014-09-19 22:32:512498<em>%ai</em>: author date, ISO 8601-like format
2499</p>
2500</li>
2501<li>
2502<p>
2503<em>%aI</em>: author date, strict ISO 8601 format
Junio C Hamano02f130b2007-07-14 08:26:562504</p>
2505</li>
2506<li>
2507<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:362508<em>%cn</em>: committer name
2509</p>
2510</li>
2511<li>
2512<p>
Junio C Hamano04e768d2013-04-23 19:19:262513<em>%cN</em>: committer name (respecting .mailmap, see
2514 <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)
Junio C Hamanof5a93622008-07-16 03:23:572515</p>
2516</li>
2517<li>
2518<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:362519<em>%ce</em>: committer email
2520</p>
2521</li>
2522<li>
2523<p>
Junio C Hamano04e768d2013-04-23 19:19:262524<em>%cE</em>: committer email (respecting .mailmap, see
2525 <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)
Junio C Hamano8bc410e2009-02-15 10:38:192526</p>
2527</li>
2528<li>
2529<p>
Junio C Hamano53fe0312014-09-09 21:16:172530<em>%cd</em>: committer date (format respects --date= option)
Junio C Hamanoa3fd83c2007-03-02 10:34:362531</p>
2532</li>
2533<li>
2534<p>
2535<em>%cD</em>: committer date, RFC2822 style
2536</p>
2537</li>
2538<li>
2539<p>
2540<em>%cr</em>: committer date, relative
2541</p>
2542</li>
2543<li>
2544<p>
2545<em>%ct</em>: committer date, UNIX timestamp
2546</p>
2547</li>
2548<li>
2549<p>
Junio C Hamanoac12f0e2014-09-19 22:32:512550<em>%ci</em>: committer date, ISO 8601-like format
2551</p>
2552</li>
2553<li>
2554<p>
2555<em>%cI</em>: committer date, strict ISO 8601 format
Junio C Hamano02f130b2007-07-14 08:26:562556</p>
2557</li>
2558<li>
2559<p>
Junio C Hamanoa28a9202012-06-21 07:08:232560<em>%d</em>: ref names, like the --decorate option of <a href="git-log.html">git-log(1)</a>
Junio C Hamano5e4d8de2008-09-19 06:27:022561</p>
2562</li>
2563<li>
2564<p>
Junio C Hamano00b9f1a2014-09-29 23:11:282565<em>%D</em>: ref names without the " (", ")" wrapping.
2566</p>
2567</li>
2568<li>
2569<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:362570<em>%e</em>: encoding
2571</p>
2572</li>
2573<li>
2574<p>
2575<em>%s</em>: subject
2576</p>
2577</li>
2578<li>
2579<p>
Junio C Hamano5f9a6f02009-04-06 08:26:562580<em>%f</em>: sanitized subject line, suitable for a filename
2581</p>
2582</li>
2583<li>
2584<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:362585<em>%b</em>: body
2586</p>
2587</li>
2588<li>
2589<p>
Junio C Hamanocb39aea2010-05-09 07:24:482590<em>%B</em>: raw body (unwrapped subject and body)
2591</p>
2592</li>
2593<li>
2594<p>
Junio C Hamano3b70d3c2009-11-21 17:37:372595<em>%N</em>: commit notes
2596</p>
2597</li>
2598<li>
2599<p>
Junio C Hamano0acb1ae2012-09-24 21:28:132600<em>%GG</em>: raw verification message from GPG for a signed commit
2601</p>
2602</li>
2603<li>
2604<p>
Junio C Hamano4a401d52016-10-26 22:24:372605<em>%G?</em>: show "G" for a good (valid) signature,
2606 "B" for a bad signature,
2607 "U" for a good signature with unknown validity,
2608 "X" for a good signature that has expired,
2609 "Y" for a good signature made by an expired key,
2610 "R" for a good signature made by a revoked key,
2611 "E" if the signature cannot be checked (e.g. missing key)
2612 and "N" for no signature
Junio C Hamano0acb1ae2012-09-24 21:28:132613</p>
2614</li>
2615<li>
2616<p>
2617<em>%GS</em>: show the name of the signer for a signed commit
2618</p>
2619</li>
2620<li>
2621<p>
Junio C Hamano5e7f1312013-03-21 22:49:012622<em>%GK</em>: show the key used to sign a signed commit
2623</p>
2624</li>
2625<li>
2626<p>
Junio C Hamanoe548d1b2016-08-08 22:26:492627<em>%gD</em>: reflog selector, e.g., <code>refs/stash@{1}</code> or
2628 <code>refs/stash@{2 minutes ago</code>}; the format follows the rules described
2629 for the <code>-g</code> option. The portion before the <code>@</code> is the refname as
2630 given on the command line (so <code>git log -g refs/heads/master</code> would
2631 yield <code>refs/heads/master@{0}</code>).
Junio C Hamanoc21ab052009-10-31 04:03:552632</p>
2633</li>
2634<li>
2635<p>
Junio C Hamanoe548d1b2016-08-08 22:26:492636<em>%gd</em>: shortened reflog selector; same as <code>%gD</code>, but the refname
2637 portion is shortened for human readability (so <code>refs/heads/master</code>
2638 becomes just <code>master</code>).
Junio C Hamanoc21ab052009-10-31 04:03:552639</p>
2640</li>
2641<li>
2642<p>
Junio C Hamano962f3a32011-12-22 20:21:442643<em>%gn</em>: reflog identity name
2644</p>
2645</li>
2646<li>
2647<p>
Junio C Hamano04e768d2013-04-23 19:19:262648<em>%gN</em>: reflog identity name (respecting .mailmap, see
2649 <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)
Junio C Hamano962f3a32011-12-22 20:21:442650</p>
2651</li>
2652<li>
2653<p>
2654<em>%ge</em>: reflog identity email
2655</p>
2656</li>
2657<li>
2658<p>
Junio C Hamano04e768d2013-04-23 19:19:262659<em>%gE</em>: reflog identity email (respecting .mailmap, see
2660 <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)
Junio C Hamano962f3a32011-12-22 20:21:442661</p>
2662</li>
2663<li>
2664<p>
Junio C Hamanoc21ab052009-10-31 04:03:552665<em>%gs</em>: reflog subject
2666</p>
2667</li>
2668<li>
2669<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:362670<em>%Cred</em>: switch color to red
2671</p>
2672</li>
2673<li>
2674<p>
2675<em>%Cgreen</em>: switch color to green
2676</p>
2677</li>
2678<li>
2679<p>
2680<em>%Cblue</em>: switch color to blue
2681</p>
2682</li>
2683<li>
2684<p>
2685<em>%Creset</em>: reset color
2686</p>
2687</li>
2688<li>
2689<p>
Junio C Hamanoc0859f72016-10-17 22:22:572690<em>%C(&#8230;)</em>: color specification, as described under Values in the
Junio C Hamano4b2a6c12017-08-22 18:32:372691 "CONFIGURATION FILE" section of <a href="git-config.html">git-config(1)</a>.
2692 By default, colors are shown only when enabled for log output (by
2693 <code>color.diff</code>, <code>color.ui</code>, or <code>--color</code>, and respecting the <code>auto</code>
2694 settings of the former if we are going to a terminal). <code>%C(auto,...)</code>
2695 is accepted as a historical synonym for the default (e.g.,
2696 <code>%C(auto,red)</code>). Specifying <code>%C(always,...) will show the colors
2697 even when color is not otherwise enabled (though consider
2698 just using `--color=always</code> to enable color for the whole output,
2699 including this format and anything else git might color). <code>auto</code>
2700 alone (i.e. <code>%C(auto)</code>) will turn on auto coloring on the next
2701 placeholders until the color is switched again.
Junio C Hamanocc0cb312009-01-22 03:38:502702</p>
2703</li>
2704<li>
2705<p>
Junio C Hamanocd451662016-09-13 00:54:092706<em>%m</em>: left (<code>&lt;</code>), right (<code>&gt;</code>) or boundary (<code>-</code>) mark
Junio C Hamanod9e0e5d2007-04-14 16:22:042707</p>
2708</li>
2709<li>
2710<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:362711<em>%n</em>: newline
2712</p>
Junio C Hamano0430e3a2007-05-15 03:13:172713</li>
Junio C Hamanob78d2592008-04-09 09:39:082714<li>
2715<p>
Junio C Hamanoa9701f02010-01-21 00:42:162716<em>%%</em>: a raw <em>%</em>
2717</p>
2718</li>
2719<li>
2720<p>
Junio C Hamanob78d2592008-04-09 09:39:082721<em>%x00</em>: print a byte from a hex code
2722</p>
2723</li>
Junio C Hamanobf984de2009-11-23 06:11:192724<li>
2725<p>
2726<em>%w([&lt;w&gt;[,&lt;i1&gt;[,&lt;i2&gt;]]])</em>: switch line wrapping, like the -w option of
Junio C Hamanoa28a9202012-06-21 07:08:232727 <a href="git-shortlog.html">git-shortlog(1)</a>.
Junio C Hamanobf984de2009-11-23 06:11:192728</p>
2729</li>
Junio C Hamano04e768d2013-04-23 19:19:262730<li>
2731<p>
2732<em>%&lt;(&lt;N&gt;[,trunc|ltrunc|mtrunc])</em>: make the next placeholder take at
2733 least N columns, padding spaces on the right if necessary.
2734 Optionally truncate at the beginning (ltrunc), the middle (mtrunc)
2735 or the end (trunc) if the output is longer than N columns.
2736 Note that truncating only works correctly with N &gt;= 2.
2737</p>
2738</li>
2739<li>
2740<p>
2741<em>%&lt;|(&lt;N&gt;)</em>: make the next placeholder take at least until Nth
2742 columns, padding spaces on the right if necessary
2743</p>
2744</li>
2745<li>
2746<p>
2747<em>%&gt;(&lt;N&gt;)</em>, <em>%&gt;|(&lt;N&gt;)</em>: similar to <em>%&lt;(&lt;N&gt;)</em>, <em>%&lt;|(&lt;N&gt;)</em>
2748 respectively, but padding spaces on the left
2749</p>
2750</li>
2751<li>
2752<p>
2753<em>%&gt;&gt;(&lt;N&gt;)</em>, <em>%&gt;&gt;|(&lt;N&gt;)</em>: similar to <em>%&gt;(&lt;N&gt;)</em>, <em>%&gt;|(&lt;N&gt;)</em>
2754 respectively, except that if the next placeholder takes more spaces
2755 than given and there are spaces on its left, use those spaces
2756</p>
2757</li>
2758<li>
2759<p>
Junio C Hamanoa25ccc42018-03-08 21:36:142760<em>%&gt;&lt;(&lt;N&gt;)</em>, <em>%&gt;&lt;|(&lt;N&gt;)</em>: similar to <em>%&lt;(&lt;N&gt;)</em>, <em>%&lt;|(&lt;N&gt;)</em>
Junio C Hamano04e768d2013-04-23 19:19:262761 respectively, but padding both sides (i.e. the text is centered)
Junio C Hamano222ed822017-06-02 06:24:062762</p>
2763</li>
2764<li>
2765<p>
Junio C Hamano0f1291d2017-12-27 19:58:352766%(trailers[:options]): display the trailers of the body as interpreted
2767 by <a href="git-interpret-trailers.html">git-interpret-trailers(1)</a>. The <code>trailers</code> string may be
2768 followed by a colon and zero or more comma-separated options. If the
2769 <code>only</code> option is given, omit non-trailer lines from the trailer block.
2770 If the <code>unfold</code> option is given, behave as if interpret-trailer&#8217;s
2771 <code>--unfold</code> option was given. E.g., <code>%(trailers:only,unfold)</code> to do
2772 both.
Junio C Hamano04e768d2013-04-23 19:19:262773</p>
2774</li>
Junio C Hamanoba4b9282008-07-06 05:20:312775</ul></div>
Junio C Hamanoa3fd83c2007-03-02 10:34:362776</li>
Junio C Hamanoc21ab052009-10-31 04:03:552777</ul></div>
2778<div class="admonitionblock">
2779<table><tr>
2780<td class="icon">
2781<div class="title">Note</div>
2782</td>
2783<td class="content">Some placeholders may depend on other options given to the
Junio C Hamanoac12f0e2014-09-19 22:32:512784revision traversal engine. For example, the <code>%g*</code> reflog options will
Junio C Hamanoc21ab052009-10-31 04:03:552785insert an empty string unless we are traversing reflog entries (e.g., by
Junio C Hamano00b9f1a2014-09-29 23:11:282786<code>git log -g</code>). The <code>%d</code> and <code>%D</code> placeholders will use the "short"
2787decoration format if <code>--decorate</code> was not already provided on the command
2788line.</td>
Junio C Hamanoc21ab052009-10-31 04:03:552789</tr></table>
2790</div>
Junio C Hamanoac12f0e2014-09-19 22:32:512791<div class="paragraph"><p>If you add a <code>+</code> (plus sign) after <em>%</em> of a placeholder, a line-feed
Junio C Hamano2bd8a742009-12-01 21:16:592792is inserted immediately before the expansion if and only if the
2793placeholder expands to a non-empty string.</p></div>
Junio C Hamano535c65c2017-06-24 22:51:582794<div class="paragraph"><p>If you add a <code>-</code> (minus sign) after <em>%</em> of a placeholder, all consecutive
2795line-feeds immediately preceding the expansion are deleted if and only if the
Junio C Hamano2bd8a742009-12-01 21:16:592796placeholder expands to an empty string.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592797<div class="paragraph"><p>If you add a ` ` (space) after <em>%</em> of a placeholder, a space
Junio C Hamano89a57342010-06-22 23:22:552798is inserted immediately before the expansion if and only if the
2799placeholder expands to a non-empty string.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592800<div class="ulist"><ul>
Junio C Hamano6fb124c2008-06-13 10:04:012801<li>
2802<p>
2803<em>tformat:</em>
2804</p>
Junio C Hamano68cf15a2010-11-06 01:01:592805<div class="paragraph"><p>The <em>tformat:</em> format works exactly like <em>format:</em>, except that it
Junio C Hamano6fb124c2008-06-13 10:04:012806provides "terminator" semantics instead of "separator" semantics. In
2807other words, each commit has the message terminator character (usually a
2808newline) appended, rather than a separator placed between entries.
2809This means that the final entry of a single-line format will be properly
2810terminated with a new line, just as the "oneline" format does.
Junio C Hamanoba4b9282008-07-06 05:20:312811For example:</p></div>
Junio C Hamano6fb124c2008-06-13 10:04:012812<div class="listingblock">
2813<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512814<pre><code>$ git log -2 --pretty=format:%h 4da45bef \
Junio C Hamano6fb124c2008-06-13 10:04:012815 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
28164da45be
28177134973 -- NO NEWLINE
2818
2819$ git log -2 --pretty=tformat:%h 4da45bef \
2820 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
28214da45be
Junio C Hamanoac12f0e2014-09-19 22:32:5128227134973</code></pre>
Junio C Hamano6fb124c2008-06-13 10:04:012823</div></div>
Junio C Hamanoac12f0e2014-09-19 22:32:512824<div class="paragraph"><p>In addition, any unrecognized string that has a <code>%</code> in it is interpreted
2825as if it has <code>tformat:</code> in front of it. For example, these two are
Junio C Hamano0a235222009-03-06 08:21:092826equivalent:</p></div>
2827<div class="listingblock">
2828<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512829<pre><code>$ git log -2 --pretty=tformat:%h 4da45bef
2830$ git log -2 --pretty=%h 4da45bef</code></pre>
Junio C Hamano0a235222009-03-06 08:21:092831</div></div>
Junio C Hamano6fb124c2008-06-13 10:04:012832</li>
Junio C Hamanoba4b9282008-07-06 05:20:312833</ul></div>
Junio C Hamano1a4e8412005-12-27 08:17:232834</div>
Junio C Hamano9629d4f2012-12-19 00:28:272835</div>
2836<div class="sect1">
Junio C Hamano58f587a2013-07-22 19:20:592837<h2 id="_common_diff_options">COMMON DIFF OPTIONS</h2>
Junio C Hamanod2c978f2011-03-20 19:42:222838<div class="sectionbody">
2839<div class="dlist"><dl>
2840<dt class="hdlist1">
2841-p
2842</dt>
2843<dt class="hdlist1">
2844-u
2845</dt>
2846<dt class="hdlist1">
2847--patch
2848</dt>
2849<dd>
2850<p>
2851 Generate patch (see section on generating patches).
Junio C Hamanod2c978f2011-03-20 19:42:222852</p>
2853</dd>
2854<dt class="hdlist1">
Junio C Hamano58f587a2013-07-22 19:20:592855-s
2856</dt>
2857<dt class="hdlist1">
2858--no-patch
2859</dt>
2860<dd>
2861<p>
Junio C Hamanoac12f0e2014-09-19 22:32:512862 Suppress diff output. Useful for commands like <code>git show</code> that
2863 show the patch by default, or to cancel the effect of <code>--patch</code>.
Junio C Hamano58f587a2013-07-22 19:20:592864</p>
2865</dd>
2866<dt class="hdlist1">
Junio C Hamanod2c978f2011-03-20 19:42:222867-U&lt;n&gt;
2868</dt>
2869<dt class="hdlist1">
2870--unified=&lt;n&gt;
2871</dt>
2872<dd>
2873<p>
2874 Generate diffs with &lt;n&gt; lines of context instead of
2875 the usual three.
Junio C Hamanoac12f0e2014-09-19 22:32:512876 Implies <code>-p</code>.
Junio C Hamanod2c978f2011-03-20 19:42:222877</p>
2878</dd>
2879<dt class="hdlist1">
2880--raw
2881</dt>
2882<dd>
2883<p>
Junio C Hamano85f1fde2015-06-01 20:37:322884 For each commit, show a summary of changes using the raw diff
2885 format. See the "RAW OUTPUT FORMAT" section of
2886 <a href="git-diff.html">git-diff(1)</a>. This is different from showing the log
2887 itself in raw format, which you can achieve with
2888 <code>--format=raw</code>.
Junio C Hamanod2c978f2011-03-20 19:42:222889</p>
2890</dd>
2891<dt class="hdlist1">
2892--patch-with-raw
2893</dt>
2894<dd>
2895<p>
Junio C Hamanoac12f0e2014-09-19 22:32:512896 Synonym for <code>-p --raw</code>.
Junio C Hamanod2c978f2011-03-20 19:42:222897</p>
2898</dd>
2899<dt class="hdlist1">
Junio C Hamanoad70bf02016-09-26 23:44:272900--indent-heuristic
2901</dt>
Junio C Hamanoa65b6762017-11-06 04:45:422902<dd>
2903<p>
2904 Enable the heuristic that shift diff hunk boundaries to make patches
2905 easier to read. This is the default.
2906</p>
2907</dd>
Junio C Hamanoad70bf02016-09-26 23:44:272908<dt class="hdlist1">
2909--no-indent-heuristic
2910</dt>
Junio C Hamano5f888332016-06-13 19:28:312911<dd>
2912<p>
Junio C Hamanoa65b6762017-11-06 04:45:422913 Disable the indent heuristic.
Junio C Hamano5f888332016-06-13 19:28:312914</p>
2915</dd>
2916<dt class="hdlist1">
Junio C Hamano5a73f302011-10-14 05:58:342917--minimal
2918</dt>
2919<dd>
2920<p>
2921 Spend extra time to make sure the smallest possible
2922 diff is produced.
2923</p>
2924</dd>
2925<dt class="hdlist1">
Junio C Hamanod2c978f2011-03-20 19:42:222926--patience
2927</dt>
2928<dd>
2929<p>
2930 Generate a diff using the "patience diff" algorithm.
2931</p>
2932</dd>
2933<dt class="hdlist1">
Junio C Hamanoaea9e6b2012-03-07 00:17:112934--histogram
2935</dt>
2936<dd>
2937<p>
2938 Generate a diff using the "histogram diff" algorithm.
2939</p>
2940</dd>
2941<dt class="hdlist1">
Junio C Hamano047135e2017-12-19 21:57:542942--anchored=&lt;text&gt;
2943</dt>
2944<dd>
2945<p>
2946 Generate a diff using the "anchored diff" algorithm.
2947</p>
2948<div class="paragraph"><p>This option may be specified more than once.</p></div>
2949<div class="paragraph"><p>If a line exists in both the source and destination, exists only once,
2950and starts with this text, this algorithm attempts to prevent it from
2951appearing as a deletion or addition in the output. It uses the "patience
2952diff" algorithm internally.</p></div>
2953</dd>
2954<dt class="hdlist1">
Junio C Hamano80ad00d2013-02-18 00:19:032955--diff-algorithm={patience|minimal|histogram|myers}
2956</dt>
2957<dd>
2958<p>
2959 Choose a diff algorithm. The variants are as follows:
2960</p>
2961<div class="openblock">
2962<div class="content">
2963<div class="dlist"><dl>
2964<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:512965<code>default</code>, <code>myers</code>
Junio C Hamano80ad00d2013-02-18 00:19:032966</dt>
2967<dd>
2968<p>
2969 The basic greedy diff algorithm. Currently, this is the default.
2970</p>
2971</dd>
2972<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:512973<code>minimal</code>
Junio C Hamano80ad00d2013-02-18 00:19:032974</dt>
2975<dd>
2976<p>
2977 Spend extra time to make sure the smallest possible diff is
2978 produced.
2979</p>
2980</dd>
2981<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:512982<code>patience</code>
Junio C Hamano80ad00d2013-02-18 00:19:032983</dt>
2984<dd>
2985<p>
2986 Use "patience diff" algorithm when generating patches.
2987</p>
2988</dd>
2989<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:512990<code>histogram</code>
Junio C Hamano80ad00d2013-02-18 00:19:032991</dt>
2992<dd>
2993<p>
2994 This algorithm extends the patience algorithm to "support
2995 low-occurrence common elements".
2996</p>
2997</dd>
2998</dl></div>
2999</div></div>
3000<div class="paragraph"><p>For instance, if you configured diff.algorithm variable to a
3001non-default value and want to use the default one, then you
Junio C Hamanoac12f0e2014-09-19 22:32:513002have to use <code>--diff-algorithm=default</code> option.</p></div>
Junio C Hamano80ad00d2013-02-18 00:19:033003</dd>
3004<dt class="hdlist1">
Junio C Hamano4c4b0122011-06-30 01:19:323005--stat[=&lt;width&gt;[,&lt;name-width&gt;[,&lt;count&gt;]]]
Junio C Hamanod2c978f2011-03-20 19:42:223006</dt>
3007<dd>
3008<p>
Junio C Hamanoaea9e6b2012-03-07 00:17:113009 Generate a diffstat. By default, as much space as necessary
3010 will be used for the filename part, and the rest for the graph
3011 part. Maximum width defaults to terminal width, or 80 columns
Junio C Hamano7f2b3cb2012-06-22 22:42:393012 if not connected to a terminal, and can be overridden by
Junio C Hamanoac12f0e2014-09-19 22:32:513013 <code>&lt;width&gt;</code>. The width of the filename part can be limited by
3014 giving another width <code>&lt;name-width&gt;</code> after a comma. The width
Junio C Hamanoaea9e6b2012-03-07 00:17:113015 of the graph part can be limited by using
Junio C Hamanoac12f0e2014-09-19 22:32:513016 <code>--stat-graph-width=&lt;width&gt;</code> (affects all commands generating
3017 a stat graph) or by setting <code>diff.statGraphWidth=&lt;width&gt;</code>
3018 (does not affect <code>git format-patch</code>).
3019 By giving a third parameter <code>&lt;count&gt;</code>, you can limit the
3020 output to the first <code>&lt;count&gt;</code> lines, followed by <code>...</code> if
Junio C Hamanoaea9e6b2012-03-07 00:17:113021 there are more.
Junio C Hamanod2c978f2011-03-20 19:42:223022</p>
Junio C Hamanoac12f0e2014-09-19 22:32:513023<div class="paragraph"><p>These parameters can also be set individually with <code>--stat-width=&lt;width&gt;</code>,
3024<code>--stat-name-width=&lt;name-width&gt;</code> and <code>--stat-count=&lt;count&gt;</code>.</p></div>
Junio C Hamanod2c978f2011-03-20 19:42:223025</dd>
3026<dt class="hdlist1">
Junio C Hamano45badf02018-03-14 21:56:413027--compact-summary
3028</dt>
3029<dd>
3030<p>
3031 Output a condensed summary of extended header information such
3032 as file creations or deletions ("new" or "gone", optionally "+l"
3033 if it&#8217;s a symlink) and mode changes ("+x" or "-x" for adding
3034 or removing executable bit respectively) in diffstat. The
3035 information is put betwen the filename part and the graph
3036 part. Implies <code>--stat</code>.
3037</p>
3038</dd>
3039<dt class="hdlist1">
Junio C Hamanod2c978f2011-03-20 19:42:223040--numstat
3041</dt>
3042<dd>
3043<p>
Junio C Hamanoac12f0e2014-09-19 22:32:513044 Similar to <code>--stat</code>, but shows number of added and
Junio C Hamanod2c978f2011-03-20 19:42:223045 deleted lines in decimal notation and pathname without
3046 abbreviation, to make it more machine friendly. For
Junio C Hamanoac12f0e2014-09-19 22:32:513047 binary files, outputs two <code>-</code> instead of saying
3048 <code>0 0</code>.
Junio C Hamanod2c978f2011-03-20 19:42:223049</p>
3050</dd>
3051<dt class="hdlist1">
3052--shortstat
3053</dt>
3054<dd>
3055<p>
Junio C Hamanoac12f0e2014-09-19 22:32:513056 Output only the last line of the <code>--stat</code> format containing total
Junio C Hamanod2c978f2011-03-20 19:42:223057 number of modified files, as well as number of added and deleted
3058 lines.
3059</p>
3060</dd>
3061<dt class="hdlist1">
Junio C Hamano1c222c52011-05-13 19:55:323062--dirstat[=&lt;param1,param2,&#8230;&gt;]
Junio C Hamanod2c978f2011-03-20 19:42:223063</dt>
3064<dd>
3065<p>
Junio C Hamano1c222c52011-05-13 19:55:323066 Output the distribution of relative amount of changes for each
Junio C Hamanoac12f0e2014-09-19 22:32:513067 sub-directory. The behavior of <code>--dirstat</code> can be customized by
Junio C Hamano1c222c52011-05-13 19:55:323068 passing it a comma separated list of parameters.
Junio C Hamanoac12f0e2014-09-19 22:32:513069 The defaults are controlled by the <code>diff.dirstat</code> configuration
Junio C Hamanoa28a9202012-06-21 07:08:233070 variable (see <a href="git-config.html">git-config(1)</a>).
Junio C Hamano1c222c52011-05-13 19:55:323071 The following parameters are available:
Junio C Hamanod2c978f2011-03-20 19:42:223072</p>
Junio C Hamano9629d4f2012-12-19 00:28:273073<div class="openblock">
3074<div class="content">
Junio C Hamano1c222c52011-05-13 19:55:323075<div class="dlist"><dl>
3076<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:513077<code>changes</code>
Junio C Hamano1c222c52011-05-13 19:55:323078</dt>
3079<dd>
3080<p>
3081 Compute the dirstat numbers by counting the lines that have been
3082 removed from the source, or added to the destination. This ignores
3083 the amount of pure code movements within a file. In other words,
3084 rearranging lines in a file is not counted as much as other changes.
3085 This is the default behavior when no parameter is given.
3086</p>
Junio C Hamanod2c978f2011-03-20 19:42:223087</dd>
3088<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:513089<code>lines</code>
Junio C Hamanod2c978f2011-03-20 19:42:223090</dt>
3091<dd>
3092<p>
Junio C Hamano1c222c52011-05-13 19:55:323093 Compute the dirstat numbers by doing the regular line-based diff
3094 analysis, and summing the removed/added line counts. (For binary
3095 files, count 64-byte chunks instead, since binary files have no
Junio C Hamanoac12f0e2014-09-19 22:32:513096 natural concept of lines). This is a more expensive <code>--dirstat</code>
3097 behavior than the <code>changes</code> behavior, but it does count rearranged
Junio C Hamano1c222c52011-05-13 19:55:323098 lines within a file as much as other changes. The resulting output
Junio C Hamanoac12f0e2014-09-19 22:32:513099 is consistent with what you get from the other <code>--*stat</code> options.
Junio C Hamanod2c978f2011-03-20 19:42:223100</p>
3101</dd>
3102<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:513103<code>files</code>
Junio C Hamano1c222c52011-05-13 19:55:323104</dt>
3105<dd>
3106<p>
3107 Compute the dirstat numbers by counting the number of files changed.
3108 Each changed file counts equally in the dirstat analysis. This is
Junio C Hamanoac12f0e2014-09-19 22:32:513109 the computationally cheapest <code>--dirstat</code> behavior, since it does
Junio C Hamano1c222c52011-05-13 19:55:323110 not have to look at the file contents at all.
3111</p>
3112</dd>
3113<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:513114<code>cumulative</code>
Junio C Hamano1c222c52011-05-13 19:55:323115</dt>
3116<dd>
3117<p>
3118 Count changes in a child directory for the parent directory as well.
Junio C Hamanoac12f0e2014-09-19 22:32:513119 Note that when using <code>cumulative</code>, the sum of the percentages
Junio C Hamano1c222c52011-05-13 19:55:323120 reported may exceed 100%. The default (non-cumulative) behavior can
Junio C Hamanoac12f0e2014-09-19 22:32:513121 be specified with the <code>noncumulative</code> parameter.
Junio C Hamano1c222c52011-05-13 19:55:323122</p>
3123</dd>
3124<dt class="hdlist1">
3125&lt;limit&gt;
3126</dt>
3127<dd>
3128<p>
3129 An integer parameter specifies a cut-off percent (3% by default).
3130 Directories contributing less than this percentage of the changes
3131 are not shown in the output.
3132</p>
3133</dd>
3134</dl></div>
Junio C Hamano9629d4f2012-12-19 00:28:273135</div></div>
Junio C Hamano1c222c52011-05-13 19:55:323136<div class="paragraph"><p>Example: The following will count changed files, while ignoring
3137directories with less than 10% of the total amount of changed files,
3138and accumulating child directory counts in the parent directories:
Junio C Hamanoac12f0e2014-09-19 22:32:513139<code>--dirstat=files,10,cumulative</code>.</p></div>
Junio C Hamano1c222c52011-05-13 19:55:323140</dd>
3141<dt class="hdlist1">
Junio C Hamanod2c978f2011-03-20 19:42:223142--summary
3143</dt>
3144<dd>
3145<p>
3146 Output a condensed summary of extended header information
3147 such as creations, renames and mode changes.
3148</p>
3149</dd>
3150<dt class="hdlist1">
3151--patch-with-stat
3152</dt>
3153<dd>
3154<p>
Junio C Hamanoac12f0e2014-09-19 22:32:513155 Synonym for <code>-p --stat</code>.
Junio C Hamanod2c978f2011-03-20 19:42:223156</p>
3157</dd>
3158<dt class="hdlist1">
3159-z
3160</dt>
3161<dd>
3162<p>
3163 Separate the commits with NULs instead of with new newlines.
3164</p>
Junio C Hamanoac12f0e2014-09-19 22:32:513165<div class="paragraph"><p>Also, when <code>--raw</code> or <code>--numstat</code> has been given, do not munge
Junio C Hamanod2c978f2011-03-20 19:42:223166pathnames and use NULs as output field terminators.</p></div>
Junio C Hamano0f6f3bf2017-03-13 07:01:533167<div class="paragraph"><p>Without this option, pathnames with "unusual" characters are quoted as
3168explained for the configuration variable <code>core.quotePath</code> (see
3169<a href="git-config.html">git-config(1)</a>).</p></div>
Junio C Hamanod2c978f2011-03-20 19:42:223170</dd>
3171<dt class="hdlist1">
3172--name-only
3173</dt>
3174<dd>
3175<p>
3176 Show only names of changed files.
3177</p>
3178</dd>
3179<dt class="hdlist1">
3180--name-status
3181</dt>
3182<dd>
3183<p>
3184 Show only names and status of changed files. See the description
Junio C Hamanoac12f0e2014-09-19 22:32:513185 of the <code>--diff-filter</code> option on what the status letters mean.
Junio C Hamanod2c978f2011-03-20 19:42:223186</p>
3187</dd>
3188<dt class="hdlist1">
3189--submodule[=&lt;format&gt;]
3190</dt>
3191<dd>
3192<p>
Junio C Hamanocd451662016-09-13 00:54:093193 Specify how differences in submodules are shown. When specifying
3194 <code>--submodule=short</code> the <em>short</em> format is used. This format just
3195 shows the names of the commits at the beginning and end of the range.
3196 When <code>--submodule</code> or <code>--submodule=log</code> is specified, the <em>log</em>
3197 format is used. This format lists the commits in the range like
3198 <a href="git-submodule.html">git-submodule(1)</a> <code>summary</code> does. When <code>--submodule=diff</code>
3199 is specified, the <em>diff</em> format is used. This format shows an
3200 inline diff of the changes in the submodule contents between the
3201 commit range. Defaults to <code>diff.submodule</code> or the <em>short</em> format
3202 if the config option is unset.
Junio C Hamanod2c978f2011-03-20 19:42:223203</p>
3204</dd>
3205<dt class="hdlist1">
3206--color[=&lt;when&gt;]
3207</dt>
3208<dd>
3209<p>
3210 Show colored diff.
Junio C Hamanoac12f0e2014-09-19 22:32:513211 <code>--color</code> (i.e. without <em>=&lt;when&gt;</em>) is the same as <code>--color=always</code>.
3212 <em>&lt;when&gt;</em> can be one of <code>always</code>, <code>never</code>, or <code>auto</code>.
Junio C Hamanod2c978f2011-03-20 19:42:223213</p>
3214</dd>
3215<dt class="hdlist1">
3216--no-color
3217</dt>
3218<dd>
3219<p>
Junio C Hamano5f2627d2011-05-06 20:23:483220 Turn off colored diff.
Junio C Hamanoac12f0e2014-09-19 22:32:513221 It is the same as <code>--color=never</code>.
Junio C Hamanod2c978f2011-03-20 19:42:223222</p>
3223</dd>
3224<dt class="hdlist1">
Junio C Hamanofb1fdf12017-08-27 06:14:593225--color-moved[=&lt;mode&gt;]
3226</dt>
3227<dd>
3228<p>
3229 Moved lines of code are colored differently.
3230 The &lt;mode&gt; defaults to <em>no</em> if the option is not given
3231 and to <em>zebra</em> if the option with no mode is given.
3232 The mode must be one of:
3233</p>
3234<div class="openblock">
3235<div class="content">
3236<div class="dlist"><dl>
3237<dt class="hdlist1">
3238no
3239</dt>
3240<dd>
3241<p>
3242 Moved lines are not highlighted.
3243</p>
3244</dd>
3245<dt class="hdlist1">
3246default
3247</dt>
3248<dd>
3249<p>
3250 Is a synonym for <code>zebra</code>. This may change to a more sensible mode
3251 in the future.
3252</p>
3253</dd>
3254<dt class="hdlist1">
3255plain
3256</dt>
3257<dd>
3258<p>
3259 Any line that is added in one location and was removed
3260 in another location will be colored with <em>color.diff.newMoved</em>.
3261 Similarly <em>color.diff.oldMoved</em> will be used for removed lines
3262 that are added somewhere else in the diff. This mode picks up any
3263 moved line, but it is not very useful in a review to determine
3264 if a block of code was moved without permutation.
3265</p>
3266</dd>
3267<dt class="hdlist1">
3268zebra
3269</dt>
3270<dd>
3271<p>
3272 Blocks of moved text of at least 20 alphanumeric characters
3273 are detected greedily. The detected blocks are
3274 painted using either the <em>color.diff.{old,new}Moved</em> color or
3275 <em>color.diff.{old,new}MovedAlternative</em>. The change between
3276 the two colors indicates that a new block was detected.
3277</p>
3278</dd>
3279<dt class="hdlist1">
3280dimmed_zebra
3281</dt>
3282<dd>
3283<p>
3284 Similar to <em>zebra</em>, but additional dimming of uninteresting parts
3285 of moved code is performed. The bordering lines of two adjacent
3286 blocks are considered interesting, the rest is uninteresting.
3287</p>
3288</dd>
3289</dl></div>
3290</div></div>
3291</dd>
3292<dt class="hdlist1">
Junio C Hamanod2c978f2011-03-20 19:42:223293--word-diff[=&lt;mode&gt;]
3294</dt>
3295<dd>
3296<p>
3297 Show a word diff, using the &lt;mode&gt; to delimit changed words.
3298 By default, words are delimited by whitespace; see
Junio C Hamanoac12f0e2014-09-19 22:32:513299 <code>--word-diff-regex</code> below. The &lt;mode&gt; defaults to <em>plain</em>, and
Junio C Hamanod2c978f2011-03-20 19:42:223300 must be one of:
3301</p>
Junio C Hamano9629d4f2012-12-19 00:28:273302<div class="openblock">
3303<div class="content">
Junio C Hamanod2c978f2011-03-20 19:42:223304<div class="dlist"><dl>
3305<dt class="hdlist1">
3306color
3307</dt>
3308<dd>
3309<p>
Junio C Hamanoac12f0e2014-09-19 22:32:513310 Highlight changed words using only colors. Implies <code>--color</code>.
Junio C Hamanod2c978f2011-03-20 19:42:223311</p>
3312</dd>
3313<dt class="hdlist1">
3314plain
3315</dt>
3316<dd>
3317<p>
Junio C Hamanoac12f0e2014-09-19 22:32:513318 Show words as <code>[-removed-]</code> and <code>{+added+}</code>. Makes no
Junio C Hamanod2c978f2011-03-20 19:42:223319 attempts to escape the delimiters if they appear in the input,
3320 so the output may be ambiguous.
3321</p>
3322</dd>
3323<dt class="hdlist1">
3324porcelain
3325</dt>
3326<dd>
3327<p>
3328 Use a special line-based format intended for script
3329 consumption. Added/removed/unchanged runs are printed in the
Junio C Hamanoac12f0e2014-09-19 22:32:513330 usual unified diff format, starting with a <code>+</code>/<code>-</code>/` `
Junio C Hamanod2c978f2011-03-20 19:42:223331 character at the beginning of the line and extending to the
3332 end of the line. Newlines in the input are represented by a
Junio C Hamanoac12f0e2014-09-19 22:32:513333 tilde <code>~</code> on a line of its own.
Junio C Hamanod2c978f2011-03-20 19:42:223334</p>
3335</dd>
3336<dt class="hdlist1">
3337none
3338</dt>
3339<dd>
3340<p>
3341 Disable word diff again.
3342</p>
3343</dd>
3344</dl></div>
Junio C Hamano9629d4f2012-12-19 00:28:273345</div></div>
Junio C Hamanod2c978f2011-03-20 19:42:223346<div class="paragraph"><p>Note that despite the name of the first mode, color is used to
3347highlight the changed parts in all modes if enabled.</p></div>
3348</dd>
3349<dt class="hdlist1">
3350--word-diff-regex=&lt;regex&gt;
3351</dt>
3352<dd>
3353<p>
3354 Use &lt;regex&gt; to decide what a word is, instead of considering
3355 runs of non-whitespace to be a word. Also implies
Junio C Hamanoac12f0e2014-09-19 22:32:513356 <code>--word-diff</code> unless it was already enabled.
Junio C Hamanod2c978f2011-03-20 19:42:223357</p>
3358<div class="paragraph"><p>Every non-overlapping match of the
3359&lt;regex&gt; is considered a word. Anything between these matches is
3360considered whitespace and ignored(!) for the purposes of finding
Junio C Hamanoac12f0e2014-09-19 22:32:513361differences. You may want to append <code>|[^[:space:]]</code> to your regular
Junio C Hamanod2c978f2011-03-20 19:42:223362expression to make sure that it matches all non-whitespace characters.
3363A match that contains a newline is silently truncated(!) at the
3364newline.</p></div>
Junio C Hamano713eded2015-12-03 00:24:023365<div class="paragraph"><p>For example, <code>--word-diff-regex=.</code> will treat each character as a word
3366and, correspondingly, show differences character by character.</p></div>
Junio C Hamanod2c978f2011-03-20 19:42:223367<div class="paragraph"><p>The regex can also be set via a diff driver or configuration option, see
Junio C Hamano198b1f12016-05-17 22:27:243368<a href="gitattributes.html">gitattributes(5)</a> or <a href="git-config.html">git-config(1)</a>. Giving it explicitly
Junio C Hamanod2c978f2011-03-20 19:42:223369overrides any diff driver or configuration setting. Diff drivers
3370override configuration settings.</p></div>
3371</dd>
3372<dt class="hdlist1">
3373--color-words[=&lt;regex&gt;]
3374</dt>
3375<dd>
3376<p>
Junio C Hamanoac12f0e2014-09-19 22:32:513377 Equivalent to <code>--word-diff=color</code> plus (if a regex was
3378 specified) <code>--word-diff-regex=&lt;regex&gt;</code>.
Junio C Hamanod2c978f2011-03-20 19:42:223379</p>
3380</dd>
3381<dt class="hdlist1">
3382--no-renames
3383</dt>
3384<dd>
3385<p>
3386 Turn off rename detection, even when the configuration
3387 file gives the default to do so.
3388</p>
3389</dd>
3390<dt class="hdlist1">
3391--check
3392</dt>
3393<dd>
3394<p>
Junio C Hamano84ea1e42016-04-08 21:53:483395 Warn if changes introduce conflict markers or whitespace errors.
3396 What are considered whitespace errors is controlled by <code>core.whitespace</code>
Junio C Hamano6005bfa2011-06-23 00:51:223397 configuration. By default, trailing whitespaces (including
3398 lines that solely consist of whitespaces) and a space character
3399 that is immediately followed by a tab character inside the
3400 initial indent of the line are considered whitespace errors.
3401 Exits with non-zero status if problems are found. Not compatible
3402 with --exit-code.
Junio C Hamanod2c978f2011-03-20 19:42:223403</p>
3404</dd>
3405<dt class="hdlist1">
Junio C Hamano8c5d5942015-06-11 19:37:483406--ws-error-highlight=&lt;kind&gt;
3407</dt>
3408<dd>
3409<p>
Junio C Hamano4b2a6c12017-08-22 18:32:373410 Highlight whitespace errors in the <code>context</code>, <code>old</code> or <code>new</code>
3411 lines of the diff. Multiple values are separated by comma,
3412 <code>none</code> resets previous values, <code>default</code> reset the list to
3413 <code>new</code> and <code>all</code> is a shorthand for <code>old,new,context</code>. When
3414 this option is not given, and the configuration variable
3415 <code>diff.wsErrorHighlight</code> is not set, only whitespace errors in
3416 <code>new</code> lines are highlighted. The whitespace errors are colored
3417 whith <code>color.diff.whitespace</code>.
Junio C Hamano8c5d5942015-06-11 19:37:483418</p>
3419</dd>
3420<dt class="hdlist1">
Junio C Hamanod2c978f2011-03-20 19:42:223421--full-index
3422</dt>
3423<dd>
3424<p>
3425 Instead of the first handful of characters, show the full
3426 pre- and post-image blob object names on the "index"
3427 line when generating patch format output.
3428</p>
3429</dd>
3430<dt class="hdlist1">
3431--binary
3432</dt>
3433<dd>
3434<p>
Junio C Hamanoac12f0e2014-09-19 22:32:513435 In addition to <code>--full-index</code>, output a binary diff that
3436 can be applied with <code>git-apply</code>.
Junio C Hamanod2c978f2011-03-20 19:42:223437</p>
3438</dd>
3439<dt class="hdlist1">
3440--abbrev[=&lt;n&gt;]
3441</dt>
3442<dd>
3443<p>
3444 Instead of showing the full 40-byte hexadecimal object
3445 name in diff-raw format output and diff-tree header
3446 lines, show only a partial prefix. This is
Junio C Hamanoac12f0e2014-09-19 22:32:513447 independent of the <code>--full-index</code> option above, which controls
Junio C Hamanod2c978f2011-03-20 19:42:223448 the diff-patch output format. Non default number of
Junio C Hamanoac12f0e2014-09-19 22:32:513449 digits can be specified with <code>--abbrev=&lt;n&gt;</code>.
Junio C Hamanod2c978f2011-03-20 19:42:223450</p>
3451</dd>
3452<dt class="hdlist1">
3453-B[&lt;n&gt;][/&lt;m&gt;]
3454</dt>
3455<dt class="hdlist1">
3456--break-rewrites[=[&lt;n&gt;][/&lt;m&gt;]]
3457</dt>
3458<dd>
3459<p>
3460 Break complete rewrite changes into pairs of delete and
3461 create. This serves two purposes:
3462</p>
3463<div class="paragraph"><p>It affects the way a change that amounts to a total rewrite of a file
3464not as a series of deletion and insertion mixed together with a very
3465few lines that happen to match textually as the context, but as a
3466single deletion of everything old followed by a single insertion of
Junio C Hamanoac12f0e2014-09-19 22:32:513467everything new, and the number <code>m</code> controls this aspect of the -B
3468option (defaults to 60%). <code>-B/70%</code> specifies that less than 30% of the
Junio C Hamano076ffcc2013-02-06 05:13:213469original should remain in the result for Git to consider it a total
Junio C Hamanod2c978f2011-03-20 19:42:223470rewrite (i.e. otherwise the resulting patch will be a series of
3471deletion and insertion mixed together with context lines).</p></div>
3472<div class="paragraph"><p>When used with -M, a totally-rewritten file is also considered as the
3473source of a rename (usually -M only considers a file that disappeared
Junio C Hamanoac12f0e2014-09-19 22:32:513474as the source of a rename), and the number <code>n</code> controls this aspect of
3475the -B option (defaults to 50%). <code>-B20%</code> specifies that a change with
Junio C Hamanod2c978f2011-03-20 19:42:223476addition and deletion compared to 20% or more of the file&#8217;s size are
3477eligible for being picked up as a possible source of a rename to
3478another file.</p></div>
3479</dd>
3480<dt class="hdlist1">
3481-M[&lt;n&gt;]
3482</dt>
3483<dt class="hdlist1">
3484--find-renames[=&lt;n&gt;]
3485</dt>
3486<dd>
3487<p>
3488 If generating diffs, detect and report renames for each commit.
3489 For following files across renames while traversing history, see
Junio C Hamanoac12f0e2014-09-19 22:32:513490 <code>--follow</code>.
3491 If <code>n</code> is specified, it is a threshold on the similarity
Junio C Hamanod2c978f2011-03-20 19:42:223492 index (i.e. amount of addition/deletions compared to the
Junio C Hamanoac12f0e2014-09-19 22:32:513493 file&#8217;s size). For example, <code>-M90%</code> means Git should consider a
Junio C Hamanod2c978f2011-03-20 19:42:223494 delete/add pair to be a rename if more than 90% of the file
Junio C Hamanoac12f0e2014-09-19 22:32:513495 hasn&#8217;t changed. Without a <code>%</code> sign, the number is to be read as
3496 a fraction, with a decimal point before it. I.e., <code>-M5</code> becomes
3497 0.5, and is thus the same as <code>-M50%</code>. Similarly, <code>-M05</code> is
3498 the same as <code>-M5%</code>. To limit detection to exact renames, use
3499 <code>-M100%</code>. The default similarity index is 50%.
Junio C Hamanod2c978f2011-03-20 19:42:223500</p>
3501</dd>
3502<dt class="hdlist1">
3503-C[&lt;n&gt;]
3504</dt>
3505<dt class="hdlist1">
3506--find-copies[=&lt;n&gt;]
3507</dt>
3508<dd>
3509<p>
Junio C Hamanoac12f0e2014-09-19 22:32:513510 Detect copies as well as renames. See also <code>--find-copies-harder</code>.
3511 If <code>n</code> is specified, it has the same meaning as for <code>-M&lt;n&gt;</code>.
Junio C Hamanod2c978f2011-03-20 19:42:223512</p>
3513</dd>
3514<dt class="hdlist1">
3515--find-copies-harder
3516</dt>
3517<dd>
3518<p>
Junio C Hamanoac12f0e2014-09-19 22:32:513519 For performance reasons, by default, <code>-C</code> option finds copies only
Junio C Hamanod2c978f2011-03-20 19:42:223520 if the original file of the copy was modified in the same
3521 changeset. This flag makes the command
3522 inspect unmodified files as candidates for the source of
3523 copy. This is a very expensive operation for large
3524 projects, so use it with caution. Giving more than one
Junio C Hamanoac12f0e2014-09-19 22:32:513525 <code>-C</code> option has the same effect.
Junio C Hamanod2c978f2011-03-20 19:42:223526</p>
3527</dd>
3528<dt class="hdlist1">
Junio C Hamanob02377c2011-04-28 22:26:023529-D
3530</dt>
3531<dt class="hdlist1">
3532--irreversible-delete
3533</dt>
3534<dd>
3535<p>
3536 Omit the preimage for deletes, i.e. print only the header but not
Junio C Hamanoac12f0e2014-09-19 22:32:513537 the diff between the preimage and <code>/dev/null</code>. The resulting patch
3538 is not meant to be applied with <code>patch</code> or <code>git apply</code>; this is
Junio C Hamanob02377c2011-04-28 22:26:023539 solely for people who want to just concentrate on reviewing the
Junio C Hamanod16fd1b2017-08-04 16:41:513540 text after the change. In addition, the output obviously lacks
Junio C Hamanob02377c2011-04-28 22:26:023541 enough information to apply such a patch in reverse, even manually,
3542 hence the name of the option.
3543</p>
Junio C Hamanoac12f0e2014-09-19 22:32:513544<div class="paragraph"><p>When used together with <code>-B</code>, omit also the preimage in the deletion part
Junio C Hamanob02377c2011-04-28 22:26:023545of a delete/create pair.</p></div>
3546</dd>
3547<dt class="hdlist1">
Junio C Hamanod2c978f2011-03-20 19:42:223548-l&lt;num&gt;
3549</dt>
3550<dd>
3551<p>
Junio C Hamanoac12f0e2014-09-19 22:32:513552 The <code>-M</code> and <code>-C</code> options require O(n^2) processing time where n
Junio C Hamanod2c978f2011-03-20 19:42:223553 is the number of potential rename/copy targets. This
3554 option prevents rename/copy detection from running if
3555 the number of rename/copy targets exceeds the specified
3556 number.
3557</p>
3558</dd>
3559<dt class="hdlist1">
3560--diff-filter=[(A|C|D|M|R|T|U|X|B)&#8230;[*]]
3561</dt>
3562<dd>
3563<p>
Junio C Hamanoac12f0e2014-09-19 22:32:513564 Select only files that are Added (<code>A</code>), Copied (<code>C</code>),
3565 Deleted (<code>D</code>), Modified (<code>M</code>), Renamed (<code>R</code>), have their
3566 type (i.e. regular file, symlink, submodule, &#8230;) changed (<code>T</code>),
3567 are Unmerged (<code>U</code>), are
3568 Unknown (<code>X</code>), or have had their pairing Broken (<code>B</code>).
Junio C Hamanod2c978f2011-03-20 19:42:223569 Any combination of the filter characters (including none) can be used.
Junio C Hamanoac12f0e2014-09-19 22:32:513570 When <code>*</code> (All-or-none) is added to the combination, all
Junio C Hamanod2c978f2011-03-20 19:42:223571 paths are selected if there is any file that matches
3572 other criteria in the comparison; if there is no file
3573 that matches other criteria, nothing is selected.
3574</p>
Junio C Hamanoeed15af2016-07-25 22:49:423575<div class="paragraph"><p>Also, these upper-case letters can be downcased to exclude. E.g.
3576<code>--diff-filter=ad</code> excludes added and deleted paths.</p></div>
Junio C Hamano3a34f152018-01-09 23:09:383577<div class="paragraph"><p>Note that not all diffs can feature all types. For instance, diffs
3578from the index to the working tree can never have Added entries
3579(because the set of paths included in the diff is limited by what is in
3580the index). Similarly, copied and renamed entries cannot appear if
3581detection for those types is disabled.</p></div>
Junio C Hamanod2c978f2011-03-20 19:42:223582</dd>
3583<dt class="hdlist1">
3584-S&lt;string&gt;
3585</dt>
3586<dd>
3587<p>
Junio C Hamanof1f5a7b2013-06-11 22:23:523588 Look for differences that change the number of occurrences of
3589 the specified string (i.e. addition/deletion) in a file.
3590 Intended for the scripter&#8217;s use.
Junio C Hamanod2c978f2011-03-20 19:42:223591</p>
Junio C Hamanof1f5a7b2013-06-11 22:23:523592<div class="paragraph"><p>It is useful when you&#8217;re looking for an exact block of code (like a
3593struct), and want to know the history of that block since it first
3594came into being: use the feature iteratively to feed the interesting
Junio C Hamanoac12f0e2014-09-19 22:32:513595block in the preimage back into <code>-S</code>, and keep going until you get the
Junio C Hamanof1f5a7b2013-06-11 22:23:523596very first version of the block.</p></div>
Junio C Hamanod2c978f2011-03-20 19:42:223597</dd>
3598<dt class="hdlist1">
3599-G&lt;regex&gt;
3600</dt>
3601<dd>
3602<p>
Junio C Hamanof1f5a7b2013-06-11 22:23:523603 Look for differences whose patch text contains added/removed
3604 lines that match &lt;regex&gt;.
Junio C Hamanod2c978f2011-03-20 19:42:223605</p>
Junio C Hamanoac12f0e2014-09-19 22:32:513606<div class="paragraph"><p>To illustrate the difference between <code>-S&lt;regex&gt; --pickaxe-regex</code> and
3607<code>-G&lt;regex&gt;</code>, consider a commit with the following diff in the same
Junio C Hamanof1f5a7b2013-06-11 22:23:523608file:</p></div>
3609<div class="listingblock">
3610<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:513611<pre><code>+ return !regexec(regexp, two-&gt;ptr, 1, &amp;regmatch, 0);
Junio C Hamanof1f5a7b2013-06-11 22:23:523612...
Junio C Hamanoac12f0e2014-09-19 22:32:513613- hit = !regexec(regexp, mf2.ptr, 1, &amp;regmatch, 0);</code></pre>
Junio C Hamanof1f5a7b2013-06-11 22:23:523614</div></div>
Junio C Hamanoac12f0e2014-09-19 22:32:513615<div class="paragraph"><p>While <code>git log -G"regexec\(regexp"</code> will show this commit, <code>git log
3616-S"regexec\(regexp" --pickaxe-regex</code> will not (because the number of
Junio C Hamanof1f5a7b2013-06-11 22:23:523617occurrences of that string did not change).</p></div>
3618<div class="paragraph"><p>See the <em>pickaxe</em> entry in <a href="gitdiffcore.html">gitdiffcore(7)</a> for more
3619information.</p></div>
Junio C Hamanod2c978f2011-03-20 19:42:223620</dd>
3621<dt class="hdlist1">
Junio C Hamano7b9cce92018-01-23 22:34:273622--find-object=&lt;object-id&gt;
3623</dt>
3624<dd>
3625<p>
3626 Look for differences that change the number of occurrences of
3627 the specified object. Similar to <code>-S</code>, just the argument is different
3628 in that it doesn&#8217;t search for a specific string but for a specific
3629 object id.
3630</p>
3631<div class="paragraph"><p>The object can be a blob or a submodule commit. It implies the <code>-t</code> option in
3632<code>git-log</code> to also find trees.</p></div>
3633</dd>
3634<dt class="hdlist1">
Junio C Hamanod2c978f2011-03-20 19:42:223635--pickaxe-all
3636</dt>
3637<dd>
3638<p>
Junio C Hamanoac12f0e2014-09-19 22:32:513639 When <code>-S</code> or <code>-G</code> finds a change, show all the changes in that
Junio C Hamanod2c978f2011-03-20 19:42:223640 changeset, not just the files that contain the change
3641 in &lt;string&gt;.
3642</p>
3643</dd>
3644<dt class="hdlist1">
3645--pickaxe-regex
3646</dt>
3647<dd>
3648<p>
Junio C Hamanoac12f0e2014-09-19 22:32:513649 Treat the &lt;string&gt; given to <code>-S</code> as an extended POSIX regular
Junio C Hamanof1f5a7b2013-06-11 22:23:523650 expression to match.
Junio C Hamanod2c978f2011-03-20 19:42:223651</p>
3652</dd>
3653<dt class="hdlist1">
3654-O&lt;orderfile&gt;
3655</dt>
3656<dd>
3657<p>
Junio C Hamanobcd98f42017-01-24 00:12:163658 Control the order in which files appear in the output.
Junio C Hamano322c6242015-03-23 21:32:463659 This overrides the <code>diff.orderFile</code> configuration variable
3660 (see <a href="git-config.html">git-config(1)</a>). To cancel <code>diff.orderFile</code>,
Junio C Hamanoac12f0e2014-09-19 22:32:513661 use <code>-O/dev/null</code>.
Junio C Hamanod2c978f2011-03-20 19:42:223662</p>
Junio C Hamanobcd98f42017-01-24 00:12:163663<div class="paragraph"><p>The output order is determined by the order of glob patterns in
3664&lt;orderfile&gt;.
3665All files with pathnames that match the first pattern are output
3666first, all files with pathnames that match the second pattern (but not
3667the first) are output next, and so on.
3668All files with pathnames that do not match any pattern are output
3669last, as if there was an implicit match-all pattern at the end of the
3670file.
3671If multiple pathnames have the same rank (they match the same pattern
3672but no earlier patterns), their output order relative to each other is
3673the normal order.</p></div>
3674<div class="paragraph"><p>&lt;orderfile&gt; is parsed as follows:</p></div>
3675<div class="openblock">
3676<div class="content">
3677<div class="ulist"><ul>
3678<li>
3679<p>
3680Blank lines are ignored, so they can be used as separators for
3681 readability.
3682</p>
3683</li>
3684<li>
3685<p>
3686Lines starting with a hash ("<code>#</code>") are ignored, so they can be used
3687 for comments. Add a backslash ("<code>\</code>") to the beginning of the
3688 pattern if it starts with a hash.
3689</p>
3690</li>
3691<li>
3692<p>
3693Each other line contains a single pattern.
3694</p>
3695</li>
3696</ul></div>
3697</div></div>
3698<div class="paragraph"><p>Patterns have the same syntax and semantics as patterns used for
3699fnmantch(3) without the FNM_PATHNAME flag, except a pathname also
3700matches a pattern if removing any number of the final pathname
3701components matches the pattern. For example, the pattern "<code>foo*bar</code>"
3702matches "<code>fooasdfbar</code>" and "<code>foo/bar/baz/asdf</code>" but not "<code>foobarx</code>".</p></div>
Junio C Hamanod2c978f2011-03-20 19:42:223703</dd>
3704<dt class="hdlist1">
3705-R
3706</dt>
3707<dd>
3708<p>
3709 Swap two inputs; that is, show differences from index or
3710 on-disk file to tree contents.
3711</p>
3712</dd>
3713<dt class="hdlist1">
3714--relative[=&lt;path&gt;]
3715</dt>
3716<dd>
3717<p>
3718 When run from a subdirectory of the project, it can be
3719 told to exclude changes outside the directory and show
3720 pathnames relative to it with this option. When you are
3721 not in a subdirectory (e.g. in a bare repository), you
3722 can name which subdirectory to make the output relative
3723 to by giving a &lt;path&gt; as an argument.
3724</p>
3725</dd>
3726<dt class="hdlist1">
3727-a
3728</dt>
3729<dt class="hdlist1">
3730--text
3731</dt>
3732<dd>
3733<p>
3734 Treat all files as text.
3735</p>
3736</dd>
3737<dt class="hdlist1">
Junio C Hamano4886c772017-11-27 03:33:283738--ignore-cr-at-eol
3739</dt>
3740<dd>
3741<p>
3742 Ignore carrige-return at the end of line when doing a comparison.
3743</p>
3744</dd>
3745<dt class="hdlist1">
Junio C Hamanod2c978f2011-03-20 19:42:223746--ignore-space-at-eol
3747</dt>
3748<dd>
3749<p>
3750 Ignore changes in whitespace at EOL.
3751</p>
3752</dd>
3753<dt class="hdlist1">
3754-b
3755</dt>
3756<dt class="hdlist1">
3757--ignore-space-change
3758</dt>
3759<dd>
3760<p>
3761 Ignore changes in amount of whitespace. This ignores whitespace
3762 at line end, and considers all other sequences of one or
3763 more whitespace characters to be equivalent.
3764</p>
3765</dd>
3766<dt class="hdlist1">
3767-w
3768</dt>
3769<dt class="hdlist1">
3770--ignore-all-space
3771</dt>
3772<dd>
3773<p>
3774 Ignore whitespace when comparing lines. This ignores
3775 differences even if one line has whitespace where the other
3776 line has none.
3777</p>
3778</dd>
3779<dt class="hdlist1">
Junio C Hamanoa1952302013-07-01 21:31:183780--ignore-blank-lines
3781</dt>
3782<dd>
3783<p>
3784 Ignore changes whose lines are all blank.
3785</p>
3786</dd>
3787<dt class="hdlist1">
Junio C Hamanod2c978f2011-03-20 19:42:223788--inter-hunk-context=&lt;lines&gt;
3789</dt>
3790<dd>
3791<p>
3792 Show the context between diff hunks, up to the specified number
3793 of lines, thereby fusing hunks that are close to each other.
Junio C Hamanobcd98f42017-01-24 00:12:163794 Defaults to <code>diff.interHunkContext</code> or 0 if the config option
3795 is unset.
Junio C Hamanod2c978f2011-03-20 19:42:223796</p>
3797</dd>
3798<dt class="hdlist1">
Junio C Hamano11821ed2011-10-19 18:42:093799-W
3800</dt>
3801<dt class="hdlist1">
3802--function-context
3803</dt>
3804<dd>
3805<p>
3806 Show whole surrounding functions of changes.
3807</p>
3808</dd>
3809<dt class="hdlist1">
Junio C Hamanod2c978f2011-03-20 19:42:223810--ext-diff
3811</dt>
3812<dd>
3813<p>
3814 Allow an external diff helper to be executed. If you set an
Junio C Hamanoa28a9202012-06-21 07:08:233815 external diff driver with <a href="gitattributes.html">gitattributes(5)</a>, you need
3816 to use this option with <a href="git-log.html">git-log(1)</a> and friends.
Junio C Hamanod2c978f2011-03-20 19:42:223817</p>
3818</dd>
3819<dt class="hdlist1">
3820--no-ext-diff
3821</dt>
3822<dd>
3823<p>
3824 Disallow external diff drivers.
3825</p>
3826</dd>
3827<dt class="hdlist1">
Junio C Hamanoc652aed2011-07-07 01:14:313828--textconv
3829</dt>
3830<dt class="hdlist1">
3831--no-textconv
3832</dt>
3833<dd>
3834<p>
3835 Allow (or disallow) external text conversion filters to be run
Junio C Hamanoa28a9202012-06-21 07:08:233836 when comparing binary files. See <a href="gitattributes.html">gitattributes(5)</a> for
Junio C Hamanoc652aed2011-07-07 01:14:313837 details. Because textconv filters are typically a one-way
3838 conversion, the resulting diff is suitable for human
3839 consumption, but cannot be applied. For this reason, textconv
Junio C Hamanoa28a9202012-06-21 07:08:233840 filters are enabled by default only for <a href="git-diff.html">git-diff(1)</a> and
3841 <a href="git-log.html">git-log(1)</a>, but not for <a href="git-format-patch.html">git-format-patch(1)</a> or
Junio C Hamanoc652aed2011-07-07 01:14:313842 diff plumbing commands.
3843</p>
3844</dd>
3845<dt class="hdlist1">
Junio C Hamanod2c978f2011-03-20 19:42:223846--ignore-submodules[=&lt;when&gt;]
3847</dt>
3848<dd>
3849<p>
3850 Ignore changes to submodules in the diff generation. &lt;when&gt; can be
Junio C Hamanoc7102962013-05-29 23:57:173851 either "none", "untracked", "dirty" or "all", which is the default.
Junio C Hamanod2c978f2011-03-20 19:42:223852 Using "none" will consider the submodule modified when it either contains
3853 untracked or modified files or its HEAD differs from the commit recorded
3854 in the superproject and can be used to override any settings of the
Junio C Hamanoa28a9202012-06-21 07:08:233855 <em>ignore</em> option in <a href="git-config.html">git-config(1)</a> or <a href="gitmodules.html">gitmodules(5)</a>. When
Junio C Hamanod2c978f2011-03-20 19:42:223856 "untracked" is used submodules are not considered dirty when they only
3857 contain untracked content (but they are still scanned for modified
3858 content). Using "dirty" ignores all changes to the work tree of submodules,
3859 only changes to the commits stored in the superproject are shown (this was
3860 the behavior until 1.7.0). Using "all" hides all changes to submodules.
3861</p>
3862</dd>
3863<dt class="hdlist1">
3864--src-prefix=&lt;prefix&gt;
3865</dt>
3866<dd>
3867<p>
3868 Show the given source prefix instead of "a/".
3869</p>
3870</dd>
3871<dt class="hdlist1">
3872--dst-prefix=&lt;prefix&gt;
3873</dt>
3874<dd>
3875<p>
3876 Show the given destination prefix instead of "b/".
3877</p>
3878</dd>
3879<dt class="hdlist1">
3880--no-prefix
3881</dt>
3882<dd>
3883<p>
3884 Do not show any source or destination prefix.
3885</p>
3886</dd>
Junio C Hamanocd451662016-09-13 00:54:093887<dt class="hdlist1">
3888--line-prefix=&lt;prefix&gt;
3889</dt>
3890<dd>
3891<p>
3892 Prepend an additional prefix to every line of output.
3893</p>
3894</dd>
Junio C Hamanof7017f12016-10-27 23:31:343895<dt class="hdlist1">
3896--ita-invisible-in-index
3897</dt>
3898<dd>
3899<p>
3900 By default entries added by "git add -N" appear as an existing
3901 empty file in "git diff" and a new file in "git diff --cached".
3902 This option makes the entry appear as a new file in "git diff"
3903 and non-existent in "git diff --cached". This option could be
3904 reverted with <code>--ita-visible-in-index</code>. Both options are
3905 experimental and could be removed in future.
3906</p>
3907</dd>
Junio C Hamanod2c978f2011-03-20 19:42:223908</dl></div>
3909<div class="paragraph"><p>For more detailed explanation on these common options, see also
Junio C Hamanoa28a9202012-06-21 07:08:233910<a href="gitdiffcore.html">gitdiffcore(7)</a>.</p></div>
Junio C Hamanod2c978f2011-03-20 19:42:223911</div>
Junio C Hamano9629d4f2012-12-19 00:28:273912</div>
3913<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:313914<h2 id="_generating_patches_with_p">Generating patches with -p</h2>
Junio C Hamano00b8b632007-12-07 09:50:493915<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:593916<div class="paragraph"><p>When "git-diff-index", "git-diff-tree", or "git-diff-files" are run
Junio C Hamano92d80372016-07-13 22:00:053917with a <code>-p</code> option, "git diff" without the <code>--raw</code> option, or
Junio C Hamano00b8b632007-12-07 09:50:493918"git log" with the "-p" option, they
3919do not produce the output described above; instead they produce a
3920patch file. You can customize the creation of such patches via the
Junio C Hamano042f2142016-06-27 18:05:053921<code>GIT_EXTERNAL_DIFF</code> and the <code>GIT_DIFF_OPTS</code> environment variables.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:593922<div class="paragraph"><p>What the -p option produces is slightly different from the traditional
Junio C Hamano7f9fa862010-10-19 23:51:143923diff format:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:593924<div class="olist arabic"><ol class="arabic">
Junio C Hamano00b8b632007-12-07 09:50:493925<li>
3926<p>
Junio C Hamano7f9fa862010-10-19 23:51:143927It is preceded with a "git diff" header that looks like this:
Junio C Hamano00b8b632007-12-07 09:50:493928</p>
3929<div class="literalblock">
3930<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:513931<pre><code>diff --git a/file1 b/file2</code></pre>
Junio C Hamano00b8b632007-12-07 09:50:493932</div></div>
Junio C Hamanoac12f0e2014-09-19 22:32:513933<div class="paragraph"><p>The <code>a/</code> and <code>b/</code> filenames are the same unless rename/copy is
Junio C Hamano00b8b632007-12-07 09:50:493934involved. Especially, even for a creation or a deletion,
Junio C Hamanoac12f0e2014-09-19 22:32:513935<code>/dev/null</code> is <em>not</em> used in place of the <code>a/</code> or <code>b/</code> filenames.</p></div>
3936<div class="paragraph"><p>When rename/copy is involved, <code>file1</code> and <code>file2</code> show the
Junio C Hamano00b8b632007-12-07 09:50:493937name of the source file of the rename/copy and the name of
Junio C Hamanoba4b9282008-07-06 05:20:313938the file that rename/copy produces, respectively.</p></div>
Junio C Hamano00b8b632007-12-07 09:50:493939</li>
3940<li>
3941<p>
3942It is followed by one or more extended header lines:
3943</p>
3944<div class="literalblock">
3945<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:513946<pre><code>old mode &lt;mode&gt;
Junio C Hamano00b8b632007-12-07 09:50:493947new mode &lt;mode&gt;
3948deleted file mode &lt;mode&gt;
3949new file mode &lt;mode&gt;
3950copy from &lt;path&gt;
3951copy to &lt;path&gt;
3952rename from &lt;path&gt;
3953rename to &lt;path&gt;
3954similarity index &lt;number&gt;
3955dissimilarity index &lt;number&gt;
Junio C Hamanoac12f0e2014-09-19 22:32:513956index &lt;hash&gt;..&lt;hash&gt; &lt;mode&gt;</code></pre>
Junio C Hamano00b8b632007-12-07 09:50:493957</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:593958<div class="paragraph"><p>File modes are printed as 6-digit octal numbers including the file type
Junio C Hamano7f9fa862010-10-19 23:51:143959and file permission bits.</p></div>
Junio C Hamanoac12f0e2014-09-19 22:32:513960<div class="paragraph"><p>Path names in extended headers do not include the <code>a/</code> and <code>b/</code> prefixes.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:593961<div class="paragraph"><p>The similarity index is the percentage of unchanged lines, and
Junio C Hamano7f9fa862010-10-19 23:51:143962the dissimilarity index is the percentage of changed lines. It
3963is a rounded down integer, followed by a percent sign. The
3964similarity index value of 100% is thus reserved for two equal
3965files, while 100% dissimilarity means that no line from the old
3966file made it into the new one.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:593967<div class="paragraph"><p>The index line includes the SHA-1 checksum before and after the change.
Junio C Hamano7f9fa862010-10-19 23:51:143968The &lt;mode&gt; is included if the file mode does not change; otherwise,
3969separate lines indicate the old and the new mode.</p></div>
Junio C Hamano00b8b632007-12-07 09:50:493970</li>
3971<li>
3972<p>
Junio C Hamano0f6f3bf2017-03-13 07:01:533973Pathnames with "unusual" characters are quoted as explained for
3974 the configuration variable <code>core.quotePath</code> (see
3975 <a href="git-config.html">git-config(1)</a>).
Junio C Hamano00b8b632007-12-07 09:50:493976</p>
3977</li>
Junio C Hamano7f9fa862010-10-19 23:51:143978<li>
3979<p>
Junio C Hamanoac12f0e2014-09-19 22:32:513980All the <code>file1</code> files in the output refer to files before the
3981 commit, and all the <code>file2</code> files refer to files after the commit.
Junio C Hamano7f9fa862010-10-19 23:51:143982 It is incorrect to apply each change to each file sequentially. For
3983 example, this patch will swap a and b:
3984</p>
3985<div class="literalblock">
3986<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:513987<pre><code>diff --git a/a b/b
Junio C Hamano7f9fa862010-10-19 23:51:143988rename from a
3989rename to b
3990diff --git a/b b/a
3991rename from b
Junio C Hamanoac12f0e2014-09-19 22:32:513992rename to a</code></pre>
Junio C Hamano7f9fa862010-10-19 23:51:143993</div></div>
3994</li>
Junio C Hamanoba4b9282008-07-06 05:20:313995</ol></div>
Junio C Hamano00b8b632007-12-07 09:50:493996</div>
Junio C Hamano9629d4f2012-12-19 00:28:273997</div>
3998<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:313999<h2 id="_combined_diff_format">combined diff format</h2>
Junio C Hamano00b8b632007-12-07 09:50:494000<div class="sectionbody">
Junio C Hamano1dbca522015-05-22 20:48:554001<div class="paragraph"><p>Any diff-generating command can take the <code>-c</code> or <code>--cc</code> option to
Junio C Hamanoc5be4cc2011-03-09 07:20:434002produce a <em>combined diff</em> when showing a merge. This is the default
Junio C Hamanoa28a9202012-06-21 07:08:234003format when showing merges with <a href="git-diff.html">git-diff(1)</a> or
Junio C Hamano1dbca522015-05-22 20:48:554004<a href="git-show.html">git-show(1)</a>. Note also that you can give the <code>-m</code> option to any
Junio C Hamanoc5be4cc2011-03-09 07:20:434005of these commands to force generation of diffs with individual parents
4006of a merge.</p></div>
4007<div class="paragraph"><p>A <em>combined diff</em> format looks like this:</p></div>
Junio C Hamano00b8b632007-12-07 09:50:494008<div class="listingblock">
4009<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:514010<pre><code>diff --combined describe.c
Junio C Hamano00b8b632007-12-07 09:50:494011index fabadb8,cc95eb0..4866510
4012--- a/describe.c
4013+++ b/describe.c
4014@@@ -98,20 -98,12 +98,20 @@@
4015 return (a_date &gt; b_date) ? -1 : (a_date == b_date) ? 0 : 1;
4016 }
4017
4018- static void describe(char *arg)
4019 -static void describe(struct commit *cmit, int last_one)
4020++static void describe(char *arg, int last_one)
4021 {
4022 + unsigned char sha1[20];
4023 + struct commit *cmit;
4024 struct commit_list *list;
4025 static int initialized = 0;
4026 struct commit_name *n;
4027
4028 + if (get_sha1(arg, sha1) &lt; 0)
4029 + usage(describe_usage);
4030 + cmit = lookup_commit_reference(sha1);
4031 + if (!cmit)
4032 + usage(describe_usage);
4033 +
4034 if (!initialized) {
4035 initialized = 1;
Junio C Hamanoac12f0e2014-09-19 22:32:514036 for_each_ref(get_name);</code></pre>
Junio C Hamano00b8b632007-12-07 09:50:494037</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:594038<div class="olist arabic"><ol class="arabic">
Junio C Hamano00b8b632007-12-07 09:50:494039<li>
4040<p>
4041It is preceded with a "git diff" header, that looks like
Junio C Hamano92d80372016-07-13 22:00:054042 this (when <code>-c</code> option is used):
Junio C Hamano00b8b632007-12-07 09:50:494043</p>
4044<div class="literalblock">
4045<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:514046<pre><code>diff --combined file</code></pre>
Junio C Hamano00b8b632007-12-07 09:50:494047</div></div>
Junio C Hamano92d80372016-07-13 22:00:054048<div class="paragraph"><p>or like this (when <code>--cc</code> option is used):</p></div>
Junio C Hamano00b8b632007-12-07 09:50:494049<div class="literalblock">
4050<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:514051<pre><code>diff --cc file</code></pre>
Junio C Hamano00b8b632007-12-07 09:50:494052</div></div>
4053</li>
4054<li>
4055<p>
4056It is followed by one or more extended header lines
4057 (this example shows a merge with two parents):
4058</p>
4059<div class="literalblock">
4060<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:514061<pre><code>index &lt;hash&gt;,&lt;hash&gt;..&lt;hash&gt;
Junio C Hamano00b8b632007-12-07 09:50:494062mode &lt;mode&gt;,&lt;mode&gt;..&lt;mode&gt;
4063new file mode &lt;mode&gt;
Junio C Hamanoac12f0e2014-09-19 22:32:514064deleted file mode &lt;mode&gt;,&lt;mode&gt;</code></pre>
Junio C Hamano00b8b632007-12-07 09:50:494065</div></div>
Junio C Hamanoac12f0e2014-09-19 22:32:514066<div class="paragraph"><p>The <code>mode &lt;mode&gt;,&lt;mode&gt;..&lt;mode&gt;</code> line appears only if at least one of
Junio C Hamano00b8b632007-12-07 09:50:494067the &lt;mode&gt; is different from the rest. Extended headers with
4068information about detected contents movement (renames and
4069copying detection) are designed to work with diff of two
Junio C Hamanoba4b9282008-07-06 05:20:314070&lt;tree-ish&gt; and are not used by combined diff format.</p></div>
Junio C Hamano00b8b632007-12-07 09:50:494071</li>
4072<li>
4073<p>
4074It is followed by two-line from-file/to-file header
4075</p>
4076<div class="literalblock">
4077<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:514078<pre><code>--- a/file
4079+++ b/file</code></pre>
Junio C Hamano00b8b632007-12-07 09:50:494080</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:594081<div class="paragraph"><p>Similar to two-line header for traditional <em>unified</em> diff
Junio C Hamanoac12f0e2014-09-19 22:32:514082format, <code>/dev/null</code> is used to signal created or deleted
Junio C Hamanoba4b9282008-07-06 05:20:314083files.</p></div>
Junio C Hamano00b8b632007-12-07 09:50:494084</li>
4085<li>
4086<p>
4087Chunk header format is modified to prevent people from
Junio C Hamanoac12f0e2014-09-19 22:32:514088 accidentally feeding it to <code>patch -p1</code>. Combined diff format
Junio C Hamano00b8b632007-12-07 09:50:494089 was created for review of merge commit changes, and was not
4090 meant for apply. The change is similar to the change in the
4091 extended <em>index</em> header:
4092</p>
4093<div class="literalblock">
4094<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:514095<pre><code>@@@ &lt;from-file-range&gt; &lt;from-file-range&gt; &lt;to-file-range&gt; @@@</code></pre>
Junio C Hamano00b8b632007-12-07 09:50:494096</div></div>
Junio C Hamanoac12f0e2014-09-19 22:32:514097<div class="paragraph"><p>There are (number of parents + 1) <code>@</code> characters in the chunk
Junio C Hamanoba4b9282008-07-06 05:20:314098header for combined diff format.</p></div>
Junio C Hamano00b8b632007-12-07 09:50:494099</li>
Junio C Hamanoba4b9282008-07-06 05:20:314100</ol></div>
Junio C Hamano68cf15a2010-11-06 01:01:594101<div class="paragraph"><p>Unlike the traditional <em>unified</em> diff format, which shows two
Junio C Hamanoac12f0e2014-09-19 22:32:514102files A and B with a single column that has <code>-</code> (minus&#8201;&#8212;&#8201;appears in A but removed in B), <code>+</code> (plus&#8201;&#8212;&#8201;missing in A but
4103added to B), or <code>" "</code> (space&#8201;&#8212;&#8201;unchanged) prefix, this format
Junio C Hamano00b8b632007-12-07 09:50:494104compares two or more files file1, file2,&#8230; with one file X, and
4105shows how X differs from each of fileN. One column for each of
Junio C Hamano68cf15a2010-11-06 01:01:594106fileN is prepended to the output line to note how X&#8217;s line is
Junio C Hamanoba4b9282008-07-06 05:20:314107different from it.</p></div>
Junio C Hamanoac12f0e2014-09-19 22:32:514108<div class="paragraph"><p>A <code>-</code> character in the column N means that the line appears in
4109fileN but it does not appear in the result. A <code>+</code> character
Junio C Hamano54bf1e22008-12-20 06:30:114110in the column N means that the line appears in the result,
Junio C Hamano00b8b632007-12-07 09:50:494111and fileN does not have that line (in other words, the line was
Junio C Hamanoba4b9282008-07-06 05:20:314112added, from the point of view of that parent).</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:594113<div class="paragraph"><p>In the above example output, the function signature was changed
Junio C Hamanoac12f0e2014-09-19 22:32:514114from both files (hence two <code>-</code> removals from both file1 and
4115file2, plus <code>++</code> to mean one line that was added does not appear
Junio C Hamanod75148a2014-04-08 19:48:384116in either file1 or file2). Also eight other lines are the same
Junio C Hamanoac12f0e2014-09-19 22:32:514117from file1 but do not appear in file2 (hence prefixed with <code>+</code>).</p></div>
4118<div class="paragraph"><p>When shown by <code>git diff-tree -c</code>, it compares the parents of a
Junio C Hamano00b8b632007-12-07 09:50:494119merge commit with the merge result (i.e. file1..fileN are the
Junio C Hamanoac12f0e2014-09-19 22:32:514120parents). When shown by <code>git diff-files -c</code>, it compares the
Junio C Hamano00b8b632007-12-07 09:50:494121two unresolved merge parents with the working tree file
4122(i.e. file1 is stage 2 aka "our version", file2 is stage 3 aka
Junio C Hamanoba4b9282008-07-06 05:20:314123"their version").</p></div>
Junio C Hamano00b8b632007-12-07 09:50:494124</div>
Junio C Hamano9629d4f2012-12-19 00:28:274125</div>
4126<div class="sect1">
Junio C Hamano58f587a2013-07-22 19:20:594127<h2 id="_examples">EXAMPLES</h2>
Junio C Hamano1a4e8412005-12-27 08:17:234128<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:594129<div class="dlist"><dl>
4130<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:514131<code>git log --no-merges</code>
Junio C Hamano1a4e8412005-12-27 08:17:234132</dt>
4133<dd>
4134<p>
4135 Show the whole commit history, but skip any merges
4136</p>
4137</dd>
Junio C Hamano68cf15a2010-11-06 01:01:594138<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:514139<code>git log v2.6.12.. include/scsi drivers/scsi</code>
Junio C Hamano1a4e8412005-12-27 08:17:234140</dt>
4141<dd>
4142<p>
4143 Show all commits since version <em>v2.6.12</em> that changed any file
Junio C Hamanoac12f0e2014-09-19 22:32:514144 in the <code>include/scsi</code> or <code>drivers/scsi</code> subdirectories
Junio C Hamano1a4e8412005-12-27 08:17:234145</p>
4146</dd>
Junio C Hamano68cf15a2010-11-06 01:01:594147<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:514148<code>git log --since="2 weeks ago" -- gitk</code>
Junio C Hamano1a4e8412005-12-27 08:17:234149</dt>
4150<dd>
4151<p>
4152 Show the changes during the last two weeks to the file <em>gitk</em>.
Junio C Hamanob73af6c2013-12-03 22:07:114153 The &#8220;--&#8221; is necessary to avoid confusion with the <strong>branch</strong> named
Junio C Hamano1a4e8412005-12-27 08:17:234154 <em>gitk</em>
4155</p>
4156</dd>
Junio C Hamano68cf15a2010-11-06 01:01:594157<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:514158<code>git log --name-status release..test</code>
Junio C Hamanoba7c8d82006-04-15 06:17:424159</dt>
4160<dd>
4161<p>
4162 Show the commits that are in the "test" branch but not yet
4163 in the "release" branch, along with the list of paths
4164 each commit modifies.
4165</p>
4166</dd>
Junio C Hamano68cf15a2010-11-06 01:01:594167<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:514168<code>git log --follow builtin/rev-list.c</code>
Junio C Hamano235d53f2007-07-13 00:25:154169</dt>
4170<dd>
4171<p>
Junio C Hamanoac12f0e2014-09-19 22:32:514172 Shows the commits that changed <code>builtin/rev-list.c</code>, including
Junio C Hamano235d53f2007-07-13 00:25:154173 those commits that occurred before the file was given its
4174 present name.
4175</p>
4176</dd>
Junio C Hamano68cf15a2010-11-06 01:01:594177<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:514178<code>git log --branches --not --remotes=origin</code>
Junio C Hamano57827fb2010-01-23 03:02:504179</dt>
4180<dd>
4181<p>
4182 Shows all commits that are in any of local branches but not in
Junio C Hamano97bcb482010-11-25 03:16:074183 any of remote-tracking branches for <em>origin</em> (what you have that
Junio C Hamano68cf15a2010-11-06 01:01:594184 origin doesn&#8217;t).
Junio C Hamano57827fb2010-01-23 03:02:504185</p>
4186</dd>
Junio C Hamano68cf15a2010-11-06 01:01:594187<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:514188<code>git log master --not --remotes=*/master</code>
Junio C Hamano57827fb2010-01-23 03:02:504189</dt>
4190<dd>
4191<p>
4192 Shows all commits that are in local master but not in any remote
4193 repository master branches.
4194</p>
4195</dd>
Junio C Hamano68cf15a2010-11-06 01:01:594196<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:514197<code>git log -p -m --first-parent</code>
Junio C Hamano31667362010-03-25 00:38:534198</dt>
4199<dd>
4200<p>
4201 Shows the history including change diffs, but only from the
Junio C Hamanob73af6c2013-12-03 22:07:114202 &#8220;main branch&#8221; perspective, skipping commits that come from merged
Junio C Hamano31667362010-03-25 00:38:534203 branches, and showing full diffs of changes introduced by the merges.
4204 This makes sense only when following a strict policy of merging all
4205 topic branches when staying on a single integration branch.
4206</p>
4207</dd>
Junio C Hamano693e7092012-09-12 22:56:534208<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:514209<code>git log -L '/int main/',/^}/:main.c</code>
Junio C Hamano7e590a12013-06-02 23:46:524210</dt>
4211<dd>
4212<p>
Junio C Hamanoac12f0e2014-09-19 22:32:514213 Shows how the function <code>main()</code> in the file <code>main.c</code> evolved
Junio C Hamano7e590a12013-06-02 23:46:524214 over time.
4215</p>
4216</dd>
4217<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:514218<code>git log -3</code>
Junio C Hamano693e7092012-09-12 22:56:534219</dt>
4220<dd>
4221<p>
4222 Limits the number of commits to show to 3.
4223</p>
4224</dd>
Junio C Hamanoba4b9282008-07-06 05:20:314225</dl></div>
Junio C Hamano1a4e8412005-12-27 08:17:234226</div>
Junio C Hamano9629d4f2012-12-19 00:28:274227</div>
4228<div class="sect1">
Junio C Hamano58f587a2013-07-22 19:20:594229<h2 id="_discussion">DISCUSSION</h2>
Junio C Hamano775a0f42006-12-31 01:19:144230<div class="sectionbody">
Junio C Hamanod7ed4042015-08-03 19:43:004231<div class="paragraph"><p>Git is to some extent character encoding agnostic.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:594232<div class="ulist"><ul>
Junio C Hamano775a0f42006-12-31 01:19:144233<li>
4234<p>
Junio C Hamano54bf1e22008-12-20 06:30:114235The contents of the blob objects are uninterpreted sequences
Junio C Hamano775a0f42006-12-31 01:19:144236 of bytes. There is no encoding translation at the core
4237 level.
4238</p>
4239</li>
4240<li>
4241<p>
Junio C Hamanod7ed4042015-08-03 19:43:004242Path names are encoded in UTF-8 normalization form C. This
4243 applies to tree objects, the index file, ref names, as well as
4244 path names in command line arguments, environment variables
4245 and config files (<code>.git/config</code> (see <a href="git-config.html">git-config(1)</a>),
4246 <a href="gitignore.html">gitignore(5)</a>, <a href="gitattributes.html">gitattributes(5)</a> and
4247 <a href="gitmodules.html">gitmodules(5)</a>).
4248</p>
4249<div class="paragraph"><p>Note that Git at the core level treats path names simply as
4250sequences of non-NUL bytes, there are no path name encoding
4251conversions (except on Mac and Windows). Therefore, using
4252non-ASCII path names will mostly work even on platforms and file
4253systems that use legacy extended ASCII encodings. However,
4254repositories created on such systems will not work properly on
4255UTF-8-based systems (e.g. Linux, Mac, Windows) and vice versa.
4256Additionally, many Git-based tools simply assume path names to
4257be UTF-8 and will fail to display other encodings correctly.</p></div>
4258</li>
4259<li>
4260<p>
4261Commit log messages are typically encoded in UTF-8, but other
4262 extended ASCII encodings are also supported. This includes
4263 ISO-8859-x, CP125x and many others, but <em>not</em> UTF-16/32,
4264 EBCDIC and CJK multi-byte encodings (GBK, Shift-JIS, Big5,
4265 EUC-x, CP9xx etc.).
Junio C Hamano775a0f42006-12-31 01:19:144266</p>
4267</li>
Junio C Hamanoba4b9282008-07-06 05:20:314268</ul></div>
Junio C Hamano68cf15a2010-11-06 01:01:594269<div class="paragraph"><p>Although we encourage that the commit log messages are encoded
Junio C Hamano076ffcc2013-02-06 05:13:214270in UTF-8, both the core and Git Porcelain are designed not to
Junio C Hamano775a0f42006-12-31 01:19:144271force UTF-8 on projects. If all participants of a particular
Junio C Hamano076ffcc2013-02-06 05:13:214272project find it more convenient to use legacy encodings, Git
Junio C Hamano775a0f42006-12-31 01:19:144273does not forbid it. However, there are a few things to keep in
Junio C Hamanoba4b9282008-07-06 05:20:314274mind.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:594275<div class="olist arabic"><ol class="arabic">
Junio C Hamano775a0f42006-12-31 01:19:144276<li>
4277<p>
Junio C Hamano1aa40d22010-01-21 17:46:434278<em>git commit</em> and <em>git commit-tree</em> issues
Junio C Hamano14b76482008-01-05 10:32:264279 a warning if the commit log message given to it does not look
Junio C Hamano775a0f42006-12-31 01:19:144280 like a valid UTF-8 string, unless you explicitly say your
4281 project uses a legacy encoding. The way to say this is to
Junio C Hamanoac12f0e2014-09-19 22:32:514282 have i18n.commitencoding in <code>.git/config</code> file, like this:
Junio C Hamano775a0f42006-12-31 01:19:144283</p>
4284<div class="listingblock">
4285<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:514286<pre><code>[i18n]
Junio C Hamanobb34c102017-07-21 22:42:284287 commitEncoding = ISO-8859-1</code></pre>
Junio C Hamano775a0f42006-12-31 01:19:144288</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:594289<div class="paragraph"><p>Commit objects created with the above setting record the value
Junio C Hamanobb34c102017-07-21 22:42:284290of <code>i18n.commitEncoding</code> in its <code>encoding</code> header. This is to
Junio C Hamano775a0f42006-12-31 01:19:144291help other people who look at them later. Lack of this header
Junio C Hamanoba4b9282008-07-06 05:20:314292implies that the commit log message is encoded in UTF-8.</p></div>
Junio C Hamano775a0f42006-12-31 01:19:144293</li>
4294<li>
4295<p>
Junio C Hamano1aa40d22010-01-21 17:46:434296<em>git log</em>, <em>git show</em>, <em>git blame</em> and friends look at the
Junio C Hamanoac12f0e2014-09-19 22:32:514297 <code>encoding</code> header of a commit object, and try to re-code the
Junio C Hamanoaa17c7c2008-11-03 04:36:584298 log message into UTF-8 unless otherwise specified. You can
Junio C Hamano775a0f42006-12-31 01:19:144299 specify the desired output encoding with
Junio C Hamanobb34c102017-07-21 22:42:284300 <code>i18n.logOutputEncoding</code> in <code>.git/config</code> file, like this:
Junio C Hamano775a0f42006-12-31 01:19:144301</p>
4302<div class="listingblock">
4303<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:514304<pre><code>[i18n]
Junio C Hamanobb34c102017-07-21 22:42:284305 logOutputEncoding = ISO-8859-1</code></pre>
Junio C Hamano775a0f42006-12-31 01:19:144306</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:594307<div class="paragraph"><p>If you do not have this configuration variable, the value of
Junio C Hamanobb34c102017-07-21 22:42:284308<code>i18n.commitEncoding</code> is used instead.</p></div>
Junio C Hamano775a0f42006-12-31 01:19:144309</li>
Junio C Hamanoba4b9282008-07-06 05:20:314310</ol></div>
Junio C Hamano68cf15a2010-11-06 01:01:594311<div class="paragraph"><p>Note that we deliberately chose not to re-code the commit log
Junio C Hamano775a0f42006-12-31 01:19:144312message when a commit is made to force UTF-8 at the commit
4313object level, because re-coding to UTF-8 is not necessarily a
Junio C Hamanoba4b9282008-07-06 05:20:314314reversible operation.</p></div>
Junio C Hamano775a0f42006-12-31 01:19:144315</div>
Junio C Hamano9629d4f2012-12-19 00:28:274316</div>
4317<div class="sect1">
Junio C Hamano58f587a2013-07-22 19:20:594318<h2 id="_configuration">CONFIGURATION</h2>
Junio C Hamanoa574a092010-06-13 19:57:104319<div class="sectionbody">
Junio C Hamanoa28a9202012-06-21 07:08:234320<div class="paragraph"><p>See <a href="git-config.html">git-config(1)</a> for core variables and <a href="git-diff.html">git-diff(1)</a>
Junio C Hamanoa574a092010-06-13 19:57:104321for settings related to diff generation.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:594322<div class="dlist"><dl>
4323<dt class="hdlist1">
Junio C Hamanoa574a092010-06-13 19:57:104324format.pretty
4325</dt>
4326<dd>
4327<p>
Junio C Hamanoac12f0e2014-09-19 22:32:514328 Default for the <code>--format</code> option. (See <em>Pretty Formats</em> above.)
4329 Defaults to <code>medium</code>.
Junio C Hamanoa574a092010-06-13 19:57:104330</p>
4331</dd>
Junio C Hamano68cf15a2010-11-06 01:01:594332<dt class="hdlist1">
Junio C Hamanoa574a092010-06-13 19:57:104333i18n.logOutputEncoding
4334</dt>
4335<dd>
4336<p>
Junio C Hamanob73af6c2013-12-03 22:07:114337 Encoding to use when displaying logs. (See <em>Discussion</em> above.)
Junio C Hamanoac12f0e2014-09-19 22:32:514338 Defaults to the value of <code>i18n.commitEncoding</code> if set, and UTF-8
Junio C Hamanoa574a092010-06-13 19:57:104339 otherwise.
4340</p>
4341</dd>
Junio C Hamano68cf15a2010-11-06 01:01:594342<dt class="hdlist1">
Junio C Hamanoa574a092010-06-13 19:57:104343log.date
4344</dt>
4345<dd>
4346<p>
4347 Default format for human-readable dates. (Compare the
Junio C Hamanoac12f0e2014-09-19 22:32:514348 <code>--date</code> option.) Defaults to "default", which means to write
4349 dates like <code>Sat May 8 19:35:34 2010 -0500</code>.
Junio C Hamanoa574a092010-06-13 19:57:104350</p>
4351</dd>
Junio C Hamano68cf15a2010-11-06 01:01:594352<dt class="hdlist1">
Junio C Hamanod7ed4042015-08-03 19:43:004353log.follow
4354</dt>
4355<dd>
4356<p>
Junio C Hamanob0a1e832015-10-15 23:08:314357 If <code>true</code>, <code>git log</code> will act as if the <code>--follow</code> option was used when
4358 a single &lt;path&gt; is given. This has the same limitations as <code>--follow</code>,
4359 i.e. it cannot be used to follow multiple files and does not work well
4360 on non-linear history.
Junio C Hamanod7ed4042015-08-03 19:43:004361</p>
4362</dd>
4363<dt class="hdlist1">
Junio C Hamano322c6242015-03-23 21:32:464364log.showRoot
Junio C Hamanoa574a092010-06-13 19:57:104365</dt>
4366<dd>
4367<p>
Junio C Hamanoac12f0e2014-09-19 22:32:514368 If <code>false</code>, <code>git log</code> and related commands will not treat the
Junio C Hamanoa574a092010-06-13 19:57:104369 initial commit as a big creation event. Any root commits in
Junio C Hamanoac12f0e2014-09-19 22:32:514370 <code>git log -p</code> output would be shown without a diff attached.
4371 The default is <code>true</code>.
Junio C Hamanoa574a092010-06-13 19:57:104372</p>
4373</dd>
Junio C Hamano68cf15a2010-11-06 01:01:594374<dt class="hdlist1">
Junio C Hamano48931e22016-07-11 20:08:474375log.showSignature
4376</dt>
4377<dd>
4378<p>
4379 If <code>true</code>, <code>git log</code> and related commands will act as if the
4380 <code>--show-signature</code> option was passed to them.
4381</p>
4382</dd>
4383<dt class="hdlist1">
Junio C Hamanoabad6da2013-01-06 09:06:324384mailmap.*
Junio C Hamanoa574a092010-06-13 19:57:104385</dt>
4386<dd>
4387<p>
Junio C Hamanoa28a9202012-06-21 07:08:234388 See <a href="git-shortlog.html">git-shortlog(1)</a>.
Junio C Hamanoa574a092010-06-13 19:57:104389</p>
4390</dd>
Junio C Hamano68cf15a2010-11-06 01:01:594391<dt class="hdlist1">
Junio C Hamanoa574a092010-06-13 19:57:104392notes.displayRef
4393</dt>
4394<dd>
4395<p>
Junio C Hamanoac12f0e2014-09-19 22:32:514396 Which refs, in addition to the default set by <code>core.notesRef</code>
Junio C Hamano042f2142016-06-27 18:05:054397 or <code>GIT_NOTES_REF</code>, to read notes from when showing commit
Junio C Hamanoac12f0e2014-09-19 22:32:514398 messages with the <code>log</code> family of commands. See
Junio C Hamanoa28a9202012-06-21 07:08:234399 <a href="git-notes.html">git-notes(1)</a>.
Junio C Hamanoa574a092010-06-13 19:57:104400</p>
Junio C Hamano68cf15a2010-11-06 01:01:594401<div class="paragraph"><p>May be an unabbreviated ref name or a glob and may be specified
Junio C Hamanoa574a092010-06-13 19:57:104402multiple times. A warning will be issued for refs that do not exist,
4403but a glob that does not match any refs is silently ignored.</p></div>
Junio C Hamanoac12f0e2014-09-19 22:32:514404<div class="paragraph"><p>This setting can be disabled by the <code>--no-notes</code> option,
Junio C Hamano042f2142016-06-27 18:05:054405overridden by the <code>GIT_NOTES_DISPLAY_REF</code> environment variable,
Junio C Hamanoac12f0e2014-09-19 22:32:514406and overridden by the <code>--notes=&lt;ref&gt;</code> option.</p></div>
Junio C Hamanoa574a092010-06-13 19:57:104407</dd>
4408</dl></div>
4409</div>
Junio C Hamano9629d4f2012-12-19 00:28:274410</div>
4411<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:314412<h2 id="_git">GIT</h2>
Junio C Hamano1a4e8412005-12-27 08:17:234413<div class="sectionbody">
Junio C Hamanoa28a9202012-06-21 07:08:234414<div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:234415</div>
Junio C Hamano7bd050f2011-09-22 06:32:224416</div>
Junio C Hamano9629d4f2012-12-19 00:28:274417</div>
Junio C Hamano7bd050f2011-09-22 06:32:224418<div id="footnotes"><hr /></div>
Junio C Hamano1a4e8412005-12-27 08:17:234419<div id="footer">
4420<div id="footer-text">
Junio C Hamano2ef0ba32018-01-26 23:13:534421Last updated
4422 2018-01-26 15:11:04 PST
Junio C Hamano1a4e8412005-12-27 08:17:234423</div>
4424</div>
4425</body>
4426</html>