blob: bea02b4f7279b38573daa86d7abd0c8b78b654c1 [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 Hamano4c4b0122011-06-30 01:19:32665--stat[=&lt;width&gt;[,&lt;name-width&gt;[,&lt;count&gt;]]]
Junio C Hamanoba7c8d82006-04-15 06:17:42666</dt>
667<dd>
668<p>
Junio C Hamano4a9a76a2006-10-01 05:40:29669 Generate a diffstat. You can override the default
Junio C Hamanod2179ef2010-10-22 04:12:17670 output width for 80-column terminal by <tt>--stat=&lt;width&gt;</tt>.
Junio C Hamano4a9a76a2006-10-01 05:40:29671 The width of the filename part can be controlled by
672 giving another width to it separated by a comma.
Junio C Hamano4c4b0122011-06-30 01:19:32673 By giving a third parameter <tt>&lt;count&gt;</tt>, you can limit the
674 output to the first <tt>&lt;count&gt;</tt> lines, followed by
675 <tt>&#8230;</tt> if there are more.
Junio C Hamanoba7c8d82006-04-15 06:17:42676</p>
Junio C Hamano4c4b0122011-06-30 01:19:32677<div class="paragraph"><p>These parameters can also be set individually with <tt>--stat-width=&lt;width&gt;</tt>,
678<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:42679</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59680<dt class="hdlist1">
Junio C Hamanofbe00522006-10-19 05:58:48681--numstat
682</dt>
683<dd>
684<p>
Junio C Hamano3b70d3c2009-11-21 17:37:37685 Similar to <tt>--stat</tt>, but shows number of added and
Junio C Hamanofbe00522006-10-19 05:58:48686 deleted lines in decimal notation and pathname without
Junio C Hamanod793de52006-12-26 09:11:43687 abbreviation, to make it more machine friendly. For
688 binary files, outputs two <tt>-</tt> instead of saying
689 <tt>0 0</tt>.
Junio C Hamanofbe00522006-10-19 05:58:48690</p>
691</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59692<dt class="hdlist1">
Junio C Hamano7d23f5e2006-12-16 07:44:04693--shortstat
694</dt>
695<dd>
696<p>
Junio C Hamano3b70d3c2009-11-21 17:37:37697 Output only the last line of the <tt>--stat</tt> format containing total
Junio C Hamano7d23f5e2006-12-16 07:44:04698 number of modified files, as well as number of added and deleted
699 lines.
700</p>
701</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59702<dt class="hdlist1">
Junio C Hamano1c222c52011-05-13 19:55:32703--dirstat[=&lt;param1,param2,&#8230;&gt;]
Junio C Hamano6a45be92008-04-22 08:19:03704</dt>
705<dd>
706<p>
Junio C Hamano1c222c52011-05-13 19:55:32707 Output the distribution of relative amount of changes for each
708 sub-directory. The behavior of <tt>--dirstat</tt> can be customized by
709 passing it a comma separated list of parameters.
710 The defaults are controlled by the <tt>diff.dirstat</tt> configuration
711 variable (see <a href="git-config.html">git-config(1)</a>).
712 The following parameters are available:
Junio C Hamano6a45be92008-04-22 08:19:03713</p>
Junio C Hamano1c222c52011-05-13 19:55:32714<div class="dlist"><dl>
715<dt class="hdlist1">
716<tt>changes</tt>
717</dt>
718<dd>
719<p>
720 Compute the dirstat numbers by counting the lines that have been
721 removed from the source, or added to the destination. This ignores
722 the amount of pure code movements within a file. In other words,
723 rearranging lines in a file is not counted as much as other changes.
724 This is the default behavior when no parameter is given.
725</p>
Junio C Hamano6a45be92008-04-22 08:19:03726</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59727<dt class="hdlist1">
Junio C Hamano1c222c52011-05-13 19:55:32728<tt>lines</tt>
Junio C Hamanoa476efa2008-10-10 15:31:42729</dt>
730<dd>
731<p>
Junio C Hamano1c222c52011-05-13 19:55:32732 Compute the dirstat numbers by doing the regular line-based diff
733 analysis, and summing the removed/added line counts. (For binary
734 files, count 64-byte chunks instead, since binary files have no
735 natural concept of lines). This is a more expensive <tt>--dirstat</tt>
736 behavior than the <tt>changes</tt> behavior, but it does count rearranged
737 lines within a file as much as other changes. The resulting output
738 is consistent with what you get from the other <tt>--*stat</tt> options.
Junio C Hamanoa476efa2008-10-10 15:31:42739</p>
740</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59741<dt class="hdlist1">
Junio C Hamano1c222c52011-05-13 19:55:32742<tt>files</tt>
743</dt>
744<dd>
745<p>
746 Compute the dirstat numbers by counting the number of files changed.
747 Each changed file counts equally in the dirstat analysis. This is
748 the computationally cheapest <tt>--dirstat</tt> behavior, since it does
749 not have to look at the file contents at all.
750</p>
751</dd>
752<dt class="hdlist1">
753<tt>cumulative</tt>
754</dt>
755<dd>
756<p>
757 Count changes in a child directory for the parent directory as well.
758 Note that when using <tt>cumulative</tt>, the sum of the percentages
759 reported may exceed 100%. The default (non-cumulative) behavior can
760 be specified with the <tt>noncumulative</tt> parameter.
761</p>
762</dd>
763<dt class="hdlist1">
764&lt;limit&gt;
765</dt>
766<dd>
767<p>
768 An integer parameter specifies a cut-off percent (3% by default).
769 Directories contributing less than this percentage of the changes
770 are not shown in the output.
771</p>
772</dd>
773</dl></div>
774<div class="paragraph"><p>Example: The following will count changed files, while ignoring
775directories with less than 10% of the total amount of changed files,
776and accumulating child directory counts in the parent directories:
777<tt>--dirstat=files,10,cumulative</tt>.</p></div>
778</dd>
779<dt class="hdlist1">
Junio C Hamano6959c6c2006-05-17 10:34:11780--summary
781</dt>
782<dd>
783<p>
784 Output a condensed summary of extended header information
785 such as creations, renames and mode changes.
786</p>
787</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59788<dt class="hdlist1">
Junio C Hamanod1308c92006-04-16 11:01:09789--patch-with-stat
790</dt>
791<dd>
792<p>
Junio C Hamano3b70d3c2009-11-21 17:37:37793 Synonym for <tt>-p --stat</tt>.
Junio C Hamanod1308c92006-04-16 11:01:09794</p>
795</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59796<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:23797-z
798</dt>
799<dd>
800<p>
Junio C Hamano0c053e82010-04-19 06:46:34801 When <tt>--raw</tt>, <tt>--numstat</tt>, <tt>--name-only</tt> or <tt>--name-status</tt> has been
802 given, do not munge pathnames and use NULs as output field terminators.
Junio C Hamano1a4e8412005-12-27 08:17:23803</p>
Junio C Hamano68cf15a2010-11-06 01:01:59804<div class="paragraph"><p>Without this option, each pathname output will have TAB, LF, double quotes,
Junio C Hamano5706e0b2009-11-24 10:54:16805and backslash characters replaced with <tt>\t</tt>, <tt>\n</tt>, <tt>\"</tt>, and <tt>\\</tt>,
806respectively, and the pathname will be enclosed in double quotes if
807any of those replacements occurred.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:23808</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59809<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:23810--name-only
811</dt>
812<dd>
813<p>
814 Show only names of changed files.
815</p>
816</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59817<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:23818--name-status
819</dt>
820<dd>
821<p>
Junio C Hamanoa9aee782008-04-23 16:09:20822 Show only names and status of changed files. See the description
823 of the <tt>--diff-filter</tt> option on what the status letters mean.
Junio C Hamano1a4e8412005-12-27 08:17:23824</p>
825</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59826<dt class="hdlist1">
Junio C Hamanoc21ab052009-10-31 04:03:55827--submodule[=&lt;format&gt;]
828</dt>
829<dd>
830<p>
831 Chose the output format for submodule differences. &lt;format&gt; can be one of
832 <em>short</em> and <em>log</em>. <em>short</em> just shows pairs of commit names, this format
833 is used when this option is not given. <em>log</em> is the default value for this
834 option and lists the commits in that commit range like the <em>summary</em>
835 option of <a href="git-submodule.html">git-submodule(1)</a> does.
836</p>
837</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59838<dt class="hdlist1">
Junio C Hamano4aa0bcc2010-03-03 05:13:12839--color[=&lt;when&gt;]
Junio C Hamano9ae1a062006-07-10 08:12:34840</dt>
841<dd>
842<p>
843 Show colored diff.
Junio C Hamano5f2627d2011-05-06 20:23:48844 The value must be <tt>always</tt> (the default for <tt>&lt;when&gt;</tt>), <tt>never</tt>, or <tt>auto</tt>.
845 The default value is <tt>never</tt>.
Junio C Hamano9ae1a062006-07-10 08:12:34846</p>
847</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59848<dt class="hdlist1">
Junio C Hamano9ae1a062006-07-10 08:12:34849--no-color
850</dt>
851<dd>
852<p>
Junio C Hamano5f2627d2011-05-06 20:23:48853 Turn off colored diff.
854 It is the same as <tt>--color=never</tt>.
Junio C Hamano9ae1a062006-07-10 08:12:34855</p>
856</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59857<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:53858--word-diff[=&lt;mode&gt;]
Junio C Hamano85e45fa2006-08-13 07:47:41859</dt>
860<dd>
861<p>
Junio C Hamanocc7636a2010-05-21 14:57:53862 Show a word diff, using the &lt;mode&gt; to delimit changed words.
863 By default, words are delimited by whitespace; see
864 <tt>--word-diff-regex</tt> below. The &lt;mode&gt; defaults to <em>plain</em>, and
865 must be one of:
Junio C Hamano85e45fa2006-08-13 07:47:41866</p>
Junio C Hamano68cf15a2010-11-06 01:01:59867<div class="dlist"><dl>
868<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:53869color
870</dt>
871<dd>
872<p>
873 Highlight changed words using only colors. Implies <tt>--color</tt>.
874</p>
875</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59876<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:53877plain
878</dt>
879<dd>
880<p>
Junio C Hamano68cf15a2010-11-06 01:01:59881 Show words as <tt>[-removed-]</tt> and <tt>{<tt>added</tt>}</tt>. Makes no
Junio C Hamanocc7636a2010-05-21 14:57:53882 attempts to escape the delimiters if they appear in the input,
883 so the output may be ambiguous.
884</p>
885</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59886<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:53887porcelain
888</dt>
889<dd>
890<p>
891 Use a special line-based format intended for script
892 consumption. Added/removed/unchanged runs are printed in the
Junio C Hamano68cf15a2010-11-06 01:01:59893 usual unified diff format, starting with a <tt>+</tt>/<tt>-</tt>/` `
Junio C Hamanocc7636a2010-05-21 14:57:53894 character at the beginning of the line and extending to the
895 end of the line. Newlines in the input are represented by a
896 tilde <tt>~</tt> on a line of its own.
897</p>
898</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59899<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:53900none
901</dt>
902<dd>
903<p>
904 Disable word diff again.
905</p>
906</dd>
907</dl></div>
Junio C Hamano68cf15a2010-11-06 01:01:59908<div class="paragraph"><p>Note that despite the name of the first mode, color is used to
Junio C Hamanocc7636a2010-05-21 14:57:53909highlight the changed parts in all modes if enabled.</p></div>
910</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59911<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:53912--word-diff-regex=&lt;regex&gt;
913</dt>
914<dd>
915<p>
916 Use &lt;regex&gt; to decide what a word is, instead of considering
917 runs of non-whitespace to be a word. Also implies
918 <tt>--word-diff</tt> unless it was already enabled.
919</p>
Junio C Hamano68cf15a2010-11-06 01:01:59920<div class="paragraph"><p>Every non-overlapping match of the
Junio C Hamano20d47e32009-01-26 06:36:02921&lt;regex&gt; is considered a word. Anything between these matches is
922considered whitespace and ignored(!) for the purposes of finding
923differences. You may want to append <tt>|[^[:space:]]</tt> to your regular
924expression to make sure that it matches all non-whitespace characters.
925A match that contains a newline is silently truncated(!) at the
926newline.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:59927<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:02928<a href="gitattributes.html">gitattributes(1)</a> or <a href="git-config.html">git-config(1)</a>. Giving it explicitly
929overrides any diff driver or configuration setting. Diff drivers
930override configuration settings.</p></div>
Junio C Hamano85e45fa2006-08-13 07:47:41931</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59932<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:53933--color-words[=&lt;regex&gt;]
934</dt>
935<dd>
936<p>
937 Equivalent to <tt>--word-diff=color</tt> plus (if a regex was
938 specified) <tt>--word-diff-regex=&lt;regex&gt;</tt>.
939</p>
940</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59941<dt class="hdlist1">
Junio C Hamano9ae1a062006-07-10 08:12:34942--no-renames
943</dt>
944<dd>
945<p>
946 Turn off rename detection, even when the configuration
947 file gives the default to do so.
948</p>
949</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59950<dt class="hdlist1">
Junio C Hamanoa890c4f2007-01-28 10:29:21951--check
952</dt>
953<dd>
954<p>
Junio C Hamano6005bfa2011-06-23 00:51:22955 Warn if changes introduce whitespace errors. What are
956 considered whitespace errors is controlled by <tt>core.whitespace</tt>
957 configuration. By default, trailing whitespaces (including
958 lines that solely consist of whitespaces) and a space character
959 that is immediately followed by a tab character inside the
960 initial indent of the line are considered whitespace errors.
961 Exits with non-zero status if problems are found. Not compatible
962 with --exit-code.
Junio C Hamanoa890c4f2007-01-28 10:29:21963</p>
964</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59965<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:23966--full-index
967</dt>
968<dd>
969<p>
Junio C Hamano5cf43ca2008-08-20 09:14:14970 Instead of the first handful of characters, show the full
971 pre- and post-image blob object names on the "index"
972 line when generating patch format output.
Junio C Hamano1a4e8412005-12-27 08:17:23973</p>
974</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59975<dt class="hdlist1">
Junio C Hamano9ae1a062006-07-10 08:12:34976--binary
977</dt>
978<dd>
979<p>
Junio C Hamano3b70d3c2009-11-21 17:37:37980 In addition to <tt>--full-index</tt>, output a binary diff that
981 can be applied with <tt>git-apply</tt>.
Junio C Hamano9ae1a062006-07-10 08:12:34982</p>
983</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59984<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:23985--abbrev[=&lt;n&gt;]
986</dt>
987<dd>
988<p>
989 Instead of showing the full 40-byte hexadecimal object
990 name in diff-raw format output and diff-tree header
Junio C Hamano6efe3022009-01-13 16:47:56991 lines, show only a partial prefix. This is
Junio C Hamano3b70d3c2009-11-21 17:37:37992 independent of the <tt>--full-index</tt> option above, which controls
Junio C Hamano1a4e8412005-12-27 08:17:23993 the diff-patch output format. Non default number of
Junio C Hamano3b70d3c2009-11-21 17:37:37994 digits can be specified with <tt>--abbrev=&lt;n&gt;</tt>.
Junio C Hamano1a4e8412005-12-27 08:17:23995</p>
996</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59997<dt class="hdlist1">
Junio C Hamanoe85e36f2010-08-10 05:30:14998-B[&lt;n&gt;][/&lt;m&gt;]
Junio C Hamano1a4e8412005-12-27 08:17:23999</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591000<dt class="hdlist1">
Junio C Hamano39c7a692010-10-27 06:08:541001--break-rewrites[=[&lt;n&gt;][/&lt;m&gt;]]
1002</dt>
Junio C Hamano1a4e8412005-12-27 08:17:231003<dd>
1004<p>
Junio C Hamanoe85e36f2010-08-10 05:30:141005 Break complete rewrite changes into pairs of delete and
1006 create. This serves two purposes:
Junio C Hamano1a4e8412005-12-27 08:17:231007</p>
Junio C Hamano68cf15a2010-11-06 01:01:591008<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:141009not as a series of deletion and insertion mixed together with a very
1010few lines that happen to match textually as the context, but as a
1011single deletion of everything old followed by a single insertion of
1012everything new, and the number <tt>m</tt> controls this aspect of the -B
1013option (defaults to 60%). <tt>-B/70%</tt> specifies that less than 30% of the
1014original should remain in the result for git to consider it a total
1015rewrite (i.e. otherwise the resulting patch will be a series of
1016deletion and insertion mixed together with context lines).</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591017<div class="paragraph"><p>When used with -M, a totally-rewritten file is also considered as the
Junio C Hamanoe85e36f2010-08-10 05:30:141018source of a rename (usually -M only considers a file that disappeared
1019as the source of a rename), and the number <tt>n</tt> controls this aspect of
1020the -B option (defaults to 50%). <tt>-B20%</tt> specifies that a change with
Junio C Hamano68cf15a2010-11-06 01:01:591021addition and deletion compared to 20% or more of the file&#8217;s size are
Junio C Hamanoe85e36f2010-08-10 05:30:141022eligible for being picked up as a possible source of a rename to
1023another file.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231024</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591025<dt class="hdlist1">
Junio C Hamanoe85e36f2010-08-10 05:30:141026-M[&lt;n&gt;]
Junio C Hamano1a4e8412005-12-27 08:17:231027</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591028<dt class="hdlist1">
Junio C Hamano0d75e872010-12-17 06:57:261029--find-renames[=&lt;n&gt;]
Junio C Hamano39c7a692010-10-27 06:08:541030</dt>
Junio C Hamano1a4e8412005-12-27 08:17:231031<dd>
1032<p>
1033 Detect renames.
Junio C Hamano5f2627d2011-05-06 20:23:481034 If <tt>n</tt> is specified, it is a threshold on the similarity
Junio C Hamanoe85e36f2010-08-10 05:30:141035 index (i.e. amount of addition/deletions compared to the
Junio C Hamano68cf15a2010-11-06 01:01:591036 file&#8217;s size). For example, <tt>-M90%</tt> means git should consider a
Junio C Hamanoe85e36f2010-08-10 05:30:141037 delete/add pair to be a rename if more than 90% of the file
Junio C Hamano68cf15a2010-11-06 01:01:591038 hasn&#8217;t changed.
Junio C Hamano1a4e8412005-12-27 08:17:231039</p>
1040</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591041<dt class="hdlist1">
Junio C Hamanoe85e36f2010-08-10 05:30:141042-C[&lt;n&gt;]
Junio C Hamano1a4e8412005-12-27 08:17:231043</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591044<dt class="hdlist1">
Junio C Hamano0d75e872010-12-17 06:57:261045--find-copies[=&lt;n&gt;]
Junio C Hamano39c7a692010-10-27 06:08:541046</dt>
Junio C Hamano1a4e8412005-12-27 08:17:231047<dd>
1048<p>
Junio C Hamano16f98872007-06-12 16:09:141049 Detect copies as well as renames. See also <tt>--find-copies-harder</tt>.
Junio C Hamanoe85e36f2010-08-10 05:30:141050 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:231051</p>
1052</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591053<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231054--find-copies-harder
1055</dt>
1056<dd>
1057<p>
Junio C Hamano16f98872007-06-12 16:09:141058 For performance reasons, by default, <tt>-C</tt> option finds copies only
Junio C Hamano1a4e8412005-12-27 08:17:231059 if the original file of the copy was modified in the same
1060 changeset. This flag makes the command
1061 inspect unmodified files as candidates for the source of
1062 copy. This is a very expensive operation for large
Junio C Hamano16f98872007-06-12 16:09:141063 projects, so use it with caution. Giving more than one
1064 <tt>-C</tt> option has the same effect.
Junio C Hamano1a4e8412005-12-27 08:17:231065</p>
1066</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591067<dt class="hdlist1">
Junio C Hamanob02377c2011-04-28 22:26:021068-D
1069</dt>
1070<dt class="hdlist1">
1071--irreversible-delete
1072</dt>
1073<dd>
1074<p>
1075 Omit the preimage for deletes, i.e. print only the header but not
1076 the diff between the preimage and <tt>/dev/null</tt>. The resulting patch
1077 is not meant to be applied with <tt>patch</tt> nor <tt>git apply</tt>; this is
1078 solely for people who want to just concentrate on reviewing the
1079 text after the change. In addition, the output obviously lack
1080 enough information to apply such a patch in reverse, even manually,
1081 hence the name of the option.
1082</p>
1083<div class="paragraph"><p>When used together with <tt>-B</tt>, omit also the preimage in the deletion part
1084of a delete/create pair.</p></div>
1085</dd>
1086<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231087-l&lt;num&gt;
1088</dt>
1089<dd>
1090<p>
Junio C Hamano3b70d3c2009-11-21 17:37:371091 The <tt>-M</tt> and <tt>-C</tt> options require O(n^2) processing time where n
Junio C Hamano1a4e8412005-12-27 08:17:231092 is the number of potential rename/copy targets. This
1093 option prevents rename/copy detection from running if
1094 the number of rename/copy targets exceeds the specified
1095 number.
1096</p>
1097</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591098<dt class="hdlist1">
Junio C Hamano982eb112010-11-18 00:53:091099--diff-filter=[(A|C|D|M|R|T|U|X|B)&#8230;[*]]
1100</dt>
1101<dd>
1102<p>
1103 Select only files that are Added (<tt>A</tt>), Copied (<tt>C</tt>),
1104 Deleted (<tt>D</tt>), Modified (<tt>M</tt>), Renamed (<tt>R</tt>), have their
1105 type (i.e. regular file, symlink, submodule, &#8230;) changed (<tt>T</tt>),
1106 are Unmerged (<tt>U</tt>), are
1107 Unknown (<tt>X</tt>), or have had their pairing Broken (<tt>B</tt>).
1108 Any combination of the filter characters (including none) can be used.
1109 When <tt>*</tt> (All-or-none) is added to the combination, all
1110 paths are selected if there is any file that matches
1111 other criteria in the comparison; if there is no file
1112 that matches other criteria, nothing is selected.
1113</p>
1114</dd>
1115<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231116-S&lt;string&gt;
1117</dt>
1118<dd>
1119<p>
Junio C Hamano5217a272009-03-21 00:39:331120 Look for differences that introduce or remove an instance of
1121 &lt;string&gt;. Note that this is different than the string simply
1122 appearing in diff output; see the <em>pickaxe</em> entry in
1123 <a href="gitdiffcore.html">gitdiffcore(7)</a> for more details.
Junio C Hamano1a4e8412005-12-27 08:17:231124</p>
1125</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591126<dt class="hdlist1">
Junio C Hamano3b4609d2010-09-30 00:04:341127-G&lt;regex&gt;
1128</dt>
1129<dd>
1130<p>
1131 Look for differences whose added or removed line matches
1132 the given &lt;regex&gt;.
1133</p>
1134</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591135<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231136--pickaxe-all
1137</dt>
1138<dd>
1139<p>
Junio C Hamano3b4609d2010-09-30 00:04:341140 When <tt>-S</tt> or <tt>-G</tt> finds a change, show all the changes in that
Junio C Hamano1a4e8412005-12-27 08:17:231141 changeset, not just the files that contain the change
1142 in &lt;string&gt;.
1143</p>
1144</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591145<dt class="hdlist1">
Junio C Hamanobfe9e752006-04-05 21:43:281146--pickaxe-regex
1147</dt>
1148<dd>
1149<p>
1150 Make the &lt;string&gt; not a plain string but an extended POSIX
1151 regex to match.
1152</p>
1153</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591154<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231155-O&lt;orderfile&gt;
1156</dt>
1157<dd>
1158<p>
1159 Output the patch in the order specified in the
1160 &lt;orderfile&gt;, which has one shell glob pattern per line.
1161</p>
1162</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591163<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231164-R
1165</dt>
1166<dd>
1167<p>
1168 Swap two inputs; that is, show differences from index or
1169 on-disk file to tree contents.
1170</p>
1171</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591172<dt class="hdlist1">
Junio C Hamano24bc09a2008-02-28 00:27:441173--relative[=&lt;path&gt;]
1174</dt>
1175<dd>
1176<p>
1177 When run from a subdirectory of the project, it can be
1178 told to exclude changes outside the directory and show
1179 pathnames relative to it with this option. When you are
1180 not in a subdirectory (e.g. in a bare repository), you
1181 can name which subdirectory to make the output relative
1182 to by giving a &lt;path&gt; as an argument.
1183</p>
1184</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591185<dt class="hdlist1">
Junio C Hamanobbbb8652008-12-29 10:34:221186-a
1187</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591188<dt class="hdlist1">
Junio C Hamanoc26f5482006-07-09 09:38:141189--text
1190</dt>
1191<dd>
1192<p>
1193 Treat all files as text.
1194</p>
1195</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591196<dt class="hdlist1">
Junio C Hamanofd468962007-02-14 23:45:041197--ignore-space-at-eol
1198</dt>
1199<dd>
1200<p>
Junio C Hamano3a702342007-12-12 21:34:021201 Ignore changes in whitespace at EOL.
Junio C Hamanofd468962007-02-14 23:45:041202</p>
1203</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591204<dt class="hdlist1">
Junio C Hamanobbbb8652008-12-29 10:34:221205-b
1206</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591207<dt class="hdlist1">
Junio C Hamanod9c2d2f2006-12-06 08:59:071208--ignore-space-change
1209</dt>
1210<dd>
1211<p>
Junio C Hamano3a702342007-12-12 21:34:021212 Ignore changes in amount of whitespace. This ignores whitespace
1213 at line end, and considers all other sequences of one or
1214 more whitespace characters to be equivalent.
Junio C Hamanod9c2d2f2006-12-06 08:59:071215</p>
1216</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591217<dt class="hdlist1">
Junio C Hamanobbbb8652008-12-29 10:34:221218-w
Junio C Hamanod9c2d2f2006-12-06 08:59:071219</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591220<dt class="hdlist1">
Junio C Hamanod9c2d2f2006-12-06 08:59:071221--ignore-all-space
1222</dt>
1223<dd>
1224<p>
Junio C Hamano3a702342007-12-12 21:34:021225 Ignore whitespace when comparing lines. This ignores
1226 differences even if one line has whitespace where the other
Junio C Hamanod9c2d2f2006-12-06 08:59:071227 line has none.
1228</p>
1229</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591230<dt class="hdlist1">
Junio C Hamano1d40ee82009-01-07 10:14:161231--inter-hunk-context=&lt;lines&gt;
1232</dt>
1233<dd>
1234<p>
1235 Show the context between diff hunks, up to the specified number
1236 of lines, thereby fusing hunks that are close to each other.
1237</p>
1238</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591239<dt class="hdlist1">
Junio C Hamano11821ed2011-10-19 18:42:091240-W
1241</dt>
1242<dt class="hdlist1">
1243--function-context
1244</dt>
1245<dd>
1246<p>
1247 Show whole surrounding functions of changes.
1248</p>
1249</dd>
1250<dt class="hdlist1">
Junio C Hamano48fd2f62007-03-19 02:02:301251--exit-code
1252</dt>
1253<dd>
1254<p>
1255 Make the program exit with codes similar to diff(1).
1256 That is, it exits with 1 if there were differences and
1257 0 means no differences.
1258</p>
1259</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591260<dt class="hdlist1">
Junio C Hamano35e57552007-03-25 07:54:351261--quiet
1262</dt>
1263<dd>
1264<p>
Junio C Hamano3b70d3c2009-11-21 17:37:371265 Disable all output of the program. Implies <tt>--exit-code</tt>.
Junio C Hamano35e57552007-03-25 07:54:351266</p>
1267</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591268<dt class="hdlist1">
Junio C Hamanobb0f4042007-07-04 06:41:401269--ext-diff
1270</dt>
1271<dd>
1272<p>
1273 Allow an external diff helper to be executed. If you set an
Junio C Hamano1b50ce92007-10-03 12:05:531274 external diff driver with <a href="gitattributes.html">gitattributes(5)</a>, you need
1275 to use this option with <a href="git-log.html">git-log(1)</a> and friends.
Junio C Hamanobb0f4042007-07-04 06:41:401276</p>
1277</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591278<dt class="hdlist1">
Junio C Hamanobb0f4042007-07-04 06:41:401279--no-ext-diff
1280</dt>
1281<dd>
1282<p>
1283 Disallow external diff drivers.
1284</p>
1285</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591286<dt class="hdlist1">
Junio C Hamanoc652aed2011-07-07 01:14:311287--textconv
1288</dt>
1289<dt class="hdlist1">
1290--no-textconv
1291</dt>
1292<dd>
1293<p>
1294 Allow (or disallow) external text conversion filters to be run
1295 when comparing binary files. See <a href="gitattributes.html">gitattributes(5)</a> for
1296 details. Because textconv filters are typically a one-way
1297 conversion, the resulting diff is suitable for human
1298 consumption, but cannot be applied. For this reason, textconv
1299 filters are enabled by default only for <a href="git-diff.html">git-diff(1)</a> and
1300 <a href="git-log.html">git-log(1)</a>, but not for <a href="git-format-patch.html">git-format-patch(1)</a> or
1301 diff plumbing commands.
1302</p>
1303</dd>
1304<dt class="hdlist1">
Junio C Hamano7d449522010-07-01 00:08:511305--ignore-submodules[=&lt;when&gt;]
Junio C Hamanodfccbb02008-05-26 01:16:141306</dt>
1307<dd>
1308<p>
Junio C Hamano7d449522010-07-01 00:08:511309 Ignore changes to submodules in the diff generation. &lt;when&gt; can be
Junio C Hamano619596a2010-08-18 22:15:351310 either "none", "untracked", "dirty" or "all", which is the default
1311 Using "none" will consider the submodule modified when it either contains
1312 untracked or modified files or its HEAD differs from the commit recorded
1313 in the superproject and can be used to override any settings of the
1314 <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:511315 "untracked" is used submodules are not considered dirty when they only
1316 contain untracked content (but they are still scanned for modified
1317 content). Using "dirty" ignores all changes to the work tree of submodules,
1318 only changes to the commits stored in the superproject are shown (this was
1319 the behavior until 1.7.0). Using "all" hides all changes to submodules.
Junio C Hamanodfccbb02008-05-26 01:16:141320</p>
1321</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591322<dt class="hdlist1">
Junio C Hamanoe27cbd22007-12-21 17:57:331323--src-prefix=&lt;prefix&gt;
1324</dt>
1325<dd>
1326<p>
1327 Show the given source prefix instead of "a/".
1328</p>
1329</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591330<dt class="hdlist1">
Junio C Hamanoe27cbd22007-12-21 17:57:331331--dst-prefix=&lt;prefix&gt;
1332</dt>
1333<dd>
1334<p>
1335 Show the given destination prefix instead of "b/".
1336</p>
1337</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591338<dt class="hdlist1">
Junio C Hamanoe27cbd22007-12-21 17:57:331339--no-prefix
1340</dt>
1341<dd>
1342<p>
1343 Do not show any source or destination prefix.
1344</p>
1345</dd>
Junio C Hamanoba4b9282008-07-06 05:20:311346</dl></div>
Junio C Hamano68cf15a2010-11-06 01:01:591347<div class="paragraph"><p>For more detailed explanation on these common options, see also
Junio C Hamanoba4b9282008-07-06 05:20:311348<a href="gitdiffcore.html">gitdiffcore(7)</a>.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591349<div class="dlist"><dl>
1350<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231351&lt;tree-ish&gt;
1352</dt>
1353<dd>
1354<p>
1355 The id of a tree object.
1356</p>
1357</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591358<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231359&lt;path&gt;&#8230;
1360</dt>
1361<dd>
1362<p>
1363 If provided, the results are limited to a subset of files
1364 matching one of these prefix strings.
Junio C Hamano341071d2006-06-04 07:24:481365 i.e., file matches <tt>/^&lt;pattern1&gt;|&lt;pattern2&gt;|&#8230;/</tt>
Junio C Hamano1a4e8412005-12-27 08:17:231366 Note that this parameter does not provide any wildcard or regexp
1367 features.
1368</p>
1369</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591370<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231371-r
1372</dt>
1373<dd>
1374<p>
1375 recurse into sub-trees
1376</p>
1377</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591378<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231379-t
1380</dt>
1381<dd>
1382<p>
1383 show tree entry itself as well as subtrees. Implies -r.
1384</p>
1385</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591386<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231387--root
1388</dt>
1389<dd>
1390<p>
Junio C Hamano54bf1e22008-12-20 06:30:111391 When <em>--root</em> is specified the initial commit will be shown as a big
Junio C Hamano1a4e8412005-12-27 08:17:231392 creation event. This is equivalent to a diff against the NULL tree.
1393</p>
1394</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591395<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231396--stdin
1397</dt>
1398<dd>
1399<p>
1400 When <em>--stdin</em> is specified, the command does not take
1401 &lt;tree-ish&gt; arguments from the command line. Instead, it
Junio C Hamano3f2f6e52008-08-21 10:34:221402 reads lines containing either two &lt;tree&gt;, one &lt;commit&gt;, or a
1403 list of &lt;commit&gt; from its standard input. (Use a single space
1404 as separator.)
Junio C Hamano1a4e8412005-12-27 08:17:231405</p>
Junio C Hamano68cf15a2010-11-06 01:01:591406<div class="paragraph"><p>When two trees are given, it compares the first tree with the second.
Junio C Hamano3f2f6e52008-08-21 10:34:221407When a single commit is given, it compares the commit with its
1408parents. The remaining commits, when given, are used as if they are
Junio C Hamanob53db3c2008-08-07 00:17:521409parents of the first commit.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591410<div class="paragraph"><p>When comparing two trees, the ID of both trees (separated by a space
Junio C Hamano3f2f6e52008-08-21 10:34:221411and terminated by a newline) is printed before the difference. When
1412comparing commits, the ID of the first (or only) commit, followed by a
1413newline, is printed.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591414<div class="paragraph"><p>The following flags further affect the behavior when comparing
Junio C Hamano3f2f6e52008-08-21 10:34:221415commits (but not trees).</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231416</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591417<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231418-m
1419</dt>
1420<dd>
1421<p>
Junio C Hamano1aa40d22010-01-21 17:46:431422 By default, <em>git diff-tree --stdin</em> does not show
Junio C Hamano1a4e8412005-12-27 08:17:231423 differences for merge commits. With this flag, it shows
Junio C Hamanoa8adb1e2006-04-10 23:46:161424 differences to that commit from all of its parents. See
1425 also <em>-c</em>.
Junio C Hamano1a4e8412005-12-27 08:17:231426</p>
1427</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591428<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231429-s
1430</dt>
1431<dd>
1432<p>
Junio C Hamano1aa40d22010-01-21 17:46:431433 By default, <em>git diff-tree --stdin</em> shows differences,
Junio C Hamano1a4e8412005-12-27 08:17:231434 either in machine-readable form (without <em>-p</em>) or in patch
Junio C Hamano235a91e2006-01-07 01:13:581435 form (with <em>-p</em>). This output can be suppressed. It is
Junio C Hamano1a4e8412005-12-27 08:17:231436 only useful with <em>-v</em> flag.
1437</p>
1438</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591439<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231440-v
1441</dt>
1442<dd>
1443<p>
Junio C Hamano1aa40d22010-01-21 17:46:431444 This flag causes <em>git diff-tree --stdin</em> to also show
Junio C Hamano1a4e8412005-12-27 08:17:231445 the commit message before the differences.
1446</p>
1447</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591448<dt class="hdlist1">
Junio C Hamanod2179ef2010-10-22 04:12:171449--pretty[=&lt;format&gt;]
Junio C Hamano1a4e8412005-12-27 08:17:231450</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591451<dt class="hdlist1">
Junio C Hamanod2179ef2010-10-22 04:12:171452--format=&lt;format&gt;
Junio C Hamano0a235222009-03-06 08:21:091453</dt>
Junio C Hamano1a4e8412005-12-27 08:17:231454<dd>
1455<p>
Junio C Hamanoa3770f92007-07-25 08:53:331456 Pretty-print the contents of the commit logs in a given format,
Junio C Hamano0430e3a2007-05-15 03:13:171457 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:311458 <em>full</em>, <em>fuller</em>, <em>email</em>, <em>raw</em> and <em>format:&lt;string&gt;</em>. See
1459 the "PRETTY FORMATS" section for some additional details for each
1460 format. When omitted, the format defaults to <em>medium</em>.
Junio C Hamano1a4e8412005-12-27 08:17:231461</p>
Junio C Hamano68cf15a2010-11-06 01:01:591462<div class="paragraph"><p>Note: you can specify the default pretty format in the repository
Junio C Hamanoba4b9282008-07-06 05:20:311463configuration (see <a href="git-config.html">git-config(1)</a>).</p></div>
Junio C Hamano0430e3a2007-05-15 03:13:171464</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591465<dt class="hdlist1">
Junio C Hamanoee695f22007-06-21 00:35:361466--abbrev-commit
1467</dt>
1468<dd>
1469<p>
1470 Instead of showing the full 40-byte hexadecimal commit object
Junio C Hamano6efe3022009-01-13 16:47:561471 name, show only a partial prefix. Non default number of
Junio C Hamanoee695f22007-06-21 00:35:361472 digits can be specified with "--abbrev=&lt;n&gt;" (which also modifies
1473 diff output, if it is displayed).
1474</p>
Junio C Hamano68cf15a2010-11-06 01:01:591475<div class="paragraph"><p>This should make "--pretty=oneline" a whole lot more readable for
Junio C Hamanoba4b9282008-07-06 05:20:311476people using 80-column terminals.</p></div>
Junio C Hamanoee695f22007-06-21 00:35:361477</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591478<dt class="hdlist1">
Junio C Hamanof93530e2011-05-25 23:59:591479--no-abbrev-commit
1480</dt>
1481<dd>
1482<p>
1483 Show the full 40-byte hexadecimal commit object name. This negates
1484 <tt>--abbrev-commit</tt> and those options which imply it such as
1485 "--oneline". It also overrides the <em>log.abbrevCommit</em> variable.
1486</p>
1487</dd>
1488<dt class="hdlist1">
Junio C Hamano0a235222009-03-06 08:21:091489--oneline
1490</dt>
1491<dd>
1492<p>
1493 This is a shorthand for "--pretty=oneline --abbrev-commit"
1494 used together.
1495</p>
1496</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591497<dt class="hdlist1">
Junio C Hamano0430e3a2007-05-15 03:13:171498--encoding[=&lt;encoding&gt;]
1499</dt>
1500<dd>
1501<p>
1502 The commit objects record the encoding used for the log message
1503 in their encoding header; this option can be used to tell the
1504 command to re-code the commit log message in the encoding
1505 preferred by the user. For non plumbing commands this
1506 defaults to UTF-8.
1507</p>
1508</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591509<dt class="hdlist1">
Junio C Hamano60033462011-05-03 00:48:431510--notes[=&lt;ref&gt;]
Junio C Hamano57827fb2010-01-23 03:02:501511</dt>
1512<dd>
1513<p>
1514 Show the notes (see <a href="git-notes.html">git-notes(1)</a>) that annotate the
1515 commit, when showing the commit log message. This is the default
1516 for <tt>git log</tt>, <tt>git show</tt> and <tt>git whatchanged</tt> commands when
Junio C Hamano60033462011-05-03 00:48:431517 there is no <tt>--pretty</tt>, <tt>--format</tt> nor <tt>--oneline</tt> option given
1518 on the command line.
Junio C Hamano57827fb2010-01-23 03:02:501519</p>
Junio C Hamano60033462011-05-03 00:48:431520<div class="paragraph"><p>By default, the notes shown are from the notes refs listed in the
1521<em>core.notesRef</em> and <em>notes.displayRef</em> variables (or corresponding
1522environment overrides). See <a href="git-config.html">git-config(1)</a> for more details.</p></div>
1523<div class="paragraph"><p>With an optional <em>&lt;ref&gt;</em> argument, show this notes ref instead of the
1524default notes ref(s). The ref is taken to be in <tt>refs/notes/</tt> if it
1525is not qualified.</p></div>
1526<div class="paragraph"><p>Multiple --notes options can be combined to control which notes are
1527being displayed. Examples: "--notes=foo" will show only notes from
1528"refs/notes/foo"; "--notes=foo --notes" will show both notes from
1529"refs/notes/foo" and from the default notes ref(s).</p></div>
Junio C Hamano31667362010-03-25 00:38:531530</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591531<dt class="hdlist1">
Junio C Hamano60033462011-05-03 00:48:431532--no-notes
1533</dt>
1534<dd>
1535<p>
1536 Do not show notes. This negates the above <tt>--notes</tt> option, by
1537 resetting the list of notes refs from which notes are shown.
1538 Options are parsed in the order given on the command line, so e.g.
1539 "--notes --notes=foo --no-notes --notes=bar" will only show notes
1540 from "refs/notes/bar".
1541</p>
1542</dd>
1543<dt class="hdlist1">
1544--show-notes[=&lt;ref&gt;]
1545</dt>
1546<dt class="hdlist1">
Junio C Hamano31667362010-03-25 00:38:531547--[no-]standard-notes
1548</dt>
1549<dd>
1550<p>
Junio C Hamano60033462011-05-03 00:48:431551 These options are deprecated. Use the above --notes/--no-notes
1552 options instead.
Junio C Hamano31667362010-03-25 00:38:531553</p>
Junio C Hamano57827fb2010-01-23 03:02:501554</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591555<dt class="hdlist1">
Junio C Hamano0430e3a2007-05-15 03:13:171556--no-commit-id
1557</dt>
1558<dd>
1559<p>
Junio C Hamano1aa40d22010-01-21 17:46:431560 <em>git diff-tree</em> outputs a line with the commit ID when
Junio C Hamano0430e3a2007-05-15 03:13:171561 applicable. This flag suppressed the commit ID output.
1562</p>
1563</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591564<dt class="hdlist1">
Junio C Hamano0430e3a2007-05-15 03:13:171565-c
1566</dt>
1567<dd>
1568<p>
1569 This flag changes the way a merge commit is displayed
1570 (which means it is useful only when the command is given
1571 one &lt;tree-ish&gt;, or <em>--stdin</em>). It shows the differences
1572 from each of the parents to the merge result simultaneously
1573 instead of showing pairwise diff between a parent and the
1574 result one at a time (which is what the <em>-m</em> option does).
1575 Furthermore, it lists only files which were modified
1576 from all parents.
1577</p>
1578</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591579<dt class="hdlist1">
Junio C Hamano0430e3a2007-05-15 03:13:171580--cc
1581</dt>
1582<dd>
1583<p>
1584 This flag changes the way a merge commit patch is displayed,
1585 in a similar way to the <em>-c</em> option. It implies the <em>-c</em>
1586 and <em>-p</em> options and further compresses the patch output
Junio C Hamanoccc2f762008-07-24 04:03:331587 by omitting uninteresting hunks whose the contents in the parents
1588 have only two variants and the merge result picks one of them
1589 without modification. When all hunks are uninteresting, the commit
1590 itself and the commit log message is not shown, just like in any other
1591 "empty diff" case.
Junio C Hamano0430e3a2007-05-15 03:13:171592</p>
1593</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591594<dt class="hdlist1">
Junio C Hamano0430e3a2007-05-15 03:13:171595--always
1596</dt>
1597<dd>
1598<p>
1599 Show the commit itself and the commit log message even
1600 if the diff itself is empty.
1601</p>
1602</dd>
Junio C Hamanoba4b9282008-07-06 05:20:311603</dl></div>
Junio C Hamano0430e3a2007-05-15 03:13:171604</div>
Junio C Hamanoba4b9282008-07-06 05:20:311605<h2 id="_pretty_formats">PRETTY FORMATS</h2>
Junio C Hamano0430e3a2007-05-15 03:13:171606<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:591607<div class="paragraph"><p>If the commit is a merge, and if the pretty-format
Junio C Hamano0430e3a2007-05-15 03:13:171608is not <em>oneline</em>, <em>email</em> or <em>raw</em>, an additional line is
1609inserted before the <em>Author:</em> line. This line begins with
1610"Merge: " and the sha1s of ancestral commits are printed,
1611separated by spaces. Note that the listed commits may not
1612necessarily be the list of the <strong>direct</strong> parent commits if you
1613have limited your view of history: for example, if you are
1614only interested in changes related to a certain directory or
Junio C Hamanoba4b9282008-07-06 05:20:311615file.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591616<div class="paragraph"><p>There are several built-in formats, and you can define
Junio C Hamanoa574a092010-06-13 19:57:101617additional formats by setting a pretty.&lt;name&gt;
1618config option to either another format name, or a
1619<em>format:</em> string, as described below (see
1620<a href="git-config.html">git-config(1)</a>). Here are the details of the
1621built-in formats:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591622<div class="ulist"><ul>
Junio C Hamanoa340aaa2006-11-23 02:47:331623<li>
1624<p>
1625<em>oneline</em>
1626</p>
1627<div class="literalblock">
1628<div class="content">
1629<pre><tt>&lt;sha1&gt; &lt;title line&gt;</tt></pre>
1630</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591631<div class="paragraph"><p>This is designed to be as compact as possible.</p></div>
Junio C Hamanoa340aaa2006-11-23 02:47:331632</li>
1633<li>
1634<p>
1635<em>short</em>
1636</p>
1637<div class="literalblock">
1638<div class="content">
1639<pre><tt>commit &lt;sha1&gt;
1640Author: &lt;author&gt;</tt></pre>
1641</div></div>
1642<div class="literalblock">
1643<div class="content">
1644<pre><tt>&lt;title line&gt;</tt></pre>
1645</div></div>
1646</li>
1647<li>
1648<p>
1649<em>medium</em>
1650</p>
1651<div class="literalblock">
1652<div class="content">
1653<pre><tt>commit &lt;sha1&gt;
1654Author: &lt;author&gt;
Junio C Hamano6a3c8272008-12-19 21:38:181655Date: &lt;author date&gt;</tt></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:331656</div></div>
1657<div class="literalblock">
1658<div class="content">
1659<pre><tt>&lt;title line&gt;</tt></pre>
1660</div></div>
1661<div class="literalblock">
1662<div class="content">
1663<pre><tt>&lt;full commit message&gt;</tt></pre>
1664</div></div>
1665</li>
1666<li>
1667<p>
1668<em>full</em>
1669</p>
1670<div class="literalblock">
1671<div class="content">
1672<pre><tt>commit &lt;sha1&gt;
1673Author: &lt;author&gt;
1674Commit: &lt;committer&gt;</tt></pre>
1675</div></div>
1676<div class="literalblock">
1677<div class="content">
1678<pre><tt>&lt;title line&gt;</tt></pre>
1679</div></div>
1680<div class="literalblock">
1681<div class="content">
1682<pre><tt>&lt;full commit message&gt;</tt></pre>
1683</div></div>
1684</li>
1685<li>
1686<p>
1687<em>fuller</em>
1688</p>
1689<div class="literalblock">
1690<div class="content">
1691<pre><tt>commit &lt;sha1&gt;
Junio C Hamano6a3c8272008-12-19 21:38:181692Author: &lt;author&gt;
Junio C Hamanoba4b9282008-07-06 05:20:311693AuthorDate: &lt;author date&gt;
Junio C Hamano6a3c8272008-12-19 21:38:181694Commit: &lt;committer&gt;
Junio C Hamanoba4b9282008-07-06 05:20:311695CommitDate: &lt;committer date&gt;</tt></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:331696</div></div>
1697<div class="literalblock">
1698<div class="content">
1699<pre><tt>&lt;title line&gt;</tt></pre>
1700</div></div>
1701<div class="literalblock">
1702<div class="content">
1703<pre><tt>&lt;full commit message&gt;</tt></pre>
1704</div></div>
1705</li>
1706<li>
1707<p>
1708<em>email</em>
1709</p>
1710<div class="literalblock">
1711<div class="content">
1712<pre><tt>From &lt;sha1&gt; &lt;date&gt;
1713From: &lt;author&gt;
Junio C Hamanoba4b9282008-07-06 05:20:311714Date: &lt;author date&gt;
Junio C Hamanoa340aaa2006-11-23 02:47:331715Subject: [PATCH] &lt;title line&gt;</tt></pre>
1716</div></div>
1717<div class="literalblock">
1718<div class="content">
Junio C Hamano0430e3a2007-05-15 03:13:171719<pre><tt>&lt;full commit message&gt;</tt></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:331720</div></div>
1721</li>
1722<li>
1723<p>
1724<em>raw</em>
1725</p>
Junio C Hamano68cf15a2010-11-06 01:01:591726<div class="paragraph"><p>The <em>raw</em> format shows the entire commit exactly as
Junio C Hamanoa340aaa2006-11-23 02:47:331727stored in the commit object. Notably, the SHA1s are
1728displayed in full, regardless of whether --abbrev or
1729--no-abbrev are used, and <em>parents</em> information show the
1730true parent commits, without taking grafts nor history
Junio C Hamanoba4b9282008-07-06 05:20:311731simplification into account.</p></div>
Junio C Hamanoa340aaa2006-11-23 02:47:331732</li>
Junio C Hamanoa3fd83c2007-03-02 10:34:361733<li>
1734<p>
Junio C Hamanoe32ec8b2010-06-02 23:32:311735<em>format:&lt;string&gt;</em>
Junio C Hamanoa3fd83c2007-03-02 10:34:361736</p>
Junio C Hamano68cf15a2010-11-06 01:01:591737<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:361738you want to show. It works a little bit like printf format,
1739with the notable exception that you get a newline with <em>%n</em>
Junio C Hamanoba4b9282008-07-06 05:20:311740instead of <em>\n</em>.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591741<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:311742would show something like this:</p></div>
Junio C Hamano0430e3a2007-05-15 03:13:171743<div class="listingblock">
1744<div class="content">
1745<pre><tt>The author of fe6e0ee was Junio C Hamano, 23 hours ago
Junio C Hamano68cf15a2010-11-06 01:01:591746The 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:171747</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591748<div class="paragraph"><p>The placeholders are:</p></div>
1749<div class="ulist"><ul>
Junio C Hamanoa3fd83c2007-03-02 10:34:361750<li>
1751<p>
1752<em>%H</em>: commit hash
1753</p>
1754</li>
1755<li>
1756<p>
1757<em>%h</em>: abbreviated commit hash
1758</p>
1759</li>
1760<li>
1761<p>
1762<em>%T</em>: tree hash
1763</p>
1764</li>
1765<li>
1766<p>
1767<em>%t</em>: abbreviated tree hash
1768</p>
1769</li>
1770<li>
1771<p>
1772<em>%P</em>: parent hashes
1773</p>
1774</li>
1775<li>
1776<p>
1777<em>%p</em>: abbreviated parent hashes
1778</p>
1779</li>
1780<li>
1781<p>
1782<em>%an</em>: author name
1783</p>
1784</li>
1785<li>
1786<p>
Junio C Hamano8bc410e2009-02-15 10:38:191787<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:571788</p>
1789</li>
1790<li>
1791<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:361792<em>%ae</em>: author email
1793</p>
1794</li>
1795<li>
1796<p>
Junio C Hamano8bc410e2009-02-15 10:38:191797<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>)
1798</p>
1799</li>
1800<li>
1801<p>
Junio C Hamanoa387df32008-08-29 08:56:581802<em>%ad</em>: author date (format respects --date= option)
Junio C Hamanoa3fd83c2007-03-02 10:34:361803</p>
1804</li>
1805<li>
1806<p>
1807<em>%aD</em>: author date, RFC2822 style
1808</p>
1809</li>
1810<li>
1811<p>
1812<em>%ar</em>: author date, relative
1813</p>
1814</li>
1815<li>
1816<p>
1817<em>%at</em>: author date, UNIX timestamp
1818</p>
1819</li>
1820<li>
1821<p>
Junio C Hamano02f130b2007-07-14 08:26:561822<em>%ai</em>: author date, ISO 8601 format
1823</p>
1824</li>
1825<li>
1826<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:361827<em>%cn</em>: committer name
1828</p>
1829</li>
1830<li>
1831<p>
Junio C Hamano8bc410e2009-02-15 10:38:191832<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:571833</p>
1834</li>
1835<li>
1836<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:361837<em>%ce</em>: committer email
1838</p>
1839</li>
1840<li>
1841<p>
Junio C Hamano8bc410e2009-02-15 10:38:191842<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>)
1843</p>
1844</li>
1845<li>
1846<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:361847<em>%cd</em>: committer date
1848</p>
1849</li>
1850<li>
1851<p>
1852<em>%cD</em>: committer date, RFC2822 style
1853</p>
1854</li>
1855<li>
1856<p>
1857<em>%cr</em>: committer date, relative
1858</p>
1859</li>
1860<li>
1861<p>
1862<em>%ct</em>: committer date, UNIX timestamp
1863</p>
1864</li>
1865<li>
1866<p>
Junio C Hamano02f130b2007-07-14 08:26:561867<em>%ci</em>: committer date, ISO 8601 format
1868</p>
1869</li>
1870<li>
1871<p>
Junio C Hamano5e4d8de2008-09-19 06:27:021872<em>%d</em>: ref names, like the --decorate option of <a href="git-log.html">git-log(1)</a>
1873</p>
1874</li>
1875<li>
1876<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:361877<em>%e</em>: encoding
1878</p>
1879</li>
1880<li>
1881<p>
1882<em>%s</em>: subject
1883</p>
1884</li>
1885<li>
1886<p>
Junio C Hamano5f9a6f02009-04-06 08:26:561887<em>%f</em>: sanitized subject line, suitable for a filename
1888</p>
1889</li>
1890<li>
1891<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:361892<em>%b</em>: body
1893</p>
1894</li>
1895<li>
1896<p>
Junio C Hamanocb39aea2010-05-09 07:24:481897<em>%B</em>: raw body (unwrapped subject and body)
1898</p>
1899</li>
1900<li>
1901<p>
Junio C Hamano3b70d3c2009-11-21 17:37:371902<em>%N</em>: commit notes
1903</p>
1904</li>
1905<li>
1906<p>
Junio C Hamanoc21ab052009-10-31 04:03:551907<em>%gD</em>: reflog selector, e.g., <tt>refs/stash@{1}</tt>
1908</p>
1909</li>
1910<li>
1911<p>
1912<em>%gd</em>: shortened reflog selector, e.g., <tt>stash@{1}</tt>
1913</p>
1914</li>
1915<li>
1916<p>
1917<em>%gs</em>: reflog subject
1918</p>
1919</li>
1920<li>
1921<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:361922<em>%Cred</em>: switch color to red
1923</p>
1924</li>
1925<li>
1926<p>
1927<em>%Cgreen</em>: switch color to green
1928</p>
1929</li>
1930<li>
1931<p>
1932<em>%Cblue</em>: switch color to blue
1933</p>
1934</li>
1935<li>
1936<p>
1937<em>%Creset</em>: reset color
1938</p>
1939</li>
1940<li>
1941<p>
Junio C Hamanocc0cb312009-01-22 03:38:501942<em>%C(&#8230;)</em>: color specification, as described in color.branch.* config option
1943</p>
1944</li>
1945<li>
1946<p>
Junio C Hamanod9e0e5d2007-04-14 16:22:041947<em>%m</em>: left, right or boundary mark
1948</p>
1949</li>
1950<li>
1951<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:361952<em>%n</em>: newline
1953</p>
Junio C Hamano0430e3a2007-05-15 03:13:171954</li>
Junio C Hamanob78d2592008-04-09 09:39:081955<li>
1956<p>
Junio C Hamanoa9701f02010-01-21 00:42:161957<em>%%</em>: a raw <em>%</em>
1958</p>
1959</li>
1960<li>
1961<p>
Junio C Hamanob78d2592008-04-09 09:39:081962<em>%x00</em>: print a byte from a hex code
1963</p>
1964</li>
Junio C Hamanobf984de2009-11-23 06:11:191965<li>
1966<p>
1967<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:161968 <a href="git-shortlog.html">git-shortlog(1)</a>.
Junio C Hamanobf984de2009-11-23 06:11:191969</p>
1970</li>
Junio C Hamanoba4b9282008-07-06 05:20:311971</ul></div>
Junio C Hamanoa3fd83c2007-03-02 10:34:361972</li>
Junio C Hamanoc21ab052009-10-31 04:03:551973</ul></div>
1974<div class="admonitionblock">
1975<table><tr>
1976<td class="icon">
1977<div class="title">Note</div>
1978</td>
1979<td class="content">Some placeholders may depend on other options given to the
1980revision traversal engine. For example, the <tt>%g*</tt> reflog options will
1981insert an empty string unless we are traversing reflog entries (e.g., by
1982<tt>git log -g</tt>). The <tt>%d</tt> placeholder will use the "short" decoration
1983format if <tt>--decorate</tt> was not already provided on the command line.</td>
1984</tr></table>
1985</div>
Junio C Hamano68cf15a2010-11-06 01:01:591986<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:591987is inserted immediately before the expansion if and only if the
1988placeholder expands to a non-empty string.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591989<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:591990immediately precede the expansion are deleted if and only if the
1991placeholder expands to an empty string.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591992<div class="paragraph"><p>If you add a ` ` (space) after <em>%</em> of a placeholder, a space
Junio C Hamano89a57342010-06-22 23:22:551993is inserted immediately before the expansion if and only if the
1994placeholder expands to a non-empty string.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591995<div class="ulist"><ul>
Junio C Hamano6fb124c2008-06-13 10:04:011996<li>
1997<p>
1998<em>tformat:</em>
1999</p>
Junio C Hamano68cf15a2010-11-06 01:01:592000<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:012001provides "terminator" semantics instead of "separator" semantics. In
2002other words, each commit has the message terminator character (usually a
2003newline) appended, rather than a separator placed between entries.
2004This means that the final entry of a single-line format will be properly
2005terminated with a new line, just as the "oneline" format does.
Junio C Hamanoba4b9282008-07-06 05:20:312006For example:</p></div>
Junio C Hamano6fb124c2008-06-13 10:04:012007<div class="listingblock">
2008<div class="content">
2009<pre><tt>$ git log -2 --pretty=format:%h 4da45bef \
2010 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
20114da45be
20127134973 -- NO NEWLINE
2013
2014$ git log -2 --pretty=tformat:%h 4da45bef \
2015 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
20164da45be
20177134973</tt></pre>
2018</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592019<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:092020as if it has <tt>tformat:</tt> in front of it. For example, these two are
2021equivalent:</p></div>
2022<div class="listingblock">
2023<div class="content">
2024<pre><tt>$ git log -2 --pretty=tformat:%h 4da45bef
2025$ git log -2 --pretty=%h 4da45bef</tt></pre>
2026</div></div>
Junio C Hamano6fb124c2008-06-13 10:04:012027</li>
Junio C Hamanoba4b9282008-07-06 05:20:312028</ul></div>
Junio C Hamano1a4e8412005-12-27 08:17:232029</div>
Junio C Hamanoba4b9282008-07-06 05:20:312030<h2 id="_limiting_output">Limiting Output</h2>
Junio C Hamano1a4e8412005-12-27 08:17:232031<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:592032<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:312033example some architecture-specific files, you might do:</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232034<div class="literalblock">
2035<div class="content">
Junio C Hamanofce7c7e2008-07-02 03:06:382036<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:232037</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592038<div class="paragraph"><p>and it will only show you what changed in those two directories.</p></div>
2039<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:232040<div class="literalblock">
2041<div class="content">
Junio C Hamanofce7c7e2008-07-02 03:06:382042<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:232043</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592044<div class="paragraph"><p>and it will ignore all differences to other files.</p></div>
2045<div class="paragraph"><p>The pattern is always the prefix, and is matched exactly. There are no
Junio C Hamano1a4e8412005-12-27 08:17:232046wildcards. Even stricter, it has to match a complete path component.
2047I.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:312048so it can be used to name subdirectories.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592049<div class="paragraph"><p>An example of normal usage is:</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232050<div class="literalblock">
2051<div class="content">
Junio C Hamanoef5a2f92011-05-31 19:53:332052<pre><tt>torvalds@ppc970:~/git&gt; git diff-tree --abbrev 5319e4
2053:100664 100664 ac348b... a01513... git-fsck-objects.c</tt></pre>
Junio C Hamano1a4e8412005-12-27 08:17:232054</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592055<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:312056this one:</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232057<div class="listingblock">
2058<div class="content">
2059<pre><tt>commit 3c6f7ca19ad4043e9e72fa94106f352897e651a8
2060tree 5319e4d609cdd282069cc4dce33c1db559539b03
2061parent b4e628ea30d5ab3606119d2ea5caeab141d38df7
2062author Linus Torvalds &lt;torvalds@ppc970.osdl.org&gt; Sat Apr 9 12:02:30 2005
2063committer Linus Torvalds &lt;torvalds@ppc970.osdl.org&gt; Sat Apr 9 12:02:30 2005
2064
2065Make "git-fsck-objects" print out all the root commits it finds.
2066
2067Once I do the reference tracking, I'll also make it print out all the
2068HEAD commits it finds, which is even more interesting.</tt></pre>
2069</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592070<div class="paragraph"><p>in case you care).</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232071</div>
Junio C Hamano543f8d62009-07-29 08:35:212072<h2 id="_raw_output_format">Raw output format</h2>
Junio C Hamano1a4e8412005-12-27 08:17:232073<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:592074<div class="paragraph"><p>The raw output format from "git-diff-index", "git-diff-tree",
Junio C Hamanoba4b9282008-07-06 05:20:312075"git-diff-files" and "git diff --raw" are very similar.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592076<div class="paragraph"><p>These commands all compare two sets of things; what is
Junio C Hamanoba4b9282008-07-06 05:20:312077compared differs:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592078<div class="dlist"><dl>
2079<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:232080git-diff-index &lt;tree-ish&gt;
2081</dt>
2082<dd>
2083<p>
2084 compares the &lt;tree-ish&gt; and the files on the filesystem.
2085</p>
2086</dd>
Junio C Hamano68cf15a2010-11-06 01:01:592087<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:232088git-diff-index --cached &lt;tree-ish&gt;
2089</dt>
2090<dd>
2091<p>
2092 compares the &lt;tree-ish&gt; and the index.
2093</p>
2094</dd>
Junio C Hamano68cf15a2010-11-06 01:01:592095<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:232096git-diff-tree [-r] &lt;tree-ish-1&gt; &lt;tree-ish-2&gt; [&lt;pattern&gt;&#8230;]
2097</dt>
2098<dd>
2099<p>
2100 compares the trees named by the two arguments.
2101</p>
2102</dd>
Junio C Hamano68cf15a2010-11-06 01:01:592103<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:232104git-diff-files [&lt;pattern&gt;&#8230;]
2105</dt>
2106<dd>
2107<p>
2108 compares the index and the files on the filesystem.
2109</p>
2110</dd>
Junio C Hamanoba4b9282008-07-06 05:20:312111</dl></div>
Junio C Hamano68cf15a2010-11-06 01:01:592112<div class="paragraph"><p>The "git-diff-tree" command begins its output by printing the hash of
Junio C Hamano543f8d62009-07-29 08:35:212113what is being compared. After that, all the commands print one output
2114line per changed file.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592115<div class="paragraph"><p>An output line is formatted this way:</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232116<div class="listingblock">
2117<div class="content">
2118<pre><tt>in-place edit :100644 100644 bcd1234... 0123456... M file0
2119copy-edit :100644 100644 abcd123... 1234567... C68 file1 file2
2120rename-edit :100644 100644 abcd123... 1234567... R86 file1 file3
2121create :000000 100644 0000000... 1234567... A file4
2122delete :100644 000000 1234567... 0000000... D file5
2123unmerged :000000 000000 0000000... 0000000... U file6</tt></pre>
2124</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592125<div class="paragraph"><p>That is, from the left to the right:</p></div>
2126<div class="olist arabic"><ol class="arabic">
Junio C Hamano1a4e8412005-12-27 08:17:232127<li>
2128<p>
2129a colon.
2130</p>
2131</li>
2132<li>
2133<p>
2134mode for "src"; 000000 if creation or unmerged.
2135</p>
2136</li>
2137<li>
2138<p>
2139a space.
2140</p>
2141</li>
2142<li>
2143<p>
2144mode for "dst"; 000000 if deletion or unmerged.
2145</p>
2146</li>
2147<li>
2148<p>
2149a space.
2150</p>
2151</li>
2152<li>
2153<p>
2154sha1 for "src"; 0{40} if creation or unmerged.
2155</p>
2156</li>
2157<li>
2158<p>
2159a space.
2160</p>
2161</li>
2162<li>
2163<p>
2164sha1 for "dst"; 0{40} if creation, unmerged or "look at work tree".
2165</p>
2166</li>
2167<li>
2168<p>
2169a space.
2170</p>
2171</li>
2172<li>
2173<p>
2174status, followed by optional "score" number.
2175</p>
2176</li>
2177<li>
2178<p>
2179a tab or a NUL when <em>-z</em> option is used.
2180</p>
2181</li>
2182<li>
2183<p>
2184path for "src"
2185</p>
2186</li>
2187<li>
2188<p>
2189a tab or a NUL when <em>-z</em> option is used; only exists for C or R.
2190</p>
2191</li>
2192<li>
2193<p>
2194path for "dst"; only exists for C or R.
2195</p>
2196</li>
2197<li>
2198<p>
2199an LF or a NUL when <em>-z</em> option is used, to terminate the record.
2200</p>
2201</li>
Junio C Hamanoba4b9282008-07-06 05:20:312202</ol></div>
Junio C Hamano68cf15a2010-11-06 01:01:592203<div class="paragraph"><p>Possible status letters are:</p></div>
2204<div class="ulist"><ul>
Junio C Hamanoaa17c7c2008-11-03 04:36:582205<li>
2206<p>
2207A: addition of a file
2208</p>
2209</li>
2210<li>
2211<p>
2212C: copy of a file into a new one
2213</p>
2214</li>
2215<li>
2216<p>
2217D: deletion of a file
2218</p>
2219</li>
2220<li>
2221<p>
2222M: modification of the contents or mode of a file
2223</p>
2224</li>
2225<li>
2226<p>
2227R: renaming of a file
2228</p>
2229</li>
2230<li>
2231<p>
2232T: change in the type of the file
2233</p>
2234</li>
2235<li>
2236<p>
2237U: file is unmerged (you must complete the merge before it can
2238be committed)
2239</p>
2240</li>
2241<li>
2242<p>
2243X: "unknown" change type (most probably a bug, please report it)
2244</p>
2245</li>
2246</ul></div>
Junio C Hamano68cf15a2010-11-06 01:01:592247<div class="paragraph"><p>Status letters C and R are always followed by a score (denoting the
Junio C Hamanoaa17c7c2008-11-03 04:36:582248percentage of similarity between the source and target of the move or
2249copy), and are the only ones to be so.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592250<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:312251and it is out of sync with the index.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592252<div class="paragraph"><p>Example:</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232253<div class="listingblock">
2254<div class="content">
2255<pre><tt>:100644 100644 5be4a4...... 000000...... M file.c</tt></pre>
2256</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592257<div class="paragraph"><p>When <tt>-z</tt> option is not used, TAB, LF, and backslash characters
Junio C Hamano1a4e8412005-12-27 08:17:232258in pathnames are represented as <tt>\t</tt>, <tt>\n</tt>, and <tt>\\</tt>,
Junio C Hamanoba4b9282008-07-06 05:20:312259respectively.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232260</div>
Junio C Hamanoba4b9282008-07-06 05:20:312261<h2 id="_diff_format_for_merges">diff format for merges</h2>
Junio C Hamano67fad6d2007-05-06 08:53:122262<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:592263<div class="paragraph"><p>"git-diff-tree", "git-diff-files" and "git-diff --raw"
Junio C Hamano7ae0ab22007-11-03 02:46:462264can take <em>-c</em> or <em>--cc</em> option
Junio C Hamano67fad6d2007-05-06 08:53:122265to generate diff output also for merge commits. The output differs
Junio C Hamanoba4b9282008-07-06 05:20:312266from the format described above in the following way:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592267<div class="olist arabic"><ol class="arabic">
Junio C Hamano67fad6d2007-05-06 08:53:122268<li>
2269<p>
2270there is a colon for each parent
2271</p>
2272</li>
2273<li>
2274<p>
2275there are more "src" modes and "src" sha1
2276</p>
2277</li>
2278<li>
2279<p>
2280status is concatenated status characters for each parent
2281</p>
2282</li>
2283<li>
2284<p>
2285no optional "score" number
2286</p>
2287</li>
2288<li>
2289<p>
2290single path, only for "dst"
2291</p>
2292</li>
Junio C Hamanoba4b9282008-07-06 05:20:312293</ol></div>
Junio C Hamano68cf15a2010-11-06 01:01:592294<div class="paragraph"><p>Example:</p></div>
Junio C Hamano67fad6d2007-05-06 08:53:122295<div class="listingblock">
2296<div class="content">
2297<pre><tt>::100644 100644 100644 fabadb8... cc95eb0... 4866510... MM describe.c</tt></pre>
2298</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592299<div class="paragraph"><p>Note that <em>combined diff</em> lists only files which were modified from
Junio C Hamanoba4b9282008-07-06 05:20:312300all parents.</p></div>
Junio C Hamano67fad6d2007-05-06 08:53:122301</div>
Junio C Hamanoba4b9282008-07-06 05:20:312302<h2 id="_generating_patches_with_p">Generating patches with -p</h2>
Junio C Hamano1a4e8412005-12-27 08:17:232303<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:592304<div class="paragraph"><p>When "git-diff-index", "git-diff-tree", or "git-diff-files" are run
Junio C Hamano00b8b632007-12-07 09:50:492305with a <em>-p</em> option, "git diff" without the <em>--raw</em> option, or
2306"git log" with the "-p" option, they
Junio C Hamano7ae0ab22007-11-03 02:46:462307do not produce the output described above; instead they produce a
2308patch file. You can customize the creation of such patches via the
Junio C Hamanoba4b9282008-07-06 05:20:312309GIT_EXTERNAL_DIFF and the GIT_DIFF_OPTS environment variables.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592310<div class="paragraph"><p>What the -p option produces is slightly different from the traditional
Junio C Hamano7f9fa862010-10-19 23:51:142311diff format:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592312<div class="olist arabic"><ol class="arabic">
Junio C Hamano1a4e8412005-12-27 08:17:232313<li>
2314<p>
Junio C Hamano7f9fa862010-10-19 23:51:142315It is preceded with a "git diff" header that looks like this:
Junio C Hamano1a4e8412005-12-27 08:17:232316</p>
2317<div class="literalblock">
2318<div class="content">
2319<pre><tt>diff --git a/file1 b/file2</tt></pre>
2320</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592321<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:232322involved. Especially, even for a creation or a deletion,
Junio C Hamano68cf15a2010-11-06 01:01:592323<tt>/dev/null</tt> is <em>not</em> used in place of the <tt>a/</tt> or <tt>b/</tt> filenames.</p></div>
2324<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:232325name of the source file of the rename/copy and the name of
Junio C Hamanoba4b9282008-07-06 05:20:312326the file that rename/copy produces, respectively.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232327</li>
2328<li>
2329<p>
2330It is followed by one or more extended header lines:
2331</p>
2332<div class="literalblock">
2333<div class="content">
2334<pre><tt>old mode &lt;mode&gt;
2335new mode &lt;mode&gt;
2336deleted file mode &lt;mode&gt;
2337new file mode &lt;mode&gt;
2338copy from &lt;path&gt;
2339copy to &lt;path&gt;
2340rename from &lt;path&gt;
2341rename to &lt;path&gt;
2342similarity index &lt;number&gt;
2343dissimilarity index &lt;number&gt;
2344index &lt;hash&gt;..&lt;hash&gt; &lt;mode&gt;</tt></pre>
2345</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592346<div class="paragraph"><p>File modes are printed as 6-digit octal numbers including the file type
Junio C Hamano7f9fa862010-10-19 23:51:142347and file permission bits.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592348<div class="paragraph"><p>Path names in extended headers do not include the <tt>a/</tt> and <tt>b/</tt> prefixes.</p></div>
2349<div class="paragraph"><p>The similarity index is the percentage of unchanged lines, and
Junio C Hamano7f9fa862010-10-19 23:51:142350the dissimilarity index is the percentage of changed lines. It
2351is a rounded down integer, followed by a percent sign. The
2352similarity index value of 100% is thus reserved for two equal
2353files, while 100% dissimilarity means that no line from the old
2354file made it into the new one.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592355<div class="paragraph"><p>The index line includes the SHA-1 checksum before and after the change.
Junio C Hamano7f9fa862010-10-19 23:51:142356The &lt;mode&gt; is included if the file mode does not change; otherwise,
2357separate lines indicate the old and the new mode.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232358</li>
2359<li>
2360<p>
Junio C Hamanoa053d542006-10-27 09:29:132361TAB, LF, double quote and backslash characters in pathnames
2362 are represented as <tt>\t</tt>, <tt>\n</tt>, <tt>\"</tt> and <tt>\\</tt>, respectively.
2363 If there is need for such substitution then the whole
2364 pathname is put in double quotes.
Junio C Hamano1a4e8412005-12-27 08:17:232365</p>
2366</li>
Junio C Hamano7f9fa862010-10-19 23:51:142367<li>
2368<p>
2369All the <tt>file1</tt> files in the output refer to files before the
2370 commit, and all the <tt>file2</tt> files refer to files after the commit.
2371 It is incorrect to apply each change to each file sequentially. For
2372 example, this patch will swap a and b:
2373</p>
2374<div class="literalblock">
2375<div class="content">
2376<pre><tt>diff --git a/a b/b
2377rename from a
2378rename to b
2379diff --git a/b b/a
2380rename from b
2381rename to a</tt></pre>
2382</div></div>
2383</li>
Junio C Hamanoba4b9282008-07-06 05:20:312384</ol></div>
Junio C Hamano1a4e8412005-12-27 08:17:232385</div>
Junio C Hamanoba4b9282008-07-06 05:20:312386<h2 id="_combined_diff_format">combined diff format</h2>
Junio C Hamanofb56a962006-01-28 10:38:192387<div class="sectionbody">
Junio C Hamanoc5be4cc2011-03-09 07:20:432388<div class="paragraph"><p>Any diff-generating command can take the &#8216;-c` or <tt>--cc</tt> option to
2389produce a <em>combined diff</em> when showing a merge. This is the default
2390format when showing merges with <a href="git-diff.html">git-diff(1)</a> or
2391<a href="git-show.html">git-show(1)</a>. Note also that you can give the `-m&#8217; option to any
2392of these commands to force generation of diffs with individual parents
2393of a merge.</p></div>
2394<div class="paragraph"><p>A <em>combined diff</em> format looks like this:</p></div>
Junio C Hamanofb56a962006-01-28 10:38:192395<div class="listingblock">
2396<div class="content">
2397<pre><tt>diff --combined describe.c
Junio C Hamano29f14312006-10-26 08:47:292398index fabadb8,cc95eb0..4866510
2399--- a/describe.c
2400+++ b/describe.c
2401@@@ -98,20 -98,12 +98,20 @@@
2402 return (a_date &gt; b_date) ? -1 : (a_date == b_date) ? 0 : 1;
Junio C Hamanofb56a962006-01-28 10:38:192403 }
2404
2405- static void describe(char *arg)
2406 -static void describe(struct commit *cmit, int last_one)
2407++static void describe(char *arg, int last_one)
2408 {
Junio C Hamano29f14312006-10-26 08:47:292409 + unsigned char sha1[20];
2410 + struct commit *cmit;
2411 struct commit_list *list;
2412 static int initialized = 0;
2413 struct commit_name *n;
2414
2415 + if (get_sha1(arg, sha1) &lt; 0)
2416 + usage(describe_usage);
2417 + cmit = lookup_commit_reference(sha1);
2418 + if (!cmit)
2419 + usage(describe_usage);
2420 +
2421 if (!initialized) {
2422 initialized = 1;
2423 for_each_ref(get_name);</tt></pre>
Junio C Hamanofb56a962006-01-28 10:38:192424</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592425<div class="olist arabic"><ol class="arabic">
Junio C Hamano29f14312006-10-26 08:47:292426<li>
2427<p>
2428It is preceded with a "git diff" header, that looks like
2429 this (when <em>-c</em> option is used):
2430</p>
2431<div class="literalblock">
2432<div class="content">
2433<pre><tt>diff --combined file</tt></pre>
2434</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592435<div class="paragraph"><p>or like this (when <em>--cc</em> option is used):</p></div>
Junio C Hamano29f14312006-10-26 08:47:292436<div class="literalblock">
2437<div class="content">
Junio C Hamano0868a302008-07-22 09:20:442438<pre><tt>diff --cc file</tt></pre>
Junio C Hamano29f14312006-10-26 08:47:292439</div></div>
2440</li>
2441<li>
2442<p>
2443It is followed by one or more extended header lines
2444 (this example shows a merge with two parents):
2445</p>
2446<div class="literalblock">
2447<div class="content">
2448<pre><tt>index &lt;hash&gt;,&lt;hash&gt;..&lt;hash&gt;
2449mode &lt;mode&gt;,&lt;mode&gt;..&lt;mode&gt;
2450new file mode &lt;mode&gt;
2451deleted file mode &lt;mode&gt;,&lt;mode&gt;</tt></pre>
2452</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592453<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:042454the &lt;mode&gt; is different from the rest. Extended headers with
Junio C Hamano29f14312006-10-26 08:47:292455information about detected contents movement (renames and
2456copying detection) are designed to work with diff of two
Junio C Hamanoba4b9282008-07-06 05:20:312457&lt;tree-ish&gt; and are not used by combined diff format.</p></div>
Junio C Hamano29f14312006-10-26 08:47:292458</li>
2459<li>
2460<p>
2461It is followed by two-line from-file/to-file header
2462</p>
2463<div class="literalblock">
2464<div class="content">
2465<pre><tt>--- a/file
2466+++ b/file</tt></pre>
2467</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592468<div class="paragraph"><p>Similar to two-line header for traditional <em>unified</em> diff
Junio C Hamano29f14312006-10-26 08:47:292469format, <tt>/dev/null</tt> is used to signal created or deleted
Junio C Hamanoba4b9282008-07-06 05:20:312470files.</p></div>
Junio C Hamano29f14312006-10-26 08:47:292471</li>
2472<li>
2473<p>
2474Chunk header format is modified to prevent people from
2475 accidentally feeding it to <tt>patch -p1</tt>. Combined diff format
2476 was created for review of merge commit changes, and was not
2477 meant for apply. The change is similar to the change in the
2478 extended <em>index</em> header:
2479</p>
2480<div class="literalblock">
2481<div class="content">
2482<pre><tt>@@@ &lt;from-file-range&gt; &lt;from-file-range&gt; &lt;to-file-range&gt; @@@</tt></pre>
2483</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592484<div class="paragraph"><p>There are (number of parents + 1) <tt>@</tt> characters in the chunk
Junio C Hamanoba4b9282008-07-06 05:20:312485header for combined diff format.</p></div>
Junio C Hamano29f14312006-10-26 08:47:292486</li>
Junio C Hamanoba4b9282008-07-06 05:20:312487</ol></div>
Junio C Hamano68cf15a2010-11-06 01:01:592488<div class="paragraph"><p>Unlike the traditional <em>unified</em> diff format, which shows two
2489files 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
2490added to B), or <tt>" "</tt> (space&#8201;&#8212;&#8201;unchanged) prefix, this format
Junio C Hamanofb56a962006-01-28 10:38:192491compares two or more files file1, file2,&#8230; with one file X, and
2492shows how X differs from each of fileN. One column for each of
Junio C Hamano68cf15a2010-11-06 01:01:592493fileN is prepended to the output line to note how X&#8217;s line is
Junio C Hamanoba4b9282008-07-06 05:20:312494different from it.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592495<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:292496fileN but it does not appear in the result. A <tt>+</tt> character
Junio C Hamano54bf1e22008-12-20 06:30:112497in the column N means that the line appears in the result,
Junio C Hamano29f14312006-10-26 08:47:292498and fileN does not have that line (in other words, the line was
Junio C Hamanoba4b9282008-07-06 05:20:312499added, from the point of view of that parent).</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592500<div class="paragraph"><p>In the above example output, the function signature was changed
Junio C Hamanofb56a962006-01-28 10:38:192501from both files (hence two <tt>-</tt> removals from both file1 and
Junio C Hamano5e4d8de2008-09-19 06:27:022502file2, plus <tt>++</tt> to mean one line that was added does not appear
Junio C Hamano54bf1e22008-12-20 06:30:112503in either file1 nor file2). Also eight other lines are the same
2504from file1 but do not appear in file2 (hence prefixed with <tt>&#43;</tt>).</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592505<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:192506merge commit with the merge result (i.e. file1..fileN are the
2507parents). When shown by <tt>git diff-files -c</tt>, it compares the
2508two unresolved merge parents with the working tree file
2509(i.e. file1 is stage 2 aka "our version", file2 is stage 3 aka
Junio C Hamanoba4b9282008-07-06 05:20:312510"their version").</p></div>
Junio C Hamanofb56a962006-01-28 10:38:192511</div>
Junio C Hamanoba4b9282008-07-06 05:20:312512<h2 id="_other_diff_formats">other diff formats</h2>
Junio C Hamano3a702342007-12-12 21:34:022513<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:592514<div class="paragraph"><p>The <tt>--summary</tt> option describes newly added, deleted, renamed and
Junio C Hamano3a702342007-12-12 21:34:022515copied files. The <tt>--stat</tt> option adds diffstat(1) graph to the
2516output. These options can be combined with other options, such as
Junio C Hamanoba4b9282008-07-06 05:20:312517<tt>-p</tt>, and are meant for human consumption.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592518<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:022519formats the pathnames compactly by combining common prefix and suffix of
2520the pathnames. For example, a change that moves <tt>arch/i386/Makefile</tt> to
Junio C Hamanoba4b9282008-07-06 05:20:312521<tt>arch/x86/Makefile</tt> while modifying 4 lines will be shown like this:</p></div>
Junio C Hamano3a702342007-12-12 21:34:022522<div class="listingblock">
2523<div class="content">
2524<pre><tt>arch/{i386 =&gt; x86}/Makefile | 4 +--</tt></pre>
2525</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592526<div class="paragraph"><p>The <tt>--numstat</tt> option gives the diffstat(1) information but is designed
Junio C Hamano3a702342007-12-12 21:34:022527for easier machine consumption. An entry in <tt>--numstat</tt> output looks
Junio C Hamanoba4b9282008-07-06 05:20:312528like this:</p></div>
Junio C Hamano3a702342007-12-12 21:34:022529<div class="listingblock">
2530<div class="content">
2531<pre><tt>1 2 README
25323 1 arch/{i386 =&gt; x86}/Makefile</tt></pre>
2533</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592534<div class="paragraph"><p>That is, from left to right:</p></div>
2535<div class="olist arabic"><ol class="arabic">
Junio C Hamano3a702342007-12-12 21:34:022536<li>
2537<p>
2538the number of added lines;
2539</p>
2540</li>
2541<li>
2542<p>
2543a tab;
2544</p>
2545</li>
2546<li>
2547<p>
2548the number of deleted lines;
2549</p>
2550</li>
2551<li>
2552<p>
2553a tab;
2554</p>
2555</li>
2556<li>
2557<p>
2558pathname (possibly with rename/copy information);
2559</p>
2560</li>
2561<li>
2562<p>
2563a newline.
2564</p>
2565</li>
Junio C Hamanoba4b9282008-07-06 05:20:312566</ol></div>
Junio C Hamano68cf15a2010-11-06 01:01:592567<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:022568<div class="listingblock">
2569<div class="content">
2570<pre><tt>1 2 README NUL
25713 1 NUL arch/i386/Makefile NUL arch/x86/Makefile NUL</tt></pre>
2572</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592573<div class="paragraph"><p>That is:</p></div>
2574<div class="olist arabic"><ol class="arabic">
Junio C Hamano3a702342007-12-12 21:34:022575<li>
2576<p>
2577the number of added lines;
2578</p>
2579</li>
2580<li>
2581<p>
2582a tab;
2583</p>
2584</li>
2585<li>
2586<p>
2587the number of deleted lines;
2588</p>
2589</li>
2590<li>
2591<p>
2592a tab;
2593</p>
2594</li>
2595<li>
2596<p>
2597a NUL (only exists if renamed/copied);
2598</p>
2599</li>
2600<li>
2601<p>
2602pathname in preimage;
2603</p>
2604</li>
2605<li>
2606<p>
2607a NUL (only exists if renamed/copied);
2608</p>
2609</li>
2610<li>
2611<p>
2612pathname in postimage (only exists if renamed/copied);
2613</p>
2614</li>
2615<li>
2616<p>
2617a NUL.
2618</p>
2619</li>
Junio C Hamanoba4b9282008-07-06 05:20:312620</ol></div>
Junio C Hamano68cf15a2010-11-06 01:01:592621<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:022622scripts that read the output to tell if the current record being read is
2623a single-path record or a rename/copy record without reading ahead.
2624After reading added and deleted lines, reading up to <tt>NUL</tt> would yield
Junio C Hamanoba4b9282008-07-06 05:20:312625the pathname, but if that is <tt>NUL</tt>, the record will show two paths.</p></div>
Junio C Hamano3a702342007-12-12 21:34:022626</div>
Junio C Hamanoba4b9282008-07-06 05:20:312627<h2 id="_git">GIT</h2>
Junio C Hamano1a4e8412005-12-27 08:17:232628<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:592629<div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232630</div>
Junio C Hamano7bd050f2011-09-22 06:32:222631</div>
2632<div id="footnotes"><hr /></div>
Junio C Hamano1a4e8412005-12-27 08:17:232633<div id="footer">
2634<div id="footer-text">
Junio C Hamano02194af2011-11-17 20:33:592635Last updated 2011-11-15 13:45:02 PDT
Junio C Hamano1a4e8412005-12-27 08:17:232636</div>
2637</div>
2638</body>
2639</html>