blob: 1b155a75cb53e9859d4a489f21fa6ec09fdb0eaf [file] [log] [blame]
Junio C Hamano1a4e8412005-12-27 08:17:231<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
2 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
4<head>
Junio C Hamano9629d4f2012-12-19 00:28:275<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
Junio C Hamanoac12f0e2014-09-19 22:32:516<meta name="generator" content="AsciiDoc 8.6.9" />
Junio C Hamano68cf15a2010-11-06 01:01:597<title>git-diff-tree(1)</title>
Junio C Hamano1a4e8412005-12-27 08:17:238<style type="text/css">
Junio C Hamano9629d4f2012-12-19 00:28:279/* Shared CSS for AsciiDoc xhtml11 and html5 backends */
10
11/* Default font. */
12body {
13 font-family: Georgia,serif;
14}
15
16/* Title font. */
17h1, h2, h3, h4, h5, h6,
18div.title, caption.title,
19thead, p.table.header,
20#toctitle,
21#author, #revnumber, #revdate, #revremark,
22#footer {
23 font-family: Arial,Helvetica,sans-serif;
Junio C Hamano1a4e8412005-12-27 08:17:2324}
25
26body {
27 margin: 1em 5% 1em 5%;
28}
29
Junio C Hamanoba4b9282008-07-06 05:20:3130a {
31 color: blue;
32 text-decoration: underline;
33}
34a:visited {
35 color: fuchsia;
36}
Junio C Hamano1a4e8412005-12-27 08:17:2337
38em {
39 font-style: italic;
Junio C Hamano68cf15a2010-11-06 01:01:5940 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:2341}
42
43strong {
44 font-weight: bold;
Junio C Hamano68cf15a2010-11-06 01:01:5945 color: #083194;
Junio C Hamano1a4e8412005-12-27 08:17:2346}
47
Junio C Hamano1a4e8412005-12-27 08:17:2348h1, h2, h3, h4, h5, h6 {
49 color: #527bbd;
Junio C Hamano1a4e8412005-12-27 08:17:2350 margin-top: 1.2em;
51 margin-bottom: 0.5em;
52 line-height: 1.3;
53}
54
Junio C Hamanoba4b9282008-07-06 05:20:3155h1, h2, h3 {
Junio C Hamano1a4e8412005-12-27 08:17:2356 border-bottom: 2px solid silver;
57}
58h2 {
Junio C Hamano1a4e8412005-12-27 08:17:2359 padding-top: 0.5em;
60}
Junio C Hamanoba4b9282008-07-06 05:20:3161h3 {
62 float: left;
63}
64h3 + * {
65 clear: left;
66}
Junio C Hamano9629d4f2012-12-19 00:28:2767h5 {
68 font-size: 1.0em;
69}
Junio C Hamano1a4e8412005-12-27 08:17:2370
71div.sectionbody {
Junio C Hamano1a4e8412005-12-27 08:17:2372 margin-left: 0;
73}
74
75hr {
76 border: 1px solid silver;
77}
78
79p {
80 margin-top: 0.5em;
81 margin-bottom: 0.5em;
82}
83
Junio C Hamano68cf15a2010-11-06 01:01:5984ul, ol, li > p {
85 margin-top: 0;
86}
Junio C Hamano9629d4f2012-12-19 00:28:2787ul > li { color: #aaa; }
88ul > li > * { color: black; }
Junio C Hamano68cf15a2010-11-06 01:01:5989
Junio C Hamanoac12f0e2014-09-19 22:32:5190.monospaced, code, pre {
91 font-family: "Courier New", Courier, monospace;
92 font-size: inherit;
93 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:2394 padding: 0;
95 margin: 0;
96}
Junio C Hamanoac12f0e2014-09-19 22:32:5197pre {
98 white-space: pre-wrap;
99}
Junio C Hamano1a4e8412005-12-27 08:17:23100
Junio C Hamano9629d4f2012-12-19 00:28:27101#author {
Junio C Hamano1a4e8412005-12-27 08:17:23102 color: #527bbd;
Junio C Hamano1a4e8412005-12-27 08:17:23103 font-weight: bold;
Junio C Hamanoba4b9282008-07-06 05:20:31104 font-size: 1.1em;
Junio C Hamano1a4e8412005-12-27 08:17:23105}
Junio C Hamano9629d4f2012-12-19 00:28:27106#email {
Junio C Hamano1a4e8412005-12-27 08:17:23107}
Junio C Hamano9629d4f2012-12-19 00:28:27108#revnumber, #revdate, #revremark {
Junio C Hamano1a4e8412005-12-27 08:17:23109}
110
Junio C Hamano9629d4f2012-12-19 00:28:27111#footer {
Junio C Hamano1a4e8412005-12-27 08:17:23112 font-size: small;
113 border-top: 2px solid silver;
114 padding-top: 0.5em;
115 margin-top: 4.0em;
116}
Junio C Hamano9629d4f2012-12-19 00:28:27117#footer-text {
Junio C Hamano1a4e8412005-12-27 08:17:23118 float: left;
119 padding-bottom: 0.5em;
120}
Junio C Hamano9629d4f2012-12-19 00:28:27121#footer-badges {
Junio C Hamano1a4e8412005-12-27 08:17:23122 float: right;
123 padding-bottom: 0.5em;
124}
125
Junio C Hamano9629d4f2012-12-19 00:28:27126#preamble {
Junio C Hamano68cf15a2010-11-06 01:01:59127 margin-top: 1.5em;
128 margin-bottom: 1.5em;
129}
Junio C Hamano9629d4f2012-12-19 00:28:27130div.imageblock, div.exampleblock, div.verseblock,
Junio C Hamano1a4e8412005-12-27 08:17:23131div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
132div.admonitionblock {
Junio C Hamano7bd050f2011-09-22 06:32:22133 margin-top: 1.0em;
Junio C Hamano1a4e8412005-12-27 08:17:23134 margin-bottom: 1.5em;
135}
136div.admonitionblock {
Junio C Hamano7bd050f2011-09-22 06:32:22137 margin-top: 2.0em;
138 margin-bottom: 2.0em;
139 margin-right: 10%;
140 color: #606060;
Junio C Hamano1a4e8412005-12-27 08:17:23141}
142
143div.content { /* Block element content. */
144 padding: 0;
145}
146
147/* Block element titles. */
148div.title, caption.title {
Junio C Hamano68cf15a2010-11-06 01:01:59149 color: #527bbd;
Junio C Hamano1a4e8412005-12-27 08:17:23150 font-weight: bold;
151 text-align: left;
152 margin-top: 1.0em;
153 margin-bottom: 0.5em;
154}
155div.title + * {
156 margin-top: 0;
157}
158
159td div.title:first-child {
160 margin-top: 0.0em;
161}
162div.content div.title:first-child {
163 margin-top: 0.0em;
164}
165div.content + div.title {
166 margin-top: 0.0em;
167}
168
169div.sidebarblock > div.content {
170 background: #ffffee;
Junio C Hamano9629d4f2012-12-19 00:28:27171 border: 1px solid #dddddd;
172 border-left: 4px solid #f0f0f0;
Junio C Hamano1a4e8412005-12-27 08:17:23173 padding: 0.5em;
174}
175
176div.listingblock > div.content {
Junio C Hamano9629d4f2012-12-19 00:28:27177 border: 1px solid #dddddd;
178 border-left: 5px solid #f0f0f0;
179 background: #f8f8f8;
Junio C Hamano1a4e8412005-12-27 08:17:23180 padding: 0.5em;
181}
182
Junio C Hamano7bd050f2011-09-22 06:32:22183div.quoteblock, div.verseblock {
184 padding-left: 1.0em;
185 margin-left: 1.0em;
Junio C Hamano68cf15a2010-11-06 01:01:59186 margin-right: 10%;
Junio C Hamano9629d4f2012-12-19 00:28:27187 border-left: 5px solid #f0f0f0;
188 color: #888;
Junio C Hamano1a4e8412005-12-27 08:17:23189}
Junio C Hamano7bd050f2011-09-22 06:32:22190
Junio C Hamano68cf15a2010-11-06 01:01:59191div.quoteblock > div.attribution {
192 padding-top: 0.5em;
Junio C Hamano1a4e8412005-12-27 08:17:23193 text-align: right;
194}
Junio C Hamano68cf15a2010-11-06 01:01:59195
Junio C Hamano9629d4f2012-12-19 00:28:27196div.verseblock > pre.content {
197 font-family: inherit;
198 font-size: inherit;
Junio C Hamano68cf15a2010-11-06 01:01:59199}
200div.verseblock > div.attribution {
201 padding-top: 0.75em;
202 text-align: left;
203}
204/* DEPRECATED: Pre version 8.2.7 verse style literal block. */
Junio C Hamanoba4b9282008-07-06 05:20:31205div.verseblock + div.attribution {
206 text-align: left;
207}
Junio C Hamano1a4e8412005-12-27 08:17:23208
209div.admonitionblock .icon {
210 vertical-align: top;
211 font-size: 1.1em;
212 font-weight: bold;
213 text-decoration: underline;
214 color: #527bbd;
215 padding-right: 0.5em;
216}
217div.admonitionblock td.content {
218 padding-left: 0.5em;
Junio C Hamano7bd050f2011-09-22 06:32:22219 border-left: 3px solid #dddddd;
Junio C Hamano1a4e8412005-12-27 08:17:23220}
221
222div.exampleblock > div.content {
Junio C Hamano7bd050f2011-09-22 06:32:22223 border-left: 3px solid #dddddd;
224 padding-left: 0.5em;
Junio C Hamano1a4e8412005-12-27 08:17:23225}
226
Junio C Hamano1a4e8412005-12-27 08:17:23227div.imageblock div.content { padding-left: 0; }
Junio C Hamanoac12f0e2014-09-19 22:32:51228span.image img { border-style: none; vertical-align: text-bottom; }
Junio C Hamano68cf15a2010-11-06 01:01:59229a.image:visited { color: white; }
Junio C Hamano1a4e8412005-12-27 08:17:23230
231dl {
232 margin-top: 0.8em;
233 margin-bottom: 0.8em;
234}
235dt {
236 margin-top: 0.5em;
237 margin-bottom: 0;
Junio C Hamano68cf15a2010-11-06 01:01:59238 font-style: normal;
239 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:23240}
241dd > *:first-child {
Junio C Hamano68cf15a2010-11-06 01:01:59242 margin-top: 0.1em;
Junio C Hamano1a4e8412005-12-27 08:17:23243}
244
245ul, ol {
246 list-style-position: outside;
247}
Junio C Hamano68cf15a2010-11-06 01:01:59248ol.arabic {
249 list-style-type: decimal;
250}
251ol.loweralpha {
Junio C Hamano1a4e8412005-12-27 08:17:23252 list-style-type: lower-alpha;
253}
Junio C Hamano68cf15a2010-11-06 01:01:59254ol.upperalpha {
255 list-style-type: upper-alpha;
256}
257ol.lowerroman {
258 list-style-type: lower-roman;
259}
260ol.upperroman {
261 list-style-type: upper-roman;
262}
263
264div.compact ul, div.compact ol,
265div.compact p, div.compact p,
266div.compact div, div.compact div {
267 margin-top: 0.1em;
268 margin-bottom: 0.1em;
269}
Junio C Hamano1a4e8412005-12-27 08:17:23270
Junio C Hamano1a4e8412005-12-27 08:17:23271tfoot {
272 font-weight: bold;
273}
Junio C Hamano68cf15a2010-11-06 01:01:59274td > div.verse {
275 white-space: pre;
276}
Junio C Hamano68cf15a2010-11-06 01:01:59277
278div.hdlist {
Junio C Hamano1a4e8412005-12-27 08:17:23279 margin-top: 0.8em;
280 margin-bottom: 0.8em;
281}
Junio C Hamano68cf15a2010-11-06 01:01:59282div.hdlist tr {
283 padding-bottom: 15px;
Junio C Hamanoba4b9282008-07-06 05:20:31284}
Junio C Hamano68cf15a2010-11-06 01:01:59285dt.hdlist1.strong, td.hdlist1.strong {
286 font-weight: bold;
287}
288td.hdlist1 {
Junio C Hamano1a4e8412005-12-27 08:17:23289 vertical-align: top;
Junio C Hamano68cf15a2010-11-06 01:01:59290 font-style: normal;
Junio C Hamano1a4e8412005-12-27 08:17:23291 padding-right: 0.8em;
Junio C Hamano68cf15a2010-11-06 01:01:59292 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:23293}
Junio C Hamano68cf15a2010-11-06 01:01:59294td.hdlist2 {
Junio C Hamano1a4e8412005-12-27 08:17:23295 vertical-align: top;
296}
Junio C Hamano68cf15a2010-11-06 01:01:59297div.hdlist.compact tr {
298 margin: 0;
299 padding-bottom: 0;
300}
301
302.comment {
303 background: yellow;
304}
Junio C Hamano1a4e8412005-12-27 08:17:23305
Junio C Hamano7bd050f2011-09-22 06:32:22306.footnote, .footnoteref {
307 font-size: 0.8em;
308}
309
310span.footnote, span.footnoteref {
311 vertical-align: super;
312}
313
314#footnotes {
315 margin: 20px 0 20px 0;
316 padding: 7px 0 0 0;
317}
318
319#footnotes div.footnote {
320 margin: 0 0 5px 0;
321}
322
323#footnotes hr {
324 border: none;
325 border-top: 1px solid silver;
326 height: 1px;
327 text-align: left;
328 margin-left: 0;
329 width: 20%;
330 min-width: 100px;
331}
332
Junio C Hamano9629d4f2012-12-19 00:28:27333div.colist td {
334 padding-right: 0.5em;
335 padding-bottom: 0.3em;
336 vertical-align: top;
337}
338div.colist td img {
339 margin-top: 0.3em;
Junio C Hamano1a4e8412005-12-27 08:17:23340}
Junio C Hamanoba4b9282008-07-06 05:20:31341
Junio C Hamano9629d4f2012-12-19 00:28:27342@media print {
343 #footer-badges { display: none; }
344}
345
346#toc {
Junio C Hamano7bd050f2011-09-22 06:32:22347 margin-bottom: 2.5em;
348}
349
Junio C Hamano9629d4f2012-12-19 00:28:27350#toctitle {
Junio C Hamanoba4b9282008-07-06 05:20:31351 color: #527bbd;
Junio C Hamanoba4b9282008-07-06 05:20:31352 font-size: 1.1em;
353 font-weight: bold;
354 margin-top: 1.0em;
355 margin-bottom: 0.1em;
356}
357
Junio C Hamanoac12f0e2014-09-19 22:32:51358div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
Junio C Hamanoba4b9282008-07-06 05:20:31359 margin-top: 0;
360 margin-bottom: 0;
361}
362div.toclevel2 {
363 margin-left: 2em;
364 font-size: 0.9em;
365}
366div.toclevel3 {
367 margin-left: 4em;
368 font-size: 0.9em;
369}
370div.toclevel4 {
371 margin-left: 6em;
372 font-size: 0.9em;
373}
Junio C Hamano9629d4f2012-12-19 00:28:27374
375span.aqua { color: aqua; }
376span.black { color: black; }
377span.blue { color: blue; }
378span.fuchsia { color: fuchsia; }
379span.gray { color: gray; }
380span.green { color: green; }
381span.lime { color: lime; }
382span.maroon { color: maroon; }
383span.navy { color: navy; }
384span.olive { color: olive; }
385span.purple { color: purple; }
386span.red { color: red; }
387span.silver { color: silver; }
388span.teal { color: teal; }
389span.white { color: white; }
390span.yellow { color: yellow; }
391
392span.aqua-background { background: aqua; }
393span.black-background { background: black; }
394span.blue-background { background: blue; }
395span.fuchsia-background { background: fuchsia; }
396span.gray-background { background: gray; }
397span.green-background { background: green; }
398span.lime-background { background: lime; }
399span.maroon-background { background: maroon; }
400span.navy-background { background: navy; }
401span.olive-background { background: olive; }
402span.purple-background { background: purple; }
403span.red-background { background: red; }
404span.silver-background { background: silver; }
405span.teal-background { background: teal; }
406span.white-background { background: white; }
407span.yellow-background { background: yellow; }
408
409span.big { font-size: 2em; }
410span.small { font-size: 0.6em; }
411
412span.underline { text-decoration: underline; }
413span.overline { text-decoration: overline; }
414span.line-through { text-decoration: line-through; }
415
Junio C Hamanoac12f0e2014-09-19 22:32:51416div.unbreakable { page-break-inside: avoid; }
417
Junio C Hamano9629d4f2012-12-19 00:28:27418
419/*
420 * xhtml11 specific
421 *
422 * */
423
424div.tableblock {
425 margin-top: 1.0em;
426 margin-bottom: 1.5em;
427}
428div.tableblock > table {
429 border: 3px solid #527bbd;
430}
431thead, p.table.header {
432 font-weight: bold;
433 color: #527bbd;
434}
435p.table {
436 margin-top: 0;
437}
438/* Because the table frame attribute is overriden by CSS in most browsers. */
439div.tableblock > table[frame="void"] {
440 border-style: none;
441}
442div.tableblock > table[frame="hsides"] {
443 border-left-style: none;
444 border-right-style: none;
445}
446div.tableblock > table[frame="vsides"] {
447 border-top-style: none;
448 border-bottom-style: none;
449}
450
451
452/*
453 * html5 specific
454 *
455 * */
456
457table.tableblock {
458 margin-top: 1.0em;
459 margin-bottom: 1.5em;
460}
461thead, p.tableblock.header {
462 font-weight: bold;
463 color: #527bbd;
464}
465p.tableblock {
466 margin-top: 0;
467}
468table.tableblock {
469 border-width: 3px;
470 border-spacing: 0px;
471 border-style: solid;
472 border-color: #527bbd;
473 border-collapse: collapse;
474}
475th.tableblock, td.tableblock {
476 border-width: 1px;
477 padding: 4px;
478 border-style: solid;
479 border-color: #527bbd;
480}
481
482table.tableblock.frame-topbot {
483 border-left-style: hidden;
484 border-right-style: hidden;
485}
486table.tableblock.frame-sides {
487 border-top-style: hidden;
488 border-bottom-style: hidden;
489}
490table.tableblock.frame-none {
491 border-style: hidden;
492}
493
494th.tableblock.halign-left, td.tableblock.halign-left {
495 text-align: left;
496}
497th.tableblock.halign-center, td.tableblock.halign-center {
498 text-align: center;
499}
500th.tableblock.halign-right, td.tableblock.halign-right {
501 text-align: right;
502}
503
504th.tableblock.valign-top, td.tableblock.valign-top {
505 vertical-align: top;
506}
507th.tableblock.valign-middle, td.tableblock.valign-middle {
508 vertical-align: middle;
509}
510th.tableblock.valign-bottom, td.tableblock.valign-bottom {
511 vertical-align: bottom;
512}
513
514
515/*
516 * manpage specific
517 *
518 * */
519
520body.manpage h1 {
Junio C Hamano68cf15a2010-11-06 01:01:59521 padding-top: 0.5em;
522 padding-bottom: 0.5em;
523 border-top: 2px solid silver;
524 border-bottom: 2px solid silver;
525}
Junio C Hamano9629d4f2012-12-19 00:28:27526body.manpage h2 {
Junio C Hamano68cf15a2010-11-06 01:01:59527 border-style: none;
528}
Junio C Hamano9629d4f2012-12-19 00:28:27529body.manpage div.sectionbody {
530 margin-left: 3em;
Junio C Hamano68cf15a2010-11-06 01:01:59531}
532
533@media print {
Junio C Hamano9629d4f2012-12-19 00:28:27534 body.manpage div#toc { display: none; }
Junio C Hamano68cf15a2010-11-06 01:01:59535}
Junio C Hamanoac12f0e2014-09-19 22:32:51536
537
Junio C Hamano1a4e8412005-12-27 08:17:23538</style>
Junio C Hamano7bd050f2011-09-22 06:32:22539<script type="text/javascript">
540/*<![CDATA[*/
Junio C Hamano7bd050f2011-09-22 06:32:22541var asciidoc = { // Namespace.
542
543/////////////////////////////////////////////////////////////////////
544// Table Of Contents generator
545/////////////////////////////////////////////////////////////////////
546
547/* Author: Mihai Bazon, September 2002
548 * http://students.infoiasi.ro/~mishoo
549 *
550 * Table Of Content generator
551 * Version: 0.4
552 *
553 * Feel free to use this script under the terms of the GNU General Public
554 * License, as long as you do not remove or alter this notice.
555 */
556
557 /* modified by Troy D. Hanson, September 2006. License: GPL */
558 /* modified by Stuart Rackham, 2006, 2009. License: GPL */
559
560// toclevels = 1..4.
561toc: function (toclevels) {
562
563 function getText(el) {
564 var text = "";
565 for (var i = el.firstChild; i != null; i = i.nextSibling) {
566 if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
567 text += i.data;
568 else if (i.firstChild != null)
569 text += getText(i);
570 }
571 return text;
572 }
573
574 function TocEntry(el, text, toclevel) {
575 this.element = el;
576 this.text = text;
577 this.toclevel = toclevel;
578 }
579
580 function tocEntries(el, toclevels) {
581 var result = new Array;
Junio C Hamanoac12f0e2014-09-19 22:32:51582 var re = new RegExp('[hH]([1-'+(toclevels+1)+'])');
Junio C Hamano7bd050f2011-09-22 06:32:22583 // Function that scans the DOM tree for header elements (the DOM2
584 // nodeIterator API would be a better technique but not supported by all
585 // browsers).
586 var iterate = function (el) {
587 for (var i = el.firstChild; i != null; i = i.nextSibling) {
588 if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
589 var mo = re.exec(i.tagName);
590 if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
591 result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
592 }
593 iterate(i);
594 }
595 }
596 }
597 iterate(el);
598 return result;
599 }
600
601 var toc = document.getElementById("toc");
Junio C Hamano9629d4f2012-12-19 00:28:27602 if (!toc) {
603 return;
604 }
605
606 // Delete existing TOC entries in case we're reloading the TOC.
607 var tocEntriesToRemove = [];
608 var i;
609 for (i = 0; i < toc.childNodes.length; i++) {
610 var entry = toc.childNodes[i];
Junio C Hamanoac12f0e2014-09-19 22:32:51611 if (entry.nodeName.toLowerCase() == 'div'
Junio C Hamano9629d4f2012-12-19 00:28:27612 && entry.getAttribute("class")
613 && entry.getAttribute("class").match(/^toclevel/))
614 tocEntriesToRemove.push(entry);
615 }
616 for (i = 0; i < tocEntriesToRemove.length; i++) {
617 toc.removeChild(tocEntriesToRemove[i]);
618 }
619
620 // Rebuild TOC entries.
Junio C Hamano7bd050f2011-09-22 06:32:22621 var entries = tocEntries(document.getElementById("content"), toclevels);
622 for (var i = 0; i < entries.length; ++i) {
623 var entry = entries[i];
624 if (entry.element.id == "")
625 entry.element.id = "_toc_" + i;
626 var a = document.createElement("a");
627 a.href = "#" + entry.element.id;
628 a.appendChild(document.createTextNode(entry.text));
629 var div = document.createElement("div");
630 div.appendChild(a);
631 div.className = "toclevel" + entry.toclevel;
632 toc.appendChild(div);
633 }
634 if (entries.length == 0)
635 toc.parentNode.removeChild(toc);
636},
637
638
639/////////////////////////////////////////////////////////////////////
640// Footnotes generator
641/////////////////////////////////////////////////////////////////////
642
643/* Based on footnote generation code from:
644 * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
645 */
646
647footnotes: function () {
Junio C Hamano9629d4f2012-12-19 00:28:27648 // Delete existing footnote entries in case we're reloading the footnodes.
649 var i;
Junio C Hamano7bd050f2011-09-22 06:32:22650 var noteholder = document.getElementById("footnotes");
Junio C Hamano9629d4f2012-12-19 00:28:27651 if (!noteholder) {
652 return;
653 }
654 var entriesToRemove = [];
655 for (i = 0; i < noteholder.childNodes.length; i++) {
656 var entry = noteholder.childNodes[i];
Junio C Hamanoac12f0e2014-09-19 22:32:51657 if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote")
Junio C Hamano9629d4f2012-12-19 00:28:27658 entriesToRemove.push(entry);
659 }
660 for (i = 0; i < entriesToRemove.length; i++) {
661 noteholder.removeChild(entriesToRemove[i]);
662 }
663
664 // Rebuild footnote entries.
665 var cont = document.getElementById("content");
Junio C Hamano7bd050f2011-09-22 06:32:22666 var spans = cont.getElementsByTagName("span");
667 var refs = {};
668 var n = 0;
669 for (i=0; i<spans.length; i++) {
670 if (spans[i].className == "footnote") {
671 n++;
Junio C Hamano9629d4f2012-12-19 00:28:27672 var note = spans[i].getAttribute("data-note");
673 if (!note) {
674 // Use [\s\S] in place of . so multi-line matches work.
675 // Because JavaScript has no s (dotall) regex flag.
676 note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
677 spans[i].innerHTML =
678 "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
679 "' title='View footnote' class='footnote'>" + n + "</a>]";
680 spans[i].setAttribute("data-note", note);
681 }
Junio C Hamano7bd050f2011-09-22 06:32:22682 noteholder.innerHTML +=
683 "<div class='footnote' id='_footnote_" + n + "'>" +
684 "<a href='#_footnoteref_" + n + "' title='Return to text'>" +
685 n + "</a>. " + note + "</div>";
Junio C Hamano7bd050f2011-09-22 06:32:22686 var id =spans[i].getAttribute("id");
687 if (id != null) refs["#"+id] = n;
688 }
689 }
690 if (n == 0)
691 noteholder.parentNode.removeChild(noteholder);
692 else {
693 // Process footnoterefs.
694 for (i=0; i<spans.length; i++) {
695 if (spans[i].className == "footnoteref") {
696 var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
697 href = href.match(/#.*/)[0]; // Because IE return full URL.
698 n = refs[href];
699 spans[i].innerHTML =
700 "[<a href='#_footnote_" + n +
701 "' title='View footnote' class='footnote'>" + n + "</a>]";
702 }
703 }
704 }
Junio C Hamano9629d4f2012-12-19 00:28:27705},
706
707install: function(toclevels) {
708 var timerId;
709
710 function reinstall() {
711 asciidoc.footnotes();
712 if (toclevels) {
713 asciidoc.toc(toclevels);
714 }
715 }
716
717 function reinstallAndRemoveTimer() {
718 clearInterval(timerId);
719 reinstall();
720 }
721
722 timerId = setInterval(reinstall, 500);
723 if (document.addEventListener)
724 document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false);
725 else
726 window.onload = reinstallAndRemoveTimer;
Junio C Hamano7bd050f2011-09-22 06:32:22727}
728
729}
Junio C Hamano9629d4f2012-12-19 00:28:27730asciidoc.install();
Junio C Hamano7bd050f2011-09-22 06:32:22731/*]]>*/
732</script>
Junio C Hamano1a4e8412005-12-27 08:17:23733</head>
Junio C Hamano9629d4f2012-12-19 00:28:27734<body class="manpage">
Junio C Hamano1a4e8412005-12-27 08:17:23735<div id="header">
736<h1>
737git-diff-tree(1) Manual Page
738</h1>
739<h2>NAME</h2>
740<div class="sectionbody">
741<p>git-diff-tree -
742 Compares the content and mode of blobs found via two tree objects
743</p>
744</div>
745</div>
Junio C Hamano7bd050f2011-09-22 06:32:22746<div id="content">
Junio C Hamano9629d4f2012-12-19 00:28:27747<div class="sect1">
Junio C Hamano68cf15a2010-11-06 01:01:59748<h2 id="_synopsis">SYNOPSIS</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23749<div class="sectionbody">
Junio C Hamano235a91e2006-01-07 01:13:58750<div class="verseblock">
Junio C Hamano9629d4f2012-12-19 00:28:27751<pre class="content"><em>git diff-tree</em> [--stdin] [-m] [-s] [-v] [--no-commit-id] [--pretty]
Junio C Hamanofb56a962006-01-28 10:38:19752 [-t] [-r] [-c | --cc] [--root] [&lt;common diff options&gt;]
Junio C Hamano9629d4f2012-12-19 00:28:27753 &lt;tree-ish&gt; [&lt;tree-ish&gt;] [&lt;path&gt;&#8230;]</pre>
754<div class="attribution">
Junio C Hamano68cf15a2010-11-06 01:01:59755</div></div>
Junio C Hamano1a4e8412005-12-27 08:17:23756</div>
Junio C Hamano9629d4f2012-12-19 00:28:27757</div>
758<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:31759<h2 id="_description">DESCRIPTION</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23760<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:59761<div class="paragraph"><p>Compares the content and mode of the blobs found via two tree objects.</p></div>
762<div class="paragraph"><p>If there is only one &lt;tree-ish&gt; given, the commit is compared with its parents
Junio C Hamanoba4b9282008-07-06 05:20:31763(see --stdin below).</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:59764<div class="paragraph"><p>Note that <em>git diff-tree</em> can use the tree encapsulated in a commit object.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:23765</div>
Junio C Hamano9629d4f2012-12-19 00:28:27766</div>
767<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:31768<h2 id="_options">OPTIONS</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23769<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:59770<div class="dlist"><dl>
771<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:23772-p
773</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59774<dt class="hdlist1">
Junio C Hamanobbbb8652008-12-29 10:34:22775-u
776</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59777<dt class="hdlist1">
Junio C Hamanoe97d5772010-05-19 08:13:58778--patch
779</dt>
Junio C Hamano1a4e8412005-12-27 08:17:23780<dd>
781<p>
Junio C Hamanoff979792007-11-16 10:11:30782 Generate patch (see section on generating patches).
Junio C Hamano1a4e8412005-12-27 08:17:23783</p>
784</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59785<dt class="hdlist1">
Junio C Hamano58f587a2013-07-22 19:20:59786-s
787</dt>
788<dt class="hdlist1">
789--no-patch
790</dt>
791<dd>
792<p>
Junio C Hamanoac12f0e2014-09-19 22:32:51793 Suppress diff output. Useful for commands like <code>git show</code> that
794 show the patch by default, or to cancel the effect of <code>--patch</code>.
Junio C Hamano58f587a2013-07-22 19:20:59795</p>
796</dd>
797<dt class="hdlist1">
Junio C Hamano69361562007-07-26 02:14:34798-U&lt;n&gt;
799</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59800<dt class="hdlist1">
Junio C Hamano69361562007-07-26 02:14:34801--unified=&lt;n&gt;
802</dt>
803<dd>
804<p>
805 Generate diffs with &lt;n&gt; lines of context instead of
Junio C Hamano3b70d3c2009-11-21 17:37:37806 the usual three.
Junio C Hamanoac12f0e2014-09-19 22:32:51807 Implies <code>-p</code>.
Junio C Hamano69361562007-07-26 02:14:34808</p>
809</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59810<dt class="hdlist1">
Junio C Hamano9ae1a062006-07-10 08:12:34811--raw
812</dt>
813<dd>
814<p>
Junio C Hamano85f1fde2015-06-01 20:37:32815 Generate the diff in raw format.
Junio C Hamano1dbca522015-05-22 20:48:55816 This is the default.
Junio C Hamano9ae1a062006-07-10 08:12:34817</p>
818</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59819<dt class="hdlist1">
Junio C Hamano54559c82006-04-13 07:45:12820--patch-with-raw
821</dt>
822<dd>
823<p>
Junio C Hamanoac12f0e2014-09-19 22:32:51824 Synonym for <code>-p --raw</code>.
Junio C Hamano54559c82006-04-13 07:45:12825</p>
826</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59827<dt class="hdlist1">
Junio C Hamano5f888332016-06-13 19:28:31828--compaction-heuristic
829</dt>
830<dt class="hdlist1">
831--no-compaction-heuristic
832</dt>
833<dd>
834<p>
835 These are to help debugging and tuning an experimental
836 heuristic (which is off by default) that shifts the hunk
837 boundary in an attempt to make the resulting patch easier
838 to read.
839</p>
840</dd>
841<dt class="hdlist1">
Junio C Hamano5a73f302011-10-14 05:58:34842--minimal
843</dt>
844<dd>
845<p>
846 Spend extra time to make sure the smallest possible
847 diff is produced.
848</p>
849</dd>
850<dt class="hdlist1">
Junio C Hamano20d47e32009-01-26 06:36:02851--patience
852</dt>
853<dd>
854<p>
855 Generate a diff using the "patience diff" algorithm.
856</p>
857</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59858<dt class="hdlist1">
Junio C Hamanoaea9e6b2012-03-07 00:17:11859--histogram
860</dt>
861<dd>
862<p>
863 Generate a diff using the "histogram diff" algorithm.
864</p>
865</dd>
866<dt class="hdlist1">
Junio C Hamano80ad00d2013-02-18 00:19:03867--diff-algorithm={patience|minimal|histogram|myers}
868</dt>
869<dd>
870<p>
871 Choose a diff algorithm. The variants are as follows:
872</p>
873<div class="openblock">
874<div class="content">
875<div class="dlist"><dl>
876<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:51877<code>default</code>, <code>myers</code>
Junio C Hamano80ad00d2013-02-18 00:19:03878</dt>
879<dd>
880<p>
881 The basic greedy diff algorithm. Currently, this is the default.
882</p>
883</dd>
884<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:51885<code>minimal</code>
Junio C Hamano80ad00d2013-02-18 00:19:03886</dt>
887<dd>
888<p>
889 Spend extra time to make sure the smallest possible diff is
890 produced.
891</p>
892</dd>
893<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:51894<code>patience</code>
Junio C Hamano80ad00d2013-02-18 00:19:03895</dt>
896<dd>
897<p>
898 Use "patience diff" algorithm when generating patches.
899</p>
900</dd>
901<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:51902<code>histogram</code>
Junio C Hamano80ad00d2013-02-18 00:19:03903</dt>
904<dd>
905<p>
906 This algorithm extends the patience algorithm to "support
907 low-occurrence common elements".
908</p>
909</dd>
910</dl></div>
911</div></div>
912<div class="paragraph"><p>For instance, if you configured diff.algorithm variable to a
913non-default value and want to use the default one, then you
Junio C Hamanoac12f0e2014-09-19 22:32:51914have to use <code>--diff-algorithm=default</code> option.</p></div>
Junio C Hamano80ad00d2013-02-18 00:19:03915</dd>
916<dt class="hdlist1">
Junio C Hamano4c4b0122011-06-30 01:19:32917--stat[=&lt;width&gt;[,&lt;name-width&gt;[,&lt;count&gt;]]]
Junio C Hamanoba7c8d82006-04-15 06:17:42918</dt>
919<dd>
920<p>
Junio C Hamanoaea9e6b2012-03-07 00:17:11921 Generate a diffstat. By default, as much space as necessary
922 will be used for the filename part, and the rest for the graph
923 part. Maximum width defaults to terminal width, or 80 columns
Junio C Hamano7f2b3cb2012-06-22 22:42:39924 if not connected to a terminal, and can be overridden by
Junio C Hamanoac12f0e2014-09-19 22:32:51925 <code>&lt;width&gt;</code>. The width of the filename part can be limited by
926 giving another width <code>&lt;name-width&gt;</code> after a comma. The width
Junio C Hamanoaea9e6b2012-03-07 00:17:11927 of the graph part can be limited by using
Junio C Hamanoac12f0e2014-09-19 22:32:51928 <code>--stat-graph-width=&lt;width&gt;</code> (affects all commands generating
929 a stat graph) or by setting <code>diff.statGraphWidth=&lt;width&gt;</code>
930 (does not affect <code>git format-patch</code>).
931 By giving a third parameter <code>&lt;count&gt;</code>, you can limit the
932 output to the first <code>&lt;count&gt;</code> lines, followed by <code>...</code> if
Junio C Hamanoaea9e6b2012-03-07 00:17:11933 there are more.
Junio C Hamanoba7c8d82006-04-15 06:17:42934</p>
Junio C Hamanoac12f0e2014-09-19 22:32:51935<div class="paragraph"><p>These parameters can also be set individually with <code>--stat-width=&lt;width&gt;</code>,
936<code>--stat-name-width=&lt;name-width&gt;</code> and <code>--stat-count=&lt;count&gt;</code>.</p></div>
Junio C Hamanoba7c8d82006-04-15 06:17:42937</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59938<dt class="hdlist1">
Junio C Hamanofbe00522006-10-19 05:58:48939--numstat
940</dt>
941<dd>
942<p>
Junio C Hamanoac12f0e2014-09-19 22:32:51943 Similar to <code>--stat</code>, but shows number of added and
Junio C Hamanofbe00522006-10-19 05:58:48944 deleted lines in decimal notation and pathname without
Junio C Hamanod793de52006-12-26 09:11:43945 abbreviation, to make it more machine friendly. For
Junio C Hamanoac12f0e2014-09-19 22:32:51946 binary files, outputs two <code>-</code> instead of saying
947 <code>0 0</code>.
Junio C Hamanofbe00522006-10-19 05:58:48948</p>
949</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59950<dt class="hdlist1">
Junio C Hamano7d23f5e2006-12-16 07:44:04951--shortstat
952</dt>
953<dd>
954<p>
Junio C Hamanoac12f0e2014-09-19 22:32:51955 Output only the last line of the <code>--stat</code> format containing total
Junio C Hamano7d23f5e2006-12-16 07:44:04956 number of modified files, as well as number of added and deleted
957 lines.
958</p>
959</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59960<dt class="hdlist1">
Junio C Hamano1c222c52011-05-13 19:55:32961--dirstat[=&lt;param1,param2,&#8230;&gt;]
Junio C Hamano6a45be92008-04-22 08:19:03962</dt>
963<dd>
964<p>
Junio C Hamano1c222c52011-05-13 19:55:32965 Output the distribution of relative amount of changes for each
Junio C Hamanoac12f0e2014-09-19 22:32:51966 sub-directory. The behavior of <code>--dirstat</code> can be customized by
Junio C Hamano1c222c52011-05-13 19:55:32967 passing it a comma separated list of parameters.
Junio C Hamanoac12f0e2014-09-19 22:32:51968 The defaults are controlled by the <code>diff.dirstat</code> configuration
Junio C Hamanoa28a9202012-06-21 07:08:23969 variable (see <a href="git-config.html">git-config(1)</a>).
Junio C Hamano1c222c52011-05-13 19:55:32970 The following parameters are available:
Junio C Hamano6a45be92008-04-22 08:19:03971</p>
Junio C Hamano9629d4f2012-12-19 00:28:27972<div class="openblock">
973<div class="content">
Junio C Hamano1c222c52011-05-13 19:55:32974<div class="dlist"><dl>
975<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:51976<code>changes</code>
Junio C Hamano1c222c52011-05-13 19:55:32977</dt>
978<dd>
979<p>
980 Compute the dirstat numbers by counting the lines that have been
981 removed from the source, or added to the destination. This ignores
982 the amount of pure code movements within a file. In other words,
983 rearranging lines in a file is not counted as much as other changes.
984 This is the default behavior when no parameter is given.
985</p>
Junio C Hamano6a45be92008-04-22 08:19:03986</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59987<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:51988<code>lines</code>
Junio C Hamanoa476efa2008-10-10 15:31:42989</dt>
990<dd>
991<p>
Junio C Hamano1c222c52011-05-13 19:55:32992 Compute the dirstat numbers by doing the regular line-based diff
993 analysis, and summing the removed/added line counts. (For binary
994 files, count 64-byte chunks instead, since binary files have no
Junio C Hamanoac12f0e2014-09-19 22:32:51995 natural concept of lines). This is a more expensive <code>--dirstat</code>
996 behavior than the <code>changes</code> behavior, but it does count rearranged
Junio C Hamano1c222c52011-05-13 19:55:32997 lines within a file as much as other changes. The resulting output
Junio C Hamanoac12f0e2014-09-19 22:32:51998 is consistent with what you get from the other <code>--*stat</code> options.
Junio C Hamanoa476efa2008-10-10 15:31:42999</p>
1000</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591001<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:511002<code>files</code>
Junio C Hamano1c222c52011-05-13 19:55:321003</dt>
1004<dd>
1005<p>
1006 Compute the dirstat numbers by counting the number of files changed.
1007 Each changed file counts equally in the dirstat analysis. This is
Junio C Hamanoac12f0e2014-09-19 22:32:511008 the computationally cheapest <code>--dirstat</code> behavior, since it does
Junio C Hamano1c222c52011-05-13 19:55:321009 not have to look at the file contents at all.
1010</p>
1011</dd>
1012<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:511013<code>cumulative</code>
Junio C Hamano1c222c52011-05-13 19:55:321014</dt>
1015<dd>
1016<p>
1017 Count changes in a child directory for the parent directory as well.
Junio C Hamanoac12f0e2014-09-19 22:32:511018 Note that when using <code>cumulative</code>, the sum of the percentages
Junio C Hamano1c222c52011-05-13 19:55:321019 reported may exceed 100%. The default (non-cumulative) behavior can
Junio C Hamanoac12f0e2014-09-19 22:32:511020 be specified with the <code>noncumulative</code> parameter.
Junio C Hamano1c222c52011-05-13 19:55:321021</p>
1022</dd>
1023<dt class="hdlist1">
1024&lt;limit&gt;
1025</dt>
1026<dd>
1027<p>
1028 An integer parameter specifies a cut-off percent (3% by default).
1029 Directories contributing less than this percentage of the changes
1030 are not shown in the output.
1031</p>
1032</dd>
1033</dl></div>
Junio C Hamano9629d4f2012-12-19 00:28:271034</div></div>
Junio C Hamano1c222c52011-05-13 19:55:321035<div class="paragraph"><p>Example: The following will count changed files, while ignoring
1036directories with less than 10% of the total amount of changed files,
1037and accumulating child directory counts in the parent directories:
Junio C Hamanoac12f0e2014-09-19 22:32:511038<code>--dirstat=files,10,cumulative</code>.</p></div>
Junio C Hamano1c222c52011-05-13 19:55:321039</dd>
1040<dt class="hdlist1">
Junio C Hamano6959c6c2006-05-17 10:34:111041--summary
1042</dt>
1043<dd>
1044<p>
1045 Output a condensed summary of extended header information
1046 such as creations, renames and mode changes.
1047</p>
1048</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591049<dt class="hdlist1">
Junio C Hamanod1308c92006-04-16 11:01:091050--patch-with-stat
1051</dt>
1052<dd>
1053<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511054 Synonym for <code>-p --stat</code>.
Junio C Hamanod1308c92006-04-16 11:01:091055</p>
1056</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591057<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231058-z
1059</dt>
1060<dd>
1061<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511062 When <code>--raw</code>, <code>--numstat</code>, <code>--name-only</code> or <code>--name-status</code> has been
Junio C Hamano0c053e82010-04-19 06:46:341063 given, do not munge pathnames and use NULs as output field terminators.
Junio C Hamano1a4e8412005-12-27 08:17:231064</p>
Junio C Hamano68cf15a2010-11-06 01:01:591065<div class="paragraph"><p>Without this option, each pathname output will have TAB, LF, double quotes,
Junio C Hamanoac12f0e2014-09-19 22:32:511066and backslash characters replaced with <code>\t</code>, <code>\n</code>, <code>\"</code>, and <code>\\</code>,
Junio C Hamano5706e0b2009-11-24 10:54:161067respectively, and the pathname will be enclosed in double quotes if
1068any of those replacements occurred.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231069</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591070<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231071--name-only
1072</dt>
1073<dd>
1074<p>
1075 Show only names of changed files.
1076</p>
1077</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591078<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231079--name-status
1080</dt>
1081<dd>
1082<p>
Junio C Hamanoa9aee782008-04-23 16:09:201083 Show only names and status of changed files. See the description
Junio C Hamanoac12f0e2014-09-19 22:32:511084 of the <code>--diff-filter</code> option on what the status letters mean.
Junio C Hamano1a4e8412005-12-27 08:17:231085</p>
1086</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591087<dt class="hdlist1">
Junio C Hamanoc21ab052009-10-31 04:03:551088--submodule[=&lt;format&gt;]
1089</dt>
1090<dd>
1091<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511092 Specify how differences in submodules are shown. When <code>--submodule</code>
1093 or <code>--submodule=log</code> is given, the <em>log</em> format is used. This format lists
1094 the commits in the range like <a href="git-submodule.html">git-submodule(1)</a> <code>summary</code> does.
1095 Omitting the <code>--submodule</code> option or specifying <code>--submodule=short</code>,
Junio C Hamanoe768cc12012-03-16 05:43:051096 uses the <em>short</em> format. This format just shows the names of the commits
Junio C Hamanob4e58b12012-11-26 03:13:061097 at the beginning and end of the range. Can be tweaked via the
Junio C Hamanoac12f0e2014-09-19 22:32:511098 <code>diff.submodule</code> configuration variable.
Junio C Hamanoc21ab052009-10-31 04:03:551099</p>
1100</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591101<dt class="hdlist1">
Junio C Hamano4aa0bcc2010-03-03 05:13:121102--color[=&lt;when&gt;]
Junio C Hamano9ae1a062006-07-10 08:12:341103</dt>
1104<dd>
1105<p>
1106 Show colored diff.
Junio C Hamanoac12f0e2014-09-19 22:32:511107 <code>--color</code> (i.e. without <em>=&lt;when&gt;</em>) is the same as <code>--color=always</code>.
1108 <em>&lt;when&gt;</em> can be one of <code>always</code>, <code>never</code>, or <code>auto</code>.
Junio C Hamano9ae1a062006-07-10 08:12:341109</p>
1110</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591111<dt class="hdlist1">
Junio C Hamano9ae1a062006-07-10 08:12:341112--no-color
1113</dt>
1114<dd>
1115<p>
Junio C Hamano5f2627d2011-05-06 20:23:481116 Turn off colored diff.
Junio C Hamanoac12f0e2014-09-19 22:32:511117 It is the same as <code>--color=never</code>.
Junio C Hamano9ae1a062006-07-10 08:12:341118</p>
1119</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591120<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531121--word-diff[=&lt;mode&gt;]
Junio C Hamano85e45fa2006-08-13 07:47:411122</dt>
1123<dd>
1124<p>
Junio C Hamanocc7636a2010-05-21 14:57:531125 Show a word diff, using the &lt;mode&gt; to delimit changed words.
1126 By default, words are delimited by whitespace; see
Junio C Hamanoac12f0e2014-09-19 22:32:511127 <code>--word-diff-regex</code> below. The &lt;mode&gt; defaults to <em>plain</em>, and
Junio C Hamanocc7636a2010-05-21 14:57:531128 must be one of:
Junio C Hamano85e45fa2006-08-13 07:47:411129</p>
Junio C Hamano9629d4f2012-12-19 00:28:271130<div class="openblock">
1131<div class="content">
Junio C Hamano68cf15a2010-11-06 01:01:591132<div class="dlist"><dl>
1133<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531134color
1135</dt>
1136<dd>
1137<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511138 Highlight changed words using only colors. Implies <code>--color</code>.
Junio C Hamanocc7636a2010-05-21 14:57:531139</p>
1140</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591141<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531142plain
1143</dt>
1144<dd>
1145<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511146 Show words as <code>[-removed-]</code> and <code>{+added+}</code>. Makes no
Junio C Hamanocc7636a2010-05-21 14:57:531147 attempts to escape the delimiters if they appear in the input,
1148 so the output may be ambiguous.
1149</p>
1150</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591151<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531152porcelain
1153</dt>
1154<dd>
1155<p>
1156 Use a special line-based format intended for script
1157 consumption. Added/removed/unchanged runs are printed in the
Junio C Hamanoac12f0e2014-09-19 22:32:511158 usual unified diff format, starting with a <code>+</code>/<code>-</code>/` `
Junio C Hamanocc7636a2010-05-21 14:57:531159 character at the beginning of the line and extending to the
1160 end of the line. Newlines in the input are represented by a
Junio C Hamanoac12f0e2014-09-19 22:32:511161 tilde <code>~</code> on a line of its own.
Junio C Hamanocc7636a2010-05-21 14:57:531162</p>
1163</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591164<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531165none
1166</dt>
1167<dd>
1168<p>
1169 Disable word diff again.
1170</p>
1171</dd>
1172</dl></div>
Junio C Hamano9629d4f2012-12-19 00:28:271173</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591174<div class="paragraph"><p>Note that despite the name of the first mode, color is used to
Junio C Hamanocc7636a2010-05-21 14:57:531175highlight the changed parts in all modes if enabled.</p></div>
1176</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591177<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531178--word-diff-regex=&lt;regex&gt;
1179</dt>
1180<dd>
1181<p>
1182 Use &lt;regex&gt; to decide what a word is, instead of considering
1183 runs of non-whitespace to be a word. Also implies
Junio C Hamanoac12f0e2014-09-19 22:32:511184 <code>--word-diff</code> unless it was already enabled.
Junio C Hamanocc7636a2010-05-21 14:57:531185</p>
Junio C Hamano68cf15a2010-11-06 01:01:591186<div class="paragraph"><p>Every non-overlapping match of the
Junio C Hamano20d47e32009-01-26 06:36:021187&lt;regex&gt; is considered a word. Anything between these matches is
1188considered whitespace and ignored(!) for the purposes of finding
Junio C Hamanoac12f0e2014-09-19 22:32:511189differences. You may want to append <code>|[^[:space:]]</code> to your regular
Junio C Hamano20d47e32009-01-26 06:36:021190expression to make sure that it matches all non-whitespace characters.
1191A match that contains a newline is silently truncated(!) at the
1192newline.</p></div>
Junio C Hamano713eded2015-12-03 00:24:021193<div class="paragraph"><p>For example, <code>--word-diff-regex=.</code> will treat each character as a word
1194and, correspondingly, show differences character by character.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591195<div class="paragraph"><p>The regex can also be set via a diff driver or configuration option, see
Junio C Hamano198b1f12016-05-17 22:27:241196<a href="gitattributes.html">gitattributes(5)</a> or <a href="git-config.html">git-config(1)</a>. Giving it explicitly
Junio C Hamano20d47e32009-01-26 06:36:021197overrides any diff driver or configuration setting. Diff drivers
1198override configuration settings.</p></div>
Junio C Hamano85e45fa2006-08-13 07:47:411199</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591200<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531201--color-words[=&lt;regex&gt;]
1202</dt>
1203<dd>
1204<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511205 Equivalent to <code>--word-diff=color</code> plus (if a regex was
1206 specified) <code>--word-diff-regex=&lt;regex&gt;</code>.
Junio C Hamanocc7636a2010-05-21 14:57:531207</p>
1208</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591209<dt class="hdlist1">
Junio C Hamano9ae1a062006-07-10 08:12:341210--no-renames
1211</dt>
1212<dd>
1213<p>
1214 Turn off rename detection, even when the configuration
1215 file gives the default to do so.
1216</p>
1217</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591218<dt class="hdlist1">
Junio C Hamanoa890c4f2007-01-28 10:29:211219--check
1220</dt>
1221<dd>
1222<p>
Junio C Hamano84ea1e42016-04-08 21:53:481223 Warn if changes introduce conflict markers or whitespace errors.
1224 What are considered whitespace errors is controlled by <code>core.whitespace</code>
Junio C Hamano6005bfa2011-06-23 00:51:221225 configuration. By default, trailing whitespaces (including
1226 lines that solely consist of whitespaces) and a space character
1227 that is immediately followed by a tab character inside the
1228 initial indent of the line are considered whitespace errors.
1229 Exits with non-zero status if problems are found. Not compatible
1230 with --exit-code.
Junio C Hamanoa890c4f2007-01-28 10:29:211231</p>
1232</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591233<dt class="hdlist1">
Junio C Hamano8c5d5942015-06-11 19:37:481234--ws-error-highlight=&lt;kind&gt;
1235</dt>
1236<dd>
1237<p>
1238 Highlight whitespace errors on lines specified by &lt;kind&gt;
1239 in the color specified by <code>color.diff.whitespace</code>. &lt;kind&gt;
1240 is a comma separated list of <code>old</code>, <code>new</code>, <code>context</code>. When
1241 this option is not given, only whitespace errors in <code>new</code>
1242 lines are highlighted. E.g. <code>--ws-error-highlight=new,old</code>
1243 highlights whitespace errors on both deleted and added lines.
1244 <code>all</code> can be used as a short-hand for <code>old,new,context</code>.
1245</p>
1246</dd>
1247<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231248--full-index
1249</dt>
1250<dd>
1251<p>
Junio C Hamano5cf43ca2008-08-20 09:14:141252 Instead of the first handful of characters, show the full
1253 pre- and post-image blob object names on the "index"
1254 line when generating patch format output.
Junio C Hamano1a4e8412005-12-27 08:17:231255</p>
1256</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591257<dt class="hdlist1">
Junio C Hamano9ae1a062006-07-10 08:12:341258--binary
1259</dt>
1260<dd>
1261<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511262 In addition to <code>--full-index</code>, output a binary diff that
1263 can be applied with <code>git-apply</code>.
Junio C Hamano9ae1a062006-07-10 08:12:341264</p>
1265</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591266<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231267--abbrev[=&lt;n&gt;]
1268</dt>
1269<dd>
1270<p>
1271 Instead of showing the full 40-byte hexadecimal object
1272 name in diff-raw format output and diff-tree header
Junio C Hamano6efe3022009-01-13 16:47:561273 lines, show only a partial prefix. This is
Junio C Hamanoac12f0e2014-09-19 22:32:511274 independent of the <code>--full-index</code> option above, which controls
Junio C Hamano1a4e8412005-12-27 08:17:231275 the diff-patch output format. Non default number of
Junio C Hamanoac12f0e2014-09-19 22:32:511276 digits can be specified with <code>--abbrev=&lt;n&gt;</code>.
Junio C Hamano1a4e8412005-12-27 08:17:231277</p>
1278</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591279<dt class="hdlist1">
Junio C Hamanoe85e36f2010-08-10 05:30:141280-B[&lt;n&gt;][/&lt;m&gt;]
Junio C Hamano1a4e8412005-12-27 08:17:231281</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591282<dt class="hdlist1">
Junio C Hamano39c7a692010-10-27 06:08:541283--break-rewrites[=[&lt;n&gt;][/&lt;m&gt;]]
1284</dt>
Junio C Hamano1a4e8412005-12-27 08:17:231285<dd>
1286<p>
Junio C Hamanoe85e36f2010-08-10 05:30:141287 Break complete rewrite changes into pairs of delete and
1288 create. This serves two purposes:
Junio C Hamano1a4e8412005-12-27 08:17:231289</p>
Junio C Hamano68cf15a2010-11-06 01:01:591290<div class="paragraph"><p>It affects the way a change that amounts to a total rewrite of a file
Junio C Hamanoe85e36f2010-08-10 05:30:141291not as a series of deletion and insertion mixed together with a very
1292few lines that happen to match textually as the context, but as a
1293single deletion of everything old followed by a single insertion of
Junio C Hamanoac12f0e2014-09-19 22:32:511294everything new, and the number <code>m</code> controls this aspect of the -B
1295option (defaults to 60%). <code>-B/70%</code> specifies that less than 30% of the
Junio C Hamano076ffcc2013-02-06 05:13:211296original should remain in the result for Git to consider it a total
Junio C Hamanoe85e36f2010-08-10 05:30:141297rewrite (i.e. otherwise the resulting patch will be a series of
1298deletion and insertion mixed together with context lines).</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591299<div class="paragraph"><p>When used with -M, a totally-rewritten file is also considered as the
Junio C Hamanoe85e36f2010-08-10 05:30:141300source of a rename (usually -M only considers a file that disappeared
Junio C Hamanoac12f0e2014-09-19 22:32:511301as the source of a rename), and the number <code>n</code> controls this aspect of
1302the -B option (defaults to 50%). <code>-B20%</code> specifies that a change with
Junio C Hamano68cf15a2010-11-06 01:01:591303addition and deletion compared to 20% or more of the file&#8217;s size are
Junio C Hamanoe85e36f2010-08-10 05:30:141304eligible for being picked up as a possible source of a rename to
1305another file.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231306</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591307<dt class="hdlist1">
Junio C Hamanoe85e36f2010-08-10 05:30:141308-M[&lt;n&gt;]
Junio C Hamano1a4e8412005-12-27 08:17:231309</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591310<dt class="hdlist1">
Junio C Hamano0d75e872010-12-17 06:57:261311--find-renames[=&lt;n&gt;]
Junio C Hamano39c7a692010-10-27 06:08:541312</dt>
Junio C Hamano1a4e8412005-12-27 08:17:231313<dd>
1314<p>
1315 Detect renames.
Junio C Hamanoac12f0e2014-09-19 22:32:511316 If <code>n</code> is specified, it is a threshold on the similarity
Junio C Hamanoe85e36f2010-08-10 05:30:141317 index (i.e. amount of addition/deletions compared to the
Junio C Hamanoac12f0e2014-09-19 22:32:511318 file&#8217;s size). For example, <code>-M90%</code> means Git should consider a
Junio C Hamanoe85e36f2010-08-10 05:30:141319 delete/add pair to be a rename if more than 90% of the file
Junio C Hamanoac12f0e2014-09-19 22:32:511320 hasn&#8217;t changed. Without a <code>%</code> sign, the number is to be read as
1321 a fraction, with a decimal point before it. I.e., <code>-M5</code> becomes
1322 0.5, and is thus the same as <code>-M50%</code>. Similarly, <code>-M05</code> is
1323 the same as <code>-M5%</code>. To limit detection to exact renames, use
1324 <code>-M100%</code>. The default similarity index is 50%.
Junio C Hamano1a4e8412005-12-27 08:17:231325</p>
1326</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591327<dt class="hdlist1">
Junio C Hamanoe85e36f2010-08-10 05:30:141328-C[&lt;n&gt;]
Junio C Hamano1a4e8412005-12-27 08:17:231329</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591330<dt class="hdlist1">
Junio C Hamano0d75e872010-12-17 06:57:261331--find-copies[=&lt;n&gt;]
Junio C Hamano39c7a692010-10-27 06:08:541332</dt>
Junio C Hamano1a4e8412005-12-27 08:17:231333<dd>
1334<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511335 Detect copies as well as renames. See also <code>--find-copies-harder</code>.
1336 If <code>n</code> is specified, it has the same meaning as for <code>-M&lt;n&gt;</code>.
Junio C Hamano1a4e8412005-12-27 08:17:231337</p>
1338</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591339<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231340--find-copies-harder
1341</dt>
1342<dd>
1343<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511344 For performance reasons, by default, <code>-C</code> option finds copies only
Junio C Hamano1a4e8412005-12-27 08:17:231345 if the original file of the copy was modified in the same
1346 changeset. This flag makes the command
1347 inspect unmodified files as candidates for the source of
1348 copy. This is a very expensive operation for large
Junio C Hamano16f98872007-06-12 16:09:141349 projects, so use it with caution. Giving more than one
Junio C Hamanoac12f0e2014-09-19 22:32:511350 <code>-C</code> option has the same effect.
Junio C Hamano1a4e8412005-12-27 08:17:231351</p>
1352</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591353<dt class="hdlist1">
Junio C Hamanob02377c2011-04-28 22:26:021354-D
1355</dt>
1356<dt class="hdlist1">
1357--irreversible-delete
1358</dt>
1359<dd>
1360<p>
1361 Omit the preimage for deletes, i.e. print only the header but not
Junio C Hamanoac12f0e2014-09-19 22:32:511362 the diff between the preimage and <code>/dev/null</code>. The resulting patch
1363 is not meant to be applied with <code>patch</code> or <code>git apply</code>; this is
Junio C Hamanob02377c2011-04-28 22:26:021364 solely for people who want to just concentrate on reviewing the
1365 text after the change. In addition, the output obviously lack
1366 enough information to apply such a patch in reverse, even manually,
1367 hence the name of the option.
1368</p>
Junio C Hamanoac12f0e2014-09-19 22:32:511369<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:021370of a delete/create pair.</p></div>
1371</dd>
1372<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231373-l&lt;num&gt;
1374</dt>
1375<dd>
1376<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511377 The <code>-M</code> and <code>-C</code> options require O(n^2) processing time where n
Junio C Hamano1a4e8412005-12-27 08:17:231378 is the number of potential rename/copy targets. This
1379 option prevents rename/copy detection from running if
1380 the number of rename/copy targets exceeds the specified
1381 number.
1382</p>
1383</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591384<dt class="hdlist1">
Junio C Hamano982eb112010-11-18 00:53:091385--diff-filter=[(A|C|D|M|R|T|U|X|B)&#8230;[*]]
1386</dt>
1387<dd>
1388<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511389 Select only files that are Added (<code>A</code>), Copied (<code>C</code>),
1390 Deleted (<code>D</code>), Modified (<code>M</code>), Renamed (<code>R</code>), have their
1391 type (i.e. regular file, symlink, submodule, &#8230;) changed (<code>T</code>),
1392 are Unmerged (<code>U</code>), are
1393 Unknown (<code>X</code>), or have had their pairing Broken (<code>B</code>).
Junio C Hamano982eb112010-11-18 00:53:091394 Any combination of the filter characters (including none) can be used.
Junio C Hamanoac12f0e2014-09-19 22:32:511395 When <code>*</code> (All-or-none) is added to the combination, all
Junio C Hamano982eb112010-11-18 00:53:091396 paths are selected if there is any file that matches
1397 other criteria in the comparison; if there is no file
1398 that matches other criteria, nothing is selected.
1399</p>
1400</dd>
1401<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231402-S&lt;string&gt;
1403</dt>
1404<dd>
1405<p>
Junio C Hamanof1f5a7b2013-06-11 22:23:521406 Look for differences that change the number of occurrences of
1407 the specified string (i.e. addition/deletion) in a file.
1408 Intended for the scripter&#8217;s use.
Junio C Hamano1a4e8412005-12-27 08:17:231409</p>
Junio C Hamanof1f5a7b2013-06-11 22:23:521410<div class="paragraph"><p>It is useful when you&#8217;re looking for an exact block of code (like a
1411struct), and want to know the history of that block since it first
1412came into being: use the feature iteratively to feed the interesting
Junio C Hamanoac12f0e2014-09-19 22:32:511413block in the preimage back into <code>-S</code>, and keep going until you get the
Junio C Hamanof1f5a7b2013-06-11 22:23:521414very first version of the block.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231415</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591416<dt class="hdlist1">
Junio C Hamano3b4609d2010-09-30 00:04:341417-G&lt;regex&gt;
1418</dt>
1419<dd>
1420<p>
Junio C Hamanof1f5a7b2013-06-11 22:23:521421 Look for differences whose patch text contains added/removed
1422 lines that match &lt;regex&gt;.
Junio C Hamano3b4609d2010-09-30 00:04:341423</p>
Junio C Hamanoac12f0e2014-09-19 22:32:511424<div class="paragraph"><p>To illustrate the difference between <code>-S&lt;regex&gt; --pickaxe-regex</code> and
1425<code>-G&lt;regex&gt;</code>, consider a commit with the following diff in the same
Junio C Hamanof1f5a7b2013-06-11 22:23:521426file:</p></div>
1427<div class="listingblock">
1428<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:511429<pre><code>+ return !regexec(regexp, two-&gt;ptr, 1, &amp;regmatch, 0);
Junio C Hamanof1f5a7b2013-06-11 22:23:521430...
Junio C Hamanoac12f0e2014-09-19 22:32:511431- hit = !regexec(regexp, mf2.ptr, 1, &amp;regmatch, 0);</code></pre>
Junio C Hamanof1f5a7b2013-06-11 22:23:521432</div></div>
Junio C Hamanoac12f0e2014-09-19 22:32:511433<div class="paragraph"><p>While <code>git log -G"regexec\(regexp"</code> will show this commit, <code>git log
1434-S"regexec\(regexp" --pickaxe-regex</code> will not (because the number of
Junio C Hamanof1f5a7b2013-06-11 22:23:521435occurrences of that string did not change).</p></div>
1436<div class="paragraph"><p>See the <em>pickaxe</em> entry in <a href="gitdiffcore.html">gitdiffcore(7)</a> for more
1437information.</p></div>
Junio C Hamano3b4609d2010-09-30 00:04:341438</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591439<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231440--pickaxe-all
1441</dt>
1442<dd>
1443<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511444 When <code>-S</code> or <code>-G</code> finds a change, show all the changes in that
Junio C Hamano1a4e8412005-12-27 08:17:231445 changeset, not just the files that contain the change
1446 in &lt;string&gt;.
1447</p>
1448</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591449<dt class="hdlist1">
Junio C Hamanobfe9e752006-04-05 21:43:281450--pickaxe-regex
1451</dt>
1452<dd>
1453<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511454 Treat the &lt;string&gt; given to <code>-S</code> as an extended POSIX regular
Junio C Hamanof1f5a7b2013-06-11 22:23:521455 expression to match.
Junio C Hamanobfe9e752006-04-05 21:43:281456</p>
1457</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591458<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231459-O&lt;orderfile&gt;
1460</dt>
1461<dd>
1462<p>
1463 Output the patch in the order specified in the
1464 &lt;orderfile&gt;, which has one shell glob pattern per line.
Junio C Hamano322c6242015-03-23 21:32:461465 This overrides the <code>diff.orderFile</code> configuration variable
1466 (see <a href="git-config.html">git-config(1)</a>). To cancel <code>diff.orderFile</code>,
Junio C Hamanoac12f0e2014-09-19 22:32:511467 use <code>-O/dev/null</code>.
Junio C Hamano1a4e8412005-12-27 08:17:231468</p>
1469</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591470<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231471-R
1472</dt>
1473<dd>
1474<p>
1475 Swap two inputs; that is, show differences from index or
1476 on-disk file to tree contents.
1477</p>
1478</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591479<dt class="hdlist1">
Junio C Hamano24bc09a2008-02-28 00:27:441480--relative[=&lt;path&gt;]
1481</dt>
1482<dd>
1483<p>
1484 When run from a subdirectory of the project, it can be
1485 told to exclude changes outside the directory and show
1486 pathnames relative to it with this option. When you are
1487 not in a subdirectory (e.g. in a bare repository), you
1488 can name which subdirectory to make the output relative
1489 to by giving a &lt;path&gt; as an argument.
1490</p>
1491</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591492<dt class="hdlist1">
Junio C Hamanobbbb8652008-12-29 10:34:221493-a
1494</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591495<dt class="hdlist1">
Junio C Hamanoc26f5482006-07-09 09:38:141496--text
1497</dt>
1498<dd>
1499<p>
1500 Treat all files as text.
1501</p>
1502</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591503<dt class="hdlist1">
Junio C Hamanofd468962007-02-14 23:45:041504--ignore-space-at-eol
1505</dt>
1506<dd>
1507<p>
Junio C Hamano3a702342007-12-12 21:34:021508 Ignore changes in whitespace at EOL.
Junio C Hamanofd468962007-02-14 23:45:041509</p>
1510</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591511<dt class="hdlist1">
Junio C Hamanobbbb8652008-12-29 10:34:221512-b
1513</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591514<dt class="hdlist1">
Junio C Hamanod9c2d2f2006-12-06 08:59:071515--ignore-space-change
1516</dt>
1517<dd>
1518<p>
Junio C Hamano3a702342007-12-12 21:34:021519 Ignore changes in amount of whitespace. This ignores whitespace
1520 at line end, and considers all other sequences of one or
1521 more whitespace characters to be equivalent.
Junio C Hamanod9c2d2f2006-12-06 08:59:071522</p>
1523</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591524<dt class="hdlist1">
Junio C Hamanobbbb8652008-12-29 10:34:221525-w
Junio C Hamanod9c2d2f2006-12-06 08:59:071526</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591527<dt class="hdlist1">
Junio C Hamanod9c2d2f2006-12-06 08:59:071528--ignore-all-space
1529</dt>
1530<dd>
1531<p>
Junio C Hamano3a702342007-12-12 21:34:021532 Ignore whitespace when comparing lines. This ignores
1533 differences even if one line has whitespace where the other
Junio C Hamanod9c2d2f2006-12-06 08:59:071534 line has none.
1535</p>
1536</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591537<dt class="hdlist1">
Junio C Hamanoa1952302013-07-01 21:31:181538--ignore-blank-lines
1539</dt>
1540<dd>
1541<p>
1542 Ignore changes whose lines are all blank.
1543</p>
1544</dd>
1545<dt class="hdlist1">
Junio C Hamano1d40ee82009-01-07 10:14:161546--inter-hunk-context=&lt;lines&gt;
1547</dt>
1548<dd>
1549<p>
1550 Show the context between diff hunks, up to the specified number
1551 of lines, thereby fusing hunks that are close to each other.
1552</p>
1553</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591554<dt class="hdlist1">
Junio C Hamano11821ed2011-10-19 18:42:091555-W
1556</dt>
1557<dt class="hdlist1">
1558--function-context
1559</dt>
1560<dd>
1561<p>
1562 Show whole surrounding functions of changes.
1563</p>
1564</dd>
1565<dt class="hdlist1">
Junio C Hamano48fd2f62007-03-19 02:02:301566--exit-code
1567</dt>
1568<dd>
1569<p>
1570 Make the program exit with codes similar to diff(1).
1571 That is, it exits with 1 if there were differences and
1572 0 means no differences.
1573</p>
1574</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591575<dt class="hdlist1">
Junio C Hamano35e57552007-03-25 07:54:351576--quiet
1577</dt>
1578<dd>
1579<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511580 Disable all output of the program. Implies <code>--exit-code</code>.
Junio C Hamano35e57552007-03-25 07:54:351581</p>
1582</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591583<dt class="hdlist1">
Junio C Hamanobb0f4042007-07-04 06:41:401584--ext-diff
1585</dt>
1586<dd>
1587<p>
1588 Allow an external diff helper to be executed. If you set an
Junio C Hamanoa28a9202012-06-21 07:08:231589 external diff driver with <a href="gitattributes.html">gitattributes(5)</a>, you need
1590 to use this option with <a href="git-log.html">git-log(1)</a> and friends.
Junio C Hamanobb0f4042007-07-04 06:41:401591</p>
1592</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591593<dt class="hdlist1">
Junio C Hamanobb0f4042007-07-04 06:41:401594--no-ext-diff
1595</dt>
1596<dd>
1597<p>
1598 Disallow external diff drivers.
1599</p>
1600</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591601<dt class="hdlist1">
Junio C Hamanoc652aed2011-07-07 01:14:311602--textconv
1603</dt>
1604<dt class="hdlist1">
1605--no-textconv
1606</dt>
1607<dd>
1608<p>
1609 Allow (or disallow) external text conversion filters to be run
Junio C Hamanoa28a9202012-06-21 07:08:231610 when comparing binary files. See <a href="gitattributes.html">gitattributes(5)</a> for
Junio C Hamanoc652aed2011-07-07 01:14:311611 details. Because textconv filters are typically a one-way
1612 conversion, the resulting diff is suitable for human
1613 consumption, but cannot be applied. For this reason, textconv
Junio C Hamanoa28a9202012-06-21 07:08:231614 filters are enabled by default only for <a href="git-diff.html">git-diff(1)</a> and
1615 <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:311616 diff plumbing commands.
1617</p>
1618</dd>
1619<dt class="hdlist1">
Junio C Hamano7d449522010-07-01 00:08:511620--ignore-submodules[=&lt;when&gt;]
Junio C Hamanodfccbb02008-05-26 01:16:141621</dt>
1622<dd>
1623<p>
Junio C Hamano7d449522010-07-01 00:08:511624 Ignore changes to submodules in the diff generation. &lt;when&gt; can be
Junio C Hamanoc7102962013-05-29 23:57:171625 either "none", "untracked", "dirty" or "all", which is the default.
Junio C Hamano619596a2010-08-18 22:15:351626 Using "none" will consider the submodule modified when it either contains
1627 untracked or modified files or its HEAD differs from the commit recorded
1628 in the superproject and can be used to override any settings of the
Junio C Hamanoa28a9202012-06-21 07:08:231629 <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 Hamano7d449522010-07-01 00:08:511630 "untracked" is used submodules are not considered dirty when they only
1631 contain untracked content (but they are still scanned for modified
1632 content). Using "dirty" ignores all changes to the work tree of submodules,
1633 only changes to the commits stored in the superproject are shown (this was
1634 the behavior until 1.7.0). Using "all" hides all changes to submodules.
Junio C Hamanodfccbb02008-05-26 01:16:141635</p>
1636</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591637<dt class="hdlist1">
Junio C Hamanoe27cbd22007-12-21 17:57:331638--src-prefix=&lt;prefix&gt;
1639</dt>
1640<dd>
1641<p>
1642 Show the given source prefix instead of "a/".
1643</p>
1644</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591645<dt class="hdlist1">
Junio C Hamanoe27cbd22007-12-21 17:57:331646--dst-prefix=&lt;prefix&gt;
1647</dt>
1648<dd>
1649<p>
1650 Show the given destination prefix instead of "b/".
1651</p>
1652</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591653<dt class="hdlist1">
Junio C Hamanoe27cbd22007-12-21 17:57:331654--no-prefix
1655</dt>
1656<dd>
1657<p>
1658 Do not show any source or destination prefix.
1659</p>
1660</dd>
Junio C Hamanoba4b9282008-07-06 05:20:311661</dl></div>
Junio C Hamano68cf15a2010-11-06 01:01:591662<div class="paragraph"><p>For more detailed explanation on these common options, see also
Junio C Hamanoa28a9202012-06-21 07:08:231663<a href="gitdiffcore.html">gitdiffcore(7)</a>.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591664<div class="dlist"><dl>
1665<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231666&lt;tree-ish&gt;
1667</dt>
1668<dd>
1669<p>
1670 The id of a tree object.
1671</p>
1672</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591673<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231674&lt;path&gt;&#8230;
1675</dt>
1676<dd>
1677<p>
1678 If provided, the results are limited to a subset of files
1679 matching one of these prefix strings.
Junio C Hamanoac12f0e2014-09-19 22:32:511680 i.e., file matches <code>/^&lt;pattern1&gt;|&lt;pattern2&gt;|.../</code>
Junio C Hamano1a4e8412005-12-27 08:17:231681 Note that this parameter does not provide any wildcard or regexp
1682 features.
1683</p>
1684</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591685<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231686-r
1687</dt>
1688<dd>
1689<p>
1690 recurse into sub-trees
1691</p>
1692</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591693<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231694-t
1695</dt>
1696<dd>
1697<p>
1698 show tree entry itself as well as subtrees. Implies -r.
1699</p>
1700</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591701<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231702--root
1703</dt>
1704<dd>
1705<p>
Junio C Hamano54bf1e22008-12-20 06:30:111706 When <em>--root</em> is specified the initial commit will be shown as a big
Junio C Hamano1a4e8412005-12-27 08:17:231707 creation event. This is equivalent to a diff against the NULL tree.
1708</p>
1709</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591710<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231711--stdin
1712</dt>
1713<dd>
1714<p>
1715 When <em>--stdin</em> is specified, the command does not take
1716 &lt;tree-ish&gt; arguments from the command line. Instead, it
Junio C Hamano3f2f6e52008-08-21 10:34:221717 reads lines containing either two &lt;tree&gt;, one &lt;commit&gt;, or a
1718 list of &lt;commit&gt; from its standard input. (Use a single space
1719 as separator.)
Junio C Hamano1a4e8412005-12-27 08:17:231720</p>
Junio C Hamano68cf15a2010-11-06 01:01:591721<div class="paragraph"><p>When two trees are given, it compares the first tree with the second.
Junio C Hamano3f2f6e52008-08-21 10:34:221722When a single commit is given, it compares the commit with its
1723parents. The remaining commits, when given, are used as if they are
Junio C Hamanob53db3c2008-08-07 00:17:521724parents of the first commit.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591725<div class="paragraph"><p>When comparing two trees, the ID of both trees (separated by a space
Junio C Hamano3f2f6e52008-08-21 10:34:221726and terminated by a newline) is printed before the difference. When
1727comparing commits, the ID of the first (or only) commit, followed by a
1728newline, is printed.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591729<div class="paragraph"><p>The following flags further affect the behavior when comparing
Junio C Hamano3f2f6e52008-08-21 10:34:221730commits (but not trees).</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231731</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591732<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231733-m
1734</dt>
1735<dd>
1736<p>
Junio C Hamano1aa40d22010-01-21 17:46:431737 By default, <em>git diff-tree --stdin</em> does not show
Junio C Hamano1a4e8412005-12-27 08:17:231738 differences for merge commits. With this flag, it shows
Junio C Hamanoa8adb1e2006-04-10 23:46:161739 differences to that commit from all of its parents. See
1740 also <em>-c</em>.
Junio C Hamano1a4e8412005-12-27 08:17:231741</p>
1742</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591743<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231744-s
1745</dt>
1746<dd>
1747<p>
Junio C Hamano1aa40d22010-01-21 17:46:431748 By default, <em>git diff-tree --stdin</em> shows differences,
Junio C Hamano1a4e8412005-12-27 08:17:231749 either in machine-readable form (without <em>-p</em>) or in patch
Junio C Hamano235a91e2006-01-07 01:13:581750 form (with <em>-p</em>). This output can be suppressed. It is
Junio C Hamano1a4e8412005-12-27 08:17:231751 only useful with <em>-v</em> flag.
1752</p>
1753</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591754<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231755-v
1756</dt>
1757<dd>
1758<p>
Junio C Hamano1aa40d22010-01-21 17:46:431759 This flag causes <em>git diff-tree --stdin</em> to also show
Junio C Hamano1a4e8412005-12-27 08:17:231760 the commit message before the differences.
1761</p>
1762</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591763<dt class="hdlist1">
Junio C Hamanod2179ef2010-10-22 04:12:171764--pretty[=&lt;format&gt;]
Junio C Hamano1a4e8412005-12-27 08:17:231765</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591766<dt class="hdlist1">
Junio C Hamanod2179ef2010-10-22 04:12:171767--format=&lt;format&gt;
Junio C Hamano0a235222009-03-06 08:21:091768</dt>
Junio C Hamano1a4e8412005-12-27 08:17:231769<dd>
1770<p>
Junio C Hamanoa3770f92007-07-25 08:53:331771 Pretty-print the contents of the commit logs in a given format,
Junio C Hamano0430e3a2007-05-15 03:13:171772 where <em>&lt;format&gt;</em> can be one of <em>oneline</em>, <em>short</em>, <em>medium</em>,
Junio C Hamano6bb32e62015-02-17 22:11:261773 <em>full</em>, <em>fuller</em>, <em>email</em>, <em>raw</em>, <em>format:&lt;string&gt;</em>
1774 and <em>tformat:&lt;string&gt;</em>. When <em>&lt;format&gt;</em> is none of the above,
1775 and has <em>%placeholder</em> in it, it acts as if
1776 <em>--pretty=tformat:&lt;format&gt;</em> were given.
Junio C Hamano1a4e8412005-12-27 08:17:231777</p>
Junio C Hamano6bb32e62015-02-17 22:11:261778<div class="paragraph"><p>See the "PRETTY FORMATS" section for some additional details for each
1779format. When <em>=&lt;format&gt;</em> part is omitted, it defaults to <em>medium</em>.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591780<div class="paragraph"><p>Note: you can specify the default pretty format in the repository
Junio C Hamanoa28a9202012-06-21 07:08:231781configuration (see <a href="git-config.html">git-config(1)</a>).</p></div>
Junio C Hamano0430e3a2007-05-15 03:13:171782</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591783<dt class="hdlist1">
Junio C Hamanoee695f22007-06-21 00:35:361784--abbrev-commit
1785</dt>
1786<dd>
1787<p>
1788 Instead of showing the full 40-byte hexadecimal commit object
Junio C Hamano6efe3022009-01-13 16:47:561789 name, show only a partial prefix. Non default number of
Junio C Hamanoee695f22007-06-21 00:35:361790 digits can be specified with "--abbrev=&lt;n&gt;" (which also modifies
1791 diff output, if it is displayed).
1792</p>
Junio C Hamano68cf15a2010-11-06 01:01:591793<div class="paragraph"><p>This should make "--pretty=oneline" a whole lot more readable for
Junio C Hamanoba4b9282008-07-06 05:20:311794people using 80-column terminals.</p></div>
Junio C Hamanoee695f22007-06-21 00:35:361795</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591796<dt class="hdlist1">
Junio C Hamanof93530e2011-05-25 23:59:591797--no-abbrev-commit
1798</dt>
1799<dd>
1800<p>
1801 Show the full 40-byte hexadecimal commit object name. This negates
Junio C Hamanoac12f0e2014-09-19 22:32:511802 <code>--abbrev-commit</code> and those options which imply it such as
Junio C Hamanof93530e2011-05-25 23:59:591803 "--oneline". It also overrides the <em>log.abbrevCommit</em> variable.
1804</p>
1805</dd>
1806<dt class="hdlist1">
Junio C Hamano0a235222009-03-06 08:21:091807--oneline
1808</dt>
1809<dd>
1810<p>
1811 This is a shorthand for "--pretty=oneline --abbrev-commit"
1812 used together.
1813</p>
1814</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591815<dt class="hdlist1">
Junio C Hamanoc5bb3b32013-08-05 22:43:361816--encoding=&lt;encoding&gt;
Junio C Hamano0430e3a2007-05-15 03:13:171817</dt>
1818<dd>
1819<p>
1820 The commit objects record the encoding used for the log message
1821 in their encoding header; this option can be used to tell the
1822 command to re-code the commit log message in the encoding
1823 preferred by the user. For non plumbing commands this
Junio C Hamano823eebb2015-07-10 22:29:341824 defaults to UTF-8. Note that if an object claims to be encoded
1825 in <code>X</code> and we are outputting in <code>X</code>, we will output the object
1826 verbatim; this means that invalid sequences in the original
1827 commit may be copied to the output.
Junio C Hamano0430e3a2007-05-15 03:13:171828</p>
1829</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591830<dt class="hdlist1">
Junio C Hamano5996b672016-04-13 22:01:411831--expand-tabs=&lt;n&gt;
1832</dt>
1833<dt class="hdlist1">
1834--expand-tabs
1835</dt>
1836<dt class="hdlist1">
1837--no-expand-tabs
1838</dt>
1839<dd>
1840<p>
1841 Perform a tab expansion (replace each tab with enough spaces
1842 to fill to the next display column that is multiple of <em>&lt;n&gt;</em>)
1843 in the log message before showing it in the output.
1844 <code>--expand-tabs</code> is a short-hand for <code>--expand-tabs=8</code>, and
1845 <code>--no-expand-tabs</code> is a short-hand for <code>--expand-tabs=0</code>,
1846 which disables tab expansion.
1847</p>
1848<div class="paragraph"><p>By default, tabs are expanded in pretty formats that indent the log
1849message by 4 spaces (i.e. <em>medium</em>, which is the default, <em>full</em>,
1850and <em>fuller</em>).</p></div>
1851</dd>
1852<dt class="hdlist1">
Junio C Hamano4e6ba272016-01-20 23:23:191853--notes[=&lt;treeish&gt;]
Junio C Hamano57827fb2010-01-23 03:02:501854</dt>
1855<dd>
1856<p>
Junio C Hamanoa28a9202012-06-21 07:08:231857 Show the notes (see <a href="git-notes.html">git-notes(1)</a>) that annotate the
Junio C Hamano57827fb2010-01-23 03:02:501858 commit, when showing the commit log message. This is the default
Junio C Hamanoac12f0e2014-09-19 22:32:511859 for <code>git log</code>, <code>git show</code> and <code>git whatchanged</code> commands when
1860 there is no <code>--pretty</code>, <code>--format</code>, or <code>--oneline</code> option given
Junio C Hamano60033462011-05-03 00:48:431861 on the command line.
Junio C Hamano57827fb2010-01-23 03:02:501862</p>
Junio C Hamano60033462011-05-03 00:48:431863<div class="paragraph"><p>By default, the notes shown are from the notes refs listed in the
1864<em>core.notesRef</em> and <em>notes.displayRef</em> variables (or corresponding
Junio C Hamanoa28a9202012-06-21 07:08:231865environment overrides). See <a href="git-config.html">git-config(1)</a> for more details.</p></div>
Junio C Hamano4e6ba272016-01-20 23:23:191866<div class="paragraph"><p>With an optional <em>&lt;treeish&gt;</em> argument, use the treeish to find the notes
1867to display. The treeish can specify the full refname when it begins
Junio C Hamano1f7c4a52015-10-14 22:15:511868with <code>refs/notes/</code>; when it begins with <code>notes/</code>, <code>refs/</code> and otherwise
1869<code>refs/notes/</code> is prefixed to form a full name of the ref.</p></div>
Junio C Hamano60033462011-05-03 00:48:431870<div class="paragraph"><p>Multiple --notes options can be combined to control which notes are
1871being displayed. Examples: "--notes=foo" will show only notes from
1872"refs/notes/foo"; "--notes=foo --notes" will show both notes from
1873"refs/notes/foo" and from the default notes ref(s).</p></div>
Junio C Hamano31667362010-03-25 00:38:531874</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591875<dt class="hdlist1">
Junio C Hamano60033462011-05-03 00:48:431876--no-notes
1877</dt>
1878<dd>
1879<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511880 Do not show notes. This negates the above <code>--notes</code> option, by
Junio C Hamano60033462011-05-03 00:48:431881 resetting the list of notes refs from which notes are shown.
1882 Options are parsed in the order given on the command line, so e.g.
1883 "--notes --notes=foo --no-notes --notes=bar" will only show notes
1884 from "refs/notes/bar".
1885</p>
1886</dd>
1887<dt class="hdlist1">
Junio C Hamano4e6ba272016-01-20 23:23:191888--show-notes[=&lt;treeish&gt;]
Junio C Hamano60033462011-05-03 00:48:431889</dt>
1890<dt class="hdlist1">
Junio C Hamano31667362010-03-25 00:38:531891--[no-]standard-notes
1892</dt>
1893<dd>
1894<p>
Junio C Hamano60033462011-05-03 00:48:431895 These options are deprecated. Use the above --notes/--no-notes
1896 options instead.
Junio C Hamano31667362010-03-25 00:38:531897</p>
Junio C Hamano57827fb2010-01-23 03:02:501898</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591899<dt class="hdlist1">
Junio C Hamano0acb1ae2012-09-24 21:28:131900--show-signature
1901</dt>
1902<dd>
1903<p>
1904 Check the validity of a signed commit object by passing the signature
Junio C Hamanoac12f0e2014-09-19 22:32:511905 to <code>gpg --verify</code> and show the output.
Junio C Hamano0acb1ae2012-09-24 21:28:131906</p>
1907</dd>
1908<dt class="hdlist1">
Junio C Hamano0430e3a2007-05-15 03:13:171909--no-commit-id
1910</dt>
1911<dd>
1912<p>
Junio C Hamano1aa40d22010-01-21 17:46:431913 <em>git diff-tree</em> outputs a line with the commit ID when
Junio C Hamano0430e3a2007-05-15 03:13:171914 applicable. This flag suppressed the commit ID output.
1915</p>
1916</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591917<dt class="hdlist1">
Junio C Hamano0430e3a2007-05-15 03:13:171918-c
1919</dt>
1920<dd>
1921<p>
1922 This flag changes the way a merge commit is displayed
1923 (which means it is useful only when the command is given
1924 one &lt;tree-ish&gt;, or <em>--stdin</em>). It shows the differences
1925 from each of the parents to the merge result simultaneously
1926 instead of showing pairwise diff between a parent and the
1927 result one at a time (which is what the <em>-m</em> option does).
1928 Furthermore, it lists only files which were modified
1929 from all parents.
1930</p>
1931</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591932<dt class="hdlist1">
Junio C Hamano0430e3a2007-05-15 03:13:171933--cc
1934</dt>
1935<dd>
1936<p>
1937 This flag changes the way a merge commit patch is displayed,
1938 in a similar way to the <em>-c</em> option. It implies the <em>-c</em>
1939 and <em>-p</em> options and further compresses the patch output
Junio C Hamanoccc2f762008-07-24 04:03:331940 by omitting uninteresting hunks whose the contents in the parents
1941 have only two variants and the merge result picks one of them
1942 without modification. When all hunks are uninteresting, the commit
1943 itself and the commit log message is not shown, just like in any other
1944 "empty diff" case.
Junio C Hamano0430e3a2007-05-15 03:13:171945</p>
1946</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591947<dt class="hdlist1">
Junio C Hamano0430e3a2007-05-15 03:13:171948--always
1949</dt>
1950<dd>
1951<p>
1952 Show the commit itself and the commit log message even
1953 if the diff itself is empty.
1954</p>
1955</dd>
Junio C Hamanoba4b9282008-07-06 05:20:311956</dl></div>
Junio C Hamano0430e3a2007-05-15 03:13:171957</div>
Junio C Hamano9629d4f2012-12-19 00:28:271958</div>
1959<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:311960<h2 id="_pretty_formats">PRETTY FORMATS</h2>
Junio C Hamano0430e3a2007-05-15 03:13:171961<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:591962<div class="paragraph"><p>If the commit is a merge, and if the pretty-format
Junio C Hamano0430e3a2007-05-15 03:13:171963is not <em>oneline</em>, <em>email</em> or <em>raw</em>, an additional line is
1964inserted before the <em>Author:</em> line. This line begins with
1965"Merge: " and the sha1s of ancestral commits are printed,
1966separated by spaces. Note that the listed commits may not
1967necessarily be the list of the <strong>direct</strong> parent commits if you
1968have limited your view of history: for example, if you are
1969only interested in changes related to a certain directory or
Junio C Hamanoba4b9282008-07-06 05:20:311970file.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591971<div class="paragraph"><p>There are several built-in formats, and you can define
Junio C Hamanoa574a092010-06-13 19:57:101972additional formats by setting a pretty.&lt;name&gt;
1973config option to either another format name, or a
1974<em>format:</em> string, as described below (see
Junio C Hamanoa28a9202012-06-21 07:08:231975<a href="git-config.html">git-config(1)</a>). Here are the details of the
Junio C Hamanoa574a092010-06-13 19:57:101976built-in formats:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591977<div class="ulist"><ul>
Junio C Hamanoa340aaa2006-11-23 02:47:331978<li>
1979<p>
1980<em>oneline</em>
1981</p>
1982<div class="literalblock">
1983<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:511984<pre><code>&lt;sha1&gt; &lt;title line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:331985</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591986<div class="paragraph"><p>This is designed to be as compact as possible.</p></div>
Junio C Hamanoa340aaa2006-11-23 02:47:331987</li>
1988<li>
1989<p>
1990<em>short</em>
1991</p>
1992<div class="literalblock">
1993<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:511994<pre><code>commit &lt;sha1&gt;
1995Author: &lt;author&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:331996</div></div>
1997<div class="literalblock">
1998<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:511999<pre><code>&lt;title line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332000</div></div>
2001</li>
2002<li>
2003<p>
2004<em>medium</em>
2005</p>
2006<div class="literalblock">
2007<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512008<pre><code>commit &lt;sha1&gt;
Junio C Hamanoa340aaa2006-11-23 02:47:332009Author: &lt;author&gt;
Junio C Hamanoac12f0e2014-09-19 22:32:512010Date: &lt;author date&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332011</div></div>
2012<div class="literalblock">
2013<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512014<pre><code>&lt;title line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332015</div></div>
2016<div class="literalblock">
2017<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512018<pre><code>&lt;full commit message&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332019</div></div>
2020</li>
2021<li>
2022<p>
2023<em>full</em>
2024</p>
2025<div class="literalblock">
2026<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512027<pre><code>commit &lt;sha1&gt;
Junio C Hamanoa340aaa2006-11-23 02:47:332028Author: &lt;author&gt;
Junio C Hamanoac12f0e2014-09-19 22:32:512029Commit: &lt;committer&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332030</div></div>
2031<div class="literalblock">
2032<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512033<pre><code>&lt;title line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332034</div></div>
2035<div class="literalblock">
2036<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512037<pre><code>&lt;full commit message&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332038</div></div>
2039</li>
2040<li>
2041<p>
2042<em>fuller</em>
2043</p>
2044<div class="literalblock">
2045<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512046<pre><code>commit &lt;sha1&gt;
Junio C Hamano6a3c8272008-12-19 21:38:182047Author: &lt;author&gt;
Junio C Hamanoba4b9282008-07-06 05:20:312048AuthorDate: &lt;author date&gt;
Junio C Hamano6a3c8272008-12-19 21:38:182049Commit: &lt;committer&gt;
Junio C Hamanoac12f0e2014-09-19 22:32:512050CommitDate: &lt;committer date&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332051</div></div>
2052<div class="literalblock">
2053<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512054<pre><code>&lt;title line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332055</div></div>
2056<div class="literalblock">
2057<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512058<pre><code>&lt;full commit message&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332059</div></div>
2060</li>
2061<li>
2062<p>
2063<em>email</em>
2064</p>
2065<div class="literalblock">
2066<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512067<pre><code>From &lt;sha1&gt; &lt;date&gt;
Junio C Hamanoa340aaa2006-11-23 02:47:332068From: &lt;author&gt;
Junio C Hamanoba4b9282008-07-06 05:20:312069Date: &lt;author date&gt;
Junio C Hamanoac12f0e2014-09-19 22:32:512070Subject: [PATCH] &lt;title line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332071</div></div>
2072<div class="literalblock">
2073<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512074<pre><code>&lt;full commit message&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332075</div></div>
2076</li>
2077<li>
2078<p>
2079<em>raw</em>
2080</p>
Junio C Hamano68cf15a2010-11-06 01:01:592081<div class="paragraph"><p>The <em>raw</em> format shows the entire commit exactly as
Junio C Hamanoe3f080d2013-04-22 02:27:132082stored in the commit object. Notably, the SHA-1s are
Junio C Hamanoa340aaa2006-11-23 02:47:332083displayed in full, regardless of whether --abbrev or
2084--no-abbrev are used, and <em>parents</em> information show the
Junio C Hamanod75148a2014-04-08 19:48:382085true parent commits, without taking grafts or history
Junio C Hamano85f1fde2015-06-01 20:37:322086simplification into account. Note that this format affects the way
2087commits are displayed, but not the way the diff is shown e.g. with
2088<code>git log --raw</code>. To get full object names in a raw diff format,
2089use <code>--no-abbrev</code>.</p></div>
Junio C Hamanoa340aaa2006-11-23 02:47:332090</li>
Junio C Hamanoa3fd83c2007-03-02 10:34:362091<li>
2092<p>
Junio C Hamanoe32ec8b2010-06-02 23:32:312093<em>format:&lt;string&gt;</em>
Junio C Hamanoa3fd83c2007-03-02 10:34:362094</p>
Junio C Hamano68cf15a2010-11-06 01:01:592095<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:362096you want to show. It works a little bit like printf format,
2097with the notable exception that you get a newline with <em>%n</em>
Junio C Hamanoba4b9282008-07-06 05:20:312098instead of <em>\n</em>.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592099<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:312100would show something like this:</p></div>
Junio C Hamano0430e3a2007-05-15 03:13:172101<div class="listingblock">
2102<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512103<pre><code>The author of fe6e0ee was Junio C Hamano, 23 hours ago
2104The 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:172105</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592106<div class="paragraph"><p>The placeholders are:</p></div>
2107<div class="ulist"><ul>
Junio C Hamanoa3fd83c2007-03-02 10:34:362108<li>
2109<p>
2110<em>%H</em>: commit hash
2111</p>
2112</li>
2113<li>
2114<p>
2115<em>%h</em>: abbreviated commit hash
2116</p>
2117</li>
2118<li>
2119<p>
2120<em>%T</em>: tree hash
2121</p>
2122</li>
2123<li>
2124<p>
2125<em>%t</em>: abbreviated tree hash
2126</p>
2127</li>
2128<li>
2129<p>
2130<em>%P</em>: parent hashes
2131</p>
2132</li>
2133<li>
2134<p>
2135<em>%p</em>: abbreviated parent hashes
2136</p>
2137</li>
2138<li>
2139<p>
2140<em>%an</em>: author name
2141</p>
2142</li>
2143<li>
2144<p>
Junio C Hamano04e768d2013-04-23 19:19:262145<em>%aN</em>: author name (respecting .mailmap, see <a href="git-shortlog.html">git-shortlog(1)</a>
2146 or <a href="git-blame.html">git-blame(1)</a>)
Junio C Hamanof5a93622008-07-16 03:23:572147</p>
2148</li>
2149<li>
2150<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:362151<em>%ae</em>: author email
2152</p>
2153</li>
2154<li>
2155<p>
Junio C Hamano04e768d2013-04-23 19:19:262156<em>%aE</em>: author email (respecting .mailmap, see
2157 <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:192158</p>
2159</li>
2160<li>
2161<p>
Junio C Hamanoa387df32008-08-29 08:56:582162<em>%ad</em>: author date (format respects --date= option)
Junio C Hamanoa3fd83c2007-03-02 10:34:362163</p>
2164</li>
2165<li>
2166<p>
2167<em>%aD</em>: author date, RFC2822 style
2168</p>
2169</li>
2170<li>
2171<p>
2172<em>%ar</em>: author date, relative
2173</p>
2174</li>
2175<li>
2176<p>
2177<em>%at</em>: author date, UNIX timestamp
2178</p>
2179</li>
2180<li>
2181<p>
Junio C Hamanoac12f0e2014-09-19 22:32:512182<em>%ai</em>: author date, ISO 8601-like format
2183</p>
2184</li>
2185<li>
2186<p>
2187<em>%aI</em>: author date, strict ISO 8601 format
Junio C Hamano02f130b2007-07-14 08:26:562188</p>
2189</li>
2190<li>
2191<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:362192<em>%cn</em>: committer name
2193</p>
2194</li>
2195<li>
2196<p>
Junio C Hamano04e768d2013-04-23 19:19:262197<em>%cN</em>: committer name (respecting .mailmap, see
2198 <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:572199</p>
2200</li>
2201<li>
2202<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:362203<em>%ce</em>: committer email
2204</p>
2205</li>
2206<li>
2207<p>
Junio C Hamano04e768d2013-04-23 19:19:262208<em>%cE</em>: committer email (respecting .mailmap, see
2209 <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:192210</p>
2211</li>
2212<li>
2213<p>
Junio C Hamano53fe0312014-09-09 21:16:172214<em>%cd</em>: committer date (format respects --date= option)
Junio C Hamanoa3fd83c2007-03-02 10:34:362215</p>
2216</li>
2217<li>
2218<p>
2219<em>%cD</em>: committer date, RFC2822 style
2220</p>
2221</li>
2222<li>
2223<p>
2224<em>%cr</em>: committer date, relative
2225</p>
2226</li>
2227<li>
2228<p>
2229<em>%ct</em>: committer date, UNIX timestamp
2230</p>
2231</li>
2232<li>
2233<p>
Junio C Hamanoac12f0e2014-09-19 22:32:512234<em>%ci</em>: committer date, ISO 8601-like format
2235</p>
2236</li>
2237<li>
2238<p>
2239<em>%cI</em>: committer date, strict ISO 8601 format
Junio C Hamano02f130b2007-07-14 08:26:562240</p>
2241</li>
2242<li>
2243<p>
Junio C Hamanoa28a9202012-06-21 07:08:232244<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:022245</p>
2246</li>
2247<li>
2248<p>
Junio C Hamano00b9f1a2014-09-29 23:11:282249<em>%D</em>: ref names without the " (", ")" wrapping.
2250</p>
2251</li>
2252<li>
2253<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:362254<em>%e</em>: encoding
2255</p>
2256</li>
2257<li>
2258<p>
2259<em>%s</em>: subject
2260</p>
2261</li>
2262<li>
2263<p>
Junio C Hamano5f9a6f02009-04-06 08:26:562264<em>%f</em>: sanitized subject line, suitable for a filename
2265</p>
2266</li>
2267<li>
2268<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:362269<em>%b</em>: body
2270</p>
2271</li>
2272<li>
2273<p>
Junio C Hamanocb39aea2010-05-09 07:24:482274<em>%B</em>: raw body (unwrapped subject and body)
2275</p>
2276</li>
2277<li>
2278<p>
Junio C Hamano3b70d3c2009-11-21 17:37:372279<em>%N</em>: commit notes
2280</p>
2281</li>
2282<li>
2283<p>
Junio C Hamano0acb1ae2012-09-24 21:28:132284<em>%GG</em>: raw verification message from GPG for a signed commit
2285</p>
2286</li>
2287<li>
2288<p>
Junio C Hamano198b1f12016-05-17 22:27:242289<em>%G?</em>: show "G" for a good (valid) signature, "B" for a bad signature,
2290 "U" for a good signature with unknown validity and "N" for no signature
Junio C Hamano0acb1ae2012-09-24 21:28:132291</p>
2292</li>
2293<li>
2294<p>
2295<em>%GS</em>: show the name of the signer for a signed commit
2296</p>
2297</li>
2298<li>
2299<p>
Junio C Hamano5e7f1312013-03-21 22:49:012300<em>%GK</em>: show the key used to sign a signed commit
2301</p>
2302</li>
2303<li>
2304<p>
Junio C Hamanoac12f0e2014-09-19 22:32:512305<em>%gD</em>: reflog selector, e.g., <code>refs/stash@{1}</code>
Junio C Hamanoc21ab052009-10-31 04:03:552306</p>
2307</li>
2308<li>
2309<p>
Junio C Hamanoac12f0e2014-09-19 22:32:512310<em>%gd</em>: shortened reflog selector, e.g., <code>stash@{1}</code>
Junio C Hamanoc21ab052009-10-31 04:03:552311</p>
2312</li>
2313<li>
2314<p>
Junio C Hamano962f3a32011-12-22 20:21:442315<em>%gn</em>: reflog identity name
2316</p>
2317</li>
2318<li>
2319<p>
Junio C Hamano04e768d2013-04-23 19:19:262320<em>%gN</em>: reflog identity name (respecting .mailmap, see
2321 <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:442322</p>
2323</li>
2324<li>
2325<p>
2326<em>%ge</em>: reflog identity email
2327</p>
2328</li>
2329<li>
2330<p>
Junio C Hamano04e768d2013-04-23 19:19:262331<em>%gE</em>: reflog identity email (respecting .mailmap, see
2332 <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:442333</p>
2334</li>
2335<li>
2336<p>
Junio C Hamanoc21ab052009-10-31 04:03:552337<em>%gs</em>: reflog subject
2338</p>
2339</li>
2340<li>
2341<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:362342<em>%Cred</em>: switch color to red
2343</p>
2344</li>
2345<li>
2346<p>
2347<em>%Cgreen</em>: switch color to green
2348</p>
2349</li>
2350<li>
2351<p>
2352<em>%Cblue</em>: switch color to blue
2353</p>
2354</li>
2355<li>
2356<p>
2357<em>%Creset</em>: reset color
2358</p>
2359</li>
2360<li>
2361<p>
Junio C Hamanoabad6da2013-01-06 09:06:322362<em>%C(&#8230;)</em>: color specification, as described in color.branch.* config option;
Junio C Hamanoac12f0e2014-09-19 22:32:512363 adding <code>auto,</code> at the beginning will emit color only when colors are
2364 enabled for log output (by <code>color.diff</code>, <code>color.ui</code>, or <code>--color</code>, and
2365 respecting the <code>auto</code> settings of the former if we are going to a
2366 terminal). <code>auto</code> alone (i.e. <code>%C(auto)</code>) will turn on auto coloring
Junio C Hamano04e768d2013-04-23 19:19:262367 on the next placeholders until the color is switched again.
Junio C Hamanocc0cb312009-01-22 03:38:502368</p>
2369</li>
2370<li>
2371<p>
Junio C Hamanod9e0e5d2007-04-14 16:22:042372<em>%m</em>: left, right or boundary mark
2373</p>
2374</li>
2375<li>
2376<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:362377<em>%n</em>: newline
2378</p>
Junio C Hamano0430e3a2007-05-15 03:13:172379</li>
Junio C Hamanob78d2592008-04-09 09:39:082380<li>
2381<p>
Junio C Hamanoa9701f02010-01-21 00:42:162382<em>%%</em>: a raw <em>%</em>
2383</p>
2384</li>
2385<li>
2386<p>
Junio C Hamanob78d2592008-04-09 09:39:082387<em>%x00</em>: print a byte from a hex code
2388</p>
2389</li>
Junio C Hamanobf984de2009-11-23 06:11:192390<li>
2391<p>
2392<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:232393 <a href="git-shortlog.html">git-shortlog(1)</a>.
Junio C Hamanobf984de2009-11-23 06:11:192394</p>
2395</li>
Junio C Hamano04e768d2013-04-23 19:19:262396<li>
2397<p>
2398<em>%&lt;(&lt;N&gt;[,trunc|ltrunc|mtrunc])</em>: make the next placeholder take at
2399 least N columns, padding spaces on the right if necessary.
2400 Optionally truncate at the beginning (ltrunc), the middle (mtrunc)
2401 or the end (trunc) if the output is longer than N columns.
2402 Note that truncating only works correctly with N &gt;= 2.
2403</p>
2404</li>
2405<li>
2406<p>
2407<em>%&lt;|(&lt;N&gt;)</em>: make the next placeholder take at least until Nth
2408 columns, padding spaces on the right if necessary
2409</p>
2410</li>
2411<li>
2412<p>
2413<em>%&gt;(&lt;N&gt;)</em>, <em>%&gt;|(&lt;N&gt;)</em>: similar to <em>%&lt;(&lt;N&gt;)</em>, <em>%&lt;|(&lt;N&gt;)</em>
2414 respectively, but padding spaces on the left
2415</p>
2416</li>
2417<li>
2418<p>
2419<em>%&gt;&gt;(&lt;N&gt;)</em>, <em>%&gt;&gt;|(&lt;N&gt;)</em>: similar to <em>%&gt;(&lt;N&gt;)</em>, <em>%&gt;|(&lt;N&gt;)</em>
2420 respectively, except that if the next placeholder takes more spaces
2421 than given and there are spaces on its left, use those spaces
2422</p>
2423</li>
2424<li>
2425<p>
2426<em>%&gt;&lt;(&lt;N&gt;)</em>, <em>%&gt;&lt;|(&lt;N&gt;)</em>: similar to <em>% &lt;(&lt;N&gt;)</em>, <em>%&lt;|(&lt;N&gt;)</em>
2427 respectively, but padding both sides (i.e. the text is centered)
2428</p>
2429</li>
Junio C Hamanoba4b9282008-07-06 05:20:312430</ul></div>
Junio C Hamanoa3fd83c2007-03-02 10:34:362431</li>
Junio C Hamanoc21ab052009-10-31 04:03:552432</ul></div>
2433<div class="admonitionblock">
2434<table><tr>
2435<td class="icon">
2436<div class="title">Note</div>
2437</td>
2438<td class="content">Some placeholders may depend on other options given to the
Junio C Hamanoac12f0e2014-09-19 22:32:512439revision traversal engine. For example, the <code>%g*</code> reflog options will
Junio C Hamanoc21ab052009-10-31 04:03:552440insert an empty string unless we are traversing reflog entries (e.g., by
Junio C Hamano00b9f1a2014-09-29 23:11:282441<code>git log -g</code>). The <code>%d</code> and <code>%D</code> placeholders will use the "short"
2442decoration format if <code>--decorate</code> was not already provided on the command
2443line.</td>
Junio C Hamanoc21ab052009-10-31 04:03:552444</tr></table>
2445</div>
Junio C Hamanoac12f0e2014-09-19 22:32:512446<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:592447is inserted immediately before the expansion if and only if the
2448placeholder expands to a non-empty string.</p></div>
Junio C Hamanoac12f0e2014-09-19 22:32:512449<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:592450immediately precede the expansion are deleted if and only if the
2451placeholder expands to an empty string.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592452<div class="paragraph"><p>If you add a ` ` (space) after <em>%</em> of a placeholder, a space
Junio C Hamano89a57342010-06-22 23:22:552453is inserted immediately before the expansion if and only if the
2454placeholder expands to a non-empty string.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592455<div class="ulist"><ul>
Junio C Hamano6fb124c2008-06-13 10:04:012456<li>
2457<p>
2458<em>tformat:</em>
2459</p>
Junio C Hamano68cf15a2010-11-06 01:01:592460<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:012461provides "terminator" semantics instead of "separator" semantics. In
2462other words, each commit has the message terminator character (usually a
2463newline) appended, rather than a separator placed between entries.
2464This means that the final entry of a single-line format will be properly
2465terminated with a new line, just as the "oneline" format does.
Junio C Hamanoba4b9282008-07-06 05:20:312466For example:</p></div>
Junio C Hamano6fb124c2008-06-13 10:04:012467<div class="listingblock">
2468<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512469<pre><code>$ git log -2 --pretty=format:%h 4da45bef \
Junio C Hamano6fb124c2008-06-13 10:04:012470 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
24714da45be
24727134973 -- NO NEWLINE
2473
2474$ git log -2 --pretty=tformat:%h 4da45bef \
2475 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
24764da45be
Junio C Hamanoac12f0e2014-09-19 22:32:5124777134973</code></pre>
Junio C Hamano6fb124c2008-06-13 10:04:012478</div></div>
Junio C Hamanoac12f0e2014-09-19 22:32:512479<div class="paragraph"><p>In addition, any unrecognized string that has a <code>%</code> in it is interpreted
2480as if it has <code>tformat:</code> in front of it. For example, these two are
Junio C Hamano0a235222009-03-06 08:21:092481equivalent:</p></div>
2482<div class="listingblock">
2483<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512484<pre><code>$ git log -2 --pretty=tformat:%h 4da45bef
2485$ git log -2 --pretty=%h 4da45bef</code></pre>
Junio C Hamano0a235222009-03-06 08:21:092486</div></div>
Junio C Hamano6fb124c2008-06-13 10:04:012487</li>
Junio C Hamanoba4b9282008-07-06 05:20:312488</ul></div>
Junio C Hamano1a4e8412005-12-27 08:17:232489</div>
Junio C Hamano9629d4f2012-12-19 00:28:272490</div>
2491<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:312492<h2 id="_limiting_output">Limiting Output</h2>
Junio C Hamano1a4e8412005-12-27 08:17:232493<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:592494<div class="paragraph"><p>If you&#8217;re only interested in differences in a subset of files, for
Junio C Hamanoba4b9282008-07-06 05:20:312495example some architecture-specific files, you might do:</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232496<div class="literalblock">
2497<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512498<pre><code>git diff-tree -r &lt;tree-ish&gt; &lt;tree-ish&gt; arch/ia64 include/asm-ia64</code></pre>
Junio C Hamano1a4e8412005-12-27 08:17:232499</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592500<div class="paragraph"><p>and it will only show you what changed in those two directories.</p></div>
Junio C Hamanoac12f0e2014-09-19 22:32:512501<div class="paragraph"><p>Or if you are searching for what changed in just <code>kernel/sched.c</code>, just do</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232502<div class="literalblock">
2503<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512504<pre><code>git diff-tree -r &lt;tree-ish&gt; &lt;tree-ish&gt; kernel/sched.c</code></pre>
Junio C Hamano1a4e8412005-12-27 08:17:232505</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592506<div class="paragraph"><p>and it will ignore all differences to other files.</p></div>
2507<div class="paragraph"><p>The pattern is always the prefix, and is matched exactly. There are no
Junio C Hamano1a4e8412005-12-27 08:17:232508wildcards. Even stricter, it has to match a complete path component.
Junio C Hamanoac12f0e2014-09-19 22:32:512509I.e. "foo" does not pick up <code>foobar.h</code>. "foo" does match <code>foo/bar.h</code>
Junio C Hamanoba4b9282008-07-06 05:20:312510so it can be used to name subdirectories.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592511<div class="paragraph"><p>An example of normal usage is:</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232512<div class="literalblock">
2513<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512514<pre><code>torvalds@ppc970:~/git&gt; git diff-tree --abbrev 5319e4
2515:100664 100664 ac348b... a01513... git-fsck-objects.c</code></pre>
Junio C Hamano1a4e8412005-12-27 08:17:232516</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592517<div class="paragraph"><p>which tells you that the last commit changed just one file (it&#8217;s from
Junio C Hamanoba4b9282008-07-06 05:20:312518this one:</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232519<div class="listingblock">
2520<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512521<pre><code>commit 3c6f7ca19ad4043e9e72fa94106f352897e651a8
Junio C Hamano1a4e8412005-12-27 08:17:232522tree 5319e4d609cdd282069cc4dce33c1db559539b03
2523parent b4e628ea30d5ab3606119d2ea5caeab141d38df7
2524author Linus Torvalds &lt;torvalds@ppc970.osdl.org&gt; Sat Apr 9 12:02:30 2005
2525committer Linus Torvalds &lt;torvalds@ppc970.osdl.org&gt; Sat Apr 9 12:02:30 2005
2526
2527Make "git-fsck-objects" print out all the root commits it finds.
2528
2529Once I do the reference tracking, I'll also make it print out all the
Junio C Hamanoac12f0e2014-09-19 22:32:512530HEAD commits it finds, which is even more interesting.</code></pre>
Junio C Hamano1a4e8412005-12-27 08:17:232531</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592532<div class="paragraph"><p>in case you care).</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232533</div>
Junio C Hamano9629d4f2012-12-19 00:28:272534</div>
2535<div class="sect1">
Junio C Hamano543f8d62009-07-29 08:35:212536<h2 id="_raw_output_format">Raw output format</h2>
Junio C Hamano1a4e8412005-12-27 08:17:232537<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:592538<div class="paragraph"><p>The raw output format from "git-diff-index", "git-diff-tree",
Junio C Hamanoba4b9282008-07-06 05:20:312539"git-diff-files" and "git diff --raw" are very similar.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592540<div class="paragraph"><p>These commands all compare two sets of things; what is
Junio C Hamanoba4b9282008-07-06 05:20:312541compared differs:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592542<div class="dlist"><dl>
2543<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:232544git-diff-index &lt;tree-ish&gt;
2545</dt>
2546<dd>
2547<p>
2548 compares the &lt;tree-ish&gt; and the files on the filesystem.
2549</p>
2550</dd>
Junio C Hamano68cf15a2010-11-06 01:01:592551<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:232552git-diff-index --cached &lt;tree-ish&gt;
2553</dt>
2554<dd>
2555<p>
2556 compares the &lt;tree-ish&gt; and the index.
2557</p>
2558</dd>
Junio C Hamano68cf15a2010-11-06 01:01:592559<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:232560git-diff-tree [-r] &lt;tree-ish-1&gt; &lt;tree-ish-2&gt; [&lt;pattern&gt;&#8230;]
2561</dt>
2562<dd>
2563<p>
2564 compares the trees named by the two arguments.
2565</p>
2566</dd>
Junio C Hamano68cf15a2010-11-06 01:01:592567<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:232568git-diff-files [&lt;pattern&gt;&#8230;]
2569</dt>
2570<dd>
2571<p>
2572 compares the index and the files on the filesystem.
2573</p>
2574</dd>
Junio C Hamanoba4b9282008-07-06 05:20:312575</dl></div>
Junio C Hamano68cf15a2010-11-06 01:01:592576<div class="paragraph"><p>The "git-diff-tree" command begins its output by printing the hash of
Junio C Hamano543f8d62009-07-29 08:35:212577what is being compared. After that, all the commands print one output
2578line per changed file.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592579<div class="paragraph"><p>An output line is formatted this way:</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232580<div class="listingblock">
2581<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512582<pre><code>in-place edit :100644 100644 bcd1234... 0123456... M file0
Junio C Hamano1a4e8412005-12-27 08:17:232583copy-edit :100644 100644 abcd123... 1234567... C68 file1 file2
2584rename-edit :100644 100644 abcd123... 1234567... R86 file1 file3
2585create :000000 100644 0000000... 1234567... A file4
2586delete :100644 000000 1234567... 0000000... D file5
Junio C Hamanoac12f0e2014-09-19 22:32:512587unmerged :000000 000000 0000000... 0000000... U file6</code></pre>
Junio C Hamano1a4e8412005-12-27 08:17:232588</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592589<div class="paragraph"><p>That is, from the left to the right:</p></div>
2590<div class="olist arabic"><ol class="arabic">
Junio C Hamano1a4e8412005-12-27 08:17:232591<li>
2592<p>
2593a colon.
2594</p>
2595</li>
2596<li>
2597<p>
2598mode for "src"; 000000 if creation or unmerged.
2599</p>
2600</li>
2601<li>
2602<p>
2603a space.
2604</p>
2605</li>
2606<li>
2607<p>
2608mode for "dst"; 000000 if deletion or unmerged.
2609</p>
2610</li>
2611<li>
2612<p>
2613a space.
2614</p>
2615</li>
2616<li>
2617<p>
2618sha1 for "src"; 0{40} if creation or unmerged.
2619</p>
2620</li>
2621<li>
2622<p>
2623a space.
2624</p>
2625</li>
2626<li>
2627<p>
2628sha1 for "dst"; 0{40} if creation, unmerged or "look at work tree".
2629</p>
2630</li>
2631<li>
2632<p>
2633a space.
2634</p>
2635</li>
2636<li>
2637<p>
2638status, followed by optional "score" number.
2639</p>
2640</li>
2641<li>
2642<p>
2643a tab or a NUL when <em>-z</em> option is used.
2644</p>
2645</li>
2646<li>
2647<p>
2648path for "src"
2649</p>
2650</li>
2651<li>
2652<p>
2653a tab or a NUL when <em>-z</em> option is used; only exists for C or R.
2654</p>
2655</li>
2656<li>
2657<p>
2658path for "dst"; only exists for C or R.
2659</p>
2660</li>
2661<li>
2662<p>
2663an LF or a NUL when <em>-z</em> option is used, to terminate the record.
2664</p>
2665</li>
Junio C Hamanoba4b9282008-07-06 05:20:312666</ol></div>
Junio C Hamano68cf15a2010-11-06 01:01:592667<div class="paragraph"><p>Possible status letters are:</p></div>
2668<div class="ulist"><ul>
Junio C Hamanoaa17c7c2008-11-03 04:36:582669<li>
2670<p>
2671A: addition of a file
2672</p>
2673</li>
2674<li>
2675<p>
2676C: copy of a file into a new one
2677</p>
2678</li>
2679<li>
2680<p>
2681D: deletion of a file
2682</p>
2683</li>
2684<li>
2685<p>
2686M: modification of the contents or mode of a file
2687</p>
2688</li>
2689<li>
2690<p>
2691R: renaming of a file
2692</p>
2693</li>
2694<li>
2695<p>
2696T: change in the type of the file
2697</p>
2698</li>
2699<li>
2700<p>
2701U: file is unmerged (you must complete the merge before it can
2702be committed)
2703</p>
2704</li>
2705<li>
2706<p>
2707X: "unknown" change type (most probably a bug, please report it)
2708</p>
2709</li>
2710</ul></div>
Junio C Hamano68cf15a2010-11-06 01:01:592711<div class="paragraph"><p>Status letters C and R are always followed by a score (denoting the
Junio C Hamanoaa17c7c2008-11-03 04:36:582712percentage of similarity between the source and target of the move or
Junio C Hamano6bb32e62015-02-17 22:11:262713copy). Status letter M may be followed by a score (denoting the
2714percentage of dissimilarity) for file rewrites.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592715<div class="paragraph"><p>&lt;sha1&gt; is shown as all 0&#8217;s if a file is new on the filesystem
Junio C Hamanoba4b9282008-07-06 05:20:312716and it is out of sync with the index.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592717<div class="paragraph"><p>Example:</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232718<div class="listingblock">
2719<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512720<pre><code>:100644 100644 5be4a4...... 000000...... M file.c</code></pre>
Junio C Hamano1a4e8412005-12-27 08:17:232721</div></div>
Junio C Hamanoac12f0e2014-09-19 22:32:512722<div class="paragraph"><p>When <code>-z</code> option is not used, TAB, LF, and backslash characters
2723in pathnames are represented as <code>\t</code>, <code>\n</code>, and <code>\\</code>,
Junio C Hamanoba4b9282008-07-06 05:20:312724respectively.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232725</div>
Junio C Hamano9629d4f2012-12-19 00:28:272726</div>
2727<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:312728<h2 id="_diff_format_for_merges">diff format for merges</h2>
Junio C Hamano67fad6d2007-05-06 08:53:122729<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:592730<div class="paragraph"><p>"git-diff-tree", "git-diff-files" and "git-diff --raw"
Junio C Hamano7ae0ab22007-11-03 02:46:462731can take <em>-c</em> or <em>--cc</em> option
Junio C Hamano67fad6d2007-05-06 08:53:122732to generate diff output also for merge commits. The output differs
Junio C Hamanoba4b9282008-07-06 05:20:312733from the format described above in the following way:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592734<div class="olist arabic"><ol class="arabic">
Junio C Hamano67fad6d2007-05-06 08:53:122735<li>
2736<p>
2737there is a colon for each parent
2738</p>
2739</li>
2740<li>
2741<p>
2742there are more "src" modes and "src" sha1
2743</p>
2744</li>
2745<li>
2746<p>
2747status is concatenated status characters for each parent
2748</p>
2749</li>
2750<li>
2751<p>
2752no optional "score" number
2753</p>
2754</li>
2755<li>
2756<p>
2757single path, only for "dst"
2758</p>
2759</li>
Junio C Hamanoba4b9282008-07-06 05:20:312760</ol></div>
Junio C Hamano68cf15a2010-11-06 01:01:592761<div class="paragraph"><p>Example:</p></div>
Junio C Hamano67fad6d2007-05-06 08:53:122762<div class="listingblock">
2763<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512764<pre><code>::100644 100644 100644 fabadb8... cc95eb0... 4866510... MM describe.c</code></pre>
Junio C Hamano67fad6d2007-05-06 08:53:122765</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592766<div class="paragraph"><p>Note that <em>combined diff</em> lists only files which were modified from
Junio C Hamanoba4b9282008-07-06 05:20:312767all parents.</p></div>
Junio C Hamano67fad6d2007-05-06 08:53:122768</div>
Junio C Hamano9629d4f2012-12-19 00:28:272769</div>
2770<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:312771<h2 id="_generating_patches_with_p">Generating patches with -p</h2>
Junio C Hamano1a4e8412005-12-27 08:17:232772<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:592773<div class="paragraph"><p>When "git-diff-index", "git-diff-tree", or "git-diff-files" are run
Junio C Hamano00b8b632007-12-07 09:50:492774with a <em>-p</em> option, "git diff" without the <em>--raw</em> option, or
2775"git log" with the "-p" option, they
Junio C Hamano7ae0ab22007-11-03 02:46:462776do not produce the output described above; instead they produce a
2777patch file. You can customize the creation of such patches via the
Junio C Hamanoba4b9282008-07-06 05:20:312778GIT_EXTERNAL_DIFF and the GIT_DIFF_OPTS environment variables.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592779<div class="paragraph"><p>What the -p option produces is slightly different from the traditional
Junio C Hamano7f9fa862010-10-19 23:51:142780diff format:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592781<div class="olist arabic"><ol class="arabic">
Junio C Hamano1a4e8412005-12-27 08:17:232782<li>
2783<p>
Junio C Hamano7f9fa862010-10-19 23:51:142784It is preceded with a "git diff" header that looks like this:
Junio C Hamano1a4e8412005-12-27 08:17:232785</p>
2786<div class="literalblock">
2787<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512788<pre><code>diff --git a/file1 b/file2</code></pre>
Junio C Hamano1a4e8412005-12-27 08:17:232789</div></div>
Junio C Hamanoac12f0e2014-09-19 22:32:512790<div class="paragraph"><p>The <code>a/</code> and <code>b/</code> filenames are the same unless rename/copy is
Junio C Hamano1a4e8412005-12-27 08:17:232791involved. Especially, even for a creation or a deletion,
Junio C Hamanoac12f0e2014-09-19 22:32:512792<code>/dev/null</code> is <em>not</em> used in place of the <code>a/</code> or <code>b/</code> filenames.</p></div>
2793<div class="paragraph"><p>When rename/copy is involved, <code>file1</code> and <code>file2</code> show the
Junio C Hamano1a4e8412005-12-27 08:17:232794name of the source file of the rename/copy and the name of
Junio C Hamanoba4b9282008-07-06 05:20:312795the file that rename/copy produces, respectively.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232796</li>
2797<li>
2798<p>
2799It is followed by one or more extended header lines:
2800</p>
2801<div class="literalblock">
2802<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512803<pre><code>old mode &lt;mode&gt;
Junio C Hamano1a4e8412005-12-27 08:17:232804new mode &lt;mode&gt;
2805deleted file mode &lt;mode&gt;
2806new file mode &lt;mode&gt;
2807copy from &lt;path&gt;
2808copy to &lt;path&gt;
2809rename from &lt;path&gt;
2810rename to &lt;path&gt;
2811similarity index &lt;number&gt;
2812dissimilarity index &lt;number&gt;
Junio C Hamanoac12f0e2014-09-19 22:32:512813index &lt;hash&gt;..&lt;hash&gt; &lt;mode&gt;</code></pre>
Junio C Hamano1a4e8412005-12-27 08:17:232814</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592815<div class="paragraph"><p>File modes are printed as 6-digit octal numbers including the file type
Junio C Hamano7f9fa862010-10-19 23:51:142816and file permission bits.</p></div>
Junio C Hamanoac12f0e2014-09-19 22:32:512817<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:592818<div class="paragraph"><p>The similarity index is the percentage of unchanged lines, and
Junio C Hamano7f9fa862010-10-19 23:51:142819the dissimilarity index is the percentage of changed lines. It
2820is a rounded down integer, followed by a percent sign. The
2821similarity index value of 100% is thus reserved for two equal
2822files, while 100% dissimilarity means that no line from the old
2823file made it into the new one.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592824<div class="paragraph"><p>The index line includes the SHA-1 checksum before and after the change.
Junio C Hamano7f9fa862010-10-19 23:51:142825The &lt;mode&gt; is included if the file mode does not change; otherwise,
2826separate lines indicate the old and the new mode.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232827</li>
2828<li>
2829<p>
Junio C Hamanoa053d542006-10-27 09:29:132830TAB, LF, double quote and backslash characters in pathnames
Junio C Hamanoac12f0e2014-09-19 22:32:512831 are represented as <code>\t</code>, <code>\n</code>, <code>\"</code> and <code>\\</code>, respectively.
Junio C Hamanoa053d542006-10-27 09:29:132832 If there is need for such substitution then the whole
2833 pathname is put in double quotes.
Junio C Hamano1a4e8412005-12-27 08:17:232834</p>
2835</li>
Junio C Hamano7f9fa862010-10-19 23:51:142836<li>
2837<p>
Junio C Hamanoac12f0e2014-09-19 22:32:512838All the <code>file1</code> files in the output refer to files before the
2839 commit, and all the <code>file2</code> files refer to files after the commit.
Junio C Hamano7f9fa862010-10-19 23:51:142840 It is incorrect to apply each change to each file sequentially. For
2841 example, this patch will swap a and b:
2842</p>
2843<div class="literalblock">
2844<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512845<pre><code>diff --git a/a b/b
Junio C Hamano7f9fa862010-10-19 23:51:142846rename from a
2847rename to b
2848diff --git a/b b/a
2849rename from b
Junio C Hamanoac12f0e2014-09-19 22:32:512850rename to a</code></pre>
Junio C Hamano7f9fa862010-10-19 23:51:142851</div></div>
2852</li>
Junio C Hamanoba4b9282008-07-06 05:20:312853</ol></div>
Junio C Hamano1a4e8412005-12-27 08:17:232854</div>
Junio C Hamano9629d4f2012-12-19 00:28:272855</div>
2856<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:312857<h2 id="_combined_diff_format">combined diff format</h2>
Junio C Hamanofb56a962006-01-28 10:38:192858<div class="sectionbody">
Junio C Hamano1dbca522015-05-22 20:48:552859<div class="paragraph"><p>Any diff-generating command can take the <code>-c</code> or <code>--cc</code> option to
Junio C Hamanoc5be4cc2011-03-09 07:20:432860produce a <em>combined diff</em> when showing a merge. This is the default
Junio C Hamanoa28a9202012-06-21 07:08:232861format when showing merges with <a href="git-diff.html">git-diff(1)</a> or
Junio C Hamano1dbca522015-05-22 20:48:552862<a href="git-show.html">git-show(1)</a>. Note also that you can give the <code>-m</code> option to any
Junio C Hamanoc5be4cc2011-03-09 07:20:432863of these commands to force generation of diffs with individual parents
2864of a merge.</p></div>
2865<div class="paragraph"><p>A <em>combined diff</em> format looks like this:</p></div>
Junio C Hamanofb56a962006-01-28 10:38:192866<div class="listingblock">
2867<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512868<pre><code>diff --combined describe.c
Junio C Hamano29f14312006-10-26 08:47:292869index fabadb8,cc95eb0..4866510
2870--- a/describe.c
2871+++ b/describe.c
2872@@@ -98,20 -98,12 +98,20 @@@
2873 return (a_date &gt; b_date) ? -1 : (a_date == b_date) ? 0 : 1;
Junio C Hamanofb56a962006-01-28 10:38:192874 }
2875
2876- static void describe(char *arg)
2877 -static void describe(struct commit *cmit, int last_one)
2878++static void describe(char *arg, int last_one)
2879 {
Junio C Hamano29f14312006-10-26 08:47:292880 + unsigned char sha1[20];
2881 + struct commit *cmit;
2882 struct commit_list *list;
2883 static int initialized = 0;
2884 struct commit_name *n;
2885
2886 + if (get_sha1(arg, sha1) &lt; 0)
2887 + usage(describe_usage);
2888 + cmit = lookup_commit_reference(sha1);
2889 + if (!cmit)
2890 + usage(describe_usage);
2891 +
2892 if (!initialized) {
2893 initialized = 1;
Junio C Hamanoac12f0e2014-09-19 22:32:512894 for_each_ref(get_name);</code></pre>
Junio C Hamanofb56a962006-01-28 10:38:192895</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592896<div class="olist arabic"><ol class="arabic">
Junio C Hamano29f14312006-10-26 08:47:292897<li>
2898<p>
2899It is preceded with a "git diff" header, that looks like
2900 this (when <em>-c</em> option is used):
2901</p>
2902<div class="literalblock">
2903<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512904<pre><code>diff --combined file</code></pre>
Junio C Hamano29f14312006-10-26 08:47:292905</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592906<div class="paragraph"><p>or like this (when <em>--cc</em> option is used):</p></div>
Junio C Hamano29f14312006-10-26 08:47:292907<div class="literalblock">
2908<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512909<pre><code>diff --cc file</code></pre>
Junio C Hamano29f14312006-10-26 08:47:292910</div></div>
2911</li>
2912<li>
2913<p>
2914It is followed by one or more extended header lines
2915 (this example shows a merge with two parents):
2916</p>
2917<div class="literalblock">
2918<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512919<pre><code>index &lt;hash&gt;,&lt;hash&gt;..&lt;hash&gt;
Junio C Hamano29f14312006-10-26 08:47:292920mode &lt;mode&gt;,&lt;mode&gt;..&lt;mode&gt;
2921new file mode &lt;mode&gt;
Junio C Hamanoac12f0e2014-09-19 22:32:512922deleted file mode &lt;mode&gt;,&lt;mode&gt;</code></pre>
Junio C Hamano29f14312006-10-26 08:47:292923</div></div>
Junio C Hamanoac12f0e2014-09-19 22:32:512924<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 Hamanoee1e4282007-02-04 08:32:042925the &lt;mode&gt; is different from the rest. Extended headers with
Junio C Hamano29f14312006-10-26 08:47:292926information about detected contents movement (renames and
2927copying detection) are designed to work with diff of two
Junio C Hamanoba4b9282008-07-06 05:20:312928&lt;tree-ish&gt; and are not used by combined diff format.</p></div>
Junio C Hamano29f14312006-10-26 08:47:292929</li>
2930<li>
2931<p>
2932It is followed by two-line from-file/to-file header
2933</p>
2934<div class="literalblock">
2935<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512936<pre><code>--- a/file
2937+++ b/file</code></pre>
Junio C Hamano29f14312006-10-26 08:47:292938</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592939<div class="paragraph"><p>Similar to two-line header for traditional <em>unified</em> diff
Junio C Hamanoac12f0e2014-09-19 22:32:512940format, <code>/dev/null</code> is used to signal created or deleted
Junio C Hamanoba4b9282008-07-06 05:20:312941files.</p></div>
Junio C Hamano29f14312006-10-26 08:47:292942</li>
2943<li>
2944<p>
2945Chunk header format is modified to prevent people from
Junio C Hamanoac12f0e2014-09-19 22:32:512946 accidentally feeding it to <code>patch -p1</code>. Combined diff format
Junio C Hamano29f14312006-10-26 08:47:292947 was created for review of merge commit changes, and was not
2948 meant for apply. The change is similar to the change in the
2949 extended <em>index</em> header:
2950</p>
2951<div class="literalblock">
2952<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512953<pre><code>@@@ &lt;from-file-range&gt; &lt;from-file-range&gt; &lt;to-file-range&gt; @@@</code></pre>
Junio C Hamano29f14312006-10-26 08:47:292954</div></div>
Junio C Hamanoac12f0e2014-09-19 22:32:512955<div class="paragraph"><p>There are (number of parents + 1) <code>@</code> characters in the chunk
Junio C Hamanoba4b9282008-07-06 05:20:312956header for combined diff format.</p></div>
Junio C Hamano29f14312006-10-26 08:47:292957</li>
Junio C Hamanoba4b9282008-07-06 05:20:312958</ol></div>
Junio C Hamano68cf15a2010-11-06 01:01:592959<div class="paragraph"><p>Unlike the traditional <em>unified</em> diff format, which shows two
Junio C Hamanoac12f0e2014-09-19 22:32:512960files 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
2961added to B), or <code>" "</code> (space&#8201;&#8212;&#8201;unchanged) prefix, this format
Junio C Hamanofb56a962006-01-28 10:38:192962compares two or more files file1, file2,&#8230; with one file X, and
2963shows how X differs from each of fileN. One column for each of
Junio C Hamano68cf15a2010-11-06 01:01:592964fileN is prepended to the output line to note how X&#8217;s line is
Junio C Hamanoba4b9282008-07-06 05:20:312965different from it.</p></div>
Junio C Hamanoac12f0e2014-09-19 22:32:512966<div class="paragraph"><p>A <code>-</code> character in the column N means that the line appears in
2967fileN but it does not appear in the result. A <code>+</code> character
Junio C Hamano54bf1e22008-12-20 06:30:112968in the column N means that the line appears in the result,
Junio C Hamano29f14312006-10-26 08:47:292969and fileN does not have that line (in other words, the line was
Junio C Hamanoba4b9282008-07-06 05:20:312970added, from the point of view of that parent).</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592971<div class="paragraph"><p>In the above example output, the function signature was changed
Junio C Hamanoac12f0e2014-09-19 22:32:512972from both files (hence two <code>-</code> removals from both file1 and
2973file2, plus <code>++</code> to mean one line that was added does not appear
Junio C Hamanod75148a2014-04-08 19:48:382974in either file1 or file2). Also eight other lines are the same
Junio C Hamanoac12f0e2014-09-19 22:32:512975from file1 but do not appear in file2 (hence prefixed with <code>+</code>).</p></div>
2976<div class="paragraph"><p>When shown by <code>git diff-tree -c</code>, it compares the parents of a
Junio C Hamanofb56a962006-01-28 10:38:192977merge commit with the merge result (i.e. file1..fileN are the
Junio C Hamanoac12f0e2014-09-19 22:32:512978parents). When shown by <code>git diff-files -c</code>, it compares the
Junio C Hamanofb56a962006-01-28 10:38:192979two unresolved merge parents with the working tree file
2980(i.e. file1 is stage 2 aka "our version", file2 is stage 3 aka
Junio C Hamanoba4b9282008-07-06 05:20:312981"their version").</p></div>
Junio C Hamanofb56a962006-01-28 10:38:192982</div>
Junio C Hamano9629d4f2012-12-19 00:28:272983</div>
2984<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:312985<h2 id="_other_diff_formats">other diff formats</h2>
Junio C Hamano3a702342007-12-12 21:34:022986<div class="sectionbody">
Junio C Hamanoac12f0e2014-09-19 22:32:512987<div class="paragraph"><p>The <code>--summary</code> option describes newly added, deleted, renamed and
2988copied files. The <code>--stat</code> option adds diffstat(1) graph to the
Junio C Hamano3a702342007-12-12 21:34:022989output. These options can be combined with other options, such as
Junio C Hamanoac12f0e2014-09-19 22:32:512990<code>-p</code>, and are meant for human consumption.</p></div>
2991<div class="paragraph"><p>When showing a change that involves a rename or a copy, <code>--stat</code> output
Junio C Hamano3a702342007-12-12 21:34:022992formats the pathnames compactly by combining common prefix and suffix of
Junio C Hamanoac12f0e2014-09-19 22:32:512993the pathnames. For example, a change that moves <code>arch/i386/Makefile</code> to
2994<code>arch/x86/Makefile</code> while modifying 4 lines will be shown like this:</p></div>
Junio C Hamano3a702342007-12-12 21:34:022995<div class="listingblock">
2996<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512997<pre><code>arch/{i386 =&gt; x86}/Makefile | 4 +--</code></pre>
Junio C Hamano3a702342007-12-12 21:34:022998</div></div>
Junio C Hamanoac12f0e2014-09-19 22:32:512999<div class="paragraph"><p>The <code>--numstat</code> option gives the diffstat(1) information but is designed
3000for easier machine consumption. An entry in <code>--numstat</code> output looks
Junio C Hamanoba4b9282008-07-06 05:20:313001like this:</p></div>
Junio C Hamano3a702342007-12-12 21:34:023002<div class="listingblock">
3003<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:513004<pre><code>1 2 README
30053 1 arch/{i386 =&gt; x86}/Makefile</code></pre>
Junio C Hamano3a702342007-12-12 21:34:023006</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:593007<div class="paragraph"><p>That is, from left to right:</p></div>
3008<div class="olist arabic"><ol class="arabic">
Junio C Hamano3a702342007-12-12 21:34:023009<li>
3010<p>
3011the number of added lines;
3012</p>
3013</li>
3014<li>
3015<p>
3016a tab;
3017</p>
3018</li>
3019<li>
3020<p>
3021the number of deleted lines;
3022</p>
3023</li>
3024<li>
3025<p>
3026a tab;
3027</p>
3028</li>
3029<li>
3030<p>
3031pathname (possibly with rename/copy information);
3032</p>
3033</li>
3034<li>
3035<p>
3036a newline.
3037</p>
3038</li>
Junio C Hamanoba4b9282008-07-06 05:20:313039</ol></div>
Junio C Hamanoac12f0e2014-09-19 22:32:513040<div class="paragraph"><p>When <code>-z</code> output option is in effect, the output is formatted this way:</p></div>
Junio C Hamano3a702342007-12-12 21:34:023041<div class="listingblock">
3042<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:513043<pre><code>1 2 README NUL
30443 1 NUL arch/i386/Makefile NUL arch/x86/Makefile NUL</code></pre>
Junio C Hamano3a702342007-12-12 21:34:023045</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:593046<div class="paragraph"><p>That is:</p></div>
3047<div class="olist arabic"><ol class="arabic">
Junio C Hamano3a702342007-12-12 21:34:023048<li>
3049<p>
3050the number of added lines;
3051</p>
3052</li>
3053<li>
3054<p>
3055a tab;
3056</p>
3057</li>
3058<li>
3059<p>
3060the number of deleted lines;
3061</p>
3062</li>
3063<li>
3064<p>
3065a tab;
3066</p>
3067</li>
3068<li>
3069<p>
3070a NUL (only exists if renamed/copied);
3071</p>
3072</li>
3073<li>
3074<p>
3075pathname in preimage;
3076</p>
3077</li>
3078<li>
3079<p>
3080a NUL (only exists if renamed/copied);
3081</p>
3082</li>
3083<li>
3084<p>
3085pathname in postimage (only exists if renamed/copied);
3086</p>
3087</li>
3088<li>
3089<p>
3090a NUL.
3091</p>
3092</li>
Junio C Hamanoba4b9282008-07-06 05:20:313093</ol></div>
Junio C Hamanoac12f0e2014-09-19 22:32:513094<div class="paragraph"><p>The extra <code>NUL</code> before the preimage path in renamed case is to allow
Junio C Hamano3a702342007-12-12 21:34:023095scripts that read the output to tell if the current record being read is
3096a single-path record or a rename/copy record without reading ahead.
Junio C Hamanoac12f0e2014-09-19 22:32:513097After reading added and deleted lines, reading up to <code>NUL</code> would yield
3098the pathname, but if that is <code>NUL</code>, the record will show two paths.</p></div>
Junio C Hamano3a702342007-12-12 21:34:023099</div>
Junio C Hamano9629d4f2012-12-19 00:28:273100</div>
3101<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:313102<h2 id="_git">GIT</h2>
Junio C Hamano1a4e8412005-12-27 08:17:233103<div class="sectionbody">
Junio C Hamanoa28a9202012-06-21 07:08:233104<div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:233105</div>
Junio C Hamano7bd050f2011-09-22 06:32:223106</div>
Junio C Hamano9629d4f2012-12-19 00:28:273107</div>
Junio C Hamano7bd050f2011-09-22 06:32:223108<div id="footnotes"><hr /></div>
Junio C Hamano1a4e8412005-12-27 08:17:233109<div id="footer">
3110<div id="footer-text">
Junio C Hamano683a8612013-08-23 20:50:093111Last updated 2013-08-20 08:40:27 PDT
Junio C Hamano1a4e8412005-12-27 08:17:233112</div>
3113</div>
3114</body>
3115</html>