blob: 5d9615e9ff446a9292d8e4b06e442f0f563896a3 [file] [log] [blame]
Junio C Hamano1a4e8412005-12-27 08:17:231<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
2 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
4<head>
Junio C Hamano9629d4f2012-12-19 00:28:275<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
6<meta name="generator" content="AsciiDoc 8.6.8" />
Junio C Hamano68cf15a2010-11-06 01:01:597<title>git-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 Hamano9629d4f2012-12-19 00:28:2790.monospaced, code, pre {
91 font-family: "Courier New", Courier, monospace;
92 font-size: inherit;
93 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:2394 padding: 0;
95 margin: 0;
96}
97
Junio C Hamano9629d4f2012-12-19 00:28:2798
99#author {
Junio C Hamano1a4e8412005-12-27 08:17:23100 color: #527bbd;
Junio C Hamano1a4e8412005-12-27 08:17:23101 font-weight: bold;
Junio C Hamanoba4b9282008-07-06 05:20:31102 font-size: 1.1em;
Junio C Hamano1a4e8412005-12-27 08:17:23103}
Junio C Hamano9629d4f2012-12-19 00:28:27104#email {
Junio C Hamano1a4e8412005-12-27 08:17:23105}
Junio C Hamano9629d4f2012-12-19 00:28:27106#revnumber, #revdate, #revremark {
Junio C Hamano1a4e8412005-12-27 08:17:23107}
108
Junio C Hamano9629d4f2012-12-19 00:28:27109#footer {
Junio C Hamano1a4e8412005-12-27 08:17:23110 font-size: small;
111 border-top: 2px solid silver;
112 padding-top: 0.5em;
113 margin-top: 4.0em;
114}
Junio C Hamano9629d4f2012-12-19 00:28:27115#footer-text {
Junio C Hamano1a4e8412005-12-27 08:17:23116 float: left;
117 padding-bottom: 0.5em;
118}
Junio C Hamano9629d4f2012-12-19 00:28:27119#footer-badges {
Junio C Hamano1a4e8412005-12-27 08:17:23120 float: right;
121 padding-bottom: 0.5em;
122}
123
Junio C Hamano9629d4f2012-12-19 00:28:27124#preamble {
Junio C Hamano68cf15a2010-11-06 01:01:59125 margin-top: 1.5em;
126 margin-bottom: 1.5em;
127}
Junio C Hamano9629d4f2012-12-19 00:28:27128div.imageblock, div.exampleblock, div.verseblock,
Junio C Hamano1a4e8412005-12-27 08:17:23129div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
130div.admonitionblock {
Junio C Hamano7bd050f2011-09-22 06:32:22131 margin-top: 1.0em;
Junio C Hamano1a4e8412005-12-27 08:17:23132 margin-bottom: 1.5em;
133}
134div.admonitionblock {
Junio C Hamano7bd050f2011-09-22 06:32:22135 margin-top: 2.0em;
136 margin-bottom: 2.0em;
137 margin-right: 10%;
138 color: #606060;
Junio C Hamano1a4e8412005-12-27 08:17:23139}
140
141div.content { /* Block element content. */
142 padding: 0;
143}
144
145/* Block element titles. */
146div.title, caption.title {
Junio C Hamano68cf15a2010-11-06 01:01:59147 color: #527bbd;
Junio C Hamano1a4e8412005-12-27 08:17:23148 font-weight: bold;
149 text-align: left;
150 margin-top: 1.0em;
151 margin-bottom: 0.5em;
152}
153div.title + * {
154 margin-top: 0;
155}
156
157td div.title:first-child {
158 margin-top: 0.0em;
159}
160div.content div.title:first-child {
161 margin-top: 0.0em;
162}
163div.content + div.title {
164 margin-top: 0.0em;
165}
166
167div.sidebarblock > div.content {
168 background: #ffffee;
Junio C Hamano9629d4f2012-12-19 00:28:27169 border: 1px solid #dddddd;
170 border-left: 4px solid #f0f0f0;
Junio C Hamano1a4e8412005-12-27 08:17:23171 padding: 0.5em;
172}
173
174div.listingblock > div.content {
Junio C Hamano9629d4f2012-12-19 00:28:27175 border: 1px solid #dddddd;
176 border-left: 5px solid #f0f0f0;
177 background: #f8f8f8;
Junio C Hamano1a4e8412005-12-27 08:17:23178 padding: 0.5em;
179}
180
Junio C Hamano7bd050f2011-09-22 06:32:22181div.quoteblock, div.verseblock {
182 padding-left: 1.0em;
183 margin-left: 1.0em;
Junio C Hamano68cf15a2010-11-06 01:01:59184 margin-right: 10%;
Junio C Hamano9629d4f2012-12-19 00:28:27185 border-left: 5px solid #f0f0f0;
186 color: #888;
Junio C Hamano1a4e8412005-12-27 08:17:23187}
Junio C Hamano7bd050f2011-09-22 06:32:22188
Junio C Hamano68cf15a2010-11-06 01:01:59189div.quoteblock > div.attribution {
190 padding-top: 0.5em;
Junio C Hamano1a4e8412005-12-27 08:17:23191 text-align: right;
192}
Junio C Hamano68cf15a2010-11-06 01:01:59193
Junio C Hamano9629d4f2012-12-19 00:28:27194div.verseblock > pre.content {
195 font-family: inherit;
196 font-size: inherit;
Junio C Hamano68cf15a2010-11-06 01:01:59197}
198div.verseblock > div.attribution {
199 padding-top: 0.75em;
200 text-align: left;
201}
202/* DEPRECATED: Pre version 8.2.7 verse style literal block. */
Junio C Hamanoba4b9282008-07-06 05:20:31203div.verseblock + div.attribution {
204 text-align: left;
205}
Junio C Hamano1a4e8412005-12-27 08:17:23206
207div.admonitionblock .icon {
208 vertical-align: top;
209 font-size: 1.1em;
210 font-weight: bold;
211 text-decoration: underline;
212 color: #527bbd;
213 padding-right: 0.5em;
214}
215div.admonitionblock td.content {
216 padding-left: 0.5em;
Junio C Hamano7bd050f2011-09-22 06:32:22217 border-left: 3px solid #dddddd;
Junio C Hamano1a4e8412005-12-27 08:17:23218}
219
220div.exampleblock > div.content {
Junio C Hamano7bd050f2011-09-22 06:32:22221 border-left: 3px solid #dddddd;
222 padding-left: 0.5em;
Junio C Hamano1a4e8412005-12-27 08:17:23223}
224
Junio C Hamano1a4e8412005-12-27 08:17:23225div.imageblock div.content { padding-left: 0; }
Junio C Hamano1a4e8412005-12-27 08:17:23226span.image img { border-style: none; }
Junio C Hamano68cf15a2010-11-06 01:01:59227a.image:visited { color: white; }
Junio C Hamano1a4e8412005-12-27 08:17:23228
229dl {
230 margin-top: 0.8em;
231 margin-bottom: 0.8em;
232}
233dt {
234 margin-top: 0.5em;
235 margin-bottom: 0;
Junio C Hamano68cf15a2010-11-06 01:01:59236 font-style: normal;
237 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:23238}
239dd > *:first-child {
Junio C Hamano68cf15a2010-11-06 01:01:59240 margin-top: 0.1em;
Junio C Hamano1a4e8412005-12-27 08:17:23241}
242
243ul, ol {
244 list-style-position: outside;
245}
Junio C Hamano68cf15a2010-11-06 01:01:59246ol.arabic {
247 list-style-type: decimal;
248}
249ol.loweralpha {
Junio C Hamano1a4e8412005-12-27 08:17:23250 list-style-type: lower-alpha;
251}
Junio C Hamano68cf15a2010-11-06 01:01:59252ol.upperalpha {
253 list-style-type: upper-alpha;
254}
255ol.lowerroman {
256 list-style-type: lower-roman;
257}
258ol.upperroman {
259 list-style-type: upper-roman;
260}
261
262div.compact ul, div.compact ol,
263div.compact p, div.compact p,
264div.compact div, div.compact div {
265 margin-top: 0.1em;
266 margin-bottom: 0.1em;
267}
Junio C Hamano1a4e8412005-12-27 08:17:23268
Junio C Hamano1a4e8412005-12-27 08:17:23269tfoot {
270 font-weight: bold;
271}
Junio C Hamano68cf15a2010-11-06 01:01:59272td > div.verse {
273 white-space: pre;
274}
Junio C Hamano68cf15a2010-11-06 01:01:59275
276div.hdlist {
Junio C Hamano1a4e8412005-12-27 08:17:23277 margin-top: 0.8em;
278 margin-bottom: 0.8em;
279}
Junio C Hamano68cf15a2010-11-06 01:01:59280div.hdlist tr {
281 padding-bottom: 15px;
Junio C Hamanoba4b9282008-07-06 05:20:31282}
Junio C Hamano68cf15a2010-11-06 01:01:59283dt.hdlist1.strong, td.hdlist1.strong {
284 font-weight: bold;
285}
286td.hdlist1 {
Junio C Hamano1a4e8412005-12-27 08:17:23287 vertical-align: top;
Junio C Hamano68cf15a2010-11-06 01:01:59288 font-style: normal;
Junio C Hamano1a4e8412005-12-27 08:17:23289 padding-right: 0.8em;
Junio C Hamano68cf15a2010-11-06 01:01:59290 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:23291}
Junio C Hamano68cf15a2010-11-06 01:01:59292td.hdlist2 {
Junio C Hamano1a4e8412005-12-27 08:17:23293 vertical-align: top;
294}
Junio C Hamano68cf15a2010-11-06 01:01:59295div.hdlist.compact tr {
296 margin: 0;
297 padding-bottom: 0;
298}
299
300.comment {
301 background: yellow;
302}
Junio C Hamano1a4e8412005-12-27 08:17:23303
Junio C Hamano7bd050f2011-09-22 06:32:22304.footnote, .footnoteref {
305 font-size: 0.8em;
306}
307
308span.footnote, span.footnoteref {
309 vertical-align: super;
310}
311
312#footnotes {
313 margin: 20px 0 20px 0;
314 padding: 7px 0 0 0;
315}
316
317#footnotes div.footnote {
318 margin: 0 0 5px 0;
319}
320
321#footnotes hr {
322 border: none;
323 border-top: 1px solid silver;
324 height: 1px;
325 text-align: left;
326 margin-left: 0;
327 width: 20%;
328 min-width: 100px;
329}
330
Junio C Hamano9629d4f2012-12-19 00:28:27331div.colist td {
332 padding-right: 0.5em;
333 padding-bottom: 0.3em;
334 vertical-align: top;
335}
336div.colist td img {
337 margin-top: 0.3em;
Junio C Hamano1a4e8412005-12-27 08:17:23338}
Junio C Hamanoba4b9282008-07-06 05:20:31339
Junio C Hamano9629d4f2012-12-19 00:28:27340@media print {
341 #footer-badges { display: none; }
342}
343
344#toc {
Junio C Hamano7bd050f2011-09-22 06:32:22345 margin-bottom: 2.5em;
346}
347
Junio C Hamano9629d4f2012-12-19 00:28:27348#toctitle {
Junio C Hamanoba4b9282008-07-06 05:20:31349 color: #527bbd;
Junio C Hamanoba4b9282008-07-06 05:20:31350 font-size: 1.1em;
351 font-weight: bold;
352 margin-top: 1.0em;
353 margin-bottom: 0.1em;
354}
355
Junio C Hamano9629d4f2012-12-19 00:28:27356div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
Junio C Hamanoba4b9282008-07-06 05:20:31357 margin-top: 0;
358 margin-bottom: 0;
359}
360div.toclevel2 {
361 margin-left: 2em;
362 font-size: 0.9em;
363}
364div.toclevel3 {
365 margin-left: 4em;
366 font-size: 0.9em;
367}
368div.toclevel4 {
369 margin-left: 6em;
370 font-size: 0.9em;
371}
Junio C Hamano9629d4f2012-12-19 00:28:27372
373span.aqua { color: aqua; }
374span.black { color: black; }
375span.blue { color: blue; }
376span.fuchsia { color: fuchsia; }
377span.gray { color: gray; }
378span.green { color: green; }
379span.lime { color: lime; }
380span.maroon { color: maroon; }
381span.navy { color: navy; }
382span.olive { color: olive; }
383span.purple { color: purple; }
384span.red { color: red; }
385span.silver { color: silver; }
386span.teal { color: teal; }
387span.white { color: white; }
388span.yellow { color: yellow; }
389
390span.aqua-background { background: aqua; }
391span.black-background { background: black; }
392span.blue-background { background: blue; }
393span.fuchsia-background { background: fuchsia; }
394span.gray-background { background: gray; }
395span.green-background { background: green; }
396span.lime-background { background: lime; }
397span.maroon-background { background: maroon; }
398span.navy-background { background: navy; }
399span.olive-background { background: olive; }
400span.purple-background { background: purple; }
401span.red-background { background: red; }
402span.silver-background { background: silver; }
403span.teal-background { background: teal; }
404span.white-background { background: white; }
405span.yellow-background { background: yellow; }
406
407span.big { font-size: 2em; }
408span.small { font-size: 0.6em; }
409
410span.underline { text-decoration: underline; }
411span.overline { text-decoration: overline; }
412span.line-through { text-decoration: line-through; }
413
414div.unbreakable { page-break-inside: avoid; }
415
416
417/*
418 * xhtml11 specific
419 *
420 * */
421
422div.tableblock {
423 margin-top: 1.0em;
424 margin-bottom: 1.5em;
425}
426div.tableblock > table {
427 border: 3px solid #527bbd;
428}
429thead, p.table.header {
430 font-weight: bold;
431 color: #527bbd;
432}
433p.table {
434 margin-top: 0;
435}
436/* Because the table frame attribute is overriden by CSS in most browsers. */
437div.tableblock > table[frame="void"] {
438 border-style: none;
439}
440div.tableblock > table[frame="hsides"] {
441 border-left-style: none;
442 border-right-style: none;
443}
444div.tableblock > table[frame="vsides"] {
445 border-top-style: none;
446 border-bottom-style: none;
447}
448
449
450/*
451 * html5 specific
452 *
453 * */
454
455table.tableblock {
456 margin-top: 1.0em;
457 margin-bottom: 1.5em;
458}
459thead, p.tableblock.header {
460 font-weight: bold;
461 color: #527bbd;
462}
463p.tableblock {
464 margin-top: 0;
465}
466table.tableblock {
467 border-width: 3px;
468 border-spacing: 0px;
469 border-style: solid;
470 border-color: #527bbd;
471 border-collapse: collapse;
472}
473th.tableblock, td.tableblock {
474 border-width: 1px;
475 padding: 4px;
476 border-style: solid;
477 border-color: #527bbd;
478}
479
480table.tableblock.frame-topbot {
481 border-left-style: hidden;
482 border-right-style: hidden;
483}
484table.tableblock.frame-sides {
485 border-top-style: hidden;
486 border-bottom-style: hidden;
487}
488table.tableblock.frame-none {
489 border-style: hidden;
490}
491
492th.tableblock.halign-left, td.tableblock.halign-left {
493 text-align: left;
494}
495th.tableblock.halign-center, td.tableblock.halign-center {
496 text-align: center;
497}
498th.tableblock.halign-right, td.tableblock.halign-right {
499 text-align: right;
500}
501
502th.tableblock.valign-top, td.tableblock.valign-top {
503 vertical-align: top;
504}
505th.tableblock.valign-middle, td.tableblock.valign-middle {
506 vertical-align: middle;
507}
508th.tableblock.valign-bottom, td.tableblock.valign-bottom {
509 vertical-align: bottom;
510}
511
512
513/*
514 * manpage specific
515 *
516 * */
517
518body.manpage h1 {
Junio C Hamano68cf15a2010-11-06 01:01:59519 padding-top: 0.5em;
520 padding-bottom: 0.5em;
521 border-top: 2px solid silver;
522 border-bottom: 2px solid silver;
523}
Junio C Hamano9629d4f2012-12-19 00:28:27524body.manpage h2 {
Junio C Hamano68cf15a2010-11-06 01:01:59525 border-style: none;
526}
Junio C Hamano9629d4f2012-12-19 00:28:27527body.manpage div.sectionbody {
528 margin-left: 3em;
Junio C Hamano68cf15a2010-11-06 01:01:59529}
530
531@media print {
Junio C Hamano9629d4f2012-12-19 00:28:27532 body.manpage div#toc { display: none; }
Junio C Hamano68cf15a2010-11-06 01:01:59533}
534
Junio C Hamano1a4e8412005-12-27 08:17:23535
Junio C Hamano1a4e8412005-12-27 08:17:23536</style>
Junio C Hamano7bd050f2011-09-22 06:32:22537<script type="text/javascript">
538/*<![CDATA[*/
Junio C Hamano7bd050f2011-09-22 06:32:22539var asciidoc = { // Namespace.
540
541/////////////////////////////////////////////////////////////////////
542// Table Of Contents generator
543/////////////////////////////////////////////////////////////////////
544
545/* Author: Mihai Bazon, September 2002
546 * http://students.infoiasi.ro/~mishoo
547 *
548 * Table Of Content generator
549 * Version: 0.4
550 *
551 * Feel free to use this script under the terms of the GNU General Public
552 * License, as long as you do not remove or alter this notice.
553 */
554
555 /* modified by Troy D. Hanson, September 2006. License: GPL */
556 /* modified by Stuart Rackham, 2006, 2009. License: GPL */
557
558// toclevels = 1..4.
559toc: function (toclevels) {
560
561 function getText(el) {
562 var text = "";
563 for (var i = el.firstChild; i != null; i = i.nextSibling) {
564 if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
565 text += i.data;
566 else if (i.firstChild != null)
567 text += getText(i);
568 }
569 return text;
570 }
571
572 function TocEntry(el, text, toclevel) {
573 this.element = el;
574 this.text = text;
575 this.toclevel = toclevel;
576 }
577
578 function tocEntries(el, toclevels) {
579 var result = new Array;
Junio C Hamano9629d4f2012-12-19 00:28:27580 var re = new RegExp('[hH]([1-'+(toclevels+1)+'])');
Junio C Hamano7bd050f2011-09-22 06:32:22581 // Function that scans the DOM tree for header elements (the DOM2
582 // nodeIterator API would be a better technique but not supported by all
583 // browsers).
584 var iterate = function (el) {
585 for (var i = el.firstChild; i != null; i = i.nextSibling) {
586 if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
587 var mo = re.exec(i.tagName);
588 if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
589 result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
590 }
591 iterate(i);
592 }
593 }
594 }
595 iterate(el);
596 return result;
597 }
598
599 var toc = document.getElementById("toc");
Junio C Hamano9629d4f2012-12-19 00:28:27600 if (!toc) {
601 return;
602 }
603
604 // Delete existing TOC entries in case we're reloading the TOC.
605 var tocEntriesToRemove = [];
606 var i;
607 for (i = 0; i < toc.childNodes.length; i++) {
608 var entry = toc.childNodes[i];
609 if (entry.nodeName.toLowerCase() == 'div'
610 && entry.getAttribute("class")
611 && entry.getAttribute("class").match(/^toclevel/))
612 tocEntriesToRemove.push(entry);
613 }
614 for (i = 0; i < tocEntriesToRemove.length; i++) {
615 toc.removeChild(tocEntriesToRemove[i]);
616 }
617
618 // Rebuild TOC entries.
Junio C Hamano7bd050f2011-09-22 06:32:22619 var entries = tocEntries(document.getElementById("content"), toclevels);
620 for (var i = 0; i < entries.length; ++i) {
621 var entry = entries[i];
622 if (entry.element.id == "")
623 entry.element.id = "_toc_" + i;
624 var a = document.createElement("a");
625 a.href = "#" + entry.element.id;
626 a.appendChild(document.createTextNode(entry.text));
627 var div = document.createElement("div");
628 div.appendChild(a);
629 div.className = "toclevel" + entry.toclevel;
630 toc.appendChild(div);
631 }
632 if (entries.length == 0)
633 toc.parentNode.removeChild(toc);
634},
635
636
637/////////////////////////////////////////////////////////////////////
638// Footnotes generator
639/////////////////////////////////////////////////////////////////////
640
641/* Based on footnote generation code from:
642 * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
643 */
644
645footnotes: function () {
Junio C Hamano9629d4f2012-12-19 00:28:27646 // Delete existing footnote entries in case we're reloading the footnodes.
647 var i;
Junio C Hamano7bd050f2011-09-22 06:32:22648 var noteholder = document.getElementById("footnotes");
Junio C Hamano9629d4f2012-12-19 00:28:27649 if (!noteholder) {
650 return;
651 }
652 var entriesToRemove = [];
653 for (i = 0; i < noteholder.childNodes.length; i++) {
654 var entry = noteholder.childNodes[i];
655 if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote")
656 entriesToRemove.push(entry);
657 }
658 for (i = 0; i < entriesToRemove.length; i++) {
659 noteholder.removeChild(entriesToRemove[i]);
660 }
661
662 // Rebuild footnote entries.
663 var cont = document.getElementById("content");
Junio C Hamano7bd050f2011-09-22 06:32:22664 var spans = cont.getElementsByTagName("span");
665 var refs = {};
666 var n = 0;
667 for (i=0; i<spans.length; i++) {
668 if (spans[i].className == "footnote") {
669 n++;
Junio C Hamano9629d4f2012-12-19 00:28:27670 var note = spans[i].getAttribute("data-note");
671 if (!note) {
672 // Use [\s\S] in place of . so multi-line matches work.
673 // Because JavaScript has no s (dotall) regex flag.
674 note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
675 spans[i].innerHTML =
676 "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
677 "' title='View footnote' class='footnote'>" + n + "</a>]";
678 spans[i].setAttribute("data-note", note);
679 }
Junio C Hamano7bd050f2011-09-22 06:32:22680 noteholder.innerHTML +=
681 "<div class='footnote' id='_footnote_" + n + "'>" +
682 "<a href='#_footnoteref_" + n + "' title='Return to text'>" +
683 n + "</a>. " + note + "</div>";
Junio C Hamano7bd050f2011-09-22 06:32:22684 var id =spans[i].getAttribute("id");
685 if (id != null) refs["#"+id] = n;
686 }
687 }
688 if (n == 0)
689 noteholder.parentNode.removeChild(noteholder);
690 else {
691 // Process footnoterefs.
692 for (i=0; i<spans.length; i++) {
693 if (spans[i].className == "footnoteref") {
694 var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
695 href = href.match(/#.*/)[0]; // Because IE return full URL.
696 n = refs[href];
697 spans[i].innerHTML =
698 "[<a href='#_footnote_" + n +
699 "' title='View footnote' class='footnote'>" + n + "</a>]";
700 }
701 }
702 }
Junio C Hamano9629d4f2012-12-19 00:28:27703},
704
705install: function(toclevels) {
706 var timerId;
707
708 function reinstall() {
709 asciidoc.footnotes();
710 if (toclevels) {
711 asciidoc.toc(toclevels);
712 }
713 }
714
715 function reinstallAndRemoveTimer() {
716 clearInterval(timerId);
717 reinstall();
718 }
719
720 timerId = setInterval(reinstall, 500);
721 if (document.addEventListener)
722 document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false);
723 else
724 window.onload = reinstallAndRemoveTimer;
Junio C Hamano7bd050f2011-09-22 06:32:22725}
726
727}
Junio C Hamano9629d4f2012-12-19 00:28:27728asciidoc.install();
Junio C Hamano7bd050f2011-09-22 06:32:22729/*]]>*/
730</script>
Junio C Hamano1a4e8412005-12-27 08:17:23731</head>
Junio C Hamano9629d4f2012-12-19 00:28:27732<body class="manpage">
Junio C Hamano1a4e8412005-12-27 08:17:23733<div id="header">
734<h1>
735git-diff-tree(1) Manual Page
736</h1>
737<h2>NAME</h2>
738<div class="sectionbody">
739<p>git-diff-tree -
740 Compares the content and mode of blobs found via two tree objects
741</p>
742</div>
743</div>
Junio C Hamano7bd050f2011-09-22 06:32:22744<div id="content">
Junio C Hamano9629d4f2012-12-19 00:28:27745<div class="sect1">
Junio C Hamano68cf15a2010-11-06 01:01:59746<h2 id="_synopsis">SYNOPSIS</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23747<div class="sectionbody">
Junio C Hamano235a91e2006-01-07 01:13:58748<div class="verseblock">
Junio C Hamano9629d4f2012-12-19 00:28:27749<pre class="content"><em>git diff-tree</em> [--stdin] [-m] [-s] [-v] [--no-commit-id] [--pretty]
Junio C Hamanofb56a962006-01-28 10:38:19750 [-t] [-r] [-c | --cc] [--root] [&lt;common diff options&gt;]
Junio C Hamano9629d4f2012-12-19 00:28:27751 &lt;tree-ish&gt; [&lt;tree-ish&gt;] [&lt;path&gt;&#8230;]</pre>
752<div class="attribution">
Junio C Hamano68cf15a2010-11-06 01:01:59753</div></div>
Junio C Hamano1a4e8412005-12-27 08:17:23754</div>
Junio C Hamano9629d4f2012-12-19 00:28:27755</div>
756<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:31757<h2 id="_description">DESCRIPTION</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23758<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:59759<div class="paragraph"><p>Compares the content and mode of the blobs found via two tree objects.</p></div>
760<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:31761(see --stdin below).</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:59762<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:23763</div>
Junio C Hamano9629d4f2012-12-19 00:28:27764</div>
765<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:31766<h2 id="_options">OPTIONS</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23767<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:59768<div class="dlist"><dl>
769<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:23770-p
771</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59772<dt class="hdlist1">
Junio C Hamanobbbb8652008-12-29 10:34:22773-u
774</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59775<dt class="hdlist1">
Junio C Hamanoe97d5772010-05-19 08:13:58776--patch
777</dt>
Junio C Hamano1a4e8412005-12-27 08:17:23778<dd>
779<p>
Junio C Hamanoff979792007-11-16 10:11:30780 Generate patch (see section on generating patches).
781
Junio C Hamano1a4e8412005-12-27 08:17:23782</p>
783</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59784<dt class="hdlist1">
Junio C Hamano58f587a2013-07-22 19:20:59785-s
786</dt>
787<dt class="hdlist1">
788--no-patch
789</dt>
790<dd>
791<p>
792 Suppress diff output. Useful for commands like <code>git show</code> that
793 show the patch by default, or to cancel the effect of <code>--patch</code>.
794</p>
795</dd>
796<dt class="hdlist1">
Junio C Hamano69361562007-07-26 02:14:34797-U&lt;n&gt;
798</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59799<dt class="hdlist1">
Junio C Hamano69361562007-07-26 02:14:34800--unified=&lt;n&gt;
801</dt>
802<dd>
803<p>
804 Generate diffs with &lt;n&gt; lines of context instead of
Junio C Hamano3b70d3c2009-11-21 17:37:37805 the usual three.
Junio C Hamano9629d4f2012-12-19 00:28:27806 Implies <code>-p</code>.
Junio C Hamano69361562007-07-26 02:14:34807</p>
808</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59809<dt class="hdlist1">
Junio C Hamano9ae1a062006-07-10 08:12:34810--raw
811</dt>
812<dd>
813<p>
814 Generate the raw format.
Junio C Hamanoff979792007-11-16 10:11:30815 This is the default.
Junio C Hamano9ae1a062006-07-10 08:12:34816</p>
817</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59818<dt class="hdlist1">
Junio C Hamano54559c82006-04-13 07:45:12819--patch-with-raw
820</dt>
821<dd>
822<p>
Junio C Hamano9629d4f2012-12-19 00:28:27823 Synonym for <code>-p --raw</code>.
Junio C Hamano54559c82006-04-13 07:45:12824</p>
825</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59826<dt class="hdlist1">
Junio C Hamano5a73f302011-10-14 05:58:34827--minimal
828</dt>
829<dd>
830<p>
831 Spend extra time to make sure the smallest possible
832 diff is produced.
833</p>
834</dd>
835<dt class="hdlist1">
Junio C Hamano20d47e32009-01-26 06:36:02836--patience
837</dt>
838<dd>
839<p>
840 Generate a diff using the "patience diff" algorithm.
841</p>
842</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59843<dt class="hdlist1">
Junio C Hamanoaea9e6b2012-03-07 00:17:11844--histogram
845</dt>
846<dd>
847<p>
848 Generate a diff using the "histogram diff" algorithm.
849</p>
850</dd>
851<dt class="hdlist1">
Junio C Hamano80ad00d2013-02-18 00:19:03852--diff-algorithm={patience|minimal|histogram|myers}
853</dt>
854<dd>
855<p>
856 Choose a diff algorithm. The variants are as follows:
857</p>
858<div class="openblock">
859<div class="content">
860<div class="dlist"><dl>
861<dt class="hdlist1">
862<code>default</code>, <code>myers</code>
863</dt>
864<dd>
865<p>
866 The basic greedy diff algorithm. Currently, this is the default.
867</p>
868</dd>
869<dt class="hdlist1">
870<code>minimal</code>
871</dt>
872<dd>
873<p>
874 Spend extra time to make sure the smallest possible diff is
875 produced.
876</p>
877</dd>
878<dt class="hdlist1">
879<code>patience</code>
880</dt>
881<dd>
882<p>
883 Use "patience diff" algorithm when generating patches.
884</p>
885</dd>
886<dt class="hdlist1">
887<code>histogram</code>
888</dt>
889<dd>
890<p>
891 This algorithm extends the patience algorithm to "support
892 low-occurrence common elements".
893</p>
894</dd>
895</dl></div>
896</div></div>
897<div class="paragraph"><p>For instance, if you configured diff.algorithm variable to a
898non-default value and want to use the default one, then you
899have to use <code>--diff-algorithm=default</code> option.</p></div>
900</dd>
901<dt class="hdlist1">
Junio C Hamano4c4b0122011-06-30 01:19:32902--stat[=&lt;width&gt;[,&lt;name-width&gt;[,&lt;count&gt;]]]
Junio C Hamanoba7c8d82006-04-15 06:17:42903</dt>
904<dd>
905<p>
Junio C Hamanoaea9e6b2012-03-07 00:17:11906 Generate a diffstat. By default, as much space as necessary
907 will be used for the filename part, and the rest for the graph
908 part. Maximum width defaults to terminal width, or 80 columns
Junio C Hamano7f2b3cb2012-06-22 22:42:39909 if not connected to a terminal, and can be overridden by
Junio C Hamano9629d4f2012-12-19 00:28:27910 <code>&lt;width&gt;</code>. The width of the filename part can be limited by
911 giving another width <code>&lt;name-width&gt;</code> after a comma. The width
Junio C Hamanoaea9e6b2012-03-07 00:17:11912 of the graph part can be limited by using
Junio C Hamano9629d4f2012-12-19 00:28:27913 <code>--stat-graph-width=&lt;width&gt;</code> (affects all commands generating
914 a stat graph) or by setting <code>diff.statGraphWidth=&lt;width&gt;</code>
915 (does not affect <code>git format-patch</code>).
916 By giving a third parameter <code>&lt;count&gt;</code>, you can limit the
917 output to the first <code>&lt;count&gt;</code> lines, followed by <code>...</code> if
Junio C Hamanoaea9e6b2012-03-07 00:17:11918 there are more.
Junio C Hamanoba7c8d82006-04-15 06:17:42919</p>
Junio C Hamano9629d4f2012-12-19 00:28:27920<div class="paragraph"><p>These parameters can also be set individually with <code>--stat-width=&lt;width&gt;</code>,
921<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:42922</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59923<dt class="hdlist1">
Junio C Hamanofbe00522006-10-19 05:58:48924--numstat
925</dt>
926<dd>
927<p>
Junio C Hamano9629d4f2012-12-19 00:28:27928 Similar to <code>--stat</code>, but shows number of added and
Junio C Hamanofbe00522006-10-19 05:58:48929 deleted lines in decimal notation and pathname without
Junio C Hamanod793de52006-12-26 09:11:43930 abbreviation, to make it more machine friendly. For
Junio C Hamano9629d4f2012-12-19 00:28:27931 binary files, outputs two <code>-</code> instead of saying
932 <code>0 0</code>.
Junio C Hamanofbe00522006-10-19 05:58:48933</p>
934</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59935<dt class="hdlist1">
Junio C Hamano7d23f5e2006-12-16 07:44:04936--shortstat
937</dt>
938<dd>
939<p>
Junio C Hamano9629d4f2012-12-19 00:28:27940 Output only the last line of the <code>--stat</code> format containing total
Junio C Hamano7d23f5e2006-12-16 07:44:04941 number of modified files, as well as number of added and deleted
942 lines.
943</p>
944</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59945<dt class="hdlist1">
Junio C Hamano1c222c52011-05-13 19:55:32946--dirstat[=&lt;param1,param2,&#8230;&gt;]
Junio C Hamano6a45be92008-04-22 08:19:03947</dt>
948<dd>
949<p>
Junio C Hamano1c222c52011-05-13 19:55:32950 Output the distribution of relative amount of changes for each
Junio C Hamano9629d4f2012-12-19 00:28:27951 sub-directory. The behavior of <code>--dirstat</code> can be customized by
Junio C Hamano1c222c52011-05-13 19:55:32952 passing it a comma separated list of parameters.
Junio C Hamano9629d4f2012-12-19 00:28:27953 The defaults are controlled by the <code>diff.dirstat</code> configuration
Junio C Hamanoa28a9202012-06-21 07:08:23954 variable (see <a href="git-config.html">git-config(1)</a>).
Junio C Hamano1c222c52011-05-13 19:55:32955 The following parameters are available:
Junio C Hamano6a45be92008-04-22 08:19:03956</p>
Junio C Hamano9629d4f2012-12-19 00:28:27957<div class="openblock">
958<div class="content">
Junio C Hamano1c222c52011-05-13 19:55:32959<div class="dlist"><dl>
960<dt class="hdlist1">
Junio C Hamano9629d4f2012-12-19 00:28:27961<code>changes</code>
Junio C Hamano1c222c52011-05-13 19:55:32962</dt>
963<dd>
964<p>
965 Compute the dirstat numbers by counting the lines that have been
966 removed from the source, or added to the destination. This ignores
967 the amount of pure code movements within a file. In other words,
968 rearranging lines in a file is not counted as much as other changes.
969 This is the default behavior when no parameter is given.
970</p>
Junio C Hamano6a45be92008-04-22 08:19:03971</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59972<dt class="hdlist1">
Junio C Hamano9629d4f2012-12-19 00:28:27973<code>lines</code>
Junio C Hamanoa476efa2008-10-10 15:31:42974</dt>
975<dd>
976<p>
Junio C Hamano1c222c52011-05-13 19:55:32977 Compute the dirstat numbers by doing the regular line-based diff
978 analysis, and summing the removed/added line counts. (For binary
979 files, count 64-byte chunks instead, since binary files have no
Junio C Hamano9629d4f2012-12-19 00:28:27980 natural concept of lines). This is a more expensive <code>--dirstat</code>
981 behavior than the <code>changes</code> behavior, but it does count rearranged
Junio C Hamano1c222c52011-05-13 19:55:32982 lines within a file as much as other changes. The resulting output
Junio C Hamano9629d4f2012-12-19 00:28:27983 is consistent with what you get from the other <code>--*stat</code> options.
Junio C Hamanoa476efa2008-10-10 15:31:42984</p>
985</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59986<dt class="hdlist1">
Junio C Hamano9629d4f2012-12-19 00:28:27987<code>files</code>
Junio C Hamano1c222c52011-05-13 19:55:32988</dt>
989<dd>
990<p>
991 Compute the dirstat numbers by counting the number of files changed.
992 Each changed file counts equally in the dirstat analysis. This is
Junio C Hamano9629d4f2012-12-19 00:28:27993 the computationally cheapest <code>--dirstat</code> behavior, since it does
Junio C Hamano1c222c52011-05-13 19:55:32994 not have to look at the file contents at all.
995</p>
996</dd>
997<dt class="hdlist1">
Junio C Hamano9629d4f2012-12-19 00:28:27998<code>cumulative</code>
Junio C Hamano1c222c52011-05-13 19:55:32999</dt>
1000<dd>
1001<p>
1002 Count changes in a child directory for the parent directory as well.
Junio C Hamano9629d4f2012-12-19 00:28:271003 Note that when using <code>cumulative</code>, the sum of the percentages
Junio C Hamano1c222c52011-05-13 19:55:321004 reported may exceed 100%. The default (non-cumulative) behavior can
Junio C Hamano9629d4f2012-12-19 00:28:271005 be specified with the <code>noncumulative</code> parameter.
Junio C Hamano1c222c52011-05-13 19:55:321006</p>
1007</dd>
1008<dt class="hdlist1">
1009&lt;limit&gt;
1010</dt>
1011<dd>
1012<p>
1013 An integer parameter specifies a cut-off percent (3% by default).
1014 Directories contributing less than this percentage of the changes
1015 are not shown in the output.
1016</p>
1017</dd>
1018</dl></div>
Junio C Hamano9629d4f2012-12-19 00:28:271019</div></div>
Junio C Hamano1c222c52011-05-13 19:55:321020<div class="paragraph"><p>Example: The following will count changed files, while ignoring
1021directories with less than 10% of the total amount of changed files,
1022and accumulating child directory counts in the parent directories:
Junio C Hamano9629d4f2012-12-19 00:28:271023<code>--dirstat=files,10,cumulative</code>.</p></div>
Junio C Hamano1c222c52011-05-13 19:55:321024</dd>
1025<dt class="hdlist1">
Junio C Hamano6959c6c2006-05-17 10:34:111026--summary
1027</dt>
1028<dd>
1029<p>
1030 Output a condensed summary of extended header information
1031 such as creations, renames and mode changes.
1032</p>
1033</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591034<dt class="hdlist1">
Junio C Hamanod1308c92006-04-16 11:01:091035--patch-with-stat
1036</dt>
1037<dd>
1038<p>
Junio C Hamano9629d4f2012-12-19 00:28:271039 Synonym for <code>-p --stat</code>.
Junio C Hamanod1308c92006-04-16 11:01:091040</p>
1041</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591042<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231043-z
1044</dt>
1045<dd>
1046<p>
Junio C Hamano9629d4f2012-12-19 00:28:271047 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:341048 given, do not munge pathnames and use NULs as output field terminators.
Junio C Hamano1a4e8412005-12-27 08:17:231049</p>
Junio C Hamano68cf15a2010-11-06 01:01:591050<div class="paragraph"><p>Without this option, each pathname output will have TAB, LF, double quotes,
Junio C Hamano9629d4f2012-12-19 00:28:271051and backslash characters replaced with <code>\t</code>, <code>\n</code>, <code>\"</code>, and <code>\\</code>,
Junio C Hamano5706e0b2009-11-24 10:54:161052respectively, and the pathname will be enclosed in double quotes if
1053any of those replacements occurred.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231054</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591055<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231056--name-only
1057</dt>
1058<dd>
1059<p>
1060 Show only names of changed files.
1061</p>
1062</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591063<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231064--name-status
1065</dt>
1066<dd>
1067<p>
Junio C Hamanoa9aee782008-04-23 16:09:201068 Show only names and status of changed files. See the description
Junio C Hamano9629d4f2012-12-19 00:28:271069 of the <code>--diff-filter</code> option on what the status letters mean.
Junio C Hamano1a4e8412005-12-27 08:17:231070</p>
1071</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591072<dt class="hdlist1">
Junio C Hamanoc21ab052009-10-31 04:03:551073--submodule[=&lt;format&gt;]
1074</dt>
1075<dd>
1076<p>
Junio C Hamano9629d4f2012-12-19 00:28:271077 Specify how differences in submodules are shown. When <code>--submodule</code>
1078 or <code>--submodule=log</code> is given, the <em>log</em> format is used. This format lists
1079 the commits in the range like <a href="git-submodule.html">git-submodule(1)</a> <code>summary</code> does.
1080 Omitting the <code>--submodule</code> option or specifying <code>--submodule=short</code>,
Junio C Hamanoe768cc12012-03-16 05:43:051081 uses the <em>short</em> format. This format just shows the names of the commits
Junio C Hamanob4e58b12012-11-26 03:13:061082 at the beginning and end of the range. Can be tweaked via the
Junio C Hamano9629d4f2012-12-19 00:28:271083 <code>diff.submodule</code> configuration variable.
Junio C Hamanoc21ab052009-10-31 04:03:551084</p>
1085</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591086<dt class="hdlist1">
Junio C Hamano4aa0bcc2010-03-03 05:13:121087--color[=&lt;when&gt;]
Junio C Hamano9ae1a062006-07-10 08:12:341088</dt>
1089<dd>
1090<p>
1091 Show colored diff.
Junio C Hamano947ab822013-03-19 23:07:291092 <code>--color</code> (i.e. without <em>=&lt;when&gt;</em>) is the same as <code>--color=always</code>.
1093 <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:341094</p>
1095</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591096<dt class="hdlist1">
Junio C Hamano9ae1a062006-07-10 08:12:341097--no-color
1098</dt>
1099<dd>
1100<p>
Junio C Hamano5f2627d2011-05-06 20:23:481101 Turn off colored diff.
Junio C Hamano9629d4f2012-12-19 00:28:271102 It is the same as <code>--color=never</code>.
Junio C Hamano9ae1a062006-07-10 08:12:341103</p>
1104</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591105<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531106--word-diff[=&lt;mode&gt;]
Junio C Hamano85e45fa2006-08-13 07:47:411107</dt>
1108<dd>
1109<p>
Junio C Hamanocc7636a2010-05-21 14:57:531110 Show a word diff, using the &lt;mode&gt; to delimit changed words.
1111 By default, words are delimited by whitespace; see
Junio C Hamano9629d4f2012-12-19 00:28:271112 <code>--word-diff-regex</code> below. The &lt;mode&gt; defaults to <em>plain</em>, and
Junio C Hamanocc7636a2010-05-21 14:57:531113 must be one of:
Junio C Hamano85e45fa2006-08-13 07:47:411114</p>
Junio C Hamano9629d4f2012-12-19 00:28:271115<div class="openblock">
1116<div class="content">
Junio C Hamano68cf15a2010-11-06 01:01:591117<div class="dlist"><dl>
1118<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531119color
1120</dt>
1121<dd>
1122<p>
Junio C Hamano9629d4f2012-12-19 00:28:271123 Highlight changed words using only colors. Implies <code>--color</code>.
Junio C Hamanocc7636a2010-05-21 14:57:531124</p>
1125</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591126<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531127plain
1128</dt>
1129<dd>
1130<p>
Junio C Hamano9629d4f2012-12-19 00:28:271131 Show words as <code>[-removed-]</code> and <code>{+added+}</code>. Makes no
Junio C Hamanocc7636a2010-05-21 14:57:531132 attempts to escape the delimiters if they appear in the input,
1133 so the output may be ambiguous.
1134</p>
1135</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591136<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531137porcelain
1138</dt>
1139<dd>
1140<p>
1141 Use a special line-based format intended for script
1142 consumption. Added/removed/unchanged runs are printed in the
Junio C Hamano9629d4f2012-12-19 00:28:271143 usual unified diff format, starting with a <code>+</code>/<code>-</code>/` `
Junio C Hamanocc7636a2010-05-21 14:57:531144 character at the beginning of the line and extending to the
1145 end of the line. Newlines in the input are represented by a
Junio C Hamano9629d4f2012-12-19 00:28:271146 tilde <code>~</code> on a line of its own.
Junio C Hamanocc7636a2010-05-21 14:57:531147</p>
1148</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591149<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531150none
1151</dt>
1152<dd>
1153<p>
1154 Disable word diff again.
1155</p>
1156</dd>
1157</dl></div>
Junio C Hamano9629d4f2012-12-19 00:28:271158</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591159<div class="paragraph"><p>Note that despite the name of the first mode, color is used to
Junio C Hamanocc7636a2010-05-21 14:57:531160highlight the changed parts in all modes if enabled.</p></div>
1161</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591162<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531163--word-diff-regex=&lt;regex&gt;
1164</dt>
1165<dd>
1166<p>
1167 Use &lt;regex&gt; to decide what a word is, instead of considering
1168 runs of non-whitespace to be a word. Also implies
Junio C Hamano9629d4f2012-12-19 00:28:271169 <code>--word-diff</code> unless it was already enabled.
Junio C Hamanocc7636a2010-05-21 14:57:531170</p>
Junio C Hamano68cf15a2010-11-06 01:01:591171<div class="paragraph"><p>Every non-overlapping match of the
Junio C Hamano20d47e32009-01-26 06:36:021172&lt;regex&gt; is considered a word. Anything between these matches is
1173considered whitespace and ignored(!) for the purposes of finding
Junio C Hamano9629d4f2012-12-19 00:28:271174differences. You may want to append <code>|[^[:space:]]</code> to your regular
Junio C Hamano20d47e32009-01-26 06:36:021175expression to make sure that it matches all non-whitespace characters.
1176A match that contains a newline is silently truncated(!) at the
1177newline.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591178<div class="paragraph"><p>The regex can also be set via a diff driver or configuration option, see
Junio C Hamanoa28a9202012-06-21 07:08:231179<a href="gitattributes.html">gitattributes(1)</a> or <a href="git-config.html">git-config(1)</a>. Giving it explicitly
Junio C Hamano20d47e32009-01-26 06:36:021180overrides any diff driver or configuration setting. Diff drivers
1181override configuration settings.</p></div>
Junio C Hamano85e45fa2006-08-13 07:47:411182</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591183<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531184--color-words[=&lt;regex&gt;]
1185</dt>
1186<dd>
1187<p>
Junio C Hamano9629d4f2012-12-19 00:28:271188 Equivalent to <code>--word-diff=color</code> plus (if a regex was
1189 specified) <code>--word-diff-regex=&lt;regex&gt;</code>.
Junio C Hamanocc7636a2010-05-21 14:57:531190</p>
1191</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591192<dt class="hdlist1">
Junio C Hamano9ae1a062006-07-10 08:12:341193--no-renames
1194</dt>
1195<dd>
1196<p>
1197 Turn off rename detection, even when the configuration
1198 file gives the default to do so.
1199</p>
1200</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591201<dt class="hdlist1">
Junio C Hamanoa890c4f2007-01-28 10:29:211202--check
1203</dt>
1204<dd>
1205<p>
Junio C Hamano6005bfa2011-06-23 00:51:221206 Warn if changes introduce whitespace errors. What are
Junio C Hamano9629d4f2012-12-19 00:28:271207 considered whitespace errors is controlled by <code>core.whitespace</code>
Junio C Hamano6005bfa2011-06-23 00:51:221208 configuration. By default, trailing whitespaces (including
1209 lines that solely consist of whitespaces) and a space character
1210 that is immediately followed by a tab character inside the
1211 initial indent of the line are considered whitespace errors.
1212 Exits with non-zero status if problems are found. Not compatible
1213 with --exit-code.
Junio C Hamanoa890c4f2007-01-28 10:29:211214</p>
1215</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591216<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231217--full-index
1218</dt>
1219<dd>
1220<p>
Junio C Hamano5cf43ca2008-08-20 09:14:141221 Instead of the first handful of characters, show the full
1222 pre- and post-image blob object names on the "index"
1223 line when generating patch format output.
Junio C Hamano1a4e8412005-12-27 08:17:231224</p>
1225</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591226<dt class="hdlist1">
Junio C Hamano9ae1a062006-07-10 08:12:341227--binary
1228</dt>
1229<dd>
1230<p>
Junio C Hamano9629d4f2012-12-19 00:28:271231 In addition to <code>--full-index</code>, output a binary diff that
1232 can be applied with <code>git-apply</code>.
Junio C Hamano9ae1a062006-07-10 08:12:341233</p>
1234</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591235<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231236--abbrev[=&lt;n&gt;]
1237</dt>
1238<dd>
1239<p>
1240 Instead of showing the full 40-byte hexadecimal object
1241 name in diff-raw format output and diff-tree header
Junio C Hamano6efe3022009-01-13 16:47:561242 lines, show only a partial prefix. This is
Junio C Hamano9629d4f2012-12-19 00:28:271243 independent of the <code>--full-index</code> option above, which controls
Junio C Hamano1a4e8412005-12-27 08:17:231244 the diff-patch output format. Non default number of
Junio C Hamano9629d4f2012-12-19 00:28:271245 digits can be specified with <code>--abbrev=&lt;n&gt;</code>.
Junio C Hamano1a4e8412005-12-27 08:17:231246</p>
1247</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591248<dt class="hdlist1">
Junio C Hamanoe85e36f2010-08-10 05:30:141249-B[&lt;n&gt;][/&lt;m&gt;]
Junio C Hamano1a4e8412005-12-27 08:17:231250</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591251<dt class="hdlist1">
Junio C Hamano39c7a692010-10-27 06:08:541252--break-rewrites[=[&lt;n&gt;][/&lt;m&gt;]]
1253</dt>
Junio C Hamano1a4e8412005-12-27 08:17:231254<dd>
1255<p>
Junio C Hamanoe85e36f2010-08-10 05:30:141256 Break complete rewrite changes into pairs of delete and
1257 create. This serves two purposes:
Junio C Hamano1a4e8412005-12-27 08:17:231258</p>
Junio C Hamano68cf15a2010-11-06 01:01:591259<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:141260not as a series of deletion and insertion mixed together with a very
1261few lines that happen to match textually as the context, but as a
1262single deletion of everything old followed by a single insertion of
Junio C Hamano9629d4f2012-12-19 00:28:271263everything new, and the number <code>m</code> controls this aspect of the -B
1264option (defaults to 60%). <code>-B/70%</code> specifies that less than 30% of the
Junio C Hamano076ffcc2013-02-06 05:13:211265original should remain in the result for Git to consider it a total
Junio C Hamanoe85e36f2010-08-10 05:30:141266rewrite (i.e. otherwise the resulting patch will be a series of
1267deletion and insertion mixed together with context lines).</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591268<div class="paragraph"><p>When used with -M, a totally-rewritten file is also considered as the
Junio C Hamanoe85e36f2010-08-10 05:30:141269source of a rename (usually -M only considers a file that disappeared
Junio C Hamano9629d4f2012-12-19 00:28:271270as the source of a rename), and the number <code>n</code> controls this aspect of
1271the -B option (defaults to 50%). <code>-B20%</code> specifies that a change with
Junio C Hamano68cf15a2010-11-06 01:01:591272addition and deletion compared to 20% or more of the file&#8217;s size are
Junio C Hamanoe85e36f2010-08-10 05:30:141273eligible for being picked up as a possible source of a rename to
1274another file.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231275</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591276<dt class="hdlist1">
Junio C Hamanoe85e36f2010-08-10 05:30:141277-M[&lt;n&gt;]
Junio C Hamano1a4e8412005-12-27 08:17:231278</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591279<dt class="hdlist1">
Junio C Hamano0d75e872010-12-17 06:57:261280--find-renames[=&lt;n&gt;]
Junio C Hamano39c7a692010-10-27 06:08:541281</dt>
Junio C Hamano1a4e8412005-12-27 08:17:231282<dd>
1283<p>
1284 Detect renames.
Junio C Hamano9629d4f2012-12-19 00:28:271285 If <code>n</code> is specified, it is a threshold on the similarity
Junio C Hamanoe85e36f2010-08-10 05:30:141286 index (i.e. amount of addition/deletions compared to the
Junio C Hamano076ffcc2013-02-06 05:13:211287 file&#8217;s size). For example, <code>-M90%</code> means Git should consider a
Junio C Hamanoe85e36f2010-08-10 05:30:141288 delete/add pair to be a rename if more than 90% of the file
Junio C Hamano9629d4f2012-12-19 00:28:271289 hasn&#8217;t changed. Without a <code>%</code> sign, the number is to be read as
1290 a fraction, with a decimal point before it. I.e., <code>-M5</code> becomes
1291 0.5, and is thus the same as <code>-M50%</code>. Similarly, <code>-M05</code> is
1292 the same as <code>-M5%</code>. To limit detection to exact renames, use
Junio C Hamano8401f142013-07-12 22:47:461293 <code>-M100%</code>. The default similarity index is 50%.
Junio C Hamano1a4e8412005-12-27 08:17:231294</p>
1295</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591296<dt class="hdlist1">
Junio C Hamanoe85e36f2010-08-10 05:30:141297-C[&lt;n&gt;]
Junio C Hamano1a4e8412005-12-27 08:17:231298</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591299<dt class="hdlist1">
Junio C Hamano0d75e872010-12-17 06:57:261300--find-copies[=&lt;n&gt;]
Junio C Hamano39c7a692010-10-27 06:08:541301</dt>
Junio C Hamano1a4e8412005-12-27 08:17:231302<dd>
1303<p>
Junio C Hamano9629d4f2012-12-19 00:28:271304 Detect copies as well as renames. See also <code>--find-copies-harder</code>.
1305 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:231306</p>
1307</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591308<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231309--find-copies-harder
1310</dt>
1311<dd>
1312<p>
Junio C Hamano9629d4f2012-12-19 00:28:271313 For performance reasons, by default, <code>-C</code> option finds copies only
Junio C Hamano1a4e8412005-12-27 08:17:231314 if the original file of the copy was modified in the same
1315 changeset. This flag makes the command
1316 inspect unmodified files as candidates for the source of
1317 copy. This is a very expensive operation for large
Junio C Hamano16f98872007-06-12 16:09:141318 projects, so use it with caution. Giving more than one
Junio C Hamano9629d4f2012-12-19 00:28:271319 <code>-C</code> option has the same effect.
Junio C Hamano1a4e8412005-12-27 08:17:231320</p>
1321</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591322<dt class="hdlist1">
Junio C Hamanob02377c2011-04-28 22:26:021323-D
1324</dt>
1325<dt class="hdlist1">
1326--irreversible-delete
1327</dt>
1328<dd>
1329<p>
1330 Omit the preimage for deletes, i.e. print only the header but not
Junio C Hamano9629d4f2012-12-19 00:28:271331 the diff between the preimage and <code>/dev/null</code>. The resulting patch
1332 is not meant to be applied with <code>patch</code> nor <code>git apply</code>; this is
Junio C Hamanob02377c2011-04-28 22:26:021333 solely for people who want to just concentrate on reviewing the
1334 text after the change. In addition, the output obviously lack
1335 enough information to apply such a patch in reverse, even manually,
1336 hence the name of the option.
1337</p>
Junio C Hamano9629d4f2012-12-19 00:28:271338<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:021339of a delete/create pair.</p></div>
1340</dd>
1341<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231342-l&lt;num&gt;
1343</dt>
1344<dd>
1345<p>
Junio C Hamano9629d4f2012-12-19 00:28:271346 The <code>-M</code> and <code>-C</code> options require O(n^2) processing time where n
Junio C Hamano1a4e8412005-12-27 08:17:231347 is the number of potential rename/copy targets. This
1348 option prevents rename/copy detection from running if
1349 the number of rename/copy targets exceeds the specified
1350 number.
1351</p>
1352</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591353<dt class="hdlist1">
Junio C Hamano982eb112010-11-18 00:53:091354--diff-filter=[(A|C|D|M|R|T|U|X|B)&#8230;[*]]
1355</dt>
1356<dd>
1357<p>
Junio C Hamano9629d4f2012-12-19 00:28:271358 Select only files that are Added (<code>A</code>), Copied (<code>C</code>),
1359 Deleted (<code>D</code>), Modified (<code>M</code>), Renamed (<code>R</code>), have their
1360 type (i.e. regular file, symlink, submodule, &#8230;) changed (<code>T</code>),
1361 are Unmerged (<code>U</code>), are
1362 Unknown (<code>X</code>), or have had their pairing Broken (<code>B</code>).
Junio C Hamano982eb112010-11-18 00:53:091363 Any combination of the filter characters (including none) can be used.
Junio C Hamano9629d4f2012-12-19 00:28:271364 When <code>*</code> (All-or-none) is added to the combination, all
Junio C Hamano982eb112010-11-18 00:53:091365 paths are selected if there is any file that matches
1366 other criteria in the comparison; if there is no file
1367 that matches other criteria, nothing is selected.
1368</p>
1369</dd>
1370<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231371-S&lt;string&gt;
1372</dt>
1373<dd>
1374<p>
Junio C Hamanof1f5a7b2013-06-11 22:23:521375 Look for differences that change the number of occurrences of
1376 the specified string (i.e. addition/deletion) in a file.
1377 Intended for the scripter&#8217;s use.
Junio C Hamano1a4e8412005-12-27 08:17:231378</p>
Junio C Hamanof1f5a7b2013-06-11 22:23:521379<div class="paragraph"><p>It is useful when you&#8217;re looking for an exact block of code (like a
1380struct), and want to know the history of that block since it first
1381came into being: use the feature iteratively to feed the interesting
1382block in the preimage back into <code>-S</code>, and keep going until you get the
1383very first version of the block.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231384</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591385<dt class="hdlist1">
Junio C Hamano3b4609d2010-09-30 00:04:341386-G&lt;regex&gt;
1387</dt>
1388<dd>
1389<p>
Junio C Hamanof1f5a7b2013-06-11 22:23:521390 Look for differences whose patch text contains added/removed
1391 lines that match &lt;regex&gt;.
Junio C Hamano3b4609d2010-09-30 00:04:341392</p>
Junio C Hamanof1f5a7b2013-06-11 22:23:521393<div class="paragraph"><p>To illustrate the difference between <code>-S&lt;regex&gt; --pickaxe-regex</code> and
1394<code>-G&lt;regex&gt;</code>, consider a commit with the following diff in the same
1395file:</p></div>
1396<div class="listingblock">
1397<div class="content">
1398<pre><code>+ return !regexec(regexp, two-&gt;ptr, 1, &amp;regmatch, 0);
1399...
1400- hit = !regexec(regexp, mf2.ptr, 1, &amp;regmatch, 0);</code></pre>
1401</div></div>
1402<div class="paragraph"><p>While <code>git log -G"regexec\(regexp"</code> will show this commit, <code>git log
1403-S"regexec\(regexp" --pickaxe-regex</code> will not (because the number of
1404occurrences of that string did not change).</p></div>
1405<div class="paragraph"><p>See the <em>pickaxe</em> entry in <a href="gitdiffcore.html">gitdiffcore(7)</a> for more
1406information.</p></div>
Junio C Hamano3b4609d2010-09-30 00:04:341407</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591408<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231409--pickaxe-all
1410</dt>
1411<dd>
1412<p>
Junio C Hamano9629d4f2012-12-19 00:28:271413 When <code>-S</code> or <code>-G</code> finds a change, show all the changes in that
Junio C Hamano1a4e8412005-12-27 08:17:231414 changeset, not just the files that contain the change
1415 in &lt;string&gt;.
1416</p>
1417</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591418<dt class="hdlist1">
Junio C Hamanobfe9e752006-04-05 21:43:281419--pickaxe-regex
1420</dt>
1421<dd>
1422<p>
Junio C Hamanof1f5a7b2013-06-11 22:23:521423 Treat the &lt;string&gt; given to <code>-S</code> as an extended POSIX regular
1424 expression to match.
Junio C Hamanobfe9e752006-04-05 21:43:281425</p>
1426</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591427<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231428-O&lt;orderfile&gt;
1429</dt>
1430<dd>
1431<p>
1432 Output the patch in the order specified in the
1433 &lt;orderfile&gt;, which has one shell glob pattern per line.
1434</p>
1435</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591436<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231437-R
1438</dt>
1439<dd>
1440<p>
1441 Swap two inputs; that is, show differences from index or
1442 on-disk file to tree contents.
1443</p>
1444</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591445<dt class="hdlist1">
Junio C Hamano24bc09a2008-02-28 00:27:441446--relative[=&lt;path&gt;]
1447</dt>
1448<dd>
1449<p>
1450 When run from a subdirectory of the project, it can be
1451 told to exclude changes outside the directory and show
1452 pathnames relative to it with this option. When you are
1453 not in a subdirectory (e.g. in a bare repository), you
1454 can name which subdirectory to make the output relative
1455 to by giving a &lt;path&gt; as an argument.
1456</p>
1457</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591458<dt class="hdlist1">
Junio C Hamanobbbb8652008-12-29 10:34:221459-a
1460</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591461<dt class="hdlist1">
Junio C Hamanoc26f5482006-07-09 09:38:141462--text
1463</dt>
1464<dd>
1465<p>
1466 Treat all files as text.
1467</p>
1468</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591469<dt class="hdlist1">
Junio C Hamanofd468962007-02-14 23:45:041470--ignore-space-at-eol
1471</dt>
1472<dd>
1473<p>
Junio C Hamano3a702342007-12-12 21:34:021474 Ignore changes in whitespace at EOL.
Junio C Hamanofd468962007-02-14 23:45:041475</p>
1476</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591477<dt class="hdlist1">
Junio C Hamanobbbb8652008-12-29 10:34:221478-b
1479</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591480<dt class="hdlist1">
Junio C Hamanod9c2d2f2006-12-06 08:59:071481--ignore-space-change
1482</dt>
1483<dd>
1484<p>
Junio C Hamano3a702342007-12-12 21:34:021485 Ignore changes in amount of whitespace. This ignores whitespace
1486 at line end, and considers all other sequences of one or
1487 more whitespace characters to be equivalent.
Junio C Hamanod9c2d2f2006-12-06 08:59:071488</p>
1489</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591490<dt class="hdlist1">
Junio C Hamanobbbb8652008-12-29 10:34:221491-w
Junio C Hamanod9c2d2f2006-12-06 08:59:071492</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591493<dt class="hdlist1">
Junio C Hamanod9c2d2f2006-12-06 08:59:071494--ignore-all-space
1495</dt>
1496<dd>
1497<p>
Junio C Hamano3a702342007-12-12 21:34:021498 Ignore whitespace when comparing lines. This ignores
1499 differences even if one line has whitespace where the other
Junio C Hamanod9c2d2f2006-12-06 08:59:071500 line has none.
1501</p>
1502</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591503<dt class="hdlist1">
Junio C Hamanoa1952302013-07-01 21:31:181504--ignore-blank-lines
1505</dt>
1506<dd>
1507<p>
1508 Ignore changes whose lines are all blank.
1509</p>
1510</dd>
1511<dt class="hdlist1">
Junio C Hamano1d40ee82009-01-07 10:14:161512--inter-hunk-context=&lt;lines&gt;
1513</dt>
1514<dd>
1515<p>
1516 Show the context between diff hunks, up to the specified number
1517 of lines, thereby fusing hunks that are close to each other.
1518</p>
1519</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591520<dt class="hdlist1">
Junio C Hamano11821ed2011-10-19 18:42:091521-W
1522</dt>
1523<dt class="hdlist1">
1524--function-context
1525</dt>
1526<dd>
1527<p>
1528 Show whole surrounding functions of changes.
1529</p>
1530</dd>
1531<dt class="hdlist1">
Junio C Hamano48fd2f62007-03-19 02:02:301532--exit-code
1533</dt>
1534<dd>
1535<p>
1536 Make the program exit with codes similar to diff(1).
1537 That is, it exits with 1 if there were differences and
1538 0 means no differences.
1539</p>
1540</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591541<dt class="hdlist1">
Junio C Hamano35e57552007-03-25 07:54:351542--quiet
1543</dt>
1544<dd>
1545<p>
Junio C Hamano9629d4f2012-12-19 00:28:271546 Disable all output of the program. Implies <code>--exit-code</code>.
Junio C Hamano35e57552007-03-25 07:54:351547</p>
1548</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591549<dt class="hdlist1">
Junio C Hamanobb0f4042007-07-04 06:41:401550--ext-diff
1551</dt>
1552<dd>
1553<p>
1554 Allow an external diff helper to be executed. If you set an
Junio C Hamanoa28a9202012-06-21 07:08:231555 external diff driver with <a href="gitattributes.html">gitattributes(5)</a>, you need
1556 to use this option with <a href="git-log.html">git-log(1)</a> and friends.
Junio C Hamanobb0f4042007-07-04 06:41:401557</p>
1558</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591559<dt class="hdlist1">
Junio C Hamanobb0f4042007-07-04 06:41:401560--no-ext-diff
1561</dt>
1562<dd>
1563<p>
1564 Disallow external diff drivers.
1565</p>
1566</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591567<dt class="hdlist1">
Junio C Hamanoc652aed2011-07-07 01:14:311568--textconv
1569</dt>
1570<dt class="hdlist1">
1571--no-textconv
1572</dt>
1573<dd>
1574<p>
1575 Allow (or disallow) external text conversion filters to be run
Junio C Hamanoa28a9202012-06-21 07:08:231576 when comparing binary files. See <a href="gitattributes.html">gitattributes(5)</a> for
Junio C Hamanoc652aed2011-07-07 01:14:311577 details. Because textconv filters are typically a one-way
1578 conversion, the resulting diff is suitable for human
1579 consumption, but cannot be applied. For this reason, textconv
Junio C Hamanoa28a9202012-06-21 07:08:231580 filters are enabled by default only for <a href="git-diff.html">git-diff(1)</a> and
1581 <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:311582 diff plumbing commands.
1583</p>
1584</dd>
1585<dt class="hdlist1">
Junio C Hamano7d449522010-07-01 00:08:511586--ignore-submodules[=&lt;when&gt;]
Junio C Hamanodfccbb02008-05-26 01:16:141587</dt>
1588<dd>
1589<p>
Junio C Hamano7d449522010-07-01 00:08:511590 Ignore changes to submodules in the diff generation. &lt;when&gt; can be
Junio C Hamanoc7102962013-05-29 23:57:171591 either "none", "untracked", "dirty" or "all", which is the default.
Junio C Hamano619596a2010-08-18 22:15:351592 Using "none" will consider the submodule modified when it either contains
1593 untracked or modified files or its HEAD differs from the commit recorded
1594 in the superproject and can be used to override any settings of the
Junio C Hamanoa28a9202012-06-21 07:08:231595 <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:511596 "untracked" is used submodules are not considered dirty when they only
1597 contain untracked content (but they are still scanned for modified
1598 content). Using "dirty" ignores all changes to the work tree of submodules,
1599 only changes to the commits stored in the superproject are shown (this was
1600 the behavior until 1.7.0). Using "all" hides all changes to submodules.
Junio C Hamanodfccbb02008-05-26 01:16:141601</p>
1602</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591603<dt class="hdlist1">
Junio C Hamanoe27cbd22007-12-21 17:57:331604--src-prefix=&lt;prefix&gt;
1605</dt>
1606<dd>
1607<p>
1608 Show the given source prefix instead of "a/".
1609</p>
1610</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591611<dt class="hdlist1">
Junio C Hamanoe27cbd22007-12-21 17:57:331612--dst-prefix=&lt;prefix&gt;
1613</dt>
1614<dd>
1615<p>
1616 Show the given destination prefix instead of "b/".
1617</p>
1618</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591619<dt class="hdlist1">
Junio C Hamanoe27cbd22007-12-21 17:57:331620--no-prefix
1621</dt>
1622<dd>
1623<p>
1624 Do not show any source or destination prefix.
1625</p>
1626</dd>
Junio C Hamanoba4b9282008-07-06 05:20:311627</dl></div>
Junio C Hamano68cf15a2010-11-06 01:01:591628<div class="paragraph"><p>For more detailed explanation on these common options, see also
Junio C Hamanoa28a9202012-06-21 07:08:231629<a href="gitdiffcore.html">gitdiffcore(7)</a>.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591630<div class="dlist"><dl>
1631<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231632&lt;tree-ish&gt;
1633</dt>
1634<dd>
1635<p>
1636 The id of a tree object.
1637</p>
1638</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591639<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231640&lt;path&gt;&#8230;
1641</dt>
1642<dd>
1643<p>
1644 If provided, the results are limited to a subset of files
1645 matching one of these prefix strings.
Junio C Hamano9629d4f2012-12-19 00:28:271646 i.e., file matches <code>/^&lt;pattern1&gt;|&lt;pattern2&gt;|.../</code>
Junio C Hamano1a4e8412005-12-27 08:17:231647 Note that this parameter does not provide any wildcard or regexp
1648 features.
1649</p>
1650</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591651<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231652-r
1653</dt>
1654<dd>
1655<p>
1656 recurse into sub-trees
1657</p>
1658</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591659<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231660-t
1661</dt>
1662<dd>
1663<p>
1664 show tree entry itself as well as subtrees. Implies -r.
1665</p>
1666</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591667<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231668--root
1669</dt>
1670<dd>
1671<p>
Junio C Hamano54bf1e22008-12-20 06:30:111672 When <em>--root</em> is specified the initial commit will be shown as a big
Junio C Hamano1a4e8412005-12-27 08:17:231673 creation event. This is equivalent to a diff against the NULL tree.
1674</p>
1675</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591676<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231677--stdin
1678</dt>
1679<dd>
1680<p>
1681 When <em>--stdin</em> is specified, the command does not take
1682 &lt;tree-ish&gt; arguments from the command line. Instead, it
Junio C Hamano3f2f6e52008-08-21 10:34:221683 reads lines containing either two &lt;tree&gt;, one &lt;commit&gt;, or a
1684 list of &lt;commit&gt; from its standard input. (Use a single space
1685 as separator.)
Junio C Hamano1a4e8412005-12-27 08:17:231686</p>
Junio C Hamano68cf15a2010-11-06 01:01:591687<div class="paragraph"><p>When two trees are given, it compares the first tree with the second.
Junio C Hamano3f2f6e52008-08-21 10:34:221688When a single commit is given, it compares the commit with its
1689parents. The remaining commits, when given, are used as if they are
Junio C Hamanob53db3c2008-08-07 00:17:521690parents of the first commit.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591691<div class="paragraph"><p>When comparing two trees, the ID of both trees (separated by a space
Junio C Hamano3f2f6e52008-08-21 10:34:221692and terminated by a newline) is printed before the difference. When
1693comparing commits, the ID of the first (or only) commit, followed by a
1694newline, is printed.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591695<div class="paragraph"><p>The following flags further affect the behavior when comparing
Junio C Hamano3f2f6e52008-08-21 10:34:221696commits (but not trees).</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231697</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591698<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231699-m
1700</dt>
1701<dd>
1702<p>
Junio C Hamano1aa40d22010-01-21 17:46:431703 By default, <em>git diff-tree --stdin</em> does not show
Junio C Hamano1a4e8412005-12-27 08:17:231704 differences for merge commits. With this flag, it shows
Junio C Hamanoa8adb1e2006-04-10 23:46:161705 differences to that commit from all of its parents. See
1706 also <em>-c</em>.
Junio C Hamano1a4e8412005-12-27 08:17:231707</p>
1708</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591709<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231710-s
1711</dt>
1712<dd>
1713<p>
Junio C Hamano1aa40d22010-01-21 17:46:431714 By default, <em>git diff-tree --stdin</em> shows differences,
Junio C Hamano1a4e8412005-12-27 08:17:231715 either in machine-readable form (without <em>-p</em>) or in patch
Junio C Hamano235a91e2006-01-07 01:13:581716 form (with <em>-p</em>). This output can be suppressed. It is
Junio C Hamano1a4e8412005-12-27 08:17:231717 only useful with <em>-v</em> flag.
1718</p>
1719</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591720<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231721-v
1722</dt>
1723<dd>
1724<p>
Junio C Hamano1aa40d22010-01-21 17:46:431725 This flag causes <em>git diff-tree --stdin</em> to also show
Junio C Hamano1a4e8412005-12-27 08:17:231726 the commit message before the differences.
1727</p>
1728</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591729<dt class="hdlist1">
Junio C Hamanod2179ef2010-10-22 04:12:171730--pretty[=&lt;format&gt;]
Junio C Hamano1a4e8412005-12-27 08:17:231731</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591732<dt class="hdlist1">
Junio C Hamanod2179ef2010-10-22 04:12:171733--format=&lt;format&gt;
Junio C Hamano0a235222009-03-06 08:21:091734</dt>
Junio C Hamano1a4e8412005-12-27 08:17:231735<dd>
1736<p>
Junio C Hamanoa3770f92007-07-25 08:53:331737 Pretty-print the contents of the commit logs in a given format,
Junio C Hamano0430e3a2007-05-15 03:13:171738 where <em>&lt;format&gt;</em> can be one of <em>oneline</em>, <em>short</em>, <em>medium</em>,
Junio C Hamanoe32ec8b2010-06-02 23:32:311739 <em>full</em>, <em>fuller</em>, <em>email</em>, <em>raw</em> and <em>format:&lt;string&gt;</em>. See
1740 the "PRETTY FORMATS" section for some additional details for each
1741 format. When omitted, the format defaults to <em>medium</em>.
Junio C Hamano1a4e8412005-12-27 08:17:231742</p>
Junio C Hamano68cf15a2010-11-06 01:01:591743<div class="paragraph"><p>Note: you can specify the default pretty format in the repository
Junio C Hamanoa28a9202012-06-21 07:08:231744configuration (see <a href="git-config.html">git-config(1)</a>).</p></div>
Junio C Hamano0430e3a2007-05-15 03:13:171745</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591746<dt class="hdlist1">
Junio C Hamanoee695f22007-06-21 00:35:361747--abbrev-commit
1748</dt>
1749<dd>
1750<p>
1751 Instead of showing the full 40-byte hexadecimal commit object
Junio C Hamano6efe3022009-01-13 16:47:561752 name, show only a partial prefix. Non default number of
Junio C Hamanoee695f22007-06-21 00:35:361753 digits can be specified with "--abbrev=&lt;n&gt;" (which also modifies
1754 diff output, if it is displayed).
1755</p>
Junio C Hamano68cf15a2010-11-06 01:01:591756<div class="paragraph"><p>This should make "--pretty=oneline" a whole lot more readable for
Junio C Hamanoba4b9282008-07-06 05:20:311757people using 80-column terminals.</p></div>
Junio C Hamanoee695f22007-06-21 00:35:361758</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591759<dt class="hdlist1">
Junio C Hamanof93530e2011-05-25 23:59:591760--no-abbrev-commit
1761</dt>
1762<dd>
1763<p>
1764 Show the full 40-byte hexadecimal commit object name. This negates
Junio C Hamano9629d4f2012-12-19 00:28:271765 <code>--abbrev-commit</code> and those options which imply it such as
Junio C Hamanof93530e2011-05-25 23:59:591766 "--oneline". It also overrides the <em>log.abbrevCommit</em> variable.
1767</p>
1768</dd>
1769<dt class="hdlist1">
Junio C Hamano0a235222009-03-06 08:21:091770--oneline
1771</dt>
1772<dd>
1773<p>
1774 This is a shorthand for "--pretty=oneline --abbrev-commit"
1775 used together.
1776</p>
1777</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591778<dt class="hdlist1">
Junio C Hamanoc5bb3b32013-08-05 22:43:361779--encoding=&lt;encoding&gt;
Junio C Hamano0430e3a2007-05-15 03:13:171780</dt>
1781<dd>
1782<p>
1783 The commit objects record the encoding used for the log message
1784 in their encoding header; this option can be used to tell the
1785 command to re-code the commit log message in the encoding
1786 preferred by the user. For non plumbing commands this
1787 defaults to UTF-8.
1788</p>
1789</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591790<dt class="hdlist1">
Junio C Hamano60033462011-05-03 00:48:431791--notes[=&lt;ref&gt;]
Junio C Hamano57827fb2010-01-23 03:02:501792</dt>
1793<dd>
1794<p>
Junio C Hamanoa28a9202012-06-21 07:08:231795 Show the notes (see <a href="git-notes.html">git-notes(1)</a>) that annotate the
Junio C Hamano57827fb2010-01-23 03:02:501796 commit, when showing the commit log message. This is the default
Junio C Hamano9629d4f2012-12-19 00:28:271797 for <code>git log</code>, <code>git show</code> and <code>git whatchanged</code> commands when
1798 there is no <code>--pretty</code>, <code>--format</code> nor <code>--oneline</code> option given
Junio C Hamano60033462011-05-03 00:48:431799 on the command line.
Junio C Hamano57827fb2010-01-23 03:02:501800</p>
Junio C Hamano60033462011-05-03 00:48:431801<div class="paragraph"><p>By default, the notes shown are from the notes refs listed in the
1802<em>core.notesRef</em> and <em>notes.displayRef</em> variables (or corresponding
Junio C Hamanoa28a9202012-06-21 07:08:231803environment overrides). See <a href="git-config.html">git-config(1)</a> for more details.</p></div>
Junio C Hamano60033462011-05-03 00:48:431804<div class="paragraph"><p>With an optional <em>&lt;ref&gt;</em> argument, show this notes ref instead of the
Junio C Hamano9629d4f2012-12-19 00:28:271805default notes ref(s). The ref is taken to be in <code>refs/notes/</code> if it
Junio C Hamano60033462011-05-03 00:48:431806is not qualified.</p></div>
1807<div class="paragraph"><p>Multiple --notes options can be combined to control which notes are
1808being displayed. Examples: "--notes=foo" will show only notes from
1809"refs/notes/foo"; "--notes=foo --notes" will show both notes from
1810"refs/notes/foo" and from the default notes ref(s).</p></div>
Junio C Hamano31667362010-03-25 00:38:531811</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591812<dt class="hdlist1">
Junio C Hamano60033462011-05-03 00:48:431813--no-notes
1814</dt>
1815<dd>
1816<p>
Junio C Hamano9629d4f2012-12-19 00:28:271817 Do not show notes. This negates the above <code>--notes</code> option, by
Junio C Hamano60033462011-05-03 00:48:431818 resetting the list of notes refs from which notes are shown.
1819 Options are parsed in the order given on the command line, so e.g.
1820 "--notes --notes=foo --no-notes --notes=bar" will only show notes
1821 from "refs/notes/bar".
1822</p>
1823</dd>
1824<dt class="hdlist1">
1825--show-notes[=&lt;ref&gt;]
1826</dt>
1827<dt class="hdlist1">
Junio C Hamano31667362010-03-25 00:38:531828--[no-]standard-notes
1829</dt>
1830<dd>
1831<p>
Junio C Hamano60033462011-05-03 00:48:431832 These options are deprecated. Use the above --notes/--no-notes
1833 options instead.
Junio C Hamano31667362010-03-25 00:38:531834</p>
Junio C Hamano57827fb2010-01-23 03:02:501835</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591836<dt class="hdlist1">
Junio C Hamano0acb1ae2012-09-24 21:28:131837--show-signature
1838</dt>
1839<dd>
1840<p>
1841 Check the validity of a signed commit object by passing the signature
Junio C Hamano9629d4f2012-12-19 00:28:271842 to <code>gpg --verify</code> and show the output.
Junio C Hamano0acb1ae2012-09-24 21:28:131843</p>
1844</dd>
1845<dt class="hdlist1">
Junio C Hamano0430e3a2007-05-15 03:13:171846--no-commit-id
1847</dt>
1848<dd>
1849<p>
Junio C Hamano1aa40d22010-01-21 17:46:431850 <em>git diff-tree</em> outputs a line with the commit ID when
Junio C Hamano0430e3a2007-05-15 03:13:171851 applicable. This flag suppressed the commit ID output.
1852</p>
1853</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591854<dt class="hdlist1">
Junio C Hamano0430e3a2007-05-15 03:13:171855-c
1856</dt>
1857<dd>
1858<p>
1859 This flag changes the way a merge commit is displayed
1860 (which means it is useful only when the command is given
1861 one &lt;tree-ish&gt;, or <em>--stdin</em>). It shows the differences
1862 from each of the parents to the merge result simultaneously
1863 instead of showing pairwise diff between a parent and the
1864 result one at a time (which is what the <em>-m</em> option does).
1865 Furthermore, it lists only files which were modified
1866 from all parents.
1867</p>
1868</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591869<dt class="hdlist1">
Junio C Hamano0430e3a2007-05-15 03:13:171870--cc
1871</dt>
1872<dd>
1873<p>
1874 This flag changes the way a merge commit patch is displayed,
1875 in a similar way to the <em>-c</em> option. It implies the <em>-c</em>
1876 and <em>-p</em> options and further compresses the patch output
Junio C Hamanoccc2f762008-07-24 04:03:331877 by omitting uninteresting hunks whose the contents in the parents
1878 have only two variants and the merge result picks one of them
1879 without modification. When all hunks are uninteresting, the commit
1880 itself and the commit log message is not shown, just like in any other
1881 "empty diff" case.
Junio C Hamano0430e3a2007-05-15 03:13:171882</p>
1883</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591884<dt class="hdlist1">
Junio C Hamano0430e3a2007-05-15 03:13:171885--always
1886</dt>
1887<dd>
1888<p>
1889 Show the commit itself and the commit log message even
1890 if the diff itself is empty.
1891</p>
1892</dd>
Junio C Hamanoba4b9282008-07-06 05:20:311893</dl></div>
Junio C Hamano0430e3a2007-05-15 03:13:171894</div>
Junio C Hamano9629d4f2012-12-19 00:28:271895</div>
1896<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:311897<h2 id="_pretty_formats">PRETTY FORMATS</h2>
Junio C Hamano0430e3a2007-05-15 03:13:171898<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:591899<div class="paragraph"><p>If the commit is a merge, and if the pretty-format
Junio C Hamano0430e3a2007-05-15 03:13:171900is not <em>oneline</em>, <em>email</em> or <em>raw</em>, an additional line is
1901inserted before the <em>Author:</em> line. This line begins with
1902"Merge: " and the sha1s of ancestral commits are printed,
1903separated by spaces. Note that the listed commits may not
1904necessarily be the list of the <strong>direct</strong> parent commits if you
1905have limited your view of history: for example, if you are
1906only interested in changes related to a certain directory or
Junio C Hamanoba4b9282008-07-06 05:20:311907file.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591908<div class="paragraph"><p>There are several built-in formats, and you can define
Junio C Hamanoa574a092010-06-13 19:57:101909additional formats by setting a pretty.&lt;name&gt;
1910config option to either another format name, or a
1911<em>format:</em> string, as described below (see
Junio C Hamanoa28a9202012-06-21 07:08:231912<a href="git-config.html">git-config(1)</a>). Here are the details of the
Junio C Hamanoa574a092010-06-13 19:57:101913built-in formats:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591914<div class="ulist"><ul>
Junio C Hamanoa340aaa2006-11-23 02:47:331915<li>
1916<p>
1917<em>oneline</em>
1918</p>
1919<div class="literalblock">
1920<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:271921<pre><code>&lt;sha1&gt; &lt;title line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:331922</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591923<div class="paragraph"><p>This is designed to be as compact as possible.</p></div>
Junio C Hamanoa340aaa2006-11-23 02:47:331924</li>
1925<li>
1926<p>
1927<em>short</em>
1928</p>
1929<div class="literalblock">
1930<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:271931<pre><code>commit &lt;sha1&gt;
1932Author: &lt;author&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:331933</div></div>
1934<div class="literalblock">
1935<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:271936<pre><code>&lt;title line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:331937</div></div>
1938</li>
1939<li>
1940<p>
1941<em>medium</em>
1942</p>
1943<div class="literalblock">
1944<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:271945<pre><code>commit &lt;sha1&gt;
Junio C Hamanoa340aaa2006-11-23 02:47:331946Author: &lt;author&gt;
Junio C Hamano9629d4f2012-12-19 00:28:271947Date: &lt;author date&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:331948</div></div>
1949<div class="literalblock">
1950<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:271951<pre><code>&lt;title line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:331952</div></div>
1953<div class="literalblock">
1954<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:271955<pre><code>&lt;full commit message&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:331956</div></div>
1957</li>
1958<li>
1959<p>
1960<em>full</em>
1961</p>
1962<div class="literalblock">
1963<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:271964<pre><code>commit &lt;sha1&gt;
Junio C Hamanoa340aaa2006-11-23 02:47:331965Author: &lt;author&gt;
Junio C Hamano9629d4f2012-12-19 00:28:271966Commit: &lt;committer&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:331967</div></div>
1968<div class="literalblock">
1969<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:271970<pre><code>&lt;title line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:331971</div></div>
1972<div class="literalblock">
1973<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:271974<pre><code>&lt;full commit message&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:331975</div></div>
1976</li>
1977<li>
1978<p>
1979<em>fuller</em>
1980</p>
1981<div class="literalblock">
1982<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:271983<pre><code>commit &lt;sha1&gt;
Junio C Hamano6a3c8272008-12-19 21:38:181984Author: &lt;author&gt;
Junio C Hamanoba4b9282008-07-06 05:20:311985AuthorDate: &lt;author date&gt;
Junio C Hamano6a3c8272008-12-19 21:38:181986Commit: &lt;committer&gt;
Junio C Hamano9629d4f2012-12-19 00:28:271987CommitDate: &lt;committer date&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:331988</div></div>
1989<div class="literalblock">
1990<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:271991<pre><code>&lt;title line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:331992</div></div>
1993<div class="literalblock">
1994<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:271995<pre><code>&lt;full commit message&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:331996</div></div>
1997</li>
1998<li>
1999<p>
2000<em>email</em>
2001</p>
2002<div class="literalblock">
2003<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272004<pre><code>From &lt;sha1&gt; &lt;date&gt;
Junio C Hamanoa340aaa2006-11-23 02:47:332005From: &lt;author&gt;
Junio C Hamanoba4b9282008-07-06 05:20:312006Date: &lt;author date&gt;
Junio C Hamano9629d4f2012-12-19 00:28:272007Subject: [PATCH] &lt;title line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332008</div></div>
2009<div class="literalblock">
2010<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272011<pre><code>&lt;full commit message&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332012</div></div>
2013</li>
2014<li>
2015<p>
2016<em>raw</em>
2017</p>
Junio C Hamano68cf15a2010-11-06 01:01:592018<div class="paragraph"><p>The <em>raw</em> format shows the entire commit exactly as
Junio C Hamanoe3f080d2013-04-22 02:27:132019stored in the commit object. Notably, the SHA-1s are
Junio C Hamanoa340aaa2006-11-23 02:47:332020displayed in full, regardless of whether --abbrev or
2021--no-abbrev are used, and <em>parents</em> information show the
2022true parent commits, without taking grafts nor history
Junio C Hamanoba4b9282008-07-06 05:20:312023simplification into account.</p></div>
Junio C Hamanoa340aaa2006-11-23 02:47:332024</li>
Junio C Hamanoa3fd83c2007-03-02 10:34:362025<li>
2026<p>
Junio C Hamanoe32ec8b2010-06-02 23:32:312027<em>format:&lt;string&gt;</em>
Junio C Hamanoa3fd83c2007-03-02 10:34:362028</p>
Junio C Hamano68cf15a2010-11-06 01:01:592029<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:362030you want to show. It works a little bit like printf format,
2031with the notable exception that you get a newline with <em>%n</em>
Junio C Hamanoba4b9282008-07-06 05:20:312032instead of <em>\n</em>.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592033<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:312034would show something like this:</p></div>
Junio C Hamano0430e3a2007-05-15 03:13:172035<div class="listingblock">
2036<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272037<pre><code>The author of fe6e0ee was Junio C Hamano, 23 hours ago
2038The 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:172039</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592040<div class="paragraph"><p>The placeholders are:</p></div>
2041<div class="ulist"><ul>
Junio C Hamanoa3fd83c2007-03-02 10:34:362042<li>
2043<p>
2044<em>%H</em>: commit hash
2045</p>
2046</li>
2047<li>
2048<p>
2049<em>%h</em>: abbreviated commit hash
2050</p>
2051</li>
2052<li>
2053<p>
2054<em>%T</em>: tree hash
2055</p>
2056</li>
2057<li>
2058<p>
2059<em>%t</em>: abbreviated tree hash
2060</p>
2061</li>
2062<li>
2063<p>
2064<em>%P</em>: parent hashes
2065</p>
2066</li>
2067<li>
2068<p>
2069<em>%p</em>: abbreviated parent hashes
2070</p>
2071</li>
2072<li>
2073<p>
2074<em>%an</em>: author name
2075</p>
2076</li>
2077<li>
2078<p>
Junio C Hamano04e768d2013-04-23 19:19:262079<em>%aN</em>: author name (respecting .mailmap, see <a href="git-shortlog.html">git-shortlog(1)</a>
2080 or <a href="git-blame.html">git-blame(1)</a>)
Junio C Hamanof5a93622008-07-16 03:23:572081</p>
2082</li>
2083<li>
2084<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:362085<em>%ae</em>: author email
2086</p>
2087</li>
2088<li>
2089<p>
Junio C Hamano04e768d2013-04-23 19:19:262090<em>%aE</em>: author email (respecting .mailmap, see
2091 <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:192092</p>
2093</li>
2094<li>
2095<p>
Junio C Hamanoa387df32008-08-29 08:56:582096<em>%ad</em>: author date (format respects --date= option)
Junio C Hamanoa3fd83c2007-03-02 10:34:362097</p>
2098</li>
2099<li>
2100<p>
2101<em>%aD</em>: author date, RFC2822 style
2102</p>
2103</li>
2104<li>
2105<p>
2106<em>%ar</em>: author date, relative
2107</p>
2108</li>
2109<li>
2110<p>
2111<em>%at</em>: author date, UNIX timestamp
2112</p>
2113</li>
2114<li>
2115<p>
Junio C Hamano02f130b2007-07-14 08:26:562116<em>%ai</em>: author date, ISO 8601 format
2117</p>
2118</li>
2119<li>
2120<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:362121<em>%cn</em>: committer name
2122</p>
2123</li>
2124<li>
2125<p>
Junio C Hamano04e768d2013-04-23 19:19:262126<em>%cN</em>: committer name (respecting .mailmap, see
2127 <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:572128</p>
2129</li>
2130<li>
2131<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:362132<em>%ce</em>: committer email
2133</p>
2134</li>
2135<li>
2136<p>
Junio C Hamano04e768d2013-04-23 19:19:262137<em>%cE</em>: committer email (respecting .mailmap, see
2138 <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:192139</p>
2140</li>
2141<li>
2142<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:362143<em>%cd</em>: committer date
2144</p>
2145</li>
2146<li>
2147<p>
2148<em>%cD</em>: committer date, RFC2822 style
2149</p>
2150</li>
2151<li>
2152<p>
2153<em>%cr</em>: committer date, relative
2154</p>
2155</li>
2156<li>
2157<p>
2158<em>%ct</em>: committer date, UNIX timestamp
2159</p>
2160</li>
2161<li>
2162<p>
Junio C Hamano02f130b2007-07-14 08:26:562163<em>%ci</em>: committer date, ISO 8601 format
2164</p>
2165</li>
2166<li>
2167<p>
Junio C Hamanoa28a9202012-06-21 07:08:232168<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:022169</p>
2170</li>
2171<li>
2172<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:362173<em>%e</em>: encoding
2174</p>
2175</li>
2176<li>
2177<p>
2178<em>%s</em>: subject
2179</p>
2180</li>
2181<li>
2182<p>
Junio C Hamano5f9a6f02009-04-06 08:26:562183<em>%f</em>: sanitized subject line, suitable for a filename
2184</p>
2185</li>
2186<li>
2187<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:362188<em>%b</em>: body
2189</p>
2190</li>
2191<li>
2192<p>
Junio C Hamanocb39aea2010-05-09 07:24:482193<em>%B</em>: raw body (unwrapped subject and body)
2194</p>
2195</li>
2196<li>
2197<p>
Junio C Hamano3b70d3c2009-11-21 17:37:372198<em>%N</em>: commit notes
2199</p>
2200</li>
2201<li>
2202<p>
Junio C Hamano0acb1ae2012-09-24 21:28:132203<em>%GG</em>: raw verification message from GPG for a signed commit
2204</p>
2205</li>
2206<li>
2207<p>
Junio C Hamanoedf80bd2013-04-05 22:14:362208<em>%G?</em>: show "G" for a Good signature, "B" for a Bad signature, "U" for a good,
2209 untrusted signature and "N" for no signature
Junio C Hamano0acb1ae2012-09-24 21:28:132210</p>
2211</li>
2212<li>
2213<p>
2214<em>%GS</em>: show the name of the signer for a signed commit
2215</p>
2216</li>
2217<li>
2218<p>
Junio C Hamano5e7f1312013-03-21 22:49:012219<em>%GK</em>: show the key used to sign a signed commit
2220</p>
2221</li>
2222<li>
2223<p>
Junio C Hamano9629d4f2012-12-19 00:28:272224<em>%gD</em>: reflog selector, e.g., <code>refs/stash@{1}</code>
Junio C Hamanoc21ab052009-10-31 04:03:552225</p>
2226</li>
2227<li>
2228<p>
Junio C Hamano9629d4f2012-12-19 00:28:272229<em>%gd</em>: shortened reflog selector, e.g., <code>stash@{1}</code>
Junio C Hamanoc21ab052009-10-31 04:03:552230</p>
2231</li>
2232<li>
2233<p>
Junio C Hamano962f3a32011-12-22 20:21:442234<em>%gn</em>: reflog identity name
2235</p>
2236</li>
2237<li>
2238<p>
Junio C Hamano04e768d2013-04-23 19:19:262239<em>%gN</em>: reflog identity name (respecting .mailmap, see
2240 <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:442241</p>
2242</li>
2243<li>
2244<p>
2245<em>%ge</em>: reflog identity email
2246</p>
2247</li>
2248<li>
2249<p>
Junio C Hamano04e768d2013-04-23 19:19:262250<em>%gE</em>: reflog identity email (respecting .mailmap, see
2251 <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:442252</p>
2253</li>
2254<li>
2255<p>
Junio C Hamanoc21ab052009-10-31 04:03:552256<em>%gs</em>: reflog subject
2257</p>
2258</li>
2259<li>
2260<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:362261<em>%Cred</em>: switch color to red
2262</p>
2263</li>
2264<li>
2265<p>
2266<em>%Cgreen</em>: switch color to green
2267</p>
2268</li>
2269<li>
2270<p>
2271<em>%Cblue</em>: switch color to blue
2272</p>
2273</li>
2274<li>
2275<p>
2276<em>%Creset</em>: reset color
2277</p>
2278</li>
2279<li>
2280<p>
Junio C Hamanoabad6da2013-01-06 09:06:322281<em>%C(&#8230;)</em>: color specification, as described in color.branch.* config option;
2282 adding <code>auto,</code> at the beginning will emit color only when colors are
2283 enabled for log output (by <code>color.diff</code>, <code>color.ui</code>, or <code>--color</code>, and
2284 respecting the <code>auto</code> settings of the former if we are going to a
Junio C Hamano04e768d2013-04-23 19:19:262285 terminal). <code>auto</code> alone (i.e. <code>%C(auto)</code>) will turn on auto coloring
2286 on the next placeholders until the color is switched again.
Junio C Hamanocc0cb312009-01-22 03:38:502287</p>
2288</li>
2289<li>
2290<p>
Junio C Hamanod9e0e5d2007-04-14 16:22:042291<em>%m</em>: left, right or boundary mark
2292</p>
2293</li>
2294<li>
2295<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:362296<em>%n</em>: newline
2297</p>
Junio C Hamano0430e3a2007-05-15 03:13:172298</li>
Junio C Hamanob78d2592008-04-09 09:39:082299<li>
2300<p>
Junio C Hamanoa9701f02010-01-21 00:42:162301<em>%%</em>: a raw <em>%</em>
2302</p>
2303</li>
2304<li>
2305<p>
Junio C Hamanob78d2592008-04-09 09:39:082306<em>%x00</em>: print a byte from a hex code
2307</p>
2308</li>
Junio C Hamanobf984de2009-11-23 06:11:192309<li>
2310<p>
2311<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:232312 <a href="git-shortlog.html">git-shortlog(1)</a>.
Junio C Hamanobf984de2009-11-23 06:11:192313</p>
2314</li>
Junio C Hamano04e768d2013-04-23 19:19:262315<li>
2316<p>
2317<em>%&lt;(&lt;N&gt;[,trunc|ltrunc|mtrunc])</em>: make the next placeholder take at
2318 least N columns, padding spaces on the right if necessary.
2319 Optionally truncate at the beginning (ltrunc), the middle (mtrunc)
2320 or the end (trunc) if the output is longer than N columns.
2321 Note that truncating only works correctly with N &gt;= 2.
2322</p>
2323</li>
2324<li>
2325<p>
2326<em>%&lt;|(&lt;N&gt;)</em>: make the next placeholder take at least until Nth
2327 columns, padding spaces on the right if necessary
2328</p>
2329</li>
2330<li>
2331<p>
2332<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>
2333 respectively, but padding spaces on the left
2334</p>
2335</li>
2336<li>
2337<p>
2338<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>
2339 respectively, except that if the next placeholder takes more spaces
2340 than given and there are spaces on its left, use those spaces
2341</p>
2342</li>
2343<li>
2344<p>
2345<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>
2346 respectively, but padding both sides (i.e. the text is centered)
2347</p>
2348</li>
Junio C Hamanoba4b9282008-07-06 05:20:312349</ul></div>
Junio C Hamanoa3fd83c2007-03-02 10:34:362350</li>
Junio C Hamanoc21ab052009-10-31 04:03:552351</ul></div>
2352<div class="admonitionblock">
2353<table><tr>
2354<td class="icon">
2355<div class="title">Note</div>
2356</td>
2357<td class="content">Some placeholders may depend on other options given to the
Junio C Hamano9629d4f2012-12-19 00:28:272358revision traversal engine. For example, the <code>%g*</code> reflog options will
Junio C Hamanoc21ab052009-10-31 04:03:552359insert an empty string unless we are traversing reflog entries (e.g., by
Junio C Hamano9629d4f2012-12-19 00:28:272360<code>git log -g</code>). The <code>%d</code> placeholder will use the "short" decoration
2361format if <code>--decorate</code> was not already provided on the command line.</td>
Junio C Hamanoc21ab052009-10-31 04:03:552362</tr></table>
2363</div>
Junio C Hamano9629d4f2012-12-19 00:28:272364<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:592365is inserted immediately before the expansion if and only if the
2366placeholder expands to a non-empty string.</p></div>
Junio C Hamano9629d4f2012-12-19 00:28:272367<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:592368immediately precede the expansion are deleted if and only if the
2369placeholder expands to an empty string.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592370<div class="paragraph"><p>If you add a ` ` (space) after <em>%</em> of a placeholder, a space
Junio C Hamano89a57342010-06-22 23:22:552371is inserted immediately before the expansion if and only if the
2372placeholder expands to a non-empty string.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592373<div class="ulist"><ul>
Junio C Hamano6fb124c2008-06-13 10:04:012374<li>
2375<p>
2376<em>tformat:</em>
2377</p>
Junio C Hamano68cf15a2010-11-06 01:01:592378<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:012379provides "terminator" semantics instead of "separator" semantics. In
2380other words, each commit has the message terminator character (usually a
2381newline) appended, rather than a separator placed between entries.
2382This means that the final entry of a single-line format will be properly
2383terminated with a new line, just as the "oneline" format does.
Junio C Hamanoba4b9282008-07-06 05:20:312384For example:</p></div>
Junio C Hamano6fb124c2008-06-13 10:04:012385<div class="listingblock">
2386<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272387<pre><code>$ git log -2 --pretty=format:%h 4da45bef \
Junio C Hamano6fb124c2008-06-13 10:04:012388 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
23894da45be
23907134973 -- NO NEWLINE
2391
2392$ git log -2 --pretty=tformat:%h 4da45bef \
2393 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
23944da45be
Junio C Hamano9629d4f2012-12-19 00:28:2723957134973</code></pre>
Junio C Hamano6fb124c2008-06-13 10:04:012396</div></div>
Junio C Hamano9629d4f2012-12-19 00:28:272397<div class="paragraph"><p>In addition, any unrecognized string that has a <code>%</code> in it is interpreted
2398as if it has <code>tformat:</code> in front of it. For example, these two are
Junio C Hamano0a235222009-03-06 08:21:092399equivalent:</p></div>
2400<div class="listingblock">
2401<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272402<pre><code>$ git log -2 --pretty=tformat:%h 4da45bef
2403$ git log -2 --pretty=%h 4da45bef</code></pre>
Junio C Hamano0a235222009-03-06 08:21:092404</div></div>
Junio C Hamano6fb124c2008-06-13 10:04:012405</li>
Junio C Hamanoba4b9282008-07-06 05:20:312406</ul></div>
Junio C Hamano1a4e8412005-12-27 08:17:232407</div>
Junio C Hamano9629d4f2012-12-19 00:28:272408</div>
2409<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:312410<h2 id="_limiting_output">Limiting Output</h2>
Junio C Hamano1a4e8412005-12-27 08:17:232411<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:592412<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:312413example some architecture-specific files, you might do:</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232414<div class="literalblock">
2415<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272416<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:232417</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592418<div class="paragraph"><p>and it will only show you what changed in those two directories.</p></div>
Junio C Hamano9629d4f2012-12-19 00:28:272419<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:232420<div class="literalblock">
2421<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272422<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:232423</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592424<div class="paragraph"><p>and it will ignore all differences to other files.</p></div>
2425<div class="paragraph"><p>The pattern is always the prefix, and is matched exactly. There are no
Junio C Hamano1a4e8412005-12-27 08:17:232426wildcards. Even stricter, it has to match a complete path component.
Junio C Hamano9629d4f2012-12-19 00:28:272427I.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:312428so it can be used to name subdirectories.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592429<div class="paragraph"><p>An example of normal usage is:</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232430<div class="literalblock">
2431<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272432<pre><code>torvalds@ppc970:~/git&gt; git diff-tree --abbrev 5319e4
2433:100664 100664 ac348b... a01513... git-fsck-objects.c</code></pre>
Junio C Hamano1a4e8412005-12-27 08:17:232434</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592435<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:312436this one:</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232437<div class="listingblock">
2438<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272439<pre><code>commit 3c6f7ca19ad4043e9e72fa94106f352897e651a8
Junio C Hamano1a4e8412005-12-27 08:17:232440tree 5319e4d609cdd282069cc4dce33c1db559539b03
2441parent b4e628ea30d5ab3606119d2ea5caeab141d38df7
2442author Linus Torvalds &lt;torvalds@ppc970.osdl.org&gt; Sat Apr 9 12:02:30 2005
2443committer Linus Torvalds &lt;torvalds@ppc970.osdl.org&gt; Sat Apr 9 12:02:30 2005
2444
2445Make "git-fsck-objects" print out all the root commits it finds.
2446
2447Once I do the reference tracking, I'll also make it print out all the
Junio C Hamano9629d4f2012-12-19 00:28:272448HEAD commits it finds, which is even more interesting.</code></pre>
Junio C Hamano1a4e8412005-12-27 08:17:232449</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592450<div class="paragraph"><p>in case you care).</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232451</div>
Junio C Hamano9629d4f2012-12-19 00:28:272452</div>
2453<div class="sect1">
Junio C Hamano543f8d62009-07-29 08:35:212454<h2 id="_raw_output_format">Raw output format</h2>
Junio C Hamano1a4e8412005-12-27 08:17:232455<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:592456<div class="paragraph"><p>The raw output format from "git-diff-index", "git-diff-tree",
Junio C Hamanoba4b9282008-07-06 05:20:312457"git-diff-files" and "git diff --raw" are very similar.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592458<div class="paragraph"><p>These commands all compare two sets of things; what is
Junio C Hamanoba4b9282008-07-06 05:20:312459compared differs:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592460<div class="dlist"><dl>
2461<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:232462git-diff-index &lt;tree-ish&gt;
2463</dt>
2464<dd>
2465<p>
2466 compares the &lt;tree-ish&gt; and the files on the filesystem.
2467</p>
2468</dd>
Junio C Hamano68cf15a2010-11-06 01:01:592469<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:232470git-diff-index --cached &lt;tree-ish&gt;
2471</dt>
2472<dd>
2473<p>
2474 compares the &lt;tree-ish&gt; and the index.
2475</p>
2476</dd>
Junio C Hamano68cf15a2010-11-06 01:01:592477<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:232478git-diff-tree [-r] &lt;tree-ish-1&gt; &lt;tree-ish-2&gt; [&lt;pattern&gt;&#8230;]
2479</dt>
2480<dd>
2481<p>
2482 compares the trees named by the two arguments.
2483</p>
2484</dd>
Junio C Hamano68cf15a2010-11-06 01:01:592485<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:232486git-diff-files [&lt;pattern&gt;&#8230;]
2487</dt>
2488<dd>
2489<p>
2490 compares the index and the files on the filesystem.
2491</p>
2492</dd>
Junio C Hamanoba4b9282008-07-06 05:20:312493</dl></div>
Junio C Hamano68cf15a2010-11-06 01:01:592494<div class="paragraph"><p>The "git-diff-tree" command begins its output by printing the hash of
Junio C Hamano543f8d62009-07-29 08:35:212495what is being compared. After that, all the commands print one output
2496line per changed file.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592497<div class="paragraph"><p>An output line is formatted this way:</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232498<div class="listingblock">
2499<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272500<pre><code>in-place edit :100644 100644 bcd1234... 0123456... M file0
Junio C Hamano1a4e8412005-12-27 08:17:232501copy-edit :100644 100644 abcd123... 1234567... C68 file1 file2
2502rename-edit :100644 100644 abcd123... 1234567... R86 file1 file3
2503create :000000 100644 0000000... 1234567... A file4
2504delete :100644 000000 1234567... 0000000... D file5
Junio C Hamano9629d4f2012-12-19 00:28:272505unmerged :000000 000000 0000000... 0000000... U file6</code></pre>
Junio C Hamano1a4e8412005-12-27 08:17:232506</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592507<div class="paragraph"><p>That is, from the left to the right:</p></div>
2508<div class="olist arabic"><ol class="arabic">
Junio C Hamano1a4e8412005-12-27 08:17:232509<li>
2510<p>
2511a colon.
2512</p>
2513</li>
2514<li>
2515<p>
2516mode for "src"; 000000 if creation or unmerged.
2517</p>
2518</li>
2519<li>
2520<p>
2521a space.
2522</p>
2523</li>
2524<li>
2525<p>
2526mode for "dst"; 000000 if deletion or unmerged.
2527</p>
2528</li>
2529<li>
2530<p>
2531a space.
2532</p>
2533</li>
2534<li>
2535<p>
2536sha1 for "src"; 0{40} if creation or unmerged.
2537</p>
2538</li>
2539<li>
2540<p>
2541a space.
2542</p>
2543</li>
2544<li>
2545<p>
2546sha1 for "dst"; 0{40} if creation, unmerged or "look at work tree".
2547</p>
2548</li>
2549<li>
2550<p>
2551a space.
2552</p>
2553</li>
2554<li>
2555<p>
2556status, followed by optional "score" number.
2557</p>
2558</li>
2559<li>
2560<p>
2561a tab or a NUL when <em>-z</em> option is used.
2562</p>
2563</li>
2564<li>
2565<p>
2566path for "src"
2567</p>
2568</li>
2569<li>
2570<p>
2571a tab or a NUL when <em>-z</em> option is used; only exists for C or R.
2572</p>
2573</li>
2574<li>
2575<p>
2576path for "dst"; only exists for C or R.
2577</p>
2578</li>
2579<li>
2580<p>
2581an LF or a NUL when <em>-z</em> option is used, to terminate the record.
2582</p>
2583</li>
Junio C Hamanoba4b9282008-07-06 05:20:312584</ol></div>
Junio C Hamano68cf15a2010-11-06 01:01:592585<div class="paragraph"><p>Possible status letters are:</p></div>
2586<div class="ulist"><ul>
Junio C Hamanoaa17c7c2008-11-03 04:36:582587<li>
2588<p>
2589A: addition of a file
2590</p>
2591</li>
2592<li>
2593<p>
2594C: copy of a file into a new one
2595</p>
2596</li>
2597<li>
2598<p>
2599D: deletion of a file
2600</p>
2601</li>
2602<li>
2603<p>
2604M: modification of the contents or mode of a file
2605</p>
2606</li>
2607<li>
2608<p>
2609R: renaming of a file
2610</p>
2611</li>
2612<li>
2613<p>
2614T: change in the type of the file
2615</p>
2616</li>
2617<li>
2618<p>
2619U: file is unmerged (you must complete the merge before it can
2620be committed)
2621</p>
2622</li>
2623<li>
2624<p>
2625X: "unknown" change type (most probably a bug, please report it)
2626</p>
2627</li>
2628</ul></div>
Junio C Hamano68cf15a2010-11-06 01:01:592629<div class="paragraph"><p>Status letters C and R are always followed by a score (denoting the
Junio C Hamanoaa17c7c2008-11-03 04:36:582630percentage of similarity between the source and target of the move or
2631copy), and are the only ones to be so.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592632<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:312633and it is out of sync with the index.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592634<div class="paragraph"><p>Example:</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232635<div class="listingblock">
2636<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272637<pre><code>:100644 100644 5be4a4...... 000000...... M file.c</code></pre>
Junio C Hamano1a4e8412005-12-27 08:17:232638</div></div>
Junio C Hamano9629d4f2012-12-19 00:28:272639<div class="paragraph"><p>When <code>-z</code> option is not used, TAB, LF, and backslash characters
2640in pathnames are represented as <code>\t</code>, <code>\n</code>, and <code>\\</code>,
Junio C Hamanoba4b9282008-07-06 05:20:312641respectively.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232642</div>
Junio C Hamano9629d4f2012-12-19 00:28:272643</div>
2644<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:312645<h2 id="_diff_format_for_merges">diff format for merges</h2>
Junio C Hamano67fad6d2007-05-06 08:53:122646<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:592647<div class="paragraph"><p>"git-diff-tree", "git-diff-files" and "git-diff --raw"
Junio C Hamano7ae0ab22007-11-03 02:46:462648can take <em>-c</em> or <em>--cc</em> option
Junio C Hamano67fad6d2007-05-06 08:53:122649to generate diff output also for merge commits. The output differs
Junio C Hamanoba4b9282008-07-06 05:20:312650from the format described above in the following way:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592651<div class="olist arabic"><ol class="arabic">
Junio C Hamano67fad6d2007-05-06 08:53:122652<li>
2653<p>
2654there is a colon for each parent
2655</p>
2656</li>
2657<li>
2658<p>
2659there are more "src" modes and "src" sha1
2660</p>
2661</li>
2662<li>
2663<p>
2664status is concatenated status characters for each parent
2665</p>
2666</li>
2667<li>
2668<p>
2669no optional "score" number
2670</p>
2671</li>
2672<li>
2673<p>
2674single path, only for "dst"
2675</p>
2676</li>
Junio C Hamanoba4b9282008-07-06 05:20:312677</ol></div>
Junio C Hamano68cf15a2010-11-06 01:01:592678<div class="paragraph"><p>Example:</p></div>
Junio C Hamano67fad6d2007-05-06 08:53:122679<div class="listingblock">
2680<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272681<pre><code>::100644 100644 100644 fabadb8... cc95eb0... 4866510... MM describe.c</code></pre>
Junio C Hamano67fad6d2007-05-06 08:53:122682</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592683<div class="paragraph"><p>Note that <em>combined diff</em> lists only files which were modified from
Junio C Hamanoba4b9282008-07-06 05:20:312684all parents.</p></div>
Junio C Hamano67fad6d2007-05-06 08:53:122685</div>
Junio C Hamano9629d4f2012-12-19 00:28:272686</div>
2687<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:312688<h2 id="_generating_patches_with_p">Generating patches with -p</h2>
Junio C Hamano1a4e8412005-12-27 08:17:232689<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:592690<div class="paragraph"><p>When "git-diff-index", "git-diff-tree", or "git-diff-files" are run
Junio C Hamano00b8b632007-12-07 09:50:492691with a <em>-p</em> option, "git diff" without the <em>--raw</em> option, or
2692"git log" with the "-p" option, they
Junio C Hamano7ae0ab22007-11-03 02:46:462693do not produce the output described above; instead they produce a
2694patch file. You can customize the creation of such patches via the
Junio C Hamanoba4b9282008-07-06 05:20:312695GIT_EXTERNAL_DIFF and the GIT_DIFF_OPTS environment variables.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592696<div class="paragraph"><p>What the -p option produces is slightly different from the traditional
Junio C Hamano7f9fa862010-10-19 23:51:142697diff format:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592698<div class="olist arabic"><ol class="arabic">
Junio C Hamano1a4e8412005-12-27 08:17:232699<li>
2700<p>
Junio C Hamano7f9fa862010-10-19 23:51:142701It is preceded with a "git diff" header that looks like this:
Junio C Hamano1a4e8412005-12-27 08:17:232702</p>
2703<div class="literalblock">
2704<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272705<pre><code>diff --git a/file1 b/file2</code></pre>
Junio C Hamano1a4e8412005-12-27 08:17:232706</div></div>
Junio C Hamano9629d4f2012-12-19 00:28:272707<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:232708involved. Especially, even for a creation or a deletion,
Junio C Hamano9629d4f2012-12-19 00:28:272709<code>/dev/null</code> is <em>not</em> used in place of the <code>a/</code> or <code>b/</code> filenames.</p></div>
2710<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:232711name of the source file of the rename/copy and the name of
Junio C Hamanoba4b9282008-07-06 05:20:312712the file that rename/copy produces, respectively.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232713</li>
2714<li>
2715<p>
2716It is followed by one or more extended header lines:
2717</p>
2718<div class="literalblock">
2719<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272720<pre><code>old mode &lt;mode&gt;
Junio C Hamano1a4e8412005-12-27 08:17:232721new mode &lt;mode&gt;
2722deleted file mode &lt;mode&gt;
2723new file mode &lt;mode&gt;
2724copy from &lt;path&gt;
2725copy to &lt;path&gt;
2726rename from &lt;path&gt;
2727rename to &lt;path&gt;
2728similarity index &lt;number&gt;
2729dissimilarity index &lt;number&gt;
Junio C Hamano9629d4f2012-12-19 00:28:272730index &lt;hash&gt;..&lt;hash&gt; &lt;mode&gt;</code></pre>
Junio C Hamano1a4e8412005-12-27 08:17:232731</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592732<div class="paragraph"><p>File modes are printed as 6-digit octal numbers including the file type
Junio C Hamano7f9fa862010-10-19 23:51:142733and file permission bits.</p></div>
Junio C Hamano9629d4f2012-12-19 00:28:272734<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:592735<div class="paragraph"><p>The similarity index is the percentage of unchanged lines, and
Junio C Hamano7f9fa862010-10-19 23:51:142736the dissimilarity index is the percentage of changed lines. It
2737is a rounded down integer, followed by a percent sign. The
2738similarity index value of 100% is thus reserved for two equal
2739files, while 100% dissimilarity means that no line from the old
2740file made it into the new one.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592741<div class="paragraph"><p>The index line includes the SHA-1 checksum before and after the change.
Junio C Hamano7f9fa862010-10-19 23:51:142742The &lt;mode&gt; is included if the file mode does not change; otherwise,
2743separate lines indicate the old and the new mode.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232744</li>
2745<li>
2746<p>
Junio C Hamanoa053d542006-10-27 09:29:132747TAB, LF, double quote and backslash characters in pathnames
Junio C Hamano9629d4f2012-12-19 00:28:272748 are represented as <code>\t</code>, <code>\n</code>, <code>\"</code> and <code>\\</code>, respectively.
Junio C Hamanoa053d542006-10-27 09:29:132749 If there is need for such substitution then the whole
2750 pathname is put in double quotes.
Junio C Hamano1a4e8412005-12-27 08:17:232751</p>
2752</li>
Junio C Hamano7f9fa862010-10-19 23:51:142753<li>
2754<p>
Junio C Hamano9629d4f2012-12-19 00:28:272755All the <code>file1</code> files in the output refer to files before the
2756 commit, and all the <code>file2</code> files refer to files after the commit.
Junio C Hamano7f9fa862010-10-19 23:51:142757 It is incorrect to apply each change to each file sequentially. For
2758 example, this patch will swap a and b:
2759</p>
2760<div class="literalblock">
2761<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272762<pre><code>diff --git a/a b/b
Junio C Hamano7f9fa862010-10-19 23:51:142763rename from a
2764rename to b
2765diff --git a/b b/a
2766rename from b
Junio C Hamano9629d4f2012-12-19 00:28:272767rename to a</code></pre>
Junio C Hamano7f9fa862010-10-19 23:51:142768</div></div>
2769</li>
Junio C Hamanoba4b9282008-07-06 05:20:312770</ol></div>
Junio C Hamano1a4e8412005-12-27 08:17:232771</div>
Junio C Hamano9629d4f2012-12-19 00:28:272772</div>
2773<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:312774<h2 id="_combined_diff_format">combined diff format</h2>
Junio C Hamanofb56a962006-01-28 10:38:192775<div class="sectionbody">
Junio C Hamano9629d4f2012-12-19 00:28:272776<div class="paragraph"><p>Any diff-generating command can take the &#8216;-c` or <code>--cc</code> option to
Junio C Hamanoc5be4cc2011-03-09 07:20:432777produce a <em>combined diff</em> when showing a merge. This is the default
Junio C Hamanoa28a9202012-06-21 07:08:232778format when showing merges with <a href="git-diff.html">git-diff(1)</a> or
2779<a href="git-show.html">git-show(1)</a>. Note also that you can give the `-m&#8217; option to any
Junio C Hamanoc5be4cc2011-03-09 07:20:432780of these commands to force generation of diffs with individual parents
2781of a merge.</p></div>
2782<div class="paragraph"><p>A <em>combined diff</em> format looks like this:</p></div>
Junio C Hamanofb56a962006-01-28 10:38:192783<div class="listingblock">
2784<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272785<pre><code>diff --combined describe.c
Junio C Hamano29f14312006-10-26 08:47:292786index fabadb8,cc95eb0..4866510
2787--- a/describe.c
2788+++ b/describe.c
2789@@@ -98,20 -98,12 +98,20 @@@
2790 return (a_date &gt; b_date) ? -1 : (a_date == b_date) ? 0 : 1;
Junio C Hamanofb56a962006-01-28 10:38:192791 }
2792
2793- static void describe(char *arg)
2794 -static void describe(struct commit *cmit, int last_one)
2795++static void describe(char *arg, int last_one)
2796 {
Junio C Hamano29f14312006-10-26 08:47:292797 + unsigned char sha1[20];
2798 + struct commit *cmit;
2799 struct commit_list *list;
2800 static int initialized = 0;
2801 struct commit_name *n;
2802
2803 + if (get_sha1(arg, sha1) &lt; 0)
2804 + usage(describe_usage);
2805 + cmit = lookup_commit_reference(sha1);
2806 + if (!cmit)
2807 + usage(describe_usage);
2808 +
2809 if (!initialized) {
2810 initialized = 1;
Junio C Hamano9629d4f2012-12-19 00:28:272811 for_each_ref(get_name);</code></pre>
Junio C Hamanofb56a962006-01-28 10:38:192812</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592813<div class="olist arabic"><ol class="arabic">
Junio C Hamano29f14312006-10-26 08:47:292814<li>
2815<p>
2816It is preceded with a "git diff" header, that looks like
2817 this (when <em>-c</em> option is used):
2818</p>
2819<div class="literalblock">
2820<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272821<pre><code>diff --combined file</code></pre>
Junio C Hamano29f14312006-10-26 08:47:292822</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592823<div class="paragraph"><p>or like this (when <em>--cc</em> option is used):</p></div>
Junio C Hamano29f14312006-10-26 08:47:292824<div class="literalblock">
2825<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272826<pre><code>diff --cc file</code></pre>
Junio C Hamano29f14312006-10-26 08:47:292827</div></div>
2828</li>
2829<li>
2830<p>
2831It is followed by one or more extended header lines
2832 (this example shows a merge with two parents):
2833</p>
2834<div class="literalblock">
2835<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272836<pre><code>index &lt;hash&gt;,&lt;hash&gt;..&lt;hash&gt;
Junio C Hamano29f14312006-10-26 08:47:292837mode &lt;mode&gt;,&lt;mode&gt;..&lt;mode&gt;
2838new file mode &lt;mode&gt;
Junio C Hamano9629d4f2012-12-19 00:28:272839deleted file mode &lt;mode&gt;,&lt;mode&gt;</code></pre>
Junio C Hamano29f14312006-10-26 08:47:292840</div></div>
Junio C Hamano9629d4f2012-12-19 00:28:272841<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:042842the &lt;mode&gt; is different from the rest. Extended headers with
Junio C Hamano29f14312006-10-26 08:47:292843information about detected contents movement (renames and
2844copying detection) are designed to work with diff of two
Junio C Hamanoba4b9282008-07-06 05:20:312845&lt;tree-ish&gt; and are not used by combined diff format.</p></div>
Junio C Hamano29f14312006-10-26 08:47:292846</li>
2847<li>
2848<p>
2849It is followed by two-line from-file/to-file header
2850</p>
2851<div class="literalblock">
2852<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272853<pre><code>--- a/file
2854+++ b/file</code></pre>
Junio C Hamano29f14312006-10-26 08:47:292855</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592856<div class="paragraph"><p>Similar to two-line header for traditional <em>unified</em> diff
Junio C Hamano9629d4f2012-12-19 00:28:272857format, <code>/dev/null</code> is used to signal created or deleted
Junio C Hamanoba4b9282008-07-06 05:20:312858files.</p></div>
Junio C Hamano29f14312006-10-26 08:47:292859</li>
2860<li>
2861<p>
2862Chunk header format is modified to prevent people from
Junio C Hamano9629d4f2012-12-19 00:28:272863 accidentally feeding it to <code>patch -p1</code>. Combined diff format
Junio C Hamano29f14312006-10-26 08:47:292864 was created for review of merge commit changes, and was not
2865 meant for apply. The change is similar to the change in the
2866 extended <em>index</em> header:
2867</p>
2868<div class="literalblock">
2869<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272870<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:292871</div></div>
Junio C Hamano9629d4f2012-12-19 00:28:272872<div class="paragraph"><p>There are (number of parents + 1) <code>@</code> characters in the chunk
Junio C Hamanoba4b9282008-07-06 05:20:312873header for combined diff format.</p></div>
Junio C Hamano29f14312006-10-26 08:47:292874</li>
Junio C Hamanoba4b9282008-07-06 05:20:312875</ol></div>
Junio C Hamano68cf15a2010-11-06 01:01:592876<div class="paragraph"><p>Unlike the traditional <em>unified</em> diff format, which shows two
Junio C Hamano9629d4f2012-12-19 00:28:272877files 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
2878added to B), or <code>" "</code> (space&#8201;&#8212;&#8201;unchanged) prefix, this format
Junio C Hamanofb56a962006-01-28 10:38:192879compares two or more files file1, file2,&#8230; with one file X, and
2880shows how X differs from each of fileN. One column for each of
Junio C Hamano68cf15a2010-11-06 01:01:592881fileN is prepended to the output line to note how X&#8217;s line is
Junio C Hamanoba4b9282008-07-06 05:20:312882different from it.</p></div>
Junio C Hamano9629d4f2012-12-19 00:28:272883<div class="paragraph"><p>A <code>-</code> character in the column N means that the line appears in
2884fileN but it does not appear in the result. A <code>+</code> character
Junio C Hamano54bf1e22008-12-20 06:30:112885in the column N means that the line appears in the result,
Junio C Hamano29f14312006-10-26 08:47:292886and fileN does not have that line (in other words, the line was
Junio C Hamanoba4b9282008-07-06 05:20:312887added, from the point of view of that parent).</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592888<div class="paragraph"><p>In the above example output, the function signature was changed
Junio C Hamano9629d4f2012-12-19 00:28:272889from both files (hence two <code>-</code> removals from both file1 and
2890file2, plus <code>++</code> to mean one line that was added does not appear
Junio C Hamano54bf1e22008-12-20 06:30:112891in either file1 nor file2). Also eight other lines are the same
Junio C Hamano9629d4f2012-12-19 00:28:272892from file1 but do not appear in file2 (hence prefixed with <code>+</code>).</p></div>
2893<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:192894merge commit with the merge result (i.e. file1..fileN are the
Junio C Hamano9629d4f2012-12-19 00:28:272895parents). When shown by <code>git diff-files -c</code>, it compares the
Junio C Hamanofb56a962006-01-28 10:38:192896two unresolved merge parents with the working tree file
2897(i.e. file1 is stage 2 aka "our version", file2 is stage 3 aka
Junio C Hamanoba4b9282008-07-06 05:20:312898"their version").</p></div>
Junio C Hamanofb56a962006-01-28 10:38:192899</div>
Junio C Hamano9629d4f2012-12-19 00:28:272900</div>
2901<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:312902<h2 id="_other_diff_formats">other diff formats</h2>
Junio C Hamano3a702342007-12-12 21:34:022903<div class="sectionbody">
Junio C Hamano9629d4f2012-12-19 00:28:272904<div class="paragraph"><p>The <code>--summary</code> option describes newly added, deleted, renamed and
2905copied files. The <code>--stat</code> option adds diffstat(1) graph to the
Junio C Hamano3a702342007-12-12 21:34:022906output. These options can be combined with other options, such as
Junio C Hamano9629d4f2012-12-19 00:28:272907<code>-p</code>, and are meant for human consumption.</p></div>
2908<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:022909formats the pathnames compactly by combining common prefix and suffix of
Junio C Hamano9629d4f2012-12-19 00:28:272910the pathnames. For example, a change that moves <code>arch/i386/Makefile</code> to
2911<code>arch/x86/Makefile</code> while modifying 4 lines will be shown like this:</p></div>
Junio C Hamano3a702342007-12-12 21:34:022912<div class="listingblock">
2913<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272914<pre><code>arch/{i386 =&gt; x86}/Makefile | 4 +--</code></pre>
Junio C Hamano3a702342007-12-12 21:34:022915</div></div>
Junio C Hamano9629d4f2012-12-19 00:28:272916<div class="paragraph"><p>The <code>--numstat</code> option gives the diffstat(1) information but is designed
2917for easier machine consumption. An entry in <code>--numstat</code> output looks
Junio C Hamanoba4b9282008-07-06 05:20:312918like this:</p></div>
Junio C Hamano3a702342007-12-12 21:34:022919<div class="listingblock">
2920<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272921<pre><code>1 2 README
29223 1 arch/{i386 =&gt; x86}/Makefile</code></pre>
Junio C Hamano3a702342007-12-12 21:34:022923</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592924<div class="paragraph"><p>That is, from left to right:</p></div>
2925<div class="olist arabic"><ol class="arabic">
Junio C Hamano3a702342007-12-12 21:34:022926<li>
2927<p>
2928the number of added lines;
2929</p>
2930</li>
2931<li>
2932<p>
2933a tab;
2934</p>
2935</li>
2936<li>
2937<p>
2938the number of deleted lines;
2939</p>
2940</li>
2941<li>
2942<p>
2943a tab;
2944</p>
2945</li>
2946<li>
2947<p>
2948pathname (possibly with rename/copy information);
2949</p>
2950</li>
2951<li>
2952<p>
2953a newline.
2954</p>
2955</li>
Junio C Hamanoba4b9282008-07-06 05:20:312956</ol></div>
Junio C Hamano9629d4f2012-12-19 00:28:272957<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:022958<div class="listingblock">
2959<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272960<pre><code>1 2 README NUL
29613 1 NUL arch/i386/Makefile NUL arch/x86/Makefile NUL</code></pre>
Junio C Hamano3a702342007-12-12 21:34:022962</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592963<div class="paragraph"><p>That is:</p></div>
2964<div class="olist arabic"><ol class="arabic">
Junio C Hamano3a702342007-12-12 21:34:022965<li>
2966<p>
2967the number of added lines;
2968</p>
2969</li>
2970<li>
2971<p>
2972a tab;
2973</p>
2974</li>
2975<li>
2976<p>
2977the number of deleted lines;
2978</p>
2979</li>
2980<li>
2981<p>
2982a tab;
2983</p>
2984</li>
2985<li>
2986<p>
2987a NUL (only exists if renamed/copied);
2988</p>
2989</li>
2990<li>
2991<p>
2992pathname in preimage;
2993</p>
2994</li>
2995<li>
2996<p>
2997a NUL (only exists if renamed/copied);
2998</p>
2999</li>
3000<li>
3001<p>
3002pathname in postimage (only exists if renamed/copied);
3003</p>
3004</li>
3005<li>
3006<p>
3007a NUL.
3008</p>
3009</li>
Junio C Hamanoba4b9282008-07-06 05:20:313010</ol></div>
Junio C Hamano9629d4f2012-12-19 00:28:273011<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:023012scripts that read the output to tell if the current record being read is
3013a single-path record or a rename/copy record without reading ahead.
Junio C Hamano9629d4f2012-12-19 00:28:273014After reading added and deleted lines, reading up to <code>NUL</code> would yield
3015the pathname, but if that is <code>NUL</code>, the record will show two paths.</p></div>
Junio C Hamano3a702342007-12-12 21:34:023016</div>
Junio C Hamano9629d4f2012-12-19 00:28:273017</div>
3018<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:313019<h2 id="_git">GIT</h2>
Junio C Hamano1a4e8412005-12-27 08:17:233020<div class="sectionbody">
Junio C Hamanoa28a9202012-06-21 07:08:233021<div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:233022</div>
Junio C Hamano7bd050f2011-09-22 06:32:223023</div>
Junio C Hamano9629d4f2012-12-19 00:28:273024</div>
Junio C Hamano7bd050f2011-09-22 06:32:223025<div id="footnotes"><hr /></div>
Junio C Hamano1a4e8412005-12-27 08:17:233026<div id="footer">
3027<div id="footer-text">
Junio C Hamano9629d4f2012-12-19 00:28:273028Last updated 2011-11-15 13:45:02 PST
Junio C Hamano1a4e8412005-12-27 08:17:233029</div>
3030</div>
3031</body>
3032</html>