blob: 919ae25fa8fc27ce944742afd7c42582a4ef3b9c [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 Hamano78e3a782010-07-15 22:24:45783--decorate[=short|full|no]
784</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
790 full ref name (including prefix) will be printed. The default option
791 is <em>short</em>.
792</p>
793</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59794<dt class="hdlist1">
Junio C Hamano78e3a782010-07-15 22:24:45795--source
796</dt>
797<dd>
798<p>
799 Print out the ref name given on the command line by which each
800 commit was reached.
801</p>
802</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59803<dt class="hdlist1">
Junio C Hamanoce836cc2013-01-21 02:01:53804--use-mailmap
805</dt>
806<dd>
807<p>
808 Use mailmap file to map author and committer names and email
Junio C Hamanob73af6c2013-12-03 22:07:11809 addresses to canonical real names and email addresses. See
Junio C Hamanoce836cc2013-01-21 02:01:53810 <a href="git-shortlog.html">git-shortlog(1)</a>.
811</p>
812</dd>
813<dt class="hdlist1">
Junio C Hamano78e3a782010-07-15 22:24:45814--full-diff
815</dt>
816<dd>
817<p>
Junio C Hamanoac12f0e2014-09-19 22:32:51818 Without this flag, <code>git log -p &lt;path&gt;...</code> shows commits that
Junio C Hamano78e3a782010-07-15 22:24:45819 touch the specified paths, and diffs about the same specified
820 paths. With this, the full diff is shown for commits that touch
821 the specified paths; this means that "&lt;path&gt;&#8230;" limits only
Junio C Hamano68cf15a2010-11-06 01:01:59822 commits, and doesn&#8217;t limit diff for those commits.
Junio C Hamano78e3a782010-07-15 22:24:45823</p>
Junio C Hamano68cf15a2010-11-06 01:01:59824<div class="paragraph"><p>Note that this affects all diff-based output types, e.g. those
Junio C Hamanoac12f0e2014-09-19 22:32:51825produced by <code>--stat</code>, etc.</p></div>
Junio C Hamano78e3a782010-07-15 22:24:45826</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59827<dt class="hdlist1">
Junio C Hamano78e3a782010-07-15 22:24:45828--log-size
829</dt>
830<dd>
831<p>
Junio C Hamanob73af6c2013-12-03 22:07:11832 Include a line &#8220;log size &lt;number&gt;&#8221; in the output for each commit,
833 where &lt;number&gt; is the length of that commit&#8217;s message in bytes.
Junio C Hamanoac12f0e2014-09-19 22:32:51834 Intended to speed up tools that read log messages from <code>git log</code>
Junio C Hamanob73af6c2013-12-03 22:07:11835 output by allowing them to allocate space in advance.
Junio C Hamano78e3a782010-07-15 22:24:45836</p>
837</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59838<dt class="hdlist1">
Junio C Hamano8eac2682013-09-09 22:35:20839-L &lt;start&gt;,&lt;end&gt;:&lt;file&gt;
840</dt>
841<dt class="hdlist1">
Junio C Hamanodd5004a2015-05-06 19:33:32842-L :&lt;funcname&gt;:&lt;file&gt;
Junio C Hamano7e590a12013-06-02 23:46:52843</dt>
844<dd>
845<p>
846 Trace the evolution of the line range given by "&lt;start&gt;,&lt;end&gt;"
Junio C Hamanodd5004a2015-05-06 19:33:32847 (or the function name regex &lt;funcname&gt;) within the &lt;file&gt;. You may
Junio C Hamano7e590a12013-06-02 23:46:52848 not give any pathspec limiters. This is currently limited to
849 a walk starting from a single revision, i.e., you may only
850 give zero or one positive revision arguments.
851 You can specify this option more than once.
852</p>
853<div class="paragraph"><p>&lt;start&gt; and &lt;end&gt; can take one of these forms:</p></div>
854<div class="ulist"><ul>
855<li>
856<p>
857number
858</p>
859<div class="paragraph"><p>If &lt;start&gt; or &lt;end&gt; is a number, it specifies an
860absolute line number (lines count from 1).</p></div>
861</li>
862<li>
863<p>
864/regex/
865</p>
866<div class="paragraph"><p>This form will use the first line matching the given
Junio C Hamano8eac2682013-09-09 22:35:20867POSIX regex. If &lt;start&gt; is a regex, it will search from the end of
Junio C Hamanoac12f0e2014-09-19 22:32:51868the previous <code>-L</code> range, if any, otherwise from the start of file.
Junio C Hamano8eac2682013-09-09 22:35:20869If &lt;start&gt; is &#8220;^/regex/&#8221;, it will search from the start of file.
870If &lt;end&gt; is a regex, it will search
Junio C Hamano7e590a12013-06-02 23:46:52871starting at the line given by &lt;start&gt;.</p></div>
872</li>
873<li>
874<p>
875+offset or -offset
876</p>
877<div class="paragraph"><p>This is only valid for &lt;end&gt; and will specify a number
878of lines before or after the line given by &lt;start&gt;.</p></div>
879</li>
Junio C Hamano7e590a12013-06-02 23:46:52880</ul></div>
Junio C Hamanodd5004a2015-05-06 19:33:32881<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
882regular expression that denotes the range from the first funcname line
883that matches &lt;funcname&gt;, up to the next funcname line. &#8220;:&lt;funcname&gt;&#8221;
884searches from the end of the previous <code>-L</code> range, if any, otherwise
885from the start of file. &#8220;^:&lt;funcname&gt;&#8221; searches from the start of
886file.</p></div>
Junio C Hamano7e590a12013-06-02 23:46:52887</dd>
888<dt class="hdlist1">
Junio C Hamanof26c77e2013-04-27 00:06:04889&lt;revision range&gt;
890</dt>
891<dd>
892<p>
893 Show only commits in the specified revision range. When no
Junio C Hamanoac12f0e2014-09-19 22:32:51894 &lt;revision range&gt; is specified, it defaults to <code>HEAD</code> (i.e. the
895 whole history leading to the current commit). <code>origin..HEAD</code>
Junio C Hamanof26c77e2013-04-27 00:06:04896 specifies all the commits reachable from the current commit
Junio C Hamanoac12f0e2014-09-19 22:32:51897 (i.e. <code>HEAD</code>), but not from <code>origin</code>. For a complete list of
Junio C Hamanob73af6c2013-12-03 22:07:11898 ways to spell &lt;revision range&gt;, see the <em>Specifying Ranges</em>
Junio C Hamanof26c77e2013-04-27 00:06:04899 section of <a href="gitrevisions.html">gitrevisions(7)</a>.
900</p>
901</dd>
902<dt class="hdlist1">
Junio C Hamano78e3a782010-07-15 22:24:45903[--] &lt;path&gt;&#8230;
904</dt>
905<dd>
906<p>
Junio C Hamano5723afa2011-08-31 00:49:23907 Show only commits that are enough to explain how the files
Junio C Hamanob73af6c2013-12-03 22:07:11908 that match the specified paths came to be. See <em>History
909 Simplification</em> below for details and other simplification
Junio C Hamano5723afa2011-08-31 00:49:23910 modes.
Junio C Hamano78e3a782010-07-15 22:24:45911</p>
Junio C Hamanob73af6c2013-12-03 22:07:11912<div class="paragraph"><p>Paths may need to be prefixed with &#8216;`-- '&#8217; to separate them from
Junio C Hamanof26c77e2013-04-27 00:06:04913options or the revision range, when confusion arises.</p></div>
Junio C Hamano78e3a782010-07-15 22:24:45914</dd>
915</dl></div>
Junio C Hamano9629d4f2012-12-19 00:28:27916<div class="sect2">
917<h3 id="_commit_limiting">Commit Limiting</h3>
Junio C Hamano68cf15a2010-11-06 01:01:59918<div class="paragraph"><p>Besides specifying a range of commits that should be listed using the
Junio C Hamanob0e02952008-01-19 08:02:00919special notations explained in the description, additional commit
Junio C Hamano8ce35d72012-09-18 22:30:42920limiting may be applied.</p></div>
921<div class="paragraph"><p>Using more options generally further limits the output (e.g.
Junio C Hamanoac12f0e2014-09-19 22:32:51922<code>--since=&lt;date1&gt;</code> limits to commits newer than <code>&lt;date1&gt;</code>, and using it
923with <code>--grep=&lt;pattern&gt;</code> further limits to commits whose log message
924has a line that matches <code>&lt;pattern&gt;</code>), unless otherwise noted.</p></div>
Junio C Hamano8ce35d72012-09-18 22:30:42925<div class="paragraph"><p>Note that these are applied before commit
Junio C Hamanoac12f0e2014-09-19 22:32:51926ordering and formatting options, such as <code>--reverse</code>.</p></div>
Junio C Hamano9629d4f2012-12-19 00:28:27927<div class="openblock">
928<div class="content">
Junio C Hamano68cf15a2010-11-06 01:01:59929<div class="dlist"><dl>
930<dt class="hdlist1">
Junio C Hamano693e7092012-09-12 22:56:53931-&lt;number&gt;
932</dt>
933<dt class="hdlist1">
934-n &lt;number&gt;
Junio C Hamanoeb415992008-06-08 22:49:47935</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59936<dt class="hdlist1">
Junio C Hamanob4a9ede2009-04-08 07:36:32937--max-count=&lt;number&gt;
Junio C Hamanob0e02952008-01-19 08:02:00938</dt>
939<dd>
940<p>
Junio C Hamanoc5be4cc2011-03-09 07:20:43941 Limit the number of commits to output.
Junio C Hamanob0e02952008-01-19 08:02:00942</p>
943</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59944<dt class="hdlist1">
Junio C Hamanob4a9ede2009-04-08 07:36:32945--skip=&lt;number&gt;
Junio C Hamanob0e02952008-01-19 08:02:00946</dt>
947<dd>
948<p>
949 Skip <em>number</em> commits before starting to show the commit output.
950</p>
951</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59952<dt class="hdlist1">
Junio C Hamanob4a9ede2009-04-08 07:36:32953--since=&lt;date&gt;
Junio C Hamanoeb415992008-06-08 22:49:47954</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59955<dt class="hdlist1">
Junio C Hamanob4a9ede2009-04-08 07:36:32956--after=&lt;date&gt;
Junio C Hamanob0e02952008-01-19 08:02:00957</dt>
958<dd>
959<p>
960 Show commits more recent than a specific date.
961</p>
962</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59963<dt class="hdlist1">
Junio C Hamanob4a9ede2009-04-08 07:36:32964--until=&lt;date&gt;
Junio C Hamanoeb415992008-06-08 22:49:47965</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59966<dt class="hdlist1">
Junio C Hamanob4a9ede2009-04-08 07:36:32967--before=&lt;date&gt;
Junio C Hamanob0e02952008-01-19 08:02:00968</dt>
969<dd>
970<p>
971 Show commits older than a specific date.
972</p>
973</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59974<dt class="hdlist1">
Junio C Hamanob4a9ede2009-04-08 07:36:32975--author=&lt;pattern&gt;
Junio C Hamanoeb415992008-06-08 22:49:47976</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59977<dt class="hdlist1">
Junio C Hamanob4a9ede2009-04-08 07:36:32978--committer=&lt;pattern&gt;
Junio C Hamanob0e02952008-01-19 08:02:00979</dt>
980<dd>
981<p>
982 Limit the commits output to ones with author/committer
Junio C Hamano8ce35d72012-09-18 22:30:42983 header lines that match the specified pattern (regular
Junio C Hamanoac12f0e2014-09-19 22:32:51984 expression). With more than one <code>--author=&lt;pattern&gt;</code>,
Junio C Hamano8ce35d72012-09-18 22:30:42985 commits whose author matches any of the given patterns are
Junio C Hamanoac12f0e2014-09-19 22:32:51986 chosen (similarly for multiple <code>--committer=&lt;pattern&gt;</code>).
Junio C Hamanob0e02952008-01-19 08:02:00987</p>
988</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59989<dt class="hdlist1">
Junio C Hamano9954ed72012-10-03 04:54:00990--grep-reflog=&lt;pattern&gt;
991</dt>
992<dd>
993<p>
994 Limit the commits output to ones with reflog entries that
995 match the specified pattern (regular expression). With
Junio C Hamanoac12f0e2014-09-19 22:32:51996 more than one <code>--grep-reflog</code>, commits whose reflog message
Junio C Hamano9954ed72012-10-03 04:54:00997 matches any of the given patterns are chosen. It is an
Junio C Hamanoac12f0e2014-09-19 22:32:51998 error to use this option unless <code>--walk-reflogs</code> is in use.
Junio C Hamano9954ed72012-10-03 04:54:00999</p>
1000</dd>
1001<dt class="hdlist1">
Junio C Hamanob4a9ede2009-04-08 07:36:321002--grep=&lt;pattern&gt;
Junio C Hamanob0e02952008-01-19 08:02:001003</dt>
1004<dd>
1005<p>
1006 Limit the commits output to ones with log message that
Junio C Hamano8ce35d72012-09-18 22:30:421007 matches the specified pattern (regular expression). With
Junio C Hamanoac12f0e2014-09-19 22:32:511008 more than one <code>--grep=&lt;pattern&gt;</code>, commits whose message
Junio C Hamano8ce35d72012-09-18 22:30:421009 matches any of the given patterns are chosen (but see
Junio C Hamanoac12f0e2014-09-19 22:32:511010 <code>--all-match</code>).
Junio C Hamanob0e02952008-01-19 08:02:001011</p>
Junio C Hamano8152abf2015-04-28 22:48:021012<div class="paragraph"><p>When <code>--show-notes</code> is in effect, the message from the notes is
1013matched as if it were part of the log message.</p></div>
Junio C Hamanob0e02952008-01-19 08:02:001014</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591015<dt class="hdlist1">
Junio C Hamanoaa17c7c2008-11-03 04:36:581016--all-match
1017</dt>
1018<dd>
1019<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511020 Limit the commits output to ones that match all given <code>--grep</code>,
Junio C Hamano8ce35d72012-09-18 22:30:421021 instead of ones that match at least one.
Junio C Hamanoaa17c7c2008-11-03 04:36:581022</p>
1023</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591024<dt class="hdlist1">
Junio C Hamano6bb32e62015-02-17 22:11:261025--invert-grep
1026</dt>
1027<dd>
1028<p>
1029 Limit the commits output to ones with log message that do not
1030 match the pattern specified with <code>--grep=&lt;pattern&gt;</code>.
1031</p>
1032</dd>
1033<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471034-i
1035</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591036<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471037--regexp-ignore-case
Junio C Hamanob0e02952008-01-19 08:02:001038</dt>
1039<dd>
1040<p>
Junio C Hamanob73af6c2013-12-03 22:07:111041 Match the regular expression limiting patterns without regard to letter
1042 case.
Junio C Hamanob0e02952008-01-19 08:02:001043</p>
1044</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591045<dt class="hdlist1">
Junio C Hamanoa1295452012-11-13 22:32:041046--basic-regexp
1047</dt>
1048<dd>
1049<p>
1050 Consider the limiting patterns to be basic regular expressions;
1051 this is the default.
1052</p>
1053</dd>
1054<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471055-E
1056</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591057<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471058--extended-regexp
Junio C Hamanob0e02952008-01-19 08:02:001059</dt>
1060<dd>
1061<p>
1062 Consider the limiting patterns to be extended regular expressions
1063 instead of the default basic regular expressions.
1064</p>
1065</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591066<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471067-F
1068</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591069<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471070--fixed-strings
Junio C Hamano24bc09a2008-02-28 00:27:441071</dt>
1072<dd>
1073<p>
Junio C Hamano68cf15a2010-11-06 01:01:591074 Consider the limiting patterns to be fixed strings (don&#8217;t interpret
Junio C Hamano24bc09a2008-02-28 00:27:441075 pattern as a regular expression).
1076</p>
1077</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591078<dt class="hdlist1">
Junio C Hamanoa1295452012-11-13 22:32:041079--perl-regexp
1080</dt>
1081<dd>
1082<p>
Junio C Hamanob73af6c2013-12-03 22:07:111083 Consider the limiting patterns to be Perl-compatible regular expressions.
Junio C Hamanoa1295452012-11-13 22:32:041084 Requires libpcre to be compiled in.
1085</p>
1086</dd>
1087<dt class="hdlist1">
Junio C Hamanob0e02952008-01-19 08:02:001088--remove-empty
1089</dt>
1090<dd>
1091<p>
1092 Stop when a given path disappears from the tree.
1093</p>
1094</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591095<dt class="hdlist1">
Junio C Hamano934e1782009-07-16 06:59:151096--merges
1097</dt>
1098<dd>
1099<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511100 Print only merge commits. This is exactly the same as <code>--min-parents=2</code>.
Junio C Hamano934e1782009-07-16 06:59:151101</p>
1102</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591103<dt class="hdlist1">
Junio C Hamanob0e02952008-01-19 08:02:001104--no-merges
1105</dt>
1106<dd>
1107<p>
Junio C Hamanof32ce262011-03-27 07:35:111108 Do not print commits with more than one parent. This is
Junio C Hamanoac12f0e2014-09-19 22:32:511109 exactly the same as <code>--max-parents=1</code>.
Junio C Hamanob0e02952008-01-19 08:02:001110</p>
1111</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591112<dt class="hdlist1">
Junio C Hamanof32ce262011-03-27 07:35:111113--min-parents=&lt;number&gt;
1114</dt>
1115<dt class="hdlist1">
1116--max-parents=&lt;number&gt;
1117</dt>
1118<dt class="hdlist1">
1119--no-min-parents
1120</dt>
1121<dt class="hdlist1">
1122--no-max-parents
1123</dt>
1124<dd>
1125<p>
Junio C Hamanoc5bb3b32013-08-05 22:43:361126 Show only commits which have at least (or at most) that many parent
Junio C Hamanoac12f0e2014-09-19 22:32:511127 commits. In particular, <code>--max-parents=1</code> is the same as <code>--no-merges</code>,
1128 <code>--min-parents=2</code> is the same as <code>--merges</code>. <code>--max-parents=0</code>
1129 gives all root commits and <code>--min-parents=3</code> all octopus merges.
Junio C Hamanof32ce262011-03-27 07:35:111130</p>
Junio C Hamanoac12f0e2014-09-19 22:32:511131<div class="paragraph"><p><code>--no-min-parents</code> and <code>--no-max-parents</code> reset these limits (to no limit)
1132again. Equivalent forms are <code>--min-parents=0</code> (any commit has 0 or more
1133parents) and <code>--max-parents=-1</code> (negative numbers denote no upper limit).</p></div>
Junio C Hamanof32ce262011-03-27 07:35:111134</dd>
1135<dt class="hdlist1">
Junio C Hamanob0e02952008-01-19 08:02:001136--first-parent
1137</dt>
1138<dd>
1139<p>
1140 Follow only the first parent commit upon seeing a merge
1141 commit. This option can give a better overview when
1142 viewing the evolution of a particular topic branch,
1143 because merges into a topic branch tend to be only about
1144 adjusting to updated upstream from time to time, and
1145 this option allows you to ignore the individual commits
Junio C Hamanoef57d1e2015-03-25 21:23:001146 brought in to your history by such a merge. Cannot be
1147 combined with --bisect.
Junio C Hamanob0e02952008-01-19 08:02:001148</p>
1149</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591150<dt class="hdlist1">
Junio C Hamanob0e02952008-01-19 08:02:001151--not
1152</dt>
1153<dd>
1154<p>
1155 Reverses the meaning of the <em>&#94;</em> prefix (or lack thereof)
Junio C Hamanoac12f0e2014-09-19 22:32:511156 for all following revision specifiers, up to the next <code>--not</code>.
Junio C Hamanob0e02952008-01-19 08:02:001157</p>
1158</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591159<dt class="hdlist1">
Junio C Hamanob0e02952008-01-19 08:02:001160--all
1161</dt>
1162<dd>
1163<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511164 Pretend as if all the refs in <code>refs/</code> are listed on the
Junio C Hamanob0e02952008-01-19 08:02:001165 command line as <em>&lt;commit&gt;</em>.
1166</p>
1167</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591168<dt class="hdlist1">
Junio C Hamanod2179ef2010-10-22 04:12:171169--branches[=&lt;pattern&gt;]
Junio C Hamano50819852008-11-19 02:07:561170</dt>
1171<dd>
1172<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511173 Pretend as if all the refs in <code>refs/heads</code> are listed
Junio C Hamanod2179ef2010-10-22 04:12:171174 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:501175 branches to ones matching given shell glob. If pattern lacks <em>?</em>,
Junio C Hamano81d540a2012-03-02 19:52:471176 <em>&#42;</em>, or <em>[</em>, <em>/&#42;</em> at the end is implied.
Junio C Hamano50819852008-11-19 02:07:561177</p>
1178</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591179<dt class="hdlist1">
Junio C Hamanod2179ef2010-10-22 04:12:171180--tags[=&lt;pattern&gt;]
Junio C Hamano50819852008-11-19 02:07:561181</dt>
1182<dd>
1183<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511184 Pretend as if all the refs in <code>refs/tags</code> are listed
Junio C Hamanod2179ef2010-10-22 04:12:171185 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:471186 tags to ones matching given shell glob. If pattern lacks <em>?</em>, <em>&#42;</em>,
1187 or <em>[</em>, <em>/&#42;</em> at the end is implied.
Junio C Hamano50819852008-11-19 02:07:561188</p>
1189</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591190<dt class="hdlist1">
Junio C Hamanod2179ef2010-10-22 04:12:171191--remotes[=&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/remotes</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 Hamano97bcb482010-11-25 03:16:071197 remote-tracking branches to ones matching given shell glob.
Junio C Hamano81d540a2012-03-02 19:52:471198 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:501199</p>
1200</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591201<dt class="hdlist1">
Junio C Hamanod2179ef2010-10-22 04:12:171202--glob=&lt;glob-pattern&gt;
Junio C Hamano57827fb2010-01-23 03:02:501203</dt>
1204<dd>
1205<p>
Junio C Hamanod2179ef2010-10-22 04:12:171206 Pretend as if all the refs matching shell glob <em>&lt;glob-pattern&gt;</em>
Junio C Hamano57827fb2010-01-23 03:02:501207 are listed on the command line as <em>&lt;commit&gt;</em>. Leading <em>refs/</em>,
Junio C Hamano81d540a2012-03-02 19:52:471208 is automatically prepended if missing. 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 Hamanof079f702013-12-06 23:43:181213--exclude=&lt;glob-pattern&gt;
1214</dt>
1215<dd>
1216<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511217 Do not include refs matching <em>&lt;glob-pattern&gt;</em> that the next <code>--all</code>,
1218 <code>--branches</code>, <code>--tags</code>, <code>--remotes</code>, or <code>--glob</code> would otherwise
Junio C Hamanof079f702013-12-06 23:43:181219 consider. Repetitions of this option accumulate exclusion patterns
Junio C Hamanoac12f0e2014-09-19 22:32:511220 up to the next <code>--all</code>, <code>--branches</code>, <code>--tags</code>, <code>--remotes</code>, or
1221 <code>--glob</code> option (other options or arguments do not clear
Junio C Hamanofb5ffde2014-11-04 22:38:561222 accumulated patterns).
Junio C Hamanof079f702013-12-06 23:43:181223</p>
Junio C Hamanoac12f0e2014-09-19 22:32:511224<div class="paragraph"><p>The patterns given should not begin with <code>refs/heads</code>, <code>refs/tags</code>, or
1225<code>refs/remotes</code> when applied to <code>--branches</code>, <code>--tags</code>, or <code>--remotes</code>,
1226respectively, and they must begin with <code>refs/</code> when applied to <code>--glob</code>
1227or <code>--all</code>. If a trailing <em>/&#42;</em> is intended, it must be given
Junio C Hamanof079f702013-12-06 23:43:181228explicitly.</p></div>
1229</dd>
1230<dt class="hdlist1">
Junio C Hamano2a4bcbc2014-10-29 20:07:391231--reflog
1232</dt>
1233<dd>
1234<p>
1235 Pretend as if all objects mentioned by reflogs are listed on the
1236 command line as <code>&lt;commit&gt;</code>.
1237</p>
1238</dd>
1239<dt class="hdlist1">
Junio C Hamano084228c2011-05-30 08:13:521240--ignore-missing
1241</dt>
1242<dd>
1243<p>
1244 Upon seeing an invalid object name in the input, pretend as if
1245 the bad input was not given.
1246</p>
1247</dd>
1248<dt class="hdlist1">
Junio C Hamano5706e0b2009-11-24 10:54:161249--bisect
1250</dt>
1251<dd>
1252<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511253 Pretend as if the bad bisection ref <code>refs/bisect/bad</code>
1254 was listed and as if it was followed by <code>--not</code> and the good
1255 bisection refs <code>refs/bisect/good-*</code> on the command
Junio C Hamanoef57d1e2015-03-25 21:23:001256 line. Cannot be combined with --first-parent.
Junio C Hamano5706e0b2009-11-24 10:54:161257</p>
1258</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591259<dt class="hdlist1">
Junio C Hamano5706e0b2009-11-24 10:54:161260--stdin
1261</dt>
1262<dd>
1263<p>
1264 In addition to the <em>&lt;commit&gt;</em> listed on the command
1265 line, read them from the standard input. If a <em>--</em> separator is
1266 seen, stop reading commits and start reading paths to limit the
1267 result.
1268</p>
1269</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591270<dt class="hdlist1">
Junio C Hamano9a2fb2d2011-03-23 05:40:151271--cherry-mark
1272</dt>
1273<dd>
1274<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511275 Like <code>--cherry-pick</code> (see below) but mark equivalent commits
1276 with <code>=</code> rather than omitting them, and inequivalent ones with <code>+</code>.
Junio C Hamano9a2fb2d2011-03-23 05:40:151277</p>
1278</dd>
1279<dt class="hdlist1">
Junio C Hamanob0e02952008-01-19 08:02:001280--cherry-pick
1281</dt>
1282<dd>
1283<p>
1284 Omit any commit that introduces the same change as
Junio C Hamanob73af6c2013-12-03 22:07:111285 another commit on the &#8220;other side&#8221; when the set of
Junio C Hamano68cf15a2010-11-06 01:01:591286 commits are limited with symmetric difference.
1287</p>
Junio C Hamanoac12f0e2014-09-19 22:32:511288<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:001289to list all commits on only one side of them is with
Junio C Hamanoac12f0e2014-09-19 22:32:511290<code>--left-right</code> (see the example below in the description of
1291the <code>--left-right</code> option). However, it shows the commits that were
Junio C Hamanob73af6c2013-12-03 22:07:111292cherry-picked from the other branch (for example, &#8220;3rd on b&#8221; may be
1293cherry-picked from branch A). With this option, such pairs of commits are
Junio C Hamano68cf15a2010-11-06 01:01:591294excluded from the output.</p></div>
Junio C Hamanob0e02952008-01-19 08:02:001295</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591296<dt class="hdlist1">
Junio C Hamano9a2fb2d2011-03-23 05:40:151297--left-only
1298</dt>
1299<dt class="hdlist1">
1300--right-only
1301</dt>
1302<dd>
1303<p>
1304 List only commits on the respective side of a symmetric range,
Junio C Hamanoac12f0e2014-09-19 22:32:511305 i.e. only those which would be marked <code>&lt;</code> resp. <code>&gt;</code> by
1306 <code>--left-right</code>.
Junio C Hamano9a2fb2d2011-03-23 05:40:151307</p>
Junio C Hamanoac12f0e2014-09-19 22:32:511308<div class="paragraph"><p>For example, <code>--cherry-pick --right-only A...B</code> omits those
1309commits from <code>B</code> which are in <code>A</code> or are patch-equivalent to a commit in
1310<code>A</code>. In other words, this lists the <code>+</code> commits from <code>git cherry A B</code>.
1311More precisely, <code>--cherry-pick --right-only --no-merges</code> gives the exact
Junio C Hamano9a2fb2d2011-03-23 05:40:151312list.</p></div>
1313</dd>
1314<dt class="hdlist1">
1315--cherry
1316</dt>
1317<dd>
1318<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511319 A synonym for <code>--right-only --cherry-mark --no-merges</code>; useful to
Junio C Hamano9a2fb2d2011-03-23 05:40:151320 limit the output to the commits on our side and mark those that
1321 have been applied to the other side of a forked history with
Junio C Hamanoac12f0e2014-09-19 22:32:511322 <code>git log --cherry upstream...mybranch</code>, similar to
1323 <code>git cherry upstream mybranch</code>.
Junio C Hamano9a2fb2d2011-03-23 05:40:151324</p>
1325</dd>
1326<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471327-g
1328</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591329<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471330--walk-reflogs
Junio C Hamanob0e02952008-01-19 08:02:001331</dt>
1332<dd>
1333<p>
1334 Instead of walking the commit ancestry chain, walk
1335 reflog entries from the most recent one to older ones.
1336 When this option is used you cannot specify commits to
1337 exclude (that is, <em>&#94;commit</em>, <em>commit1..commit2</em>,
Junio C Hamanod75148a2014-04-08 19:48:381338 and <em>commit1...commit2</em> notations cannot be used).
Junio C Hamano68cf15a2010-11-06 01:01:591339</p>
Junio C Hamanoac12f0e2014-09-19 22:32:511340<div class="paragraph"><p>With <code>--pretty</code> format other than <code>oneline</code> (for obvious reasons),
Junio C Hamanob0e02952008-01-19 08:02:001341this causes the output to have two extra lines of information
1342taken from the reflog. By default, <em>commit@{Nth}</em> notation is
1343used in the output. When the starting commit is specified as
Junio C Hamano1d368882008-08-11 22:03:101344<em>commit@{now}</em>, output also uses <em>commit@{timestamp}</em> notation
Junio C Hamanoac12f0e2014-09-19 22:32:511345instead. Under <code>--pretty=oneline</code>, the commit message is
Junio C Hamanob0e02952008-01-19 08:02:001346prefixed with this information on the same line.
Junio C Hamanoac12f0e2014-09-19 22:32:511347This option cannot be combined with <code>--reverse</code>.
Junio C Hamanoa28a9202012-06-21 07:08:231348See also <a href="git-reflog.html">git-reflog(1)</a>.</p></div>
Junio C Hamanob0e02952008-01-19 08:02:001349</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591350<dt class="hdlist1">
Junio C Hamanob0e02952008-01-19 08:02:001351--merge
1352</dt>
1353<dd>
1354<p>
1355 After a failed merge, show refs that touch files having a
Junio C Hamano68cf15a2010-11-06 01:01:591356 conflict and don&#8217;t exist on all heads to merge.
Junio C Hamanob0e02952008-01-19 08:02:001357</p>
1358</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591359<dt class="hdlist1">
Junio C Hamanob0e02952008-01-19 08:02:001360--boundary
1361</dt>
1362<dd>
1363<p>
Junio C Hamano27159f82013-06-14 17:19:221364 Output excluded boundary commits. Boundary commits are
Junio C Hamanoac12f0e2014-09-19 22:32:511365 prefixed with <code>-</code>.
Junio C Hamanob0e02952008-01-19 08:02:001366</p>
1367</dd>
Junio C Hamanoa76cb0d2008-08-13 20:04:101368</dl></div>
Junio C Hamano9629d4f2012-12-19 00:28:271369</div></div>
1370</div>
1371<div class="sect2">
1372<h3 id="_history_simplification">History Simplification</h3>
Junio C Hamano68cf15a2010-11-06 01:01:591373<div class="paragraph"><p>Sometimes you are only interested in parts of the history, for example the
Junio C Hamano28363492008-11-14 08:26:311374commits modifying a particular &lt;path&gt;. But there are two parts of
1375<em>History Simplification</em>, one part is selecting the commits and the other
1376is how to do it, as there are various strategies to simplify the history.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591377<div class="paragraph"><p>The following options select the commits to be shown:</p></div>
1378<div class="dlist"><dl>
1379<dt class="hdlist1">
Junio C Hamano28363492008-11-14 08:26:311380&lt;paths&gt;
1381</dt>
1382<dd>
1383<p>
1384 Commits modifying the given &lt;paths&gt; are selected.
1385</p>
1386</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591387<dt class="hdlist1">
Junio C Hamano28363492008-11-14 08:26:311388--simplify-by-decoration
1389</dt>
1390<dd>
1391<p>
1392 Commits that are referred by some branch or tag are selected.
1393</p>
1394</dd>
1395</dl></div>
Junio C Hamano68cf15a2010-11-06 01:01:591396<div class="paragraph"><p>Note that extra commits can be shown to give a meaningful history.</p></div>
1397<div class="paragraph"><p>The following options affect the way the simplification is performed:</p></div>
1398<div class="dlist"><dl>
1399<dt class="hdlist1">
Junio C Hamano28363492008-11-14 08:26:311400Default mode
1401</dt>
1402<dd>
1403<p>
1404 Simplifies the history to the simplest history explaining the
1405 final state of the tree. Simplest because it prunes some side
1406 branches if the end result is the same (i.e. merging branches
1407 with the same content)
1408</p>
1409</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591410<dt class="hdlist1">
Junio C Hamano28363492008-11-14 08:26:311411--full-history
1412</dt>
1413<dd>
1414<p>
Junio C Hamano15567bc2011-07-23 00:51:591415 Same as the default mode, but does not prune some history.
Junio C Hamano28363492008-11-14 08:26:311416</p>
1417</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591418<dt class="hdlist1">
Junio C Hamano28363492008-11-14 08:26:311419--dense
1420</dt>
1421<dd>
1422<p>
1423 Only the selected commits are shown, plus some to have a
1424 meaningful history.
1425</p>
1426</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591427<dt class="hdlist1">
Junio C Hamano28363492008-11-14 08:26:311428--sparse
1429</dt>
1430<dd>
1431<p>
1432 All commits in the simplified history are shown.
1433</p>
1434</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591435<dt class="hdlist1">
Junio C Hamano28363492008-11-14 08:26:311436--simplify-merges
1437</dt>
1438<dd>
1439<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511440 Additional option to <code>--full-history</code> to remove some needless
Junio C Hamano28363492008-11-14 08:26:311441 merges from the resulting history, as there are no selected
1442 commits contributing to this merge.
1443</p>
1444</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591445<dt class="hdlist1">
Junio C Hamano89a57342010-06-22 23:22:551446--ancestry-path
1447</dt>
1448<dd>
1449<p>
1450 When given a range of commits to display (e.g. <em>commit1..commit2</em>
1451 or <em>commit2 &#94;commit1</em>), only display commits that exist
1452 directly on the ancestry chain between the <em>commit1</em> and
1453 <em>commit2</em>, i.e. commits that are both descendants of <em>commit1</em>,
1454 and ancestors of <em>commit2</em>.
1455</p>
1456</dd>
Junio C Hamano28363492008-11-14 08:26:311457</dl></div>
Junio C Hamano68cf15a2010-11-06 01:01:591458<div class="paragraph"><p>A more detailed explanation follows.</p></div>
Junio C Hamanoac12f0e2014-09-19 22:32:511459<div class="paragraph"><p>Suppose you specified <code>foo</code> as the &lt;paths&gt;. We shall call commits
1460that modify <code>foo</code> !TREESAME, and the rest TREESAME. (In a diff
1461filtered for <code>foo</code>, they look different and equal, respectively.)</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591462<div class="paragraph"><p>In the following, we will always refer to the same example history to
Junio C Hamanoa76cb0d2008-08-13 20:04:101463illustrate the differences between simplification settings. We assume
Junio C Hamanoac12f0e2014-09-19 22:32:511464that you are filtering for a file <code>foo</code> in this commit graph:</p></div>
Junio C Hamanoa76cb0d2008-08-13 20:04:101465<div class="listingblock">
1466<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:511467<pre><code> .-A---M---N---O---P---Q
Junio C Hamano27159f82013-06-14 17:19:221468 / / / / / /
1469 I B C D E Y
1470 \ / / / / /
Junio C Hamanoac12f0e2014-09-19 22:32:511471 `-------------' X</code></pre>
Junio C Hamanoa76cb0d2008-08-13 20:04:101472</div></div>
Junio C Hamano27159f82013-06-14 17:19:221473<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:101474each merge. The commits are:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591475<div class="ulist"><ul>
Junio C Hamanoa76cb0d2008-08-13 20:04:101476<li>
1477<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511478<code>I</code> is the initial commit, in which <code>foo</code> exists with contents
1479 &#8220;asdf&#8221;, and a file <code>quux</code> exists with contents &#8220;quux&#8221;. Initial
1480 commits are compared to an empty tree, so <code>I</code> is !TREESAME.
Junio C Hamanoa76cb0d2008-08-13 20:04:101481</p>
1482</li>
1483<li>
1484<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511485In <code>A</code>, <code>foo</code> contains just &#8220;foo&#8221;.
Junio C Hamanoa76cb0d2008-08-13 20:04:101486</p>
1487</li>
1488<li>
1489<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511490<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:101491 hence TREESAME to all parents.
1492</p>
1493</li>
1494<li>
1495<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511496<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:101497 so it is not TREESAME to any parent.
1498</p>
1499</li>
1500<li>
1501<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511502<code>D</code> sets <code>foo</code> to &#8220;baz&#8221;. Its merge <code>O</code> combines the strings from
1503 <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:101504</p>
1505</li>
1506<li>
1507<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511508<code>E</code> changes <code>quux</code> to &#8220;xyzzy&#8221;, and its merge <code>P</code> combines the
1509 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:221510</p>
1511</li>
1512<li>
1513<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511514<code>X</code> is an independent root commit that added a new file <code>side</code>, and <code>Y</code>
1515 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
1516 <code>Q</code> is TREESAME to <code>P</code>, but not to <code>Y</code>.
Junio C Hamanoa76cb0d2008-08-13 20:04:101517</p>
1518</li>
1519</ul></div>
Junio C Hamanoac12f0e2014-09-19 22:32:511520<div class="paragraph"><p><code>rev-list</code> walks backwards through history, including or excluding
1521commits based on whether <code>--full-history</code> and/or parent rewriting
1522(via <code>--parents</code> or <code>--children</code>) are used. The following settings
Junio C Hamanoa76cb0d2008-08-13 20:04:101523are available.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591524<div class="dlist"><dl>
1525<dt class="hdlist1">
Junio C Hamanoa76cb0d2008-08-13 20:04:101526Default mode
1527</dt>
1528<dd>
1529<p>
1530 Commits are included if they are not TREESAME to any parent
Junio C Hamanoac12f0e2014-09-19 22:32:511531 (though this can be changed, see <code>--sparse</code> below). If the
Junio C Hamanoa76cb0d2008-08-13 20:04:101532 commit was a merge, and it was TREESAME to one parent, follow
1533 only that parent. (Even if there are several TREESAME
1534 parents, follow only one of them.) Otherwise, follow all
1535 parents.
1536</p>
Junio C Hamano68cf15a2010-11-06 01:01:591537<div class="paragraph"><p>This results in:</p></div>
Junio C Hamanoa76cb0d2008-08-13 20:04:101538<div class="listingblock">
1539<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:511540<pre><code> .-A---N---O
Junio C Hamano89a57342010-06-22 23:22:551541 / / /
Junio C Hamanoac12f0e2014-09-19 22:32:511542 I---------D</code></pre>
Junio C Hamanoa76cb0d2008-08-13 20:04:101543</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591544<div class="paragraph"><p>Note how the rule to only follow the TREESAME parent, if one is
Junio C Hamanoac12f0e2014-09-19 22:32:511545available, removed <code>B</code> from consideration entirely. <code>C</code> was
1546considered via <code>N</code>, but is TREESAME. Root commits are compared to an
1547empty tree, so <code>I</code> is !TREESAME.</p></div>
1548<div class="paragraph"><p>Parent/child relations are only visible with <code>--parents</code>, but that does
Junio C Hamanoa76cb0d2008-08-13 20:04:101549not affect the commits selected in default mode, so we have shown the
1550parent lines.</p></div>
1551</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591552<dt class="hdlist1">
Junio C Hamanoa76cb0d2008-08-13 20:04:101553--full-history without parent rewriting
1554</dt>
1555<dd>
1556<p>
1557 This mode differs from the default in one point: always follow
1558 all parents of a merge, even if it is TREESAME to one of them.
1559 Even if more than one side of the merge has commits that are
1560 included, this does not imply that the merge itself is! In
1561 the example, we get
1562</p>
1563<div class="listingblock">
1564<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:511565<pre><code> I A B N D O P Q</code></pre>
Junio C Hamanoa76cb0d2008-08-13 20:04:101566</div></div>
Junio C Hamanoac12f0e2014-09-19 22:32:511567<div class="paragraph"><p><code>M</code> was excluded because it is TREESAME to both parents. <code>E</code>,
1568<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:101569do not appear.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591570<div class="paragraph"><p>Note that without parent rewriting, it is not really possible to talk
Junio C Hamanoa76cb0d2008-08-13 20:04:101571about the parent/child relationships between the commits, so we show
1572them disconnected.</p></div>
1573</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591574<dt class="hdlist1">
Junio C Hamanoa76cb0d2008-08-13 20:04:101575--full-history with parent rewriting
1576</dt>
1577<dd>
1578<p>
1579 Ordinary commits are only included if they are !TREESAME
Junio C Hamanoac12f0e2014-09-19 22:32:511580 (though this can be changed, see <code>--sparse</code> below).
Junio C Hamanoa76cb0d2008-08-13 20:04:101581</p>
Junio C Hamano68cf15a2010-11-06 01:01:591582<div class="paragraph"><p>Merges are always included. However, their parent list is rewritten:
Junio C Hamanoa76cb0d2008-08-13 20:04:101583Along each parent, prune away commits that are not included
1584themselves. This results in</p></div>
1585<div class="listingblock">
1586<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:511587<pre><code> .-A---M---N---O---P---Q
Junio C Hamanoa76cb0d2008-08-13 20:04:101588 / / / / /
1589 I B / D /
1590 \ / / / /
Junio C Hamanoac12f0e2014-09-19 22:32:511591 `-------------'</code></pre>
Junio C Hamanoa76cb0d2008-08-13 20:04:101592</div></div>
Junio C Hamanoac12f0e2014-09-19 22:32:511593<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:101594was pruned away because it is TREESAME, but the parent list of P was
Junio C Hamanoac12f0e2014-09-19 22:32:511595rewritten to contain <code>E</code>'s parent <code>I</code>. The same happened for <code>C</code> and
1596<code>N</code>, and <code>X</code>, <code>Y</code> and <code>Q</code>.</p></div>
Junio C Hamanoa76cb0d2008-08-13 20:04:101597</dd>
1598</dl></div>
Junio C Hamano68cf15a2010-11-06 01:01:591599<div class="paragraph"><p>In addition to the above settings, you can change whether TREESAME
Junio C Hamanoa76cb0d2008-08-13 20:04:101600affects inclusion:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591601<div class="dlist"><dl>
1602<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471603--dense
1604</dt>
Junio C Hamanoa76cb0d2008-08-13 20:04:101605<dd>
1606<p>
1607 Commits that are walked are included if they are not TREESAME
1608 to any parent.
1609</p>
1610</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591611<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471612--sparse
Junio C Hamanob0e02952008-01-19 08:02:001613</dt>
1614<dd>
1615<p>
Junio C Hamanoa76cb0d2008-08-13 20:04:101616 All commits that are walked are included.
Junio C Hamanob0e02952008-01-19 08:02:001617</p>
Junio C Hamanoac12f0e2014-09-19 22:32:511618<div class="paragraph"><p>Note that without <code>--full-history</code>, this still simplifies merges: if
Junio C Hamanoa76cb0d2008-08-13 20:04:101619one of the parents is TREESAME, we follow only that one, so the other
1620sides of the merge are never walked.</p></div>
Junio C Hamanob0e02952008-01-19 08:02:001621</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591622<dt class="hdlist1">
Junio C Hamanoa2f46622008-09-03 05:20:311623--simplify-merges
1624</dt>
1625<dd>
1626<p>
1627 First, build a history graph in the same way that
Junio C Hamanoac12f0e2014-09-19 22:32:511628 <code>--full-history</code> with parent rewriting does (see above).
Junio C Hamanoa2f46622008-09-03 05:20:311629</p>
Junio C Hamanoac12f0e2014-09-19 22:32:511630<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:311631history according to the following rules:</p></div>
Junio C Hamano9629d4f2012-12-19 00:28:271632<div class="openblock">
1633<div class="content">
Junio C Hamano68cf15a2010-11-06 01:01:591634<div class="ulist"><ul>
Junio C Hamanoa2f46622008-09-03 05:20:311635<li>
1636<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511637Set <code>C'</code> to <code>C</code>.
Junio C Hamanoa2f46622008-09-03 05:20:311638</p>
1639</li>
1640<li>
1641<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511642Replace each parent <code>P</code> of <code>C'</code> with its simplification <code>P'</code>. In
Junio C Hamano27159f82013-06-14 17:19:221643 the process, drop parents that are ancestors of other parents or that are
1644 root commits TREESAME to an empty tree, and remove duplicates, but take care
1645 to never drop all parents that we are TREESAME to.
Junio C Hamanoa2f46622008-09-03 05:20:311646</p>
1647</li>
1648<li>
1649<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511650If after this parent rewriting, <code>C'</code> is a root or merge commit (has
Junio C Hamanoa2f46622008-09-03 05:20:311651 zero or &gt;1 parents), a boundary commit, or !TREESAME, it remains.
1652 Otherwise, it is replaced with its only parent.
1653</p>
1654</li>
1655</ul></div>
Junio C Hamano9629d4f2012-12-19 00:28:271656</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591657<div class="paragraph"><p>The effect of this is best shown by way of comparing to
Junio C Hamanoac12f0e2014-09-19 22:32:511658<code>--full-history</code> with parent rewriting. The example turns into:</p></div>
Junio C Hamanoa2f46622008-09-03 05:20:311659<div class="listingblock">
1660<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:511661<pre><code> .-A---M---N---O
Junio C Hamanoa2f46622008-09-03 05:20:311662 / / /
1663 I B D
1664 \ / /
Junio C Hamanoac12f0e2014-09-19 22:32:511665 `---------'</code></pre>
Junio C Hamanoa2f46622008-09-03 05:20:311666</div></div>
Junio C Hamanoac12f0e2014-09-19 22:32:511667<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:271668<div class="openblock">
1669<div class="content">
Junio C Hamano68cf15a2010-11-06 01:01:591670<div class="ulist"><ul>
Junio C Hamanoa2f46622008-09-03 05:20:311671<li>
1672<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511673<code>N</code>'s parent list had <code>I</code> removed, because it is an ancestor of the
1674 other parent <code>M</code>. Still, <code>N</code> remained because it is !TREESAME.
Junio C Hamanoa2f46622008-09-03 05:20:311675</p>
1676</li>
1677<li>
1678<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511679<code>P</code>'s parent list similarly had <code>I</code> removed. <code>P</code> was then
Junio C Hamanoa2f46622008-09-03 05:20:311680 removed completely, because it had one parent and is TREESAME.
1681</p>
1682</li>
Junio C Hamano27159f82013-06-14 17:19:221683<li>
1684<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511685<code>Q</code>'s parent list had <code>Y</code> simplified to <code>X</code>. <code>X</code> was then removed, because it
1686 was a TREESAME root. <code>Q</code> was then removed completely, because it had one
Junio C Hamano27159f82013-06-14 17:19:221687 parent and is TREESAME.
1688</p>
1689</li>
Junio C Hamanoa2f46622008-09-03 05:20:311690</ul></div>
Junio C Hamano9629d4f2012-12-19 00:28:271691</div></div>
Junio C Hamanoa2f46622008-09-03 05:20:311692</dd>
1693</dl></div>
Junio C Hamano68cf15a2010-11-06 01:01:591694<div class="paragraph"><p>Finally, there is a fifth simplification mode available:</p></div>
1695<div class="dlist"><dl>
1696<dt class="hdlist1">
Junio C Hamano89a57342010-06-22 23:22:551697--ancestry-path
1698</dt>
1699<dd>
1700<p>
1701 Limit the displayed commits to those directly on the ancestry
Junio C Hamanob73af6c2013-12-03 22:07:111702 chain between the &#8220;from&#8221; and &#8220;to&#8221; commits in the given commit
1703 range. I.e. only display commits that are ancestor of the &#8220;to&#8221;
1704 commit and descendants of the &#8220;from&#8221; commit.
Junio C Hamano89a57342010-06-22 23:22:551705</p>
Junio C Hamano68cf15a2010-11-06 01:01:591706<div class="paragraph"><p>As an example use case, consider the following commit history:</p></div>
Junio C Hamano89a57342010-06-22 23:22:551707<div class="listingblock">
1708<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:511709<pre><code> D---E-------F
Junio C Hamano89a57342010-06-22 23:22:551710 / \ \
1711 B---C---G---H---I---J
1712 / \
Junio C Hamanoac12f0e2014-09-19 22:32:511713 A-------K---------------L--M</code></pre>
Junio C Hamano89a57342010-06-22 23:22:551714</div></div>
Junio C Hamanoac12f0e2014-09-19 22:32:511715<div class="paragraph"><p>A regular <em>D..M</em> computes the set of commits that are ancestors of <code>M</code>,
1716but excludes the ones that are ancestors of <code>D</code>. This is useful to see
1717what happened to the history leading to <code>M</code> since <code>D</code>, in the sense
1718that &#8220;what does <code>M</code> have that did not exist in <code>D</code>&#8221;. The result in this
1719example 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:551720of course).</p></div>
Junio C Hamanoac12f0e2014-09-19 22:32:511721<div class="paragraph"><p>When we want to find out what commits in <code>M</code> are contaminated with the
1722bug introduced by <code>D</code> and need fixing, however, we might want to view
1723only the subset of <em>D..M</em> that are actually descendants of <code>D</code>, i.e.
1724excluding <code>C</code> and <code>K</code>. This is exactly what the <code>--ancestry-path</code>
Junio C Hamano89a57342010-06-22 23:22:551725option does. Applied to the <em>D..M</em> range, it results in:</p></div>
1726<div class="listingblock">
1727<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:511728<pre><code> E-------F
Junio C Hamano89a57342010-06-22 23:22:551729 \ \
1730 G---H---I---J
1731 \
Junio C Hamanoac12f0e2014-09-19 22:32:511732 L--M</code></pre>
Junio C Hamano89a57342010-06-22 23:22:551733</div></div>
1734</dd>
1735</dl></div>
Junio C Hamanoac12f0e2014-09-19 22:32:511736<div class="paragraph"><p>The <code>--simplify-by-decoration</code> option allows you to view only the
Junio C Hamano28363492008-11-14 08:26:311737big picture of the topology of the history, by omitting commits
1738that are not referenced by tags. Commits are marked as !TREESAME
1739(in other words, kept after history simplification rules described
1740above) if (1) they are referenced by tags, or (2) they change the
1741contents of the paths given on the command line. All other
1742commits are marked as TREESAME (subject to be simplified away).</p></div>
Junio C Hamano9629d4f2012-12-19 00:28:271743</div>
1744<div class="sect2">
1745<h3 id="_commit_ordering">Commit Ordering</h3>
Junio C Hamano68cf15a2010-11-06 01:01:591746<div class="paragraph"><p>By default, the commits are shown in reverse chronological order.</p></div>
1747<div class="dlist"><dl>
1748<dt class="hdlist1">
Junio C Hamanob0e02952008-01-19 08:02:001749--date-order
1750</dt>
1751<dd>
1752<p>
Junio C Hamanod0316112012-08-22 19:55:291753 Show no parents before all of its children are shown, but
1754 otherwise show commits in the commit timestamp order.
Junio C Hamanob0e02952008-01-19 08:02:001755</p>
1756</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591757<dt class="hdlist1">
Junio C Hamanoa1952302013-07-01 21:31:181758--author-date-order
1759</dt>
1760<dd>
1761<p>
1762 Show no parents before all of its children are shown, but
1763 otherwise show commits in the author timestamp order.
1764</p>
1765</dd>
1766<dt class="hdlist1">
Junio C Hamanod0316112012-08-22 19:55:291767--topo-order
1768</dt>
1769<dd>
1770<p>
1771 Show no parents before all of its children are shown, and
1772 avoid showing commits on multiple lines of history
1773 intermixed.
1774</p>
1775<div class="paragraph"><p>For example, in a commit history like this:</p></div>
1776<div class="listingblock">
1777<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:511778<pre><code> ---1----2----4----7
Junio C Hamanod0316112012-08-22 19:55:291779 \ \
Junio C Hamanoac12f0e2014-09-19 22:32:511780 3----5----6----8---</code></pre>
Junio C Hamanod0316112012-08-22 19:55:291781</div></div>
Junio C Hamanoac12f0e2014-09-19 22:32:511782<div class="paragraph"><p>where the numbers denote the order of commit timestamps, <code>git
1783rev-list</code> and friends with <code>--date-order</code> show the commits in the
Junio C Hamanod0316112012-08-22 19:55:291784timestamp order: 8 7 6 5 4 3 2 1.</p></div>
Junio C Hamanoac12f0e2014-09-19 22:32:511785<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:2917863 1); some older commits are shown before newer ones in order to
1787avoid showing the commits from two parallel development track mixed
1788together.</p></div>
1789</dd>
1790<dt class="hdlist1">
Junio C Hamanob0e02952008-01-19 08:02:001791--reverse
1792</dt>
1793<dd>
1794<p>
1795 Output the commits in reverse order.
Junio C Hamanoac12f0e2014-09-19 22:32:511796 Cannot be combined with <code>--walk-reflogs</code>.
Junio C Hamanob0e02952008-01-19 08:02:001797</p>
1798</dd>
Junio C Hamanoba4b9282008-07-06 05:20:311799</dl></div>
Junio C Hamano9629d4f2012-12-19 00:28:271800</div>
1801<div class="sect2">
1802<h3 id="_object_traversal">Object Traversal</h3>
Junio C Hamano076ffcc2013-02-06 05:13:211803<div class="paragraph"><p>These options are mostly targeted for packing of Git repositories.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591804<div class="dlist"><dl>
1805<dt class="hdlist1">
Junio C Hamanoeccdd4a2012-09-10 23:28:171806--no-walk[=(sorted|unsorted)]
Junio C Hamanob0e02952008-01-19 08:02:001807</dt>
1808<dd>
1809<p>
Junio C Hamanoeccdd4a2012-09-10 23:28:171810 Only show the given commits, but do not traverse their ancestors.
1811 This has no effect if a range is specified. If the argument
Junio C Hamanoac12f0e2014-09-19 22:32:511812 <code>unsorted</code> is given, the commits are shown in the order they were
1813 given on the command line. Otherwise (if <code>sorted</code> or no argument
Junio C Hamanob73af6c2013-12-03 22:07:111814 was given), the commits are shown in reverse chronological order
Junio C Hamanoeccdd4a2012-09-10 23:28:171815 by commit time.
Junio C Hamanoef57d1e2015-03-25 21:23:001816 Cannot be combined with <code>--graph</code>.
Junio C Hamanob0e02952008-01-19 08:02:001817</p>
1818</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591819<dt class="hdlist1">
Junio C Hamanob0e02952008-01-19 08:02:001820--do-walk
1821</dt>
1822<dd>
1823<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511824 Overrides a previous <code>--no-walk</code>.
Junio C Hamanob0e02952008-01-19 08:02:001825</p>
1826</dd>
Junio C Hamanoba4b9282008-07-06 05:20:311827</dl></div>
Junio C Hamano9629d4f2012-12-19 00:28:271828</div>
1829<div class="sect2">
1830<h3 id="_commit_formatting">Commit Formatting</h3>
Junio C Hamanod2c978f2011-03-20 19:42:221831<div class="dlist"><dl>
1832<dt class="hdlist1">
1833--pretty[=&lt;format&gt;]
1834</dt>
1835<dt class="hdlist1">
1836--format=&lt;format&gt;
1837</dt>
1838<dd>
1839<p>
1840 Pretty-print the contents of the commit logs in a given format,
1841 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:261842 <em>full</em>, <em>fuller</em>, <em>email</em>, <em>raw</em>, <em>format:&lt;string&gt;</em>
1843 and <em>tformat:&lt;string&gt;</em>. When <em>&lt;format&gt;</em> is none of the above,
1844 and has <em>%placeholder</em> in it, it acts as if
1845 <em>--pretty=tformat:&lt;format&gt;</em> were given.
Junio C Hamanod2c978f2011-03-20 19:42:221846</p>
Junio C Hamano6bb32e62015-02-17 22:11:261847<div class="paragraph"><p>See the "PRETTY FORMATS" section for some additional details for each
1848format. When <em>=&lt;format&gt;</em> part is omitted, it defaults to <em>medium</em>.</p></div>
Junio C Hamanod2c978f2011-03-20 19:42:221849<div class="paragraph"><p>Note: you can specify the default pretty format in the repository
Junio C Hamanoa28a9202012-06-21 07:08:231850configuration (see <a href="git-config.html">git-config(1)</a>).</p></div>
Junio C Hamanod2c978f2011-03-20 19:42:221851</dd>
1852<dt class="hdlist1">
1853--abbrev-commit
1854</dt>
1855<dd>
1856<p>
1857 Instead of showing the full 40-byte hexadecimal commit object
1858 name, show only a partial prefix. Non default number of
1859 digits can be specified with "--abbrev=&lt;n&gt;" (which also modifies
1860 diff output, if it is displayed).
1861</p>
1862<div class="paragraph"><p>This should make "--pretty=oneline" a whole lot more readable for
1863people using 80-column terminals.</p></div>
1864</dd>
1865<dt class="hdlist1">
Junio C Hamanof93530e2011-05-25 23:59:591866--no-abbrev-commit
1867</dt>
1868<dd>
1869<p>
1870 Show the full 40-byte hexadecimal commit object name. This negates
Junio C Hamanoac12f0e2014-09-19 22:32:511871 <code>--abbrev-commit</code> and those options which imply it such as
Junio C Hamanof93530e2011-05-25 23:59:591872 "--oneline". It also overrides the <em>log.abbrevCommit</em> variable.
1873</p>
1874</dd>
1875<dt class="hdlist1">
Junio C Hamanod2c978f2011-03-20 19:42:221876--oneline
1877</dt>
1878<dd>
1879<p>
1880 This is a shorthand for "--pretty=oneline --abbrev-commit"
1881 used together.
1882</p>
1883</dd>
1884<dt class="hdlist1">
Junio C Hamanoc5bb3b32013-08-05 22:43:361885--encoding=&lt;encoding&gt;
Junio C Hamanod2c978f2011-03-20 19:42:221886</dt>
1887<dd>
1888<p>
1889 The commit objects record the encoding used for the log message
1890 in their encoding header; this option can be used to tell the
1891 command to re-code the commit log message in the encoding
1892 preferred by the user. For non plumbing commands this
Junio C Hamano823eebb2015-07-10 22:29:341893 defaults to UTF-8. Note that if an object claims to be encoded
1894 in <code>X</code> and we are outputting in <code>X</code>, we will output the object
1895 verbatim; this means that invalid sequences in the original
1896 commit may be copied to the output.
Junio C Hamanod2c978f2011-03-20 19:42:221897</p>
1898</dd>
1899<dt class="hdlist1">
Junio C Hamano4e6ba272016-01-20 23:23:191900--notes[=&lt;treeish&gt;]
Junio C Hamanod2c978f2011-03-20 19:42:221901</dt>
1902<dd>
1903<p>
Junio C Hamanoa28a9202012-06-21 07:08:231904 Show the notes (see <a href="git-notes.html">git-notes(1)</a>) that annotate the
Junio C Hamanod2c978f2011-03-20 19:42:221905 commit, when showing the commit log message. This is the default
Junio C Hamanoac12f0e2014-09-19 22:32:511906 for <code>git log</code>, <code>git show</code> and <code>git whatchanged</code> commands when
1907 there is no <code>--pretty</code>, <code>--format</code>, or <code>--oneline</code> option given
Junio C Hamano60033462011-05-03 00:48:431908 on the command line.
Junio C Hamanod2c978f2011-03-20 19:42:221909</p>
Junio C Hamano60033462011-05-03 00:48:431910<div class="paragraph"><p>By default, the notes shown are from the notes refs listed in the
1911<em>core.notesRef</em> and <em>notes.displayRef</em> variables (or corresponding
Junio C Hamanoa28a9202012-06-21 07:08:231912environment overrides). See <a href="git-config.html">git-config(1)</a> for more details.</p></div>
Junio C Hamano4e6ba272016-01-20 23:23:191913<div class="paragraph"><p>With an optional <em>&lt;treeish&gt;</em> argument, use the treeish to find the notes
1914to display. The treeish can specify the full refname when it begins
Junio C Hamano1f7c4a52015-10-14 22:15:511915with <code>refs/notes/</code>; when it begins with <code>notes/</code>, <code>refs/</code> and otherwise
1916<code>refs/notes/</code> is prefixed to form a full name of the ref.</p></div>
Junio C Hamano60033462011-05-03 00:48:431917<div class="paragraph"><p>Multiple --notes options can be combined to control which notes are
1918being displayed. Examples: "--notes=foo" will show only notes from
1919"refs/notes/foo"; "--notes=foo --notes" will show both notes from
1920"refs/notes/foo" and from the default notes ref(s).</p></div>
Junio C Hamanod2c978f2011-03-20 19:42:221921</dd>
1922<dt class="hdlist1">
Junio C Hamano60033462011-05-03 00:48:431923--no-notes
1924</dt>
1925<dd>
1926<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511927 Do not show notes. This negates the above <code>--notes</code> option, by
Junio C Hamano60033462011-05-03 00:48:431928 resetting the list of notes refs from which notes are shown.
1929 Options are parsed in the order given on the command line, so e.g.
1930 "--notes --notes=foo --no-notes --notes=bar" will only show notes
1931 from "refs/notes/bar".
1932</p>
1933</dd>
1934<dt class="hdlist1">
Junio C Hamano4e6ba272016-01-20 23:23:191935--show-notes[=&lt;treeish&gt;]
Junio C Hamano60033462011-05-03 00:48:431936</dt>
1937<dt class="hdlist1">
Junio C Hamanod2c978f2011-03-20 19:42:221938--[no-]standard-notes
1939</dt>
1940<dd>
1941<p>
Junio C Hamano60033462011-05-03 00:48:431942 These options are deprecated. Use the above --notes/--no-notes
1943 options instead.
Junio C Hamanod2c978f2011-03-20 19:42:221944</p>
1945</dd>
1946<dt class="hdlist1">
Junio C Hamano0acb1ae2012-09-24 21:28:131947--show-signature
1948</dt>
1949<dd>
1950<p>
1951 Check the validity of a signed commit object by passing the signature
Junio C Hamanoac12f0e2014-09-19 22:32:511952 to <code>gpg --verify</code> and show the output.
Junio C Hamano0acb1ae2012-09-24 21:28:131953</p>
1954</dd>
1955<dt class="hdlist1">
Junio C Hamanod2c978f2011-03-20 19:42:221956--relative-date
1957</dt>
1958<dd>
1959<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511960 Synonym for <code>--date=relative</code>.
Junio C Hamanod2c978f2011-03-20 19:42:221961</p>
1962</dd>
1963<dt class="hdlist1">
Junio C Hamano1eb56092015-10-05 20:39:531964--date=&lt;format&gt;
Junio C Hamanod2c978f2011-03-20 19:42:221965</dt>
1966<dd>
1967<p>
1968 Only takes effect for dates shown in human-readable format, such
Junio C Hamanoac12f0e2014-09-19 22:32:511969 as when using <code>--pretty</code>. <code>log.date</code> config variable sets a default
Junio C Hamano1eb56092015-10-05 20:39:531970 value for the log command&#8217;s <code>--date</code> option. By default, dates
1971 are shown in the original time zone (either committer&#8217;s or
1972 author&#8217;s). If <code>-local</code> is appended to the format (e.g.,
1973 <code>iso-local</code>), the user&#8217;s local time zone is used instead.
Junio C Hamanod2c978f2011-03-20 19:42:221974</p>
Junio C Hamanoac12f0e2014-09-19 22:32:511975<div class="paragraph"><p><code>--date=relative</code> shows dates relative to the current time,
Junio C Hamano1eb56092015-10-05 20:39:531976e.g. &#8220;2 hours ago&#8221;. The <code>-local</code> option cannot be used with
1977<code>--raw</code> or <code>--relative</code>.</p></div>
1978<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:511979<div class="paragraph"><p><code>--date=iso</code> (or <code>--date=iso8601</code>) shows timestamps in a ISO 8601-like format.
1980The differences to the strict ISO 8601 format are:</p></div>
1981<div class="ulist"><ul>
1982<li>
1983<p>
1984a space instead of the <code>T</code> date/time delimiter
1985</p>
1986</li>
1987<li>
1988<p>
1989a space between time and time zone
1990</p>
1991</li>
1992<li>
1993<p>
1994no colon between hours and minutes of the time zone
1995</p>
1996</li>
1997</ul></div>
1998<div class="paragraph"><p><code>--date=iso-strict</code> (or <code>--date=iso8601-strict</code>) shows timestamps in strict
1999ISO 8601 format.</p></div>
2000<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:112001format, often found in email messages.</p></div>
Junio C Hamanoac12f0e2014-09-19 22:32:512002<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>
2003<div class="paragraph"><p><code>--date=raw</code> shows the date in the internal raw Git format <code>%s %z</code> format.</p></div>
Junio C Hamanod7ed4042015-08-03 19:43:002004<div class="paragraph"><p><code>--date=format:...</code> feeds the format <code>...</code> to your system <code>strftime</code>.
2005Use <code>--date=format:%c</code> to show the date in your system locale&#8217;s
2006preferred format. See the <code>strftime</code> manual for a complete list of
Junio C Hamano1eb56092015-10-05 20:39:532007format placeholders. When using <code>-local</code>, the correct syntax is
2008<code>--date=format-local:...</code>.</p></div>
2009<div class="paragraph"><p><code>--date=default</code> is the default format, and is similar to
2010<code>--date=rfc2822</code>, with a few exceptions:</p></div>
2011<div class="ulist"><ul>
2012<li>
2013<p>
2014there is no comma after the day-of-week
2015</p>
2016</li>
2017<li>
2018<p>
2019the time zone is omitted when the local time zone is used
2020</p>
2021</li>
2022</ul></div>
Junio C Hamanod2c978f2011-03-20 19:42:222023</dd>
2024<dt class="hdlist1">
2025--parents
2026</dt>
2027<dd>
2028<p>
2029 Print also the parents of the commit (in the form "commit parent&#8230;").
2030 Also enables parent rewriting, see <em>History Simplification</em> below.
2031</p>
2032</dd>
2033<dt class="hdlist1">
2034--children
2035</dt>
2036<dd>
2037<p>
2038 Print also the children of the commit (in the form "commit child&#8230;").
2039 Also enables parent rewriting, see <em>History Simplification</em> below.
2040</p>
2041</dd>
2042<dt class="hdlist1">
2043--left-right
2044</dt>
2045<dd>
2046<p>
2047 Mark which side of a symmetric diff a commit is reachable from.
Junio C Hamanoac12f0e2014-09-19 22:32:512048 Commits from the left side are prefixed with <code>&lt;</code> and those from
2049 the right with <code>&gt;</code>. If combined with <code>--boundary</code>, those
2050 commits are prefixed with <code>-</code>.
Junio C Hamanod2c978f2011-03-20 19:42:222051</p>
2052<div class="paragraph"><p>For example, if you have this topology:</p></div>
2053<div class="listingblock">
2054<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512055<pre><code> y---b---b branch B
Junio C Hamanod2c978f2011-03-20 19:42:222056 / \ /
2057 / .
2058 / / \
Junio C Hamanoac12f0e2014-09-19 22:32:512059 o---x---a---a branch A</code></pre>
Junio C Hamanod2c978f2011-03-20 19:42:222060</div></div>
2061<div class="paragraph"><p>you would get an output like this:</p></div>
2062<div class="listingblock">
2063<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512064<pre><code> $ git rev-list --left-right --boundary --pretty=oneline A...B
Junio C Hamanod2c978f2011-03-20 19:42:222065
2066 &gt;bbbbbbb... 3rd on b
2067 &gt;bbbbbbb... 2nd on b
2068 &lt;aaaaaaa... 3rd on a
2069 &lt;aaaaaaa... 2nd on a
2070 -yyyyyyy... 1st on b
Junio C Hamanoac12f0e2014-09-19 22:32:512071 -xxxxxxx... 1st on a</code></pre>
Junio C Hamanod2c978f2011-03-20 19:42:222072</div></div>
2073</dd>
2074<dt class="hdlist1">
2075--graph
2076</dt>
2077<dd>
2078<p>
2079 Draw a text-based graphical representation of the commit history
2080 on the left hand side of the output. This may cause extra lines
2081 to be printed in between commits, in order for the graph history
2082 to be drawn properly.
Junio C Hamanoef57d1e2015-03-25 21:23:002083 Cannot be combined with <code>--no-walk</code>.
Junio C Hamanod2c978f2011-03-20 19:42:222084</p>
2085<div class="paragraph"><p>This enables parent rewriting, see <em>History Simplification</em> below.</p></div>
Junio C Hamanoac12f0e2014-09-19 22:32:512086<div class="paragraph"><p>This implies the <code>--topo-order</code> option by default, but the
2087<code>--date-order</code> option may also be specified.</p></div>
Junio C Hamanod2c978f2011-03-20 19:42:222088</dd>
Junio C Hamano624dd4c2014-04-03 21:56:302089<dt class="hdlist1">
2090--show-linear-break[=&lt;barrier&gt;]
2091</dt>
2092<dd>
2093<p>
2094 When --graph is not used, all history branches are flattened
2095 which can make it hard to see that the two consecutive commits
2096 do not belong to a linear branch. This option puts a barrier
Junio C Hamanoac12f0e2014-09-19 22:32:512097 in between them in that case. If <code>&lt;barrier&gt;</code> is specified, it
Junio C Hamano624dd4c2014-04-03 21:56:302098 is the string that will be shown instead of the default one.
2099</p>
2100</dd>
Junio C Hamanod2c978f2011-03-20 19:42:222101</dl></div>
Junio C Hamano9629d4f2012-12-19 00:28:272102</div>
2103<div class="sect2">
2104<h3 id="_diff_formatting">Diff Formatting</h3>
Junio C Hamanob73af6c2013-12-03 22:07:112105<div class="paragraph"><p>Listed below are options that control the formatting of diff output.
Junio C Hamanoa28a9202012-06-21 07:08:232106Some of them are specific to <a href="git-rev-list.html">git-rev-list(1)</a>, however other diff
2107options 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:222108<div class="dlist"><dl>
2109<dt class="hdlist1">
2110-c
2111</dt>
2112<dd>
2113<p>
2114 With this option, diff output for a merge commit
2115 shows the differences from each of the parents to the merge result
2116 simultaneously instead of showing pairwise diff between a parent
2117 and the result one at a time. Furthermore, it lists only files
2118 which were modified from all parents.
2119</p>
2120</dd>
2121<dt class="hdlist1">
2122--cc
2123</dt>
2124<dd>
2125<p>
Junio C Hamanoac12f0e2014-09-19 22:32:512126 This flag implies the <code>-c</code> option and further compresses the
Junio C Hamanod2c978f2011-03-20 19:42:222127 patch output by omitting uninteresting hunks whose contents in
2128 the parents have only two variants and the merge result picks
2129 one of them without modification.
2130</p>
2131</dd>
2132<dt class="hdlist1">
2133-m
2134</dt>
2135<dd>
2136<p>
2137 This flag makes the merge commits show the full diff like
2138 regular commits; for each merge parent, a separate log entry
2139 and diff is generated. An exception is that only diff against
Junio C Hamanoac12f0e2014-09-19 22:32:512140 the first parent is shown when <code>--first-parent</code> option is given;
Junio C Hamanod2c978f2011-03-20 19:42:222141 in that case, the output represents the changes the merge
2142 brought <em>into</em> the then-current branch.
2143</p>
2144</dd>
2145<dt class="hdlist1">
2146-r
2147</dt>
2148<dd>
2149<p>
2150 Show recursive diffs.
2151</p>
2152</dd>
2153<dt class="hdlist1">
2154-t
2155</dt>
2156<dd>
2157<p>
Junio C Hamanoac12f0e2014-09-19 22:32:512158 Show the tree objects in the diff output. This implies <code>-r</code>.
Junio C Hamanod2c978f2011-03-20 19:42:222159</p>
2160</dd>
Junio C Hamanod2c978f2011-03-20 19:42:222161</dl></div>
Junio C Hamano0430e3a2007-05-15 03:13:172162</div>
Junio C Hamano9629d4f2012-12-19 00:28:272163</div>
2164</div>
2165<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:312166<h2 id="_pretty_formats">PRETTY FORMATS</h2>
Junio C Hamano0430e3a2007-05-15 03:13:172167<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:592168<div class="paragraph"><p>If the commit is a merge, and if the pretty-format
Junio C Hamano0430e3a2007-05-15 03:13:172169is not <em>oneline</em>, <em>email</em> or <em>raw</em>, an additional line is
2170inserted before the <em>Author:</em> line. This line begins with
2171"Merge: " and the sha1s of ancestral commits are printed,
2172separated by spaces. Note that the listed commits may not
2173necessarily be the list of the <strong>direct</strong> parent commits if you
2174have limited your view of history: for example, if you are
2175only interested in changes related to a certain directory or
Junio C Hamanoba4b9282008-07-06 05:20:312176file.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592177<div class="paragraph"><p>There are several built-in formats, and you can define
Junio C Hamanoa574a092010-06-13 19:57:102178additional formats by setting a pretty.&lt;name&gt;
2179config option to either another format name, or a
2180<em>format:</em> string, as described below (see
Junio C Hamanoa28a9202012-06-21 07:08:232181<a href="git-config.html">git-config(1)</a>). Here are the details of the
Junio C Hamanoa574a092010-06-13 19:57:102182built-in formats:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592183<div class="ulist"><ul>
Junio C Hamanoa340aaa2006-11-23 02:47:332184<li>
2185<p>
2186<em>oneline</em>
2187</p>
2188<div class="literalblock">
2189<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512190<pre><code>&lt;sha1&gt; &lt;title line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332191</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592192<div class="paragraph"><p>This is designed to be as compact as possible.</p></div>
Junio C Hamanoa340aaa2006-11-23 02:47:332193</li>
2194<li>
2195<p>
2196<em>short</em>
2197</p>
2198<div class="literalblock">
2199<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512200<pre><code>commit &lt;sha1&gt;
2201Author: &lt;author&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332202</div></div>
2203<div class="literalblock">
2204<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512205<pre><code>&lt;title line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332206</div></div>
2207</li>
2208<li>
2209<p>
2210<em>medium</em>
2211</p>
2212<div class="literalblock">
2213<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512214<pre><code>commit &lt;sha1&gt;
Junio C Hamanoa340aaa2006-11-23 02:47:332215Author: &lt;author&gt;
Junio C Hamanoac12f0e2014-09-19 22:32:512216Date: &lt;author date&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332217</div></div>
2218<div class="literalblock">
2219<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512220<pre><code>&lt;title line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332221</div></div>
2222<div class="literalblock">
2223<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512224<pre><code>&lt;full commit message&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332225</div></div>
2226</li>
2227<li>
2228<p>
2229<em>full</em>
2230</p>
2231<div class="literalblock">
2232<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512233<pre><code>commit &lt;sha1&gt;
Junio C Hamanoa340aaa2006-11-23 02:47:332234Author: &lt;author&gt;
Junio C Hamanoac12f0e2014-09-19 22:32:512235Commit: &lt;committer&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332236</div></div>
2237<div class="literalblock">
2238<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512239<pre><code>&lt;title line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332240</div></div>
2241<div class="literalblock">
2242<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512243<pre><code>&lt;full commit message&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332244</div></div>
2245</li>
2246<li>
2247<p>
2248<em>fuller</em>
2249</p>
2250<div class="literalblock">
2251<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512252<pre><code>commit &lt;sha1&gt;
Junio C Hamano6a3c8272008-12-19 21:38:182253Author: &lt;author&gt;
Junio C Hamanoba4b9282008-07-06 05:20:312254AuthorDate: &lt;author date&gt;
Junio C Hamano6a3c8272008-12-19 21:38:182255Commit: &lt;committer&gt;
Junio C Hamanoac12f0e2014-09-19 22:32:512256CommitDate: &lt;committer date&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332257</div></div>
2258<div class="literalblock">
2259<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512260<pre><code>&lt;title line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332261</div></div>
2262<div class="literalblock">
2263<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512264<pre><code>&lt;full commit message&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332265</div></div>
2266</li>
2267<li>
2268<p>
2269<em>email</em>
2270</p>
2271<div class="literalblock">
2272<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512273<pre><code>From &lt;sha1&gt; &lt;date&gt;
Junio C Hamanoa340aaa2006-11-23 02:47:332274From: &lt;author&gt;
Junio C Hamanoba4b9282008-07-06 05:20:312275Date: &lt;author date&gt;
Junio C Hamanoac12f0e2014-09-19 22:32:512276Subject: [PATCH] &lt;title line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332277</div></div>
2278<div class="literalblock">
2279<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512280<pre><code>&lt;full commit message&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332281</div></div>
2282</li>
2283<li>
2284<p>
2285<em>raw</em>
2286</p>
Junio C Hamano68cf15a2010-11-06 01:01:592287<div class="paragraph"><p>The <em>raw</em> format shows the entire commit exactly as
Junio C Hamanoe3f080d2013-04-22 02:27:132288stored in the commit object. Notably, the SHA-1s are
Junio C Hamanoa340aaa2006-11-23 02:47:332289displayed in full, regardless of whether --abbrev or
2290--no-abbrev are used, and <em>parents</em> information show the
Junio C Hamanod75148a2014-04-08 19:48:382291true parent commits, without taking grafts or history
Junio C Hamano85f1fde2015-06-01 20:37:322292simplification into account. Note that this format affects the way
2293commits are displayed, but not the way the diff is shown e.g. with
2294<code>git log --raw</code>. To get full object names in a raw diff format,
2295use <code>--no-abbrev</code>.</p></div>
Junio C Hamanoa340aaa2006-11-23 02:47:332296</li>
Junio C Hamanoa3fd83c2007-03-02 10:34:362297<li>
2298<p>
Junio C Hamanoe32ec8b2010-06-02 23:32:312299<em>format:&lt;string&gt;</em>
Junio C Hamanoa3fd83c2007-03-02 10:34:362300</p>
Junio C Hamano68cf15a2010-11-06 01:01:592301<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:362302you want to show. It works a little bit like printf format,
2303with the notable exception that you get a newline with <em>%n</em>
Junio C Hamanoba4b9282008-07-06 05:20:312304instead of <em>\n</em>.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592305<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:312306would show something like this:</p></div>
Junio C Hamano0430e3a2007-05-15 03:13:172307<div class="listingblock">
2308<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512309<pre><code>The author of fe6e0ee was Junio C Hamano, 23 hours ago
2310The 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:172311</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592312<div class="paragraph"><p>The placeholders are:</p></div>
2313<div class="ulist"><ul>
Junio C Hamanoa3fd83c2007-03-02 10:34:362314<li>
2315<p>
2316<em>%H</em>: commit hash
2317</p>
2318</li>
2319<li>
2320<p>
2321<em>%h</em>: abbreviated commit hash
2322</p>
2323</li>
2324<li>
2325<p>
2326<em>%T</em>: tree hash
2327</p>
2328</li>
2329<li>
2330<p>
2331<em>%t</em>: abbreviated tree hash
2332</p>
2333</li>
2334<li>
2335<p>
2336<em>%P</em>: parent hashes
2337</p>
2338</li>
2339<li>
2340<p>
2341<em>%p</em>: abbreviated parent hashes
2342</p>
2343</li>
2344<li>
2345<p>
2346<em>%an</em>: author name
2347</p>
2348</li>
2349<li>
2350<p>
Junio C Hamano04e768d2013-04-23 19:19:262351<em>%aN</em>: author name (respecting .mailmap, see <a href="git-shortlog.html">git-shortlog(1)</a>
2352 or <a href="git-blame.html">git-blame(1)</a>)
Junio C Hamanof5a93622008-07-16 03:23:572353</p>
2354</li>
2355<li>
2356<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:362357<em>%ae</em>: author email
2358</p>
2359</li>
2360<li>
2361<p>
Junio C Hamano04e768d2013-04-23 19:19:262362<em>%aE</em>: author email (respecting .mailmap, see
2363 <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:192364</p>
2365</li>
2366<li>
2367<p>
Junio C Hamanoa387df32008-08-29 08:56:582368<em>%ad</em>: author date (format respects --date= option)
Junio C Hamanoa3fd83c2007-03-02 10:34:362369</p>
2370</li>
2371<li>
2372<p>
2373<em>%aD</em>: author date, RFC2822 style
2374</p>
2375</li>
2376<li>
2377<p>
2378<em>%ar</em>: author date, relative
2379</p>
2380</li>
2381<li>
2382<p>
2383<em>%at</em>: author date, UNIX timestamp
2384</p>
2385</li>
2386<li>
2387<p>
Junio C Hamanoac12f0e2014-09-19 22:32:512388<em>%ai</em>: author date, ISO 8601-like format
2389</p>
2390</li>
2391<li>
2392<p>
2393<em>%aI</em>: author date, strict ISO 8601 format
Junio C Hamano02f130b2007-07-14 08:26:562394</p>
2395</li>
2396<li>
2397<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:362398<em>%cn</em>: committer name
2399</p>
2400</li>
2401<li>
2402<p>
Junio C Hamano04e768d2013-04-23 19:19:262403<em>%cN</em>: committer name (respecting .mailmap, see
2404 <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:572405</p>
2406</li>
2407<li>
2408<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:362409<em>%ce</em>: committer email
2410</p>
2411</li>
2412<li>
2413<p>
Junio C Hamano04e768d2013-04-23 19:19:262414<em>%cE</em>: committer email (respecting .mailmap, see
2415 <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:192416</p>
2417</li>
2418<li>
2419<p>
Junio C Hamano53fe0312014-09-09 21:16:172420<em>%cd</em>: committer date (format respects --date= option)
Junio C Hamanoa3fd83c2007-03-02 10:34:362421</p>
2422</li>
2423<li>
2424<p>
2425<em>%cD</em>: committer date, RFC2822 style
2426</p>
2427</li>
2428<li>
2429<p>
2430<em>%cr</em>: committer date, relative
2431</p>
2432</li>
2433<li>
2434<p>
2435<em>%ct</em>: committer date, UNIX timestamp
2436</p>
2437</li>
2438<li>
2439<p>
Junio C Hamanoac12f0e2014-09-19 22:32:512440<em>%ci</em>: committer date, ISO 8601-like format
2441</p>
2442</li>
2443<li>
2444<p>
2445<em>%cI</em>: committer date, strict ISO 8601 format
Junio C Hamano02f130b2007-07-14 08:26:562446</p>
2447</li>
2448<li>
2449<p>
Junio C Hamanoa28a9202012-06-21 07:08:232450<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:022451</p>
2452</li>
2453<li>
2454<p>
Junio C Hamano00b9f1a2014-09-29 23:11:282455<em>%D</em>: ref names without the " (", ")" wrapping.
2456</p>
2457</li>
2458<li>
2459<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:362460<em>%e</em>: encoding
2461</p>
2462</li>
2463<li>
2464<p>
2465<em>%s</em>: subject
2466</p>
2467</li>
2468<li>
2469<p>
Junio C Hamano5f9a6f02009-04-06 08:26:562470<em>%f</em>: sanitized subject line, suitable for a filename
2471</p>
2472</li>
2473<li>
2474<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:362475<em>%b</em>: body
2476</p>
2477</li>
2478<li>
2479<p>
Junio C Hamanocb39aea2010-05-09 07:24:482480<em>%B</em>: raw body (unwrapped subject and body)
2481</p>
2482</li>
2483<li>
2484<p>
Junio C Hamano3b70d3c2009-11-21 17:37:372485<em>%N</em>: commit notes
2486</p>
2487</li>
2488<li>
2489<p>
Junio C Hamano0acb1ae2012-09-24 21:28:132490<em>%GG</em>: raw verification message from GPG for a signed commit
2491</p>
2492</li>
2493<li>
2494<p>
Junio C Hamanoedf80bd2013-04-05 22:14:362495<em>%G?</em>: show "G" for a Good signature, "B" for a Bad signature, "U" for a good,
2496 untrusted signature and "N" for no signature
Junio C Hamano0acb1ae2012-09-24 21:28:132497</p>
2498</li>
2499<li>
2500<p>
2501<em>%GS</em>: show the name of the signer for a signed commit
2502</p>
2503</li>
2504<li>
2505<p>
Junio C Hamano5e7f1312013-03-21 22:49:012506<em>%GK</em>: show the key used to sign a signed commit
2507</p>
2508</li>
2509<li>
2510<p>
Junio C Hamanoac12f0e2014-09-19 22:32:512511<em>%gD</em>: reflog selector, e.g., <code>refs/stash@{1}</code>
Junio C Hamanoc21ab052009-10-31 04:03:552512</p>
2513</li>
2514<li>
2515<p>
Junio C Hamanoac12f0e2014-09-19 22:32:512516<em>%gd</em>: shortened reflog selector, e.g., <code>stash@{1}</code>
Junio C Hamanoc21ab052009-10-31 04:03:552517</p>
2518</li>
2519<li>
2520<p>
Junio C Hamano962f3a32011-12-22 20:21:442521<em>%gn</em>: reflog identity name
2522</p>
2523</li>
2524<li>
2525<p>
Junio C Hamano04e768d2013-04-23 19:19:262526<em>%gN</em>: reflog identity name (respecting .mailmap, see
2527 <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:442528</p>
2529</li>
2530<li>
2531<p>
2532<em>%ge</em>: reflog identity email
2533</p>
2534</li>
2535<li>
2536<p>
Junio C Hamano04e768d2013-04-23 19:19:262537<em>%gE</em>: reflog identity email (respecting .mailmap, see
2538 <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:442539</p>
2540</li>
2541<li>
2542<p>
Junio C Hamanoc21ab052009-10-31 04:03:552543<em>%gs</em>: reflog subject
2544</p>
2545</li>
2546<li>
2547<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:362548<em>%Cred</em>: switch color to red
2549</p>
2550</li>
2551<li>
2552<p>
2553<em>%Cgreen</em>: switch color to green
2554</p>
2555</li>
2556<li>
2557<p>
2558<em>%Cblue</em>: switch color to blue
2559</p>
2560</li>
2561<li>
2562<p>
2563<em>%Creset</em>: reset color
2564</p>
2565</li>
2566<li>
2567<p>
Junio C Hamanoabad6da2013-01-06 09:06:322568<em>%C(&#8230;)</em>: color specification, as described in color.branch.* config option;
Junio C Hamanoac12f0e2014-09-19 22:32:512569 adding <code>auto,</code> at the beginning will emit color only when colors are
2570 enabled for log output (by <code>color.diff</code>, <code>color.ui</code>, or <code>--color</code>, and
2571 respecting the <code>auto</code> settings of the former if we are going to a
2572 terminal). <code>auto</code> alone (i.e. <code>%C(auto)</code>) will turn on auto coloring
Junio C Hamano04e768d2013-04-23 19:19:262573 on the next placeholders until the color is switched again.
Junio C Hamanocc0cb312009-01-22 03:38:502574</p>
2575</li>
2576<li>
2577<p>
Junio C Hamanod9e0e5d2007-04-14 16:22:042578<em>%m</em>: left, right or boundary mark
2579</p>
2580</li>
2581<li>
2582<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:362583<em>%n</em>: newline
2584</p>
Junio C Hamano0430e3a2007-05-15 03:13:172585</li>
Junio C Hamanob78d2592008-04-09 09:39:082586<li>
2587<p>
Junio C Hamanoa9701f02010-01-21 00:42:162588<em>%%</em>: a raw <em>%</em>
2589</p>
2590</li>
2591<li>
2592<p>
Junio C Hamanob78d2592008-04-09 09:39:082593<em>%x00</em>: print a byte from a hex code
2594</p>
2595</li>
Junio C Hamanobf984de2009-11-23 06:11:192596<li>
2597<p>
2598<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:232599 <a href="git-shortlog.html">git-shortlog(1)</a>.
Junio C Hamanobf984de2009-11-23 06:11:192600</p>
2601</li>
Junio C Hamano04e768d2013-04-23 19:19:262602<li>
2603<p>
2604<em>%&lt;(&lt;N&gt;[,trunc|ltrunc|mtrunc])</em>: make the next placeholder take at
2605 least N columns, padding spaces on the right if necessary.
2606 Optionally truncate at the beginning (ltrunc), the middle (mtrunc)
2607 or the end (trunc) if the output is longer than N columns.
2608 Note that truncating only works correctly with N &gt;= 2.
2609</p>
2610</li>
2611<li>
2612<p>
2613<em>%&lt;|(&lt;N&gt;)</em>: make the next placeholder take at least until Nth
2614 columns, padding spaces on the right if necessary
2615</p>
2616</li>
2617<li>
2618<p>
2619<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>
2620 respectively, but padding spaces on the left
2621</p>
2622</li>
2623<li>
2624<p>
2625<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>
2626 respectively, except that if the next placeholder takes more spaces
2627 than given and there are spaces on its left, use those spaces
2628</p>
2629</li>
2630<li>
2631<p>
2632<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>
2633 respectively, but padding both sides (i.e. the text is centered)
2634</p>
2635</li>
Junio C Hamanoba4b9282008-07-06 05:20:312636</ul></div>
Junio C Hamanoa3fd83c2007-03-02 10:34:362637</li>
Junio C Hamanoc21ab052009-10-31 04:03:552638</ul></div>
2639<div class="admonitionblock">
2640<table><tr>
2641<td class="icon">
2642<div class="title">Note</div>
2643</td>
2644<td class="content">Some placeholders may depend on other options given to the
Junio C Hamanoac12f0e2014-09-19 22:32:512645revision traversal engine. For example, the <code>%g*</code> reflog options will
Junio C Hamanoc21ab052009-10-31 04:03:552646insert an empty string unless we are traversing reflog entries (e.g., by
Junio C Hamano00b9f1a2014-09-29 23:11:282647<code>git log -g</code>). The <code>%d</code> and <code>%D</code> placeholders will use the "short"
2648decoration format if <code>--decorate</code> was not already provided on the command
2649line.</td>
Junio C Hamanoc21ab052009-10-31 04:03:552650</tr></table>
2651</div>
Junio C Hamanoac12f0e2014-09-19 22:32:512652<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:592653is inserted immediately before the expansion if and only if the
2654placeholder expands to a non-empty string.</p></div>
Junio C Hamanoac12f0e2014-09-19 22:32:512655<div class="paragraph"><p>If you add a <code>-</code> (minus sign) after <em>%</em> of a placeholder, line-feeds that
Junio C Hamano2bd8a742009-12-01 21:16:592656immediately precede the expansion are deleted if and only if the
2657placeholder expands to an empty string.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592658<div class="paragraph"><p>If you add a ` ` (space) after <em>%</em> of a placeholder, a space
Junio C Hamano89a57342010-06-22 23:22:552659is inserted immediately before the expansion if and only if the
2660placeholder expands to a non-empty string.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592661<div class="ulist"><ul>
Junio C Hamano6fb124c2008-06-13 10:04:012662<li>
2663<p>
2664<em>tformat:</em>
2665</p>
Junio C Hamano68cf15a2010-11-06 01:01:592666<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:012667provides "terminator" semantics instead of "separator" semantics. In
2668other words, each commit has the message terminator character (usually a
2669newline) appended, rather than a separator placed between entries.
2670This means that the final entry of a single-line format will be properly
2671terminated with a new line, just as the "oneline" format does.
Junio C Hamanoba4b9282008-07-06 05:20:312672For example:</p></div>
Junio C Hamano6fb124c2008-06-13 10:04:012673<div class="listingblock">
2674<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512675<pre><code>$ git log -2 --pretty=format:%h 4da45bef \
Junio C Hamano6fb124c2008-06-13 10:04:012676 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
26774da45be
26787134973 -- NO NEWLINE
2679
2680$ git log -2 --pretty=tformat:%h 4da45bef \
2681 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
26824da45be
Junio C Hamanoac12f0e2014-09-19 22:32:5126837134973</code></pre>
Junio C Hamano6fb124c2008-06-13 10:04:012684</div></div>
Junio C Hamanoac12f0e2014-09-19 22:32:512685<div class="paragraph"><p>In addition, any unrecognized string that has a <code>%</code> in it is interpreted
2686as if it has <code>tformat:</code> in front of it. For example, these two are
Junio C Hamano0a235222009-03-06 08:21:092687equivalent:</p></div>
2688<div class="listingblock">
2689<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512690<pre><code>$ git log -2 --pretty=tformat:%h 4da45bef
2691$ git log -2 --pretty=%h 4da45bef</code></pre>
Junio C Hamano0a235222009-03-06 08:21:092692</div></div>
Junio C Hamano6fb124c2008-06-13 10:04:012693</li>
Junio C Hamanoba4b9282008-07-06 05:20:312694</ul></div>
Junio C Hamano1a4e8412005-12-27 08:17:232695</div>
Junio C Hamano9629d4f2012-12-19 00:28:272696</div>
2697<div class="sect1">
Junio C Hamano58f587a2013-07-22 19:20:592698<h2 id="_common_diff_options">COMMON DIFF OPTIONS</h2>
Junio C Hamanod2c978f2011-03-20 19:42:222699<div class="sectionbody">
2700<div class="dlist"><dl>
2701<dt class="hdlist1">
2702-p
2703</dt>
2704<dt class="hdlist1">
2705-u
2706</dt>
2707<dt class="hdlist1">
2708--patch
2709</dt>
2710<dd>
2711<p>
2712 Generate patch (see section on generating patches).
Junio C Hamanod2c978f2011-03-20 19:42:222713</p>
2714</dd>
2715<dt class="hdlist1">
Junio C Hamano58f587a2013-07-22 19:20:592716-s
2717</dt>
2718<dt class="hdlist1">
2719--no-patch
2720</dt>
2721<dd>
2722<p>
Junio C Hamanoac12f0e2014-09-19 22:32:512723 Suppress diff output. Useful for commands like <code>git show</code> that
2724 show the patch by default, or to cancel the effect of <code>--patch</code>.
Junio C Hamano58f587a2013-07-22 19:20:592725</p>
2726</dd>
2727<dt class="hdlist1">
Junio C Hamanod2c978f2011-03-20 19:42:222728-U&lt;n&gt;
2729</dt>
2730<dt class="hdlist1">
2731--unified=&lt;n&gt;
2732</dt>
2733<dd>
2734<p>
2735 Generate diffs with &lt;n&gt; lines of context instead of
2736 the usual three.
Junio C Hamanoac12f0e2014-09-19 22:32:512737 Implies <code>-p</code>.
Junio C Hamanod2c978f2011-03-20 19:42:222738</p>
2739</dd>
2740<dt class="hdlist1">
2741--raw
2742</dt>
2743<dd>
2744<p>
Junio C Hamano85f1fde2015-06-01 20:37:322745 For each commit, show a summary of changes using the raw diff
2746 format. See the "RAW OUTPUT FORMAT" section of
2747 <a href="git-diff.html">git-diff(1)</a>. This is different from showing the log
2748 itself in raw format, which you can achieve with
2749 <code>--format=raw</code>.
Junio C Hamanod2c978f2011-03-20 19:42:222750</p>
2751</dd>
2752<dt class="hdlist1">
2753--patch-with-raw
2754</dt>
2755<dd>
2756<p>
Junio C Hamanoac12f0e2014-09-19 22:32:512757 Synonym for <code>-p --raw</code>.
Junio C Hamanod2c978f2011-03-20 19:42:222758</p>
2759</dd>
2760<dt class="hdlist1">
Junio C Hamano5a73f302011-10-14 05:58:342761--minimal
2762</dt>
2763<dd>
2764<p>
2765 Spend extra time to make sure the smallest possible
2766 diff is produced.
2767</p>
2768</dd>
2769<dt class="hdlist1">
Junio C Hamanod2c978f2011-03-20 19:42:222770--patience
2771</dt>
2772<dd>
2773<p>
2774 Generate a diff using the "patience diff" algorithm.
2775</p>
2776</dd>
2777<dt class="hdlist1">
Junio C Hamanoaea9e6b2012-03-07 00:17:112778--histogram
2779</dt>
2780<dd>
2781<p>
2782 Generate a diff using the "histogram diff" algorithm.
2783</p>
2784</dd>
2785<dt class="hdlist1">
Junio C Hamano80ad00d2013-02-18 00:19:032786--diff-algorithm={patience|minimal|histogram|myers}
2787</dt>
2788<dd>
2789<p>
2790 Choose a diff algorithm. The variants are as follows:
2791</p>
2792<div class="openblock">
2793<div class="content">
2794<div class="dlist"><dl>
2795<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:512796<code>default</code>, <code>myers</code>
Junio C Hamano80ad00d2013-02-18 00:19:032797</dt>
2798<dd>
2799<p>
2800 The basic greedy diff algorithm. Currently, this is the default.
2801</p>
2802</dd>
2803<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:512804<code>minimal</code>
Junio C Hamano80ad00d2013-02-18 00:19:032805</dt>
2806<dd>
2807<p>
2808 Spend extra time to make sure the smallest possible diff is
2809 produced.
2810</p>
2811</dd>
2812<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:512813<code>patience</code>
Junio C Hamano80ad00d2013-02-18 00:19:032814</dt>
2815<dd>
2816<p>
2817 Use "patience diff" algorithm when generating patches.
2818</p>
2819</dd>
2820<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:512821<code>histogram</code>
Junio C Hamano80ad00d2013-02-18 00:19:032822</dt>
2823<dd>
2824<p>
2825 This algorithm extends the patience algorithm to "support
2826 low-occurrence common elements".
2827</p>
2828</dd>
2829</dl></div>
2830</div></div>
2831<div class="paragraph"><p>For instance, if you configured diff.algorithm variable to a
2832non-default value and want to use the default one, then you
Junio C Hamanoac12f0e2014-09-19 22:32:512833have to use <code>--diff-algorithm=default</code> option.</p></div>
Junio C Hamano80ad00d2013-02-18 00:19:032834</dd>
2835<dt class="hdlist1">
Junio C Hamano4c4b0122011-06-30 01:19:322836--stat[=&lt;width&gt;[,&lt;name-width&gt;[,&lt;count&gt;]]]
Junio C Hamanod2c978f2011-03-20 19:42:222837</dt>
2838<dd>
2839<p>
Junio C Hamanoaea9e6b2012-03-07 00:17:112840 Generate a diffstat. By default, as much space as necessary
2841 will be used for the filename part, and the rest for the graph
2842 part. Maximum width defaults to terminal width, or 80 columns
Junio C Hamano7f2b3cb2012-06-22 22:42:392843 if not connected to a terminal, and can be overridden by
Junio C Hamanoac12f0e2014-09-19 22:32:512844 <code>&lt;width&gt;</code>. The width of the filename part can be limited by
2845 giving another width <code>&lt;name-width&gt;</code> after a comma. The width
Junio C Hamanoaea9e6b2012-03-07 00:17:112846 of the graph part can be limited by using
Junio C Hamanoac12f0e2014-09-19 22:32:512847 <code>--stat-graph-width=&lt;width&gt;</code> (affects all commands generating
2848 a stat graph) or by setting <code>diff.statGraphWidth=&lt;width&gt;</code>
2849 (does not affect <code>git format-patch</code>).
2850 By giving a third parameter <code>&lt;count&gt;</code>, you can limit the
2851 output to the first <code>&lt;count&gt;</code> lines, followed by <code>...</code> if
Junio C Hamanoaea9e6b2012-03-07 00:17:112852 there are more.
Junio C Hamanod2c978f2011-03-20 19:42:222853</p>
Junio C Hamanoac12f0e2014-09-19 22:32:512854<div class="paragraph"><p>These parameters can also be set individually with <code>--stat-width=&lt;width&gt;</code>,
2855<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:222856</dd>
2857<dt class="hdlist1">
2858--numstat
2859</dt>
2860<dd>
2861<p>
Junio C Hamanoac12f0e2014-09-19 22:32:512862 Similar to <code>--stat</code>, but shows number of added and
Junio C Hamanod2c978f2011-03-20 19:42:222863 deleted lines in decimal notation and pathname without
2864 abbreviation, to make it more machine friendly. For
Junio C Hamanoac12f0e2014-09-19 22:32:512865 binary files, outputs two <code>-</code> instead of saying
2866 <code>0 0</code>.
Junio C Hamanod2c978f2011-03-20 19:42:222867</p>
2868</dd>
2869<dt class="hdlist1">
2870--shortstat
2871</dt>
2872<dd>
2873<p>
Junio C Hamanoac12f0e2014-09-19 22:32:512874 Output only the last line of the <code>--stat</code> format containing total
Junio C Hamanod2c978f2011-03-20 19:42:222875 number of modified files, as well as number of added and deleted
2876 lines.
2877</p>
2878</dd>
2879<dt class="hdlist1">
Junio C Hamano1c222c52011-05-13 19:55:322880--dirstat[=&lt;param1,param2,&#8230;&gt;]
Junio C Hamanod2c978f2011-03-20 19:42:222881</dt>
2882<dd>
2883<p>
Junio C Hamano1c222c52011-05-13 19:55:322884 Output the distribution of relative amount of changes for each
Junio C Hamanoac12f0e2014-09-19 22:32:512885 sub-directory. The behavior of <code>--dirstat</code> can be customized by
Junio C Hamano1c222c52011-05-13 19:55:322886 passing it a comma separated list of parameters.
Junio C Hamanoac12f0e2014-09-19 22:32:512887 The defaults are controlled by the <code>diff.dirstat</code> configuration
Junio C Hamanoa28a9202012-06-21 07:08:232888 variable (see <a href="git-config.html">git-config(1)</a>).
Junio C Hamano1c222c52011-05-13 19:55:322889 The following parameters are available:
Junio C Hamanod2c978f2011-03-20 19:42:222890</p>
Junio C Hamano9629d4f2012-12-19 00:28:272891<div class="openblock">
2892<div class="content">
Junio C Hamano1c222c52011-05-13 19:55:322893<div class="dlist"><dl>
2894<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:512895<code>changes</code>
Junio C Hamano1c222c52011-05-13 19:55:322896</dt>
2897<dd>
2898<p>
2899 Compute the dirstat numbers by counting the lines that have been
2900 removed from the source, or added to the destination. This ignores
2901 the amount of pure code movements within a file. In other words,
2902 rearranging lines in a file is not counted as much as other changes.
2903 This is the default behavior when no parameter is given.
2904</p>
Junio C Hamanod2c978f2011-03-20 19:42:222905</dd>
2906<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:512907<code>lines</code>
Junio C Hamanod2c978f2011-03-20 19:42:222908</dt>
2909<dd>
2910<p>
Junio C Hamano1c222c52011-05-13 19:55:322911 Compute the dirstat numbers by doing the regular line-based diff
2912 analysis, and summing the removed/added line counts. (For binary
2913 files, count 64-byte chunks instead, since binary files have no
Junio C Hamanoac12f0e2014-09-19 22:32:512914 natural concept of lines). This is a more expensive <code>--dirstat</code>
2915 behavior than the <code>changes</code> behavior, but it does count rearranged
Junio C Hamano1c222c52011-05-13 19:55:322916 lines within a file as much as other changes. The resulting output
Junio C Hamanoac12f0e2014-09-19 22:32:512917 is consistent with what you get from the other <code>--*stat</code> options.
Junio C Hamanod2c978f2011-03-20 19:42:222918</p>
2919</dd>
2920<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:512921<code>files</code>
Junio C Hamano1c222c52011-05-13 19:55:322922</dt>
2923<dd>
2924<p>
2925 Compute the dirstat numbers by counting the number of files changed.
2926 Each changed file counts equally in the dirstat analysis. This is
Junio C Hamanoac12f0e2014-09-19 22:32:512927 the computationally cheapest <code>--dirstat</code> behavior, since it does
Junio C Hamano1c222c52011-05-13 19:55:322928 not have to look at the file contents at all.
2929</p>
2930</dd>
2931<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:512932<code>cumulative</code>
Junio C Hamano1c222c52011-05-13 19:55:322933</dt>
2934<dd>
2935<p>
2936 Count changes in a child directory for the parent directory as well.
Junio C Hamanoac12f0e2014-09-19 22:32:512937 Note that when using <code>cumulative</code>, the sum of the percentages
Junio C Hamano1c222c52011-05-13 19:55:322938 reported may exceed 100%. The default (non-cumulative) behavior can
Junio C Hamanoac12f0e2014-09-19 22:32:512939 be specified with the <code>noncumulative</code> parameter.
Junio C Hamano1c222c52011-05-13 19:55:322940</p>
2941</dd>
2942<dt class="hdlist1">
2943&lt;limit&gt;
2944</dt>
2945<dd>
2946<p>
2947 An integer parameter specifies a cut-off percent (3% by default).
2948 Directories contributing less than this percentage of the changes
2949 are not shown in the output.
2950</p>
2951</dd>
2952</dl></div>
Junio C Hamano9629d4f2012-12-19 00:28:272953</div></div>
Junio C Hamano1c222c52011-05-13 19:55:322954<div class="paragraph"><p>Example: The following will count changed files, while ignoring
2955directories with less than 10% of the total amount of changed files,
2956and accumulating child directory counts in the parent directories:
Junio C Hamanoac12f0e2014-09-19 22:32:512957<code>--dirstat=files,10,cumulative</code>.</p></div>
Junio C Hamano1c222c52011-05-13 19:55:322958</dd>
2959<dt class="hdlist1">
Junio C Hamanod2c978f2011-03-20 19:42:222960--summary
2961</dt>
2962<dd>
2963<p>
2964 Output a condensed summary of extended header information
2965 such as creations, renames and mode changes.
2966</p>
2967</dd>
2968<dt class="hdlist1">
2969--patch-with-stat
2970</dt>
2971<dd>
2972<p>
Junio C Hamanoac12f0e2014-09-19 22:32:512973 Synonym for <code>-p --stat</code>.
Junio C Hamanod2c978f2011-03-20 19:42:222974</p>
2975</dd>
2976<dt class="hdlist1">
2977-z
2978</dt>
2979<dd>
2980<p>
2981 Separate the commits with NULs instead of with new newlines.
2982</p>
Junio C Hamanoac12f0e2014-09-19 22:32:512983<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:222984pathnames and use NULs as output field terminators.</p></div>
2985<div class="paragraph"><p>Without this option, each pathname output will have TAB, LF, double quotes,
Junio C Hamanoac12f0e2014-09-19 22:32:512986and backslash characters replaced with <code>\t</code>, <code>\n</code>, <code>\"</code>, and <code>\\</code>,
Junio C Hamanod2c978f2011-03-20 19:42:222987respectively, and the pathname will be enclosed in double quotes if
2988any of those replacements occurred.</p></div>
2989</dd>
2990<dt class="hdlist1">
2991--name-only
2992</dt>
2993<dd>
2994<p>
2995 Show only names of changed files.
2996</p>
2997</dd>
2998<dt class="hdlist1">
2999--name-status
3000</dt>
3001<dd>
3002<p>
3003 Show only names and status of changed files. See the description
Junio C Hamanoac12f0e2014-09-19 22:32:513004 of the <code>--diff-filter</code> option on what the status letters mean.
Junio C Hamanod2c978f2011-03-20 19:42:223005</p>
3006</dd>
3007<dt class="hdlist1">
3008--submodule[=&lt;format&gt;]
3009</dt>
3010<dd>
3011<p>
Junio C Hamanoac12f0e2014-09-19 22:32:513012 Specify how differences in submodules are shown. When <code>--submodule</code>
3013 or <code>--submodule=log</code> is given, the <em>log</em> format is used. This format lists
3014 the commits in the range like <a href="git-submodule.html">git-submodule(1)</a> <code>summary</code> does.
3015 Omitting the <code>--submodule</code> option or specifying <code>--submodule=short</code>,
Junio C Hamanoe768cc12012-03-16 05:43:053016 uses the <em>short</em> format. This format just shows the names of the commits
Junio C Hamanob4e58b12012-11-26 03:13:063017 at the beginning and end of the range. Can be tweaked via the
Junio C Hamanoac12f0e2014-09-19 22:32:513018 <code>diff.submodule</code> configuration variable.
Junio C Hamanod2c978f2011-03-20 19:42:223019</p>
3020</dd>
3021<dt class="hdlist1">
3022--color[=&lt;when&gt;]
3023</dt>
3024<dd>
3025<p>
3026 Show colored diff.
Junio C Hamanoac12f0e2014-09-19 22:32:513027 <code>--color</code> (i.e. without <em>=&lt;when&gt;</em>) is the same as <code>--color=always</code>.
3028 <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:223029</p>
3030</dd>
3031<dt class="hdlist1">
3032--no-color
3033</dt>
3034<dd>
3035<p>
Junio C Hamano5f2627d2011-05-06 20:23:483036 Turn off colored diff.
Junio C Hamanoac12f0e2014-09-19 22:32:513037 It is the same as <code>--color=never</code>.
Junio C Hamanod2c978f2011-03-20 19:42:223038</p>
3039</dd>
3040<dt class="hdlist1">
3041--word-diff[=&lt;mode&gt;]
3042</dt>
3043<dd>
3044<p>
3045 Show a word diff, using the &lt;mode&gt; to delimit changed words.
3046 By default, words are delimited by whitespace; see
Junio C Hamanoac12f0e2014-09-19 22:32:513047 <code>--word-diff-regex</code> below. The &lt;mode&gt; defaults to <em>plain</em>, and
Junio C Hamanod2c978f2011-03-20 19:42:223048 must be one of:
3049</p>
Junio C Hamano9629d4f2012-12-19 00:28:273050<div class="openblock">
3051<div class="content">
Junio C Hamanod2c978f2011-03-20 19:42:223052<div class="dlist"><dl>
3053<dt class="hdlist1">
3054color
3055</dt>
3056<dd>
3057<p>
Junio C Hamanoac12f0e2014-09-19 22:32:513058 Highlight changed words using only colors. Implies <code>--color</code>.
Junio C Hamanod2c978f2011-03-20 19:42:223059</p>
3060</dd>
3061<dt class="hdlist1">
3062plain
3063</dt>
3064<dd>
3065<p>
Junio C Hamanoac12f0e2014-09-19 22:32:513066 Show words as <code>[-removed-]</code> and <code>{+added+}</code>. Makes no
Junio C Hamanod2c978f2011-03-20 19:42:223067 attempts to escape the delimiters if they appear in the input,
3068 so the output may be ambiguous.
3069</p>
3070</dd>
3071<dt class="hdlist1">
3072porcelain
3073</dt>
3074<dd>
3075<p>
3076 Use a special line-based format intended for script
3077 consumption. Added/removed/unchanged runs are printed in the
Junio C Hamanoac12f0e2014-09-19 22:32:513078 usual unified diff format, starting with a <code>+</code>/<code>-</code>/` `
Junio C Hamanod2c978f2011-03-20 19:42:223079 character at the beginning of the line and extending to the
3080 end of the line. Newlines in the input are represented by a
Junio C Hamanoac12f0e2014-09-19 22:32:513081 tilde <code>~</code> on a line of its own.
Junio C Hamanod2c978f2011-03-20 19:42:223082</p>
3083</dd>
3084<dt class="hdlist1">
3085none
3086</dt>
3087<dd>
3088<p>
3089 Disable word diff again.
3090</p>
3091</dd>
3092</dl></div>
Junio C Hamano9629d4f2012-12-19 00:28:273093</div></div>
Junio C Hamanod2c978f2011-03-20 19:42:223094<div class="paragraph"><p>Note that despite the name of the first mode, color is used to
3095highlight the changed parts in all modes if enabled.</p></div>
3096</dd>
3097<dt class="hdlist1">
3098--word-diff-regex=&lt;regex&gt;
3099</dt>
3100<dd>
3101<p>
3102 Use &lt;regex&gt; to decide what a word is, instead of considering
3103 runs of non-whitespace to be a word. Also implies
Junio C Hamanoac12f0e2014-09-19 22:32:513104 <code>--word-diff</code> unless it was already enabled.
Junio C Hamanod2c978f2011-03-20 19:42:223105</p>
3106<div class="paragraph"><p>Every non-overlapping match of the
3107&lt;regex&gt; is considered a word. Anything between these matches is
3108considered whitespace and ignored(!) for the purposes of finding
Junio C Hamanoac12f0e2014-09-19 22:32:513109differences. You may want to append <code>|[^[:space:]]</code> to your regular
Junio C Hamanod2c978f2011-03-20 19:42:223110expression to make sure that it matches all non-whitespace characters.
3111A match that contains a newline is silently truncated(!) at the
3112newline.</p></div>
Junio C Hamano713eded2015-12-03 00:24:023113<div class="paragraph"><p>For example, <code>--word-diff-regex=.</code> will treat each character as a word
3114and, correspondingly, show differences character by character.</p></div>
Junio C Hamanod2c978f2011-03-20 19:42:223115<div class="paragraph"><p>The regex can also be set via a diff driver or configuration option, see
Junio C Hamanoa28a9202012-06-21 07:08:233116<a href="gitattributes.html">gitattributes(1)</a> or <a href="git-config.html">git-config(1)</a>. Giving it explicitly
Junio C Hamanod2c978f2011-03-20 19:42:223117overrides any diff driver or configuration setting. Diff drivers
3118override configuration settings.</p></div>
3119</dd>
3120<dt class="hdlist1">
3121--color-words[=&lt;regex&gt;]
3122</dt>
3123<dd>
3124<p>
Junio C Hamanoac12f0e2014-09-19 22:32:513125 Equivalent to <code>--word-diff=color</code> plus (if a regex was
3126 specified) <code>--word-diff-regex=&lt;regex&gt;</code>.
Junio C Hamanod2c978f2011-03-20 19:42:223127</p>
3128</dd>
3129<dt class="hdlist1">
3130--no-renames
3131</dt>
3132<dd>
3133<p>
3134 Turn off rename detection, even when the configuration
3135 file gives the default to do so.
3136</p>
3137</dd>
3138<dt class="hdlist1">
3139--check
3140</dt>
3141<dd>
3142<p>
Junio C Hamano6005bfa2011-06-23 00:51:223143 Warn if changes introduce whitespace errors. What are
Junio C Hamanoac12f0e2014-09-19 22:32:513144 considered whitespace errors is controlled by <code>core.whitespace</code>
Junio C Hamano6005bfa2011-06-23 00:51:223145 configuration. By default, trailing whitespaces (including
3146 lines that solely consist of whitespaces) and a space character
3147 that is immediately followed by a tab character inside the
3148 initial indent of the line are considered whitespace errors.
3149 Exits with non-zero status if problems are found. Not compatible
3150 with --exit-code.
Junio C Hamanod2c978f2011-03-20 19:42:223151</p>
3152</dd>
3153<dt class="hdlist1">
Junio C Hamano8c5d5942015-06-11 19:37:483154--ws-error-highlight=&lt;kind&gt;
3155</dt>
3156<dd>
3157<p>
3158 Highlight whitespace errors on lines specified by &lt;kind&gt;
3159 in the color specified by <code>color.diff.whitespace</code>. &lt;kind&gt;
3160 is a comma separated list of <code>old</code>, <code>new</code>, <code>context</code>. When
3161 this option is not given, only whitespace errors in <code>new</code>
3162 lines are highlighted. E.g. <code>--ws-error-highlight=new,old</code>
3163 highlights whitespace errors on both deleted and added lines.
3164 <code>all</code> can be used as a short-hand for <code>old,new,context</code>.
3165</p>
3166</dd>
3167<dt class="hdlist1">
Junio C Hamanod2c978f2011-03-20 19:42:223168--full-index
3169</dt>
3170<dd>
3171<p>
3172 Instead of the first handful of characters, show the full
3173 pre- and post-image blob object names on the "index"
3174 line when generating patch format output.
3175</p>
3176</dd>
3177<dt class="hdlist1">
3178--binary
3179</dt>
3180<dd>
3181<p>
Junio C Hamanoac12f0e2014-09-19 22:32:513182 In addition to <code>--full-index</code>, output a binary diff that
3183 can be applied with <code>git-apply</code>.
Junio C Hamanod2c978f2011-03-20 19:42:223184</p>
3185</dd>
3186<dt class="hdlist1">
3187--abbrev[=&lt;n&gt;]
3188</dt>
3189<dd>
3190<p>
3191 Instead of showing the full 40-byte hexadecimal object
3192 name in diff-raw format output and diff-tree header
3193 lines, show only a partial prefix. This is
Junio C Hamanoac12f0e2014-09-19 22:32:513194 independent of the <code>--full-index</code> option above, which controls
Junio C Hamanod2c978f2011-03-20 19:42:223195 the diff-patch output format. Non default number of
Junio C Hamanoac12f0e2014-09-19 22:32:513196 digits can be specified with <code>--abbrev=&lt;n&gt;</code>.
Junio C Hamanod2c978f2011-03-20 19:42:223197</p>
3198</dd>
3199<dt class="hdlist1">
3200-B[&lt;n&gt;][/&lt;m&gt;]
3201</dt>
3202<dt class="hdlist1">
3203--break-rewrites[=[&lt;n&gt;][/&lt;m&gt;]]
3204</dt>
3205<dd>
3206<p>
3207 Break complete rewrite changes into pairs of delete and
3208 create. This serves two purposes:
3209</p>
3210<div class="paragraph"><p>It affects the way a change that amounts to a total rewrite of a file
3211not as a series of deletion and insertion mixed together with a very
3212few lines that happen to match textually as the context, but as a
3213single deletion of everything old followed by a single insertion of
Junio C Hamanoac12f0e2014-09-19 22:32:513214everything new, and the number <code>m</code> controls this aspect of the -B
3215option (defaults to 60%). <code>-B/70%</code> specifies that less than 30% of the
Junio C Hamano076ffcc2013-02-06 05:13:213216original should remain in the result for Git to consider it a total
Junio C Hamanod2c978f2011-03-20 19:42:223217rewrite (i.e. otherwise the resulting patch will be a series of
3218deletion and insertion mixed together with context lines).</p></div>
3219<div class="paragraph"><p>When used with -M, a totally-rewritten file is also considered as the
3220source of a rename (usually -M only considers a file that disappeared
Junio C Hamanoac12f0e2014-09-19 22:32:513221as the source of a rename), and the number <code>n</code> controls this aspect of
3222the -B option (defaults to 50%). <code>-B20%</code> specifies that a change with
Junio C Hamanod2c978f2011-03-20 19:42:223223addition and deletion compared to 20% or more of the file&#8217;s size are
3224eligible for being picked up as a possible source of a rename to
3225another file.</p></div>
3226</dd>
3227<dt class="hdlist1">
3228-M[&lt;n&gt;]
3229</dt>
3230<dt class="hdlist1">
3231--find-renames[=&lt;n&gt;]
3232</dt>
3233<dd>
3234<p>
3235 If generating diffs, detect and report renames for each commit.
3236 For following files across renames while traversing history, see
Junio C Hamanoac12f0e2014-09-19 22:32:513237 <code>--follow</code>.
3238 If <code>n</code> is specified, it is a threshold on the similarity
Junio C Hamanod2c978f2011-03-20 19:42:223239 index (i.e. amount of addition/deletions compared to the
Junio C Hamanoac12f0e2014-09-19 22:32:513240 file&#8217;s size). For example, <code>-M90%</code> means Git should consider a
Junio C Hamanod2c978f2011-03-20 19:42:223241 delete/add pair to be a rename if more than 90% of the file
Junio C Hamanoac12f0e2014-09-19 22:32:513242 hasn&#8217;t changed. Without a <code>%</code> sign, the number is to be read as
3243 a fraction, with a decimal point before it. I.e., <code>-M5</code> becomes
3244 0.5, and is thus the same as <code>-M50%</code>. Similarly, <code>-M05</code> is
3245 the same as <code>-M5%</code>. To limit detection to exact renames, use
3246 <code>-M100%</code>. The default similarity index is 50%.
Junio C Hamanod2c978f2011-03-20 19:42:223247</p>
3248</dd>
3249<dt class="hdlist1">
3250-C[&lt;n&gt;]
3251</dt>
3252<dt class="hdlist1">
3253--find-copies[=&lt;n&gt;]
3254</dt>
3255<dd>
3256<p>
Junio C Hamanoac12f0e2014-09-19 22:32:513257 Detect copies as well as renames. See also <code>--find-copies-harder</code>.
3258 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:223259</p>
3260</dd>
3261<dt class="hdlist1">
3262--find-copies-harder
3263</dt>
3264<dd>
3265<p>
Junio C Hamanoac12f0e2014-09-19 22:32:513266 For performance reasons, by default, <code>-C</code> option finds copies only
Junio C Hamanod2c978f2011-03-20 19:42:223267 if the original file of the copy was modified in the same
3268 changeset. This flag makes the command
3269 inspect unmodified files as candidates for the source of
3270 copy. This is a very expensive operation for large
3271 projects, so use it with caution. Giving more than one
Junio C Hamanoac12f0e2014-09-19 22:32:513272 <code>-C</code> option has the same effect.
Junio C Hamanod2c978f2011-03-20 19:42:223273</p>
3274</dd>
3275<dt class="hdlist1">
Junio C Hamanob02377c2011-04-28 22:26:023276-D
3277</dt>
3278<dt class="hdlist1">
3279--irreversible-delete
3280</dt>
3281<dd>
3282<p>
3283 Omit the preimage for deletes, i.e. print only the header but not
Junio C Hamanoac12f0e2014-09-19 22:32:513284 the diff between the preimage and <code>/dev/null</code>. The resulting patch
3285 is not meant to be applied with <code>patch</code> or <code>git apply</code>; this is
Junio C Hamanob02377c2011-04-28 22:26:023286 solely for people who want to just concentrate on reviewing the
3287 text after the change. In addition, the output obviously lack
3288 enough information to apply such a patch in reverse, even manually,
3289 hence the name of the option.
3290</p>
Junio C Hamanoac12f0e2014-09-19 22:32:513291<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:023292of a delete/create pair.</p></div>
3293</dd>
3294<dt class="hdlist1">
Junio C Hamanod2c978f2011-03-20 19:42:223295-l&lt;num&gt;
3296</dt>
3297<dd>
3298<p>
Junio C Hamanoac12f0e2014-09-19 22:32:513299 The <code>-M</code> and <code>-C</code> options require O(n^2) processing time where n
Junio C Hamanod2c978f2011-03-20 19:42:223300 is the number of potential rename/copy targets. This
3301 option prevents rename/copy detection from running if
3302 the number of rename/copy targets exceeds the specified
3303 number.
3304</p>
3305</dd>
3306<dt class="hdlist1">
3307--diff-filter=[(A|C|D|M|R|T|U|X|B)&#8230;[*]]
3308</dt>
3309<dd>
3310<p>
Junio C Hamanoac12f0e2014-09-19 22:32:513311 Select only files that are Added (<code>A</code>), Copied (<code>C</code>),
3312 Deleted (<code>D</code>), Modified (<code>M</code>), Renamed (<code>R</code>), have their
3313 type (i.e. regular file, symlink, submodule, &#8230;) changed (<code>T</code>),
3314 are Unmerged (<code>U</code>), are
3315 Unknown (<code>X</code>), or have had their pairing Broken (<code>B</code>).
Junio C Hamanod2c978f2011-03-20 19:42:223316 Any combination of the filter characters (including none) can be used.
Junio C Hamanoac12f0e2014-09-19 22:32:513317 When <code>*</code> (All-or-none) is added to the combination, all
Junio C Hamanod2c978f2011-03-20 19:42:223318 paths are selected if there is any file that matches
3319 other criteria in the comparison; if there is no file
3320 that matches other criteria, nothing is selected.
3321</p>
3322</dd>
3323<dt class="hdlist1">
3324-S&lt;string&gt;
3325</dt>
3326<dd>
3327<p>
Junio C Hamanof1f5a7b2013-06-11 22:23:523328 Look for differences that change the number of occurrences of
3329 the specified string (i.e. addition/deletion) in a file.
3330 Intended for the scripter&#8217;s use.
Junio C Hamanod2c978f2011-03-20 19:42:223331</p>
Junio C Hamanof1f5a7b2013-06-11 22:23:523332<div class="paragraph"><p>It is useful when you&#8217;re looking for an exact block of code (like a
3333struct), and want to know the history of that block since it first
3334came into being: use the feature iteratively to feed the interesting
Junio C Hamanoac12f0e2014-09-19 22:32:513335block in the preimage back into <code>-S</code>, and keep going until you get the
Junio C Hamanof1f5a7b2013-06-11 22:23:523336very first version of the block.</p></div>
Junio C Hamanod2c978f2011-03-20 19:42:223337</dd>
3338<dt class="hdlist1">
3339-G&lt;regex&gt;
3340</dt>
3341<dd>
3342<p>
Junio C Hamanof1f5a7b2013-06-11 22:23:523343 Look for differences whose patch text contains added/removed
3344 lines that match &lt;regex&gt;.
Junio C Hamanod2c978f2011-03-20 19:42:223345</p>
Junio C Hamanoac12f0e2014-09-19 22:32:513346<div class="paragraph"><p>To illustrate the difference between <code>-S&lt;regex&gt; --pickaxe-regex</code> and
3347<code>-G&lt;regex&gt;</code>, consider a commit with the following diff in the same
Junio C Hamanof1f5a7b2013-06-11 22:23:523348file:</p></div>
3349<div class="listingblock">
3350<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:513351<pre><code>+ return !regexec(regexp, two-&gt;ptr, 1, &amp;regmatch, 0);
Junio C Hamanof1f5a7b2013-06-11 22:23:523352...
Junio C Hamanoac12f0e2014-09-19 22:32:513353- hit = !regexec(regexp, mf2.ptr, 1, &amp;regmatch, 0);</code></pre>
Junio C Hamanof1f5a7b2013-06-11 22:23:523354</div></div>
Junio C Hamanoac12f0e2014-09-19 22:32:513355<div class="paragraph"><p>While <code>git log -G"regexec\(regexp"</code> will show this commit, <code>git log
3356-S"regexec\(regexp" --pickaxe-regex</code> will not (because the number of
Junio C Hamanof1f5a7b2013-06-11 22:23:523357occurrences of that string did not change).</p></div>
3358<div class="paragraph"><p>See the <em>pickaxe</em> entry in <a href="gitdiffcore.html">gitdiffcore(7)</a> for more
3359information.</p></div>
Junio C Hamanod2c978f2011-03-20 19:42:223360</dd>
3361<dt class="hdlist1">
3362--pickaxe-all
3363</dt>
3364<dd>
3365<p>
Junio C Hamanoac12f0e2014-09-19 22:32:513366 When <code>-S</code> or <code>-G</code> finds a change, show all the changes in that
Junio C Hamanod2c978f2011-03-20 19:42:223367 changeset, not just the files that contain the change
3368 in &lt;string&gt;.
3369</p>
3370</dd>
3371<dt class="hdlist1">
3372--pickaxe-regex
3373</dt>
3374<dd>
3375<p>
Junio C Hamanoac12f0e2014-09-19 22:32:513376 Treat the &lt;string&gt; given to <code>-S</code> as an extended POSIX regular
Junio C Hamanof1f5a7b2013-06-11 22:23:523377 expression to match.
Junio C Hamanod2c978f2011-03-20 19:42:223378</p>
3379</dd>
3380<dt class="hdlist1">
3381-O&lt;orderfile&gt;
3382</dt>
3383<dd>
3384<p>
3385 Output the patch in the order specified in the
3386 &lt;orderfile&gt;, which has one shell glob pattern per line.
Junio C Hamano322c6242015-03-23 21:32:463387 This overrides the <code>diff.orderFile</code> configuration variable
3388 (see <a href="git-config.html">git-config(1)</a>). To cancel <code>diff.orderFile</code>,
Junio C Hamanoac12f0e2014-09-19 22:32:513389 use <code>-O/dev/null</code>.
Junio C Hamanod2c978f2011-03-20 19:42:223390</p>
3391</dd>
3392<dt class="hdlist1">
3393-R
3394</dt>
3395<dd>
3396<p>
3397 Swap two inputs; that is, show differences from index or
3398 on-disk file to tree contents.
3399</p>
3400</dd>
3401<dt class="hdlist1">
3402--relative[=&lt;path&gt;]
3403</dt>
3404<dd>
3405<p>
3406 When run from a subdirectory of the project, it can be
3407 told to exclude changes outside the directory and show
3408 pathnames relative to it with this option. When you are
3409 not in a subdirectory (e.g. in a bare repository), you
3410 can name which subdirectory to make the output relative
3411 to by giving a &lt;path&gt; as an argument.
3412</p>
3413</dd>
3414<dt class="hdlist1">
3415-a
3416</dt>
3417<dt class="hdlist1">
3418--text
3419</dt>
3420<dd>
3421<p>
3422 Treat all files as text.
3423</p>
3424</dd>
3425<dt class="hdlist1">
3426--ignore-space-at-eol
3427</dt>
3428<dd>
3429<p>
3430 Ignore changes in whitespace at EOL.
3431</p>
3432</dd>
3433<dt class="hdlist1">
3434-b
3435</dt>
3436<dt class="hdlist1">
3437--ignore-space-change
3438</dt>
3439<dd>
3440<p>
3441 Ignore changes in amount of whitespace. This ignores whitespace
3442 at line end, and considers all other sequences of one or
3443 more whitespace characters to be equivalent.
3444</p>
3445</dd>
3446<dt class="hdlist1">
3447-w
3448</dt>
3449<dt class="hdlist1">
3450--ignore-all-space
3451</dt>
3452<dd>
3453<p>
3454 Ignore whitespace when comparing lines. This ignores
3455 differences even if one line has whitespace where the other
3456 line has none.
3457</p>
3458</dd>
3459<dt class="hdlist1">
Junio C Hamanoa1952302013-07-01 21:31:183460--ignore-blank-lines
3461</dt>
3462<dd>
3463<p>
3464 Ignore changes whose lines are all blank.
3465</p>
3466</dd>
3467<dt class="hdlist1">
Junio C Hamanod2c978f2011-03-20 19:42:223468--inter-hunk-context=&lt;lines&gt;
3469</dt>
3470<dd>
3471<p>
3472 Show the context between diff hunks, up to the specified number
3473 of lines, thereby fusing hunks that are close to each other.
3474</p>
3475</dd>
3476<dt class="hdlist1">
Junio C Hamano11821ed2011-10-19 18:42:093477-W
3478</dt>
3479<dt class="hdlist1">
3480--function-context
3481</dt>
3482<dd>
3483<p>
3484 Show whole surrounding functions of changes.
3485</p>
3486</dd>
3487<dt class="hdlist1">
Junio C Hamanod2c978f2011-03-20 19:42:223488--ext-diff
3489</dt>
3490<dd>
3491<p>
3492 Allow an external diff helper to be executed. If you set an
Junio C Hamanoa28a9202012-06-21 07:08:233493 external diff driver with <a href="gitattributes.html">gitattributes(5)</a>, you need
3494 to use this option with <a href="git-log.html">git-log(1)</a> and friends.
Junio C Hamanod2c978f2011-03-20 19:42:223495</p>
3496</dd>
3497<dt class="hdlist1">
3498--no-ext-diff
3499</dt>
3500<dd>
3501<p>
3502 Disallow external diff drivers.
3503</p>
3504</dd>
3505<dt class="hdlist1">
Junio C Hamanoc652aed2011-07-07 01:14:313506--textconv
3507</dt>
3508<dt class="hdlist1">
3509--no-textconv
3510</dt>
3511<dd>
3512<p>
3513 Allow (or disallow) external text conversion filters to be run
Junio C Hamanoa28a9202012-06-21 07:08:233514 when comparing binary files. See <a href="gitattributes.html">gitattributes(5)</a> for
Junio C Hamanoc652aed2011-07-07 01:14:313515 details. Because textconv filters are typically a one-way
3516 conversion, the resulting diff is suitable for human
3517 consumption, but cannot be applied. For this reason, textconv
Junio C Hamanoa28a9202012-06-21 07:08:233518 filters are enabled by default only for <a href="git-diff.html">git-diff(1)</a> and
3519 <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:313520 diff plumbing commands.
3521</p>
3522</dd>
3523<dt class="hdlist1">
Junio C Hamanod2c978f2011-03-20 19:42:223524--ignore-submodules[=&lt;when&gt;]
3525</dt>
3526<dd>
3527<p>
3528 Ignore changes to submodules in the diff generation. &lt;when&gt; can be
Junio C Hamanoc7102962013-05-29 23:57:173529 either "none", "untracked", "dirty" or "all", which is the default.
Junio C Hamanod2c978f2011-03-20 19:42:223530 Using "none" will consider the submodule modified when it either contains
3531 untracked or modified files or its HEAD differs from the commit recorded
3532 in the superproject and can be used to override any settings of the
Junio C Hamanoa28a9202012-06-21 07:08:233533 <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:223534 "untracked" is used submodules are not considered dirty when they only
3535 contain untracked content (but they are still scanned for modified
3536 content). Using "dirty" ignores all changes to the work tree of submodules,
3537 only changes to the commits stored in the superproject are shown (this was
3538 the behavior until 1.7.0). Using "all" hides all changes to submodules.
3539</p>
3540</dd>
3541<dt class="hdlist1">
3542--src-prefix=&lt;prefix&gt;
3543</dt>
3544<dd>
3545<p>
3546 Show the given source prefix instead of "a/".
3547</p>
3548</dd>
3549<dt class="hdlist1">
3550--dst-prefix=&lt;prefix&gt;
3551</dt>
3552<dd>
3553<p>
3554 Show the given destination prefix instead of "b/".
3555</p>
3556</dd>
3557<dt class="hdlist1">
3558--no-prefix
3559</dt>
3560<dd>
3561<p>
3562 Do not show any source or destination prefix.
3563</p>
3564</dd>
3565</dl></div>
3566<div class="paragraph"><p>For more detailed explanation on these common options, see also
Junio C Hamanoa28a9202012-06-21 07:08:233567<a href="gitdiffcore.html">gitdiffcore(7)</a>.</p></div>
Junio C Hamanod2c978f2011-03-20 19:42:223568</div>
Junio C Hamano9629d4f2012-12-19 00:28:273569</div>
3570<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:313571<h2 id="_generating_patches_with_p">Generating patches with -p</h2>
Junio C Hamano00b8b632007-12-07 09:50:493572<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:593573<div class="paragraph"><p>When "git-diff-index", "git-diff-tree", or "git-diff-files" are run
Junio C Hamano00b8b632007-12-07 09:50:493574with a <em>-p</em> option, "git diff" without the <em>--raw</em> option, or
3575"git log" with the "-p" option, they
3576do not produce the output described above; instead they produce a
3577patch file. You can customize the creation of such patches via the
Junio C Hamanoba4b9282008-07-06 05:20:313578GIT_EXTERNAL_DIFF and the GIT_DIFF_OPTS environment variables.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:593579<div class="paragraph"><p>What the -p option produces is slightly different from the traditional
Junio C Hamano7f9fa862010-10-19 23:51:143580diff format:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:593581<div class="olist arabic"><ol class="arabic">
Junio C Hamano00b8b632007-12-07 09:50:493582<li>
3583<p>
Junio C Hamano7f9fa862010-10-19 23:51:143584It is preceded with a "git diff" header that looks like this:
Junio C Hamano00b8b632007-12-07 09:50:493585</p>
3586<div class="literalblock">
3587<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:513588<pre><code>diff --git a/file1 b/file2</code></pre>
Junio C Hamano00b8b632007-12-07 09:50:493589</div></div>
Junio C Hamanoac12f0e2014-09-19 22:32:513590<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:493591involved. Especially, even for a creation or a deletion,
Junio C Hamanoac12f0e2014-09-19 22:32:513592<code>/dev/null</code> is <em>not</em> used in place of the <code>a/</code> or <code>b/</code> filenames.</p></div>
3593<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:493594name of the source file of the rename/copy and the name of
Junio C Hamanoba4b9282008-07-06 05:20:313595the file that rename/copy produces, respectively.</p></div>
Junio C Hamano00b8b632007-12-07 09:50:493596</li>
3597<li>
3598<p>
3599It is followed by one or more extended header lines:
3600</p>
3601<div class="literalblock">
3602<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:513603<pre><code>old mode &lt;mode&gt;
Junio C Hamano00b8b632007-12-07 09:50:493604new mode &lt;mode&gt;
3605deleted file mode &lt;mode&gt;
3606new file mode &lt;mode&gt;
3607copy from &lt;path&gt;
3608copy to &lt;path&gt;
3609rename from &lt;path&gt;
3610rename to &lt;path&gt;
3611similarity index &lt;number&gt;
3612dissimilarity index &lt;number&gt;
Junio C Hamanoac12f0e2014-09-19 22:32:513613index &lt;hash&gt;..&lt;hash&gt; &lt;mode&gt;</code></pre>
Junio C Hamano00b8b632007-12-07 09:50:493614</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:593615<div class="paragraph"><p>File modes are printed as 6-digit octal numbers including the file type
Junio C Hamano7f9fa862010-10-19 23:51:143616and file permission bits.</p></div>
Junio C Hamanoac12f0e2014-09-19 22:32:513617<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:593618<div class="paragraph"><p>The similarity index is the percentage of unchanged lines, and
Junio C Hamano7f9fa862010-10-19 23:51:143619the dissimilarity index is the percentage of changed lines. It
3620is a rounded down integer, followed by a percent sign. The
3621similarity index value of 100% is thus reserved for two equal
3622files, while 100% dissimilarity means that no line from the old
3623file made it into the new one.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:593624<div class="paragraph"><p>The index line includes the SHA-1 checksum before and after the change.
Junio C Hamano7f9fa862010-10-19 23:51:143625The &lt;mode&gt; is included if the file mode does not change; otherwise,
3626separate lines indicate the old and the new mode.</p></div>
Junio C Hamano00b8b632007-12-07 09:50:493627</li>
3628<li>
3629<p>
3630TAB, LF, double quote and backslash characters in pathnames
Junio C Hamanoac12f0e2014-09-19 22:32:513631 are represented as <code>\t</code>, <code>\n</code>, <code>\"</code> and <code>\\</code>, respectively.
Junio C Hamano00b8b632007-12-07 09:50:493632 If there is need for such substitution then the whole
3633 pathname is put in double quotes.
3634</p>
3635</li>
Junio C Hamano7f9fa862010-10-19 23:51:143636<li>
3637<p>
Junio C Hamanoac12f0e2014-09-19 22:32:513638All the <code>file1</code> files in the output refer to files before the
3639 commit, and all the <code>file2</code> files refer to files after the commit.
Junio C Hamano7f9fa862010-10-19 23:51:143640 It is incorrect to apply each change to each file sequentially. For
3641 example, this patch will swap a and b:
3642</p>
3643<div class="literalblock">
3644<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:513645<pre><code>diff --git a/a b/b
Junio C Hamano7f9fa862010-10-19 23:51:143646rename from a
3647rename to b
3648diff --git a/b b/a
3649rename from b
Junio C Hamanoac12f0e2014-09-19 22:32:513650rename to a</code></pre>
Junio C Hamano7f9fa862010-10-19 23:51:143651</div></div>
3652</li>
Junio C Hamanoba4b9282008-07-06 05:20:313653</ol></div>
Junio C Hamano00b8b632007-12-07 09:50:493654</div>
Junio C Hamano9629d4f2012-12-19 00:28:273655</div>
3656<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:313657<h2 id="_combined_diff_format">combined diff format</h2>
Junio C Hamano00b8b632007-12-07 09:50:493658<div class="sectionbody">
Junio C Hamano1dbca522015-05-22 20:48:553659<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:433660produce a <em>combined diff</em> when showing a merge. This is the default
Junio C Hamanoa28a9202012-06-21 07:08:233661format when showing merges with <a href="git-diff.html">git-diff(1)</a> or
Junio C Hamano1dbca522015-05-22 20:48:553662<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:433663of these commands to force generation of diffs with individual parents
3664of a merge.</p></div>
3665<div class="paragraph"><p>A <em>combined diff</em> format looks like this:</p></div>
Junio C Hamano00b8b632007-12-07 09:50:493666<div class="listingblock">
3667<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:513668<pre><code>diff --combined describe.c
Junio C Hamano00b8b632007-12-07 09:50:493669index fabadb8,cc95eb0..4866510
3670--- a/describe.c
3671+++ b/describe.c
3672@@@ -98,20 -98,12 +98,20 @@@
3673 return (a_date &gt; b_date) ? -1 : (a_date == b_date) ? 0 : 1;
3674 }
3675
3676- static void describe(char *arg)
3677 -static void describe(struct commit *cmit, int last_one)
3678++static void describe(char *arg, int last_one)
3679 {
3680 + unsigned char sha1[20];
3681 + struct commit *cmit;
3682 struct commit_list *list;
3683 static int initialized = 0;
3684 struct commit_name *n;
3685
3686 + if (get_sha1(arg, sha1) &lt; 0)
3687 + usage(describe_usage);
3688 + cmit = lookup_commit_reference(sha1);
3689 + if (!cmit)
3690 + usage(describe_usage);
3691 +
3692 if (!initialized) {
3693 initialized = 1;
Junio C Hamanoac12f0e2014-09-19 22:32:513694 for_each_ref(get_name);</code></pre>
Junio C Hamano00b8b632007-12-07 09:50:493695</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:593696<div class="olist arabic"><ol class="arabic">
Junio C Hamano00b8b632007-12-07 09:50:493697<li>
3698<p>
3699It is preceded with a "git diff" header, that looks like
3700 this (when <em>-c</em> option is used):
3701</p>
3702<div class="literalblock">
3703<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:513704<pre><code>diff --combined file</code></pre>
Junio C Hamano00b8b632007-12-07 09:50:493705</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:593706<div class="paragraph"><p>or like this (when <em>--cc</em> option is used):</p></div>
Junio C Hamano00b8b632007-12-07 09:50:493707<div class="literalblock">
3708<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:513709<pre><code>diff --cc file</code></pre>
Junio C Hamano00b8b632007-12-07 09:50:493710</div></div>
3711</li>
3712<li>
3713<p>
3714It is followed by one or more extended header lines
3715 (this example shows a merge with two parents):
3716</p>
3717<div class="literalblock">
3718<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:513719<pre><code>index &lt;hash&gt;,&lt;hash&gt;..&lt;hash&gt;
Junio C Hamano00b8b632007-12-07 09:50:493720mode &lt;mode&gt;,&lt;mode&gt;..&lt;mode&gt;
3721new file mode &lt;mode&gt;
Junio C Hamanoac12f0e2014-09-19 22:32:513722deleted file mode &lt;mode&gt;,&lt;mode&gt;</code></pre>
Junio C Hamano00b8b632007-12-07 09:50:493723</div></div>
Junio C Hamanoac12f0e2014-09-19 22:32:513724<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:493725the &lt;mode&gt; is different from the rest. Extended headers with
3726information about detected contents movement (renames and
3727copying detection) are designed to work with diff of two
Junio C Hamanoba4b9282008-07-06 05:20:313728&lt;tree-ish&gt; and are not used by combined diff format.</p></div>
Junio C Hamano00b8b632007-12-07 09:50:493729</li>
3730<li>
3731<p>
3732It is followed by two-line from-file/to-file header
3733</p>
3734<div class="literalblock">
3735<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:513736<pre><code>--- a/file
3737+++ b/file</code></pre>
Junio C Hamano00b8b632007-12-07 09:50:493738</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:593739<div class="paragraph"><p>Similar to two-line header for traditional <em>unified</em> diff
Junio C Hamanoac12f0e2014-09-19 22:32:513740format, <code>/dev/null</code> is used to signal created or deleted
Junio C Hamanoba4b9282008-07-06 05:20:313741files.</p></div>
Junio C Hamano00b8b632007-12-07 09:50:493742</li>
3743<li>
3744<p>
3745Chunk header format is modified to prevent people from
Junio C Hamanoac12f0e2014-09-19 22:32:513746 accidentally feeding it to <code>patch -p1</code>. Combined diff format
Junio C Hamano00b8b632007-12-07 09:50:493747 was created for review of merge commit changes, and was not
3748 meant for apply. The change is similar to the change in the
3749 extended <em>index</em> header:
3750</p>
3751<div class="literalblock">
3752<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:513753<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:493754</div></div>
Junio C Hamanoac12f0e2014-09-19 22:32:513755<div class="paragraph"><p>There are (number of parents + 1) <code>@</code> characters in the chunk
Junio C Hamanoba4b9282008-07-06 05:20:313756header for combined diff format.</p></div>
Junio C Hamano00b8b632007-12-07 09:50:493757</li>
Junio C Hamanoba4b9282008-07-06 05:20:313758</ol></div>
Junio C Hamano68cf15a2010-11-06 01:01:593759<div class="paragraph"><p>Unlike the traditional <em>unified</em> diff format, which shows two
Junio C Hamanoac12f0e2014-09-19 22:32:513760files 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
3761added to B), or <code>" "</code> (space&#8201;&#8212;&#8201;unchanged) prefix, this format
Junio C Hamano00b8b632007-12-07 09:50:493762compares two or more files file1, file2,&#8230; with one file X, and
3763shows how X differs from each of fileN. One column for each of
Junio C Hamano68cf15a2010-11-06 01:01:593764fileN is prepended to the output line to note how X&#8217;s line is
Junio C Hamanoba4b9282008-07-06 05:20:313765different from it.</p></div>
Junio C Hamanoac12f0e2014-09-19 22:32:513766<div class="paragraph"><p>A <code>-</code> character in the column N means that the line appears in
3767fileN but it does not appear in the result. A <code>+</code> character
Junio C Hamano54bf1e22008-12-20 06:30:113768in the column N means that the line appears in the result,
Junio C Hamano00b8b632007-12-07 09:50:493769and fileN does not have that line (in other words, the line was
Junio C Hamanoba4b9282008-07-06 05:20:313770added, from the point of view of that parent).</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:593771<div class="paragraph"><p>In the above example output, the function signature was changed
Junio C Hamanoac12f0e2014-09-19 22:32:513772from both files (hence two <code>-</code> removals from both file1 and
3773file2, plus <code>++</code> to mean one line that was added does not appear
Junio C Hamanod75148a2014-04-08 19:48:383774in either file1 or file2). Also eight other lines are the same
Junio C Hamanoac12f0e2014-09-19 22:32:513775from file1 but do not appear in file2 (hence prefixed with <code>+</code>).</p></div>
3776<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:493777merge commit with the merge result (i.e. file1..fileN are the
Junio C Hamanoac12f0e2014-09-19 22:32:513778parents). When shown by <code>git diff-files -c</code>, it compares the
Junio C Hamano00b8b632007-12-07 09:50:493779two unresolved merge parents with the working tree file
3780(i.e. file1 is stage 2 aka "our version", file2 is stage 3 aka
Junio C Hamanoba4b9282008-07-06 05:20:313781"their version").</p></div>
Junio C Hamano00b8b632007-12-07 09:50:493782</div>
Junio C Hamano9629d4f2012-12-19 00:28:273783</div>
3784<div class="sect1">
Junio C Hamano58f587a2013-07-22 19:20:593785<h2 id="_examples">EXAMPLES</h2>
Junio C Hamano1a4e8412005-12-27 08:17:233786<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:593787<div class="dlist"><dl>
3788<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:513789<code>git log --no-merges</code>
Junio C Hamano1a4e8412005-12-27 08:17:233790</dt>
3791<dd>
3792<p>
3793 Show the whole commit history, but skip any merges
3794</p>
3795</dd>
Junio C Hamano68cf15a2010-11-06 01:01:593796<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:513797<code>git log v2.6.12.. include/scsi drivers/scsi</code>
Junio C Hamano1a4e8412005-12-27 08:17:233798</dt>
3799<dd>
3800<p>
3801 Show all commits since version <em>v2.6.12</em> that changed any file
Junio C Hamanoac12f0e2014-09-19 22:32:513802 in the <code>include/scsi</code> or <code>drivers/scsi</code> subdirectories
Junio C Hamano1a4e8412005-12-27 08:17:233803</p>
3804</dd>
Junio C Hamano68cf15a2010-11-06 01:01:593805<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:513806<code>git log --since="2 weeks ago" -- gitk</code>
Junio C Hamano1a4e8412005-12-27 08:17:233807</dt>
3808<dd>
3809<p>
3810 Show the changes during the last two weeks to the file <em>gitk</em>.
Junio C Hamanob73af6c2013-12-03 22:07:113811 The &#8220;--&#8221; is necessary to avoid confusion with the <strong>branch</strong> named
Junio C Hamano1a4e8412005-12-27 08:17:233812 <em>gitk</em>
3813</p>
3814</dd>
Junio C Hamano68cf15a2010-11-06 01:01:593815<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:513816<code>git log --name-status release..test</code>
Junio C Hamanoba7c8d82006-04-15 06:17:423817</dt>
3818<dd>
3819<p>
3820 Show the commits that are in the "test" branch but not yet
3821 in the "release" branch, along with the list of paths
3822 each commit modifies.
3823</p>
3824</dd>
Junio C Hamano68cf15a2010-11-06 01:01:593825<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:513826<code>git log --follow builtin/rev-list.c</code>
Junio C Hamano235d53f2007-07-13 00:25:153827</dt>
3828<dd>
3829<p>
Junio C Hamanoac12f0e2014-09-19 22:32:513830 Shows the commits that changed <code>builtin/rev-list.c</code>, including
Junio C Hamano235d53f2007-07-13 00:25:153831 those commits that occurred before the file was given its
3832 present name.
3833</p>
3834</dd>
Junio C Hamano68cf15a2010-11-06 01:01:593835<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:513836<code>git log --branches --not --remotes=origin</code>
Junio C Hamano57827fb2010-01-23 03:02:503837</dt>
3838<dd>
3839<p>
3840 Shows all commits that are in any of local branches but not in
Junio C Hamano97bcb482010-11-25 03:16:073841 any of remote-tracking branches for <em>origin</em> (what you have that
Junio C Hamano68cf15a2010-11-06 01:01:593842 origin doesn&#8217;t).
Junio C Hamano57827fb2010-01-23 03:02:503843</p>
3844</dd>
Junio C Hamano68cf15a2010-11-06 01:01:593845<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:513846<code>git log master --not --remotes=*/master</code>
Junio C Hamano57827fb2010-01-23 03:02:503847</dt>
3848<dd>
3849<p>
3850 Shows all commits that are in local master but not in any remote
3851 repository master branches.
3852</p>
3853</dd>
Junio C Hamano68cf15a2010-11-06 01:01:593854<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:513855<code>git log -p -m --first-parent</code>
Junio C Hamano31667362010-03-25 00:38:533856</dt>
3857<dd>
3858<p>
3859 Shows the history including change diffs, but only from the
Junio C Hamanob73af6c2013-12-03 22:07:113860 &#8220;main branch&#8221; perspective, skipping commits that come from merged
Junio C Hamano31667362010-03-25 00:38:533861 branches, and showing full diffs of changes introduced by the merges.
3862 This makes sense only when following a strict policy of merging all
3863 topic branches when staying on a single integration branch.
3864</p>
3865</dd>
Junio C Hamano693e7092012-09-12 22:56:533866<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:513867<code>git log -L '/int main/',/^}/:main.c</code>
Junio C Hamano7e590a12013-06-02 23:46:523868</dt>
3869<dd>
3870<p>
Junio C Hamanoac12f0e2014-09-19 22:32:513871 Shows how the function <code>main()</code> in the file <code>main.c</code> evolved
Junio C Hamano7e590a12013-06-02 23:46:523872 over time.
3873</p>
3874</dd>
3875<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:513876<code>git log -3</code>
Junio C Hamano693e7092012-09-12 22:56:533877</dt>
3878<dd>
3879<p>
3880 Limits the number of commits to show to 3.
3881</p>
3882</dd>
Junio C Hamanoba4b9282008-07-06 05:20:313883</dl></div>
Junio C Hamano1a4e8412005-12-27 08:17:233884</div>
Junio C Hamano9629d4f2012-12-19 00:28:273885</div>
3886<div class="sect1">
Junio C Hamano58f587a2013-07-22 19:20:593887<h2 id="_discussion">DISCUSSION</h2>
Junio C Hamano775a0f42006-12-31 01:19:143888<div class="sectionbody">
Junio C Hamanod7ed4042015-08-03 19:43:003889<div class="paragraph"><p>Git is to some extent character encoding agnostic.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:593890<div class="ulist"><ul>
Junio C Hamano775a0f42006-12-31 01:19:143891<li>
3892<p>
Junio C Hamano54bf1e22008-12-20 06:30:113893The contents of the blob objects are uninterpreted sequences
Junio C Hamano775a0f42006-12-31 01:19:143894 of bytes. There is no encoding translation at the core
3895 level.
3896</p>
3897</li>
3898<li>
3899<p>
Junio C Hamanod7ed4042015-08-03 19:43:003900Path names are encoded in UTF-8 normalization form C. This
3901 applies to tree objects, the index file, ref names, as well as
3902 path names in command line arguments, environment variables
3903 and config files (<code>.git/config</code> (see <a href="git-config.html">git-config(1)</a>),
3904 <a href="gitignore.html">gitignore(5)</a>, <a href="gitattributes.html">gitattributes(5)</a> and
3905 <a href="gitmodules.html">gitmodules(5)</a>).
3906</p>
3907<div class="paragraph"><p>Note that Git at the core level treats path names simply as
3908sequences of non-NUL bytes, there are no path name encoding
3909conversions (except on Mac and Windows). Therefore, using
3910non-ASCII path names will mostly work even on platforms and file
3911systems that use legacy extended ASCII encodings. However,
3912repositories created on such systems will not work properly on
3913UTF-8-based systems (e.g. Linux, Mac, Windows) and vice versa.
3914Additionally, many Git-based tools simply assume path names to
3915be UTF-8 and will fail to display other encodings correctly.</p></div>
3916</li>
3917<li>
3918<p>
3919Commit log messages are typically encoded in UTF-8, but other
3920 extended ASCII encodings are also supported. This includes
3921 ISO-8859-x, CP125x and many others, but <em>not</em> UTF-16/32,
3922 EBCDIC and CJK multi-byte encodings (GBK, Shift-JIS, Big5,
3923 EUC-x, CP9xx etc.).
Junio C Hamano775a0f42006-12-31 01:19:143924</p>
3925</li>
Junio C Hamanoba4b9282008-07-06 05:20:313926</ul></div>
Junio C Hamano68cf15a2010-11-06 01:01:593927<div class="paragraph"><p>Although we encourage that the commit log messages are encoded
Junio C Hamano076ffcc2013-02-06 05:13:213928in UTF-8, both the core and Git Porcelain are designed not to
Junio C Hamano775a0f42006-12-31 01:19:143929force UTF-8 on projects. If all participants of a particular
Junio C Hamano076ffcc2013-02-06 05:13:213930project find it more convenient to use legacy encodings, Git
Junio C Hamano775a0f42006-12-31 01:19:143931does not forbid it. However, there are a few things to keep in
Junio C Hamanoba4b9282008-07-06 05:20:313932mind.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:593933<div class="olist arabic"><ol class="arabic">
Junio C Hamano775a0f42006-12-31 01:19:143934<li>
3935<p>
Junio C Hamano1aa40d22010-01-21 17:46:433936<em>git commit</em> and <em>git commit-tree</em> issues
Junio C Hamano14b76482008-01-05 10:32:263937 a warning if the commit log message given to it does not look
Junio C Hamano775a0f42006-12-31 01:19:143938 like a valid UTF-8 string, unless you explicitly say your
3939 project uses a legacy encoding. The way to say this is to
Junio C Hamanoac12f0e2014-09-19 22:32:513940 have i18n.commitencoding in <code>.git/config</code> file, like this:
Junio C Hamano775a0f42006-12-31 01:19:143941</p>
3942<div class="listingblock">
3943<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:513944<pre><code>[i18n]
3945 commitencoding = ISO-8859-1</code></pre>
Junio C Hamano775a0f42006-12-31 01:19:143946</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:593947<div class="paragraph"><p>Commit objects created with the above setting record the value
Junio C Hamanoac12f0e2014-09-19 22:32:513948of <code>i18n.commitencoding</code> in its <code>encoding</code> header. This is to
Junio C Hamano775a0f42006-12-31 01:19:143949help other people who look at them later. Lack of this header
Junio C Hamanoba4b9282008-07-06 05:20:313950implies that the commit log message is encoded in UTF-8.</p></div>
Junio C Hamano775a0f42006-12-31 01:19:143951</li>
3952<li>
3953<p>
Junio C Hamano1aa40d22010-01-21 17:46:433954<em>git log</em>, <em>git show</em>, <em>git blame</em> and friends look at the
Junio C Hamanoac12f0e2014-09-19 22:32:513955 <code>encoding</code> header of a commit object, and try to re-code the
Junio C Hamanoaa17c7c2008-11-03 04:36:583956 log message into UTF-8 unless otherwise specified. You can
Junio C Hamano775a0f42006-12-31 01:19:143957 specify the desired output encoding with
Junio C Hamanoac12f0e2014-09-19 22:32:513958 <code>i18n.logoutputencoding</code> in <code>.git/config</code> file, like this:
Junio C Hamano775a0f42006-12-31 01:19:143959</p>
3960<div class="listingblock">
3961<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:513962<pre><code>[i18n]
3963 logoutputencoding = ISO-8859-1</code></pre>
Junio C Hamano775a0f42006-12-31 01:19:143964</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:593965<div class="paragraph"><p>If you do not have this configuration variable, the value of
Junio C Hamanoac12f0e2014-09-19 22:32:513966<code>i18n.commitencoding</code> is used instead.</p></div>
Junio C Hamano775a0f42006-12-31 01:19:143967</li>
Junio C Hamanoba4b9282008-07-06 05:20:313968</ol></div>
Junio C Hamano68cf15a2010-11-06 01:01:593969<div class="paragraph"><p>Note that we deliberately chose not to re-code the commit log
Junio C Hamano775a0f42006-12-31 01:19:143970message when a commit is made to force UTF-8 at the commit
3971object level, because re-coding to UTF-8 is not necessarily a
Junio C Hamanoba4b9282008-07-06 05:20:313972reversible operation.</p></div>
Junio C Hamano775a0f42006-12-31 01:19:143973</div>
Junio C Hamano9629d4f2012-12-19 00:28:273974</div>
3975<div class="sect1">
Junio C Hamano58f587a2013-07-22 19:20:593976<h2 id="_configuration">CONFIGURATION</h2>
Junio C Hamanoa574a092010-06-13 19:57:103977<div class="sectionbody">
Junio C Hamanoa28a9202012-06-21 07:08:233978<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:103979for settings related to diff generation.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:593980<div class="dlist"><dl>
3981<dt class="hdlist1">
Junio C Hamanoa574a092010-06-13 19:57:103982format.pretty
3983</dt>
3984<dd>
3985<p>
Junio C Hamanoac12f0e2014-09-19 22:32:513986 Default for the <code>--format</code> option. (See <em>Pretty Formats</em> above.)
3987 Defaults to <code>medium</code>.
Junio C Hamanoa574a092010-06-13 19:57:103988</p>
3989</dd>
Junio C Hamano68cf15a2010-11-06 01:01:593990<dt class="hdlist1">
Junio C Hamanoa574a092010-06-13 19:57:103991i18n.logOutputEncoding
3992</dt>
3993<dd>
3994<p>
Junio C Hamanob73af6c2013-12-03 22:07:113995 Encoding to use when displaying logs. (See <em>Discussion</em> above.)
Junio C Hamanoac12f0e2014-09-19 22:32:513996 Defaults to the value of <code>i18n.commitEncoding</code> if set, and UTF-8
Junio C Hamanoa574a092010-06-13 19:57:103997 otherwise.
3998</p>
3999</dd>
Junio C Hamano68cf15a2010-11-06 01:01:594000<dt class="hdlist1">
Junio C Hamanoa574a092010-06-13 19:57:104001log.date
4002</dt>
4003<dd>
4004<p>
4005 Default format for human-readable dates. (Compare the
Junio C Hamanoac12f0e2014-09-19 22:32:514006 <code>--date</code> option.) Defaults to "default", which means to write
4007 dates like <code>Sat May 8 19:35:34 2010 -0500</code>.
Junio C Hamanoa574a092010-06-13 19:57:104008</p>
4009</dd>
Junio C Hamano68cf15a2010-11-06 01:01:594010<dt class="hdlist1">
Junio C Hamanod7ed4042015-08-03 19:43:004011log.follow
4012</dt>
4013<dd>
4014<p>
Junio C Hamanob0a1e832015-10-15 23:08:314015 If <code>true</code>, <code>git log</code> will act as if the <code>--follow</code> option was used when
4016 a single &lt;path&gt; is given. This has the same limitations as <code>--follow</code>,
4017 i.e. it cannot be used to follow multiple files and does not work well
4018 on non-linear history.
Junio C Hamanod7ed4042015-08-03 19:43:004019</p>
4020</dd>
4021<dt class="hdlist1">
Junio C Hamano322c6242015-03-23 21:32:464022log.showRoot
Junio C Hamanoa574a092010-06-13 19:57:104023</dt>
4024<dd>
4025<p>
Junio C Hamanoac12f0e2014-09-19 22:32:514026 If <code>false</code>, <code>git log</code> and related commands will not treat the
Junio C Hamanoa574a092010-06-13 19:57:104027 initial commit as a big creation event. Any root commits in
Junio C Hamanoac12f0e2014-09-19 22:32:514028 <code>git log -p</code> output would be shown without a diff attached.
4029 The default is <code>true</code>.
Junio C Hamanoa574a092010-06-13 19:57:104030</p>
4031</dd>
Junio C Hamano68cf15a2010-11-06 01:01:594032<dt class="hdlist1">
Junio C Hamanoabad6da2013-01-06 09:06:324033mailmap.*
Junio C Hamanoa574a092010-06-13 19:57:104034</dt>
4035<dd>
4036<p>
Junio C Hamanoa28a9202012-06-21 07:08:234037 See <a href="git-shortlog.html">git-shortlog(1)</a>.
Junio C Hamanoa574a092010-06-13 19:57:104038</p>
4039</dd>
Junio C Hamano68cf15a2010-11-06 01:01:594040<dt class="hdlist1">
Junio C Hamanoa574a092010-06-13 19:57:104041notes.displayRef
4042</dt>
4043<dd>
4044<p>
Junio C Hamanoac12f0e2014-09-19 22:32:514045 Which refs, in addition to the default set by <code>core.notesRef</code>
Junio C Hamanoa574a092010-06-13 19:57:104046 or <em>GIT_NOTES_REF</em>, to read notes from when showing commit
Junio C Hamanoac12f0e2014-09-19 22:32:514047 messages with the <code>log</code> family of commands. See
Junio C Hamanoa28a9202012-06-21 07:08:234048 <a href="git-notes.html">git-notes(1)</a>.
Junio C Hamanoa574a092010-06-13 19:57:104049</p>
Junio C Hamano68cf15a2010-11-06 01:01:594050<div class="paragraph"><p>May be an unabbreviated ref name or a glob and may be specified
Junio C Hamanoa574a092010-06-13 19:57:104051multiple times. A warning will be issued for refs that do not exist,
4052but a glob that does not match any refs is silently ignored.</p></div>
Junio C Hamanoac12f0e2014-09-19 22:32:514053<div class="paragraph"><p>This setting can be disabled by the <code>--no-notes</code> option,
Junio C Hamanoa574a092010-06-13 19:57:104054overridden by the <em>GIT_NOTES_DISPLAY_REF</em> environment variable,
Junio C Hamanoac12f0e2014-09-19 22:32:514055and overridden by the <code>--notes=&lt;ref&gt;</code> option.</p></div>
Junio C Hamanoa574a092010-06-13 19:57:104056</dd>
4057</dl></div>
4058</div>
Junio C Hamano9629d4f2012-12-19 00:28:274059</div>
4060<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:314061<h2 id="_git">GIT</h2>
Junio C Hamano1a4e8412005-12-27 08:17:234062<div class="sectionbody">
Junio C Hamanoa28a9202012-06-21 07:08:234063<div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:234064</div>
Junio C Hamano7bd050f2011-09-22 06:32:224065</div>
Junio C Hamano9629d4f2012-12-19 00:28:274066</div>
Junio C Hamano7bd050f2011-09-22 06:32:224067<div id="footnotes"><hr /></div>
Junio C Hamano1a4e8412005-12-27 08:17:234068<div id="footer">
4069<div id="footer-text">
Junio C Hamanob0a1e832015-10-15 23:08:314070Last updated 2015-10-15 16:07:45 PDT
Junio C Hamano1a4e8412005-12-27 08:17:234071</div>
4072</div>
4073</body>
4074</html>