blob: 1664b85e81292bd75afca37ca8bbf92624b08dc7 [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>
5<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
Junio C Hamano7bd050f2011-09-22 06:32:226<meta name="generator" content="AsciiDoc 8.5.2" />
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">
9/* Debug borders */
10p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {
11/*
12 border: 1px solid red;
13*/
14}
15
16body {
17 margin: 1em 5% 1em 5%;
18}
19
Junio C Hamanoba4b9282008-07-06 05:20:3120a {
21 color: blue;
22 text-decoration: underline;
23}
24a:visited {
25 color: fuchsia;
26}
Junio C Hamano1a4e8412005-12-27 08:17:2327
28em {
29 font-style: italic;
Junio C Hamano68cf15a2010-11-06 01:01:5930 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:2331}
32
33strong {
34 font-weight: bold;
Junio C Hamano68cf15a2010-11-06 01:01:5935 color: #083194;
Junio C Hamano1a4e8412005-12-27 08:17:2336}
37
38tt {
39 color: navy;
40}
41
42h1, h2, h3, h4, h5, h6 {
43 color: #527bbd;
44 font-family: sans-serif;
45 margin-top: 1.2em;
46 margin-bottom: 0.5em;
47 line-height: 1.3;
48}
49
Junio C Hamanoba4b9282008-07-06 05:20:3150h1, h2, h3 {
Junio C Hamano1a4e8412005-12-27 08:17:2351 border-bottom: 2px solid silver;
52}
53h2 {
Junio C Hamano1a4e8412005-12-27 08:17:2354 padding-top: 0.5em;
55}
Junio C Hamanoba4b9282008-07-06 05:20:3156h3 {
57 float: left;
58}
59h3 + * {
60 clear: left;
61}
Junio C Hamano1a4e8412005-12-27 08:17:2362
63div.sectionbody {
64 font-family: serif;
65 margin-left: 0;
66}
67
68hr {
69 border: 1px solid silver;
70}
71
72p {
73 margin-top: 0.5em;
74 margin-bottom: 0.5em;
75}
76
Junio C Hamano68cf15a2010-11-06 01:01:5977ul, ol, li > p {
78 margin-top: 0;
79}
80
Junio C Hamano1a4e8412005-12-27 08:17:2381pre {
82 padding: 0;
83 margin: 0;
84}
85
86span#author {
87 color: #527bbd;
88 font-family: sans-serif;
89 font-weight: bold;
Junio C Hamanoba4b9282008-07-06 05:20:3190 font-size: 1.1em;
Junio C Hamano1a4e8412005-12-27 08:17:2391}
92span#email {
93}
Junio C Hamano68cf15a2010-11-06 01:01:5994span#revnumber, span#revdate, span#revremark {
Junio C Hamano1a4e8412005-12-27 08:17:2395 font-family: sans-serif;
96}
97
98div#footer {
99 font-family: sans-serif;
100 font-size: small;
101 border-top: 2px solid silver;
102 padding-top: 0.5em;
103 margin-top: 4.0em;
104}
105div#footer-text {
106 float: left;
107 padding-bottom: 0.5em;
108}
109div#footer-badges {
110 float: right;
111 padding-bottom: 0.5em;
112}
113
Junio C Hamano68cf15a2010-11-06 01:01:59114div#preamble {
115 margin-top: 1.5em;
116 margin-bottom: 1.5em;
117}
Junio C Hamano1a4e8412005-12-27 08:17:23118div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
119div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
120div.admonitionblock {
Junio C Hamano7bd050f2011-09-22 06:32:22121 margin-top: 1.0em;
Junio C Hamano1a4e8412005-12-27 08:17:23122 margin-bottom: 1.5em;
123}
124div.admonitionblock {
Junio C Hamano7bd050f2011-09-22 06:32:22125 margin-top: 2.0em;
126 margin-bottom: 2.0em;
127 margin-right: 10%;
128 color: #606060;
Junio C Hamano1a4e8412005-12-27 08:17:23129}
130
131div.content { /* Block element content. */
132 padding: 0;
133}
134
135/* Block element titles. */
136div.title, caption.title {
Junio C Hamano68cf15a2010-11-06 01:01:59137 color: #527bbd;
Junio C Hamano1a4e8412005-12-27 08:17:23138 font-family: sans-serif;
139 font-weight: bold;
140 text-align: left;
141 margin-top: 1.0em;
142 margin-bottom: 0.5em;
143}
144div.title + * {
145 margin-top: 0;
146}
147
148td div.title:first-child {
149 margin-top: 0.0em;
150}
151div.content div.title:first-child {
152 margin-top: 0.0em;
153}
154div.content + div.title {
155 margin-top: 0.0em;
156}
157
158div.sidebarblock > div.content {
159 background: #ffffee;
160 border: 1px solid silver;
161 padding: 0.5em;
162}
163
164div.listingblock > div.content {
165 border: 1px solid silver;
166 background: #f4f4f4;
167 padding: 0.5em;
168}
169
Junio C Hamano7bd050f2011-09-22 06:32:22170div.quoteblock, div.verseblock {
171 padding-left: 1.0em;
172 margin-left: 1.0em;
Junio C Hamano68cf15a2010-11-06 01:01:59173 margin-right: 10%;
Junio C Hamano7bd050f2011-09-22 06:32:22174 border-left: 5px solid #dddddd;
175 color: #777777;
Junio C Hamano1a4e8412005-12-27 08:17:23176}
Junio C Hamano7bd050f2011-09-22 06:32:22177
Junio C Hamano68cf15a2010-11-06 01:01:59178div.quoteblock > div.attribution {
179 padding-top: 0.5em;
Junio C Hamano1a4e8412005-12-27 08:17:23180 text-align: right;
181}
Junio C Hamano68cf15a2010-11-06 01:01:59182
Junio C Hamano68cf15a2010-11-06 01:01:59183div.verseblock > div.content {
184 white-space: pre;
185}
186div.verseblock > div.attribution {
187 padding-top: 0.75em;
188 text-align: left;
189}
190/* DEPRECATED: Pre version 8.2.7 verse style literal block. */
Junio C Hamanoba4b9282008-07-06 05:20:31191div.verseblock + div.attribution {
192 text-align: left;
193}
Junio C Hamano1a4e8412005-12-27 08:17:23194
195div.admonitionblock .icon {
196 vertical-align: top;
197 font-size: 1.1em;
198 font-weight: bold;
199 text-decoration: underline;
200 color: #527bbd;
201 padding-right: 0.5em;
202}
203div.admonitionblock td.content {
204 padding-left: 0.5em;
Junio C Hamano7bd050f2011-09-22 06:32:22205 border-left: 3px solid #dddddd;
Junio C Hamano1a4e8412005-12-27 08:17:23206}
207
208div.exampleblock > div.content {
Junio C Hamano7bd050f2011-09-22 06:32:22209 border-left: 3px solid #dddddd;
210 padding-left: 0.5em;
Junio C Hamano1a4e8412005-12-27 08:17:23211}
212
Junio C Hamano1a4e8412005-12-27 08:17:23213div.imageblock div.content { padding-left: 0; }
Junio C Hamano1a4e8412005-12-27 08:17:23214span.image img { border-style: none; }
Junio C Hamano68cf15a2010-11-06 01:01:59215a.image:visited { color: white; }
Junio C Hamano1a4e8412005-12-27 08:17:23216
217dl {
218 margin-top: 0.8em;
219 margin-bottom: 0.8em;
220}
221dt {
222 margin-top: 0.5em;
223 margin-bottom: 0;
Junio C Hamano68cf15a2010-11-06 01:01:59224 font-style: normal;
225 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:23226}
227dd > *:first-child {
Junio C Hamano68cf15a2010-11-06 01:01:59228 margin-top: 0.1em;
Junio C Hamano1a4e8412005-12-27 08:17:23229}
230
231ul, ol {
232 list-style-position: outside;
233}
Junio C Hamano68cf15a2010-11-06 01:01:59234ol.arabic {
235 list-style-type: decimal;
236}
237ol.loweralpha {
Junio C Hamano1a4e8412005-12-27 08:17:23238 list-style-type: lower-alpha;
239}
Junio C Hamano68cf15a2010-11-06 01:01:59240ol.upperalpha {
241 list-style-type: upper-alpha;
242}
243ol.lowerroman {
244 list-style-type: lower-roman;
245}
246ol.upperroman {
247 list-style-type: upper-roman;
248}
249
250div.compact ul, div.compact ol,
251div.compact p, div.compact p,
252div.compact div, div.compact div {
253 margin-top: 0.1em;
254 margin-bottom: 0.1em;
255}
Junio C Hamano1a4e8412005-12-27 08:17:23256
257div.tableblock > table {
Junio C Hamanoba4b9282008-07-06 05:20:31258 border: 3px solid #527bbd;
Junio C Hamano1a4e8412005-12-27 08:17:23259}
Junio C Hamano7bd050f2011-09-22 06:32:22260thead, p.table.header {
Junio C Hamano1a4e8412005-12-27 08:17:23261 font-family: sans-serif;
262 font-weight: bold;
263}
264tfoot {
265 font-weight: bold;
266}
Junio C Hamano68cf15a2010-11-06 01:01:59267td > div.verse {
268 white-space: pre;
269}
270p.table {
271 margin-top: 0;
272}
273/* Because the table frame attribute is overriden by CSS in most browsers. */
274div.tableblock > table[frame="void"] {
275 border-style: none;
276}
277div.tableblock > table[frame="hsides"] {
278 border-left-style: none;
279 border-right-style: none;
280}
281div.tableblock > table[frame="vsides"] {
282 border-top-style: none;
283 border-bottom-style: none;
284}
Junio C Hamano1a4e8412005-12-27 08:17:23285
Junio C Hamano68cf15a2010-11-06 01:01:59286
287div.hdlist {
Junio C Hamano1a4e8412005-12-27 08:17:23288 margin-top: 0.8em;
289 margin-bottom: 0.8em;
290}
Junio C Hamano68cf15a2010-11-06 01:01:59291div.hdlist tr {
292 padding-bottom: 15px;
Junio C Hamanoba4b9282008-07-06 05:20:31293}
Junio C Hamano68cf15a2010-11-06 01:01:59294dt.hdlist1.strong, td.hdlist1.strong {
295 font-weight: bold;
296}
297td.hdlist1 {
Junio C Hamano1a4e8412005-12-27 08:17:23298 vertical-align: top;
Junio C Hamano68cf15a2010-11-06 01:01:59299 font-style: normal;
Junio C Hamano1a4e8412005-12-27 08:17:23300 padding-right: 0.8em;
Junio C Hamano68cf15a2010-11-06 01:01:59301 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:23302}
Junio C Hamano68cf15a2010-11-06 01:01:59303td.hdlist2 {
Junio C Hamano1a4e8412005-12-27 08:17:23304 vertical-align: top;
305}
Junio C Hamano68cf15a2010-11-06 01:01:59306div.hdlist.compact tr {
307 margin: 0;
308 padding-bottom: 0;
309}
310
311.comment {
312 background: yellow;
313}
Junio C Hamano1a4e8412005-12-27 08:17:23314
Junio C Hamano7bd050f2011-09-22 06:32:22315.footnote, .footnoteref {
316 font-size: 0.8em;
317}
318
319span.footnote, span.footnoteref {
320 vertical-align: super;
321}
322
323#footnotes {
324 margin: 20px 0 20px 0;
325 padding: 7px 0 0 0;
326}
327
328#footnotes div.footnote {
329 margin: 0 0 5px 0;
330}
331
332#footnotes hr {
333 border: none;
334 border-top: 1px solid silver;
335 height: 1px;
336 text-align: left;
337 margin-left: 0;
338 width: 20%;
339 min-width: 100px;
340}
341
342
Junio C Hamano1a4e8412005-12-27 08:17:23343@media print {
344 div#footer-badges { display: none; }
345}
Junio C Hamanoba4b9282008-07-06 05:20:31346
Junio C Hamano7bd050f2011-09-22 06:32:22347div#toc {
348 margin-bottom: 2.5em;
349}
350
Junio C Hamanoba4b9282008-07-06 05:20:31351div#toctitle {
352 color: #527bbd;
353 font-family: sans-serif;
354 font-size: 1.1em;
355 font-weight: bold;
356 margin-top: 1.0em;
357 margin-bottom: 0.1em;
358}
359
360div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
361 margin-top: 0;
362 margin-bottom: 0;
363}
364div.toclevel2 {
365 margin-left: 2em;
366 font-size: 0.9em;
367}
368div.toclevel3 {
369 margin-left: 4em;
370 font-size: 0.9em;
371}
372div.toclevel4 {
373 margin-left: 6em;
374 font-size: 0.9em;
375}
Junio C Hamano68cf15a2010-11-06 01:01:59376/* Overrides for manpage documents */
377h1 {
378 padding-top: 0.5em;
379 padding-bottom: 0.5em;
380 border-top: 2px solid silver;
381 border-bottom: 2px solid silver;
382}
383h2 {
384 border-style: none;
385}
386div.sectionbody {
387 margin-left: 5%;
388}
389
390@media print {
391 div#toc { display: none; }
392}
393
Junio C Hamano1a4e8412005-12-27 08:17:23394/* Workarounds for IE6's broken and incomplete CSS2. */
395
396div.sidebar-content {
397 background: #ffffee;
398 border: 1px solid silver;
399 padding: 0.5em;
400}
401div.sidebar-title, div.image-title {
Junio C Hamano68cf15a2010-11-06 01:01:59402 color: #527bbd;
Junio C Hamano1a4e8412005-12-27 08:17:23403 font-family: sans-serif;
404 font-weight: bold;
405 margin-top: 0.0em;
406 margin-bottom: 0.5em;
407}
408
409div.listingblock div.content {
410 border: 1px solid silver;
411 background: #f4f4f4;
412 padding: 0.5em;
413}
414
Junio C Hamano68cf15a2010-11-06 01:01:59415div.quoteblock-attribution {
416 padding-top: 0.5em;
417 text-align: right;
418}
419
420div.verseblock-content {
421 white-space: pre;
422}
423div.verseblock-attribution {
424 padding-top: 0.75em;
425 text-align: left;
Junio C Hamano1a4e8412005-12-27 08:17:23426}
427
428div.exampleblock-content {
Junio C Hamano7bd050f2011-09-22 06:32:22429 border-left: 3px solid #dddddd;
Junio C Hamano1a4e8412005-12-27 08:17:23430 padding-left: 0.5em;
431}
Junio C Hamanoba4b9282008-07-06 05:20:31432
433/* IE6 sets dynamically generated links as visited. */
434div#toc a:visited { color: blue; }
Junio C Hamano1a4e8412005-12-27 08:17:23435</style>
Junio C Hamano7bd050f2011-09-22 06:32:22436<script type="text/javascript">
437/*<![CDATA[*/
438window.onload = function(){asciidoc.footnotes();}
439var asciidoc = { // Namespace.
440
441/////////////////////////////////////////////////////////////////////
442// Table Of Contents generator
443/////////////////////////////////////////////////////////////////////
444
445/* Author: Mihai Bazon, September 2002
446 * http://students.infoiasi.ro/~mishoo
447 *
448 * Table Of Content generator
449 * Version: 0.4
450 *
451 * Feel free to use this script under the terms of the GNU General Public
452 * License, as long as you do not remove or alter this notice.
453 */
454
455 /* modified by Troy D. Hanson, September 2006. License: GPL */
456 /* modified by Stuart Rackham, 2006, 2009. License: GPL */
457
458// toclevels = 1..4.
459toc: function (toclevels) {
460
461 function getText(el) {
462 var text = "";
463 for (var i = el.firstChild; i != null; i = i.nextSibling) {
464 if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
465 text += i.data;
466 else if (i.firstChild != null)
467 text += getText(i);
468 }
469 return text;
470 }
471
472 function TocEntry(el, text, toclevel) {
473 this.element = el;
474 this.text = text;
475 this.toclevel = toclevel;
476 }
477
478 function tocEntries(el, toclevels) {
479 var result = new Array;
480 var re = new RegExp('[hH]([2-'+(toclevels+1)+'])');
481 // Function that scans the DOM tree for header elements (the DOM2
482 // nodeIterator API would be a better technique but not supported by all
483 // browsers).
484 var iterate = function (el) {
485 for (var i = el.firstChild; i != null; i = i.nextSibling) {
486 if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
487 var mo = re.exec(i.tagName);
488 if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
489 result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
490 }
491 iterate(i);
492 }
493 }
494 }
495 iterate(el);
496 return result;
497 }
498
499 var toc = document.getElementById("toc");
500 var entries = tocEntries(document.getElementById("content"), toclevels);
501 for (var i = 0; i < entries.length; ++i) {
502 var entry = entries[i];
503 if (entry.element.id == "")
504 entry.element.id = "_toc_" + i;
505 var a = document.createElement("a");
506 a.href = "#" + entry.element.id;
507 a.appendChild(document.createTextNode(entry.text));
508 var div = document.createElement("div");
509 div.appendChild(a);
510 div.className = "toclevel" + entry.toclevel;
511 toc.appendChild(div);
512 }
513 if (entries.length == 0)
514 toc.parentNode.removeChild(toc);
515},
516
517
518/////////////////////////////////////////////////////////////////////
519// Footnotes generator
520/////////////////////////////////////////////////////////////////////
521
522/* Based on footnote generation code from:
523 * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
524 */
525
526footnotes: function () {
527 var cont = document.getElementById("content");
528 var noteholder = document.getElementById("footnotes");
529 var spans = cont.getElementsByTagName("span");
530 var refs = {};
531 var n = 0;
532 for (i=0; i<spans.length; i++) {
533 if (spans[i].className == "footnote") {
534 n++;
535 // Use [\s\S] in place of . so multi-line matches work.
536 // Because JavaScript has no s (dotall) regex flag.
537 note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
538 noteholder.innerHTML +=
539 "<div class='footnote' id='_footnote_" + n + "'>" +
540 "<a href='#_footnoteref_" + n + "' title='Return to text'>" +
541 n + "</a>. " + note + "</div>";
542 spans[i].innerHTML =
543 "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
544 "' title='View footnote' class='footnote'>" + n + "</a>]";
545 var id =spans[i].getAttribute("id");
546 if (id != null) refs["#"+id] = n;
547 }
548 }
549 if (n == 0)
550 noteholder.parentNode.removeChild(noteholder);
551 else {
552 // Process footnoterefs.
553 for (i=0; i<spans.length; i++) {
554 if (spans[i].className == "footnoteref") {
555 var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
556 href = href.match(/#.*/)[0]; // Because IE return full URL.
557 n = refs[href];
558 spans[i].innerHTML =
559 "[<a href='#_footnote_" + n +
560 "' title='View footnote' class='footnote'>" + n + "</a>]";
561 }
562 }
563 }
564}
565
566}
567/*]]>*/
568</script>
Junio C Hamano1a4e8412005-12-27 08:17:23569</head>
570<body>
571<div id="header">
572<h1>
573git-diff-tree(1) Manual Page
574</h1>
575<h2>NAME</h2>
576<div class="sectionbody">
577<p>git-diff-tree -
578 Compares the content and mode of blobs found via two tree objects
579</p>
580</div>
581</div>
Junio C Hamano7bd050f2011-09-22 06:32:22582<div id="content">
Junio C Hamano68cf15a2010-11-06 01:01:59583<h2 id="_synopsis">SYNOPSIS</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23584<div class="sectionbody">
Junio C Hamano235a91e2006-01-07 01:13:58585<div class="verseblock">
Junio C Hamano68cf15a2010-11-06 01:01:59586<div class="verseblock-content"><em>git diff-tree</em> [--stdin] [-m] [-s] [-v] [--no-commit-id] [--pretty]
Junio C Hamanofb56a962006-01-28 10:38:19587 [-t] [-r] [-c | --cc] [--root] [&lt;common diff options&gt;]
Junio C Hamano68cf15a2010-11-06 01:01:59588 &lt;tree-ish&gt; [&lt;tree-ish&gt;] [&lt;path&gt;&#8230;]</div>
589<div class="verseblock-attribution">
590</div></div>
Junio C Hamano1a4e8412005-12-27 08:17:23591</div>
Junio C Hamanoba4b9282008-07-06 05:20:31592<h2 id="_description">DESCRIPTION</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23593<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:59594<div class="paragraph"><p>Compares the content and mode of the blobs found via two tree objects.</p></div>
595<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:31596(see --stdin below).</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:59597<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:23598</div>
Junio C Hamanoba4b9282008-07-06 05:20:31599<h2 id="_options">OPTIONS</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23600<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:59601<div class="dlist"><dl>
602<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:23603-p
604</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59605<dt class="hdlist1">
Junio C Hamanobbbb8652008-12-29 10:34:22606-u
607</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59608<dt class="hdlist1">
Junio C Hamanoe97d5772010-05-19 08:13:58609--patch
610</dt>
Junio C Hamano1a4e8412005-12-27 08:17:23611<dd>
612<p>
Junio C Hamanoff979792007-11-16 10:11:30613 Generate patch (see section on generating patches).
614
Junio C Hamano1a4e8412005-12-27 08:17:23615</p>
616</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59617<dt class="hdlist1">
Junio C Hamano69361562007-07-26 02:14:34618-U&lt;n&gt;
619</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59620<dt class="hdlist1">
Junio C Hamano69361562007-07-26 02:14:34621--unified=&lt;n&gt;
622</dt>
623<dd>
624<p>
625 Generate diffs with &lt;n&gt; lines of context instead of
Junio C Hamano3b70d3c2009-11-21 17:37:37626 the usual three.
627 Implies <tt>-p</tt>.
Junio C Hamano69361562007-07-26 02:14:34628</p>
629</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59630<dt class="hdlist1">
Junio C Hamano9ae1a062006-07-10 08:12:34631--raw
632</dt>
633<dd>
634<p>
635 Generate the raw format.
Junio C Hamanoff979792007-11-16 10:11:30636 This is the default.
Junio C Hamano9ae1a062006-07-10 08:12:34637</p>
638</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59639<dt class="hdlist1">
Junio C Hamano54559c82006-04-13 07:45:12640--patch-with-raw
641</dt>
642<dd>
643<p>
Junio C Hamano3b70d3c2009-11-21 17:37:37644 Synonym for <tt>-p --raw</tt>.
Junio C Hamano54559c82006-04-13 07:45:12645</p>
646</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59647<dt class="hdlist1">
Junio C Hamano5a73f302011-10-14 05:58:34648--minimal
649</dt>
650<dd>
651<p>
652 Spend extra time to make sure the smallest possible
653 diff is produced.
654</p>
655</dd>
656<dt class="hdlist1">
Junio C Hamano20d47e32009-01-26 06:36:02657--patience
658</dt>
659<dd>
660<p>
661 Generate a diff using the "patience diff" algorithm.
662</p>
663</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59664<dt class="hdlist1">
Junio C Hamanoaea9e6b2012-03-07 00:17:11665--histogram
666</dt>
667<dd>
668<p>
669 Generate a diff using the "histogram diff" algorithm.
670</p>
671</dd>
672<dt class="hdlist1">
Junio C Hamano4c4b0122011-06-30 01:19:32673--stat[=&lt;width&gt;[,&lt;name-width&gt;[,&lt;count&gt;]]]
Junio C Hamanoba7c8d82006-04-15 06:17:42674</dt>
675<dd>
676<p>
Junio C Hamanoaea9e6b2012-03-07 00:17:11677 Generate a diffstat. By default, as much space as necessary
678 will be used for the filename part, and the rest for the graph
679 part. Maximum width defaults to terminal width, or 80 columns
680 if not connected to a terminal, and can be overriden by
681 <tt>&lt;width&gt;</tt>. The width of the filename part can be limited by
682 giving another width <tt>&lt;name-width&gt;</tt> after a comma. The width
683 of the graph part can be limited by using
684 <tt>--stat-graph-width=&lt;width&gt;</tt> (affects all commands generating
685 a stat graph) or by setting <tt>diff.statGraphWidth=&lt;width&gt;</tt>
686 (does not affect <tt>git format-patch</tt>).
Junio C Hamano4c4b0122011-06-30 01:19:32687 By giving a third parameter <tt>&lt;count&gt;</tt>, you can limit the
Junio C Hamanoaea9e6b2012-03-07 00:17:11688 output to the first <tt>&lt;count&gt;</tt> lines, followed by <tt>&#8230;</tt> if
689 there are more.
Junio C Hamanoba7c8d82006-04-15 06:17:42690</p>
Junio C Hamano4c4b0122011-06-30 01:19:32691<div class="paragraph"><p>These parameters can also be set individually with <tt>--stat-width=&lt;width&gt;</tt>,
692<tt>--stat-name-width=&lt;name-width&gt;</tt> and <tt>--stat-count=&lt;count&gt;</tt>.</p></div>
Junio C Hamanoba7c8d82006-04-15 06:17:42693</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59694<dt class="hdlist1">
Junio C Hamanofbe00522006-10-19 05:58:48695--numstat
696</dt>
697<dd>
698<p>
Junio C Hamano3b70d3c2009-11-21 17:37:37699 Similar to <tt>--stat</tt>, but shows number of added and
Junio C Hamanofbe00522006-10-19 05:58:48700 deleted lines in decimal notation and pathname without
Junio C Hamanod793de52006-12-26 09:11:43701 abbreviation, to make it more machine friendly. For
702 binary files, outputs two <tt>-</tt> instead of saying
703 <tt>0 0</tt>.
Junio C Hamanofbe00522006-10-19 05:58:48704</p>
705</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59706<dt class="hdlist1">
Junio C Hamano7d23f5e2006-12-16 07:44:04707--shortstat
708</dt>
709<dd>
710<p>
Junio C Hamano3b70d3c2009-11-21 17:37:37711 Output only the last line of the <tt>--stat</tt> format containing total
Junio C Hamano7d23f5e2006-12-16 07:44:04712 number of modified files, as well as number of added and deleted
713 lines.
714</p>
715</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59716<dt class="hdlist1">
Junio C Hamano1c222c52011-05-13 19:55:32717--dirstat[=&lt;param1,param2,&#8230;&gt;]
Junio C Hamano6a45be92008-04-22 08:19:03718</dt>
719<dd>
720<p>
Junio C Hamano1c222c52011-05-13 19:55:32721 Output the distribution of relative amount of changes for each
722 sub-directory. The behavior of <tt>--dirstat</tt> can be customized by
723 passing it a comma separated list of parameters.
724 The defaults are controlled by the <tt>diff.dirstat</tt> configuration
725 variable (see <a href="git-config.html">git-config(1)</a>).
726 The following parameters are available:
Junio C Hamano6a45be92008-04-22 08:19:03727</p>
Junio C Hamano1c222c52011-05-13 19:55:32728<div class="dlist"><dl>
729<dt class="hdlist1">
730<tt>changes</tt>
731</dt>
732<dd>
733<p>
734 Compute the dirstat numbers by counting the lines that have been
735 removed from the source, or added to the destination. This ignores
736 the amount of pure code movements within a file. In other words,
737 rearranging lines in a file is not counted as much as other changes.
738 This is the default behavior when no parameter is given.
739</p>
Junio C Hamano6a45be92008-04-22 08:19:03740</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59741<dt class="hdlist1">
Junio C Hamano1c222c52011-05-13 19:55:32742<tt>lines</tt>
Junio C Hamanoa476efa2008-10-10 15:31:42743</dt>
744<dd>
745<p>
Junio C Hamano1c222c52011-05-13 19:55:32746 Compute the dirstat numbers by doing the regular line-based diff
747 analysis, and summing the removed/added line counts. (For binary
748 files, count 64-byte chunks instead, since binary files have no
749 natural concept of lines). This is a more expensive <tt>--dirstat</tt>
750 behavior than the <tt>changes</tt> behavior, but it does count rearranged
751 lines within a file as much as other changes. The resulting output
752 is consistent with what you get from the other <tt>--*stat</tt> options.
Junio C Hamanoa476efa2008-10-10 15:31:42753</p>
754</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59755<dt class="hdlist1">
Junio C Hamano1c222c52011-05-13 19:55:32756<tt>files</tt>
757</dt>
758<dd>
759<p>
760 Compute the dirstat numbers by counting the number of files changed.
761 Each changed file counts equally in the dirstat analysis. This is
762 the computationally cheapest <tt>--dirstat</tt> behavior, since it does
763 not have to look at the file contents at all.
764</p>
765</dd>
766<dt class="hdlist1">
767<tt>cumulative</tt>
768</dt>
769<dd>
770<p>
771 Count changes in a child directory for the parent directory as well.
772 Note that when using <tt>cumulative</tt>, the sum of the percentages
773 reported may exceed 100%. The default (non-cumulative) behavior can
774 be specified with the <tt>noncumulative</tt> parameter.
775</p>
776</dd>
777<dt class="hdlist1">
778&lt;limit&gt;
779</dt>
780<dd>
781<p>
782 An integer parameter specifies a cut-off percent (3% by default).
783 Directories contributing less than this percentage of the changes
784 are not shown in the output.
785</p>
786</dd>
787</dl></div>
788<div class="paragraph"><p>Example: The following will count changed files, while ignoring
789directories with less than 10% of the total amount of changed files,
790and accumulating child directory counts in the parent directories:
791<tt>--dirstat=files,10,cumulative</tt>.</p></div>
792</dd>
793<dt class="hdlist1">
Junio C Hamano6959c6c2006-05-17 10:34:11794--summary
795</dt>
796<dd>
797<p>
798 Output a condensed summary of extended header information
799 such as creations, renames and mode changes.
800</p>
801</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59802<dt class="hdlist1">
Junio C Hamanod1308c92006-04-16 11:01:09803--patch-with-stat
804</dt>
805<dd>
806<p>
Junio C Hamano3b70d3c2009-11-21 17:37:37807 Synonym for <tt>-p --stat</tt>.
Junio C Hamanod1308c92006-04-16 11:01:09808</p>
809</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59810<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:23811-z
812</dt>
813<dd>
814<p>
Junio C Hamano0c053e82010-04-19 06:46:34815 When <tt>--raw</tt>, <tt>--numstat</tt>, <tt>--name-only</tt> or <tt>--name-status</tt> has been
816 given, do not munge pathnames and use NULs as output field terminators.
Junio C Hamano1a4e8412005-12-27 08:17:23817</p>
Junio C Hamano68cf15a2010-11-06 01:01:59818<div class="paragraph"><p>Without this option, each pathname output will have TAB, LF, double quotes,
Junio C Hamano5706e0b2009-11-24 10:54:16819and backslash characters replaced with <tt>\t</tt>, <tt>\n</tt>, <tt>\"</tt>, and <tt>\\</tt>,
820respectively, and the pathname will be enclosed in double quotes if
821any of those replacements occurred.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:23822</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59823<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:23824--name-only
825</dt>
826<dd>
827<p>
828 Show only names of changed files.
829</p>
830</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59831<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:23832--name-status
833</dt>
834<dd>
835<p>
Junio C Hamanoa9aee782008-04-23 16:09:20836 Show only names and status of changed files. See the description
837 of the <tt>--diff-filter</tt> option on what the status letters mean.
Junio C Hamano1a4e8412005-12-27 08:17:23838</p>
839</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59840<dt class="hdlist1">
Junio C Hamanoc21ab052009-10-31 04:03:55841--submodule[=&lt;format&gt;]
842</dt>
843<dd>
844<p>
Junio C Hamanoe768cc12012-03-16 05:43:05845 Specify how differences in submodules are shown. When <tt>--submodule</tt>
846 or <tt>--submodule=log</tt> is given, the <em>log</em> format is used. This format lists
847 the commits in the range like <a href="git-submodule.html">git-submodule(1)</a> <tt>summary</tt> does.
848 Omitting the <tt>--submodule</tt> option or specifying <tt>--submodule=short</tt>,
849 uses the <em>short</em> format. This format just shows the names of the commits
850 at the beginning and end of the range.
Junio C Hamanoc21ab052009-10-31 04:03:55851</p>
852</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59853<dt class="hdlist1">
Junio C Hamano4aa0bcc2010-03-03 05:13:12854--color[=&lt;when&gt;]
Junio C Hamano9ae1a062006-07-10 08:12:34855</dt>
856<dd>
857<p>
858 Show colored diff.
Junio C Hamano5f2627d2011-05-06 20:23:48859 The value must be <tt>always</tt> (the default for <tt>&lt;when&gt;</tt>), <tt>never</tt>, or <tt>auto</tt>.
860 The default value is <tt>never</tt>.
Junio C Hamano9ae1a062006-07-10 08:12:34861</p>
862</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59863<dt class="hdlist1">
Junio C Hamano9ae1a062006-07-10 08:12:34864--no-color
865</dt>
866<dd>
867<p>
Junio C Hamano5f2627d2011-05-06 20:23:48868 Turn off colored diff.
869 It is the same as <tt>--color=never</tt>.
Junio C Hamano9ae1a062006-07-10 08:12:34870</p>
871</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59872<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:53873--word-diff[=&lt;mode&gt;]
Junio C Hamano85e45fa2006-08-13 07:47:41874</dt>
875<dd>
876<p>
Junio C Hamanocc7636a2010-05-21 14:57:53877 Show a word diff, using the &lt;mode&gt; to delimit changed words.
878 By default, words are delimited by whitespace; see
879 <tt>--word-diff-regex</tt> below. The &lt;mode&gt; defaults to <em>plain</em>, and
880 must be one of:
Junio C Hamano85e45fa2006-08-13 07:47:41881</p>
Junio C Hamano68cf15a2010-11-06 01:01:59882<div class="dlist"><dl>
883<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:53884color
885</dt>
886<dd>
887<p>
888 Highlight changed words using only colors. Implies <tt>--color</tt>.
889</p>
890</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59891<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:53892plain
893</dt>
894<dd>
895<p>
Junio C Hamano68cf15a2010-11-06 01:01:59896 Show words as <tt>[-removed-]</tt> and <tt>{<tt>added</tt>}</tt>. Makes no
Junio C Hamanocc7636a2010-05-21 14:57:53897 attempts to escape the delimiters if they appear in the input,
898 so the output may be ambiguous.
899</p>
900</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59901<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:53902porcelain
903</dt>
904<dd>
905<p>
906 Use a special line-based format intended for script
907 consumption. Added/removed/unchanged runs are printed in the
Junio C Hamano68cf15a2010-11-06 01:01:59908 usual unified diff format, starting with a <tt>+</tt>/<tt>-</tt>/` `
Junio C Hamanocc7636a2010-05-21 14:57:53909 character at the beginning of the line and extending to the
910 end of the line. Newlines in the input are represented by a
911 tilde <tt>~</tt> on a line of its own.
912</p>
913</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59914<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:53915none
916</dt>
917<dd>
918<p>
919 Disable word diff again.
920</p>
921</dd>
922</dl></div>
Junio C Hamano68cf15a2010-11-06 01:01:59923<div class="paragraph"><p>Note that despite the name of the first mode, color is used to
Junio C Hamanocc7636a2010-05-21 14:57:53924highlight the changed parts in all modes if enabled.</p></div>
925</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59926<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:53927--word-diff-regex=&lt;regex&gt;
928</dt>
929<dd>
930<p>
931 Use &lt;regex&gt; to decide what a word is, instead of considering
932 runs of non-whitespace to be a word. Also implies
933 <tt>--word-diff</tt> unless it was already enabled.
934</p>
Junio C Hamano68cf15a2010-11-06 01:01:59935<div class="paragraph"><p>Every non-overlapping match of the
Junio C Hamano20d47e32009-01-26 06:36:02936&lt;regex&gt; is considered a word. Anything between these matches is
937considered whitespace and ignored(!) for the purposes of finding
938differences. You may want to append <tt>|[^[:space:]]</tt> to your regular
939expression to make sure that it matches all non-whitespace characters.
940A match that contains a newline is silently truncated(!) at the
941newline.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:59942<div class="paragraph"><p>The regex can also be set via a diff driver or configuration option, see
Junio C Hamano20d47e32009-01-26 06:36:02943<a href="gitattributes.html">gitattributes(1)</a> or <a href="git-config.html">git-config(1)</a>. Giving it explicitly
944overrides any diff driver or configuration setting. Diff drivers
945override configuration settings.</p></div>
Junio C Hamano85e45fa2006-08-13 07:47:41946</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59947<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:53948--color-words[=&lt;regex&gt;]
949</dt>
950<dd>
951<p>
952 Equivalent to <tt>--word-diff=color</tt> plus (if a regex was
953 specified) <tt>--word-diff-regex=&lt;regex&gt;</tt>.
954</p>
955</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59956<dt class="hdlist1">
Junio C Hamano9ae1a062006-07-10 08:12:34957--no-renames
958</dt>
959<dd>
960<p>
961 Turn off rename detection, even when the configuration
962 file gives the default to do so.
963</p>
964</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59965<dt class="hdlist1">
Junio C Hamanoa890c4f2007-01-28 10:29:21966--check
967</dt>
968<dd>
969<p>
Junio C Hamano6005bfa2011-06-23 00:51:22970 Warn if changes introduce whitespace errors. What are
971 considered whitespace errors is controlled by <tt>core.whitespace</tt>
972 configuration. By default, trailing whitespaces (including
973 lines that solely consist of whitespaces) and a space character
974 that is immediately followed by a tab character inside the
975 initial indent of the line are considered whitespace errors.
976 Exits with non-zero status if problems are found. Not compatible
977 with --exit-code.
Junio C Hamanoa890c4f2007-01-28 10:29:21978</p>
979</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59980<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:23981--full-index
982</dt>
983<dd>
984<p>
Junio C Hamano5cf43ca2008-08-20 09:14:14985 Instead of the first handful of characters, show the full
986 pre- and post-image blob object names on the "index"
987 line when generating patch format output.
Junio C Hamano1a4e8412005-12-27 08:17:23988</p>
989</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59990<dt class="hdlist1">
Junio C Hamano9ae1a062006-07-10 08:12:34991--binary
992</dt>
993<dd>
994<p>
Junio C Hamano3b70d3c2009-11-21 17:37:37995 In addition to <tt>--full-index</tt>, output a binary diff that
996 can be applied with <tt>git-apply</tt>.
Junio C Hamano9ae1a062006-07-10 08:12:34997</p>
998</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59999<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231000--abbrev[=&lt;n&gt;]
1001</dt>
1002<dd>
1003<p>
1004 Instead of showing the full 40-byte hexadecimal object
1005 name in diff-raw format output and diff-tree header
Junio C Hamano6efe3022009-01-13 16:47:561006 lines, show only a partial prefix. This is
Junio C Hamano3b70d3c2009-11-21 17:37:371007 independent of the <tt>--full-index</tt> option above, which controls
Junio C Hamano1a4e8412005-12-27 08:17:231008 the diff-patch output format. Non default number of
Junio C Hamano3b70d3c2009-11-21 17:37:371009 digits can be specified with <tt>--abbrev=&lt;n&gt;</tt>.
Junio C Hamano1a4e8412005-12-27 08:17:231010</p>
1011</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591012<dt class="hdlist1">
Junio C Hamanoe85e36f2010-08-10 05:30:141013-B[&lt;n&gt;][/&lt;m&gt;]
Junio C Hamano1a4e8412005-12-27 08:17:231014</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591015<dt class="hdlist1">
Junio C Hamano39c7a692010-10-27 06:08:541016--break-rewrites[=[&lt;n&gt;][/&lt;m&gt;]]
1017</dt>
Junio C Hamano1a4e8412005-12-27 08:17:231018<dd>
1019<p>
Junio C Hamanoe85e36f2010-08-10 05:30:141020 Break complete rewrite changes into pairs of delete and
1021 create. This serves two purposes:
Junio C Hamano1a4e8412005-12-27 08:17:231022</p>
Junio C Hamano68cf15a2010-11-06 01:01:591023<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:141024not as a series of deletion and insertion mixed together with a very
1025few lines that happen to match textually as the context, but as a
1026single deletion of everything old followed by a single insertion of
1027everything new, and the number <tt>m</tt> controls this aspect of the -B
1028option (defaults to 60%). <tt>-B/70%</tt> specifies that less than 30% of the
1029original should remain in the result for git to consider it a total
1030rewrite (i.e. otherwise the resulting patch will be a series of
1031deletion and insertion mixed together with context lines).</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591032<div class="paragraph"><p>When used with -M, a totally-rewritten file is also considered as the
Junio C Hamanoe85e36f2010-08-10 05:30:141033source of a rename (usually -M only considers a file that disappeared
1034as the source of a rename), and the number <tt>n</tt> controls this aspect of
1035the -B option (defaults to 50%). <tt>-B20%</tt> specifies that a change with
Junio C Hamano68cf15a2010-11-06 01:01:591036addition and deletion compared to 20% or more of the file&#8217;s size are
Junio C Hamanoe85e36f2010-08-10 05:30:141037eligible for being picked up as a possible source of a rename to
1038another file.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231039</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591040<dt class="hdlist1">
Junio C Hamanoe85e36f2010-08-10 05:30:141041-M[&lt;n&gt;]
Junio C Hamano1a4e8412005-12-27 08:17:231042</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591043<dt class="hdlist1">
Junio C Hamano0d75e872010-12-17 06:57:261044--find-renames[=&lt;n&gt;]
Junio C Hamano39c7a692010-10-27 06:08:541045</dt>
Junio C Hamano1a4e8412005-12-27 08:17:231046<dd>
1047<p>
1048 Detect renames.
Junio C Hamano5f2627d2011-05-06 20:23:481049 If <tt>n</tt> is specified, it is a threshold on the similarity
Junio C Hamanoe85e36f2010-08-10 05:30:141050 index (i.e. amount of addition/deletions compared to the
Junio C Hamano68cf15a2010-11-06 01:01:591051 file&#8217;s size). For example, <tt>-M90%</tt> means git should consider a
Junio C Hamanoe85e36f2010-08-10 05:30:141052 delete/add pair to be a rename if more than 90% of the file
Junio C Hamano68cf15a2010-11-06 01:01:591053 hasn&#8217;t changed.
Junio C Hamano1a4e8412005-12-27 08:17:231054</p>
1055</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591056<dt class="hdlist1">
Junio C Hamanoe85e36f2010-08-10 05:30:141057-C[&lt;n&gt;]
Junio C Hamano1a4e8412005-12-27 08:17:231058</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591059<dt class="hdlist1">
Junio C Hamano0d75e872010-12-17 06:57:261060--find-copies[=&lt;n&gt;]
Junio C Hamano39c7a692010-10-27 06:08:541061</dt>
Junio C Hamano1a4e8412005-12-27 08:17:231062<dd>
1063<p>
Junio C Hamano16f98872007-06-12 16:09:141064 Detect copies as well as renames. See also <tt>--find-copies-harder</tt>.
Junio C Hamanoe85e36f2010-08-10 05:30:141065 If <tt>n</tt> is specified, it has the same meaning as for <tt>-M&lt;n&gt;</tt>.
Junio C Hamano1a4e8412005-12-27 08:17:231066</p>
1067</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591068<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231069--find-copies-harder
1070</dt>
1071<dd>
1072<p>
Junio C Hamano16f98872007-06-12 16:09:141073 For performance reasons, by default, <tt>-C</tt> option finds copies only
Junio C Hamano1a4e8412005-12-27 08:17:231074 if the original file of the copy was modified in the same
1075 changeset. This flag makes the command
1076 inspect unmodified files as candidates for the source of
1077 copy. This is a very expensive operation for large
Junio C Hamano16f98872007-06-12 16:09:141078 projects, so use it with caution. Giving more than one
1079 <tt>-C</tt> option has the same effect.
Junio C Hamano1a4e8412005-12-27 08:17:231080</p>
1081</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591082<dt class="hdlist1">
Junio C Hamanob02377c2011-04-28 22:26:021083-D
1084</dt>
1085<dt class="hdlist1">
1086--irreversible-delete
1087</dt>
1088<dd>
1089<p>
1090 Omit the preimage for deletes, i.e. print only the header but not
1091 the diff between the preimage and <tt>/dev/null</tt>. The resulting patch
1092 is not meant to be applied with <tt>patch</tt> nor <tt>git apply</tt>; this is
1093 solely for people who want to just concentrate on reviewing the
1094 text after the change. In addition, the output obviously lack
1095 enough information to apply such a patch in reverse, even manually,
1096 hence the name of the option.
1097</p>
1098<div class="paragraph"><p>When used together with <tt>-B</tt>, omit also the preimage in the deletion part
1099of a delete/create pair.</p></div>
1100</dd>
1101<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231102-l&lt;num&gt;
1103</dt>
1104<dd>
1105<p>
Junio C Hamano3b70d3c2009-11-21 17:37:371106 The <tt>-M</tt> and <tt>-C</tt> options require O(n^2) processing time where n
Junio C Hamano1a4e8412005-12-27 08:17:231107 is the number of potential rename/copy targets. This
1108 option prevents rename/copy detection from running if
1109 the number of rename/copy targets exceeds the specified
1110 number.
1111</p>
1112</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591113<dt class="hdlist1">
Junio C Hamano982eb112010-11-18 00:53:091114--diff-filter=[(A|C|D|M|R|T|U|X|B)&#8230;[*]]
1115</dt>
1116<dd>
1117<p>
1118 Select only files that are Added (<tt>A</tt>), Copied (<tt>C</tt>),
1119 Deleted (<tt>D</tt>), Modified (<tt>M</tt>), Renamed (<tt>R</tt>), have their
1120 type (i.e. regular file, symlink, submodule, &#8230;) changed (<tt>T</tt>),
1121 are Unmerged (<tt>U</tt>), are
1122 Unknown (<tt>X</tt>), or have had their pairing Broken (<tt>B</tt>).
1123 Any combination of the filter characters (including none) can be used.
1124 When <tt>*</tt> (All-or-none) is added to the combination, all
1125 paths are selected if there is any file that matches
1126 other criteria in the comparison; if there is no file
1127 that matches other criteria, nothing is selected.
1128</p>
1129</dd>
1130<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231131-S&lt;string&gt;
1132</dt>
1133<dd>
1134<p>
Junio C Hamano5217a272009-03-21 00:39:331135 Look for differences that introduce or remove an instance of
1136 &lt;string&gt;. Note that this is different than the string simply
1137 appearing in diff output; see the <em>pickaxe</em> entry in
1138 <a href="gitdiffcore.html">gitdiffcore(7)</a> for more details.
Junio C Hamano1a4e8412005-12-27 08:17:231139</p>
1140</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591141<dt class="hdlist1">
Junio C Hamano3b4609d2010-09-30 00:04:341142-G&lt;regex&gt;
1143</dt>
1144<dd>
1145<p>
1146 Look for differences whose added or removed line matches
1147 the given &lt;regex&gt;.
1148</p>
1149</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591150<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231151--pickaxe-all
1152</dt>
1153<dd>
1154<p>
Junio C Hamano3b4609d2010-09-30 00:04:341155 When <tt>-S</tt> or <tt>-G</tt> finds a change, show all the changes in that
Junio C Hamano1a4e8412005-12-27 08:17:231156 changeset, not just the files that contain the change
1157 in &lt;string&gt;.
1158</p>
1159</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591160<dt class="hdlist1">
Junio C Hamanobfe9e752006-04-05 21:43:281161--pickaxe-regex
1162</dt>
1163<dd>
1164<p>
1165 Make the &lt;string&gt; not a plain string but an extended POSIX
1166 regex to match.
1167</p>
1168</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591169<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231170-O&lt;orderfile&gt;
1171</dt>
1172<dd>
1173<p>
1174 Output the patch in the order specified in the
1175 &lt;orderfile&gt;, which has one shell glob pattern per line.
1176</p>
1177</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591178<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231179-R
1180</dt>
1181<dd>
1182<p>
1183 Swap two inputs; that is, show differences from index or
1184 on-disk file to tree contents.
1185</p>
1186</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591187<dt class="hdlist1">
Junio C Hamano24bc09a2008-02-28 00:27:441188--relative[=&lt;path&gt;]
1189</dt>
1190<dd>
1191<p>
1192 When run from a subdirectory of the project, it can be
1193 told to exclude changes outside the directory and show
1194 pathnames relative to it with this option. When you are
1195 not in a subdirectory (e.g. in a bare repository), you
1196 can name which subdirectory to make the output relative
1197 to by giving a &lt;path&gt; as an argument.
1198</p>
1199</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591200<dt class="hdlist1">
Junio C Hamanobbbb8652008-12-29 10:34:221201-a
1202</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591203<dt class="hdlist1">
Junio C Hamanoc26f5482006-07-09 09:38:141204--text
1205</dt>
1206<dd>
1207<p>
1208 Treat all files as text.
1209</p>
1210</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591211<dt class="hdlist1">
Junio C Hamanofd468962007-02-14 23:45:041212--ignore-space-at-eol
1213</dt>
1214<dd>
1215<p>
Junio C Hamano3a702342007-12-12 21:34:021216 Ignore changes in whitespace at EOL.
Junio C Hamanofd468962007-02-14 23:45:041217</p>
1218</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591219<dt class="hdlist1">
Junio C Hamanobbbb8652008-12-29 10:34:221220-b
1221</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591222<dt class="hdlist1">
Junio C Hamanod9c2d2f2006-12-06 08:59:071223--ignore-space-change
1224</dt>
1225<dd>
1226<p>
Junio C Hamano3a702342007-12-12 21:34:021227 Ignore changes in amount of whitespace. This ignores whitespace
1228 at line end, and considers all other sequences of one or
1229 more whitespace characters to be equivalent.
Junio C Hamanod9c2d2f2006-12-06 08:59:071230</p>
1231</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591232<dt class="hdlist1">
Junio C Hamanobbbb8652008-12-29 10:34:221233-w
Junio C Hamanod9c2d2f2006-12-06 08:59:071234</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591235<dt class="hdlist1">
Junio C Hamanod9c2d2f2006-12-06 08:59:071236--ignore-all-space
1237</dt>
1238<dd>
1239<p>
Junio C Hamano3a702342007-12-12 21:34:021240 Ignore whitespace when comparing lines. This ignores
1241 differences even if one line has whitespace where the other
Junio C Hamanod9c2d2f2006-12-06 08:59:071242 line has none.
1243</p>
1244</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591245<dt class="hdlist1">
Junio C Hamano1d40ee82009-01-07 10:14:161246--inter-hunk-context=&lt;lines&gt;
1247</dt>
1248<dd>
1249<p>
1250 Show the context between diff hunks, up to the specified number
1251 of lines, thereby fusing hunks that are close to each other.
1252</p>
1253</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591254<dt class="hdlist1">
Junio C Hamano11821ed2011-10-19 18:42:091255-W
1256</dt>
1257<dt class="hdlist1">
1258--function-context
1259</dt>
1260<dd>
1261<p>
1262 Show whole surrounding functions of changes.
1263</p>
1264</dd>
1265<dt class="hdlist1">
Junio C Hamano48fd2f62007-03-19 02:02:301266--exit-code
1267</dt>
1268<dd>
1269<p>
1270 Make the program exit with codes similar to diff(1).
1271 That is, it exits with 1 if there were differences and
1272 0 means no differences.
1273</p>
1274</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591275<dt class="hdlist1">
Junio C Hamano35e57552007-03-25 07:54:351276--quiet
1277</dt>
1278<dd>
1279<p>
Junio C Hamano3b70d3c2009-11-21 17:37:371280 Disable all output of the program. Implies <tt>--exit-code</tt>.
Junio C Hamano35e57552007-03-25 07:54:351281</p>
1282</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591283<dt class="hdlist1">
Junio C Hamanobb0f4042007-07-04 06:41:401284--ext-diff
1285</dt>
1286<dd>
1287<p>
1288 Allow an external diff helper to be executed. If you set an
Junio C Hamano1b50ce92007-10-03 12:05:531289 external diff driver with <a href="gitattributes.html">gitattributes(5)</a>, you need
1290 to use this option with <a href="git-log.html">git-log(1)</a> and friends.
Junio C Hamanobb0f4042007-07-04 06:41:401291</p>
1292</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591293<dt class="hdlist1">
Junio C Hamanobb0f4042007-07-04 06:41:401294--no-ext-diff
1295</dt>
1296<dd>
1297<p>
1298 Disallow external diff drivers.
1299</p>
1300</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591301<dt class="hdlist1">
Junio C Hamanoc652aed2011-07-07 01:14:311302--textconv
1303</dt>
1304<dt class="hdlist1">
1305--no-textconv
1306</dt>
1307<dd>
1308<p>
1309 Allow (or disallow) external text conversion filters to be run
1310 when comparing binary files. See <a href="gitattributes.html">gitattributes(5)</a> for
1311 details. Because textconv filters are typically a one-way
1312 conversion, the resulting diff is suitable for human
1313 consumption, but cannot be applied. For this reason, textconv
1314 filters are enabled by default only for <a href="git-diff.html">git-diff(1)</a> and
1315 <a href="git-log.html">git-log(1)</a>, but not for <a href="git-format-patch.html">git-format-patch(1)</a> or
1316 diff plumbing commands.
1317</p>
1318</dd>
1319<dt class="hdlist1">
Junio C Hamano7d449522010-07-01 00:08:511320--ignore-submodules[=&lt;when&gt;]
Junio C Hamanodfccbb02008-05-26 01:16:141321</dt>
1322<dd>
1323<p>
Junio C Hamano7d449522010-07-01 00:08:511324 Ignore changes to submodules in the diff generation. &lt;when&gt; can be
Junio C Hamano619596a2010-08-18 22:15:351325 either "none", "untracked", "dirty" or "all", which is the default
1326 Using "none" will consider the submodule modified when it either contains
1327 untracked or modified files or its HEAD differs from the commit recorded
1328 in the superproject and can be used to override any settings of the
1329 <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:511330 "untracked" is used submodules are not considered dirty when they only
1331 contain untracked content (but they are still scanned for modified
1332 content). Using "dirty" ignores all changes to the work tree of submodules,
1333 only changes to the commits stored in the superproject are shown (this was
1334 the behavior until 1.7.0). Using "all" hides all changes to submodules.
Junio C Hamanodfccbb02008-05-26 01:16:141335</p>
1336</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591337<dt class="hdlist1">
Junio C Hamanoe27cbd22007-12-21 17:57:331338--src-prefix=&lt;prefix&gt;
1339</dt>
1340<dd>
1341<p>
1342 Show the given source prefix instead of "a/".
1343</p>
1344</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591345<dt class="hdlist1">
Junio C Hamanoe27cbd22007-12-21 17:57:331346--dst-prefix=&lt;prefix&gt;
1347</dt>
1348<dd>
1349<p>
1350 Show the given destination prefix instead of "b/".
1351</p>
1352</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591353<dt class="hdlist1">
Junio C Hamanoe27cbd22007-12-21 17:57:331354--no-prefix
1355</dt>
1356<dd>
1357<p>
1358 Do not show any source or destination prefix.
1359</p>
1360</dd>
Junio C Hamanoba4b9282008-07-06 05:20:311361</dl></div>
Junio C Hamano68cf15a2010-11-06 01:01:591362<div class="paragraph"><p>For more detailed explanation on these common options, see also
Junio C Hamanoba4b9282008-07-06 05:20:311363<a href="gitdiffcore.html">gitdiffcore(7)</a>.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591364<div class="dlist"><dl>
1365<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231366&lt;tree-ish&gt;
1367</dt>
1368<dd>
1369<p>
1370 The id of a tree object.
1371</p>
1372</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591373<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231374&lt;path&gt;&#8230;
1375</dt>
1376<dd>
1377<p>
1378 If provided, the results are limited to a subset of files
1379 matching one of these prefix strings.
Junio C Hamano341071d2006-06-04 07:24:481380 i.e., file matches <tt>/^&lt;pattern1&gt;|&lt;pattern2&gt;|&#8230;/</tt>
Junio C Hamano1a4e8412005-12-27 08:17:231381 Note that this parameter does not provide any wildcard or regexp
1382 features.
1383</p>
1384</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591385<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231386-r
1387</dt>
1388<dd>
1389<p>
1390 recurse into sub-trees
1391</p>
1392</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591393<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231394-t
1395</dt>
1396<dd>
1397<p>
1398 show tree entry itself as well as subtrees. Implies -r.
1399</p>
1400</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591401<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231402--root
1403</dt>
1404<dd>
1405<p>
Junio C Hamano54bf1e22008-12-20 06:30:111406 When <em>--root</em> is specified the initial commit will be shown as a big
Junio C Hamano1a4e8412005-12-27 08:17:231407 creation event. This is equivalent to a diff against the NULL tree.
1408</p>
1409</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591410<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231411--stdin
1412</dt>
1413<dd>
1414<p>
1415 When <em>--stdin</em> is specified, the command does not take
1416 &lt;tree-ish&gt; arguments from the command line. Instead, it
Junio C Hamano3f2f6e52008-08-21 10:34:221417 reads lines containing either two &lt;tree&gt;, one &lt;commit&gt;, or a
1418 list of &lt;commit&gt; from its standard input. (Use a single space
1419 as separator.)
Junio C Hamano1a4e8412005-12-27 08:17:231420</p>
Junio C Hamano68cf15a2010-11-06 01:01:591421<div class="paragraph"><p>When two trees are given, it compares the first tree with the second.
Junio C Hamano3f2f6e52008-08-21 10:34:221422When a single commit is given, it compares the commit with its
1423parents. The remaining commits, when given, are used as if they are
Junio C Hamanob53db3c2008-08-07 00:17:521424parents of the first commit.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591425<div class="paragraph"><p>When comparing two trees, the ID of both trees (separated by a space
Junio C Hamano3f2f6e52008-08-21 10:34:221426and terminated by a newline) is printed before the difference. When
1427comparing commits, the ID of the first (or only) commit, followed by a
1428newline, is printed.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591429<div class="paragraph"><p>The following flags further affect the behavior when comparing
Junio C Hamano3f2f6e52008-08-21 10:34:221430commits (but not trees).</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231431</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591432<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231433-m
1434</dt>
1435<dd>
1436<p>
Junio C Hamano1aa40d22010-01-21 17:46:431437 By default, <em>git diff-tree --stdin</em> does not show
Junio C Hamano1a4e8412005-12-27 08:17:231438 differences for merge commits. With this flag, it shows
Junio C Hamanoa8adb1e2006-04-10 23:46:161439 differences to that commit from all of its parents. See
1440 also <em>-c</em>.
Junio C Hamano1a4e8412005-12-27 08:17:231441</p>
1442</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591443<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231444-s
1445</dt>
1446<dd>
1447<p>
Junio C Hamano1aa40d22010-01-21 17:46:431448 By default, <em>git diff-tree --stdin</em> shows differences,
Junio C Hamano1a4e8412005-12-27 08:17:231449 either in machine-readable form (without <em>-p</em>) or in patch
Junio C Hamano235a91e2006-01-07 01:13:581450 form (with <em>-p</em>). This output can be suppressed. It is
Junio C Hamano1a4e8412005-12-27 08:17:231451 only useful with <em>-v</em> flag.
1452</p>
1453</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591454<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231455-v
1456</dt>
1457<dd>
1458<p>
Junio C Hamano1aa40d22010-01-21 17:46:431459 This flag causes <em>git diff-tree --stdin</em> to also show
Junio C Hamano1a4e8412005-12-27 08:17:231460 the commit message before the differences.
1461</p>
1462</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591463<dt class="hdlist1">
Junio C Hamanod2179ef2010-10-22 04:12:171464--pretty[=&lt;format&gt;]
Junio C Hamano1a4e8412005-12-27 08:17:231465</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591466<dt class="hdlist1">
Junio C Hamanod2179ef2010-10-22 04:12:171467--format=&lt;format&gt;
Junio C Hamano0a235222009-03-06 08:21:091468</dt>
Junio C Hamano1a4e8412005-12-27 08:17:231469<dd>
1470<p>
Junio C Hamanoa3770f92007-07-25 08:53:331471 Pretty-print the contents of the commit logs in a given format,
Junio C Hamano0430e3a2007-05-15 03:13:171472 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:311473 <em>full</em>, <em>fuller</em>, <em>email</em>, <em>raw</em> and <em>format:&lt;string&gt;</em>. See
1474 the "PRETTY FORMATS" section for some additional details for each
1475 format. When omitted, the format defaults to <em>medium</em>.
Junio C Hamano1a4e8412005-12-27 08:17:231476</p>
Junio C Hamano68cf15a2010-11-06 01:01:591477<div class="paragraph"><p>Note: you can specify the default pretty format in the repository
Junio C Hamanoba4b9282008-07-06 05:20:311478configuration (see <a href="git-config.html">git-config(1)</a>).</p></div>
Junio C Hamano0430e3a2007-05-15 03:13:171479</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591480<dt class="hdlist1">
Junio C Hamanoee695f22007-06-21 00:35:361481--abbrev-commit
1482</dt>
1483<dd>
1484<p>
1485 Instead of showing the full 40-byte hexadecimal commit object
Junio C Hamano6efe3022009-01-13 16:47:561486 name, show only a partial prefix. Non default number of
Junio C Hamanoee695f22007-06-21 00:35:361487 digits can be specified with "--abbrev=&lt;n&gt;" (which also modifies
1488 diff output, if it is displayed).
1489</p>
Junio C Hamano68cf15a2010-11-06 01:01:591490<div class="paragraph"><p>This should make "--pretty=oneline" a whole lot more readable for
Junio C Hamanoba4b9282008-07-06 05:20:311491people using 80-column terminals.</p></div>
Junio C Hamanoee695f22007-06-21 00:35:361492</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591493<dt class="hdlist1">
Junio C Hamanof93530e2011-05-25 23:59:591494--no-abbrev-commit
1495</dt>
1496<dd>
1497<p>
1498 Show the full 40-byte hexadecimal commit object name. This negates
1499 <tt>--abbrev-commit</tt> and those options which imply it such as
1500 "--oneline". It also overrides the <em>log.abbrevCommit</em> variable.
1501</p>
1502</dd>
1503<dt class="hdlist1">
Junio C Hamano0a235222009-03-06 08:21:091504--oneline
1505</dt>
1506<dd>
1507<p>
1508 This is a shorthand for "--pretty=oneline --abbrev-commit"
1509 used together.
1510</p>
1511</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591512<dt class="hdlist1">
Junio C Hamano0430e3a2007-05-15 03:13:171513--encoding[=&lt;encoding&gt;]
1514</dt>
1515<dd>
1516<p>
1517 The commit objects record the encoding used for the log message
1518 in their encoding header; this option can be used to tell the
1519 command to re-code the commit log message in the encoding
1520 preferred by the user. For non plumbing commands this
1521 defaults to UTF-8.
1522</p>
1523</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591524<dt class="hdlist1">
Junio C Hamano60033462011-05-03 00:48:431525--notes[=&lt;ref&gt;]
Junio C Hamano57827fb2010-01-23 03:02:501526</dt>
1527<dd>
1528<p>
1529 Show the notes (see <a href="git-notes.html">git-notes(1)</a>) that annotate the
1530 commit, when showing the commit log message. This is the default
1531 for <tt>git log</tt>, <tt>git show</tt> and <tt>git whatchanged</tt> commands when
Junio C Hamano60033462011-05-03 00:48:431532 there is no <tt>--pretty</tt>, <tt>--format</tt> nor <tt>--oneline</tt> option given
1533 on the command line.
Junio C Hamano57827fb2010-01-23 03:02:501534</p>
Junio C Hamano60033462011-05-03 00:48:431535<div class="paragraph"><p>By default, the notes shown are from the notes refs listed in the
1536<em>core.notesRef</em> and <em>notes.displayRef</em> variables (or corresponding
1537environment overrides). See <a href="git-config.html">git-config(1)</a> for more details.</p></div>
1538<div class="paragraph"><p>With an optional <em>&lt;ref&gt;</em> argument, show this notes ref instead of the
1539default notes ref(s). The ref is taken to be in <tt>refs/notes/</tt> if it
1540is not qualified.</p></div>
1541<div class="paragraph"><p>Multiple --notes options can be combined to control which notes are
1542being displayed. Examples: "--notes=foo" will show only notes from
1543"refs/notes/foo"; "--notes=foo --notes" will show both notes from
1544"refs/notes/foo" and from the default notes ref(s).</p></div>
Junio C Hamano31667362010-03-25 00:38:531545</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591546<dt class="hdlist1">
Junio C Hamano60033462011-05-03 00:48:431547--no-notes
1548</dt>
1549<dd>
1550<p>
1551 Do not show notes. This negates the above <tt>--notes</tt> option, by
1552 resetting the list of notes refs from which notes are shown.
1553 Options are parsed in the order given on the command line, so e.g.
1554 "--notes --notes=foo --no-notes --notes=bar" will only show notes
1555 from "refs/notes/bar".
1556</p>
1557</dd>
1558<dt class="hdlist1">
1559--show-notes[=&lt;ref&gt;]
1560</dt>
1561<dt class="hdlist1">
Junio C Hamano31667362010-03-25 00:38:531562--[no-]standard-notes
1563</dt>
1564<dd>
1565<p>
Junio C Hamano60033462011-05-03 00:48:431566 These options are deprecated. Use the above --notes/--no-notes
1567 options instead.
Junio C Hamano31667362010-03-25 00:38:531568</p>
Junio C Hamano57827fb2010-01-23 03:02:501569</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591570<dt class="hdlist1">
Junio C Hamano0430e3a2007-05-15 03:13:171571--no-commit-id
1572</dt>
1573<dd>
1574<p>
Junio C Hamano1aa40d22010-01-21 17:46:431575 <em>git diff-tree</em> outputs a line with the commit ID when
Junio C Hamano0430e3a2007-05-15 03:13:171576 applicable. This flag suppressed the commit ID output.
1577</p>
1578</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591579<dt class="hdlist1">
Junio C Hamano0430e3a2007-05-15 03:13:171580-c
1581</dt>
1582<dd>
1583<p>
1584 This flag changes the way a merge commit is displayed
1585 (which means it is useful only when the command is given
1586 one &lt;tree-ish&gt;, or <em>--stdin</em>). It shows the differences
1587 from each of the parents to the merge result simultaneously
1588 instead of showing pairwise diff between a parent and the
1589 result one at a time (which is what the <em>-m</em> option does).
1590 Furthermore, it lists only files which were modified
1591 from all parents.
1592</p>
1593</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591594<dt class="hdlist1">
Junio C Hamano0430e3a2007-05-15 03:13:171595--cc
1596</dt>
1597<dd>
1598<p>
1599 This flag changes the way a merge commit patch is displayed,
1600 in a similar way to the <em>-c</em> option. It implies the <em>-c</em>
1601 and <em>-p</em> options and further compresses the patch output
Junio C Hamanoccc2f762008-07-24 04:03:331602 by omitting uninteresting hunks whose the contents in the parents
1603 have only two variants and the merge result picks one of them
1604 without modification. When all hunks are uninteresting, the commit
1605 itself and the commit log message is not shown, just like in any other
1606 "empty diff" case.
Junio C Hamano0430e3a2007-05-15 03:13:171607</p>
1608</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591609<dt class="hdlist1">
Junio C Hamano0430e3a2007-05-15 03:13:171610--always
1611</dt>
1612<dd>
1613<p>
1614 Show the commit itself and the commit log message even
1615 if the diff itself is empty.
1616</p>
1617</dd>
Junio C Hamanoba4b9282008-07-06 05:20:311618</dl></div>
Junio C Hamano0430e3a2007-05-15 03:13:171619</div>
Junio C Hamanoba4b9282008-07-06 05:20:311620<h2 id="_pretty_formats">PRETTY FORMATS</h2>
Junio C Hamano0430e3a2007-05-15 03:13:171621<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:591622<div class="paragraph"><p>If the commit is a merge, and if the pretty-format
Junio C Hamano0430e3a2007-05-15 03:13:171623is not <em>oneline</em>, <em>email</em> or <em>raw</em>, an additional line is
1624inserted before the <em>Author:</em> line. This line begins with
1625"Merge: " and the sha1s of ancestral commits are printed,
1626separated by spaces. Note that the listed commits may not
1627necessarily be the list of the <strong>direct</strong> parent commits if you
1628have limited your view of history: for example, if you are
1629only interested in changes related to a certain directory or
Junio C Hamanoba4b9282008-07-06 05:20:311630file.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591631<div class="paragraph"><p>There are several built-in formats, and you can define
Junio C Hamanoa574a092010-06-13 19:57:101632additional formats by setting a pretty.&lt;name&gt;
1633config option to either another format name, or a
1634<em>format:</em> string, as described below (see
1635<a href="git-config.html">git-config(1)</a>). Here are the details of the
1636built-in formats:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591637<div class="ulist"><ul>
Junio C Hamanoa340aaa2006-11-23 02:47:331638<li>
1639<p>
1640<em>oneline</em>
1641</p>
1642<div class="literalblock">
1643<div class="content">
1644<pre><tt>&lt;sha1&gt; &lt;title line&gt;</tt></pre>
1645</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591646<div class="paragraph"><p>This is designed to be as compact as possible.</p></div>
Junio C Hamanoa340aaa2006-11-23 02:47:331647</li>
1648<li>
1649<p>
1650<em>short</em>
1651</p>
1652<div class="literalblock">
1653<div class="content">
1654<pre><tt>commit &lt;sha1&gt;
1655Author: &lt;author&gt;</tt></pre>
1656</div></div>
1657<div class="literalblock">
1658<div class="content">
1659<pre><tt>&lt;title line&gt;</tt></pre>
1660</div></div>
1661</li>
1662<li>
1663<p>
1664<em>medium</em>
1665</p>
1666<div class="literalblock">
1667<div class="content">
1668<pre><tt>commit &lt;sha1&gt;
1669Author: &lt;author&gt;
Junio C Hamano6a3c8272008-12-19 21:38:181670Date: &lt;author date&gt;</tt></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:331671</div></div>
1672<div class="literalblock">
1673<div class="content">
1674<pre><tt>&lt;title line&gt;</tt></pre>
1675</div></div>
1676<div class="literalblock">
1677<div class="content">
1678<pre><tt>&lt;full commit message&gt;</tt></pre>
1679</div></div>
1680</li>
1681<li>
1682<p>
1683<em>full</em>
1684</p>
1685<div class="literalblock">
1686<div class="content">
1687<pre><tt>commit &lt;sha1&gt;
1688Author: &lt;author&gt;
1689Commit: &lt;committer&gt;</tt></pre>
1690</div></div>
1691<div class="literalblock">
1692<div class="content">
1693<pre><tt>&lt;title line&gt;</tt></pre>
1694</div></div>
1695<div class="literalblock">
1696<div class="content">
1697<pre><tt>&lt;full commit message&gt;</tt></pre>
1698</div></div>
1699</li>
1700<li>
1701<p>
1702<em>fuller</em>
1703</p>
1704<div class="literalblock">
1705<div class="content">
1706<pre><tt>commit &lt;sha1&gt;
Junio C Hamano6a3c8272008-12-19 21:38:181707Author: &lt;author&gt;
Junio C Hamanoba4b9282008-07-06 05:20:311708AuthorDate: &lt;author date&gt;
Junio C Hamano6a3c8272008-12-19 21:38:181709Commit: &lt;committer&gt;
Junio C Hamanoba4b9282008-07-06 05:20:311710CommitDate: &lt;committer date&gt;</tt></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:331711</div></div>
1712<div class="literalblock">
1713<div class="content">
1714<pre><tt>&lt;title line&gt;</tt></pre>
1715</div></div>
1716<div class="literalblock">
1717<div class="content">
1718<pre><tt>&lt;full commit message&gt;</tt></pre>
1719</div></div>
1720</li>
1721<li>
1722<p>
1723<em>email</em>
1724</p>
1725<div class="literalblock">
1726<div class="content">
1727<pre><tt>From &lt;sha1&gt; &lt;date&gt;
1728From: &lt;author&gt;
Junio C Hamanoba4b9282008-07-06 05:20:311729Date: &lt;author date&gt;
Junio C Hamanoa340aaa2006-11-23 02:47:331730Subject: [PATCH] &lt;title line&gt;</tt></pre>
1731</div></div>
1732<div class="literalblock">
1733<div class="content">
Junio C Hamano0430e3a2007-05-15 03:13:171734<pre><tt>&lt;full commit message&gt;</tt></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:331735</div></div>
1736</li>
1737<li>
1738<p>
1739<em>raw</em>
1740</p>
Junio C Hamano68cf15a2010-11-06 01:01:591741<div class="paragraph"><p>The <em>raw</em> format shows the entire commit exactly as
Junio C Hamanoa340aaa2006-11-23 02:47:331742stored in the commit object. Notably, the SHA1s are
1743displayed in full, regardless of whether --abbrev or
1744--no-abbrev are used, and <em>parents</em> information show the
1745true parent commits, without taking grafts nor history
Junio C Hamanoba4b9282008-07-06 05:20:311746simplification into account.</p></div>
Junio C Hamanoa340aaa2006-11-23 02:47:331747</li>
Junio C Hamanoa3fd83c2007-03-02 10:34:361748<li>
1749<p>
Junio C Hamanoe32ec8b2010-06-02 23:32:311750<em>format:&lt;string&gt;</em>
Junio C Hamanoa3fd83c2007-03-02 10:34:361751</p>
Junio C Hamano68cf15a2010-11-06 01:01:591752<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:361753you want to show. It works a little bit like printf format,
1754with the notable exception that you get a newline with <em>%n</em>
Junio C Hamanoba4b9282008-07-06 05:20:311755instead of <em>\n</em>.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591756<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:311757would show something like this:</p></div>
Junio C Hamano0430e3a2007-05-15 03:13:171758<div class="listingblock">
1759<div class="content">
1760<pre><tt>The author of fe6e0ee was Junio C Hamano, 23 hours ago
Junio C Hamano68cf15a2010-11-06 01:01:591761The title was &gt;&gt;t4119: test autocomputing -p&lt;n&gt; for traditional diff input.&lt;&lt;</tt></pre>
Junio C Hamano0430e3a2007-05-15 03:13:171762</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591763<div class="paragraph"><p>The placeholders are:</p></div>
1764<div class="ulist"><ul>
Junio C Hamanoa3fd83c2007-03-02 10:34:361765<li>
1766<p>
1767<em>%H</em>: commit hash
1768</p>
1769</li>
1770<li>
1771<p>
1772<em>%h</em>: abbreviated commit hash
1773</p>
1774</li>
1775<li>
1776<p>
1777<em>%T</em>: tree hash
1778</p>
1779</li>
1780<li>
1781<p>
1782<em>%t</em>: abbreviated tree hash
1783</p>
1784</li>
1785<li>
1786<p>
1787<em>%P</em>: parent hashes
1788</p>
1789</li>
1790<li>
1791<p>
1792<em>%p</em>: abbreviated parent hashes
1793</p>
1794</li>
1795<li>
1796<p>
1797<em>%an</em>: author name
1798</p>
1799</li>
1800<li>
1801<p>
Junio C Hamano8bc410e2009-02-15 10:38:191802<em>%aN</em>: author name (respecting .mailmap, see <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)
Junio C Hamanof5a93622008-07-16 03:23:571803</p>
1804</li>
1805<li>
1806<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:361807<em>%ae</em>: author email
1808</p>
1809</li>
1810<li>
1811<p>
Junio C Hamano8bc410e2009-02-15 10:38:191812<em>%aE</em>: author email (respecting .mailmap, see <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)
1813</p>
1814</li>
1815<li>
1816<p>
Junio C Hamanoa387df32008-08-29 08:56:581817<em>%ad</em>: author date (format respects --date= option)
Junio C Hamanoa3fd83c2007-03-02 10:34:361818</p>
1819</li>
1820<li>
1821<p>
1822<em>%aD</em>: author date, RFC2822 style
1823</p>
1824</li>
1825<li>
1826<p>
1827<em>%ar</em>: author date, relative
1828</p>
1829</li>
1830<li>
1831<p>
1832<em>%at</em>: author date, UNIX timestamp
1833</p>
1834</li>
1835<li>
1836<p>
Junio C Hamano02f130b2007-07-14 08:26:561837<em>%ai</em>: author date, ISO 8601 format
1838</p>
1839</li>
1840<li>
1841<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:361842<em>%cn</em>: committer name
1843</p>
1844</li>
1845<li>
1846<p>
Junio C Hamano8bc410e2009-02-15 10:38:191847<em>%cN</em>: committer name (respecting .mailmap, see <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)
Junio C Hamanof5a93622008-07-16 03:23:571848</p>
1849</li>
1850<li>
1851<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:361852<em>%ce</em>: committer email
1853</p>
1854</li>
1855<li>
1856<p>
Junio C Hamano8bc410e2009-02-15 10:38:191857<em>%cE</em>: committer email (respecting .mailmap, see <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)
1858</p>
1859</li>
1860<li>
1861<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:361862<em>%cd</em>: committer date
1863</p>
1864</li>
1865<li>
1866<p>
1867<em>%cD</em>: committer date, RFC2822 style
1868</p>
1869</li>
1870<li>
1871<p>
1872<em>%cr</em>: committer date, relative
1873</p>
1874</li>
1875<li>
1876<p>
1877<em>%ct</em>: committer date, UNIX timestamp
1878</p>
1879</li>
1880<li>
1881<p>
Junio C Hamano02f130b2007-07-14 08:26:561882<em>%ci</em>: committer date, ISO 8601 format
1883</p>
1884</li>
1885<li>
1886<p>
Junio C Hamano5e4d8de2008-09-19 06:27:021887<em>%d</em>: ref names, like the --decorate option of <a href="git-log.html">git-log(1)</a>
1888</p>
1889</li>
1890<li>
1891<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:361892<em>%e</em>: encoding
1893</p>
1894</li>
1895<li>
1896<p>
1897<em>%s</em>: subject
1898</p>
1899</li>
1900<li>
1901<p>
Junio C Hamano5f9a6f02009-04-06 08:26:561902<em>%f</em>: sanitized subject line, suitable for a filename
1903</p>
1904</li>
1905<li>
1906<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:361907<em>%b</em>: body
1908</p>
1909</li>
1910<li>
1911<p>
Junio C Hamanocb39aea2010-05-09 07:24:481912<em>%B</em>: raw body (unwrapped subject and body)
1913</p>
1914</li>
1915<li>
1916<p>
Junio C Hamano3b70d3c2009-11-21 17:37:371917<em>%N</em>: commit notes
1918</p>
1919</li>
1920<li>
1921<p>
Junio C Hamanoc21ab052009-10-31 04:03:551922<em>%gD</em>: reflog selector, e.g., <tt>refs/stash@{1}</tt>
1923</p>
1924</li>
1925<li>
1926<p>
1927<em>%gd</em>: shortened reflog selector, e.g., <tt>stash@{1}</tt>
1928</p>
1929</li>
1930<li>
1931<p>
Junio C Hamano962f3a32011-12-22 20:21:441932<em>%gn</em>: reflog identity name
1933</p>
1934</li>
1935<li>
1936<p>
1937<em>%gN</em>: reflog identity name (respecting .mailmap, see <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)
1938</p>
1939</li>
1940<li>
1941<p>
1942<em>%ge</em>: reflog identity email
1943</p>
1944</li>
1945<li>
1946<p>
1947<em>%gE</em>: reflog identity email (respecting .mailmap, see <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)
1948</p>
1949</li>
1950<li>
1951<p>
Junio C Hamanoc21ab052009-10-31 04:03:551952<em>%gs</em>: reflog subject
1953</p>
1954</li>
1955<li>
1956<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:361957<em>%Cred</em>: switch color to red
1958</p>
1959</li>
1960<li>
1961<p>
1962<em>%Cgreen</em>: switch color to green
1963</p>
1964</li>
1965<li>
1966<p>
1967<em>%Cblue</em>: switch color to blue
1968</p>
1969</li>
1970<li>
1971<p>
1972<em>%Creset</em>: reset color
1973</p>
1974</li>
1975<li>
1976<p>
Junio C Hamanocc0cb312009-01-22 03:38:501977<em>%C(&#8230;)</em>: color specification, as described in color.branch.* config option
1978</p>
1979</li>
1980<li>
1981<p>
Junio C Hamanod9e0e5d2007-04-14 16:22:041982<em>%m</em>: left, right or boundary mark
1983</p>
1984</li>
1985<li>
1986<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:361987<em>%n</em>: newline
1988</p>
Junio C Hamano0430e3a2007-05-15 03:13:171989</li>
Junio C Hamanob78d2592008-04-09 09:39:081990<li>
1991<p>
Junio C Hamanoa9701f02010-01-21 00:42:161992<em>%%</em>: a raw <em>%</em>
1993</p>
1994</li>
1995<li>
1996<p>
Junio C Hamanob78d2592008-04-09 09:39:081997<em>%x00</em>: print a byte from a hex code
1998</p>
1999</li>
Junio C Hamanobf984de2009-11-23 06:11:192000<li>
2001<p>
2002<em>%w([&lt;w&gt;[,&lt;i1&gt;[,&lt;i2&gt;]]])</em>: switch line wrapping, like the -w option of
Junio C Hamano5706e0b2009-11-24 10:54:162003 <a href="git-shortlog.html">git-shortlog(1)</a>.
Junio C Hamanobf984de2009-11-23 06:11:192004</p>
2005</li>
Junio C Hamanoba4b9282008-07-06 05:20:312006</ul></div>
Junio C Hamanoa3fd83c2007-03-02 10:34:362007</li>
Junio C Hamanoc21ab052009-10-31 04:03:552008</ul></div>
2009<div class="admonitionblock">
2010<table><tr>
2011<td class="icon">
2012<div class="title">Note</div>
2013</td>
2014<td class="content">Some placeholders may depend on other options given to the
2015revision traversal engine. For example, the <tt>%g*</tt> reflog options will
2016insert an empty string unless we are traversing reflog entries (e.g., by
2017<tt>git log -g</tt>). The <tt>%d</tt> placeholder will use the "short" decoration
2018format if <tt>--decorate</tt> was not already provided on the command line.</td>
2019</tr></table>
2020</div>
Junio C Hamano68cf15a2010-11-06 01:01:592021<div class="paragraph"><p>If you add a <tt>&#43;</tt> (plus sign) after <em>%</em> of a placeholder, a line-feed
Junio C Hamano2bd8a742009-12-01 21:16:592022is inserted immediately before the expansion if and only if the
2023placeholder expands to a non-empty string.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592024<div class="paragraph"><p>If you add a <tt>-</tt> (minus sign) after <em>%</em> of a placeholder, line-feeds that
Junio C Hamano2bd8a742009-12-01 21:16:592025immediately precede the expansion are deleted if and only if the
2026placeholder expands to an empty string.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592027<div class="paragraph"><p>If you add a ` ` (space) after <em>%</em> of a placeholder, a space
Junio C Hamano89a57342010-06-22 23:22:552028is inserted immediately before the expansion if and only if the
2029placeholder expands to a non-empty string.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592030<div class="ulist"><ul>
Junio C Hamano6fb124c2008-06-13 10:04:012031<li>
2032<p>
2033<em>tformat:</em>
2034</p>
Junio C Hamano68cf15a2010-11-06 01:01:592035<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:012036provides "terminator" semantics instead of "separator" semantics. In
2037other words, each commit has the message terminator character (usually a
2038newline) appended, rather than a separator placed between entries.
2039This means that the final entry of a single-line format will be properly
2040terminated with a new line, just as the "oneline" format does.
Junio C Hamanoba4b9282008-07-06 05:20:312041For example:</p></div>
Junio C Hamano6fb124c2008-06-13 10:04:012042<div class="listingblock">
2043<div class="content">
2044<pre><tt>$ git log -2 --pretty=format:%h 4da45bef \
2045 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
20464da45be
20477134973 -- NO NEWLINE
2048
2049$ git log -2 --pretty=tformat:%h 4da45bef \
2050 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
20514da45be
20527134973</tt></pre>
2053</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592054<div class="paragraph"><p>In addition, any unrecognized string that has a <tt>%</tt> in it is interpreted
Junio C Hamano0a235222009-03-06 08:21:092055as if it has <tt>tformat:</tt> in front of it. For example, these two are
2056equivalent:</p></div>
2057<div class="listingblock">
2058<div class="content">
2059<pre><tt>$ git log -2 --pretty=tformat:%h 4da45bef
2060$ git log -2 --pretty=%h 4da45bef</tt></pre>
2061</div></div>
Junio C Hamano6fb124c2008-06-13 10:04:012062</li>
Junio C Hamanoba4b9282008-07-06 05:20:312063</ul></div>
Junio C Hamano1a4e8412005-12-27 08:17:232064</div>
Junio C Hamanoba4b9282008-07-06 05:20:312065<h2 id="_limiting_output">Limiting Output</h2>
Junio C Hamano1a4e8412005-12-27 08:17:232066<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:592067<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:312068example some architecture-specific files, you might do:</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232069<div class="literalblock">
2070<div class="content">
Junio C Hamanofce7c7e2008-07-02 03:06:382071<pre><tt>git diff-tree -r &lt;tree-ish&gt; &lt;tree-ish&gt; arch/ia64 include/asm-ia64</tt></pre>
Junio C Hamano1a4e8412005-12-27 08:17:232072</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592073<div class="paragraph"><p>and it will only show you what changed in those two directories.</p></div>
2074<div class="paragraph"><p>Or if you are searching for what changed in just <tt>kernel/sched.c</tt>, just do</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232075<div class="literalblock">
2076<div class="content">
Junio C Hamanofce7c7e2008-07-02 03:06:382077<pre><tt>git diff-tree -r &lt;tree-ish&gt; &lt;tree-ish&gt; kernel/sched.c</tt></pre>
Junio C Hamano1a4e8412005-12-27 08:17:232078</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592079<div class="paragraph"><p>and it will ignore all differences to other files.</p></div>
2080<div class="paragraph"><p>The pattern is always the prefix, and is matched exactly. There are no
Junio C Hamano1a4e8412005-12-27 08:17:232081wildcards. Even stricter, it has to match a complete path component.
2082I.e. "foo" does not pick up <tt>foobar.h</tt>. "foo" does match <tt>foo/bar.h</tt>
Junio C Hamanoba4b9282008-07-06 05:20:312083so it can be used to name subdirectories.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592084<div class="paragraph"><p>An example of normal usage is:</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232085<div class="literalblock">
2086<div class="content">
Junio C Hamanoef5a2f92011-05-31 19:53:332087<pre><tt>torvalds@ppc970:~/git&gt; git diff-tree --abbrev 5319e4
2088:100664 100664 ac348b... a01513... git-fsck-objects.c</tt></pre>
Junio C Hamano1a4e8412005-12-27 08:17:232089</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592090<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:312091this one:</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232092<div class="listingblock">
2093<div class="content">
2094<pre><tt>commit 3c6f7ca19ad4043e9e72fa94106f352897e651a8
2095tree 5319e4d609cdd282069cc4dce33c1db559539b03
2096parent b4e628ea30d5ab3606119d2ea5caeab141d38df7
2097author Linus Torvalds &lt;torvalds@ppc970.osdl.org&gt; Sat Apr 9 12:02:30 2005
2098committer Linus Torvalds &lt;torvalds@ppc970.osdl.org&gt; Sat Apr 9 12:02:30 2005
2099
2100Make "git-fsck-objects" print out all the root commits it finds.
2101
2102Once I do the reference tracking, I'll also make it print out all the
2103HEAD commits it finds, which is even more interesting.</tt></pre>
2104</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592105<div class="paragraph"><p>in case you care).</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232106</div>
Junio C Hamano543f8d62009-07-29 08:35:212107<h2 id="_raw_output_format">Raw output format</h2>
Junio C Hamano1a4e8412005-12-27 08:17:232108<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:592109<div class="paragraph"><p>The raw output format from "git-diff-index", "git-diff-tree",
Junio C Hamanoba4b9282008-07-06 05:20:312110"git-diff-files" and "git diff --raw" are very similar.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592111<div class="paragraph"><p>These commands all compare two sets of things; what is
Junio C Hamanoba4b9282008-07-06 05:20:312112compared differs:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592113<div class="dlist"><dl>
2114<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:232115git-diff-index &lt;tree-ish&gt;
2116</dt>
2117<dd>
2118<p>
2119 compares the &lt;tree-ish&gt; and the files on the filesystem.
2120</p>
2121</dd>
Junio C Hamano68cf15a2010-11-06 01:01:592122<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:232123git-diff-index --cached &lt;tree-ish&gt;
2124</dt>
2125<dd>
2126<p>
2127 compares the &lt;tree-ish&gt; and the index.
2128</p>
2129</dd>
Junio C Hamano68cf15a2010-11-06 01:01:592130<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:232131git-diff-tree [-r] &lt;tree-ish-1&gt; &lt;tree-ish-2&gt; [&lt;pattern&gt;&#8230;]
2132</dt>
2133<dd>
2134<p>
2135 compares the trees named by the two arguments.
2136</p>
2137</dd>
Junio C Hamano68cf15a2010-11-06 01:01:592138<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:232139git-diff-files [&lt;pattern&gt;&#8230;]
2140</dt>
2141<dd>
2142<p>
2143 compares the index and the files on the filesystem.
2144</p>
2145</dd>
Junio C Hamanoba4b9282008-07-06 05:20:312146</dl></div>
Junio C Hamano68cf15a2010-11-06 01:01:592147<div class="paragraph"><p>The "git-diff-tree" command begins its output by printing the hash of
Junio C Hamano543f8d62009-07-29 08:35:212148what is being compared. After that, all the commands print one output
2149line per changed file.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592150<div class="paragraph"><p>An output line is formatted this way:</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232151<div class="listingblock">
2152<div class="content">
2153<pre><tt>in-place edit :100644 100644 bcd1234... 0123456... M file0
2154copy-edit :100644 100644 abcd123... 1234567... C68 file1 file2
2155rename-edit :100644 100644 abcd123... 1234567... R86 file1 file3
2156create :000000 100644 0000000... 1234567... A file4
2157delete :100644 000000 1234567... 0000000... D file5
2158unmerged :000000 000000 0000000... 0000000... U file6</tt></pre>
2159</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592160<div class="paragraph"><p>That is, from the left to the right:</p></div>
2161<div class="olist arabic"><ol class="arabic">
Junio C Hamano1a4e8412005-12-27 08:17:232162<li>
2163<p>
2164a colon.
2165</p>
2166</li>
2167<li>
2168<p>
2169mode for "src"; 000000 if creation or unmerged.
2170</p>
2171</li>
2172<li>
2173<p>
2174a space.
2175</p>
2176</li>
2177<li>
2178<p>
2179mode for "dst"; 000000 if deletion or unmerged.
2180</p>
2181</li>
2182<li>
2183<p>
2184a space.
2185</p>
2186</li>
2187<li>
2188<p>
2189sha1 for "src"; 0{40} if creation or unmerged.
2190</p>
2191</li>
2192<li>
2193<p>
2194a space.
2195</p>
2196</li>
2197<li>
2198<p>
2199sha1 for "dst"; 0{40} if creation, unmerged or "look at work tree".
2200</p>
2201</li>
2202<li>
2203<p>
2204a space.
2205</p>
2206</li>
2207<li>
2208<p>
2209status, followed by optional "score" number.
2210</p>
2211</li>
2212<li>
2213<p>
2214a tab or a NUL when <em>-z</em> option is used.
2215</p>
2216</li>
2217<li>
2218<p>
2219path for "src"
2220</p>
2221</li>
2222<li>
2223<p>
2224a tab or a NUL when <em>-z</em> option is used; only exists for C or R.
2225</p>
2226</li>
2227<li>
2228<p>
2229path for "dst"; only exists for C or R.
2230</p>
2231</li>
2232<li>
2233<p>
2234an LF or a NUL when <em>-z</em> option is used, to terminate the record.
2235</p>
2236</li>
Junio C Hamanoba4b9282008-07-06 05:20:312237</ol></div>
Junio C Hamano68cf15a2010-11-06 01:01:592238<div class="paragraph"><p>Possible status letters are:</p></div>
2239<div class="ulist"><ul>
Junio C Hamanoaa17c7c2008-11-03 04:36:582240<li>
2241<p>
2242A: addition of a file
2243</p>
2244</li>
2245<li>
2246<p>
2247C: copy of a file into a new one
2248</p>
2249</li>
2250<li>
2251<p>
2252D: deletion of a file
2253</p>
2254</li>
2255<li>
2256<p>
2257M: modification of the contents or mode of a file
2258</p>
2259</li>
2260<li>
2261<p>
2262R: renaming of a file
2263</p>
2264</li>
2265<li>
2266<p>
2267T: change in the type of the file
2268</p>
2269</li>
2270<li>
2271<p>
2272U: file is unmerged (you must complete the merge before it can
2273be committed)
2274</p>
2275</li>
2276<li>
2277<p>
2278X: "unknown" change type (most probably a bug, please report it)
2279</p>
2280</li>
2281</ul></div>
Junio C Hamano68cf15a2010-11-06 01:01:592282<div class="paragraph"><p>Status letters C and R are always followed by a score (denoting the
Junio C Hamanoaa17c7c2008-11-03 04:36:582283percentage of similarity between the source and target of the move or
2284copy), and are the only ones to be so.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592285<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:312286and it is out of sync with the index.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592287<div class="paragraph"><p>Example:</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232288<div class="listingblock">
2289<div class="content">
2290<pre><tt>:100644 100644 5be4a4...... 000000...... M file.c</tt></pre>
2291</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592292<div class="paragraph"><p>When <tt>-z</tt> option is not used, TAB, LF, and backslash characters
Junio C Hamano1a4e8412005-12-27 08:17:232293in pathnames are represented as <tt>\t</tt>, <tt>\n</tt>, and <tt>\\</tt>,
Junio C Hamanoba4b9282008-07-06 05:20:312294respectively.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232295</div>
Junio C Hamanoba4b9282008-07-06 05:20:312296<h2 id="_diff_format_for_merges">diff format for merges</h2>
Junio C Hamano67fad6d2007-05-06 08:53:122297<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:592298<div class="paragraph"><p>"git-diff-tree", "git-diff-files" and "git-diff --raw"
Junio C Hamano7ae0ab22007-11-03 02:46:462299can take <em>-c</em> or <em>--cc</em> option
Junio C Hamano67fad6d2007-05-06 08:53:122300to generate diff output also for merge commits. The output differs
Junio C Hamanoba4b9282008-07-06 05:20:312301from the format described above in the following way:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592302<div class="olist arabic"><ol class="arabic">
Junio C Hamano67fad6d2007-05-06 08:53:122303<li>
2304<p>
2305there is a colon for each parent
2306</p>
2307</li>
2308<li>
2309<p>
2310there are more "src" modes and "src" sha1
2311</p>
2312</li>
2313<li>
2314<p>
2315status is concatenated status characters for each parent
2316</p>
2317</li>
2318<li>
2319<p>
2320no optional "score" number
2321</p>
2322</li>
2323<li>
2324<p>
2325single path, only for "dst"
2326</p>
2327</li>
Junio C Hamanoba4b9282008-07-06 05:20:312328</ol></div>
Junio C Hamano68cf15a2010-11-06 01:01:592329<div class="paragraph"><p>Example:</p></div>
Junio C Hamano67fad6d2007-05-06 08:53:122330<div class="listingblock">
2331<div class="content">
2332<pre><tt>::100644 100644 100644 fabadb8... cc95eb0... 4866510... MM describe.c</tt></pre>
2333</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592334<div class="paragraph"><p>Note that <em>combined diff</em> lists only files which were modified from
Junio C Hamanoba4b9282008-07-06 05:20:312335all parents.</p></div>
Junio C Hamano67fad6d2007-05-06 08:53:122336</div>
Junio C Hamanoba4b9282008-07-06 05:20:312337<h2 id="_generating_patches_with_p">Generating patches with -p</h2>
Junio C Hamano1a4e8412005-12-27 08:17:232338<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:592339<div class="paragraph"><p>When "git-diff-index", "git-diff-tree", or "git-diff-files" are run
Junio C Hamano00b8b632007-12-07 09:50:492340with a <em>-p</em> option, "git diff" without the <em>--raw</em> option, or
2341"git log" with the "-p" option, they
Junio C Hamano7ae0ab22007-11-03 02:46:462342do not produce the output described above; instead they produce a
2343patch file. You can customize the creation of such patches via the
Junio C Hamanoba4b9282008-07-06 05:20:312344GIT_EXTERNAL_DIFF and the GIT_DIFF_OPTS environment variables.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592345<div class="paragraph"><p>What the -p option produces is slightly different from the traditional
Junio C Hamano7f9fa862010-10-19 23:51:142346diff format:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592347<div class="olist arabic"><ol class="arabic">
Junio C Hamano1a4e8412005-12-27 08:17:232348<li>
2349<p>
Junio C Hamano7f9fa862010-10-19 23:51:142350It is preceded with a "git diff" header that looks like this:
Junio C Hamano1a4e8412005-12-27 08:17:232351</p>
2352<div class="literalblock">
2353<div class="content">
2354<pre><tt>diff --git a/file1 b/file2</tt></pre>
2355</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592356<div class="paragraph"><p>The <tt>a/</tt> and <tt>b/</tt> filenames are the same unless rename/copy is
Junio C Hamano1a4e8412005-12-27 08:17:232357involved. Especially, even for a creation or a deletion,
Junio C Hamano68cf15a2010-11-06 01:01:592358<tt>/dev/null</tt> is <em>not</em> used in place of the <tt>a/</tt> or <tt>b/</tt> filenames.</p></div>
2359<div class="paragraph"><p>When rename/copy is involved, <tt>file1</tt> and <tt>file2</tt> show the
Junio C Hamano1a4e8412005-12-27 08:17:232360name of the source file of the rename/copy and the name of
Junio C Hamanoba4b9282008-07-06 05:20:312361the file that rename/copy produces, respectively.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232362</li>
2363<li>
2364<p>
2365It is followed by one or more extended header lines:
2366</p>
2367<div class="literalblock">
2368<div class="content">
2369<pre><tt>old mode &lt;mode&gt;
2370new mode &lt;mode&gt;
2371deleted file mode &lt;mode&gt;
2372new file mode &lt;mode&gt;
2373copy from &lt;path&gt;
2374copy to &lt;path&gt;
2375rename from &lt;path&gt;
2376rename to &lt;path&gt;
2377similarity index &lt;number&gt;
2378dissimilarity index &lt;number&gt;
2379index &lt;hash&gt;..&lt;hash&gt; &lt;mode&gt;</tt></pre>
2380</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592381<div class="paragraph"><p>File modes are printed as 6-digit octal numbers including the file type
Junio C Hamano7f9fa862010-10-19 23:51:142382and file permission bits.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592383<div class="paragraph"><p>Path names in extended headers do not include the <tt>a/</tt> and <tt>b/</tt> prefixes.</p></div>
2384<div class="paragraph"><p>The similarity index is the percentage of unchanged lines, and
Junio C Hamano7f9fa862010-10-19 23:51:142385the dissimilarity index is the percentage of changed lines. It
2386is a rounded down integer, followed by a percent sign. The
2387similarity index value of 100% is thus reserved for two equal
2388files, while 100% dissimilarity means that no line from the old
2389file made it into the new one.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592390<div class="paragraph"><p>The index line includes the SHA-1 checksum before and after the change.
Junio C Hamano7f9fa862010-10-19 23:51:142391The &lt;mode&gt; is included if the file mode does not change; otherwise,
2392separate lines indicate the old and the new mode.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232393</li>
2394<li>
2395<p>
Junio C Hamanoa053d542006-10-27 09:29:132396TAB, LF, double quote and backslash characters in pathnames
2397 are represented as <tt>\t</tt>, <tt>\n</tt>, <tt>\"</tt> and <tt>\\</tt>, respectively.
2398 If there is need for such substitution then the whole
2399 pathname is put in double quotes.
Junio C Hamano1a4e8412005-12-27 08:17:232400</p>
2401</li>
Junio C Hamano7f9fa862010-10-19 23:51:142402<li>
2403<p>
2404All the <tt>file1</tt> files in the output refer to files before the
2405 commit, and all the <tt>file2</tt> files refer to files after the commit.
2406 It is incorrect to apply each change to each file sequentially. For
2407 example, this patch will swap a and b:
2408</p>
2409<div class="literalblock">
2410<div class="content">
2411<pre><tt>diff --git a/a b/b
2412rename from a
2413rename to b
2414diff --git a/b b/a
2415rename from b
2416rename to a</tt></pre>
2417</div></div>
2418</li>
Junio C Hamanoba4b9282008-07-06 05:20:312419</ol></div>
Junio C Hamano1a4e8412005-12-27 08:17:232420</div>
Junio C Hamanoba4b9282008-07-06 05:20:312421<h2 id="_combined_diff_format">combined diff format</h2>
Junio C Hamanofb56a962006-01-28 10:38:192422<div class="sectionbody">
Junio C Hamanoc5be4cc2011-03-09 07:20:432423<div class="paragraph"><p>Any diff-generating command can take the &#8216;-c` or <tt>--cc</tt> option to
2424produce a <em>combined diff</em> when showing a merge. This is the default
2425format when showing merges with <a href="git-diff.html">git-diff(1)</a> or
2426<a href="git-show.html">git-show(1)</a>. Note also that you can give the `-m&#8217; option to any
2427of these commands to force generation of diffs with individual parents
2428of a merge.</p></div>
2429<div class="paragraph"><p>A <em>combined diff</em> format looks like this:</p></div>
Junio C Hamanofb56a962006-01-28 10:38:192430<div class="listingblock">
2431<div class="content">
2432<pre><tt>diff --combined describe.c
Junio C Hamano29f14312006-10-26 08:47:292433index fabadb8,cc95eb0..4866510
2434--- a/describe.c
2435+++ b/describe.c
2436@@@ -98,20 -98,12 +98,20 @@@
2437 return (a_date &gt; b_date) ? -1 : (a_date == b_date) ? 0 : 1;
Junio C Hamanofb56a962006-01-28 10:38:192438 }
2439
2440- static void describe(char *arg)
2441 -static void describe(struct commit *cmit, int last_one)
2442++static void describe(char *arg, int last_one)
2443 {
Junio C Hamano29f14312006-10-26 08:47:292444 + unsigned char sha1[20];
2445 + struct commit *cmit;
2446 struct commit_list *list;
2447 static int initialized = 0;
2448 struct commit_name *n;
2449
2450 + if (get_sha1(arg, sha1) &lt; 0)
2451 + usage(describe_usage);
2452 + cmit = lookup_commit_reference(sha1);
2453 + if (!cmit)
2454 + usage(describe_usage);
2455 +
2456 if (!initialized) {
2457 initialized = 1;
2458 for_each_ref(get_name);</tt></pre>
Junio C Hamanofb56a962006-01-28 10:38:192459</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592460<div class="olist arabic"><ol class="arabic">
Junio C Hamano29f14312006-10-26 08:47:292461<li>
2462<p>
2463It is preceded with a "git diff" header, that looks like
2464 this (when <em>-c</em> option is used):
2465</p>
2466<div class="literalblock">
2467<div class="content">
2468<pre><tt>diff --combined file</tt></pre>
2469</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592470<div class="paragraph"><p>or like this (when <em>--cc</em> option is used):</p></div>
Junio C Hamano29f14312006-10-26 08:47:292471<div class="literalblock">
2472<div class="content">
Junio C Hamano0868a302008-07-22 09:20:442473<pre><tt>diff --cc file</tt></pre>
Junio C Hamano29f14312006-10-26 08:47:292474</div></div>
2475</li>
2476<li>
2477<p>
2478It is followed by one or more extended header lines
2479 (this example shows a merge with two parents):
2480</p>
2481<div class="literalblock">
2482<div class="content">
2483<pre><tt>index &lt;hash&gt;,&lt;hash&gt;..&lt;hash&gt;
2484mode &lt;mode&gt;,&lt;mode&gt;..&lt;mode&gt;
2485new file mode &lt;mode&gt;
2486deleted file mode &lt;mode&gt;,&lt;mode&gt;</tt></pre>
2487</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592488<div class="paragraph"><p>The <tt>mode &lt;mode&gt;,&lt;mode&gt;..&lt;mode&gt;</tt> line appears only if at least one of
Junio C Hamanoee1e4282007-02-04 08:32:042489the &lt;mode&gt; is different from the rest. Extended headers with
Junio C Hamano29f14312006-10-26 08:47:292490information about detected contents movement (renames and
2491copying detection) are designed to work with diff of two
Junio C Hamanoba4b9282008-07-06 05:20:312492&lt;tree-ish&gt; and are not used by combined diff format.</p></div>
Junio C Hamano29f14312006-10-26 08:47:292493</li>
2494<li>
2495<p>
2496It is followed by two-line from-file/to-file header
2497</p>
2498<div class="literalblock">
2499<div class="content">
2500<pre><tt>--- a/file
2501+++ b/file</tt></pre>
2502</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592503<div class="paragraph"><p>Similar to two-line header for traditional <em>unified</em> diff
Junio C Hamano29f14312006-10-26 08:47:292504format, <tt>/dev/null</tt> is used to signal created or deleted
Junio C Hamanoba4b9282008-07-06 05:20:312505files.</p></div>
Junio C Hamano29f14312006-10-26 08:47:292506</li>
2507<li>
2508<p>
2509Chunk header format is modified to prevent people from
2510 accidentally feeding it to <tt>patch -p1</tt>. Combined diff format
2511 was created for review of merge commit changes, and was not
2512 meant for apply. The change is similar to the change in the
2513 extended <em>index</em> header:
2514</p>
2515<div class="literalblock">
2516<div class="content">
2517<pre><tt>@@@ &lt;from-file-range&gt; &lt;from-file-range&gt; &lt;to-file-range&gt; @@@</tt></pre>
2518</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592519<div class="paragraph"><p>There are (number of parents + 1) <tt>@</tt> characters in the chunk
Junio C Hamanoba4b9282008-07-06 05:20:312520header for combined diff format.</p></div>
Junio C Hamano29f14312006-10-26 08:47:292521</li>
Junio C Hamanoba4b9282008-07-06 05:20:312522</ol></div>
Junio C Hamano68cf15a2010-11-06 01:01:592523<div class="paragraph"><p>Unlike the traditional <em>unified</em> diff format, which shows two
2524files A and B with a single column that has <tt>-</tt> (minus&#8201;&#8212;&#8201;appears in A but removed in B), <tt>+</tt> (plus&#8201;&#8212;&#8201;missing in A but
2525added to B), or <tt>" "</tt> (space&#8201;&#8212;&#8201;unchanged) prefix, this format
Junio C Hamanofb56a962006-01-28 10:38:192526compares two or more files file1, file2,&#8230; with one file X, and
2527shows how X differs from each of fileN. One column for each of
Junio C Hamano68cf15a2010-11-06 01:01:592528fileN is prepended to the output line to note how X&#8217;s line is
Junio C Hamanoba4b9282008-07-06 05:20:312529different from it.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592530<div class="paragraph"><p>A <tt>-</tt> character in the column N means that the line appears in
Junio C Hamano29f14312006-10-26 08:47:292531fileN but it does not appear in the result. A <tt>+</tt> character
Junio C Hamano54bf1e22008-12-20 06:30:112532in the column N means that the line appears in the result,
Junio C Hamano29f14312006-10-26 08:47:292533and fileN does not have that line (in other words, the line was
Junio C Hamanoba4b9282008-07-06 05:20:312534added, from the point of view of that parent).</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592535<div class="paragraph"><p>In the above example output, the function signature was changed
Junio C Hamanofb56a962006-01-28 10:38:192536from both files (hence two <tt>-</tt> removals from both file1 and
Junio C Hamano5e4d8de2008-09-19 06:27:022537file2, plus <tt>++</tt> to mean one line that was added does not appear
Junio C Hamano54bf1e22008-12-20 06:30:112538in either file1 nor file2). Also eight other lines are the same
2539from file1 but do not appear in file2 (hence prefixed with <tt>&#43;</tt>).</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592540<div class="paragraph"><p>When shown by <tt>git diff-tree -c</tt>, it compares the parents of a
Junio C Hamanofb56a962006-01-28 10:38:192541merge commit with the merge result (i.e. file1..fileN are the
2542parents). When shown by <tt>git diff-files -c</tt>, it compares the
2543two unresolved merge parents with the working tree file
2544(i.e. file1 is stage 2 aka "our version", file2 is stage 3 aka
Junio C Hamanoba4b9282008-07-06 05:20:312545"their version").</p></div>
Junio C Hamanofb56a962006-01-28 10:38:192546</div>
Junio C Hamanoba4b9282008-07-06 05:20:312547<h2 id="_other_diff_formats">other diff formats</h2>
Junio C Hamano3a702342007-12-12 21:34:022548<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:592549<div class="paragraph"><p>The <tt>--summary</tt> option describes newly added, deleted, renamed and
Junio C Hamano3a702342007-12-12 21:34:022550copied files. The <tt>--stat</tt> option adds diffstat(1) graph to the
2551output. These options can be combined with other options, such as
Junio C Hamanoba4b9282008-07-06 05:20:312552<tt>-p</tt>, and are meant for human consumption.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592553<div class="paragraph"><p>When showing a change that involves a rename or a copy, <tt>--stat</tt> output
Junio C Hamano3a702342007-12-12 21:34:022554formats the pathnames compactly by combining common prefix and suffix of
2555the pathnames. For example, a change that moves <tt>arch/i386/Makefile</tt> to
Junio C Hamanoba4b9282008-07-06 05:20:312556<tt>arch/x86/Makefile</tt> while modifying 4 lines will be shown like this:</p></div>
Junio C Hamano3a702342007-12-12 21:34:022557<div class="listingblock">
2558<div class="content">
2559<pre><tt>arch/{i386 =&gt; x86}/Makefile | 4 +--</tt></pre>
2560</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592561<div class="paragraph"><p>The <tt>--numstat</tt> option gives the diffstat(1) information but is designed
Junio C Hamano3a702342007-12-12 21:34:022562for easier machine consumption. An entry in <tt>--numstat</tt> output looks
Junio C Hamanoba4b9282008-07-06 05:20:312563like this:</p></div>
Junio C Hamano3a702342007-12-12 21:34:022564<div class="listingblock">
2565<div class="content">
2566<pre><tt>1 2 README
25673 1 arch/{i386 =&gt; x86}/Makefile</tt></pre>
2568</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592569<div class="paragraph"><p>That is, from left to right:</p></div>
2570<div class="olist arabic"><ol class="arabic">
Junio C Hamano3a702342007-12-12 21:34:022571<li>
2572<p>
2573the number of added lines;
2574</p>
2575</li>
2576<li>
2577<p>
2578a tab;
2579</p>
2580</li>
2581<li>
2582<p>
2583the number of deleted lines;
2584</p>
2585</li>
2586<li>
2587<p>
2588a tab;
2589</p>
2590</li>
2591<li>
2592<p>
2593pathname (possibly with rename/copy information);
2594</p>
2595</li>
2596<li>
2597<p>
2598a newline.
2599</p>
2600</li>
Junio C Hamanoba4b9282008-07-06 05:20:312601</ol></div>
Junio C Hamano68cf15a2010-11-06 01:01:592602<div class="paragraph"><p>When <tt>-z</tt> output option is in effect, the output is formatted this way:</p></div>
Junio C Hamano3a702342007-12-12 21:34:022603<div class="listingblock">
2604<div class="content">
2605<pre><tt>1 2 README NUL
26063 1 NUL arch/i386/Makefile NUL arch/x86/Makefile NUL</tt></pre>
2607</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592608<div class="paragraph"><p>That is:</p></div>
2609<div class="olist arabic"><ol class="arabic">
Junio C Hamano3a702342007-12-12 21:34:022610<li>
2611<p>
2612the number of added lines;
2613</p>
2614</li>
2615<li>
2616<p>
2617a tab;
2618</p>
2619</li>
2620<li>
2621<p>
2622the number of deleted lines;
2623</p>
2624</li>
2625<li>
2626<p>
2627a tab;
2628</p>
2629</li>
2630<li>
2631<p>
2632a NUL (only exists if renamed/copied);
2633</p>
2634</li>
2635<li>
2636<p>
2637pathname in preimage;
2638</p>
2639</li>
2640<li>
2641<p>
2642a NUL (only exists if renamed/copied);
2643</p>
2644</li>
2645<li>
2646<p>
2647pathname in postimage (only exists if renamed/copied);
2648</p>
2649</li>
2650<li>
2651<p>
2652a NUL.
2653</p>
2654</li>
Junio C Hamanoba4b9282008-07-06 05:20:312655</ol></div>
Junio C Hamano68cf15a2010-11-06 01:01:592656<div class="paragraph"><p>The extra <tt>NUL</tt> before the preimage path in renamed case is to allow
Junio C Hamano3a702342007-12-12 21:34:022657scripts that read the output to tell if the current record being read is
2658a single-path record or a rename/copy record without reading ahead.
2659After reading added and deleted lines, reading up to <tt>NUL</tt> would yield
Junio C Hamanoba4b9282008-07-06 05:20:312660the pathname, but if that is <tt>NUL</tt>, the record will show two paths.</p></div>
Junio C Hamano3a702342007-12-12 21:34:022661</div>
Junio C Hamanoba4b9282008-07-06 05:20:312662<h2 id="_git">GIT</h2>
Junio C Hamano1a4e8412005-12-27 08:17:232663<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:592664<div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232665</div>
Junio C Hamano7bd050f2011-09-22 06:32:222666</div>
2667<div id="footnotes"><hr /></div>
Junio C Hamano1a4e8412005-12-27 08:17:232668<div id="footer">
2669<div id="footer-text">
Junio C Hamano02194af2011-11-17 20:33:592670Last updated 2011-11-15 13:45:02 PDT
Junio C Hamano1a4e8412005-12-27 08:17:232671</div>
2672</div>
2673</body>
2674</html>