blob: 64b4fe7b99294980e6da20258ae029a098d6a16f [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" />
6<meta name="generator" content="AsciiDoc 8.6.8" />
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 Hamano9629d4f2012-12-19 00:28:2790.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}
97
Junio C Hamano9629d4f2012-12-19 00:28:2798
99#author {
Junio C Hamano1a4e8412005-12-27 08:17:23100 color: #527bbd;
Junio C Hamano1a4e8412005-12-27 08:17:23101 font-weight: bold;
Junio C Hamanoba4b9282008-07-06 05:20:31102 font-size: 1.1em;
Junio C Hamano1a4e8412005-12-27 08:17:23103}
Junio C Hamano9629d4f2012-12-19 00:28:27104#email {
Junio C Hamano1a4e8412005-12-27 08:17:23105}
Junio C Hamano9629d4f2012-12-19 00:28:27106#revnumber, #revdate, #revremark {
Junio C Hamano1a4e8412005-12-27 08:17:23107}
108
Junio C Hamano9629d4f2012-12-19 00:28:27109#footer {
Junio C Hamano1a4e8412005-12-27 08:17:23110 font-size: small;
111 border-top: 2px solid silver;
112 padding-top: 0.5em;
113 margin-top: 4.0em;
114}
Junio C Hamano9629d4f2012-12-19 00:28:27115#footer-text {
Junio C Hamano1a4e8412005-12-27 08:17:23116 float: left;
117 padding-bottom: 0.5em;
118}
Junio C Hamano9629d4f2012-12-19 00:28:27119#footer-badges {
Junio C Hamano1a4e8412005-12-27 08:17:23120 float: right;
121 padding-bottom: 0.5em;
122}
123
Junio C Hamano9629d4f2012-12-19 00:28:27124#preamble {
Junio C Hamano68cf15a2010-11-06 01:01:59125 margin-top: 1.5em;
126 margin-bottom: 1.5em;
127}
Junio C Hamano9629d4f2012-12-19 00:28:27128div.imageblock, div.exampleblock, div.verseblock,
Junio C Hamano1a4e8412005-12-27 08:17:23129div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
130div.admonitionblock {
Junio C Hamano7bd050f2011-09-22 06:32:22131 margin-top: 1.0em;
Junio C Hamano1a4e8412005-12-27 08:17:23132 margin-bottom: 1.5em;
133}
134div.admonitionblock {
Junio C Hamano7bd050f2011-09-22 06:32:22135 margin-top: 2.0em;
136 margin-bottom: 2.0em;
137 margin-right: 10%;
138 color: #606060;
Junio C Hamano1a4e8412005-12-27 08:17:23139}
140
141div.content { /* Block element content. */
142 padding: 0;
143}
144
145/* Block element titles. */
146div.title, caption.title {
Junio C Hamano68cf15a2010-11-06 01:01:59147 color: #527bbd;
Junio C Hamano1a4e8412005-12-27 08:17:23148 font-weight: bold;
149 text-align: left;
150 margin-top: 1.0em;
151 margin-bottom: 0.5em;
152}
153div.title + * {
154 margin-top: 0;
155}
156
157td div.title:first-child {
158 margin-top: 0.0em;
159}
160div.content div.title:first-child {
161 margin-top: 0.0em;
162}
163div.content + div.title {
164 margin-top: 0.0em;
165}
166
167div.sidebarblock > div.content {
168 background: #ffffee;
Junio C Hamano9629d4f2012-12-19 00:28:27169 border: 1px solid #dddddd;
170 border-left: 4px solid #f0f0f0;
Junio C Hamano1a4e8412005-12-27 08:17:23171 padding: 0.5em;
172}
173
174div.listingblock > div.content {
Junio C Hamano9629d4f2012-12-19 00:28:27175 border: 1px solid #dddddd;
176 border-left: 5px solid #f0f0f0;
177 background: #f8f8f8;
Junio C Hamano1a4e8412005-12-27 08:17:23178 padding: 0.5em;
179}
180
Junio C Hamano7bd050f2011-09-22 06:32:22181div.quoteblock, div.verseblock {
182 padding-left: 1.0em;
183 margin-left: 1.0em;
Junio C Hamano68cf15a2010-11-06 01:01:59184 margin-right: 10%;
Junio C Hamano9629d4f2012-12-19 00:28:27185 border-left: 5px solid #f0f0f0;
186 color: #888;
Junio C Hamano1a4e8412005-12-27 08:17:23187}
Junio C Hamano7bd050f2011-09-22 06:32:22188
Junio C Hamano68cf15a2010-11-06 01:01:59189div.quoteblock > div.attribution {
190 padding-top: 0.5em;
Junio C Hamano1a4e8412005-12-27 08:17:23191 text-align: right;
192}
Junio C Hamano68cf15a2010-11-06 01:01:59193
Junio C Hamano9629d4f2012-12-19 00:28:27194div.verseblock > pre.content {
195 font-family: inherit;
196 font-size: inherit;
Junio C Hamano68cf15a2010-11-06 01:01:59197}
198div.verseblock > div.attribution {
199 padding-top: 0.75em;
200 text-align: left;
201}
202/* DEPRECATED: Pre version 8.2.7 verse style literal block. */
Junio C Hamanoba4b9282008-07-06 05:20:31203div.verseblock + div.attribution {
204 text-align: left;
205}
Junio C Hamano1a4e8412005-12-27 08:17:23206
207div.admonitionblock .icon {
208 vertical-align: top;
209 font-size: 1.1em;
210 font-weight: bold;
211 text-decoration: underline;
212 color: #527bbd;
213 padding-right: 0.5em;
214}
215div.admonitionblock td.content {
216 padding-left: 0.5em;
Junio C Hamano7bd050f2011-09-22 06:32:22217 border-left: 3px solid #dddddd;
Junio C Hamano1a4e8412005-12-27 08:17:23218}
219
220div.exampleblock > div.content {
Junio C Hamano7bd050f2011-09-22 06:32:22221 border-left: 3px solid #dddddd;
222 padding-left: 0.5em;
Junio C Hamano1a4e8412005-12-27 08:17:23223}
224
Junio C Hamano1a4e8412005-12-27 08:17:23225div.imageblock div.content { padding-left: 0; }
Junio C Hamano1a4e8412005-12-27 08:17:23226span.image img { border-style: none; }
Junio C Hamano68cf15a2010-11-06 01:01:59227a.image:visited { color: white; }
Junio C Hamano1a4e8412005-12-27 08:17:23228
229dl {
230 margin-top: 0.8em;
231 margin-bottom: 0.8em;
232}
233dt {
234 margin-top: 0.5em;
235 margin-bottom: 0;
Junio C Hamano68cf15a2010-11-06 01:01:59236 font-style: normal;
237 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:23238}
239dd > *:first-child {
Junio C Hamano68cf15a2010-11-06 01:01:59240 margin-top: 0.1em;
Junio C Hamano1a4e8412005-12-27 08:17:23241}
242
243ul, ol {
244 list-style-position: outside;
245}
Junio C Hamano68cf15a2010-11-06 01:01:59246ol.arabic {
247 list-style-type: decimal;
248}
249ol.loweralpha {
Junio C Hamano1a4e8412005-12-27 08:17:23250 list-style-type: lower-alpha;
251}
Junio C Hamano68cf15a2010-11-06 01:01:59252ol.upperalpha {
253 list-style-type: upper-alpha;
254}
255ol.lowerroman {
256 list-style-type: lower-roman;
257}
258ol.upperroman {
259 list-style-type: upper-roman;
260}
261
262div.compact ul, div.compact ol,
263div.compact p, div.compact p,
264div.compact div, div.compact div {
265 margin-top: 0.1em;
266 margin-bottom: 0.1em;
267}
Junio C Hamano1a4e8412005-12-27 08:17:23268
Junio C Hamano1a4e8412005-12-27 08:17:23269tfoot {
270 font-weight: bold;
271}
Junio C Hamano68cf15a2010-11-06 01:01:59272td > div.verse {
273 white-space: pre;
274}
Junio C Hamano68cf15a2010-11-06 01:01:59275
276div.hdlist {
Junio C Hamano1a4e8412005-12-27 08:17:23277 margin-top: 0.8em;
278 margin-bottom: 0.8em;
279}
Junio C Hamano68cf15a2010-11-06 01:01:59280div.hdlist tr {
281 padding-bottom: 15px;
Junio C Hamanoba4b9282008-07-06 05:20:31282}
Junio C Hamano68cf15a2010-11-06 01:01:59283dt.hdlist1.strong, td.hdlist1.strong {
284 font-weight: bold;
285}
286td.hdlist1 {
Junio C Hamano1a4e8412005-12-27 08:17:23287 vertical-align: top;
Junio C Hamano68cf15a2010-11-06 01:01:59288 font-style: normal;
Junio C Hamano1a4e8412005-12-27 08:17:23289 padding-right: 0.8em;
Junio C Hamano68cf15a2010-11-06 01:01:59290 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:23291}
Junio C Hamano68cf15a2010-11-06 01:01:59292td.hdlist2 {
Junio C Hamano1a4e8412005-12-27 08:17:23293 vertical-align: top;
294}
Junio C Hamano68cf15a2010-11-06 01:01:59295div.hdlist.compact tr {
296 margin: 0;
297 padding-bottom: 0;
298}
299
300.comment {
301 background: yellow;
302}
Junio C Hamano1a4e8412005-12-27 08:17:23303
Junio C Hamano7bd050f2011-09-22 06:32:22304.footnote, .footnoteref {
305 font-size: 0.8em;
306}
307
308span.footnote, span.footnoteref {
309 vertical-align: super;
310}
311
312#footnotes {
313 margin: 20px 0 20px 0;
314 padding: 7px 0 0 0;
315}
316
317#footnotes div.footnote {
318 margin: 0 0 5px 0;
319}
320
321#footnotes hr {
322 border: none;
323 border-top: 1px solid silver;
324 height: 1px;
325 text-align: left;
326 margin-left: 0;
327 width: 20%;
328 min-width: 100px;
329}
330
Junio C Hamano9629d4f2012-12-19 00:28:27331div.colist td {
332 padding-right: 0.5em;
333 padding-bottom: 0.3em;
334 vertical-align: top;
335}
336div.colist td img {
337 margin-top: 0.3em;
Junio C Hamano1a4e8412005-12-27 08:17:23338}
Junio C Hamanoba4b9282008-07-06 05:20:31339
Junio C Hamano9629d4f2012-12-19 00:28:27340@media print {
341 #footer-badges { display: none; }
342}
343
344#toc {
Junio C Hamano7bd050f2011-09-22 06:32:22345 margin-bottom: 2.5em;
346}
347
Junio C Hamano9629d4f2012-12-19 00:28:27348#toctitle {
Junio C Hamanoba4b9282008-07-06 05:20:31349 color: #527bbd;
Junio C Hamanoba4b9282008-07-06 05:20:31350 font-size: 1.1em;
351 font-weight: bold;
352 margin-top: 1.0em;
353 margin-bottom: 0.1em;
354}
355
Junio C Hamano9629d4f2012-12-19 00:28:27356div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
Junio C Hamanoba4b9282008-07-06 05:20:31357 margin-top: 0;
358 margin-bottom: 0;
359}
360div.toclevel2 {
361 margin-left: 2em;
362 font-size: 0.9em;
363}
364div.toclevel3 {
365 margin-left: 4em;
366 font-size: 0.9em;
367}
368div.toclevel4 {
369 margin-left: 6em;
370 font-size: 0.9em;
371}
Junio C Hamano9629d4f2012-12-19 00:28:27372
373span.aqua { color: aqua; }
374span.black { color: black; }
375span.blue { color: blue; }
376span.fuchsia { color: fuchsia; }
377span.gray { color: gray; }
378span.green { color: green; }
379span.lime { color: lime; }
380span.maroon { color: maroon; }
381span.navy { color: navy; }
382span.olive { color: olive; }
383span.purple { color: purple; }
384span.red { color: red; }
385span.silver { color: silver; }
386span.teal { color: teal; }
387span.white { color: white; }
388span.yellow { color: yellow; }
389
390span.aqua-background { background: aqua; }
391span.black-background { background: black; }
392span.blue-background { background: blue; }
393span.fuchsia-background { background: fuchsia; }
394span.gray-background { background: gray; }
395span.green-background { background: green; }
396span.lime-background { background: lime; }
397span.maroon-background { background: maroon; }
398span.navy-background { background: navy; }
399span.olive-background { background: olive; }
400span.purple-background { background: purple; }
401span.red-background { background: red; }
402span.silver-background { background: silver; }
403span.teal-background { background: teal; }
404span.white-background { background: white; }
405span.yellow-background { background: yellow; }
406
407span.big { font-size: 2em; }
408span.small { font-size: 0.6em; }
409
410span.underline { text-decoration: underline; }
411span.overline { text-decoration: overline; }
412span.line-through { text-decoration: line-through; }
413
414div.unbreakable { page-break-inside: avoid; }
415
416
417/*
418 * xhtml11 specific
419 *
420 * */
421
422div.tableblock {
423 margin-top: 1.0em;
424 margin-bottom: 1.5em;
425}
426div.tableblock > table {
427 border: 3px solid #527bbd;
428}
429thead, p.table.header {
430 font-weight: bold;
431 color: #527bbd;
432}
433p.table {
434 margin-top: 0;
435}
436/* Because the table frame attribute is overriden by CSS in most browsers. */
437div.tableblock > table[frame="void"] {
438 border-style: none;
439}
440div.tableblock > table[frame="hsides"] {
441 border-left-style: none;
442 border-right-style: none;
443}
444div.tableblock > table[frame="vsides"] {
445 border-top-style: none;
446 border-bottom-style: none;
447}
448
449
450/*
451 * html5 specific
452 *
453 * */
454
455table.tableblock {
456 margin-top: 1.0em;
457 margin-bottom: 1.5em;
458}
459thead, p.tableblock.header {
460 font-weight: bold;
461 color: #527bbd;
462}
463p.tableblock {
464 margin-top: 0;
465}
466table.tableblock {
467 border-width: 3px;
468 border-spacing: 0px;
469 border-style: solid;
470 border-color: #527bbd;
471 border-collapse: collapse;
472}
473th.tableblock, td.tableblock {
474 border-width: 1px;
475 padding: 4px;
476 border-style: solid;
477 border-color: #527bbd;
478}
479
480table.tableblock.frame-topbot {
481 border-left-style: hidden;
482 border-right-style: hidden;
483}
484table.tableblock.frame-sides {
485 border-top-style: hidden;
486 border-bottom-style: hidden;
487}
488table.tableblock.frame-none {
489 border-style: hidden;
490}
491
492th.tableblock.halign-left, td.tableblock.halign-left {
493 text-align: left;
494}
495th.tableblock.halign-center, td.tableblock.halign-center {
496 text-align: center;
497}
498th.tableblock.halign-right, td.tableblock.halign-right {
499 text-align: right;
500}
501
502th.tableblock.valign-top, td.tableblock.valign-top {
503 vertical-align: top;
504}
505th.tableblock.valign-middle, td.tableblock.valign-middle {
506 vertical-align: middle;
507}
508th.tableblock.valign-bottom, td.tableblock.valign-bottom {
509 vertical-align: bottom;
510}
511
512
513/*
514 * manpage specific
515 *
516 * */
517
518body.manpage h1 {
Junio C Hamano68cf15a2010-11-06 01:01:59519 padding-top: 0.5em;
520 padding-bottom: 0.5em;
521 border-top: 2px solid silver;
522 border-bottom: 2px solid silver;
523}
Junio C Hamano9629d4f2012-12-19 00:28:27524body.manpage h2 {
Junio C Hamano68cf15a2010-11-06 01:01:59525 border-style: none;
526}
Junio C Hamano9629d4f2012-12-19 00:28:27527body.manpage div.sectionbody {
528 margin-left: 3em;
Junio C Hamano68cf15a2010-11-06 01:01:59529}
530
531@media print {
Junio C Hamano9629d4f2012-12-19 00:28:27532 body.manpage div#toc { display: none; }
Junio C Hamano68cf15a2010-11-06 01:01:59533}
534
Junio C Hamano1a4e8412005-12-27 08:17:23535
Junio C Hamano1a4e8412005-12-27 08:17:23536</style>
Junio C Hamano7bd050f2011-09-22 06:32:22537<script type="text/javascript">
538/*<![CDATA[*/
Junio C Hamano7bd050f2011-09-22 06:32:22539var asciidoc = { // Namespace.
540
541/////////////////////////////////////////////////////////////////////
542// Table Of Contents generator
543/////////////////////////////////////////////////////////////////////
544
545/* Author: Mihai Bazon, September 2002
546 * http://students.infoiasi.ro/~mishoo
547 *
548 * Table Of Content generator
549 * Version: 0.4
550 *
551 * Feel free to use this script under the terms of the GNU General Public
552 * License, as long as you do not remove or alter this notice.
553 */
554
555 /* modified by Troy D. Hanson, September 2006. License: GPL */
556 /* modified by Stuart Rackham, 2006, 2009. License: GPL */
557
558// toclevels = 1..4.
559toc: function (toclevels) {
560
561 function getText(el) {
562 var text = "";
563 for (var i = el.firstChild; i != null; i = i.nextSibling) {
564 if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
565 text += i.data;
566 else if (i.firstChild != null)
567 text += getText(i);
568 }
569 return text;
570 }
571
572 function TocEntry(el, text, toclevel) {
573 this.element = el;
574 this.text = text;
575 this.toclevel = toclevel;
576 }
577
578 function tocEntries(el, toclevels) {
579 var result = new Array;
Junio C Hamano9629d4f2012-12-19 00:28:27580 var re = new RegExp('[hH]([1-'+(toclevels+1)+'])');
Junio C Hamano7bd050f2011-09-22 06:32:22581 // Function that scans the DOM tree for header elements (the DOM2
582 // nodeIterator API would be a better technique but not supported by all
583 // browsers).
584 var iterate = function (el) {
585 for (var i = el.firstChild; i != null; i = i.nextSibling) {
586 if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
587 var mo = re.exec(i.tagName);
588 if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
589 result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
590 }
591 iterate(i);
592 }
593 }
594 }
595 iterate(el);
596 return result;
597 }
598
599 var toc = document.getElementById("toc");
Junio C Hamano9629d4f2012-12-19 00:28:27600 if (!toc) {
601 return;
602 }
603
604 // Delete existing TOC entries in case we're reloading the TOC.
605 var tocEntriesToRemove = [];
606 var i;
607 for (i = 0; i < toc.childNodes.length; i++) {
608 var entry = toc.childNodes[i];
609 if (entry.nodeName.toLowerCase() == 'div'
610 && entry.getAttribute("class")
611 && entry.getAttribute("class").match(/^toclevel/))
612 tocEntriesToRemove.push(entry);
613 }
614 for (i = 0; i < tocEntriesToRemove.length; i++) {
615 toc.removeChild(tocEntriesToRemove[i]);
616 }
617
618 // Rebuild TOC entries.
Junio C Hamano7bd050f2011-09-22 06:32:22619 var entries = tocEntries(document.getElementById("content"), toclevels);
620 for (var i = 0; i < entries.length; ++i) {
621 var entry = entries[i];
622 if (entry.element.id == "")
623 entry.element.id = "_toc_" + i;
624 var a = document.createElement("a");
625 a.href = "#" + entry.element.id;
626 a.appendChild(document.createTextNode(entry.text));
627 var div = document.createElement("div");
628 div.appendChild(a);
629 div.className = "toclevel" + entry.toclevel;
630 toc.appendChild(div);
631 }
632 if (entries.length == 0)
633 toc.parentNode.removeChild(toc);
634},
635
636
637/////////////////////////////////////////////////////////////////////
638// Footnotes generator
639/////////////////////////////////////////////////////////////////////
640
641/* Based on footnote generation code from:
642 * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
643 */
644
645footnotes: function () {
Junio C Hamano9629d4f2012-12-19 00:28:27646 // Delete existing footnote entries in case we're reloading the footnodes.
647 var i;
Junio C Hamano7bd050f2011-09-22 06:32:22648 var noteholder = document.getElementById("footnotes");
Junio C Hamano9629d4f2012-12-19 00:28:27649 if (!noteholder) {
650 return;
651 }
652 var entriesToRemove = [];
653 for (i = 0; i < noteholder.childNodes.length; i++) {
654 var entry = noteholder.childNodes[i];
655 if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote")
656 entriesToRemove.push(entry);
657 }
658 for (i = 0; i < entriesToRemove.length; i++) {
659 noteholder.removeChild(entriesToRemove[i]);
660 }
661
662 // Rebuild footnote entries.
663 var cont = document.getElementById("content");
Junio C Hamano7bd050f2011-09-22 06:32:22664 var spans = cont.getElementsByTagName("span");
665 var refs = {};
666 var n = 0;
667 for (i=0; i<spans.length; i++) {
668 if (spans[i].className == "footnote") {
669 n++;
Junio C Hamano9629d4f2012-12-19 00:28:27670 var note = spans[i].getAttribute("data-note");
671 if (!note) {
672 // Use [\s\S] in place of . so multi-line matches work.
673 // Because JavaScript has no s (dotall) regex flag.
674 note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
675 spans[i].innerHTML =
676 "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
677 "' title='View footnote' class='footnote'>" + n + "</a>]";
678 spans[i].setAttribute("data-note", note);
679 }
Junio C Hamano7bd050f2011-09-22 06:32:22680 noteholder.innerHTML +=
681 "<div class='footnote' id='_footnote_" + n + "'>" +
682 "<a href='#_footnoteref_" + n + "' title='Return to text'>" +
683 n + "</a>. " + note + "</div>";
Junio C Hamano7bd050f2011-09-22 06:32:22684 var id =spans[i].getAttribute("id");
685 if (id != null) refs["#"+id] = n;
686 }
687 }
688 if (n == 0)
689 noteholder.parentNode.removeChild(noteholder);
690 else {
691 // Process footnoterefs.
692 for (i=0; i<spans.length; i++) {
693 if (spans[i].className == "footnoteref") {
694 var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
695 href = href.match(/#.*/)[0]; // Because IE return full URL.
696 n = refs[href];
697 spans[i].innerHTML =
698 "[<a href='#_footnote_" + n +
699 "' title='View footnote' class='footnote'>" + n + "</a>]";
700 }
701 }
702 }
Junio C Hamano9629d4f2012-12-19 00:28:27703},
704
705install: function(toclevels) {
706 var timerId;
707
708 function reinstall() {
709 asciidoc.footnotes();
710 if (toclevels) {
711 asciidoc.toc(toclevels);
712 }
713 }
714
715 function reinstallAndRemoveTimer() {
716 clearInterval(timerId);
717 reinstall();
718 }
719
720 timerId = setInterval(reinstall, 500);
721 if (document.addEventListener)
722 document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false);
723 else
724 window.onload = reinstallAndRemoveTimer;
Junio C Hamano7bd050f2011-09-22 06:32:22725}
726
727}
Junio C Hamano9629d4f2012-12-19 00:28:27728asciidoc.install();
Junio C Hamano7bd050f2011-09-22 06:32:22729/*]]>*/
730</script>
Junio C Hamano1a4e8412005-12-27 08:17:23731</head>
Junio C Hamano9629d4f2012-12-19 00:28:27732<body class="manpage">
Junio C Hamano1a4e8412005-12-27 08:17:23733<div id="header">
734<h1>
735git-log(1) Manual Page
736</h1>
737<h2>NAME</h2>
738<div class="sectionbody">
739<p>git-log -
740 Show commit logs
741</p>
742</div>
743</div>
Junio C Hamano7bd050f2011-09-22 06:32:22744<div id="content">
Junio C Hamano9629d4f2012-12-19 00:28:27745<div class="sect1">
Junio C Hamano68cf15a2010-11-06 01:01:59746<h2 id="_synopsis">SYNOPSIS</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23747<div class="sectionbody">
Junio C Hamano15567bc2011-07-23 00:51:59748<div class="verseblock">
Junio C Hamano9629d4f2012-12-19 00:28:27749<pre class="content"><em>git log</em> [&lt;options&gt;] [&lt;since&gt;..&lt;until&gt;] [[--] &lt;path&gt;&#8230;]</pre>
750<div class="attribution">
Junio C Hamano15567bc2011-07-23 00:51:59751</div></div>
Junio C Hamano1a4e8412005-12-27 08:17:23752</div>
Junio C Hamano9629d4f2012-12-19 00:28:27753</div>
754<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:31755<h2 id="_description">DESCRIPTION</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23756<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:59757<div class="paragraph"><p>Shows the commit logs.</p></div>
758<div class="paragraph"><p>The command takes options applicable to the <em>git rev-list</em>
Junio C Hamanoba7c8d82006-04-15 06:17:42759command to control what is shown and how, and options applicable to
Junio C Hamano1aa40d22010-01-21 17:46:43760the <em>git diff-*</em> commands to control how the changes
Junio C Hamanoba4b9282008-07-06 05:20:31761each commit introduces are shown.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:23762</div>
Junio C Hamano9629d4f2012-12-19 00:28:27763</div>
764<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:31765<h2 id="_options">OPTIONS</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23766<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:59767<div class="dlist"><dl>
768<dt class="hdlist1">
Junio C Hamano78e3a782010-07-15 22:24:45769&lt;since&gt;..&lt;until&gt;
770</dt>
771<dd>
772<p>
773 Show only commits between the named two commits. When
774 either &lt;since&gt; or &lt;until&gt; is omitted, it defaults to
Junio C Hamano9629d4f2012-12-19 00:28:27775 <code>HEAD</code>, i.e. the tip of the current branch.
Junio C Hamano78e3a782010-07-15 22:24:45776 For a more complete list of ways to spell &lt;since&gt;
Junio C Hamanoa28a9202012-06-21 07:08:23777 and &lt;until&gt;, see <a href="gitrevisions.html">gitrevisions(7)</a>.
Junio C Hamano78e3a782010-07-15 22:24:45778</p>
779</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59780<dt class="hdlist1">
Junio C Hamano78e3a782010-07-15 22:24:45781--follow
782</dt>
783<dd>
784<p>
785 Continue listing the history of a file beyond renames
786 (works only for a single file).
787</p>
788</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59789<dt class="hdlist1">
Junio C Hamano78e3a782010-07-15 22:24:45790--no-decorate
791</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59792<dt class="hdlist1">
Junio C Hamano78e3a782010-07-15 22:24:45793--decorate[=short|full|no]
794</dt>
795<dd>
796<p>
797 Print out the ref names of any commits that are shown. If <em>short</em> is
798 specified, the ref name prefixes <em>refs/heads/</em>, <em>refs/tags/</em> and
799 <em>refs/remotes/</em> will not be printed. If <em>full</em> is specified, the
800 full ref name (including prefix) will be printed. The default option
801 is <em>short</em>.
802</p>
803</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59804<dt class="hdlist1">
Junio C Hamano78e3a782010-07-15 22:24:45805--source
806</dt>
807<dd>
808<p>
809 Print out the ref name given on the command line by which each
810 commit was reached.
811</p>
812</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59813<dt class="hdlist1">
Junio C Hamanoce836cc2013-01-21 02:01:53814--use-mailmap
815</dt>
816<dd>
817<p>
818 Use mailmap file to map author and committer names and email
819 to canonical real names and email addresses. See
820 <a href="git-shortlog.html">git-shortlog(1)</a>.
821</p>
822</dd>
823<dt class="hdlist1">
Junio C Hamano78e3a782010-07-15 22:24:45824--full-diff
825</dt>
826<dd>
827<p>
828 Without this flag, "git log -p &lt;path&gt;&#8230;" shows commits that
829 touch the specified paths, and diffs about the same specified
830 paths. With this, the full diff is shown for commits that touch
831 the specified paths; this means that "&lt;path&gt;&#8230;" limits only
Junio C Hamano68cf15a2010-11-06 01:01:59832 commits, and doesn&#8217;t limit diff for those commits.
Junio C Hamano78e3a782010-07-15 22:24:45833</p>
Junio C Hamano68cf15a2010-11-06 01:01:59834<div class="paragraph"><p>Note that this affects all diff-based output types, e.g. those
Junio C Hamanoe85e36f2010-08-10 05:30:14835produced by --stat etc.</p></div>
Junio C Hamano78e3a782010-07-15 22:24:45836</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59837<dt class="hdlist1">
Junio C Hamano78e3a782010-07-15 22:24:45838--log-size
839</dt>
840<dd>
841<p>
842 Before the log message print out its size in bytes. Intended
Junio C Hamano076ffcc2013-02-06 05:13:21843 mainly for porcelain tools consumption. If Git is unable to
Junio C Hamano78e3a782010-07-15 22:24:45844 produce a valid value size is set to zero.
845 Note that only message is considered, if also a diff is shown
846 its size is not included.
847</p>
848</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59849<dt class="hdlist1">
Junio C Hamano78e3a782010-07-15 22:24:45850[--] &lt;path&gt;&#8230;
851</dt>
852<dd>
853<p>
Junio C Hamano5723afa2011-08-31 00:49:23854 Show only commits that are enough to explain how the files
855 that match the specified paths came to be. See "History
856 Simplification" below for details and other simplification
857 modes.
Junio C Hamano78e3a782010-07-15 22:24:45858</p>
Junio C Hamano5723afa2011-08-31 00:49:23859<div class="paragraph"><p>To prevent confusion with options and branch names, paths may need to
860be prefixed with "-- " to separate them from options or refnames.</p></div>
Junio C Hamano78e3a782010-07-15 22:24:45861</dd>
862</dl></div>
Junio C Hamano9629d4f2012-12-19 00:28:27863<div class="sect2">
864<h3 id="_commit_limiting">Commit Limiting</h3>
Junio C Hamano68cf15a2010-11-06 01:01:59865<div class="paragraph"><p>Besides specifying a range of commits that should be listed using the
Junio C Hamanob0e02952008-01-19 08:02:00866special notations explained in the description, additional commit
Junio C Hamano8ce35d72012-09-18 22:30:42867limiting may be applied.</p></div>
868<div class="paragraph"><p>Using more options generally further limits the output (e.g.
Junio C Hamano9629d4f2012-12-19 00:28:27869<code>--since=&lt;date1&gt;</code> limits to commits newer than <code>&lt;date1&gt;</code>, and using it
870with <code>--grep=&lt;pattern&gt;</code> further limits to commits whose log message
871has a line that matches <code>&lt;pattern&gt;</code>), unless otherwise noted.</p></div>
Junio C Hamano8ce35d72012-09-18 22:30:42872<div class="paragraph"><p>Note that these are applied before commit
Junio C Hamano9629d4f2012-12-19 00:28:27873ordering and formatting options, such as <code>--reverse</code>.</p></div>
874<div class="openblock">
875<div class="content">
Junio C Hamano68cf15a2010-11-06 01:01:59876<div class="dlist"><dl>
877<dt class="hdlist1">
Junio C Hamano693e7092012-09-12 22:56:53878-&lt;number&gt;
879</dt>
880<dt class="hdlist1">
881-n &lt;number&gt;
Junio C Hamanoeb415992008-06-08 22:49:47882</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59883<dt class="hdlist1">
Junio C Hamanob4a9ede2009-04-08 07:36:32884--max-count=&lt;number&gt;
Junio C Hamanob0e02952008-01-19 08:02:00885</dt>
886<dd>
887<p>
Junio C Hamanoc5be4cc2011-03-09 07:20:43888 Limit the number of commits to output.
Junio C Hamanob0e02952008-01-19 08:02:00889</p>
890</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59891<dt class="hdlist1">
Junio C Hamanob4a9ede2009-04-08 07:36:32892--skip=&lt;number&gt;
Junio C Hamanob0e02952008-01-19 08:02:00893</dt>
894<dd>
895<p>
896 Skip <em>number</em> commits before starting to show the commit output.
897</p>
898</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59899<dt class="hdlist1">
Junio C Hamanob4a9ede2009-04-08 07:36:32900--since=&lt;date&gt;
Junio C Hamanoeb415992008-06-08 22:49:47901</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59902<dt class="hdlist1">
Junio C Hamanob4a9ede2009-04-08 07:36:32903--after=&lt;date&gt;
Junio C Hamanob0e02952008-01-19 08:02:00904</dt>
905<dd>
906<p>
907 Show commits more recent than a specific date.
908</p>
909</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59910<dt class="hdlist1">
Junio C Hamanob4a9ede2009-04-08 07:36:32911--until=&lt;date&gt;
Junio C Hamanoeb415992008-06-08 22:49:47912</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59913<dt class="hdlist1">
Junio C Hamanob4a9ede2009-04-08 07:36:32914--before=&lt;date&gt;
Junio C Hamanob0e02952008-01-19 08:02:00915</dt>
916<dd>
917<p>
918 Show commits older than a specific date.
919</p>
920</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59921<dt class="hdlist1">
Junio C Hamanob4a9ede2009-04-08 07:36:32922--author=&lt;pattern&gt;
Junio C Hamanoeb415992008-06-08 22:49:47923</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59924<dt class="hdlist1">
Junio C Hamanob4a9ede2009-04-08 07:36:32925--committer=&lt;pattern&gt;
Junio C Hamanob0e02952008-01-19 08:02:00926</dt>
927<dd>
928<p>
929 Limit the commits output to ones with author/committer
Junio C Hamano8ce35d72012-09-18 22:30:42930 header lines that match the specified pattern (regular
Junio C Hamano9629d4f2012-12-19 00:28:27931 expression). With more than one <code>--author=&lt;pattern&gt;</code>,
Junio C Hamano8ce35d72012-09-18 22:30:42932 commits whose author matches any of the given patterns are
Junio C Hamano9629d4f2012-12-19 00:28:27933 chosen (similarly for multiple <code>--committer=&lt;pattern&gt;</code>).
Junio C Hamanob0e02952008-01-19 08:02:00934</p>
935</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59936<dt class="hdlist1">
Junio C Hamano9954ed72012-10-03 04:54:00937--grep-reflog=&lt;pattern&gt;
938</dt>
939<dd>
940<p>
941 Limit the commits output to ones with reflog entries that
942 match the specified pattern (regular expression). With
Junio C Hamano9629d4f2012-12-19 00:28:27943 more than one <code>--grep-reflog</code>, commits whose reflog message
Junio C Hamano9954ed72012-10-03 04:54:00944 matches any of the given patterns are chosen. It is an
Junio C Hamano9629d4f2012-12-19 00:28:27945 error to use this option unless <code>--walk-reflogs</code> is in use.
Junio C Hamano9954ed72012-10-03 04:54:00946</p>
947</dd>
948<dt class="hdlist1">
Junio C Hamanob4a9ede2009-04-08 07:36:32949--grep=&lt;pattern&gt;
Junio C Hamanob0e02952008-01-19 08:02:00950</dt>
951<dd>
952<p>
953 Limit the commits output to ones with log message that
Junio C Hamano8ce35d72012-09-18 22:30:42954 matches the specified pattern (regular expression). With
Junio C Hamano9629d4f2012-12-19 00:28:27955 more than one <code>--grep=&lt;pattern&gt;</code>, commits whose message
Junio C Hamano8ce35d72012-09-18 22:30:42956 matches any of the given patterns are chosen (but see
Junio C Hamano9629d4f2012-12-19 00:28:27957 <code>--all-match</code>).
Junio C Hamanob0e02952008-01-19 08:02:00958</p>
Junio C Hamano9629d4f2012-12-19 00:28:27959<div class="paragraph"><p>When <code>--show-notes</code> is in effect, the message from the notes as
Junio C Hamano9954ed72012-10-03 04:54:00960if it is part of the log message.</p></div>
Junio C Hamanob0e02952008-01-19 08:02:00961</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59962<dt class="hdlist1">
Junio C Hamanoaa17c7c2008-11-03 04:36:58963--all-match
964</dt>
965<dd>
966<p>
967 Limit the commits output to ones that match all given --grep,
Junio C Hamano8ce35d72012-09-18 22:30:42968 instead of ones that match at least one.
Junio C Hamanoaa17c7c2008-11-03 04:36:58969</p>
970</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59971<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:47972-i
973</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59974<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:47975--regexp-ignore-case
Junio C Hamanob0e02952008-01-19 08:02:00976</dt>
977<dd>
978<p>
979 Match the regexp limiting patterns without regard to letters case.
980</p>
981</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59982<dt class="hdlist1">
Junio C Hamanoa1295452012-11-13 22:32:04983--basic-regexp
984</dt>
985<dd>
986<p>
987 Consider the limiting patterns to be basic regular expressions;
988 this is the default.
989</p>
990</dd>
991<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:47992-E
993</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59994<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:47995--extended-regexp
Junio C Hamanob0e02952008-01-19 08:02:00996</dt>
997<dd>
998<p>
999 Consider the limiting patterns to be extended regular expressions
1000 instead of the default basic regular expressions.
1001</p>
1002</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591003<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471004-F
1005</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591006<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471007--fixed-strings
Junio C Hamano24bc09a2008-02-28 00:27:441008</dt>
1009<dd>
1010<p>
Junio C Hamano68cf15a2010-11-06 01:01:591011 Consider the limiting patterns to be fixed strings (don&#8217;t interpret
Junio C Hamano24bc09a2008-02-28 00:27:441012 pattern as a regular expression).
1013</p>
1014</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591015<dt class="hdlist1">
Junio C Hamanoa1295452012-11-13 22:32:041016--perl-regexp
1017</dt>
1018<dd>
1019<p>
1020 Consider the limiting patterns to be Perl-compatible regexp.
1021 Requires libpcre to be compiled in.
1022</p>
1023</dd>
1024<dt class="hdlist1">
Junio C Hamanob0e02952008-01-19 08:02:001025--remove-empty
1026</dt>
1027<dd>
1028<p>
1029 Stop when a given path disappears from the tree.
1030</p>
1031</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591032<dt class="hdlist1">
Junio C Hamano934e1782009-07-16 06:59:151033--merges
1034</dt>
1035<dd>
1036<p>
Junio C Hamano9629d4f2012-12-19 00:28:271037 Print only merge commits. This is exactly the same as <code>--min-parents=2</code>.
Junio C Hamano934e1782009-07-16 06:59:151038</p>
1039</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591040<dt class="hdlist1">
Junio C Hamanob0e02952008-01-19 08:02:001041--no-merges
1042</dt>
1043<dd>
1044<p>
Junio C Hamanof32ce262011-03-27 07:35:111045 Do not print commits with more than one parent. This is
Junio C Hamano9629d4f2012-12-19 00:28:271046 exactly the same as <code>--max-parents=1</code>.
Junio C Hamanob0e02952008-01-19 08:02:001047</p>
1048</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591049<dt class="hdlist1">
Junio C Hamanof32ce262011-03-27 07:35:111050--min-parents=&lt;number&gt;
1051</dt>
1052<dt class="hdlist1">
1053--max-parents=&lt;number&gt;
1054</dt>
1055<dt class="hdlist1">
1056--no-min-parents
1057</dt>
1058<dt class="hdlist1">
1059--no-max-parents
1060</dt>
1061<dd>
1062<p>
1063 Show only commits which have at least (or at most) that many
Junio C Hamano9629d4f2012-12-19 00:28:271064 commits. In particular, <code>--max-parents=1</code> is the same as <code>--no-merges</code>,
1065 <code>--min-parents=2</code> is the same as <code>--merges</code>. <code>--max-parents=0</code>
1066 gives all root commits and <code>--min-parents=3</code> all octopus merges.
Junio C Hamanof32ce262011-03-27 07:35:111067</p>
Junio C Hamano9629d4f2012-12-19 00:28:271068<div class="paragraph"><p><code>--no-min-parents</code> and <code>--no-max-parents</code> reset these limits (to no limit)
1069again. Equivalent forms are <code>--min-parents=0</code> (any commit has 0 or more
1070parents) and <code>--max-parents=-1</code> (negative numbers denote no upper limit).</p></div>
Junio C Hamanof32ce262011-03-27 07:35:111071</dd>
1072<dt class="hdlist1">
Junio C Hamanob0e02952008-01-19 08:02:001073--first-parent
1074</dt>
1075<dd>
1076<p>
1077 Follow only the first parent commit upon seeing a merge
1078 commit. This option can give a better overview when
1079 viewing the evolution of a particular topic branch,
1080 because merges into a topic branch tend to be only about
1081 adjusting to updated upstream from time to time, and
1082 this option allows you to ignore the individual commits
1083 brought in to your history by such a merge.
1084</p>
1085</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591086<dt class="hdlist1">
Junio C Hamanob0e02952008-01-19 08:02:001087--not
1088</dt>
1089<dd>
1090<p>
1091 Reverses the meaning of the <em>&#94;</em> prefix (or lack thereof)
1092 for all following revision specifiers, up to the next <em>--not</em>.
1093</p>
1094</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591095<dt class="hdlist1">
Junio C Hamanob0e02952008-01-19 08:02:001096--all
1097</dt>
1098<dd>
1099<p>
Junio C Hamano9629d4f2012-12-19 00:28:271100 Pretend as if all the refs in <code>refs/</code> are listed on the
Junio C Hamanob0e02952008-01-19 08:02:001101 command line as <em>&lt;commit&gt;</em>.
1102</p>
1103</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591104<dt class="hdlist1">
Junio C Hamanod2179ef2010-10-22 04:12:171105--branches[=&lt;pattern&gt;]
Junio C Hamano50819852008-11-19 02:07:561106</dt>
1107<dd>
1108<p>
Junio C Hamano9629d4f2012-12-19 00:28:271109 Pretend as if all the refs in <code>refs/heads</code> are listed
Junio C Hamanod2179ef2010-10-22 04:12:171110 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:501111 branches to ones matching given shell glob. If pattern lacks <em>?</em>,
Junio C Hamano81d540a2012-03-02 19:52:471112 <em>&#42;</em>, or <em>[</em>, <em>/&#42;</em> at the end is implied.
Junio C Hamano50819852008-11-19 02:07:561113</p>
1114</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591115<dt class="hdlist1">
Junio C Hamanod2179ef2010-10-22 04:12:171116--tags[=&lt;pattern&gt;]
Junio C Hamano50819852008-11-19 02:07:561117</dt>
1118<dd>
1119<p>
Junio C Hamano9629d4f2012-12-19 00:28:271120 Pretend as if all the refs in <code>refs/tags</code> are listed
Junio C Hamanod2179ef2010-10-22 04:12:171121 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:471122 tags to ones matching given shell glob. If pattern lacks <em>?</em>, <em>&#42;</em>,
1123 or <em>[</em>, <em>/&#42;</em> at the end is implied.
Junio C Hamano50819852008-11-19 02:07:561124</p>
1125</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591126<dt class="hdlist1">
Junio C Hamanod2179ef2010-10-22 04:12:171127--remotes[=&lt;pattern&gt;]
Junio C Hamano50819852008-11-19 02:07:561128</dt>
1129<dd>
1130<p>
Junio C Hamano9629d4f2012-12-19 00:28:271131 Pretend as if all the refs in <code>refs/remotes</code> are listed
Junio C Hamanod2179ef2010-10-22 04:12:171132 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:071133 remote-tracking branches to ones matching given shell glob.
Junio C Hamano81d540a2012-03-02 19:52:471134 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:501135</p>
1136</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591137<dt class="hdlist1">
Junio C Hamanod2179ef2010-10-22 04:12:171138--glob=&lt;glob-pattern&gt;
Junio C Hamano57827fb2010-01-23 03:02:501139</dt>
1140<dd>
1141<p>
Junio C Hamanod2179ef2010-10-22 04:12:171142 Pretend as if all the refs matching shell glob <em>&lt;glob-pattern&gt;</em>
Junio C Hamano57827fb2010-01-23 03:02:501143 are listed on the command line as <em>&lt;commit&gt;</em>. Leading <em>refs/</em>,
Junio C Hamano81d540a2012-03-02 19:52:471144 is automatically prepended if missing. If pattern lacks <em>?</em>, <em>&#42;</em>,
1145 or <em>[</em>, <em>/&#42;</em> at the end is implied.
Junio C Hamano50819852008-11-19 02:07:561146</p>
1147</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591148<dt class="hdlist1">
Junio C Hamano084228c2011-05-30 08:13:521149--ignore-missing
1150</dt>
1151<dd>
1152<p>
1153 Upon seeing an invalid object name in the input, pretend as if
1154 the bad input was not given.
1155</p>
1156</dd>
1157<dt class="hdlist1">
Junio C Hamano5706e0b2009-11-24 10:54:161158--bisect
1159</dt>
1160<dd>
1161<p>
Junio C Hamano9629d4f2012-12-19 00:28:271162 Pretend as if the bad bisection ref <code>refs/bisect/bad</code>
1163 was listed and as if it was followed by <code>--not</code> and the good
1164 bisection refs <code>refs/bisect/good-*</code> on the command
Junio C Hamano5706e0b2009-11-24 10:54:161165 line.
1166</p>
1167</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591168<dt class="hdlist1">
Junio C Hamano5706e0b2009-11-24 10:54:161169--stdin
1170</dt>
1171<dd>
1172<p>
1173 In addition to the <em>&lt;commit&gt;</em> listed on the command
1174 line, read them from the standard input. If a <em>--</em> separator is
1175 seen, stop reading commits and start reading paths to limit the
1176 result.
1177</p>
1178</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591179<dt class="hdlist1">
Junio C Hamano9a2fb2d2011-03-23 05:40:151180--cherry-mark
1181</dt>
1182<dd>
1183<p>
Junio C Hamano9629d4f2012-12-19 00:28:271184 Like <code>--cherry-pick</code> (see below) but mark equivalent commits
1185 with <code>=</code> rather than omitting them, and inequivalent ones with <code>+</code>.
Junio C Hamano9a2fb2d2011-03-23 05:40:151186</p>
1187</dd>
1188<dt class="hdlist1">
Junio C Hamanob0e02952008-01-19 08:02:001189--cherry-pick
1190</dt>
1191<dd>
1192<p>
1193 Omit any commit that introduces the same change as
1194 another commit on the "other side" when the set of
Junio C Hamano68cf15a2010-11-06 01:01:591195 commits are limited with symmetric difference.
1196</p>
Junio C Hamano9629d4f2012-12-19 00:28:271197<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:001198to list all commits on only one side of them is with
Junio C Hamano9629d4f2012-12-19 00:28:271199<code>--left-right</code> (see the example below in the description of
1200the <code>--left-right</code> option). It however shows the commits that were cherry-picked
Junio C Hamanob0e02952008-01-19 08:02:001201from the other branch (for example, "3rd on b" may be cherry-picked
1202from branch A). With this option, such pairs of commits are
Junio C Hamano68cf15a2010-11-06 01:01:591203excluded from the output.</p></div>
Junio C Hamanob0e02952008-01-19 08:02:001204</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591205<dt class="hdlist1">
Junio C Hamano9a2fb2d2011-03-23 05:40:151206--left-only
1207</dt>
1208<dt class="hdlist1">
1209--right-only
1210</dt>
1211<dd>
1212<p>
1213 List only commits on the respective side of a symmetric range,
Junio C Hamano9629d4f2012-12-19 00:28:271214 i.e. only those which would be marked <code>&lt;</code> resp. <code>&gt;</code> by
1215 <code>--left-right</code>.
Junio C Hamano9a2fb2d2011-03-23 05:40:151216</p>
Junio C Hamano9629d4f2012-12-19 00:28:271217<div class="paragraph"><p>For example, <code>--cherry-pick --right-only A...B</code> omits those
1218commits from <code>B</code> which are in <code>A</code> or are patch-equivalent to a commit in
1219<code>A</code>. In other words, this lists the <code>+</code> commits from <code>git cherry A B</code>.
1220More precisely, <code>--cherry-pick --right-only --no-merges</code> gives the exact
Junio C Hamano9a2fb2d2011-03-23 05:40:151221list.</p></div>
1222</dd>
1223<dt class="hdlist1">
1224--cherry
1225</dt>
1226<dd>
1227<p>
Junio C Hamano9629d4f2012-12-19 00:28:271228 A synonym for <code>--right-only --cherry-mark --no-merges</code>; useful to
Junio C Hamano9a2fb2d2011-03-23 05:40:151229 limit the output to the commits on our side and mark those that
1230 have been applied to the other side of a forked history with
Junio C Hamano9629d4f2012-12-19 00:28:271231 <code>git log --cherry upstream...mybranch</code>, similar to
1232 <code>git cherry upstream mybranch</code>.
Junio C Hamano9a2fb2d2011-03-23 05:40:151233</p>
1234</dd>
1235<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471236-g
1237</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591238<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471239--walk-reflogs
Junio C Hamanob0e02952008-01-19 08:02:001240</dt>
1241<dd>
1242<p>
1243 Instead of walking the commit ancestry chain, walk
1244 reflog entries from the most recent one to older ones.
1245 When this option is used you cannot specify commits to
1246 exclude (that is, <em>&#94;commit</em>, <em>commit1..commit2</em>,
Junio C Hamano68cf15a2010-11-06 01:01:591247 nor <em>commit1...commit2</em> notations cannot be used).
1248</p>
1249<div class="paragraph"><p>With <em>--pretty</em> format other than oneline (for obvious reasons),
Junio C Hamanob0e02952008-01-19 08:02:001250this causes the output to have two extra lines of information
1251taken from the reflog. By default, <em>commit@{Nth}</em> notation is
1252used in the output. When the starting commit is specified as
Junio C Hamano1d368882008-08-11 22:03:101253<em>commit@{now}</em>, output also uses <em>commit@{timestamp}</em> notation
Junio C Hamanob0e02952008-01-19 08:02:001254instead. Under <em>--pretty=oneline</em>, the commit message is
1255prefixed with this information on the same line.
Junio C Hamano1d368882008-08-11 22:03:101256This option cannot be combined with <em>--reverse</em>.
Junio C Hamanoa28a9202012-06-21 07:08:231257See also <a href="git-reflog.html">git-reflog(1)</a>.</p></div>
Junio C Hamanob0e02952008-01-19 08:02:001258</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591259<dt class="hdlist1">
Junio C Hamanob0e02952008-01-19 08:02:001260--merge
1261</dt>
1262<dd>
1263<p>
1264 After a failed merge, show refs that touch files having a
Junio C Hamano68cf15a2010-11-06 01:01:591265 conflict and don&#8217;t exist on all heads to merge.
Junio C Hamanob0e02952008-01-19 08:02:001266</p>
1267</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591268<dt class="hdlist1">
Junio C Hamanob0e02952008-01-19 08:02:001269--boundary
1270</dt>
1271<dd>
1272<p>
1273 Output uninteresting commits at the boundary, which are usually
1274 not shown.
1275</p>
1276</dd>
Junio C Hamanoa76cb0d2008-08-13 20:04:101277</dl></div>
Junio C Hamano9629d4f2012-12-19 00:28:271278</div></div>
1279</div>
1280<div class="sect2">
1281<h3 id="_history_simplification">History Simplification</h3>
Junio C Hamano68cf15a2010-11-06 01:01:591282<div class="paragraph"><p>Sometimes you are only interested in parts of the history, for example the
Junio C Hamano28363492008-11-14 08:26:311283commits modifying a particular &lt;path&gt;. But there are two parts of
1284<em>History Simplification</em>, one part is selecting the commits and the other
1285is how to do it, as there are various strategies to simplify the history.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591286<div class="paragraph"><p>The following options select the commits to be shown:</p></div>
1287<div class="dlist"><dl>
1288<dt class="hdlist1">
Junio C Hamano28363492008-11-14 08:26:311289&lt;paths&gt;
1290</dt>
1291<dd>
1292<p>
1293 Commits modifying the given &lt;paths&gt; are selected.
1294</p>
1295</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591296<dt class="hdlist1">
Junio C Hamano28363492008-11-14 08:26:311297--simplify-by-decoration
1298</dt>
1299<dd>
1300<p>
1301 Commits that are referred by some branch or tag are selected.
1302</p>
1303</dd>
1304</dl></div>
Junio C Hamano68cf15a2010-11-06 01:01:591305<div class="paragraph"><p>Note that extra commits can be shown to give a meaningful history.</p></div>
1306<div class="paragraph"><p>The following options affect the way the simplification is performed:</p></div>
1307<div class="dlist"><dl>
1308<dt class="hdlist1">
Junio C Hamano28363492008-11-14 08:26:311309Default mode
1310</dt>
1311<dd>
1312<p>
1313 Simplifies the history to the simplest history explaining the
1314 final state of the tree. Simplest because it prunes some side
1315 branches if the end result is the same (i.e. merging branches
1316 with the same content)
1317</p>
1318</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591319<dt class="hdlist1">
Junio C Hamano28363492008-11-14 08:26:311320--full-history
1321</dt>
1322<dd>
1323<p>
Junio C Hamano15567bc2011-07-23 00:51:591324 Same as the default mode, but does not prune some history.
Junio C Hamano28363492008-11-14 08:26:311325</p>
1326</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591327<dt class="hdlist1">
Junio C Hamano28363492008-11-14 08:26:311328--dense
1329</dt>
1330<dd>
1331<p>
1332 Only the selected commits are shown, plus some to have a
1333 meaningful history.
1334</p>
1335</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591336<dt class="hdlist1">
Junio C Hamano28363492008-11-14 08:26:311337--sparse
1338</dt>
1339<dd>
1340<p>
1341 All commits in the simplified history are shown.
1342</p>
1343</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591344<dt class="hdlist1">
Junio C Hamano28363492008-11-14 08:26:311345--simplify-merges
1346</dt>
1347<dd>
1348<p>
1349 Additional option to <em>--full-history</em> to remove some needless
1350 merges from the resulting history, as there are no selected
1351 commits contributing to this merge.
1352</p>
1353</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591354<dt class="hdlist1">
Junio C Hamano89a57342010-06-22 23:22:551355--ancestry-path
1356</dt>
1357<dd>
1358<p>
1359 When given a range of commits to display (e.g. <em>commit1..commit2</em>
1360 or <em>commit2 &#94;commit1</em>), only display commits that exist
1361 directly on the ancestry chain between the <em>commit1</em> and
1362 <em>commit2</em>, i.e. commits that are both descendants of <em>commit1</em>,
1363 and ancestors of <em>commit2</em>.
1364</p>
1365</dd>
Junio C Hamano28363492008-11-14 08:26:311366</dl></div>
Junio C Hamano68cf15a2010-11-06 01:01:591367<div class="paragraph"><p>A more detailed explanation follows.</p></div>
Junio C Hamano9629d4f2012-12-19 00:28:271368<div class="paragraph"><p>Suppose you specified <code>foo</code> as the &lt;paths&gt;. We shall call commits
1369that modify <code>foo</code> !TREESAME, and the rest TREESAME. (In a diff
1370filtered for <code>foo</code>, they look different and equal, respectively.)</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591371<div class="paragraph"><p>In the following, we will always refer to the same example history to
Junio C Hamanoa76cb0d2008-08-13 20:04:101372illustrate the differences between simplification settings. We assume
Junio C Hamano9629d4f2012-12-19 00:28:271373that you are filtering for a file <code>foo</code> in this commit graph:</p></div>
Junio C Hamanoa76cb0d2008-08-13 20:04:101374<div class="listingblock">
1375<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:271376<pre><code> .-A---M---N---O---P
Junio C Hamanoa76cb0d2008-08-13 20:04:101377 / / / / /
1378 I B C D E
1379 \ / / / /
Junio C Hamano9629d4f2012-12-19 00:28:271380 `-------------'</code></pre>
Junio C Hamanoa76cb0d2008-08-13 20:04:101381</div></div>
Junio C Hamano360e3a12011-07-13 23:51:561382<div class="paragraph"><p>The horizontal line of history A---P is taken to be the first parent of
Junio C Hamanoa76cb0d2008-08-13 20:04:101383each merge. The commits are:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591384<div class="ulist"><ul>
Junio C Hamanoa76cb0d2008-08-13 20:04:101385<li>
1386<p>
Junio C Hamano9629d4f2012-12-19 00:28:271387<code>I</code> is the initial commit, in which <code>foo</code> exists with contents
1388 "asdf", and a file <code>quux</code> exists with contents "quux". Initial
1389 commits are compared to an empty tree, so <code>I</code> is !TREESAME.
Junio C Hamanoa76cb0d2008-08-13 20:04:101390</p>
1391</li>
1392<li>
1393<p>
Junio C Hamano9629d4f2012-12-19 00:28:271394In <code>A</code>, <code>foo</code> contains just "foo".
Junio C Hamanoa76cb0d2008-08-13 20:04:101395</p>
1396</li>
1397<li>
1398<p>
Junio C Hamano9629d4f2012-12-19 00:28:271399<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:101400 hence TREESAME to all parents.
1401</p>
1402</li>
1403<li>
1404<p>
Junio C Hamano9629d4f2012-12-19 00:28:271405<code>C</code> does not change <code>foo</code>, but its merge <code>N</code> changes it to "foobar",
Junio C Hamanoa76cb0d2008-08-13 20:04:101406 so it is not TREESAME to any parent.
1407</p>
1408</li>
1409<li>
1410<p>
Junio C Hamano9629d4f2012-12-19 00:28:271411<code>D</code> sets <code>foo</code> to "baz". Its merge <code>O</code> combines the strings from
1412 <code>N</code> and <code>D</code> to "foobarbaz"; i.e., it is not TREESAME to any parent.
Junio C Hamanoa76cb0d2008-08-13 20:04:101413</p>
1414</li>
1415<li>
1416<p>
Junio C Hamano9629d4f2012-12-19 00:28:271417<code>E</code> changes <code>quux</code> to "xyzzy", and its merge <code>P</code> combines the
1418 strings to "quux xyzzy". Despite appearing interesting, <code>P</code> is
Junio C Hamanoa76cb0d2008-08-13 20:04:101419 TREESAME to all parents.
1420</p>
1421</li>
1422</ul></div>
Junio C Hamano68cf15a2010-11-06 01:01:591423<div class="paragraph"><p><em>rev-list</em> walks backwards through history, including or excluding
Junio C Hamanoa76cb0d2008-08-13 20:04:101424commits based on whether <em>--full-history</em> and/or parent rewriting
1425(via <em>--parents</em> or <em>--children</em>) are used. The following settings
1426are available.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591427<div class="dlist"><dl>
1428<dt class="hdlist1">
Junio C Hamanoa76cb0d2008-08-13 20:04:101429Default mode
1430</dt>
1431<dd>
1432<p>
1433 Commits are included if they are not TREESAME to any parent
1434 (though this can be changed, see <em>--sparse</em> below). If the
1435 commit was a merge, and it was TREESAME to one parent, follow
1436 only that parent. (Even if there are several TREESAME
1437 parents, follow only one of them.) Otherwise, follow all
1438 parents.
1439</p>
Junio C Hamano68cf15a2010-11-06 01:01:591440<div class="paragraph"><p>This results in:</p></div>
Junio C Hamanoa76cb0d2008-08-13 20:04:101441<div class="listingblock">
1442<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:271443<pre><code> .-A---N---O
Junio C Hamano89a57342010-06-22 23:22:551444 / / /
Junio C Hamano9629d4f2012-12-19 00:28:271445 I---------D</code></pre>
Junio C Hamanoa76cb0d2008-08-13 20:04:101446</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591447<div class="paragraph"><p>Note how the rule to only follow the TREESAME parent, if one is
Junio C Hamano9629d4f2012-12-19 00:28:271448available, removed <code>B</code> from consideration entirely. <code>C</code> was
1449considered via <code>N</code>, but is TREESAME. Root commits are compared to an
1450empty tree, so <code>I</code> is !TREESAME.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591451<div class="paragraph"><p>Parent/child relations are only visible with --parents, but that does
Junio C Hamanoa76cb0d2008-08-13 20:04:101452not affect the commits selected in default mode, so we have shown the
1453parent lines.</p></div>
1454</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591455<dt class="hdlist1">
Junio C Hamanoa76cb0d2008-08-13 20:04:101456--full-history without parent rewriting
1457</dt>
1458<dd>
1459<p>
1460 This mode differs from the default in one point: always follow
1461 all parents of a merge, even if it is TREESAME to one of them.
1462 Even if more than one side of the merge has commits that are
1463 included, this does not imply that the merge itself is! In
1464 the example, we get
1465</p>
1466<div class="listingblock">
1467<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:271468<pre><code> I A B N D O</code></pre>
Junio C Hamanoa76cb0d2008-08-13 20:04:101469</div></div>
Junio C Hamano9629d4f2012-12-19 00:28:271470<div class="paragraph"><p><code>P</code> and <code>M</code> were excluded because they are TREESAME to a parent. <code>E</code>,
1471<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:101472do not appear.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591473<div class="paragraph"><p>Note that without parent rewriting, it is not really possible to talk
Junio C Hamanoa76cb0d2008-08-13 20:04:101474about the parent/child relationships between the commits, so we show
1475them disconnected.</p></div>
1476</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591477<dt class="hdlist1">
Junio C Hamanoa76cb0d2008-08-13 20:04:101478--full-history with parent rewriting
1479</dt>
1480<dd>
1481<p>
1482 Ordinary commits are only included if they are !TREESAME
1483 (though this can be changed, see <em>--sparse</em> below).
1484</p>
Junio C Hamano68cf15a2010-11-06 01:01:591485<div class="paragraph"><p>Merges are always included. However, their parent list is rewritten:
Junio C Hamanoa76cb0d2008-08-13 20:04:101486Along each parent, prune away commits that are not included
1487themselves. This results in</p></div>
1488<div class="listingblock">
1489<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:271490<pre><code> .-A---M---N---O---P
Junio C Hamanoa76cb0d2008-08-13 20:04:101491 / / / / /
1492 I B / D /
1493 \ / / / /
Junio C Hamano9629d4f2012-12-19 00:28:271494 `-------------'</code></pre>
Junio C Hamanoa76cb0d2008-08-13 20:04:101495</div></div>
Junio C Hamano9629d4f2012-12-19 00:28:271496<div class="paragraph"><p>Compare to <em>--full-history</em> without rewriting above. Note that <code>E</code>
Junio C Hamanoa76cb0d2008-08-13 20:04:101497was pruned away because it is TREESAME, but the parent list of P was
Junio C Hamano9629d4f2012-12-19 00:28:271498rewritten to contain <code>E</code>'s parent <code>I</code>. The same happened for <code>C</code> and
1499<code>N</code>. Note also that <code>P</code> was included despite being TREESAME.</p></div>
Junio C Hamanoa76cb0d2008-08-13 20:04:101500</dd>
1501</dl></div>
Junio C Hamano68cf15a2010-11-06 01:01:591502<div class="paragraph"><p>In addition to the above settings, you can change whether TREESAME
Junio C Hamanoa76cb0d2008-08-13 20:04:101503affects inclusion:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591504<div class="dlist"><dl>
1505<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471506--dense
1507</dt>
Junio C Hamanoa76cb0d2008-08-13 20:04:101508<dd>
1509<p>
1510 Commits that are walked are included if they are not TREESAME
1511 to any parent.
1512</p>
1513</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591514<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471515--sparse
Junio C Hamanob0e02952008-01-19 08:02:001516</dt>
1517<dd>
1518<p>
Junio C Hamanoa76cb0d2008-08-13 20:04:101519 All commits that are walked are included.
Junio C Hamanob0e02952008-01-19 08:02:001520</p>
Junio C Hamano68cf15a2010-11-06 01:01:591521<div class="paragraph"><p>Note that without <em>--full-history</em>, this still simplifies merges: if
Junio C Hamanoa76cb0d2008-08-13 20:04:101522one of the parents is TREESAME, we follow only that one, so the other
1523sides of the merge are never walked.</p></div>
Junio C Hamanob0e02952008-01-19 08:02:001524</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591525<dt class="hdlist1">
Junio C Hamanoa2f46622008-09-03 05:20:311526--simplify-merges
1527</dt>
1528<dd>
1529<p>
1530 First, build a history graph in the same way that
1531 <em>--full-history</em> with parent rewriting does (see above).
1532</p>
Junio C Hamano9629d4f2012-12-19 00:28:271533<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:311534history according to the following rules:</p></div>
Junio C Hamano9629d4f2012-12-19 00:28:271535<div class="openblock">
1536<div class="content">
Junio C Hamano68cf15a2010-11-06 01:01:591537<div class="ulist"><ul>
Junio C Hamanoa2f46622008-09-03 05:20:311538<li>
1539<p>
Junio C Hamano9629d4f2012-12-19 00:28:271540Set <code>C'</code> to <code>C</code>.
Junio C Hamanoa2f46622008-09-03 05:20:311541</p>
1542</li>
1543<li>
1544<p>
Junio C Hamano9629d4f2012-12-19 00:28:271545Replace each parent <code>P</code> of <code>C'</code> with its simplification <code>P'</code>. In
Junio C Hamanoa2f46622008-09-03 05:20:311546 the process, drop parents that are ancestors of other parents, and
Junio C Hamano68cf15a2010-11-06 01:01:591547 remove duplicates.
Junio C Hamanoa2f46622008-09-03 05:20:311548</p>
1549</li>
1550<li>
1551<p>
Junio C Hamano9629d4f2012-12-19 00:28:271552If after this parent rewriting, <code>C'</code> is a root or merge commit (has
Junio C Hamanoa2f46622008-09-03 05:20:311553 zero or &gt;1 parents), a boundary commit, or !TREESAME, it remains.
1554 Otherwise, it is replaced with its only parent.
1555</p>
1556</li>
1557</ul></div>
Junio C Hamano9629d4f2012-12-19 00:28:271558</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591559<div class="paragraph"><p>The effect of this is best shown by way of comparing to
Junio C Hamanoa2f46622008-09-03 05:20:311560<em>--full-history</em> with parent rewriting. The example turns into:</p></div>
1561<div class="listingblock">
1562<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:271563<pre><code> .-A---M---N---O
Junio C Hamanoa2f46622008-09-03 05:20:311564 / / /
1565 I B D
1566 \ / /
Junio C Hamano9629d4f2012-12-19 00:28:271567 `---------'</code></pre>
Junio C Hamanoa2f46622008-09-03 05:20:311568</div></div>
Junio C Hamano9629d4f2012-12-19 00:28:271569<div class="paragraph"><p>Note the major differences in <code>N</code> and <code>P</code> over <em>--full-history</em>:</p></div>
1570<div class="openblock">
1571<div class="content">
Junio C Hamano68cf15a2010-11-06 01:01:591572<div class="ulist"><ul>
Junio C Hamanoa2f46622008-09-03 05:20:311573<li>
1574<p>
Junio C Hamano9629d4f2012-12-19 00:28:271575<code>N</code>'s parent list had <code>I</code> removed, because it is an ancestor of the
1576 other parent <code>M</code>. Still, <code>N</code> remained because it is !TREESAME.
Junio C Hamanoa2f46622008-09-03 05:20:311577</p>
1578</li>
1579<li>
1580<p>
Junio C Hamano9629d4f2012-12-19 00:28:271581<code>P</code>'s parent list similarly had <code>I</code> removed. <code>P</code> was then
Junio C Hamanoa2f46622008-09-03 05:20:311582 removed completely, because it had one parent and is TREESAME.
1583</p>
1584</li>
1585</ul></div>
Junio C Hamano9629d4f2012-12-19 00:28:271586</div></div>
Junio C Hamanoa2f46622008-09-03 05:20:311587</dd>
1588</dl></div>
Junio C Hamano68cf15a2010-11-06 01:01:591589<div class="paragraph"><p>Finally, there is a fifth simplification mode available:</p></div>
1590<div class="dlist"><dl>
1591<dt class="hdlist1">
Junio C Hamano89a57342010-06-22 23:22:551592--ancestry-path
1593</dt>
1594<dd>
1595<p>
1596 Limit the displayed commits to those directly on the ancestry
1597 chain between the "from" and "to" commits in the given commit
1598 range. I.e. only display commits that are ancestor of the "to"
1599 commit, and descendants of the "from" commit.
1600</p>
Junio C Hamano68cf15a2010-11-06 01:01:591601<div class="paragraph"><p>As an example use case, consider the following commit history:</p></div>
Junio C Hamano89a57342010-06-22 23:22:551602<div class="listingblock">
1603<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:271604<pre><code> D---E-------F
Junio C Hamano89a57342010-06-22 23:22:551605 / \ \
1606 B---C---G---H---I---J
1607 / \
Junio C Hamano9629d4f2012-12-19 00:28:271608 A-------K---------------L--M</code></pre>
Junio C Hamano89a57342010-06-22 23:22:551609</div></div>
Junio C Hamano9629d4f2012-12-19 00:28:271610<div class="paragraph"><p>A regular <em>D..M</em> computes the set of commits that are ancestors of <code>M</code>,
1611but excludes the ones that are ancestors of <code>D</code>. This is useful to see
1612what happened to the history leading to <code>M</code> since <code>D</code>, in the sense
1613that "what does <code>M</code> have that did not exist in <code>D</code>". The result in this
1614example 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:551615of course).</p></div>
Junio C Hamano9629d4f2012-12-19 00:28:271616<div class="paragraph"><p>When we want to find out what commits in <code>M</code> are contaminated with the
1617bug introduced by <code>D</code> and need fixing, however, we might want to view
1618only the subset of <em>D..M</em> that are actually descendants of <code>D</code>, i.e.
1619excluding <code>C</code> and <code>K</code>. This is exactly what the <em>--ancestry-path</em>
Junio C Hamano89a57342010-06-22 23:22:551620option does. Applied to the <em>D..M</em> range, it results in:</p></div>
1621<div class="listingblock">
1622<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:271623<pre><code> E-------F
Junio C Hamano89a57342010-06-22 23:22:551624 \ \
1625 G---H---I---J
1626 \
Junio C Hamano9629d4f2012-12-19 00:28:271627 L--M</code></pre>
Junio C Hamano89a57342010-06-22 23:22:551628</div></div>
1629</dd>
1630</dl></div>
Junio C Hamano68cf15a2010-11-06 01:01:591631<div class="paragraph"><p>The <em>--simplify-by-decoration</em> option allows you to view only the
Junio C Hamano28363492008-11-14 08:26:311632big picture of the topology of the history, by omitting commits
1633that are not referenced by tags. Commits are marked as !TREESAME
1634(in other words, kept after history simplification rules described
1635above) if (1) they are referenced by tags, or (2) they change the
1636contents of the paths given on the command line. All other
1637commits are marked as TREESAME (subject to be simplified away).</p></div>
Junio C Hamano9629d4f2012-12-19 00:28:271638</div>
1639<div class="sect2">
1640<h3 id="_commit_ordering">Commit Ordering</h3>
Junio C Hamano68cf15a2010-11-06 01:01:591641<div class="paragraph"><p>By default, the commits are shown in reverse chronological order.</p></div>
1642<div class="dlist"><dl>
1643<dt class="hdlist1">
Junio C Hamanob0e02952008-01-19 08:02:001644--date-order
1645</dt>
1646<dd>
1647<p>
Junio C Hamanod0316112012-08-22 19:55:291648 Show no parents before all of its children are shown, but
1649 otherwise show commits in the commit timestamp order.
Junio C Hamanob0e02952008-01-19 08:02:001650</p>
1651</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591652<dt class="hdlist1">
Junio C Hamanod0316112012-08-22 19:55:291653--topo-order
1654</dt>
1655<dd>
1656<p>
1657 Show no parents before all of its children are shown, and
1658 avoid showing commits on multiple lines of history
1659 intermixed.
1660</p>
1661<div class="paragraph"><p>For example, in a commit history like this:</p></div>
1662<div class="listingblock">
1663<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:271664<pre><code> ---1----2----4----7
Junio C Hamanod0316112012-08-22 19:55:291665 \ \
Junio C Hamano9629d4f2012-12-19 00:28:271666 3----5----6----8---</code></pre>
Junio C Hamanod0316112012-08-22 19:55:291667</div></div>
Junio C Hamano9629d4f2012-12-19 00:28:271668<div class="paragraph"><p>where the numbers denote the order of commit timestamps, <code>git
1669rev-list</code> and friends with <code>--date-order</code> show the commits in the
Junio C Hamanod0316112012-08-22 19:55:291670timestamp order: 8 7 6 5 4 3 2 1.</p></div>
Junio C Hamano9629d4f2012-12-19 00:28:271671<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:2916723 1); some older commits are shown before newer ones in order to
1673avoid showing the commits from two parallel development track mixed
1674together.</p></div>
1675</dd>
1676<dt class="hdlist1">
Junio C Hamanob0e02952008-01-19 08:02:001677--reverse
1678</dt>
1679<dd>
1680<p>
1681 Output the commits in reverse order.
1682 Cannot be combined with <em>--walk-reflogs</em>.
1683</p>
1684</dd>
Junio C Hamanoba4b9282008-07-06 05:20:311685</dl></div>
Junio C Hamano9629d4f2012-12-19 00:28:271686</div>
1687<div class="sect2">
1688<h3 id="_object_traversal">Object Traversal</h3>
Junio C Hamano076ffcc2013-02-06 05:13:211689<div class="paragraph"><p>These options are mostly targeted for packing of Git repositories.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591690<div class="dlist"><dl>
1691<dt class="hdlist1">
Junio C Hamanob0e02952008-01-19 08:02:001692--objects
1693</dt>
1694<dd>
1695<p>
1696 Print the object IDs of any object referenced by the listed
1697 commits. <em>--objects foo ^bar</em> thus means "send me
1698 all object IDs which I need to download if I have the commit
1699 object <em>bar</em>, but not <em>foo</em>".
1700</p>
1701</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591702<dt class="hdlist1">
Junio C Hamanob0e02952008-01-19 08:02:001703--objects-edge
1704</dt>
1705<dd>
1706<p>
1707 Similar to <em>--objects</em>, but also print the IDs of excluded
1708 commits prefixed with a "-" character. This is used by
Junio C Hamanoa28a9202012-06-21 07:08:231709 <a href="git-pack-objects.html">git-pack-objects(1)</a> to build "thin" pack, which records
Junio C Hamanob0e02952008-01-19 08:02:001710 objects in deltified form based on objects contained in these
1711 excluded commits to reduce network traffic.
1712</p>
1713</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591714<dt class="hdlist1">
Junio C Hamanob0e02952008-01-19 08:02:001715--unpacked
1716</dt>
1717<dd>
1718<p>
1719 Only useful with <em>--objects</em>; print the object IDs that are not
1720 in packs.
1721</p>
1722</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591723<dt class="hdlist1">
Junio C Hamanoeccdd4a2012-09-10 23:28:171724--no-walk[=(sorted|unsorted)]
Junio C Hamanob0e02952008-01-19 08:02:001725</dt>
1726<dd>
1727<p>
Junio C Hamanoeccdd4a2012-09-10 23:28:171728 Only show the given commits, but do not traverse their ancestors.
1729 This has no effect if a range is specified. If the argument
1730 "unsorted" is given, the commits are show in the order they were
1731 given on the command line. Otherwise (if "sorted" or no argument
1732 was given), the commits are show in reverse chronological order
1733 by commit time.
Junio C Hamanob0e02952008-01-19 08:02:001734</p>
1735</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591736<dt class="hdlist1">
Junio C Hamanob0e02952008-01-19 08:02:001737--do-walk
1738</dt>
1739<dd>
1740<p>
1741 Overrides a previous --no-walk.
1742</p>
1743</dd>
Junio C Hamanoba4b9282008-07-06 05:20:311744</dl></div>
Junio C Hamano9629d4f2012-12-19 00:28:271745</div>
1746<div class="sect2">
1747<h3 id="_commit_formatting">Commit Formatting</h3>
Junio C Hamanod2c978f2011-03-20 19:42:221748<div class="dlist"><dl>
1749<dt class="hdlist1">
1750--pretty[=&lt;format&gt;]
1751</dt>
1752<dt class="hdlist1">
1753--format=&lt;format&gt;
1754</dt>
1755<dd>
1756<p>
1757 Pretty-print the contents of the commit logs in a given format,
1758 where <em>&lt;format&gt;</em> can be one of <em>oneline</em>, <em>short</em>, <em>medium</em>,
1759 <em>full</em>, <em>fuller</em>, <em>email</em>, <em>raw</em> and <em>format:&lt;string&gt;</em>. See
1760 the "PRETTY FORMATS" section for some additional details for each
1761 format. When omitted, the format defaults to <em>medium</em>.
1762</p>
1763<div class="paragraph"><p>Note: you can specify the default pretty format in the repository
Junio C Hamanoa28a9202012-06-21 07:08:231764configuration (see <a href="git-config.html">git-config(1)</a>).</p></div>
Junio C Hamanod2c978f2011-03-20 19:42:221765</dd>
1766<dt class="hdlist1">
1767--abbrev-commit
1768</dt>
1769<dd>
1770<p>
1771 Instead of showing the full 40-byte hexadecimal commit object
1772 name, show only a partial prefix. Non default number of
1773 digits can be specified with "--abbrev=&lt;n&gt;" (which also modifies
1774 diff output, if it is displayed).
1775</p>
1776<div class="paragraph"><p>This should make "--pretty=oneline" a whole lot more readable for
1777people using 80-column terminals.</p></div>
1778</dd>
1779<dt class="hdlist1">
Junio C Hamanof93530e2011-05-25 23:59:591780--no-abbrev-commit
1781</dt>
1782<dd>
1783<p>
1784 Show the full 40-byte hexadecimal commit object name. This negates
Junio C Hamano9629d4f2012-12-19 00:28:271785 <code>--abbrev-commit</code> and those options which imply it such as
Junio C Hamanof93530e2011-05-25 23:59:591786 "--oneline". It also overrides the <em>log.abbrevCommit</em> variable.
1787</p>
1788</dd>
1789<dt class="hdlist1">
Junio C Hamanod2c978f2011-03-20 19:42:221790--oneline
1791</dt>
1792<dd>
1793<p>
1794 This is a shorthand for "--pretty=oneline --abbrev-commit"
1795 used together.
1796</p>
1797</dd>
1798<dt class="hdlist1">
1799--encoding[=&lt;encoding&gt;]
1800</dt>
1801<dd>
1802<p>
1803 The commit objects record the encoding used for the log message
1804 in their encoding header; this option can be used to tell the
1805 command to re-code the commit log message in the encoding
1806 preferred by the user. For non plumbing commands this
1807 defaults to UTF-8.
1808</p>
1809</dd>
1810<dt class="hdlist1">
Junio C Hamano60033462011-05-03 00:48:431811--notes[=&lt;ref&gt;]
Junio C Hamanod2c978f2011-03-20 19:42:221812</dt>
1813<dd>
1814<p>
Junio C Hamanoa28a9202012-06-21 07:08:231815 Show the notes (see <a href="git-notes.html">git-notes(1)</a>) that annotate the
Junio C Hamanod2c978f2011-03-20 19:42:221816 commit, when showing the commit log message. This is the default
Junio C Hamano9629d4f2012-12-19 00:28:271817 for <code>git log</code>, <code>git show</code> and <code>git whatchanged</code> commands when
1818 there is no <code>--pretty</code>, <code>--format</code> nor <code>--oneline</code> option given
Junio C Hamano60033462011-05-03 00:48:431819 on the command line.
Junio C Hamanod2c978f2011-03-20 19:42:221820</p>
Junio C Hamano60033462011-05-03 00:48:431821<div class="paragraph"><p>By default, the notes shown are from the notes refs listed in the
1822<em>core.notesRef</em> and <em>notes.displayRef</em> variables (or corresponding
Junio C Hamanoa28a9202012-06-21 07:08:231823environment overrides). See <a href="git-config.html">git-config(1)</a> for more details.</p></div>
Junio C Hamano60033462011-05-03 00:48:431824<div class="paragraph"><p>With an optional <em>&lt;ref&gt;</em> argument, show this notes ref instead of the
Junio C Hamano9629d4f2012-12-19 00:28:271825default notes ref(s). The ref is taken to be in <code>refs/notes/</code> if it
Junio C Hamano60033462011-05-03 00:48:431826is not qualified.</p></div>
1827<div class="paragraph"><p>Multiple --notes options can be combined to control which notes are
1828being displayed. Examples: "--notes=foo" will show only notes from
1829"refs/notes/foo"; "--notes=foo --notes" will show both notes from
1830"refs/notes/foo" and from the default notes ref(s).</p></div>
Junio C Hamanod2c978f2011-03-20 19:42:221831</dd>
1832<dt class="hdlist1">
Junio C Hamano60033462011-05-03 00:48:431833--no-notes
1834</dt>
1835<dd>
1836<p>
Junio C Hamano9629d4f2012-12-19 00:28:271837 Do not show notes. This negates the above <code>--notes</code> option, by
Junio C Hamano60033462011-05-03 00:48:431838 resetting the list of notes refs from which notes are shown.
1839 Options are parsed in the order given on the command line, so e.g.
1840 "--notes --notes=foo --no-notes --notes=bar" will only show notes
1841 from "refs/notes/bar".
1842</p>
1843</dd>
1844<dt class="hdlist1">
1845--show-notes[=&lt;ref&gt;]
1846</dt>
1847<dt class="hdlist1">
Junio C Hamanod2c978f2011-03-20 19:42:221848--[no-]standard-notes
1849</dt>
1850<dd>
1851<p>
Junio C Hamano60033462011-05-03 00:48:431852 These options are deprecated. Use the above --notes/--no-notes
1853 options instead.
Junio C Hamanod2c978f2011-03-20 19:42:221854</p>
1855</dd>
1856<dt class="hdlist1">
Junio C Hamano0acb1ae2012-09-24 21:28:131857--show-signature
1858</dt>
1859<dd>
1860<p>
1861 Check the validity of a signed commit object by passing the signature
Junio C Hamano9629d4f2012-12-19 00:28:271862 to <code>gpg --verify</code> and show the output.
Junio C Hamano0acb1ae2012-09-24 21:28:131863</p>
1864</dd>
1865<dt class="hdlist1">
Junio C Hamanod2c978f2011-03-20 19:42:221866--relative-date
1867</dt>
1868<dd>
1869<p>
Junio C Hamano9629d4f2012-12-19 00:28:271870 Synonym for <code>--date=relative</code>.
Junio C Hamanod2c978f2011-03-20 19:42:221871</p>
1872</dd>
1873<dt class="hdlist1">
1874--date=(relative|local|default|iso|rfc|short|raw)
1875</dt>
1876<dd>
1877<p>
1878 Only takes effect for dates shown in human-readable format, such
Junio C Hamano9629d4f2012-12-19 00:28:271879 as when using "--pretty". <code>log.date</code> config variable sets a default
Junio C Hamanod2c978f2011-03-20 19:42:221880 value for log command&#8217;s --date option.
1881</p>
Junio C Hamano9629d4f2012-12-19 00:28:271882<div class="paragraph"><p><code>--date=relative</code> shows dates relative to the current time,
Junio C Hamanod2c978f2011-03-20 19:42:221883e.g. "2 hours ago".</p></div>
Junio C Hamano9629d4f2012-12-19 00:28:271884<div class="paragraph"><p><code>--date=local</code> shows timestamps in user&#8217;s local timezone.</p></div>
1885<div class="paragraph"><p><code>--date=iso</code> (or <code>--date=iso8601</code>) shows timestamps in ISO 8601 format.</p></div>
1886<div class="paragraph"><p><code>--date=rfc</code> (or <code>--date=rfc2822</code>) shows timestamps in RFC 2822
Junio C Hamanod2c978f2011-03-20 19:42:221887format, often found in E-mail messages.</p></div>
Junio C Hamano9629d4f2012-12-19 00:28:271888<div class="paragraph"><p><code>--date=short</code> shows only date but not time, in <code>YYYY-MM-DD</code> format.</p></div>
Junio C Hamano076ffcc2013-02-06 05:13:211889<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 Hamano9629d4f2012-12-19 00:28:271890<div class="paragraph"><p><code>--date=default</code> shows timestamps in the original timezone
Junio C Hamanod2c978f2011-03-20 19:42:221891(either committer&#8217;s or author&#8217;s).</p></div>
1892</dd>
1893<dt class="hdlist1">
1894--parents
1895</dt>
1896<dd>
1897<p>
1898 Print also the parents of the commit (in the form "commit parent&#8230;").
1899 Also enables parent rewriting, see <em>History Simplification</em> below.
1900</p>
1901</dd>
1902<dt class="hdlist1">
1903--children
1904</dt>
1905<dd>
1906<p>
1907 Print also the children of the commit (in the form "commit child&#8230;").
1908 Also enables parent rewriting, see <em>History Simplification</em> below.
1909</p>
1910</dd>
1911<dt class="hdlist1">
1912--left-right
1913</dt>
1914<dd>
1915<p>
1916 Mark which side of a symmetric diff a commit is reachable from.
Junio C Hamano9629d4f2012-12-19 00:28:271917 Commits from the left side are prefixed with <code>&lt;</code> and those from
1918 the right with <code>&gt;</code>. If combined with <code>--boundary</code>, those
1919 commits are prefixed with <code>-</code>.
Junio C Hamanod2c978f2011-03-20 19:42:221920</p>
1921<div class="paragraph"><p>For example, if you have this topology:</p></div>
1922<div class="listingblock">
1923<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:271924<pre><code> y---b---b branch B
Junio C Hamanod2c978f2011-03-20 19:42:221925 / \ /
1926 / .
1927 / / \
Junio C Hamano9629d4f2012-12-19 00:28:271928 o---x---a---a branch A</code></pre>
Junio C Hamanod2c978f2011-03-20 19:42:221929</div></div>
1930<div class="paragraph"><p>you would get an output like this:</p></div>
1931<div class="listingblock">
1932<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:271933<pre><code> $ git rev-list --left-right --boundary --pretty=oneline A...B
Junio C Hamanod2c978f2011-03-20 19:42:221934
1935 &gt;bbbbbbb... 3rd on b
1936 &gt;bbbbbbb... 2nd on b
1937 &lt;aaaaaaa... 3rd on a
1938 &lt;aaaaaaa... 2nd on a
1939 -yyyyyyy... 1st on b
Junio C Hamano9629d4f2012-12-19 00:28:271940 -xxxxxxx... 1st on a</code></pre>
Junio C Hamanod2c978f2011-03-20 19:42:221941</div></div>
1942</dd>
1943<dt class="hdlist1">
1944--graph
1945</dt>
1946<dd>
1947<p>
1948 Draw a text-based graphical representation of the commit history
1949 on the left hand side of the output. This may cause extra lines
1950 to be printed in between commits, in order for the graph history
1951 to be drawn properly.
1952</p>
1953<div class="paragraph"><p>This enables parent rewriting, see <em>History Simplification</em> below.</p></div>
1954<div class="paragraph"><p>This implies the <em>--topo-order</em> option by default, but the
1955<em>--date-order</em> option may also be specified.</p></div>
1956</dd>
1957</dl></div>
Junio C Hamano9629d4f2012-12-19 00:28:271958</div>
1959<div class="sect2">
1960<h3 id="_diff_formatting">Diff Formatting</h3>
Junio C Hamanod2c978f2011-03-20 19:42:221961<div class="paragraph"><p>Below are listed options that control the formatting of diff output.
Junio C Hamanoa28a9202012-06-21 07:08:231962Some of them are specific to <a href="git-rev-list.html">git-rev-list(1)</a>, however other diff
1963options 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:221964<div class="dlist"><dl>
1965<dt class="hdlist1">
1966-c
1967</dt>
1968<dd>
1969<p>
1970 With this option, diff output for a merge commit
1971 shows the differences from each of the parents to the merge result
1972 simultaneously instead of showing pairwise diff between a parent
1973 and the result one at a time. Furthermore, it lists only files
1974 which were modified from all parents.
1975</p>
1976</dd>
1977<dt class="hdlist1">
1978--cc
1979</dt>
1980<dd>
1981<p>
Junio C Hamano44dcd492012-07-24 04:35:381982 This flag implies the <em>-c</em> option and further compresses the
Junio C Hamanod2c978f2011-03-20 19:42:221983 patch output by omitting uninteresting hunks whose contents in
1984 the parents have only two variants and the merge result picks
1985 one of them without modification.
1986</p>
1987</dd>
1988<dt class="hdlist1">
1989-m
1990</dt>
1991<dd>
1992<p>
1993 This flag makes the merge commits show the full diff like
1994 regular commits; for each merge parent, a separate log entry
1995 and diff is generated. An exception is that only diff against
1996 the first parent is shown when <em>--first-parent</em> option is given;
1997 in that case, the output represents the changes the merge
1998 brought <em>into</em> the then-current branch.
1999</p>
2000</dd>
2001<dt class="hdlist1">
2002-r
2003</dt>
2004<dd>
2005<p>
2006 Show recursive diffs.
2007</p>
2008</dd>
2009<dt class="hdlist1">
2010-t
2011</dt>
2012<dd>
2013<p>
2014 Show the tree objects in the diff output. This implies <em>-r</em>.
2015</p>
2016</dd>
2017<dt class="hdlist1">
2018-s
2019</dt>
2020<dd>
2021<p>
2022 Suppress diff output.
2023</p>
2024</dd>
2025</dl></div>
Junio C Hamano0430e3a2007-05-15 03:13:172026</div>
Junio C Hamano9629d4f2012-12-19 00:28:272027</div>
2028</div>
2029<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:312030<h2 id="_pretty_formats">PRETTY FORMATS</h2>
Junio C Hamano0430e3a2007-05-15 03:13:172031<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:592032<div class="paragraph"><p>If the commit is a merge, and if the pretty-format
Junio C Hamano0430e3a2007-05-15 03:13:172033is not <em>oneline</em>, <em>email</em> or <em>raw</em>, an additional line is
2034inserted before the <em>Author:</em> line. This line begins with
2035"Merge: " and the sha1s of ancestral commits are printed,
2036separated by spaces. Note that the listed commits may not
2037necessarily be the list of the <strong>direct</strong> parent commits if you
2038have limited your view of history: for example, if you are
2039only interested in changes related to a certain directory or
Junio C Hamanoba4b9282008-07-06 05:20:312040file.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592041<div class="paragraph"><p>There are several built-in formats, and you can define
Junio C Hamanoa574a092010-06-13 19:57:102042additional formats by setting a pretty.&lt;name&gt;
2043config option to either another format name, or a
2044<em>format:</em> string, as described below (see
Junio C Hamanoa28a9202012-06-21 07:08:232045<a href="git-config.html">git-config(1)</a>). Here are the details of the
Junio C Hamanoa574a092010-06-13 19:57:102046built-in formats:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592047<div class="ulist"><ul>
Junio C Hamanoa340aaa2006-11-23 02:47:332048<li>
2049<p>
2050<em>oneline</em>
2051</p>
2052<div class="literalblock">
2053<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272054<pre><code>&lt;sha1&gt; &lt;title line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332055</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592056<div class="paragraph"><p>This is designed to be as compact as possible.</p></div>
Junio C Hamanoa340aaa2006-11-23 02:47:332057</li>
2058<li>
2059<p>
2060<em>short</em>
2061</p>
2062<div class="literalblock">
2063<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272064<pre><code>commit &lt;sha1&gt;
2065Author: &lt;author&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332066</div></div>
2067<div class="literalblock">
2068<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272069<pre><code>&lt;title line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332070</div></div>
2071</li>
2072<li>
2073<p>
2074<em>medium</em>
2075</p>
2076<div class="literalblock">
2077<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272078<pre><code>commit &lt;sha1&gt;
Junio C Hamanoa340aaa2006-11-23 02:47:332079Author: &lt;author&gt;
Junio C Hamano9629d4f2012-12-19 00:28:272080Date: &lt;author date&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332081</div></div>
2082<div class="literalblock">
2083<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272084<pre><code>&lt;title line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332085</div></div>
2086<div class="literalblock">
2087<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272088<pre><code>&lt;full commit message&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332089</div></div>
2090</li>
2091<li>
2092<p>
2093<em>full</em>
2094</p>
2095<div class="literalblock">
2096<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272097<pre><code>commit &lt;sha1&gt;
Junio C Hamanoa340aaa2006-11-23 02:47:332098Author: &lt;author&gt;
Junio C Hamano9629d4f2012-12-19 00:28:272099Commit: &lt;committer&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332100</div></div>
2101<div class="literalblock">
2102<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272103<pre><code>&lt;title line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332104</div></div>
2105<div class="literalblock">
2106<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272107<pre><code>&lt;full commit message&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332108</div></div>
2109</li>
2110<li>
2111<p>
2112<em>fuller</em>
2113</p>
2114<div class="literalblock">
2115<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272116<pre><code>commit &lt;sha1&gt;
Junio C Hamano6a3c8272008-12-19 21:38:182117Author: &lt;author&gt;
Junio C Hamanoba4b9282008-07-06 05:20:312118AuthorDate: &lt;author date&gt;
Junio C Hamano6a3c8272008-12-19 21:38:182119Commit: &lt;committer&gt;
Junio C Hamano9629d4f2012-12-19 00:28:272120CommitDate: &lt;committer date&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332121</div></div>
2122<div class="literalblock">
2123<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272124<pre><code>&lt;title line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332125</div></div>
2126<div class="literalblock">
2127<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272128<pre><code>&lt;full commit message&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332129</div></div>
2130</li>
2131<li>
2132<p>
2133<em>email</em>
2134</p>
2135<div class="literalblock">
2136<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272137<pre><code>From &lt;sha1&gt; &lt;date&gt;
Junio C Hamanoa340aaa2006-11-23 02:47:332138From: &lt;author&gt;
Junio C Hamanoba4b9282008-07-06 05:20:312139Date: &lt;author date&gt;
Junio C Hamano9629d4f2012-12-19 00:28:272140Subject: [PATCH] &lt;title line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332141</div></div>
2142<div class="literalblock">
2143<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272144<pre><code>&lt;full commit message&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332145</div></div>
2146</li>
2147<li>
2148<p>
2149<em>raw</em>
2150</p>
Junio C Hamano68cf15a2010-11-06 01:01:592151<div class="paragraph"><p>The <em>raw</em> format shows the entire commit exactly as
Junio C Hamanoa340aaa2006-11-23 02:47:332152stored in the commit object. Notably, the SHA1s are
2153displayed in full, regardless of whether --abbrev or
2154--no-abbrev are used, and <em>parents</em> information show the
2155true parent commits, without taking grafts nor history
Junio C Hamanoba4b9282008-07-06 05:20:312156simplification into account.</p></div>
Junio C Hamanoa340aaa2006-11-23 02:47:332157</li>
Junio C Hamanoa3fd83c2007-03-02 10:34:362158<li>
2159<p>
Junio C Hamanoe32ec8b2010-06-02 23:32:312160<em>format:&lt;string&gt;</em>
Junio C Hamanoa3fd83c2007-03-02 10:34:362161</p>
Junio C Hamano68cf15a2010-11-06 01:01:592162<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:362163you want to show. It works a little bit like printf format,
2164with the notable exception that you get a newline with <em>%n</em>
Junio C Hamanoba4b9282008-07-06 05:20:312165instead of <em>\n</em>.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592166<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:312167would show something like this:</p></div>
Junio C Hamano0430e3a2007-05-15 03:13:172168<div class="listingblock">
2169<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272170<pre><code>The author of fe6e0ee was Junio C Hamano, 23 hours ago
2171The 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:172172</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592173<div class="paragraph"><p>The placeholders are:</p></div>
2174<div class="ulist"><ul>
Junio C Hamanoa3fd83c2007-03-02 10:34:362175<li>
2176<p>
2177<em>%H</em>: commit hash
2178</p>
2179</li>
2180<li>
2181<p>
2182<em>%h</em>: abbreviated commit hash
2183</p>
2184</li>
2185<li>
2186<p>
2187<em>%T</em>: tree hash
2188</p>
2189</li>
2190<li>
2191<p>
2192<em>%t</em>: abbreviated tree hash
2193</p>
2194</li>
2195<li>
2196<p>
2197<em>%P</em>: parent hashes
2198</p>
2199</li>
2200<li>
2201<p>
2202<em>%p</em>: abbreviated parent hashes
2203</p>
2204</li>
2205<li>
2206<p>
2207<em>%an</em>: author name
2208</p>
2209</li>
2210<li>
2211<p>
Junio C Hamanoa28a9202012-06-21 07:08:232212<em>%aN</em>: author name (respecting .mailmap, see <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)
Junio C Hamanof5a93622008-07-16 03:23:572213</p>
2214</li>
2215<li>
2216<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:362217<em>%ae</em>: author email
2218</p>
2219</li>
2220<li>
2221<p>
Junio C Hamanoa28a9202012-06-21 07:08:232222<em>%aE</em>: author email (respecting .mailmap, see <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)
Junio C Hamano8bc410e2009-02-15 10:38:192223</p>
2224</li>
2225<li>
2226<p>
Junio C Hamanoa387df32008-08-29 08:56:582227<em>%ad</em>: author date (format respects --date= option)
Junio C Hamanoa3fd83c2007-03-02 10:34:362228</p>
2229</li>
2230<li>
2231<p>
2232<em>%aD</em>: author date, RFC2822 style
2233</p>
2234</li>
2235<li>
2236<p>
2237<em>%ar</em>: author date, relative
2238</p>
2239</li>
2240<li>
2241<p>
2242<em>%at</em>: author date, UNIX timestamp
2243</p>
2244</li>
2245<li>
2246<p>
Junio C Hamano02f130b2007-07-14 08:26:562247<em>%ai</em>: author date, ISO 8601 format
2248</p>
2249</li>
2250<li>
2251<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:362252<em>%cn</em>: committer name
2253</p>
2254</li>
2255<li>
2256<p>
Junio C Hamanoa28a9202012-06-21 07:08:232257<em>%cN</em>: committer name (respecting .mailmap, see <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)
Junio C Hamanof5a93622008-07-16 03:23:572258</p>
2259</li>
2260<li>
2261<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:362262<em>%ce</em>: committer email
2263</p>
2264</li>
2265<li>
2266<p>
Junio C Hamanoa28a9202012-06-21 07:08:232267<em>%cE</em>: committer email (respecting .mailmap, see <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)
Junio C Hamano8bc410e2009-02-15 10:38:192268</p>
2269</li>
2270<li>
2271<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:362272<em>%cd</em>: committer date
2273</p>
2274</li>
2275<li>
2276<p>
2277<em>%cD</em>: committer date, RFC2822 style
2278</p>
2279</li>
2280<li>
2281<p>
2282<em>%cr</em>: committer date, relative
2283</p>
2284</li>
2285<li>
2286<p>
2287<em>%ct</em>: committer date, UNIX timestamp
2288</p>
2289</li>
2290<li>
2291<p>
Junio C Hamano02f130b2007-07-14 08:26:562292<em>%ci</em>: committer date, ISO 8601 format
2293</p>
2294</li>
2295<li>
2296<p>
Junio C Hamanoa28a9202012-06-21 07:08:232297<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:022298</p>
2299</li>
2300<li>
2301<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:362302<em>%e</em>: encoding
2303</p>
2304</li>
2305<li>
2306<p>
2307<em>%s</em>: subject
2308</p>
2309</li>
2310<li>
2311<p>
Junio C Hamano5f9a6f02009-04-06 08:26:562312<em>%f</em>: sanitized subject line, suitable for a filename
2313</p>
2314</li>
2315<li>
2316<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:362317<em>%b</em>: body
2318</p>
2319</li>
2320<li>
2321<p>
Junio C Hamanocb39aea2010-05-09 07:24:482322<em>%B</em>: raw body (unwrapped subject and body)
2323</p>
2324</li>
2325<li>
2326<p>
Junio C Hamano3b70d3c2009-11-21 17:37:372327<em>%N</em>: commit notes
2328</p>
2329</li>
2330<li>
2331<p>
Junio C Hamano0acb1ae2012-09-24 21:28:132332<em>%GG</em>: raw verification message from GPG for a signed commit
2333</p>
2334</li>
2335<li>
2336<p>
Junio C Hamanoedf80bd2013-04-05 22:14:362337<em>%G?</em>: show "G" for a Good signature, "B" for a Bad signature, "U" for a good,
2338 untrusted signature and "N" for no signature
Junio C Hamano0acb1ae2012-09-24 21:28:132339</p>
2340</li>
2341<li>
2342<p>
2343<em>%GS</em>: show the name of the signer for a signed commit
2344</p>
2345</li>
2346<li>
2347<p>
Junio C Hamano5e7f1312013-03-21 22:49:012348<em>%GK</em>: show the key used to sign a signed commit
2349</p>
2350</li>
2351<li>
2352<p>
Junio C Hamano9629d4f2012-12-19 00:28:272353<em>%gD</em>: reflog selector, e.g., <code>refs/stash@{1}</code>
Junio C Hamanoc21ab052009-10-31 04:03:552354</p>
2355</li>
2356<li>
2357<p>
Junio C Hamano9629d4f2012-12-19 00:28:272358<em>%gd</em>: shortened reflog selector, e.g., <code>stash@{1}</code>
Junio C Hamanoc21ab052009-10-31 04:03:552359</p>
2360</li>
2361<li>
2362<p>
Junio C Hamano962f3a32011-12-22 20:21:442363<em>%gn</em>: reflog identity name
2364</p>
2365</li>
2366<li>
2367<p>
Junio C Hamanoa28a9202012-06-21 07:08:232368<em>%gN</em>: reflog identity name (respecting .mailmap, see <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:442369</p>
2370</li>
2371<li>
2372<p>
2373<em>%ge</em>: reflog identity email
2374</p>
2375</li>
2376<li>
2377<p>
Junio C Hamanoa28a9202012-06-21 07:08:232378<em>%gE</em>: reflog identity email (respecting .mailmap, see <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:442379</p>
2380</li>
2381<li>
2382<p>
Junio C Hamanoc21ab052009-10-31 04:03:552383<em>%gs</em>: reflog subject
2384</p>
2385</li>
2386<li>
2387<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:362388<em>%Cred</em>: switch color to red
2389</p>
2390</li>
2391<li>
2392<p>
2393<em>%Cgreen</em>: switch color to green
2394</p>
2395</li>
2396<li>
2397<p>
2398<em>%Cblue</em>: switch color to blue
2399</p>
2400</li>
2401<li>
2402<p>
2403<em>%Creset</em>: reset color
2404</p>
2405</li>
2406<li>
2407<p>
Junio C Hamanoabad6da2013-01-06 09:06:322408<em>%C(&#8230;)</em>: color specification, as described in color.branch.* config option;
2409 adding <code>auto,</code> at the beginning will emit color only when colors are
2410 enabled for log output (by <code>color.diff</code>, <code>color.ui</code>, or <code>--color</code>, and
2411 respecting the <code>auto</code> settings of the former if we are going to a
2412 terminal)
Junio C Hamanocc0cb312009-01-22 03:38:502413</p>
2414</li>
2415<li>
2416<p>
Junio C Hamanod9e0e5d2007-04-14 16:22:042417<em>%m</em>: left, right or boundary mark
2418</p>
2419</li>
2420<li>
2421<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:362422<em>%n</em>: newline
2423</p>
Junio C Hamano0430e3a2007-05-15 03:13:172424</li>
Junio C Hamanob78d2592008-04-09 09:39:082425<li>
2426<p>
Junio C Hamanoa9701f02010-01-21 00:42:162427<em>%%</em>: a raw <em>%</em>
2428</p>
2429</li>
2430<li>
2431<p>
Junio C Hamanob78d2592008-04-09 09:39:082432<em>%x00</em>: print a byte from a hex code
2433</p>
2434</li>
Junio C Hamanobf984de2009-11-23 06:11:192435<li>
2436<p>
2437<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:232438 <a href="git-shortlog.html">git-shortlog(1)</a>.
Junio C Hamanobf984de2009-11-23 06:11:192439</p>
2440</li>
Junio C Hamanoba4b9282008-07-06 05:20:312441</ul></div>
Junio C Hamanoa3fd83c2007-03-02 10:34:362442</li>
Junio C Hamanoc21ab052009-10-31 04:03:552443</ul></div>
2444<div class="admonitionblock">
2445<table><tr>
2446<td class="icon">
2447<div class="title">Note</div>
2448</td>
2449<td class="content">Some placeholders may depend on other options given to the
Junio C Hamano9629d4f2012-12-19 00:28:272450revision traversal engine. For example, the <code>%g*</code> reflog options will
Junio C Hamanoc21ab052009-10-31 04:03:552451insert an empty string unless we are traversing reflog entries (e.g., by
Junio C Hamano9629d4f2012-12-19 00:28:272452<code>git log -g</code>). The <code>%d</code> placeholder will use the "short" decoration
2453format if <code>--decorate</code> was not already provided on the command line.</td>
Junio C Hamanoc21ab052009-10-31 04:03:552454</tr></table>
2455</div>
Junio C Hamano9629d4f2012-12-19 00:28:272456<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:592457is inserted immediately before the expansion if and only if the
2458placeholder expands to a non-empty string.</p></div>
Junio C Hamano9629d4f2012-12-19 00:28:272459<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:592460immediately precede the expansion are deleted if and only if the
2461placeholder expands to an empty string.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592462<div class="paragraph"><p>If you add a ` ` (space) after <em>%</em> of a placeholder, a space
Junio C Hamano89a57342010-06-22 23:22:552463is inserted immediately before the expansion if and only if the
2464placeholder expands to a non-empty string.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592465<div class="ulist"><ul>
Junio C Hamano6fb124c2008-06-13 10:04:012466<li>
2467<p>
2468<em>tformat:</em>
2469</p>
Junio C Hamano68cf15a2010-11-06 01:01:592470<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:012471provides "terminator" semantics instead of "separator" semantics. In
2472other words, each commit has the message terminator character (usually a
2473newline) appended, rather than a separator placed between entries.
2474This means that the final entry of a single-line format will be properly
2475terminated with a new line, just as the "oneline" format does.
Junio C Hamanoba4b9282008-07-06 05:20:312476For example:</p></div>
Junio C Hamano6fb124c2008-06-13 10:04:012477<div class="listingblock">
2478<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272479<pre><code>$ git log -2 --pretty=format:%h 4da45bef \
Junio C Hamano6fb124c2008-06-13 10:04:012480 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
24814da45be
24827134973 -- NO NEWLINE
2483
2484$ git log -2 --pretty=tformat:%h 4da45bef \
2485 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
24864da45be
Junio C Hamano9629d4f2012-12-19 00:28:2724877134973</code></pre>
Junio C Hamano6fb124c2008-06-13 10:04:012488</div></div>
Junio C Hamano9629d4f2012-12-19 00:28:272489<div class="paragraph"><p>In addition, any unrecognized string that has a <code>%</code> in it is interpreted
2490as if it has <code>tformat:</code> in front of it. For example, these two are
Junio C Hamano0a235222009-03-06 08:21:092491equivalent:</p></div>
2492<div class="listingblock">
2493<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272494<pre><code>$ git log -2 --pretty=tformat:%h 4da45bef
2495$ git log -2 --pretty=%h 4da45bef</code></pre>
Junio C Hamano0a235222009-03-06 08:21:092496</div></div>
Junio C Hamano6fb124c2008-06-13 10:04:012497</li>
Junio C Hamanoba4b9282008-07-06 05:20:312498</ul></div>
Junio C Hamano1a4e8412005-12-27 08:17:232499</div>
Junio C Hamano9629d4f2012-12-19 00:28:272500</div>
2501<div class="sect1">
Junio C Hamanod2c978f2011-03-20 19:42:222502<h2 id="_common_diff_options">Common diff options</h2>
2503<div class="sectionbody">
2504<div class="dlist"><dl>
2505<dt class="hdlist1">
2506-p
2507</dt>
2508<dt class="hdlist1">
2509-u
2510</dt>
2511<dt class="hdlist1">
2512--patch
2513</dt>
2514<dd>
2515<p>
2516 Generate patch (see section on generating patches).
2517
2518</p>
2519</dd>
2520<dt class="hdlist1">
2521-U&lt;n&gt;
2522</dt>
2523<dt class="hdlist1">
2524--unified=&lt;n&gt;
2525</dt>
2526<dd>
2527<p>
2528 Generate diffs with &lt;n&gt; lines of context instead of
2529 the usual three.
Junio C Hamano9629d4f2012-12-19 00:28:272530 Implies <code>-p</code>.
Junio C Hamanod2c978f2011-03-20 19:42:222531</p>
2532</dd>
2533<dt class="hdlist1">
2534--raw
2535</dt>
2536<dd>
2537<p>
2538 Generate the raw format.
2539
2540</p>
2541</dd>
2542<dt class="hdlist1">
2543--patch-with-raw
2544</dt>
2545<dd>
2546<p>
Junio C Hamano9629d4f2012-12-19 00:28:272547 Synonym for <code>-p --raw</code>.
Junio C Hamanod2c978f2011-03-20 19:42:222548</p>
2549</dd>
2550<dt class="hdlist1">
Junio C Hamano5a73f302011-10-14 05:58:342551--minimal
2552</dt>
2553<dd>
2554<p>
2555 Spend extra time to make sure the smallest possible
2556 diff is produced.
2557</p>
2558</dd>
2559<dt class="hdlist1">
Junio C Hamanod2c978f2011-03-20 19:42:222560--patience
2561</dt>
2562<dd>
2563<p>
2564 Generate a diff using the "patience diff" algorithm.
2565</p>
2566</dd>
2567<dt class="hdlist1">
Junio C Hamanoaea9e6b2012-03-07 00:17:112568--histogram
2569</dt>
2570<dd>
2571<p>
2572 Generate a diff using the "histogram diff" algorithm.
2573</p>
2574</dd>
2575<dt class="hdlist1">
Junio C Hamano80ad00d2013-02-18 00:19:032576--diff-algorithm={patience|minimal|histogram|myers}
2577</dt>
2578<dd>
2579<p>
2580 Choose a diff algorithm. The variants are as follows:
2581</p>
2582<div class="openblock">
2583<div class="content">
2584<div class="dlist"><dl>
2585<dt class="hdlist1">
2586<code>default</code>, <code>myers</code>
2587</dt>
2588<dd>
2589<p>
2590 The basic greedy diff algorithm. Currently, this is the default.
2591</p>
2592</dd>
2593<dt class="hdlist1">
2594<code>minimal</code>
2595</dt>
2596<dd>
2597<p>
2598 Spend extra time to make sure the smallest possible diff is
2599 produced.
2600</p>
2601</dd>
2602<dt class="hdlist1">
2603<code>patience</code>
2604</dt>
2605<dd>
2606<p>
2607 Use "patience diff" algorithm when generating patches.
2608</p>
2609</dd>
2610<dt class="hdlist1">
2611<code>histogram</code>
2612</dt>
2613<dd>
2614<p>
2615 This algorithm extends the patience algorithm to "support
2616 low-occurrence common elements".
2617</p>
2618</dd>
2619</dl></div>
2620</div></div>
2621<div class="paragraph"><p>For instance, if you configured diff.algorithm variable to a
2622non-default value and want to use the default one, then you
2623have to use <code>--diff-algorithm=default</code> option.</p></div>
2624</dd>
2625<dt class="hdlist1">
Junio C Hamano4c4b0122011-06-30 01:19:322626--stat[=&lt;width&gt;[,&lt;name-width&gt;[,&lt;count&gt;]]]
Junio C Hamanod2c978f2011-03-20 19:42:222627</dt>
2628<dd>
2629<p>
Junio C Hamanoaea9e6b2012-03-07 00:17:112630 Generate a diffstat. By default, as much space as necessary
2631 will be used for the filename part, and the rest for the graph
2632 part. Maximum width defaults to terminal width, or 80 columns
Junio C Hamano7f2b3cb2012-06-22 22:42:392633 if not connected to a terminal, and can be overridden by
Junio C Hamano9629d4f2012-12-19 00:28:272634 <code>&lt;width&gt;</code>. The width of the filename part can be limited by
2635 giving another width <code>&lt;name-width&gt;</code> after a comma. The width
Junio C Hamanoaea9e6b2012-03-07 00:17:112636 of the graph part can be limited by using
Junio C Hamano9629d4f2012-12-19 00:28:272637 <code>--stat-graph-width=&lt;width&gt;</code> (affects all commands generating
2638 a stat graph) or by setting <code>diff.statGraphWidth=&lt;width&gt;</code>
2639 (does not affect <code>git format-patch</code>).
2640 By giving a third parameter <code>&lt;count&gt;</code>, you can limit the
2641 output to the first <code>&lt;count&gt;</code> lines, followed by <code>...</code> if
Junio C Hamanoaea9e6b2012-03-07 00:17:112642 there are more.
Junio C Hamanod2c978f2011-03-20 19:42:222643</p>
Junio C Hamano9629d4f2012-12-19 00:28:272644<div class="paragraph"><p>These parameters can also be set individually with <code>--stat-width=&lt;width&gt;</code>,
2645<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:222646</dd>
2647<dt class="hdlist1">
2648--numstat
2649</dt>
2650<dd>
2651<p>
Junio C Hamano9629d4f2012-12-19 00:28:272652 Similar to <code>--stat</code>, but shows number of added and
Junio C Hamanod2c978f2011-03-20 19:42:222653 deleted lines in decimal notation and pathname without
2654 abbreviation, to make it more machine friendly. For
Junio C Hamano9629d4f2012-12-19 00:28:272655 binary files, outputs two <code>-</code> instead of saying
2656 <code>0 0</code>.
Junio C Hamanod2c978f2011-03-20 19:42:222657</p>
2658</dd>
2659<dt class="hdlist1">
2660--shortstat
2661</dt>
2662<dd>
2663<p>
Junio C Hamano9629d4f2012-12-19 00:28:272664 Output only the last line of the <code>--stat</code> format containing total
Junio C Hamanod2c978f2011-03-20 19:42:222665 number of modified files, as well as number of added and deleted
2666 lines.
2667</p>
2668</dd>
2669<dt class="hdlist1">
Junio C Hamano1c222c52011-05-13 19:55:322670--dirstat[=&lt;param1,param2,&#8230;&gt;]
Junio C Hamanod2c978f2011-03-20 19:42:222671</dt>
2672<dd>
2673<p>
Junio C Hamano1c222c52011-05-13 19:55:322674 Output the distribution of relative amount of changes for each
Junio C Hamano9629d4f2012-12-19 00:28:272675 sub-directory. The behavior of <code>--dirstat</code> can be customized by
Junio C Hamano1c222c52011-05-13 19:55:322676 passing it a comma separated list of parameters.
Junio C Hamano9629d4f2012-12-19 00:28:272677 The defaults are controlled by the <code>diff.dirstat</code> configuration
Junio C Hamanoa28a9202012-06-21 07:08:232678 variable (see <a href="git-config.html">git-config(1)</a>).
Junio C Hamano1c222c52011-05-13 19:55:322679 The following parameters are available:
Junio C Hamanod2c978f2011-03-20 19:42:222680</p>
Junio C Hamano9629d4f2012-12-19 00:28:272681<div class="openblock">
2682<div class="content">
Junio C Hamano1c222c52011-05-13 19:55:322683<div class="dlist"><dl>
2684<dt class="hdlist1">
Junio C Hamano9629d4f2012-12-19 00:28:272685<code>changes</code>
Junio C Hamano1c222c52011-05-13 19:55:322686</dt>
2687<dd>
2688<p>
2689 Compute the dirstat numbers by counting the lines that have been
2690 removed from the source, or added to the destination. This ignores
2691 the amount of pure code movements within a file. In other words,
2692 rearranging lines in a file is not counted as much as other changes.
2693 This is the default behavior when no parameter is given.
2694</p>
Junio C Hamanod2c978f2011-03-20 19:42:222695</dd>
2696<dt class="hdlist1">
Junio C Hamano9629d4f2012-12-19 00:28:272697<code>lines</code>
Junio C Hamanod2c978f2011-03-20 19:42:222698</dt>
2699<dd>
2700<p>
Junio C Hamano1c222c52011-05-13 19:55:322701 Compute the dirstat numbers by doing the regular line-based diff
2702 analysis, and summing the removed/added line counts. (For binary
2703 files, count 64-byte chunks instead, since binary files have no
Junio C Hamano9629d4f2012-12-19 00:28:272704 natural concept of lines). This is a more expensive <code>--dirstat</code>
2705 behavior than the <code>changes</code> behavior, but it does count rearranged
Junio C Hamano1c222c52011-05-13 19:55:322706 lines within a file as much as other changes. The resulting output
Junio C Hamano9629d4f2012-12-19 00:28:272707 is consistent with what you get from the other <code>--*stat</code> options.
Junio C Hamanod2c978f2011-03-20 19:42:222708</p>
2709</dd>
2710<dt class="hdlist1">
Junio C Hamano9629d4f2012-12-19 00:28:272711<code>files</code>
Junio C Hamano1c222c52011-05-13 19:55:322712</dt>
2713<dd>
2714<p>
2715 Compute the dirstat numbers by counting the number of files changed.
2716 Each changed file counts equally in the dirstat analysis. This is
Junio C Hamano9629d4f2012-12-19 00:28:272717 the computationally cheapest <code>--dirstat</code> behavior, since it does
Junio C Hamano1c222c52011-05-13 19:55:322718 not have to look at the file contents at all.
2719</p>
2720</dd>
2721<dt class="hdlist1">
Junio C Hamano9629d4f2012-12-19 00:28:272722<code>cumulative</code>
Junio C Hamano1c222c52011-05-13 19:55:322723</dt>
2724<dd>
2725<p>
2726 Count changes in a child directory for the parent directory as well.
Junio C Hamano9629d4f2012-12-19 00:28:272727 Note that when using <code>cumulative</code>, the sum of the percentages
Junio C Hamano1c222c52011-05-13 19:55:322728 reported may exceed 100%. The default (non-cumulative) behavior can
Junio C Hamano9629d4f2012-12-19 00:28:272729 be specified with the <code>noncumulative</code> parameter.
Junio C Hamano1c222c52011-05-13 19:55:322730</p>
2731</dd>
2732<dt class="hdlist1">
2733&lt;limit&gt;
2734</dt>
2735<dd>
2736<p>
2737 An integer parameter specifies a cut-off percent (3% by default).
2738 Directories contributing less than this percentage of the changes
2739 are not shown in the output.
2740</p>
2741</dd>
2742</dl></div>
Junio C Hamano9629d4f2012-12-19 00:28:272743</div></div>
Junio C Hamano1c222c52011-05-13 19:55:322744<div class="paragraph"><p>Example: The following will count changed files, while ignoring
2745directories with less than 10% of the total amount of changed files,
2746and accumulating child directory counts in the parent directories:
Junio C Hamano9629d4f2012-12-19 00:28:272747<code>--dirstat=files,10,cumulative</code>.</p></div>
Junio C Hamano1c222c52011-05-13 19:55:322748</dd>
2749<dt class="hdlist1">
Junio C Hamanod2c978f2011-03-20 19:42:222750--summary
2751</dt>
2752<dd>
2753<p>
2754 Output a condensed summary of extended header information
2755 such as creations, renames and mode changes.
2756</p>
2757</dd>
2758<dt class="hdlist1">
2759--patch-with-stat
2760</dt>
2761<dd>
2762<p>
Junio C Hamano9629d4f2012-12-19 00:28:272763 Synonym for <code>-p --stat</code>.
Junio C Hamanod2c978f2011-03-20 19:42:222764</p>
2765</dd>
2766<dt class="hdlist1">
2767-z
2768</dt>
2769<dd>
2770<p>
2771 Separate the commits with NULs instead of with new newlines.
2772</p>
Junio C Hamano9629d4f2012-12-19 00:28:272773<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:222774pathnames and use NULs as output field terminators.</p></div>
2775<div class="paragraph"><p>Without this option, each pathname output will have TAB, LF, double quotes,
Junio C Hamano9629d4f2012-12-19 00:28:272776and backslash characters replaced with <code>\t</code>, <code>\n</code>, <code>\"</code>, and <code>\\</code>,
Junio C Hamanod2c978f2011-03-20 19:42:222777respectively, and the pathname will be enclosed in double quotes if
2778any of those replacements occurred.</p></div>
2779</dd>
2780<dt class="hdlist1">
2781--name-only
2782</dt>
2783<dd>
2784<p>
2785 Show only names of changed files.
2786</p>
2787</dd>
2788<dt class="hdlist1">
2789--name-status
2790</dt>
2791<dd>
2792<p>
2793 Show only names and status of changed files. See the description
Junio C Hamano9629d4f2012-12-19 00:28:272794 of the <code>--diff-filter</code> option on what the status letters mean.
Junio C Hamanod2c978f2011-03-20 19:42:222795</p>
2796</dd>
2797<dt class="hdlist1">
2798--submodule[=&lt;format&gt;]
2799</dt>
2800<dd>
2801<p>
Junio C Hamano9629d4f2012-12-19 00:28:272802 Specify how differences in submodules are shown. When <code>--submodule</code>
2803 or <code>--submodule=log</code> is given, the <em>log</em> format is used. This format lists
2804 the commits in the range like <a href="git-submodule.html">git-submodule(1)</a> <code>summary</code> does.
2805 Omitting the <code>--submodule</code> option or specifying <code>--submodule=short</code>,
Junio C Hamanoe768cc12012-03-16 05:43:052806 uses the <em>short</em> format. This format just shows the names of the commits
Junio C Hamanob4e58b12012-11-26 03:13:062807 at the beginning and end of the range. Can be tweaked via the
Junio C Hamano9629d4f2012-12-19 00:28:272808 <code>diff.submodule</code> configuration variable.
Junio C Hamanod2c978f2011-03-20 19:42:222809</p>
2810</dd>
2811<dt class="hdlist1">
2812--color[=&lt;when&gt;]
2813</dt>
2814<dd>
2815<p>
2816 Show colored diff.
Junio C Hamano947ab822013-03-19 23:07:292817 <code>--color</code> (i.e. without <em>=&lt;when&gt;</em>) is the same as <code>--color=always</code>.
2818 <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:222819</p>
2820</dd>
2821<dt class="hdlist1">
2822--no-color
2823</dt>
2824<dd>
2825<p>
Junio C Hamano5f2627d2011-05-06 20:23:482826 Turn off colored diff.
Junio C Hamano9629d4f2012-12-19 00:28:272827 It is the same as <code>--color=never</code>.
Junio C Hamanod2c978f2011-03-20 19:42:222828</p>
2829</dd>
2830<dt class="hdlist1">
2831--word-diff[=&lt;mode&gt;]
2832</dt>
2833<dd>
2834<p>
2835 Show a word diff, using the &lt;mode&gt; to delimit changed words.
2836 By default, words are delimited by whitespace; see
Junio C Hamano9629d4f2012-12-19 00:28:272837 <code>--word-diff-regex</code> below. The &lt;mode&gt; defaults to <em>plain</em>, and
Junio C Hamanod2c978f2011-03-20 19:42:222838 must be one of:
2839</p>
Junio C Hamano9629d4f2012-12-19 00:28:272840<div class="openblock">
2841<div class="content">
Junio C Hamanod2c978f2011-03-20 19:42:222842<div class="dlist"><dl>
2843<dt class="hdlist1">
2844color
2845</dt>
2846<dd>
2847<p>
Junio C Hamano9629d4f2012-12-19 00:28:272848 Highlight changed words using only colors. Implies <code>--color</code>.
Junio C Hamanod2c978f2011-03-20 19:42:222849</p>
2850</dd>
2851<dt class="hdlist1">
2852plain
2853</dt>
2854<dd>
2855<p>
Junio C Hamano9629d4f2012-12-19 00:28:272856 Show words as <code>[-removed-]</code> and <code>{+added+}</code>. Makes no
Junio C Hamanod2c978f2011-03-20 19:42:222857 attempts to escape the delimiters if they appear in the input,
2858 so the output may be ambiguous.
2859</p>
2860</dd>
2861<dt class="hdlist1">
2862porcelain
2863</dt>
2864<dd>
2865<p>
2866 Use a special line-based format intended for script
2867 consumption. Added/removed/unchanged runs are printed in the
Junio C Hamano9629d4f2012-12-19 00:28:272868 usual unified diff format, starting with a <code>+</code>/<code>-</code>/` `
Junio C Hamanod2c978f2011-03-20 19:42:222869 character at the beginning of the line and extending to the
2870 end of the line. Newlines in the input are represented by a
Junio C Hamano9629d4f2012-12-19 00:28:272871 tilde <code>~</code> on a line of its own.
Junio C Hamanod2c978f2011-03-20 19:42:222872</p>
2873</dd>
2874<dt class="hdlist1">
2875none
2876</dt>
2877<dd>
2878<p>
2879 Disable word diff again.
2880</p>
2881</dd>
2882</dl></div>
Junio C Hamano9629d4f2012-12-19 00:28:272883</div></div>
Junio C Hamanod2c978f2011-03-20 19:42:222884<div class="paragraph"><p>Note that despite the name of the first mode, color is used to
2885highlight the changed parts in all modes if enabled.</p></div>
2886</dd>
2887<dt class="hdlist1">
2888--word-diff-regex=&lt;regex&gt;
2889</dt>
2890<dd>
2891<p>
2892 Use &lt;regex&gt; to decide what a word is, instead of considering
2893 runs of non-whitespace to be a word. Also implies
Junio C Hamano9629d4f2012-12-19 00:28:272894 <code>--word-diff</code> unless it was already enabled.
Junio C Hamanod2c978f2011-03-20 19:42:222895</p>
2896<div class="paragraph"><p>Every non-overlapping match of the
2897&lt;regex&gt; is considered a word. Anything between these matches is
2898considered whitespace and ignored(!) for the purposes of finding
Junio C Hamano9629d4f2012-12-19 00:28:272899differences. You may want to append <code>|[^[:space:]]</code> to your regular
Junio C Hamanod2c978f2011-03-20 19:42:222900expression to make sure that it matches all non-whitespace characters.
2901A match that contains a newline is silently truncated(!) at the
2902newline.</p></div>
2903<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:232904<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:222905overrides any diff driver or configuration setting. Diff drivers
2906override configuration settings.</p></div>
2907</dd>
2908<dt class="hdlist1">
2909--color-words[=&lt;regex&gt;]
2910</dt>
2911<dd>
2912<p>
Junio C Hamano9629d4f2012-12-19 00:28:272913 Equivalent to <code>--word-diff=color</code> plus (if a regex was
2914 specified) <code>--word-diff-regex=&lt;regex&gt;</code>.
Junio C Hamanod2c978f2011-03-20 19:42:222915</p>
2916</dd>
2917<dt class="hdlist1">
2918--no-renames
2919</dt>
2920<dd>
2921<p>
2922 Turn off rename detection, even when the configuration
2923 file gives the default to do so.
2924</p>
2925</dd>
2926<dt class="hdlist1">
2927--check
2928</dt>
2929<dd>
2930<p>
Junio C Hamano6005bfa2011-06-23 00:51:222931 Warn if changes introduce whitespace errors. What are
Junio C Hamano9629d4f2012-12-19 00:28:272932 considered whitespace errors is controlled by <code>core.whitespace</code>
Junio C Hamano6005bfa2011-06-23 00:51:222933 configuration. By default, trailing whitespaces (including
2934 lines that solely consist of whitespaces) and a space character
2935 that is immediately followed by a tab character inside the
2936 initial indent of the line are considered whitespace errors.
2937 Exits with non-zero status if problems are found. Not compatible
2938 with --exit-code.
Junio C Hamanod2c978f2011-03-20 19:42:222939</p>
2940</dd>
2941<dt class="hdlist1">
2942--full-index
2943</dt>
2944<dd>
2945<p>
2946 Instead of the first handful of characters, show the full
2947 pre- and post-image blob object names on the "index"
2948 line when generating patch format output.
2949</p>
2950</dd>
2951<dt class="hdlist1">
2952--binary
2953</dt>
2954<dd>
2955<p>
Junio C Hamano9629d4f2012-12-19 00:28:272956 In addition to <code>--full-index</code>, output a binary diff that
2957 can be applied with <code>git-apply</code>.
Junio C Hamanod2c978f2011-03-20 19:42:222958</p>
2959</dd>
2960<dt class="hdlist1">
2961--abbrev[=&lt;n&gt;]
2962</dt>
2963<dd>
2964<p>
2965 Instead of showing the full 40-byte hexadecimal object
2966 name in diff-raw format output and diff-tree header
2967 lines, show only a partial prefix. This is
Junio C Hamano9629d4f2012-12-19 00:28:272968 independent of the <code>--full-index</code> option above, which controls
Junio C Hamanod2c978f2011-03-20 19:42:222969 the diff-patch output format. Non default number of
Junio C Hamano9629d4f2012-12-19 00:28:272970 digits can be specified with <code>--abbrev=&lt;n&gt;</code>.
Junio C Hamanod2c978f2011-03-20 19:42:222971</p>
2972</dd>
2973<dt class="hdlist1">
2974-B[&lt;n&gt;][/&lt;m&gt;]
2975</dt>
2976<dt class="hdlist1">
2977--break-rewrites[=[&lt;n&gt;][/&lt;m&gt;]]
2978</dt>
2979<dd>
2980<p>
2981 Break complete rewrite changes into pairs of delete and
2982 create. This serves two purposes:
2983</p>
2984<div class="paragraph"><p>It affects the way a change that amounts to a total rewrite of a file
2985not as a series of deletion and insertion mixed together with a very
2986few lines that happen to match textually as the context, but as a
2987single deletion of everything old followed by a single insertion of
Junio C Hamano9629d4f2012-12-19 00:28:272988everything new, and the number <code>m</code> controls this aspect of the -B
2989option (defaults to 60%). <code>-B/70%</code> specifies that less than 30% of the
Junio C Hamano076ffcc2013-02-06 05:13:212990original should remain in the result for Git to consider it a total
Junio C Hamanod2c978f2011-03-20 19:42:222991rewrite (i.e. otherwise the resulting patch will be a series of
2992deletion and insertion mixed together with context lines).</p></div>
2993<div class="paragraph"><p>When used with -M, a totally-rewritten file is also considered as the
2994source of a rename (usually -M only considers a file that disappeared
Junio C Hamano9629d4f2012-12-19 00:28:272995as the source of a rename), and the number <code>n</code> controls this aspect of
2996the -B option (defaults to 50%). <code>-B20%</code> specifies that a change with
Junio C Hamanod2c978f2011-03-20 19:42:222997addition and deletion compared to 20% or more of the file&#8217;s size are
2998eligible for being picked up as a possible source of a rename to
2999another file.</p></div>
3000</dd>
3001<dt class="hdlist1">
3002-M[&lt;n&gt;]
3003</dt>
3004<dt class="hdlist1">
3005--find-renames[=&lt;n&gt;]
3006</dt>
3007<dd>
3008<p>
3009 If generating diffs, detect and report renames for each commit.
3010 For following files across renames while traversing history, see
Junio C Hamano9629d4f2012-12-19 00:28:273011 <code>--follow</code>.
3012 If <code>n</code> is specified, it is a threshold on the similarity
Junio C Hamanod2c978f2011-03-20 19:42:223013 index (i.e. amount of addition/deletions compared to the
Junio C Hamano076ffcc2013-02-06 05:13:213014 file&#8217;s size). For example, <code>-M90%</code> means Git should consider a
Junio C Hamanod2c978f2011-03-20 19:42:223015 delete/add pair to be a rename if more than 90% of the file
Junio C Hamano9629d4f2012-12-19 00:28:273016 hasn&#8217;t changed. Without a <code>%</code> sign, the number is to be read as
3017 a fraction, with a decimal point before it. I.e., <code>-M5</code> becomes
3018 0.5, and is thus the same as <code>-M50%</code>. Similarly, <code>-M05</code> is
3019 the same as <code>-M5%</code>. To limit detection to exact renames, use
3020 <code>-M100%</code>.
Junio C Hamanod2c978f2011-03-20 19:42:223021</p>
3022</dd>
3023<dt class="hdlist1">
3024-C[&lt;n&gt;]
3025</dt>
3026<dt class="hdlist1">
3027--find-copies[=&lt;n&gt;]
3028</dt>
3029<dd>
3030<p>
Junio C Hamano9629d4f2012-12-19 00:28:273031 Detect copies as well as renames. See also <code>--find-copies-harder</code>.
3032 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:223033</p>
3034</dd>
3035<dt class="hdlist1">
3036--find-copies-harder
3037</dt>
3038<dd>
3039<p>
Junio C Hamano9629d4f2012-12-19 00:28:273040 For performance reasons, by default, <code>-C</code> option finds copies only
Junio C Hamanod2c978f2011-03-20 19:42:223041 if the original file of the copy was modified in the same
3042 changeset. This flag makes the command
3043 inspect unmodified files as candidates for the source of
3044 copy. This is a very expensive operation for large
3045 projects, so use it with caution. Giving more than one
Junio C Hamano9629d4f2012-12-19 00:28:273046 <code>-C</code> option has the same effect.
Junio C Hamanod2c978f2011-03-20 19:42:223047</p>
3048</dd>
3049<dt class="hdlist1">
Junio C Hamanob02377c2011-04-28 22:26:023050-D
3051</dt>
3052<dt class="hdlist1">
3053--irreversible-delete
3054</dt>
3055<dd>
3056<p>
3057 Omit the preimage for deletes, i.e. print only the header but not
Junio C Hamano9629d4f2012-12-19 00:28:273058 the diff between the preimage and <code>/dev/null</code>. The resulting patch
3059 is not meant to be applied with <code>patch</code> nor <code>git apply</code>; this is
Junio C Hamanob02377c2011-04-28 22:26:023060 solely for people who want to just concentrate on reviewing the
3061 text after the change. In addition, the output obviously lack
3062 enough information to apply such a patch in reverse, even manually,
3063 hence the name of the option.
3064</p>
Junio C Hamano9629d4f2012-12-19 00:28:273065<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:023066of a delete/create pair.</p></div>
3067</dd>
3068<dt class="hdlist1">
Junio C Hamanod2c978f2011-03-20 19:42:223069-l&lt;num&gt;
3070</dt>
3071<dd>
3072<p>
Junio C Hamano9629d4f2012-12-19 00:28:273073 The <code>-M</code> and <code>-C</code> options require O(n^2) processing time where n
Junio C Hamanod2c978f2011-03-20 19:42:223074 is the number of potential rename/copy targets. This
3075 option prevents rename/copy detection from running if
3076 the number of rename/copy targets exceeds the specified
3077 number.
3078</p>
3079</dd>
3080<dt class="hdlist1">
3081--diff-filter=[(A|C|D|M|R|T|U|X|B)&#8230;[*]]
3082</dt>
3083<dd>
3084<p>
Junio C Hamano9629d4f2012-12-19 00:28:273085 Select only files that are Added (<code>A</code>), Copied (<code>C</code>),
3086 Deleted (<code>D</code>), Modified (<code>M</code>), Renamed (<code>R</code>), have their
3087 type (i.e. regular file, symlink, submodule, &#8230;) changed (<code>T</code>),
3088 are Unmerged (<code>U</code>), are
3089 Unknown (<code>X</code>), or have had their pairing Broken (<code>B</code>).
Junio C Hamanod2c978f2011-03-20 19:42:223090 Any combination of the filter characters (including none) can be used.
Junio C Hamano9629d4f2012-12-19 00:28:273091 When <code>*</code> (All-or-none) is added to the combination, all
Junio C Hamanod2c978f2011-03-20 19:42:223092 paths are selected if there is any file that matches
3093 other criteria in the comparison; if there is no file
3094 that matches other criteria, nothing is selected.
3095</p>
3096</dd>
3097<dt class="hdlist1">
3098-S&lt;string&gt;
3099</dt>
3100<dd>
3101<p>
3102 Look for differences that introduce or remove an instance of
3103 &lt;string&gt;. Note that this is different than the string simply
3104 appearing in diff output; see the <em>pickaxe</em> entry in
Junio C Hamanoa28a9202012-06-21 07:08:233105 <a href="gitdiffcore.html">gitdiffcore(7)</a> for more details.
Junio C Hamanod2c978f2011-03-20 19:42:223106</p>
3107</dd>
3108<dt class="hdlist1">
3109-G&lt;regex&gt;
3110</dt>
3111<dd>
3112<p>
3113 Look for differences whose added or removed line matches
3114 the given &lt;regex&gt;.
3115</p>
3116</dd>
3117<dt class="hdlist1">
3118--pickaxe-all
3119</dt>
3120<dd>
3121<p>
Junio C Hamano9629d4f2012-12-19 00:28:273122 When <code>-S</code> or <code>-G</code> finds a change, show all the changes in that
Junio C Hamanod2c978f2011-03-20 19:42:223123 changeset, not just the files that contain the change
3124 in &lt;string&gt;.
3125</p>
3126</dd>
3127<dt class="hdlist1">
3128--pickaxe-regex
3129</dt>
3130<dd>
3131<p>
3132 Make the &lt;string&gt; not a plain string but an extended POSIX
3133 regex to match.
3134</p>
3135</dd>
3136<dt class="hdlist1">
3137-O&lt;orderfile&gt;
3138</dt>
3139<dd>
3140<p>
3141 Output the patch in the order specified in the
3142 &lt;orderfile&gt;, which has one shell glob pattern per line.
3143</p>
3144</dd>
3145<dt class="hdlist1">
3146-R
3147</dt>
3148<dd>
3149<p>
3150 Swap two inputs; that is, show differences from index or
3151 on-disk file to tree contents.
3152</p>
3153</dd>
3154<dt class="hdlist1">
3155--relative[=&lt;path&gt;]
3156</dt>
3157<dd>
3158<p>
3159 When run from a subdirectory of the project, it can be
3160 told to exclude changes outside the directory and show
3161 pathnames relative to it with this option. When you are
3162 not in a subdirectory (e.g. in a bare repository), you
3163 can name which subdirectory to make the output relative
3164 to by giving a &lt;path&gt; as an argument.
3165</p>
3166</dd>
3167<dt class="hdlist1">
3168-a
3169</dt>
3170<dt class="hdlist1">
3171--text
3172</dt>
3173<dd>
3174<p>
3175 Treat all files as text.
3176</p>
3177</dd>
3178<dt class="hdlist1">
3179--ignore-space-at-eol
3180</dt>
3181<dd>
3182<p>
3183 Ignore changes in whitespace at EOL.
3184</p>
3185</dd>
3186<dt class="hdlist1">
3187-b
3188</dt>
3189<dt class="hdlist1">
3190--ignore-space-change
3191</dt>
3192<dd>
3193<p>
3194 Ignore changes in amount of whitespace. This ignores whitespace
3195 at line end, and considers all other sequences of one or
3196 more whitespace characters to be equivalent.
3197</p>
3198</dd>
3199<dt class="hdlist1">
3200-w
3201</dt>
3202<dt class="hdlist1">
3203--ignore-all-space
3204</dt>
3205<dd>
3206<p>
3207 Ignore whitespace when comparing lines. This ignores
3208 differences even if one line has whitespace where the other
3209 line has none.
3210</p>
3211</dd>
3212<dt class="hdlist1">
3213--inter-hunk-context=&lt;lines&gt;
3214</dt>
3215<dd>
3216<p>
3217 Show the context between diff hunks, up to the specified number
3218 of lines, thereby fusing hunks that are close to each other.
3219</p>
3220</dd>
3221<dt class="hdlist1">
Junio C Hamano11821ed2011-10-19 18:42:093222-W
3223</dt>
3224<dt class="hdlist1">
3225--function-context
3226</dt>
3227<dd>
3228<p>
3229 Show whole surrounding functions of changes.
3230</p>
3231</dd>
3232<dt class="hdlist1">
Junio C Hamanod2c978f2011-03-20 19:42:223233--ext-diff
3234</dt>
3235<dd>
3236<p>
3237 Allow an external diff helper to be executed. If you set an
Junio C Hamanoa28a9202012-06-21 07:08:233238 external diff driver with <a href="gitattributes.html">gitattributes(5)</a>, you need
3239 to use this option with <a href="git-log.html">git-log(1)</a> and friends.
Junio C Hamanod2c978f2011-03-20 19:42:223240</p>
3241</dd>
3242<dt class="hdlist1">
3243--no-ext-diff
3244</dt>
3245<dd>
3246<p>
3247 Disallow external diff drivers.
3248</p>
3249</dd>
3250<dt class="hdlist1">
Junio C Hamanoc652aed2011-07-07 01:14:313251--textconv
3252</dt>
3253<dt class="hdlist1">
3254--no-textconv
3255</dt>
3256<dd>
3257<p>
3258 Allow (or disallow) external text conversion filters to be run
Junio C Hamanoa28a9202012-06-21 07:08:233259 when comparing binary files. See <a href="gitattributes.html">gitattributes(5)</a> for
Junio C Hamanoc652aed2011-07-07 01:14:313260 details. Because textconv filters are typically a one-way
3261 conversion, the resulting diff is suitable for human
3262 consumption, but cannot be applied. For this reason, textconv
Junio C Hamanoa28a9202012-06-21 07:08:233263 filters are enabled by default only for <a href="git-diff.html">git-diff(1)</a> and
3264 <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:313265 diff plumbing commands.
3266</p>
3267</dd>
3268<dt class="hdlist1">
Junio C Hamanod2c978f2011-03-20 19:42:223269--ignore-submodules[=&lt;when&gt;]
3270</dt>
3271<dd>
3272<p>
3273 Ignore changes to submodules in the diff generation. &lt;when&gt; can be
3274 either "none", "untracked", "dirty" or "all", which is the default
3275 Using "none" will consider the submodule modified when it either contains
3276 untracked or modified files or its HEAD differs from the commit recorded
3277 in the superproject and can be used to override any settings of the
Junio C Hamanoa28a9202012-06-21 07:08:233278 <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:223279 "untracked" is used submodules are not considered dirty when they only
3280 contain untracked content (but they are still scanned for modified
3281 content). Using "dirty" ignores all changes to the work tree of submodules,
3282 only changes to the commits stored in the superproject are shown (this was
3283 the behavior until 1.7.0). Using "all" hides all changes to submodules.
3284</p>
3285</dd>
3286<dt class="hdlist1">
3287--src-prefix=&lt;prefix&gt;
3288</dt>
3289<dd>
3290<p>
3291 Show the given source prefix instead of "a/".
3292</p>
3293</dd>
3294<dt class="hdlist1">
3295--dst-prefix=&lt;prefix&gt;
3296</dt>
3297<dd>
3298<p>
3299 Show the given destination prefix instead of "b/".
3300</p>
3301</dd>
3302<dt class="hdlist1">
3303--no-prefix
3304</dt>
3305<dd>
3306<p>
3307 Do not show any source or destination prefix.
3308</p>
3309</dd>
3310</dl></div>
3311<div class="paragraph"><p>For more detailed explanation on these common options, see also
Junio C Hamanoa28a9202012-06-21 07:08:233312<a href="gitdiffcore.html">gitdiffcore(7)</a>.</p></div>
Junio C Hamanod2c978f2011-03-20 19:42:223313</div>
Junio C Hamano9629d4f2012-12-19 00:28:273314</div>
3315<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:313316<h2 id="_generating_patches_with_p">Generating patches with -p</h2>
Junio C Hamano00b8b632007-12-07 09:50:493317<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:593318<div class="paragraph"><p>When "git-diff-index", "git-diff-tree", or "git-diff-files" are run
Junio C Hamano00b8b632007-12-07 09:50:493319with a <em>-p</em> option, "git diff" without the <em>--raw</em> option, or
3320"git log" with the "-p" option, they
3321do not produce the output described above; instead they produce a
3322patch file. You can customize the creation of such patches via the
Junio C Hamanoba4b9282008-07-06 05:20:313323GIT_EXTERNAL_DIFF and the GIT_DIFF_OPTS environment variables.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:593324<div class="paragraph"><p>What the -p option produces is slightly different from the traditional
Junio C Hamano7f9fa862010-10-19 23:51:143325diff format:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:593326<div class="olist arabic"><ol class="arabic">
Junio C Hamano00b8b632007-12-07 09:50:493327<li>
3328<p>
Junio C Hamano7f9fa862010-10-19 23:51:143329It is preceded with a "git diff" header that looks like this:
Junio C Hamano00b8b632007-12-07 09:50:493330</p>
3331<div class="literalblock">
3332<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:273333<pre><code>diff --git a/file1 b/file2</code></pre>
Junio C Hamano00b8b632007-12-07 09:50:493334</div></div>
Junio C Hamano9629d4f2012-12-19 00:28:273335<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:493336involved. Especially, even for a creation or a deletion,
Junio C Hamano9629d4f2012-12-19 00:28:273337<code>/dev/null</code> is <em>not</em> used in place of the <code>a/</code> or <code>b/</code> filenames.</p></div>
3338<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:493339name of the source file of the rename/copy and the name of
Junio C Hamanoba4b9282008-07-06 05:20:313340the file that rename/copy produces, respectively.</p></div>
Junio C Hamano00b8b632007-12-07 09:50:493341</li>
3342<li>
3343<p>
3344It is followed by one or more extended header lines:
3345</p>
3346<div class="literalblock">
3347<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:273348<pre><code>old mode &lt;mode&gt;
Junio C Hamano00b8b632007-12-07 09:50:493349new mode &lt;mode&gt;
3350deleted file mode &lt;mode&gt;
3351new file mode &lt;mode&gt;
3352copy from &lt;path&gt;
3353copy to &lt;path&gt;
3354rename from &lt;path&gt;
3355rename to &lt;path&gt;
3356similarity index &lt;number&gt;
3357dissimilarity index &lt;number&gt;
Junio C Hamano9629d4f2012-12-19 00:28:273358index &lt;hash&gt;..&lt;hash&gt; &lt;mode&gt;</code></pre>
Junio C Hamano00b8b632007-12-07 09:50:493359</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:593360<div class="paragraph"><p>File modes are printed as 6-digit octal numbers including the file type
Junio C Hamano7f9fa862010-10-19 23:51:143361and file permission bits.</p></div>
Junio C Hamano9629d4f2012-12-19 00:28:273362<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:593363<div class="paragraph"><p>The similarity index is the percentage of unchanged lines, and
Junio C Hamano7f9fa862010-10-19 23:51:143364the dissimilarity index is the percentage of changed lines. It
3365is a rounded down integer, followed by a percent sign. The
3366similarity index value of 100% is thus reserved for two equal
3367files, while 100% dissimilarity means that no line from the old
3368file made it into the new one.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:593369<div class="paragraph"><p>The index line includes the SHA-1 checksum before and after the change.
Junio C Hamano7f9fa862010-10-19 23:51:143370The &lt;mode&gt; is included if the file mode does not change; otherwise,
3371separate lines indicate the old and the new mode.</p></div>
Junio C Hamano00b8b632007-12-07 09:50:493372</li>
3373<li>
3374<p>
3375TAB, LF, double quote and backslash characters in pathnames
Junio C Hamano9629d4f2012-12-19 00:28:273376 are represented as <code>\t</code>, <code>\n</code>, <code>\"</code> and <code>\\</code>, respectively.
Junio C Hamano00b8b632007-12-07 09:50:493377 If there is need for such substitution then the whole
3378 pathname is put in double quotes.
3379</p>
3380</li>
Junio C Hamano7f9fa862010-10-19 23:51:143381<li>
3382<p>
Junio C Hamano9629d4f2012-12-19 00:28:273383All the <code>file1</code> files in the output refer to files before the
3384 commit, and all the <code>file2</code> files refer to files after the commit.
Junio C Hamano7f9fa862010-10-19 23:51:143385 It is incorrect to apply each change to each file sequentially. For
3386 example, this patch will swap a and b:
3387</p>
3388<div class="literalblock">
3389<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:273390<pre><code>diff --git a/a b/b
Junio C Hamano7f9fa862010-10-19 23:51:143391rename from a
3392rename to b
3393diff --git a/b b/a
3394rename from b
Junio C Hamano9629d4f2012-12-19 00:28:273395rename to a</code></pre>
Junio C Hamano7f9fa862010-10-19 23:51:143396</div></div>
3397</li>
Junio C Hamanoba4b9282008-07-06 05:20:313398</ol></div>
Junio C Hamano00b8b632007-12-07 09:50:493399</div>
Junio C Hamano9629d4f2012-12-19 00:28:273400</div>
3401<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:313402<h2 id="_combined_diff_format">combined diff format</h2>
Junio C Hamano00b8b632007-12-07 09:50:493403<div class="sectionbody">
Junio C Hamano9629d4f2012-12-19 00:28:273404<div class="paragraph"><p>Any diff-generating command can take the &#8216;-c` or <code>--cc</code> option to
Junio C Hamanoc5be4cc2011-03-09 07:20:433405produce a <em>combined diff</em> when showing a merge. This is the default
Junio C Hamanoa28a9202012-06-21 07:08:233406format when showing merges with <a href="git-diff.html">git-diff(1)</a> or
3407<a href="git-show.html">git-show(1)</a>. Note also that you can give the `-m&#8217; option to any
Junio C Hamanoc5be4cc2011-03-09 07:20:433408of these commands to force generation of diffs with individual parents
3409of a merge.</p></div>
3410<div class="paragraph"><p>A <em>combined diff</em> format looks like this:</p></div>
Junio C Hamano00b8b632007-12-07 09:50:493411<div class="listingblock">
3412<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:273413<pre><code>diff --combined describe.c
Junio C Hamano00b8b632007-12-07 09:50:493414index fabadb8,cc95eb0..4866510
3415--- a/describe.c
3416+++ b/describe.c
3417@@@ -98,20 -98,12 +98,20 @@@
3418 return (a_date &gt; b_date) ? -1 : (a_date == b_date) ? 0 : 1;
3419 }
3420
3421- static void describe(char *arg)
3422 -static void describe(struct commit *cmit, int last_one)
3423++static void describe(char *arg, int last_one)
3424 {
3425 + unsigned char sha1[20];
3426 + struct commit *cmit;
3427 struct commit_list *list;
3428 static int initialized = 0;
3429 struct commit_name *n;
3430
3431 + if (get_sha1(arg, sha1) &lt; 0)
3432 + usage(describe_usage);
3433 + cmit = lookup_commit_reference(sha1);
3434 + if (!cmit)
3435 + usage(describe_usage);
3436 +
3437 if (!initialized) {
3438 initialized = 1;
Junio C Hamano9629d4f2012-12-19 00:28:273439 for_each_ref(get_name);</code></pre>
Junio C Hamano00b8b632007-12-07 09:50:493440</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:593441<div class="olist arabic"><ol class="arabic">
Junio C Hamano00b8b632007-12-07 09:50:493442<li>
3443<p>
3444It is preceded with a "git diff" header, that looks like
3445 this (when <em>-c</em> option is used):
3446</p>
3447<div class="literalblock">
3448<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:273449<pre><code>diff --combined file</code></pre>
Junio C Hamano00b8b632007-12-07 09:50:493450</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:593451<div class="paragraph"><p>or like this (when <em>--cc</em> option is used):</p></div>
Junio C Hamano00b8b632007-12-07 09:50:493452<div class="literalblock">
3453<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:273454<pre><code>diff --cc file</code></pre>
Junio C Hamano00b8b632007-12-07 09:50:493455</div></div>
3456</li>
3457<li>
3458<p>
3459It is followed by one or more extended header lines
3460 (this example shows a merge with two parents):
3461</p>
3462<div class="literalblock">
3463<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:273464<pre><code>index &lt;hash&gt;,&lt;hash&gt;..&lt;hash&gt;
Junio C Hamano00b8b632007-12-07 09:50:493465mode &lt;mode&gt;,&lt;mode&gt;..&lt;mode&gt;
3466new file mode &lt;mode&gt;
Junio C Hamano9629d4f2012-12-19 00:28:273467deleted file mode &lt;mode&gt;,&lt;mode&gt;</code></pre>
Junio C Hamano00b8b632007-12-07 09:50:493468</div></div>
Junio C Hamano9629d4f2012-12-19 00:28:273469<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:493470the &lt;mode&gt; is different from the rest. Extended headers with
3471information about detected contents movement (renames and
3472copying detection) are designed to work with diff of two
Junio C Hamanoba4b9282008-07-06 05:20:313473&lt;tree-ish&gt; and are not used by combined diff format.</p></div>
Junio C Hamano00b8b632007-12-07 09:50:493474</li>
3475<li>
3476<p>
3477It is followed by two-line from-file/to-file header
3478</p>
3479<div class="literalblock">
3480<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:273481<pre><code>--- a/file
3482+++ b/file</code></pre>
Junio C Hamano00b8b632007-12-07 09:50:493483</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:593484<div class="paragraph"><p>Similar to two-line header for traditional <em>unified</em> diff
Junio C Hamano9629d4f2012-12-19 00:28:273485format, <code>/dev/null</code> is used to signal created or deleted
Junio C Hamanoba4b9282008-07-06 05:20:313486files.</p></div>
Junio C Hamano00b8b632007-12-07 09:50:493487</li>
3488<li>
3489<p>
3490Chunk header format is modified to prevent people from
Junio C Hamano9629d4f2012-12-19 00:28:273491 accidentally feeding it to <code>patch -p1</code>. Combined diff format
Junio C Hamano00b8b632007-12-07 09:50:493492 was created for review of merge commit changes, and was not
3493 meant for apply. The change is similar to the change in the
3494 extended <em>index</em> header:
3495</p>
3496<div class="literalblock">
3497<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:273498<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:493499</div></div>
Junio C Hamano9629d4f2012-12-19 00:28:273500<div class="paragraph"><p>There are (number of parents + 1) <code>@</code> characters in the chunk
Junio C Hamanoba4b9282008-07-06 05:20:313501header for combined diff format.</p></div>
Junio C Hamano00b8b632007-12-07 09:50:493502</li>
Junio C Hamanoba4b9282008-07-06 05:20:313503</ol></div>
Junio C Hamano68cf15a2010-11-06 01:01:593504<div class="paragraph"><p>Unlike the traditional <em>unified</em> diff format, which shows two
Junio C Hamano9629d4f2012-12-19 00:28:273505files 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
3506added to B), or <code>" "</code> (space&#8201;&#8212;&#8201;unchanged) prefix, this format
Junio C Hamano00b8b632007-12-07 09:50:493507compares two or more files file1, file2,&#8230; with one file X, and
3508shows how X differs from each of fileN. One column for each of
Junio C Hamano68cf15a2010-11-06 01:01:593509fileN is prepended to the output line to note how X&#8217;s line is
Junio C Hamanoba4b9282008-07-06 05:20:313510different from it.</p></div>
Junio C Hamano9629d4f2012-12-19 00:28:273511<div class="paragraph"><p>A <code>-</code> character in the column N means that the line appears in
3512fileN but it does not appear in the result. A <code>+</code> character
Junio C Hamano54bf1e22008-12-20 06:30:113513in the column N means that the line appears in the result,
Junio C Hamano00b8b632007-12-07 09:50:493514and fileN does not have that line (in other words, the line was
Junio C Hamanoba4b9282008-07-06 05:20:313515added, from the point of view of that parent).</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:593516<div class="paragraph"><p>In the above example output, the function signature was changed
Junio C Hamano9629d4f2012-12-19 00:28:273517from both files (hence two <code>-</code> removals from both file1 and
3518file2, plus <code>++</code> to mean one line that was added does not appear
Junio C Hamano54bf1e22008-12-20 06:30:113519in either file1 nor file2). Also eight other lines are the same
Junio C Hamano9629d4f2012-12-19 00:28:273520from file1 but do not appear in file2 (hence prefixed with <code>+</code>).</p></div>
3521<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:493522merge commit with the merge result (i.e. file1..fileN are the
Junio C Hamano9629d4f2012-12-19 00:28:273523parents). When shown by <code>git diff-files -c</code>, it compares the
Junio C Hamano00b8b632007-12-07 09:50:493524two unresolved merge parents with the working tree file
3525(i.e. file1 is stage 2 aka "our version", file2 is stage 3 aka
Junio C Hamanoba4b9282008-07-06 05:20:313526"their version").</p></div>
Junio C Hamano00b8b632007-12-07 09:50:493527</div>
Junio C Hamano9629d4f2012-12-19 00:28:273528</div>
3529<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:313530<h2 id="_examples">Examples</h2>
Junio C Hamano1a4e8412005-12-27 08:17:233531<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:593532<div class="dlist"><dl>
3533<dt class="hdlist1">
Junio C Hamano9629d4f2012-12-19 00:28:273534<code>git log --no-merges</code>
Junio C Hamano1a4e8412005-12-27 08:17:233535</dt>
3536<dd>
3537<p>
3538 Show the whole commit history, but skip any merges
3539</p>
3540</dd>
Junio C Hamano68cf15a2010-11-06 01:01:593541<dt class="hdlist1">
Junio C Hamano9629d4f2012-12-19 00:28:273542<code>git log v2.6.12.. include/scsi drivers/scsi</code>
Junio C Hamano1a4e8412005-12-27 08:17:233543</dt>
3544<dd>
3545<p>
3546 Show all commits since version <em>v2.6.12</em> that changed any file
3547 in the include/scsi or drivers/scsi subdirectories
3548</p>
3549</dd>
Junio C Hamano68cf15a2010-11-06 01:01:593550<dt class="hdlist1">
Junio C Hamano9629d4f2012-12-19 00:28:273551<code>git log --since="2 weeks ago" -- gitk</code>
Junio C Hamano1a4e8412005-12-27 08:17:233552</dt>
3553<dd>
3554<p>
3555 Show the changes during the last two weeks to the file <em>gitk</em>.
3556 The "--" is necessary to avoid confusion with the <strong>branch</strong> named
3557 <em>gitk</em>
3558</p>
3559</dd>
Junio C Hamano68cf15a2010-11-06 01:01:593560<dt class="hdlist1">
Junio C Hamano9629d4f2012-12-19 00:28:273561<code>git log --name-status release..test</code>
Junio C Hamanoba7c8d82006-04-15 06:17:423562</dt>
3563<dd>
3564<p>
3565 Show the commits that are in the "test" branch but not yet
3566 in the "release" branch, along with the list of paths
3567 each commit modifies.
3568</p>
3569</dd>
Junio C Hamano68cf15a2010-11-06 01:01:593570<dt class="hdlist1">
Junio C Hamano9629d4f2012-12-19 00:28:273571<code>git log --follow builtin-rev-list.c</code>
Junio C Hamano235d53f2007-07-13 00:25:153572</dt>
3573<dd>
3574<p>
3575 Shows the commits that changed builtin-rev-list.c, including
3576 those commits that occurred before the file was given its
3577 present name.
3578</p>
3579</dd>
Junio C Hamano68cf15a2010-11-06 01:01:593580<dt class="hdlist1">
Junio C Hamano9629d4f2012-12-19 00:28:273581<code>git log --branches --not --remotes=origin</code>
Junio C Hamano57827fb2010-01-23 03:02:503582</dt>
3583<dd>
3584<p>
3585 Shows all commits that are in any of local branches but not in
Junio C Hamano97bcb482010-11-25 03:16:073586 any of remote-tracking branches for <em>origin</em> (what you have that
Junio C Hamano68cf15a2010-11-06 01:01:593587 origin doesn&#8217;t).
Junio C Hamano57827fb2010-01-23 03:02:503588</p>
3589</dd>
Junio C Hamano68cf15a2010-11-06 01:01:593590<dt class="hdlist1">
Junio C Hamano9629d4f2012-12-19 00:28:273591<code>git log master --not --remotes=*/master</code>
Junio C Hamano57827fb2010-01-23 03:02:503592</dt>
3593<dd>
3594<p>
3595 Shows all commits that are in local master but not in any remote
3596 repository master branches.
3597</p>
3598</dd>
Junio C Hamano68cf15a2010-11-06 01:01:593599<dt class="hdlist1">
Junio C Hamano9629d4f2012-12-19 00:28:273600<code>git log -p -m --first-parent</code>
Junio C Hamano31667362010-03-25 00:38:533601</dt>
3602<dd>
3603<p>
3604 Shows the history including change diffs, but only from the
3605 "main branch" perspective, skipping commits that come from merged
3606 branches, and showing full diffs of changes introduced by the merges.
3607 This makes sense only when following a strict policy of merging all
3608 topic branches when staying on a single integration branch.
3609</p>
3610</dd>
Junio C Hamano693e7092012-09-12 22:56:533611<dt class="hdlist1">
Junio C Hamano9629d4f2012-12-19 00:28:273612<code>git log -3</code>
Junio C Hamano693e7092012-09-12 22:56:533613</dt>
3614<dd>
3615<p>
3616 Limits the number of commits to show to 3.
3617</p>
3618</dd>
Junio C Hamanoba4b9282008-07-06 05:20:313619</dl></div>
Junio C Hamano1a4e8412005-12-27 08:17:233620</div>
Junio C Hamano9629d4f2012-12-19 00:28:273621</div>
3622<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:313623<h2 id="_discussion">Discussion</h2>
Junio C Hamano775a0f42006-12-31 01:19:143624<div class="sectionbody">
Junio C Hamano076ffcc2013-02-06 05:13:213625<div class="paragraph"><p>At the core level, Git is character encoding agnostic.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:593626<div class="ulist"><ul>
Junio C Hamano775a0f42006-12-31 01:19:143627<li>
3628<p>
3629The pathnames recorded in the index and in the tree objects
3630 are treated as uninterpreted sequences of non-NUL bytes.
3631 What readdir(2) returns are what are recorded and compared
Junio C Hamano076ffcc2013-02-06 05:13:213632 with the data Git keeps track of, which in turn are expected
Junio C Hamano775a0f42006-12-31 01:19:143633 to be what lstat(2) and creat(2) accepts. There is no such
3634 thing as pathname encoding translation.
3635</p>
3636</li>
3637<li>
3638<p>
Junio C Hamano54bf1e22008-12-20 06:30:113639The contents of the blob objects are uninterpreted sequences
Junio C Hamano775a0f42006-12-31 01:19:143640 of bytes. There is no encoding translation at the core
3641 level.
3642</p>
3643</li>
3644<li>
3645<p>
Junio C Hamano54bf1e22008-12-20 06:30:113646The commit log messages are uninterpreted sequences of non-NUL
Junio C Hamano775a0f42006-12-31 01:19:143647 bytes.
3648</p>
3649</li>
Junio C Hamanoba4b9282008-07-06 05:20:313650</ul></div>
Junio C Hamano68cf15a2010-11-06 01:01:593651<div class="paragraph"><p>Although we encourage that the commit log messages are encoded
Junio C Hamano076ffcc2013-02-06 05:13:213652in UTF-8, both the core and Git Porcelain are designed not to
Junio C Hamano775a0f42006-12-31 01:19:143653force UTF-8 on projects. If all participants of a particular
Junio C Hamano076ffcc2013-02-06 05:13:213654project find it more convenient to use legacy encodings, Git
Junio C Hamano775a0f42006-12-31 01:19:143655does not forbid it. However, there are a few things to keep in
Junio C Hamanoba4b9282008-07-06 05:20:313656mind.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:593657<div class="olist arabic"><ol class="arabic">
Junio C Hamano775a0f42006-12-31 01:19:143658<li>
3659<p>
Junio C Hamano1aa40d22010-01-21 17:46:433660<em>git commit</em> and <em>git commit-tree</em> issues
Junio C Hamano14b76482008-01-05 10:32:263661 a warning if the commit log message given to it does not look
Junio C Hamano775a0f42006-12-31 01:19:143662 like a valid UTF-8 string, unless you explicitly say your
3663 project uses a legacy encoding. The way to say this is to
Junio C Hamano9629d4f2012-12-19 00:28:273664 have i18n.commitencoding in <code>.git/config</code> file, like this:
Junio C Hamano775a0f42006-12-31 01:19:143665</p>
3666<div class="listingblock">
3667<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:273668<pre><code>[i18n]
3669 commitencoding = ISO-8859-1</code></pre>
Junio C Hamano775a0f42006-12-31 01:19:143670</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:593671<div class="paragraph"><p>Commit objects created with the above setting record the value
Junio C Hamano9629d4f2012-12-19 00:28:273672of <code>i18n.commitencoding</code> in its <code>encoding</code> header. This is to
Junio C Hamano775a0f42006-12-31 01:19:143673help other people who look at them later. Lack of this header
Junio C Hamanoba4b9282008-07-06 05:20:313674implies that the commit log message is encoded in UTF-8.</p></div>
Junio C Hamano775a0f42006-12-31 01:19:143675</li>
3676<li>
3677<p>
Junio C Hamano1aa40d22010-01-21 17:46:433678<em>git log</em>, <em>git show</em>, <em>git blame</em> and friends look at the
Junio C Hamano9629d4f2012-12-19 00:28:273679 <code>encoding</code> header of a commit object, and try to re-code the
Junio C Hamanoaa17c7c2008-11-03 04:36:583680 log message into UTF-8 unless otherwise specified. You can
Junio C Hamano775a0f42006-12-31 01:19:143681 specify the desired output encoding with
Junio C Hamano9629d4f2012-12-19 00:28:273682 <code>i18n.logoutputencoding</code> in <code>.git/config</code> file, like this:
Junio C Hamano775a0f42006-12-31 01:19:143683</p>
3684<div class="listingblock">
3685<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:273686<pre><code>[i18n]
3687 logoutputencoding = ISO-8859-1</code></pre>
Junio C Hamano775a0f42006-12-31 01:19:143688</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:593689<div class="paragraph"><p>If you do not have this configuration variable, the value of
Junio C Hamano9629d4f2012-12-19 00:28:273690<code>i18n.commitencoding</code> is used instead.</p></div>
Junio C Hamano775a0f42006-12-31 01:19:143691</li>
Junio C Hamanoba4b9282008-07-06 05:20:313692</ol></div>
Junio C Hamano68cf15a2010-11-06 01:01:593693<div class="paragraph"><p>Note that we deliberately chose not to re-code the commit log
Junio C Hamano775a0f42006-12-31 01:19:143694message when a commit is made to force UTF-8 at the commit
3695object level, because re-coding to UTF-8 is not necessarily a
Junio C Hamanoba4b9282008-07-06 05:20:313696reversible operation.</p></div>
Junio C Hamano775a0f42006-12-31 01:19:143697</div>
Junio C Hamano9629d4f2012-12-19 00:28:273698</div>
3699<div class="sect1">
Junio C Hamanoa574a092010-06-13 19:57:103700<h2 id="_configuration">Configuration</h2>
3701<div class="sectionbody">
Junio C Hamanoa28a9202012-06-21 07:08:233702<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:103703for settings related to diff generation.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:593704<div class="dlist"><dl>
3705<dt class="hdlist1">
Junio C Hamanoa574a092010-06-13 19:57:103706format.pretty
3707</dt>
3708<dd>
3709<p>
Junio C Hamano9629d4f2012-12-19 00:28:273710 Default for the <code>--format</code> option. (See "PRETTY FORMATS" above.)
Junio C Hamanoa574a092010-06-13 19:57:103711 Defaults to "medium".
3712</p>
3713</dd>
Junio C Hamano68cf15a2010-11-06 01:01:593714<dt class="hdlist1">
Junio C Hamanoa574a092010-06-13 19:57:103715i18n.logOutputEncoding
3716</dt>
3717<dd>
3718<p>
3719 Encoding to use when displaying logs. (See "Discussion", above.)
Junio C Hamano9629d4f2012-12-19 00:28:273720 Defaults to the value of <code>i18n.commitEncoding</code> if set, UTF-8
Junio C Hamanoa574a092010-06-13 19:57:103721 otherwise.
3722</p>
3723</dd>
Junio C Hamano68cf15a2010-11-06 01:01:593724<dt class="hdlist1">
Junio C Hamanoa574a092010-06-13 19:57:103725log.date
3726</dt>
3727<dd>
3728<p>
3729 Default format for human-readable dates. (Compare the
Junio C Hamano9629d4f2012-12-19 00:28:273730 <code>--date</code> option.) Defaults to "default", which means to write
3731 dates like <code>Sat May 8 19:35:34 2010 -0500</code>.
Junio C Hamanoa574a092010-06-13 19:57:103732</p>
3733</dd>
Junio C Hamano68cf15a2010-11-06 01:01:593734<dt class="hdlist1">
Junio C Hamanoa574a092010-06-13 19:57:103735log.showroot
3736</dt>
3737<dd>
3738<p>
Junio C Hamano9629d4f2012-12-19 00:28:273739 If <code>false</code>, <em>git log</em> and related commands will not treat the
Junio C Hamanoa574a092010-06-13 19:57:103740 initial commit as a big creation event. Any root commits in
Junio C Hamano9629d4f2012-12-19 00:28:273741 <code>git log -p</code> output would be shown without a diff attached.
3742 The default is <code>true</code>.
Junio C Hamanoa574a092010-06-13 19:57:103743</p>
3744</dd>
Junio C Hamano68cf15a2010-11-06 01:01:593745<dt class="hdlist1">
Junio C Hamanoabad6da2013-01-06 09:06:323746mailmap.*
Junio C Hamanoa574a092010-06-13 19:57:103747</dt>
3748<dd>
3749<p>
Junio C Hamanoa28a9202012-06-21 07:08:233750 See <a href="git-shortlog.html">git-shortlog(1)</a>.
Junio C Hamanoa574a092010-06-13 19:57:103751</p>
3752</dd>
Junio C Hamano68cf15a2010-11-06 01:01:593753<dt class="hdlist1">
Junio C Hamanoa574a092010-06-13 19:57:103754notes.displayRef
3755</dt>
3756<dd>
3757<p>
Junio C Hamano9629d4f2012-12-19 00:28:273758 Which refs, in addition to the default set by <code>core.notesRef</code>
Junio C Hamanoa574a092010-06-13 19:57:103759 or <em>GIT_NOTES_REF</em>, to read notes from when showing commit
3760 messages with the <em>log</em> family of commands. See
Junio C Hamanoa28a9202012-06-21 07:08:233761 <a href="git-notes.html">git-notes(1)</a>.
Junio C Hamanoa574a092010-06-13 19:57:103762</p>
Junio C Hamano68cf15a2010-11-06 01:01:593763<div class="paragraph"><p>May be an unabbreviated ref name or a glob and may be specified
Junio C Hamanoa574a092010-06-13 19:57:103764multiple times. A warning will be issued for refs that do not exist,
3765but a glob that does not match any refs is silently ignored.</p></div>
Junio C Hamano9629d4f2012-12-19 00:28:273766<div class="paragraph"><p>This setting can be disabled by the <code>--no-notes</code> option,
Junio C Hamanoa574a092010-06-13 19:57:103767overridden by the <em>GIT_NOTES_DISPLAY_REF</em> environment variable,
Junio C Hamano9629d4f2012-12-19 00:28:273768and overridden by the <code>--notes=&lt;ref&gt;</code> option.</p></div>
Junio C Hamanoa574a092010-06-13 19:57:103769</dd>
3770</dl></div>
3771</div>
Junio C Hamano9629d4f2012-12-19 00:28:273772</div>
3773<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:313774<h2 id="_git">GIT</h2>
Junio C Hamano1a4e8412005-12-27 08:17:233775<div class="sectionbody">
Junio C Hamanoa28a9202012-06-21 07:08:233776<div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:233777</div>
Junio C Hamano7bd050f2011-09-22 06:32:223778</div>
Junio C Hamano9629d4f2012-12-19 00:28:273779</div>
Junio C Hamano7bd050f2011-09-22 06:32:223780<div id="footnotes"><hr /></div>
Junio C Hamano1a4e8412005-12-27 08:17:233781<div id="footer">
3782<div id="footer-text">
Junio C Hamano076ffcc2013-02-06 05:13:213783Last updated 2013-02-05 21:07:26 PST
Junio C Hamano1a4e8412005-12-27 08:17:233784</div>
3785</div>
3786</body>
3787</html>