blob: 76060d5ed6821e2ca5a8b552ac85630bee2b9688 [file] [log] [blame]
Junio C Hamano1a4e8412005-12-27 08:17:231<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
2 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
4<head>
Junio C Hamano9629d4f2012-12-19 00:28:275<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
6<meta name="generator" content="AsciiDoc 8.6.8" />
Junio C Hamano68cf15a2010-11-06 01:01:597<title>git-diff(1)</title>
Junio C Hamano1a4e8412005-12-27 08:17:238<style type="text/css">
Junio C Hamano9629d4f2012-12-19 00:28:279/* Shared CSS for AsciiDoc xhtml11 and html5 backends */
10
11/* Default font. */
12body {
13 font-family: Georgia,serif;
14}
15
16/* Title font. */
17h1, h2, h3, h4, h5, h6,
18div.title, caption.title,
19thead, p.table.header,
20#toctitle,
21#author, #revnumber, #revdate, #revremark,
22#footer {
23 font-family: Arial,Helvetica,sans-serif;
Junio C Hamano1a4e8412005-12-27 08:17:2324}
25
26body {
27 margin: 1em 5% 1em 5%;
28}
29
Junio C Hamano0868a302008-07-22 09:20:4430a {
31 color: blue;
32 text-decoration: underline;
33}
34a:visited {
35 color: fuchsia;
36}
Junio C Hamano1a4e8412005-12-27 08:17:2337
38em {
39 font-style: italic;
Junio C Hamano68cf15a2010-11-06 01:01:5940 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:2341}
42
43strong {
44 font-weight: bold;
Junio C Hamano68cf15a2010-11-06 01:01:5945 color: #083194;
Junio C Hamano1a4e8412005-12-27 08:17:2346}
47
Junio C Hamano1a4e8412005-12-27 08:17:2348h1, h2, h3, h4, h5, h6 {
49 color: #527bbd;
Junio C Hamano1a4e8412005-12-27 08:17:2350 margin-top: 1.2em;
51 margin-bottom: 0.5em;
52 line-height: 1.3;
53}
54
Junio C Hamano0868a302008-07-22 09:20:4455h1, h2, h3 {
Junio C Hamano1a4e8412005-12-27 08:17:2356 border-bottom: 2px solid silver;
57}
58h2 {
Junio C Hamano1a4e8412005-12-27 08:17:2359 padding-top: 0.5em;
60}
Junio C Hamano0868a302008-07-22 09:20:4461h3 {
62 float: left;
63}
64h3 + * {
65 clear: left;
66}
Junio C Hamano9629d4f2012-12-19 00:28:2767h5 {
68 font-size: 1.0em;
69}
Junio C Hamano1a4e8412005-12-27 08:17:2370
71div.sectionbody {
Junio C Hamano1a4e8412005-12-27 08:17:2372 margin-left: 0;
73}
74
75hr {
76 border: 1px solid silver;
77}
78
79p {
80 margin-top: 0.5em;
81 margin-bottom: 0.5em;
82}
83
Junio C Hamano68cf15a2010-11-06 01:01:5984ul, ol, li > p {
85 margin-top: 0;
86}
Junio C Hamano9629d4f2012-12-19 00:28:2787ul > li { color: #aaa; }
88ul > li > * { color: black; }
Junio C Hamano68cf15a2010-11-06 01:01:5989
Junio C Hamano9629d4f2012-12-19 00:28:2790.monospaced, code, pre {
91 font-family: "Courier New", Courier, monospace;
92 font-size: inherit;
93 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:2394 padding: 0;
95 margin: 0;
96}
97
Junio C Hamano9629d4f2012-12-19 00:28:2798
99#author {
Junio C Hamano1a4e8412005-12-27 08:17:23100 color: #527bbd;
Junio C Hamano1a4e8412005-12-27 08:17:23101 font-weight: bold;
Junio C Hamano0868a302008-07-22 09:20:44102 font-size: 1.1em;
Junio C Hamano1a4e8412005-12-27 08:17:23103}
Junio C Hamano9629d4f2012-12-19 00:28:27104#email {
Junio C Hamano1a4e8412005-12-27 08:17:23105}
Junio C Hamano9629d4f2012-12-19 00:28:27106#revnumber, #revdate, #revremark {
Junio C Hamano1a4e8412005-12-27 08:17:23107}
108
Junio C Hamano9629d4f2012-12-19 00:28:27109#footer {
Junio C Hamano1a4e8412005-12-27 08:17:23110 font-size: small;
111 border-top: 2px solid silver;
112 padding-top: 0.5em;
113 margin-top: 4.0em;
114}
Junio C Hamano9629d4f2012-12-19 00:28:27115#footer-text {
Junio C Hamano1a4e8412005-12-27 08:17:23116 float: left;
117 padding-bottom: 0.5em;
118}
Junio C Hamano9629d4f2012-12-19 00:28:27119#footer-badges {
Junio C Hamano1a4e8412005-12-27 08:17:23120 float: right;
121 padding-bottom: 0.5em;
122}
123
Junio C Hamano9629d4f2012-12-19 00:28:27124#preamble {
Junio C Hamano68cf15a2010-11-06 01:01:59125 margin-top: 1.5em;
126 margin-bottom: 1.5em;
127}
Junio C Hamano9629d4f2012-12-19 00:28:27128div.imageblock, div.exampleblock, div.verseblock,
Junio C Hamano1a4e8412005-12-27 08:17:23129div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
130div.admonitionblock {
Junio C Hamano7bd050f2011-09-22 06:32:22131 margin-top: 1.0em;
Junio C Hamano1a4e8412005-12-27 08:17:23132 margin-bottom: 1.5em;
133}
134div.admonitionblock {
Junio C Hamano7bd050f2011-09-22 06:32:22135 margin-top: 2.0em;
136 margin-bottom: 2.0em;
137 margin-right: 10%;
138 color: #606060;
Junio C Hamano1a4e8412005-12-27 08:17:23139}
140
141div.content { /* Block element content. */
142 padding: 0;
143}
144
145/* Block element titles. */
146div.title, caption.title {
Junio C Hamano68cf15a2010-11-06 01:01:59147 color: #527bbd;
Junio C Hamano1a4e8412005-12-27 08:17:23148 font-weight: bold;
149 text-align: left;
150 margin-top: 1.0em;
151 margin-bottom: 0.5em;
152}
153div.title + * {
154 margin-top: 0;
155}
156
157td div.title:first-child {
158 margin-top: 0.0em;
159}
160div.content div.title:first-child {
161 margin-top: 0.0em;
162}
163div.content + div.title {
164 margin-top: 0.0em;
165}
166
167div.sidebarblock > div.content {
168 background: #ffffee;
Junio C Hamano9629d4f2012-12-19 00:28:27169 border: 1px solid #dddddd;
170 border-left: 4px solid #f0f0f0;
Junio C Hamano1a4e8412005-12-27 08:17:23171 padding: 0.5em;
172}
173
174div.listingblock > div.content {
Junio C Hamano9629d4f2012-12-19 00:28:27175 border: 1px solid #dddddd;
176 border-left: 5px solid #f0f0f0;
177 background: #f8f8f8;
Junio C Hamano1a4e8412005-12-27 08:17:23178 padding: 0.5em;
179}
180
Junio C Hamano7bd050f2011-09-22 06:32:22181div.quoteblock, div.verseblock {
182 padding-left: 1.0em;
183 margin-left: 1.0em;
Junio C Hamano68cf15a2010-11-06 01:01:59184 margin-right: 10%;
Junio C Hamano9629d4f2012-12-19 00:28:27185 border-left: 5px solid #f0f0f0;
186 color: #888;
Junio C Hamano1a4e8412005-12-27 08:17:23187}
Junio C Hamano7bd050f2011-09-22 06:32:22188
Junio C Hamano68cf15a2010-11-06 01:01:59189div.quoteblock > div.attribution {
190 padding-top: 0.5em;
Junio C Hamano1a4e8412005-12-27 08:17:23191 text-align: right;
192}
Junio C Hamano68cf15a2010-11-06 01:01:59193
Junio C Hamano9629d4f2012-12-19 00:28:27194div.verseblock > pre.content {
195 font-family: inherit;
196 font-size: inherit;
Junio C Hamano68cf15a2010-11-06 01:01:59197}
198div.verseblock > div.attribution {
199 padding-top: 0.75em;
200 text-align: left;
201}
202/* DEPRECATED: Pre version 8.2.7 verse style literal block. */
Junio C Hamano0868a302008-07-22 09:20:44203div.verseblock + div.attribution {
204 text-align: left;
205}
Junio C Hamano1a4e8412005-12-27 08:17:23206
207div.admonitionblock .icon {
208 vertical-align: top;
209 font-size: 1.1em;
210 font-weight: bold;
211 text-decoration: underline;
212 color: #527bbd;
213 padding-right: 0.5em;
214}
215div.admonitionblock td.content {
216 padding-left: 0.5em;
Junio C Hamano7bd050f2011-09-22 06:32:22217 border-left: 3px solid #dddddd;
Junio C Hamano1a4e8412005-12-27 08:17:23218}
219
220div.exampleblock > div.content {
Junio C Hamano7bd050f2011-09-22 06:32:22221 border-left: 3px solid #dddddd;
222 padding-left: 0.5em;
Junio C Hamano1a4e8412005-12-27 08:17:23223}
224
Junio C Hamano1a4e8412005-12-27 08:17:23225div.imageblock div.content { padding-left: 0; }
Junio C Hamano1a4e8412005-12-27 08:17:23226span.image img { border-style: none; }
Junio C Hamano68cf15a2010-11-06 01:01:59227a.image:visited { color: white; }
Junio C Hamano1a4e8412005-12-27 08:17:23228
229dl {
230 margin-top: 0.8em;
231 margin-bottom: 0.8em;
232}
233dt {
234 margin-top: 0.5em;
235 margin-bottom: 0;
Junio C Hamano68cf15a2010-11-06 01:01:59236 font-style: normal;
237 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:23238}
239dd > *:first-child {
Junio C Hamano68cf15a2010-11-06 01:01:59240 margin-top: 0.1em;
Junio C Hamano1a4e8412005-12-27 08:17:23241}
242
243ul, ol {
244 list-style-position: outside;
245}
Junio C Hamano68cf15a2010-11-06 01:01:59246ol.arabic {
247 list-style-type: decimal;
248}
249ol.loweralpha {
Junio C Hamano1a4e8412005-12-27 08:17:23250 list-style-type: lower-alpha;
251}
Junio C Hamano68cf15a2010-11-06 01:01:59252ol.upperalpha {
253 list-style-type: upper-alpha;
254}
255ol.lowerroman {
256 list-style-type: lower-roman;
257}
258ol.upperroman {
259 list-style-type: upper-roman;
260}
261
262div.compact ul, div.compact ol,
263div.compact p, div.compact p,
264div.compact div, div.compact div {
265 margin-top: 0.1em;
266 margin-bottom: 0.1em;
267}
Junio C Hamano1a4e8412005-12-27 08:17:23268
Junio C Hamano1a4e8412005-12-27 08:17:23269tfoot {
270 font-weight: bold;
271}
Junio C Hamano68cf15a2010-11-06 01:01:59272td > div.verse {
273 white-space: pre;
274}
Junio C Hamano68cf15a2010-11-06 01:01:59275
276div.hdlist {
Junio C Hamano1a4e8412005-12-27 08:17:23277 margin-top: 0.8em;
278 margin-bottom: 0.8em;
279}
Junio C Hamano68cf15a2010-11-06 01:01:59280div.hdlist tr {
281 padding-bottom: 15px;
Junio C Hamano0868a302008-07-22 09:20:44282}
Junio C Hamano68cf15a2010-11-06 01:01:59283dt.hdlist1.strong, td.hdlist1.strong {
284 font-weight: bold;
285}
286td.hdlist1 {
Junio C Hamano1a4e8412005-12-27 08:17:23287 vertical-align: top;
Junio C Hamano68cf15a2010-11-06 01:01:59288 font-style: normal;
Junio C Hamano1a4e8412005-12-27 08:17:23289 padding-right: 0.8em;
Junio C Hamano68cf15a2010-11-06 01:01:59290 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:23291}
Junio C Hamano68cf15a2010-11-06 01:01:59292td.hdlist2 {
Junio C Hamano1a4e8412005-12-27 08:17:23293 vertical-align: top;
294}
Junio C Hamano68cf15a2010-11-06 01:01:59295div.hdlist.compact tr {
296 margin: 0;
297 padding-bottom: 0;
298}
299
300.comment {
301 background: yellow;
302}
Junio C Hamano1a4e8412005-12-27 08:17:23303
Junio C Hamano7bd050f2011-09-22 06:32:22304.footnote, .footnoteref {
305 font-size: 0.8em;
306}
307
308span.footnote, span.footnoteref {
309 vertical-align: super;
310}
311
312#footnotes {
313 margin: 20px 0 20px 0;
314 padding: 7px 0 0 0;
315}
316
317#footnotes div.footnote {
318 margin: 0 0 5px 0;
319}
320
321#footnotes hr {
322 border: none;
323 border-top: 1px solid silver;
324 height: 1px;
325 text-align: left;
326 margin-left: 0;
327 width: 20%;
328 min-width: 100px;
329}
330
Junio C Hamano9629d4f2012-12-19 00:28:27331div.colist td {
332 padding-right: 0.5em;
333 padding-bottom: 0.3em;
334 vertical-align: top;
335}
336div.colist td img {
337 margin-top: 0.3em;
Junio C Hamano1a4e8412005-12-27 08:17:23338}
Junio C Hamano0868a302008-07-22 09:20:44339
Junio C Hamano9629d4f2012-12-19 00:28:27340@media print {
341 #footer-badges { display: none; }
342}
343
344#toc {
Junio C Hamano7bd050f2011-09-22 06:32:22345 margin-bottom: 2.5em;
346}
347
Junio C Hamano9629d4f2012-12-19 00:28:27348#toctitle {
Junio C Hamano0868a302008-07-22 09:20:44349 color: #527bbd;
Junio C Hamano0868a302008-07-22 09:20:44350 font-size: 1.1em;
351 font-weight: bold;
352 margin-top: 1.0em;
353 margin-bottom: 0.1em;
354}
355
Junio C Hamano9629d4f2012-12-19 00:28:27356div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
Junio C Hamano0868a302008-07-22 09:20:44357 margin-top: 0;
358 margin-bottom: 0;
359}
360div.toclevel2 {
361 margin-left: 2em;
362 font-size: 0.9em;
363}
364div.toclevel3 {
365 margin-left: 4em;
366 font-size: 0.9em;
367}
368div.toclevel4 {
369 margin-left: 6em;
370 font-size: 0.9em;
371}
Junio C Hamano9629d4f2012-12-19 00:28:27372
373span.aqua { color: aqua; }
374span.black { color: black; }
375span.blue { color: blue; }
376span.fuchsia { color: fuchsia; }
377span.gray { color: gray; }
378span.green { color: green; }
379span.lime { color: lime; }
380span.maroon { color: maroon; }
381span.navy { color: navy; }
382span.olive { color: olive; }
383span.purple { color: purple; }
384span.red { color: red; }
385span.silver { color: silver; }
386span.teal { color: teal; }
387span.white { color: white; }
388span.yellow { color: yellow; }
389
390span.aqua-background { background: aqua; }
391span.black-background { background: black; }
392span.blue-background { background: blue; }
393span.fuchsia-background { background: fuchsia; }
394span.gray-background { background: gray; }
395span.green-background { background: green; }
396span.lime-background { background: lime; }
397span.maroon-background { background: maroon; }
398span.navy-background { background: navy; }
399span.olive-background { background: olive; }
400span.purple-background { background: purple; }
401span.red-background { background: red; }
402span.silver-background { background: silver; }
403span.teal-background { background: teal; }
404span.white-background { background: white; }
405span.yellow-background { background: yellow; }
406
407span.big { font-size: 2em; }
408span.small { font-size: 0.6em; }
409
410span.underline { text-decoration: underline; }
411span.overline { text-decoration: overline; }
412span.line-through { text-decoration: line-through; }
413
414div.unbreakable { page-break-inside: avoid; }
415
416
417/*
418 * xhtml11 specific
419 *
420 * */
421
422div.tableblock {
423 margin-top: 1.0em;
424 margin-bottom: 1.5em;
425}
426div.tableblock > table {
427 border: 3px solid #527bbd;
428}
429thead, p.table.header {
430 font-weight: bold;
431 color: #527bbd;
432}
433p.table {
434 margin-top: 0;
435}
436/* Because the table frame attribute is overriden by CSS in most browsers. */
437div.tableblock > table[frame="void"] {
438 border-style: none;
439}
440div.tableblock > table[frame="hsides"] {
441 border-left-style: none;
442 border-right-style: none;
443}
444div.tableblock > table[frame="vsides"] {
445 border-top-style: none;
446 border-bottom-style: none;
447}
448
449
450/*
451 * html5 specific
452 *
453 * */
454
455table.tableblock {
456 margin-top: 1.0em;
457 margin-bottom: 1.5em;
458}
459thead, p.tableblock.header {
460 font-weight: bold;
461 color: #527bbd;
462}
463p.tableblock {
464 margin-top: 0;
465}
466table.tableblock {
467 border-width: 3px;
468 border-spacing: 0px;
469 border-style: solid;
470 border-color: #527bbd;
471 border-collapse: collapse;
472}
473th.tableblock, td.tableblock {
474 border-width: 1px;
475 padding: 4px;
476 border-style: solid;
477 border-color: #527bbd;
478}
479
480table.tableblock.frame-topbot {
481 border-left-style: hidden;
482 border-right-style: hidden;
483}
484table.tableblock.frame-sides {
485 border-top-style: hidden;
486 border-bottom-style: hidden;
487}
488table.tableblock.frame-none {
489 border-style: hidden;
490}
491
492th.tableblock.halign-left, td.tableblock.halign-left {
493 text-align: left;
494}
495th.tableblock.halign-center, td.tableblock.halign-center {
496 text-align: center;
497}
498th.tableblock.halign-right, td.tableblock.halign-right {
499 text-align: right;
500}
501
502th.tableblock.valign-top, td.tableblock.valign-top {
503 vertical-align: top;
504}
505th.tableblock.valign-middle, td.tableblock.valign-middle {
506 vertical-align: middle;
507}
508th.tableblock.valign-bottom, td.tableblock.valign-bottom {
509 vertical-align: bottom;
510}
511
512
513/*
514 * manpage specific
515 *
516 * */
517
518body.manpage h1 {
Junio C Hamano68cf15a2010-11-06 01:01:59519 padding-top: 0.5em;
520 padding-bottom: 0.5em;
521 border-top: 2px solid silver;
522 border-bottom: 2px solid silver;
523}
Junio C Hamano9629d4f2012-12-19 00:28:27524body.manpage h2 {
Junio C Hamano68cf15a2010-11-06 01:01:59525 border-style: none;
526}
Junio C Hamano9629d4f2012-12-19 00:28:27527body.manpage div.sectionbody {
528 margin-left: 3em;
Junio C Hamano68cf15a2010-11-06 01:01:59529}
530
531@media print {
Junio C Hamano9629d4f2012-12-19 00:28:27532 body.manpage div#toc { display: none; }
Junio C Hamano68cf15a2010-11-06 01:01:59533}
534
Junio C Hamano1a4e8412005-12-27 08:17:23535
Junio C Hamano1a4e8412005-12-27 08:17:23536</style>
Junio C Hamano7bd050f2011-09-22 06:32:22537<script type="text/javascript">
538/*<![CDATA[*/
Junio C Hamano7bd050f2011-09-22 06:32:22539var asciidoc = { // Namespace.
540
541/////////////////////////////////////////////////////////////////////
542// Table Of Contents generator
543/////////////////////////////////////////////////////////////////////
544
545/* Author: Mihai Bazon, September 2002
546 * http://students.infoiasi.ro/~mishoo
547 *
548 * Table Of Content generator
549 * Version: 0.4
550 *
551 * Feel free to use this script under the terms of the GNU General Public
552 * License, as long as you do not remove or alter this notice.
553 */
554
555 /* modified by Troy D. Hanson, September 2006. License: GPL */
556 /* modified by Stuart Rackham, 2006, 2009. License: GPL */
557
558// toclevels = 1..4.
559toc: function (toclevels) {
560
561 function getText(el) {
562 var text = "";
563 for (var i = el.firstChild; i != null; i = i.nextSibling) {
564 if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
565 text += i.data;
566 else if (i.firstChild != null)
567 text += getText(i);
568 }
569 return text;
570 }
571
572 function TocEntry(el, text, toclevel) {
573 this.element = el;
574 this.text = text;
575 this.toclevel = toclevel;
576 }
577
578 function tocEntries(el, toclevels) {
579 var result = new Array;
Junio C Hamano9629d4f2012-12-19 00:28:27580 var re = new RegExp('[hH]([1-'+(toclevels+1)+'])');
Junio C Hamano7bd050f2011-09-22 06:32:22581 // Function that scans the DOM tree for header elements (the DOM2
582 // nodeIterator API would be a better technique but not supported by all
583 // browsers).
584 var iterate = function (el) {
585 for (var i = el.firstChild; i != null; i = i.nextSibling) {
586 if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
587 var mo = re.exec(i.tagName);
588 if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
589 result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
590 }
591 iterate(i);
592 }
593 }
594 }
595 iterate(el);
596 return result;
597 }
598
599 var toc = document.getElementById("toc");
Junio C Hamano9629d4f2012-12-19 00:28:27600 if (!toc) {
601 return;
602 }
603
604 // Delete existing TOC entries in case we're reloading the TOC.
605 var tocEntriesToRemove = [];
606 var i;
607 for (i = 0; i < toc.childNodes.length; i++) {
608 var entry = toc.childNodes[i];
609 if (entry.nodeName.toLowerCase() == 'div'
610 && entry.getAttribute("class")
611 && entry.getAttribute("class").match(/^toclevel/))
612 tocEntriesToRemove.push(entry);
613 }
614 for (i = 0; i < tocEntriesToRemove.length; i++) {
615 toc.removeChild(tocEntriesToRemove[i]);
616 }
617
618 // Rebuild TOC entries.
Junio C Hamano7bd050f2011-09-22 06:32:22619 var entries = tocEntries(document.getElementById("content"), toclevels);
620 for (var i = 0; i < entries.length; ++i) {
621 var entry = entries[i];
622 if (entry.element.id == "")
623 entry.element.id = "_toc_" + i;
624 var a = document.createElement("a");
625 a.href = "#" + entry.element.id;
626 a.appendChild(document.createTextNode(entry.text));
627 var div = document.createElement("div");
628 div.appendChild(a);
629 div.className = "toclevel" + entry.toclevel;
630 toc.appendChild(div);
631 }
632 if (entries.length == 0)
633 toc.parentNode.removeChild(toc);
634},
635
636
637/////////////////////////////////////////////////////////////////////
638// Footnotes generator
639/////////////////////////////////////////////////////////////////////
640
641/* Based on footnote generation code from:
642 * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
643 */
644
645footnotes: function () {
Junio C Hamano9629d4f2012-12-19 00:28:27646 // Delete existing footnote entries in case we're reloading the footnodes.
647 var i;
Junio C Hamano7bd050f2011-09-22 06:32:22648 var noteholder = document.getElementById("footnotes");
Junio C Hamano9629d4f2012-12-19 00:28:27649 if (!noteholder) {
650 return;
651 }
652 var entriesToRemove = [];
653 for (i = 0; i < noteholder.childNodes.length; i++) {
654 var entry = noteholder.childNodes[i];
655 if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote")
656 entriesToRemove.push(entry);
657 }
658 for (i = 0; i < entriesToRemove.length; i++) {
659 noteholder.removeChild(entriesToRemove[i]);
660 }
661
662 // Rebuild footnote entries.
663 var cont = document.getElementById("content");
Junio C Hamano7bd050f2011-09-22 06:32:22664 var spans = cont.getElementsByTagName("span");
665 var refs = {};
666 var n = 0;
667 for (i=0; i<spans.length; i++) {
668 if (spans[i].className == "footnote") {
669 n++;
Junio C Hamano9629d4f2012-12-19 00:28:27670 var note = spans[i].getAttribute("data-note");
671 if (!note) {
672 // Use [\s\S] in place of . so multi-line matches work.
673 // Because JavaScript has no s (dotall) regex flag.
674 note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
675 spans[i].innerHTML =
676 "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
677 "' title='View footnote' class='footnote'>" + n + "</a>]";
678 spans[i].setAttribute("data-note", note);
679 }
Junio C Hamano7bd050f2011-09-22 06:32:22680 noteholder.innerHTML +=
681 "<div class='footnote' id='_footnote_" + n + "'>" +
682 "<a href='#_footnoteref_" + n + "' title='Return to text'>" +
683 n + "</a>. " + note + "</div>";
Junio C Hamano7bd050f2011-09-22 06:32:22684 var id =spans[i].getAttribute("id");
685 if (id != null) refs["#"+id] = n;
686 }
687 }
688 if (n == 0)
689 noteholder.parentNode.removeChild(noteholder);
690 else {
691 // Process footnoterefs.
692 for (i=0; i<spans.length; i++) {
693 if (spans[i].className == "footnoteref") {
694 var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
695 href = href.match(/#.*/)[0]; // Because IE return full URL.
696 n = refs[href];
697 spans[i].innerHTML =
698 "[<a href='#_footnote_" + n +
699 "' title='View footnote' class='footnote'>" + n + "</a>]";
700 }
701 }
702 }
Junio C Hamano9629d4f2012-12-19 00:28:27703},
704
705install: function(toclevels) {
706 var timerId;
707
708 function reinstall() {
709 asciidoc.footnotes();
710 if (toclevels) {
711 asciidoc.toc(toclevels);
712 }
713 }
714
715 function reinstallAndRemoveTimer() {
716 clearInterval(timerId);
717 reinstall();
718 }
719
720 timerId = setInterval(reinstall, 500);
721 if (document.addEventListener)
722 document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false);
723 else
724 window.onload = reinstallAndRemoveTimer;
Junio C Hamano7bd050f2011-09-22 06:32:22725}
726
727}
Junio C Hamano9629d4f2012-12-19 00:28:27728asciidoc.install();
Junio C Hamano7bd050f2011-09-22 06:32:22729/*]]>*/
730</script>
Junio C Hamano1a4e8412005-12-27 08:17:23731</head>
Junio C Hamano9629d4f2012-12-19 00:28:27732<body class="manpage">
Junio C Hamano1a4e8412005-12-27 08:17:23733<div id="header">
734<h1>
735git-diff(1) Manual Page
736</h1>
737<h2>NAME</h2>
738<div class="sectionbody">
739<p>git-diff -
Junio C Hamano01078922006-03-10 00:31:47740 Show changes between commits, commit and working tree, etc
Junio C Hamano1a4e8412005-12-27 08:17:23741</p>
742</div>
743</div>
Junio C Hamano7bd050f2011-09-22 06:32:22744<div id="content">
Junio C Hamano9629d4f2012-12-19 00:28:27745<div class="sect1">
Junio C Hamano68cf15a2010-11-06 01:01:59746<h2 id="_synopsis">SYNOPSIS</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23747<div class="sectionbody">
Junio C Hamano2e6ded82010-12-05 06:20:48748<div class="verseblock">
Junio C Hamano9629d4f2012-12-19 00:28:27749<pre class="content"><em>git diff</em> [options] [&lt;commit&gt;] [--] [&lt;path&gt;&#8230;]
Junio C Hamano2e6ded82010-12-05 06:20:48750<em>git diff</em> [options] --cached [&lt;commit&gt;] [--] [&lt;path&gt;&#8230;]
751<em>git diff</em> [options] &lt;commit&gt; &lt;commit&gt; [--] [&lt;path&gt;&#8230;]
Junio C Hamanodb81b992012-12-21 23:49:12752<em>git diff</em> [options] &lt;blob&gt; &lt;blob&gt;
Junio C Hamano9629d4f2012-12-19 00:28:27753<em>git diff</em> [options] [--no-index] [--] &lt;path&gt; &lt;path&gt;</pre>
754<div class="attribution">
Junio C Hamano2e6ded82010-12-05 06:20:48755</div></div>
Junio C Hamano1a4e8412005-12-27 08:17:23756</div>
Junio C Hamano9629d4f2012-12-19 00:28:27757</div>
758<div class="sect1">
Junio C Hamano0868a302008-07-22 09:20:44759<h2 id="_description">DESCRIPTION</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23760<div class="sectionbody">
Junio C Hamano2e6ded82010-12-05 06:20:48761<div class="paragraph"><p>Show changes between the working tree and the index or a tree, changes
762between the index and a tree, changes between two trees, or changes
763between two files on disk.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:59764<div class="dlist"><dl>
765<dt class="hdlist1">
Junio C Hamanofce7c7e2008-07-02 03:06:38766<em>git diff</em> [--options] [--] [&lt;path&gt;&#8230;]
Junio C Hamano47848ae2006-12-14 11:20:06767</dt>
768<dd>
Junio C Hamano1a4e8412005-12-27 08:17:23769<p>
Junio C Hamano47848ae2006-12-14 11:20:06770 This form is to view the changes you made relative to
771 the index (staging area for the next commit). In other
Junio C Hamano076ffcc2013-02-06 05:13:21772 words, the differences are what you <em>could</em> tell Git to
Junio C Hamano68cf15a2010-11-06 01:01:59773 further add to the index but you still haven&#8217;t. You can
Junio C Hamanoa28a9202012-06-21 07:08:23774 stage these changes by using <a href="git-add.html">git-add(1)</a>.
Junio C Hamano1a4e8412005-12-27 08:17:23775</p>
Junio C Hamano68cf15a2010-11-06 01:01:59776<div class="paragraph"><p>If exactly two paths are given and at least one points outside
Junio C Hamanoc27b7332010-10-14 04:37:28777the current repository, <em>git diff</em> will compare the two files /
778directories. This behavior can be forced by --no-index.</p></div>
Junio C Hamano47848ae2006-12-14 11:20:06779</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59780<dt class="hdlist1">
Junio C Hamanofce7c7e2008-07-02 03:06:38781<em>git diff</em> [--options] --cached [&lt;commit&gt;] [--] [&lt;path&gt;&#8230;]
Junio C Hamano47848ae2006-12-14 11:20:06782</dt>
783<dd>
Junio C Hamano1a4e8412005-12-27 08:17:23784<p>
Junio C Hamano47848ae2006-12-14 11:20:06785 This form is to view the changes you staged for the next
Junio C Hamano4bf6dca2006-12-21 02:25:57786 commit relative to the named &lt;commit&gt;. Typically you
Junio C Hamano47848ae2006-12-14 11:20:06787 would want comparison with the latest commit, so if you
788 do not give &lt;commit&gt;, it defaults to HEAD.
Junio C Hamanoe6116832011-02-08 00:49:45789 If HEAD does not exist (e.g. unborned branches) and
790 &lt;commit&gt; is not given, it shows all staged changes.
Junio C Hamano8b4977b2008-11-12 04:57:48791 --staged is a synonym of --cached.
Junio C Hamano1a4e8412005-12-27 08:17:23792</p>
Junio C Hamano47848ae2006-12-14 11:20:06793</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59794<dt class="hdlist1">
Junio C Hamanofce7c7e2008-07-02 03:06:38795<em>git diff</em> [--options] &lt;commit&gt; [--] [&lt;path&gt;&#8230;]
Junio C Hamano47848ae2006-12-14 11:20:06796</dt>
797<dd>
Junio C Hamano1a4e8412005-12-27 08:17:23798<p>
Junio C Hamano47848ae2006-12-14 11:20:06799 This form is to view the changes you have in your
800 working tree relative to the named &lt;commit&gt;. You can
801 use HEAD to compare it with the latest commit, or a
802 branch name to compare with the tip of a different
803 branch.
Junio C Hamano1a4e8412005-12-27 08:17:23804</p>
Junio C Hamano47848ae2006-12-14 11:20:06805</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59806<dt class="hdlist1">
Junio C Hamanofce7c7e2008-07-02 03:06:38807<em>git diff</em> [--options] &lt;commit&gt; &lt;commit&gt; [--] [&lt;path&gt;&#8230;]
Junio C Hamano47848ae2006-12-14 11:20:06808</dt>
809<dd>
810<p>
Junio C Hamanoc435b1c2007-08-28 06:25:35811 This is to view the changes between two arbitrary
812 &lt;commit&gt;.
813</p>
814</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59815<dt class="hdlist1">
Junio C Hamanodb81b992012-12-21 23:49:12816<em>git diff</em> [options] &lt;blob&gt; &lt;blob&gt;
817</dt>
818<dd>
819<p>
820 This form is to view the differences between the raw
821 contents of two blob objects.
822</p>
823</dd>
824<dt class="hdlist1">
Junio C Hamanofce7c7e2008-07-02 03:06:38825<em>git diff</em> [--options] &lt;commit&gt;..&lt;commit&gt; [--] [&lt;path&gt;&#8230;]
Junio C Hamanoc435b1c2007-08-28 06:25:35826</dt>
827<dd>
828<p>
829 This is synonymous to the previous form. If &lt;commit&gt; on
830 one side is omitted, it will have the same effect as
831 using HEAD instead.
832</p>
833</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59834<dt class="hdlist1">
Junio C Hamanofce7c7e2008-07-02 03:06:38835<em>git diff</em> [--options] &lt;commit&gt;...&lt;commit&gt; [--] [&lt;path&gt;&#8230;]
Junio C Hamanoc435b1c2007-08-28 06:25:35836</dt>
837<dd>
838<p>
839 This form is to view the changes on the branch containing
840 and up to the second &lt;commit&gt;, starting at a common ancestor
Junio C Hamanofce7c7e2008-07-02 03:06:38841 of both &lt;commit&gt;. "git diff A...B" is equivalent to
842 "git diff $(git-merge-base A B) B". You can omit any one
Junio C Hamanoc435b1c2007-08-28 06:25:35843 of &lt;commit&gt;, which has the same effect as using HEAD instead.
Junio C Hamano47848ae2006-12-14 11:20:06844</p>
845</dd>
Junio C Hamano0868a302008-07-22 09:20:44846</dl></div>
Junio C Hamano68cf15a2010-11-06 01:01:59847<div class="paragraph"><p>Just in case if you are doing something exotic, it should be
Junio C Hamano7d9e9bd2007-08-29 07:31:47848noted that all of the &lt;commit&gt; in the above description, except
Junio C Hamanoc27b7332010-10-14 04:37:28849in the last two forms that use ".." notations, can be any
Junio C Hamanodb81b992012-12-21 23:49:12850&lt;tree&gt;.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:59851<div class="paragraph"><p>For a more complete list of ways to spell &lt;commit&gt;, see
Junio C Hamanoa28a9202012-06-21 07:08:23852"SPECIFYING REVISIONS" section in <a href="gitrevisions.html">gitrevisions(7)</a>.
Junio C Hamano68cf15a2010-11-06 01:01:59853However, "diff" is about comparing two <em>endpoints</em>, not ranges,
Junio C Hamanoc435b1c2007-08-28 06:25:35854and the range notations ("&lt;commit&gt;..&lt;commit&gt;" and
Junio C Hamano7d9e9bd2007-08-29 07:31:47855"&lt;commit&gt;...&lt;commit&gt;") do not mean a range as defined in the
Junio C Hamanoa28a9202012-06-21 07:08:23856"SPECIFYING RANGES" section in <a href="gitrevisions.html">gitrevisions(7)</a>.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:23857</div>
Junio C Hamano9629d4f2012-12-19 00:28:27858</div>
859<div class="sect1">
Junio C Hamano0868a302008-07-22 09:20:44860<h2 id="_options">OPTIONS</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23861<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:59862<div class="dlist"><dl>
863<dt class="hdlist1">
Junio C Hamano47848ae2006-12-14 11:20:06864-p
Junio C Hamano1a4e8412005-12-27 08:17:23865</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59866<dt class="hdlist1">
Junio C Hamanobbbb8652008-12-29 10:34:22867-u
868</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59869<dt class="hdlist1">
Junio C Hamanoe97d5772010-05-19 08:13:58870--patch
871</dt>
Junio C Hamano1a4e8412005-12-27 08:17:23872<dd>
873<p>
Junio C Hamanoff979792007-11-16 10:11:30874 Generate patch (see section on generating patches).
875 This is the default.
Junio C Hamano1a4e8412005-12-27 08:17:23876</p>
877</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59878<dt class="hdlist1">
Junio C Hamano69361562007-07-26 02:14:34879-U&lt;n&gt;
880</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59881<dt class="hdlist1">
Junio C Hamano69361562007-07-26 02:14:34882--unified=&lt;n&gt;
883</dt>
884<dd>
885<p>
886 Generate diffs with &lt;n&gt; lines of context instead of
Junio C Hamano3b70d3c2009-11-21 17:37:37887 the usual three.
Junio C Hamano9629d4f2012-12-19 00:28:27888 Implies <code>-p</code>.
Junio C Hamano69361562007-07-26 02:14:34889</p>
890</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59891<dt class="hdlist1">
Junio C Hamano47848ae2006-12-14 11:20:06892--raw
893</dt>
894<dd>
895<p>
896 Generate the raw format.
Junio C Hamanoff979792007-11-16 10:11:30897
Junio C Hamano47848ae2006-12-14 11:20:06898</p>
899</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59900<dt class="hdlist1">
Junio C Hamano47848ae2006-12-14 11:20:06901--patch-with-raw
902</dt>
903<dd>
904<p>
Junio C Hamano9629d4f2012-12-19 00:28:27905 Synonym for <code>-p --raw</code>.
Junio C Hamano47848ae2006-12-14 11:20:06906</p>
907</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59908<dt class="hdlist1">
Junio C Hamano5a73f302011-10-14 05:58:34909--minimal
910</dt>
911<dd>
912<p>
913 Spend extra time to make sure the smallest possible
914 diff is produced.
915</p>
916</dd>
917<dt class="hdlist1">
Junio C Hamano20d47e32009-01-26 06:36:02918--patience
919</dt>
920<dd>
921<p>
922 Generate a diff using the "patience diff" algorithm.
923</p>
924</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59925<dt class="hdlist1">
Junio C Hamanoaea9e6b2012-03-07 00:17:11926--histogram
927</dt>
928<dd>
929<p>
930 Generate a diff using the "histogram diff" algorithm.
931</p>
932</dd>
933<dt class="hdlist1">
Junio C Hamano80ad00d2013-02-18 00:19:03934--diff-algorithm={patience|minimal|histogram|myers}
935</dt>
936<dd>
937<p>
938 Choose a diff algorithm. The variants are as follows:
939</p>
940<div class="openblock">
941<div class="content">
942<div class="dlist"><dl>
943<dt class="hdlist1">
944<code>default</code>, <code>myers</code>
945</dt>
946<dd>
947<p>
948 The basic greedy diff algorithm. Currently, this is the default.
949</p>
950</dd>
951<dt class="hdlist1">
952<code>minimal</code>
953</dt>
954<dd>
955<p>
956 Spend extra time to make sure the smallest possible diff is
957 produced.
958</p>
959</dd>
960<dt class="hdlist1">
961<code>patience</code>
962</dt>
963<dd>
964<p>
965 Use "patience diff" algorithm when generating patches.
966</p>
967</dd>
968<dt class="hdlist1">
969<code>histogram</code>
970</dt>
971<dd>
972<p>
973 This algorithm extends the patience algorithm to "support
974 low-occurrence common elements".
975</p>
976</dd>
977</dl></div>
978</div></div>
979<div class="paragraph"><p>For instance, if you configured diff.algorithm variable to a
980non-default value and want to use the default one, then you
981have to use <code>--diff-algorithm=default</code> option.</p></div>
982</dd>
983<dt class="hdlist1">
Junio C Hamano4c4b0122011-06-30 01:19:32984--stat[=&lt;width&gt;[,&lt;name-width&gt;[,&lt;count&gt;]]]
Junio C Hamano47848ae2006-12-14 11:20:06985</dt>
986<dd>
987<p>
Junio C Hamanoaea9e6b2012-03-07 00:17:11988 Generate a diffstat. By default, as much space as necessary
989 will be used for the filename part, and the rest for the graph
990 part. Maximum width defaults to terminal width, or 80 columns
Junio C Hamano7f2b3cb2012-06-22 22:42:39991 if not connected to a terminal, and can be overridden by
Junio C Hamano9629d4f2012-12-19 00:28:27992 <code>&lt;width&gt;</code>. The width of the filename part can be limited by
993 giving another width <code>&lt;name-width&gt;</code> after a comma. The width
Junio C Hamanoaea9e6b2012-03-07 00:17:11994 of the graph part can be limited by using
Junio C Hamano9629d4f2012-12-19 00:28:27995 <code>--stat-graph-width=&lt;width&gt;</code> (affects all commands generating
996 a stat graph) or by setting <code>diff.statGraphWidth=&lt;width&gt;</code>
997 (does not affect <code>git format-patch</code>).
998 By giving a third parameter <code>&lt;count&gt;</code>, you can limit the
999 output to the first <code>&lt;count&gt;</code> lines, followed by <code>...</code> if
Junio C Hamanoaea9e6b2012-03-07 00:17:111000 there are more.
Junio C Hamano47848ae2006-12-14 11:20:061001</p>
Junio C Hamano9629d4f2012-12-19 00:28:271002<div class="paragraph"><p>These parameters can also be set individually with <code>--stat-width=&lt;width&gt;</code>,
1003<code>--stat-name-width=&lt;name-width&gt;</code> and <code>--stat-count=&lt;count&gt;</code>.</p></div>
Junio C Hamano47848ae2006-12-14 11:20:061004</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591005<dt class="hdlist1">
Junio C Hamano47848ae2006-12-14 11:20:061006--numstat
1007</dt>
1008<dd>
1009<p>
Junio C Hamano9629d4f2012-12-19 00:28:271010 Similar to <code>--stat</code>, but shows number of added and
Junio C Hamano47848ae2006-12-14 11:20:061011 deleted lines in decimal notation and pathname without
Junio C Hamanod793de52006-12-26 09:11:431012 abbreviation, to make it more machine friendly. For
Junio C Hamano9629d4f2012-12-19 00:28:271013 binary files, outputs two <code>-</code> instead of saying
1014 <code>0 0</code>.
Junio C Hamano47848ae2006-12-14 11:20:061015</p>
1016</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591017<dt class="hdlist1">
Junio C Hamano7d23f5e2006-12-16 07:44:041018--shortstat
1019</dt>
1020<dd>
1021<p>
Junio C Hamano9629d4f2012-12-19 00:28:271022 Output only the last line of the <code>--stat</code> format containing total
Junio C Hamano7d23f5e2006-12-16 07:44:041023 number of modified files, as well as number of added and deleted
1024 lines.
1025</p>
1026</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591027<dt class="hdlist1">
Junio C Hamano1c222c52011-05-13 19:55:321028--dirstat[=&lt;param1,param2,&#8230;&gt;]
Junio C Hamano6a45be92008-04-22 08:19:031029</dt>
1030<dd>
1031<p>
Junio C Hamano1c222c52011-05-13 19:55:321032 Output the distribution of relative amount of changes for each
Junio C Hamano9629d4f2012-12-19 00:28:271033 sub-directory. The behavior of <code>--dirstat</code> can be customized by
Junio C Hamano1c222c52011-05-13 19:55:321034 passing it a comma separated list of parameters.
Junio C Hamano9629d4f2012-12-19 00:28:271035 The defaults are controlled by the <code>diff.dirstat</code> configuration
Junio C Hamanoa28a9202012-06-21 07:08:231036 variable (see <a href="git-config.html">git-config(1)</a>).
Junio C Hamano1c222c52011-05-13 19:55:321037 The following parameters are available:
Junio C Hamano6a45be92008-04-22 08:19:031038</p>
Junio C Hamano9629d4f2012-12-19 00:28:271039<div class="openblock">
1040<div class="content">
Junio C Hamano1c222c52011-05-13 19:55:321041<div class="dlist"><dl>
1042<dt class="hdlist1">
Junio C Hamano9629d4f2012-12-19 00:28:271043<code>changes</code>
Junio C Hamano1c222c52011-05-13 19:55:321044</dt>
1045<dd>
1046<p>
1047 Compute the dirstat numbers by counting the lines that have been
1048 removed from the source, or added to the destination. This ignores
1049 the amount of pure code movements within a file. In other words,
1050 rearranging lines in a file is not counted as much as other changes.
1051 This is the default behavior when no parameter is given.
1052</p>
Junio C Hamano6a45be92008-04-22 08:19:031053</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591054<dt class="hdlist1">
Junio C Hamano9629d4f2012-12-19 00:28:271055<code>lines</code>
Junio C Hamanoa476efa2008-10-10 15:31:421056</dt>
1057<dd>
1058<p>
Junio C Hamano1c222c52011-05-13 19:55:321059 Compute the dirstat numbers by doing the regular line-based diff
1060 analysis, and summing the removed/added line counts. (For binary
1061 files, count 64-byte chunks instead, since binary files have no
Junio C Hamano9629d4f2012-12-19 00:28:271062 natural concept of lines). This is a more expensive <code>--dirstat</code>
1063 behavior than the <code>changes</code> behavior, but it does count rearranged
Junio C Hamano1c222c52011-05-13 19:55:321064 lines within a file as much as other changes. The resulting output
Junio C Hamano9629d4f2012-12-19 00:28:271065 is consistent with what you get from the other <code>--*stat</code> options.
Junio C Hamanoa476efa2008-10-10 15:31:421066</p>
1067</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591068<dt class="hdlist1">
Junio C Hamano9629d4f2012-12-19 00:28:271069<code>files</code>
Junio C Hamano1c222c52011-05-13 19:55:321070</dt>
1071<dd>
1072<p>
1073 Compute the dirstat numbers by counting the number of files changed.
1074 Each changed file counts equally in the dirstat analysis. This is
Junio C Hamano9629d4f2012-12-19 00:28:271075 the computationally cheapest <code>--dirstat</code> behavior, since it does
Junio C Hamano1c222c52011-05-13 19:55:321076 not have to look at the file contents at all.
1077</p>
1078</dd>
1079<dt class="hdlist1">
Junio C Hamano9629d4f2012-12-19 00:28:271080<code>cumulative</code>
Junio C Hamano1c222c52011-05-13 19:55:321081</dt>
1082<dd>
1083<p>
1084 Count changes in a child directory for the parent directory as well.
Junio C Hamano9629d4f2012-12-19 00:28:271085 Note that when using <code>cumulative</code>, the sum of the percentages
Junio C Hamano1c222c52011-05-13 19:55:321086 reported may exceed 100%. The default (non-cumulative) behavior can
Junio C Hamano9629d4f2012-12-19 00:28:271087 be specified with the <code>noncumulative</code> parameter.
Junio C Hamano1c222c52011-05-13 19:55:321088</p>
1089</dd>
1090<dt class="hdlist1">
1091&lt;limit&gt;
1092</dt>
1093<dd>
1094<p>
1095 An integer parameter specifies a cut-off percent (3% by default).
1096 Directories contributing less than this percentage of the changes
1097 are not shown in the output.
1098</p>
1099</dd>
1100</dl></div>
Junio C Hamano9629d4f2012-12-19 00:28:271101</div></div>
Junio C Hamano1c222c52011-05-13 19:55:321102<div class="paragraph"><p>Example: The following will count changed files, while ignoring
1103directories with less than 10% of the total amount of changed files,
1104and accumulating child directory counts in the parent directories:
Junio C Hamano9629d4f2012-12-19 00:28:271105<code>--dirstat=files,10,cumulative</code>.</p></div>
Junio C Hamano1c222c52011-05-13 19:55:321106</dd>
1107<dt class="hdlist1">
Junio C Hamano47848ae2006-12-14 11:20:061108--summary
1109</dt>
1110<dd>
1111<p>
1112 Output a condensed summary of extended header information
1113 such as creations, renames and mode changes.
1114</p>
1115</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591116<dt class="hdlist1">
Junio C Hamano47848ae2006-12-14 11:20:061117--patch-with-stat
1118</dt>
1119<dd>
1120<p>
Junio C Hamano9629d4f2012-12-19 00:28:271121 Synonym for <code>-p --stat</code>.
Junio C Hamano47848ae2006-12-14 11:20:061122</p>
1123</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591124<dt class="hdlist1">
Junio C Hamano47848ae2006-12-14 11:20:061125-z
1126</dt>
1127<dd>
1128<p>
Junio C Hamano9629d4f2012-12-19 00:28:271129 When <code>--raw</code>, <code>--numstat</code>, <code>--name-only</code> or <code>--name-status</code> has been
Junio C Hamano0c053e82010-04-19 06:46:341130 given, do not munge pathnames and use NULs as output field terminators.
Junio C Hamano47848ae2006-12-14 11:20:061131</p>
Junio C Hamano68cf15a2010-11-06 01:01:591132<div class="paragraph"><p>Without this option, each pathname output will have TAB, LF, double quotes,
Junio C Hamano9629d4f2012-12-19 00:28:271133and backslash characters replaced with <code>\t</code>, <code>\n</code>, <code>\"</code>, and <code>\\</code>,
Junio C Hamano5706e0b2009-11-24 10:54:161134respectively, and the pathname will be enclosed in double quotes if
1135any of those replacements occurred.</p></div>
Junio C Hamano47848ae2006-12-14 11:20:061136</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591137<dt class="hdlist1">
Junio C Hamano47848ae2006-12-14 11:20:061138--name-only
1139</dt>
1140<dd>
1141<p>
1142 Show only names of changed files.
1143</p>
1144</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591145<dt class="hdlist1">
Junio C Hamano47848ae2006-12-14 11:20:061146--name-status
1147</dt>
1148<dd>
1149<p>
Junio C Hamanoa9aee782008-04-23 16:09:201150 Show only names and status of changed files. See the description
Junio C Hamano9629d4f2012-12-19 00:28:271151 of the <code>--diff-filter</code> option on what the status letters mean.
Junio C Hamano47848ae2006-12-14 11:20:061152</p>
1153</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591154<dt class="hdlist1">
Junio C Hamanoc21ab052009-10-31 04:03:551155--submodule[=&lt;format&gt;]
1156</dt>
1157<dd>
1158<p>
Junio C Hamano9629d4f2012-12-19 00:28:271159 Specify how differences in submodules are shown. When <code>--submodule</code>
1160 or <code>--submodule=log</code> is given, the <em>log</em> format is used. This format lists
1161 the commits in the range like <a href="git-submodule.html">git-submodule(1)</a> <code>summary</code> does.
1162 Omitting the <code>--submodule</code> option or specifying <code>--submodule=short</code>,
Junio C Hamanoe768cc12012-03-16 05:43:051163 uses the <em>short</em> format. This format just shows the names of the commits
Junio C Hamanob4e58b12012-11-26 03:13:061164 at the beginning and end of the range. Can be tweaked via the
Junio C Hamano9629d4f2012-12-19 00:28:271165 <code>diff.submodule</code> configuration variable.
Junio C Hamanoc21ab052009-10-31 04:03:551166</p>
1167</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591168<dt class="hdlist1">
Junio C Hamano4aa0bcc2010-03-03 05:13:121169--color[=&lt;when&gt;]
Junio C Hamano47848ae2006-12-14 11:20:061170</dt>
1171<dd>
1172<p>
1173 Show colored diff.
Junio C Hamano947ab822013-03-19 23:07:291174 <code>--color</code> (i.e. without <em>=&lt;when&gt;</em>) is the same as <code>--color=always</code>.
1175 <em>&lt;when&gt;</em> can be one of <code>always</code>, <code>never</code>, or <code>auto</code>.
Junio C Hamano9629d4f2012-12-19 00:28:271176 It can be changed by the <code>color.ui</code> and <code>color.diff</code>
Junio C Hamano5f2627d2011-05-06 20:23:481177 configuration settings.
Junio C Hamano47848ae2006-12-14 11:20:061178</p>
1179</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591180<dt class="hdlist1">
Junio C Hamano47848ae2006-12-14 11:20:061181--no-color
1182</dt>
1183<dd>
1184<p>
Junio C Hamano5f2627d2011-05-06 20:23:481185 Turn off colored diff.
1186 This can be used to override configuration settings.
Junio C Hamano9629d4f2012-12-19 00:28:271187 It is the same as <code>--color=never</code>.
Junio C Hamano47848ae2006-12-14 11:20:061188</p>
1189</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591190<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531191--word-diff[=&lt;mode&gt;]
Junio C Hamano47848ae2006-12-14 11:20:061192</dt>
1193<dd>
1194<p>
Junio C Hamanocc7636a2010-05-21 14:57:531195 Show a word diff, using the &lt;mode&gt; to delimit changed words.
1196 By default, words are delimited by whitespace; see
Junio C Hamano9629d4f2012-12-19 00:28:271197 <code>--word-diff-regex</code> below. The &lt;mode&gt; defaults to <em>plain</em>, and
Junio C Hamanocc7636a2010-05-21 14:57:531198 must be one of:
Junio C Hamano47848ae2006-12-14 11:20:061199</p>
Junio C Hamano9629d4f2012-12-19 00:28:271200<div class="openblock">
1201<div class="content">
Junio C Hamano68cf15a2010-11-06 01:01:591202<div class="dlist"><dl>
1203<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531204color
1205</dt>
1206<dd>
1207<p>
Junio C Hamano9629d4f2012-12-19 00:28:271208 Highlight changed words using only colors. Implies <code>--color</code>.
Junio C Hamanocc7636a2010-05-21 14:57:531209</p>
1210</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591211<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531212plain
1213</dt>
1214<dd>
1215<p>
Junio C Hamano9629d4f2012-12-19 00:28:271216 Show words as <code>[-removed-]</code> and <code>{+added+}</code>. Makes no
Junio C Hamanocc7636a2010-05-21 14:57:531217 attempts to escape the delimiters if they appear in the input,
1218 so the output may be ambiguous.
1219</p>
1220</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591221<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531222porcelain
1223</dt>
1224<dd>
1225<p>
1226 Use a special line-based format intended for script
1227 consumption. Added/removed/unchanged runs are printed in the
Junio C Hamano9629d4f2012-12-19 00:28:271228 usual unified diff format, starting with a <code>+</code>/<code>-</code>/` `
Junio C Hamanocc7636a2010-05-21 14:57:531229 character at the beginning of the line and extending to the
1230 end of the line. Newlines in the input are represented by a
Junio C Hamano9629d4f2012-12-19 00:28:271231 tilde <code>~</code> on a line of its own.
Junio C Hamanocc7636a2010-05-21 14:57:531232</p>
1233</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591234<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531235none
1236</dt>
1237<dd>
1238<p>
1239 Disable word diff again.
1240</p>
1241</dd>
1242</dl></div>
Junio C Hamano9629d4f2012-12-19 00:28:271243</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591244<div class="paragraph"><p>Note that despite the name of the first mode, color is used to
Junio C Hamanocc7636a2010-05-21 14:57:531245highlight the changed parts in all modes if enabled.</p></div>
1246</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591247<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531248--word-diff-regex=&lt;regex&gt;
1249</dt>
1250<dd>
1251<p>
1252 Use &lt;regex&gt; to decide what a word is, instead of considering
1253 runs of non-whitespace to be a word. Also implies
Junio C Hamano9629d4f2012-12-19 00:28:271254 <code>--word-diff</code> unless it was already enabled.
Junio C Hamanocc7636a2010-05-21 14:57:531255</p>
Junio C Hamano68cf15a2010-11-06 01:01:591256<div class="paragraph"><p>Every non-overlapping match of the
Junio C Hamano20d47e32009-01-26 06:36:021257&lt;regex&gt; is considered a word. Anything between these matches is
1258considered whitespace and ignored(!) for the purposes of finding
Junio C Hamano9629d4f2012-12-19 00:28:271259differences. You may want to append <code>|[^[:space:]]</code> to your regular
Junio C Hamano20d47e32009-01-26 06:36:021260expression to make sure that it matches all non-whitespace characters.
1261A match that contains a newline is silently truncated(!) at the
1262newline.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591263<div class="paragraph"><p>The regex can also be set via a diff driver or configuration option, see
Junio C Hamanoa28a9202012-06-21 07:08:231264<a href="gitattributes.html">gitattributes(1)</a> or <a href="git-config.html">git-config(1)</a>. Giving it explicitly
Junio C Hamano20d47e32009-01-26 06:36:021265overrides any diff driver or configuration setting. Diff drivers
1266override configuration settings.</p></div>
Junio C Hamano47848ae2006-12-14 11:20:061267</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591268<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531269--color-words[=&lt;regex&gt;]
1270</dt>
1271<dd>
1272<p>
Junio C Hamano9629d4f2012-12-19 00:28:271273 Equivalent to <code>--word-diff=color</code> plus (if a regex was
1274 specified) <code>--word-diff-regex=&lt;regex&gt;</code>.
Junio C Hamanocc7636a2010-05-21 14:57:531275</p>
1276</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591277<dt class="hdlist1">
Junio C Hamano47848ae2006-12-14 11:20:061278--no-renames
1279</dt>
1280<dd>
1281<p>
1282 Turn off rename detection, even when the configuration
1283 file gives the default to do so.
1284</p>
1285</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591286<dt class="hdlist1">
Junio C Hamanoa890c4f2007-01-28 10:29:211287--check
1288</dt>
1289<dd>
1290<p>
Junio C Hamano6005bfa2011-06-23 00:51:221291 Warn if changes introduce whitespace errors. What are
Junio C Hamano9629d4f2012-12-19 00:28:271292 considered whitespace errors is controlled by <code>core.whitespace</code>
Junio C Hamano6005bfa2011-06-23 00:51:221293 configuration. By default, trailing whitespaces (including
1294 lines that solely consist of whitespaces) and a space character
1295 that is immediately followed by a tab character inside the
1296 initial indent of the line are considered whitespace errors.
1297 Exits with non-zero status if problems are found. Not compatible
1298 with --exit-code.
Junio C Hamanoa890c4f2007-01-28 10:29:211299</p>
1300</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591301<dt class="hdlist1">
Junio C Hamano47848ae2006-12-14 11:20:061302--full-index
1303</dt>
1304<dd>
1305<p>
Junio C Hamano5cf43ca2008-08-20 09:14:141306 Instead of the first handful of characters, show the full
1307 pre- and post-image blob object names on the "index"
1308 line when generating patch format output.
Junio C Hamano47848ae2006-12-14 11:20:061309</p>
1310</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591311<dt class="hdlist1">
Junio C Hamano47848ae2006-12-14 11:20:061312--binary
1313</dt>
1314<dd>
1315<p>
Junio C Hamano9629d4f2012-12-19 00:28:271316 In addition to <code>--full-index</code>, output a binary diff that
1317 can be applied with <code>git-apply</code>.
Junio C Hamano47848ae2006-12-14 11:20:061318</p>
1319</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591320<dt class="hdlist1">
Junio C Hamano47848ae2006-12-14 11:20:061321--abbrev[=&lt;n&gt;]
1322</dt>
1323<dd>
1324<p>
1325 Instead of showing the full 40-byte hexadecimal object
1326 name in diff-raw format output and diff-tree header
Junio C Hamano6efe3022009-01-13 16:47:561327 lines, show only a partial prefix. This is
Junio C Hamano9629d4f2012-12-19 00:28:271328 independent of the <code>--full-index</code> option above, which controls
Junio C Hamano47848ae2006-12-14 11:20:061329 the diff-patch output format. Non default number of
Junio C Hamano9629d4f2012-12-19 00:28:271330 digits can be specified with <code>--abbrev=&lt;n&gt;</code>.
Junio C Hamano47848ae2006-12-14 11:20:061331</p>
1332</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591333<dt class="hdlist1">
Junio C Hamanoe85e36f2010-08-10 05:30:141334-B[&lt;n&gt;][/&lt;m&gt;]
Junio C Hamano47848ae2006-12-14 11:20:061335</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591336<dt class="hdlist1">
Junio C Hamano39c7a692010-10-27 06:08:541337--break-rewrites[=[&lt;n&gt;][/&lt;m&gt;]]
1338</dt>
Junio C Hamano47848ae2006-12-14 11:20:061339<dd>
1340<p>
Junio C Hamanoe85e36f2010-08-10 05:30:141341 Break complete rewrite changes into pairs of delete and
1342 create. This serves two purposes:
Junio C Hamano47848ae2006-12-14 11:20:061343</p>
Junio C Hamano68cf15a2010-11-06 01:01:591344<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:141345not as a series of deletion and insertion mixed together with a very
1346few lines that happen to match textually as the context, but as a
1347single deletion of everything old followed by a single insertion of
Junio C Hamano9629d4f2012-12-19 00:28:271348everything new, and the number <code>m</code> controls this aspect of the -B
1349option (defaults to 60%). <code>-B/70%</code> specifies that less than 30% of the
Junio C Hamano076ffcc2013-02-06 05:13:211350original should remain in the result for Git to consider it a total
Junio C Hamanoe85e36f2010-08-10 05:30:141351rewrite (i.e. otherwise the resulting patch will be a series of
1352deletion and insertion mixed together with context lines).</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591353<div class="paragraph"><p>When used with -M, a totally-rewritten file is also considered as the
Junio C Hamanoe85e36f2010-08-10 05:30:141354source of a rename (usually -M only considers a file that disappeared
Junio C Hamano9629d4f2012-12-19 00:28:271355as the source of a rename), and the number <code>n</code> controls this aspect of
1356the -B option (defaults to 50%). <code>-B20%</code> specifies that a change with
Junio C Hamano68cf15a2010-11-06 01:01:591357addition and deletion compared to 20% or more of the file&#8217;s size are
Junio C Hamanoe85e36f2010-08-10 05:30:141358eligible for being picked up as a possible source of a rename to
1359another file.</p></div>
Junio C Hamano47848ae2006-12-14 11:20:061360</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591361<dt class="hdlist1">
Junio C Hamanoe85e36f2010-08-10 05:30:141362-M[&lt;n&gt;]
Junio C Hamano47848ae2006-12-14 11:20:061363</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591364<dt class="hdlist1">
Junio C Hamano0d75e872010-12-17 06:57:261365--find-renames[=&lt;n&gt;]
Junio C Hamano39c7a692010-10-27 06:08:541366</dt>
Junio C Hamano47848ae2006-12-14 11:20:061367<dd>
1368<p>
1369 Detect renames.
Junio C Hamano9629d4f2012-12-19 00:28:271370 If <code>n</code> is specified, it is a threshold on the similarity
Junio C Hamanoe85e36f2010-08-10 05:30:141371 index (i.e. amount of addition/deletions compared to the
Junio C Hamano076ffcc2013-02-06 05:13:211372 file&#8217;s size). For example, <code>-M90%</code> means Git should consider a
Junio C Hamanoe85e36f2010-08-10 05:30:141373 delete/add pair to be a rename if more than 90% of the file
Junio C Hamano9629d4f2012-12-19 00:28:271374 hasn&#8217;t changed. Without a <code>%</code> sign, the number is to be read as
1375 a fraction, with a decimal point before it. I.e., <code>-M5</code> becomes
1376 0.5, and is thus the same as <code>-M50%</code>. Similarly, <code>-M05</code> is
1377 the same as <code>-M5%</code>. To limit detection to exact renames, use
1378 <code>-M100%</code>.
Junio C Hamano47848ae2006-12-14 11:20:061379</p>
1380</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591381<dt class="hdlist1">
Junio C Hamanoe85e36f2010-08-10 05:30:141382-C[&lt;n&gt;]
Junio C Hamano47848ae2006-12-14 11:20:061383</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591384<dt class="hdlist1">
Junio C Hamano0d75e872010-12-17 06:57:261385--find-copies[=&lt;n&gt;]
Junio C Hamano39c7a692010-10-27 06:08:541386</dt>
Junio C Hamano47848ae2006-12-14 11:20:061387<dd>
1388<p>
Junio C Hamano9629d4f2012-12-19 00:28:271389 Detect copies as well as renames. See also <code>--find-copies-harder</code>.
1390 If <code>n</code> is specified, it has the same meaning as for <code>-M&lt;n&gt;</code>.
Junio C Hamano47848ae2006-12-14 11:20:061391</p>
1392</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591393<dt class="hdlist1">
Junio C Hamano47848ae2006-12-14 11:20:061394--find-copies-harder
1395</dt>
1396<dd>
1397<p>
Junio C Hamano9629d4f2012-12-19 00:28:271398 For performance reasons, by default, <code>-C</code> option finds copies only
Junio C Hamano47848ae2006-12-14 11:20:061399 if the original file of the copy was modified in the same
1400 changeset. This flag makes the command
1401 inspect unmodified files as candidates for the source of
1402 copy. This is a very expensive operation for large
Junio C Hamano16f98872007-06-12 16:09:141403 projects, so use it with caution. Giving more than one
Junio C Hamano9629d4f2012-12-19 00:28:271404 <code>-C</code> option has the same effect.
Junio C Hamano47848ae2006-12-14 11:20:061405</p>
1406</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591407<dt class="hdlist1">
Junio C Hamanob02377c2011-04-28 22:26:021408-D
1409</dt>
1410<dt class="hdlist1">
1411--irreversible-delete
1412</dt>
1413<dd>
1414<p>
1415 Omit the preimage for deletes, i.e. print only the header but not
Junio C Hamano9629d4f2012-12-19 00:28:271416 the diff between the preimage and <code>/dev/null</code>. The resulting patch
1417 is not meant to be applied with <code>patch</code> nor <code>git apply</code>; this is
Junio C Hamanob02377c2011-04-28 22:26:021418 solely for people who want to just concentrate on reviewing the
1419 text after the change. In addition, the output obviously lack
1420 enough information to apply such a patch in reverse, even manually,
1421 hence the name of the option.
1422</p>
Junio C Hamano9629d4f2012-12-19 00:28:271423<div class="paragraph"><p>When used together with <code>-B</code>, omit also the preimage in the deletion part
Junio C Hamanob02377c2011-04-28 22:26:021424of a delete/create pair.</p></div>
1425</dd>
1426<dt class="hdlist1">
Junio C Hamano47848ae2006-12-14 11:20:061427-l&lt;num&gt;
1428</dt>
1429<dd>
1430<p>
Junio C Hamano9629d4f2012-12-19 00:28:271431 The <code>-M</code> and <code>-C</code> options require O(n^2) processing time where n
Junio C Hamano47848ae2006-12-14 11:20:061432 is the number of potential rename/copy targets. This
1433 option prevents rename/copy detection from running if
1434 the number of rename/copy targets exceeds the specified
1435 number.
1436</p>
1437</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591438<dt class="hdlist1">
Junio C Hamano982eb112010-11-18 00:53:091439--diff-filter=[(A|C|D|M|R|T|U|X|B)&#8230;[*]]
1440</dt>
1441<dd>
1442<p>
Junio C Hamano9629d4f2012-12-19 00:28:271443 Select only files that are Added (<code>A</code>), Copied (<code>C</code>),
1444 Deleted (<code>D</code>), Modified (<code>M</code>), Renamed (<code>R</code>), have their
1445 type (i.e. regular file, symlink, submodule, &#8230;) changed (<code>T</code>),
1446 are Unmerged (<code>U</code>), are
1447 Unknown (<code>X</code>), or have had their pairing Broken (<code>B</code>).
Junio C Hamano982eb112010-11-18 00:53:091448 Any combination of the filter characters (including none) can be used.
Junio C Hamano9629d4f2012-12-19 00:28:271449 When <code>*</code> (All-or-none) is added to the combination, all
Junio C Hamano982eb112010-11-18 00:53:091450 paths are selected if there is any file that matches
1451 other criteria in the comparison; if there is no file
1452 that matches other criteria, nothing is selected.
1453</p>
1454</dd>
1455<dt class="hdlist1">
Junio C Hamano47848ae2006-12-14 11:20:061456-S&lt;string&gt;
1457</dt>
1458<dd>
1459<p>
Junio C Hamano5217a272009-03-21 00:39:331460 Look for differences that introduce or remove an instance of
1461 &lt;string&gt;. Note that this is different than the string simply
1462 appearing in diff output; see the <em>pickaxe</em> entry in
Junio C Hamanoa28a9202012-06-21 07:08:231463 <a href="gitdiffcore.html">gitdiffcore(7)</a> for more details.
Junio C Hamano47848ae2006-12-14 11:20:061464</p>
1465</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591466<dt class="hdlist1">
Junio C Hamano3b4609d2010-09-30 00:04:341467-G&lt;regex&gt;
1468</dt>
1469<dd>
1470<p>
1471 Look for differences whose added or removed line matches
1472 the given &lt;regex&gt;.
1473</p>
1474</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591475<dt class="hdlist1">
Junio C Hamano47848ae2006-12-14 11:20:061476--pickaxe-all
1477</dt>
1478<dd>
1479<p>
Junio C Hamano9629d4f2012-12-19 00:28:271480 When <code>-S</code> or <code>-G</code> finds a change, show all the changes in that
Junio C Hamano47848ae2006-12-14 11:20:061481 changeset, not just the files that contain the change
1482 in &lt;string&gt;.
1483</p>
1484</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591485<dt class="hdlist1">
Junio C Hamano47848ae2006-12-14 11:20:061486--pickaxe-regex
1487</dt>
1488<dd>
1489<p>
1490 Make the &lt;string&gt; not a plain string but an extended POSIX
1491 regex to match.
1492</p>
1493</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591494<dt class="hdlist1">
Junio C Hamano47848ae2006-12-14 11:20:061495-O&lt;orderfile&gt;
1496</dt>
1497<dd>
1498<p>
1499 Output the patch in the order specified in the
1500 &lt;orderfile&gt;, which has one shell glob pattern per line.
1501</p>
1502</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591503<dt class="hdlist1">
Junio C Hamano47848ae2006-12-14 11:20:061504-R
1505</dt>
1506<dd>
1507<p>
1508 Swap two inputs; that is, show differences from index or
1509 on-disk file to tree contents.
1510</p>
1511</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591512<dt class="hdlist1">
Junio C Hamano24bc09a2008-02-28 00:27:441513--relative[=&lt;path&gt;]
1514</dt>
1515<dd>
1516<p>
1517 When run from a subdirectory of the project, it can be
1518 told to exclude changes outside the directory and show
1519 pathnames relative to it with this option. When you are
1520 not in a subdirectory (e.g. in a bare repository), you
1521 can name which subdirectory to make the output relative
1522 to by giving a &lt;path&gt; as an argument.
1523</p>
1524</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591525<dt class="hdlist1">
Junio C Hamanobbbb8652008-12-29 10:34:221526-a
1527</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591528<dt class="hdlist1">
Junio C Hamano47848ae2006-12-14 11:20:061529--text
1530</dt>
1531<dd>
1532<p>
1533 Treat all files as text.
1534</p>
1535</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591536<dt class="hdlist1">
Junio C Hamanofd468962007-02-14 23:45:041537--ignore-space-at-eol
1538</dt>
1539<dd>
1540<p>
Junio C Hamano3a702342007-12-12 21:34:021541 Ignore changes in whitespace at EOL.
Junio C Hamanofd468962007-02-14 23:45:041542</p>
1543</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591544<dt class="hdlist1">
Junio C Hamanobbbb8652008-12-29 10:34:221545-b
1546</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591547<dt class="hdlist1">
Junio C Hamano47848ae2006-12-14 11:20:061548--ignore-space-change
1549</dt>
1550<dd>
1551<p>
Junio C Hamano3a702342007-12-12 21:34:021552 Ignore changes in amount of whitespace. This ignores whitespace
1553 at line end, and considers all other sequences of one or
1554 more whitespace characters to be equivalent.
Junio C Hamano47848ae2006-12-14 11:20:061555</p>
1556</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591557<dt class="hdlist1">
Junio C Hamanobbbb8652008-12-29 10:34:221558-w
Junio C Hamano47848ae2006-12-14 11:20:061559</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591560<dt class="hdlist1">
Junio C Hamano47848ae2006-12-14 11:20:061561--ignore-all-space
1562</dt>
1563<dd>
1564<p>
Junio C Hamano3a702342007-12-12 21:34:021565 Ignore whitespace when comparing lines. This ignores
1566 differences even if one line has whitespace where the other
Junio C Hamano47848ae2006-12-14 11:20:061567 line has none.
1568</p>
1569</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591570<dt class="hdlist1">
Junio C Hamano1d40ee82009-01-07 10:14:161571--inter-hunk-context=&lt;lines&gt;
1572</dt>
1573<dd>
1574<p>
1575 Show the context between diff hunks, up to the specified number
1576 of lines, thereby fusing hunks that are close to each other.
1577</p>
1578</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591579<dt class="hdlist1">
Junio C Hamano11821ed2011-10-19 18:42:091580-W
1581</dt>
1582<dt class="hdlist1">
1583--function-context
1584</dt>
1585<dd>
1586<p>
1587 Show whole surrounding functions of changes.
1588</p>
1589</dd>
1590<dt class="hdlist1">
Junio C Hamano48fd2f62007-03-19 02:02:301591--exit-code
1592</dt>
1593<dd>
1594<p>
1595 Make the program exit with codes similar to diff(1).
1596 That is, it exits with 1 if there were differences and
1597 0 means no differences.
1598</p>
1599</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591600<dt class="hdlist1">
Junio C Hamano35e57552007-03-25 07:54:351601--quiet
1602</dt>
1603<dd>
1604<p>
Junio C Hamano9629d4f2012-12-19 00:28:271605 Disable all output of the program. Implies <code>--exit-code</code>.
Junio C Hamano35e57552007-03-25 07:54:351606</p>
1607</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591608<dt class="hdlist1">
Junio C Hamanobb0f4042007-07-04 06:41:401609--ext-diff
1610</dt>
1611<dd>
1612<p>
1613 Allow an external diff helper to be executed. If you set an
Junio C Hamanoa28a9202012-06-21 07:08:231614 external diff driver with <a href="gitattributes.html">gitattributes(5)</a>, you need
1615 to use this option with <a href="git-log.html">git-log(1)</a> and friends.
Junio C Hamanobb0f4042007-07-04 06:41:401616</p>
1617</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591618<dt class="hdlist1">
Junio C Hamanobb0f4042007-07-04 06:41:401619--no-ext-diff
1620</dt>
1621<dd>
1622<p>
1623 Disallow external diff drivers.
1624</p>
1625</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591626<dt class="hdlist1">
Junio C Hamanoc652aed2011-07-07 01:14:311627--textconv
1628</dt>
1629<dt class="hdlist1">
1630--no-textconv
1631</dt>
1632<dd>
1633<p>
1634 Allow (or disallow) external text conversion filters to be run
Junio C Hamanoa28a9202012-06-21 07:08:231635 when comparing binary files. See <a href="gitattributes.html">gitattributes(5)</a> for
Junio C Hamanoc652aed2011-07-07 01:14:311636 details. Because textconv filters are typically a one-way
1637 conversion, the resulting diff is suitable for human
1638 consumption, but cannot be applied. For this reason, textconv
Junio C Hamanoa28a9202012-06-21 07:08:231639 filters are enabled by default only for <a href="git-diff.html">git-diff(1)</a> and
1640 <a href="git-log.html">git-log(1)</a>, but not for <a href="git-format-patch.html">git-format-patch(1)</a> or
Junio C Hamanoc652aed2011-07-07 01:14:311641 diff plumbing commands.
1642</p>
1643</dd>
1644<dt class="hdlist1">
Junio C Hamano7d449522010-07-01 00:08:511645--ignore-submodules[=&lt;when&gt;]
Junio C Hamanodfccbb02008-05-26 01:16:141646</dt>
1647<dd>
1648<p>
Junio C Hamano7d449522010-07-01 00:08:511649 Ignore changes to submodules in the diff generation. &lt;when&gt; can be
Junio C Hamano619596a2010-08-18 22:15:351650 either "none", "untracked", "dirty" or "all", which is the default
1651 Using "none" will consider the submodule modified when it either contains
1652 untracked or modified files or its HEAD differs from the commit recorded
1653 in the superproject and can be used to override any settings of the
Junio C Hamanoa28a9202012-06-21 07:08:231654 <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:511655 "untracked" is used submodules are not considered dirty when they only
1656 contain untracked content (but they are still scanned for modified
1657 content). Using "dirty" ignores all changes to the work tree of submodules,
1658 only changes to the commits stored in the superproject are shown (this was
1659 the behavior until 1.7.0). Using "all" hides all changes to submodules.
Junio C Hamanodfccbb02008-05-26 01:16:141660</p>
1661</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591662<dt class="hdlist1">
Junio C Hamanoe27cbd22007-12-21 17:57:331663--src-prefix=&lt;prefix&gt;
1664</dt>
1665<dd>
1666<p>
1667 Show the given source prefix instead of "a/".
1668</p>
1669</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591670<dt class="hdlist1">
Junio C Hamanoe27cbd22007-12-21 17:57:331671--dst-prefix=&lt;prefix&gt;
1672</dt>
1673<dd>
1674<p>
1675 Show the given destination prefix instead of "b/".
1676</p>
1677</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591678<dt class="hdlist1">
Junio C Hamanoe27cbd22007-12-21 17:57:331679--no-prefix
1680</dt>
1681<dd>
1682<p>
1683 Do not show any source or destination prefix.
1684</p>
1685</dd>
Junio C Hamano0868a302008-07-22 09:20:441686</dl></div>
Junio C Hamano68cf15a2010-11-06 01:01:591687<div class="paragraph"><p>For more detailed explanation on these common options, see also
Junio C Hamanoa28a9202012-06-21 07:08:231688<a href="gitdiffcore.html">gitdiffcore(7)</a>.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591689<div class="dlist"><dl>
1690<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231691&lt;path&gt;&#8230;
1692</dt>
1693<dd>
1694<p>
Junio C Hamano47848ae2006-12-14 11:20:061695 The &lt;paths&gt; parameters, when given, are used to limit
1696 the diff to the named paths (you can give directory
1697 names and get diff for all files under them).
Junio C Hamano1a4e8412005-12-27 08:17:231698</p>
1699</dd>
Junio C Hamano0868a302008-07-22 09:20:441700</dl></div>
Junio C Hamano1a4e8412005-12-27 08:17:231701</div>
Junio C Hamano9629d4f2012-12-19 00:28:271702</div>
1703<div class="sect1">
Junio C Hamano543f8d62009-07-29 08:35:211704<h2 id="_raw_output_format">Raw output format</h2>
Junio C Hamano7ae0ab22007-11-03 02:46:461705<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:591706<div class="paragraph"><p>The raw output format from "git-diff-index", "git-diff-tree",
Junio C Hamano0868a302008-07-22 09:20:441707"git-diff-files" and "git diff --raw" are very similar.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591708<div class="paragraph"><p>These commands all compare two sets of things; what is
Junio C Hamano0868a302008-07-22 09:20:441709compared differs:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591710<div class="dlist"><dl>
1711<dt class="hdlist1">
Junio C Hamano7ae0ab22007-11-03 02:46:461712git-diff-index &lt;tree-ish&gt;
1713</dt>
1714<dd>
1715<p>
1716 compares the &lt;tree-ish&gt; and the files on the filesystem.
1717</p>
1718</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591719<dt class="hdlist1">
Junio C Hamano7ae0ab22007-11-03 02:46:461720git-diff-index --cached &lt;tree-ish&gt;
1721</dt>
1722<dd>
1723<p>
1724 compares the &lt;tree-ish&gt; and the index.
1725</p>
1726</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591727<dt class="hdlist1">
Junio C Hamano7ae0ab22007-11-03 02:46:461728git-diff-tree [-r] &lt;tree-ish-1&gt; &lt;tree-ish-2&gt; [&lt;pattern&gt;&#8230;]
1729</dt>
1730<dd>
1731<p>
1732 compares the trees named by the two arguments.
1733</p>
1734</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591735<dt class="hdlist1">
Junio C Hamano7ae0ab22007-11-03 02:46:461736git-diff-files [&lt;pattern&gt;&#8230;]
1737</dt>
1738<dd>
1739<p>
1740 compares the index and the files on the filesystem.
1741</p>
1742</dd>
Junio C Hamano0868a302008-07-22 09:20:441743</dl></div>
Junio C Hamano68cf15a2010-11-06 01:01:591744<div class="paragraph"><p>The "git-diff-tree" command begins its output by printing the hash of
Junio C Hamano543f8d62009-07-29 08:35:211745what is being compared. After that, all the commands print one output
1746line per changed file.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591747<div class="paragraph"><p>An output line is formatted this way:</p></div>
Junio C Hamano7ae0ab22007-11-03 02:46:461748<div class="listingblock">
1749<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:271750<pre><code>in-place edit :100644 100644 bcd1234... 0123456... M file0
Junio C Hamano7ae0ab22007-11-03 02:46:461751copy-edit :100644 100644 abcd123... 1234567... C68 file1 file2
1752rename-edit :100644 100644 abcd123... 1234567... R86 file1 file3
1753create :000000 100644 0000000... 1234567... A file4
1754delete :100644 000000 1234567... 0000000... D file5
Junio C Hamano9629d4f2012-12-19 00:28:271755unmerged :000000 000000 0000000... 0000000... U file6</code></pre>
Junio C Hamano7ae0ab22007-11-03 02:46:461756</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591757<div class="paragraph"><p>That is, from the left to the right:</p></div>
1758<div class="olist arabic"><ol class="arabic">
Junio C Hamano7ae0ab22007-11-03 02:46:461759<li>
1760<p>
1761a colon.
1762</p>
1763</li>
1764<li>
1765<p>
1766mode for "src"; 000000 if creation or unmerged.
1767</p>
1768</li>
1769<li>
1770<p>
1771a space.
1772</p>
1773</li>
1774<li>
1775<p>
1776mode for "dst"; 000000 if deletion or unmerged.
1777</p>
1778</li>
1779<li>
1780<p>
1781a space.
1782</p>
1783</li>
1784<li>
1785<p>
1786sha1 for "src"; 0{40} if creation or unmerged.
1787</p>
1788</li>
1789<li>
1790<p>
1791a space.
1792</p>
1793</li>
1794<li>
1795<p>
1796sha1 for "dst"; 0{40} if creation, unmerged or "look at work tree".
1797</p>
1798</li>
1799<li>
1800<p>
1801a space.
1802</p>
1803</li>
1804<li>
1805<p>
1806status, followed by optional "score" number.
1807</p>
1808</li>
1809<li>
1810<p>
1811a tab or a NUL when <em>-z</em> option is used.
1812</p>
1813</li>
1814<li>
1815<p>
1816path for "src"
1817</p>
1818</li>
1819<li>
1820<p>
1821a tab or a NUL when <em>-z</em> option is used; only exists for C or R.
1822</p>
1823</li>
1824<li>
1825<p>
1826path for "dst"; only exists for C or R.
1827</p>
1828</li>
1829<li>
1830<p>
1831an LF or a NUL when <em>-z</em> option is used, to terminate the record.
1832</p>
1833</li>
Junio C Hamano0868a302008-07-22 09:20:441834</ol></div>
Junio C Hamano68cf15a2010-11-06 01:01:591835<div class="paragraph"><p>Possible status letters are:</p></div>
1836<div class="ulist"><ul>
Junio C Hamanoaa17c7c2008-11-03 04:36:581837<li>
1838<p>
1839A: addition of a file
1840</p>
1841</li>
1842<li>
1843<p>
1844C: copy of a file into a new one
1845</p>
1846</li>
1847<li>
1848<p>
1849D: deletion of a file
1850</p>
1851</li>
1852<li>
1853<p>
1854M: modification of the contents or mode of a file
1855</p>
1856</li>
1857<li>
1858<p>
1859R: renaming of a file
1860</p>
1861</li>
1862<li>
1863<p>
1864T: change in the type of the file
1865</p>
1866</li>
1867<li>
1868<p>
1869U: file is unmerged (you must complete the merge before it can
1870be committed)
1871</p>
1872</li>
1873<li>
1874<p>
1875X: "unknown" change type (most probably a bug, please report it)
1876</p>
1877</li>
1878</ul></div>
Junio C Hamano68cf15a2010-11-06 01:01:591879<div class="paragraph"><p>Status letters C and R are always followed by a score (denoting the
Junio C Hamanoaa17c7c2008-11-03 04:36:581880percentage of similarity between the source and target of the move or
1881copy), and are the only ones to be so.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591882<div class="paragraph"><p>&lt;sha1&gt; is shown as all 0&#8217;s if a file is new on the filesystem
Junio C Hamano0868a302008-07-22 09:20:441883and it is out of sync with the index.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591884<div class="paragraph"><p>Example:</p></div>
Junio C Hamano7ae0ab22007-11-03 02:46:461885<div class="listingblock">
1886<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:271887<pre><code>:100644 100644 5be4a4...... 000000...... M file.c</code></pre>
Junio C Hamano7ae0ab22007-11-03 02:46:461888</div></div>
Junio C Hamano9629d4f2012-12-19 00:28:271889<div class="paragraph"><p>When <code>-z</code> option is not used, TAB, LF, and backslash characters
1890in pathnames are represented as <code>\t</code>, <code>\n</code>, and <code>\\</code>,
Junio C Hamano0868a302008-07-22 09:20:441891respectively.</p></div>
Junio C Hamano7ae0ab22007-11-03 02:46:461892</div>
Junio C Hamano9629d4f2012-12-19 00:28:271893</div>
1894<div class="sect1">
Junio C Hamano0868a302008-07-22 09:20:441895<h2 id="_diff_format_for_merges">diff format for merges</h2>
Junio C Hamano7ae0ab22007-11-03 02:46:461896<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:591897<div class="paragraph"><p>"git-diff-tree", "git-diff-files" and "git-diff --raw"
Junio C Hamano7ae0ab22007-11-03 02:46:461898can take <em>-c</em> or <em>--cc</em> option
1899to generate diff output also for merge commits. The output differs
Junio C Hamano0868a302008-07-22 09:20:441900from the format described above in the following way:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591901<div class="olist arabic"><ol class="arabic">
Junio C Hamano7ae0ab22007-11-03 02:46:461902<li>
1903<p>
1904there is a colon for each parent
1905</p>
1906</li>
1907<li>
1908<p>
1909there are more "src" modes and "src" sha1
1910</p>
1911</li>
1912<li>
1913<p>
1914status is concatenated status characters for each parent
1915</p>
1916</li>
1917<li>
1918<p>
1919no optional "score" number
1920</p>
1921</li>
1922<li>
1923<p>
1924single path, only for "dst"
1925</p>
1926</li>
Junio C Hamano0868a302008-07-22 09:20:441927</ol></div>
Junio C Hamano68cf15a2010-11-06 01:01:591928<div class="paragraph"><p>Example:</p></div>
Junio C Hamano7ae0ab22007-11-03 02:46:461929<div class="listingblock">
1930<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:271931<pre><code>::100644 100644 100644 fabadb8... cc95eb0... 4866510... MM describe.c</code></pre>
Junio C Hamano7ae0ab22007-11-03 02:46:461932</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591933<div class="paragraph"><p>Note that <em>combined diff</em> lists only files which were modified from
Junio C Hamano0868a302008-07-22 09:20:441934all parents.</p></div>
Junio C Hamano7ae0ab22007-11-03 02:46:461935</div>
Junio C Hamano9629d4f2012-12-19 00:28:271936</div>
1937<div class="sect1">
Junio C Hamano0868a302008-07-22 09:20:441938<h2 id="_generating_patches_with_p">Generating patches with -p</h2>
Junio C Hamano7ae0ab22007-11-03 02:46:461939<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:591940<div class="paragraph"><p>When "git-diff-index", "git-diff-tree", or "git-diff-files" are run
Junio C Hamano00b8b632007-12-07 09:50:491941with a <em>-p</em> option, "git diff" without the <em>--raw</em> option, or
1942"git log" with the "-p" option, they
Junio C Hamano7ae0ab22007-11-03 02:46:461943do not produce the output described above; instead they produce a
1944patch file. You can customize the creation of such patches via the
Junio C Hamano0868a302008-07-22 09:20:441945GIT_EXTERNAL_DIFF and the GIT_DIFF_OPTS environment variables.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591946<div class="paragraph"><p>What the -p option produces is slightly different from the traditional
Junio C Hamano7f9fa862010-10-19 23:51:141947diff format:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591948<div class="olist arabic"><ol class="arabic">
Junio C Hamano7ae0ab22007-11-03 02:46:461949<li>
1950<p>
Junio C Hamano7f9fa862010-10-19 23:51:141951It is preceded with a "git diff" header that looks like this:
Junio C Hamano7ae0ab22007-11-03 02:46:461952</p>
1953<div class="literalblock">
1954<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:271955<pre><code>diff --git a/file1 b/file2</code></pre>
Junio C Hamano7ae0ab22007-11-03 02:46:461956</div></div>
Junio C Hamano9629d4f2012-12-19 00:28:271957<div class="paragraph"><p>The <code>a/</code> and <code>b/</code> filenames are the same unless rename/copy is
Junio C Hamano7ae0ab22007-11-03 02:46:461958involved. Especially, even for a creation or a deletion,
Junio C Hamano9629d4f2012-12-19 00:28:271959<code>/dev/null</code> is <em>not</em> used in place of the <code>a/</code> or <code>b/</code> filenames.</p></div>
1960<div class="paragraph"><p>When rename/copy is involved, <code>file1</code> and <code>file2</code> show the
Junio C Hamano7ae0ab22007-11-03 02:46:461961name of the source file of the rename/copy and the name of
Junio C Hamano0868a302008-07-22 09:20:441962the file that rename/copy produces, respectively.</p></div>
Junio C Hamano7ae0ab22007-11-03 02:46:461963</li>
1964<li>
1965<p>
1966It is followed by one or more extended header lines:
1967</p>
1968<div class="literalblock">
1969<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:271970<pre><code>old mode &lt;mode&gt;
Junio C Hamano7ae0ab22007-11-03 02:46:461971new mode &lt;mode&gt;
1972deleted file mode &lt;mode&gt;
1973new file mode &lt;mode&gt;
1974copy from &lt;path&gt;
1975copy to &lt;path&gt;
1976rename from &lt;path&gt;
1977rename to &lt;path&gt;
1978similarity index &lt;number&gt;
1979dissimilarity index &lt;number&gt;
Junio C Hamano9629d4f2012-12-19 00:28:271980index &lt;hash&gt;..&lt;hash&gt; &lt;mode&gt;</code></pre>
Junio C Hamano7ae0ab22007-11-03 02:46:461981</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591982<div class="paragraph"><p>File modes are printed as 6-digit octal numbers including the file type
Junio C Hamano7f9fa862010-10-19 23:51:141983and file permission bits.</p></div>
Junio C Hamano9629d4f2012-12-19 00:28:271984<div class="paragraph"><p>Path names in extended headers do not include the <code>a/</code> and <code>b/</code> prefixes.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591985<div class="paragraph"><p>The similarity index is the percentage of unchanged lines, and
Junio C Hamano7f9fa862010-10-19 23:51:141986the dissimilarity index is the percentage of changed lines. It
1987is a rounded down integer, followed by a percent sign. The
1988similarity index value of 100% is thus reserved for two equal
1989files, while 100% dissimilarity means that no line from the old
1990file made it into the new one.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591991<div class="paragraph"><p>The index line includes the SHA-1 checksum before and after the change.
Junio C Hamano7f9fa862010-10-19 23:51:141992The &lt;mode&gt; is included if the file mode does not change; otherwise,
1993separate lines indicate the old and the new mode.</p></div>
Junio C Hamano7ae0ab22007-11-03 02:46:461994</li>
1995<li>
1996<p>
1997TAB, LF, double quote and backslash characters in pathnames
Junio C Hamano9629d4f2012-12-19 00:28:271998 are represented as <code>\t</code>, <code>\n</code>, <code>\"</code> and <code>\\</code>, respectively.
Junio C Hamano7ae0ab22007-11-03 02:46:461999 If there is need for such substitution then the whole
2000 pathname is put in double quotes.
2001</p>
2002</li>
Junio C Hamano7f9fa862010-10-19 23:51:142003<li>
2004<p>
Junio C Hamano9629d4f2012-12-19 00:28:272005All the <code>file1</code> files in the output refer to files before the
2006 commit, and all the <code>file2</code> files refer to files after the commit.
Junio C Hamano7f9fa862010-10-19 23:51:142007 It is incorrect to apply each change to each file sequentially. For
2008 example, this patch will swap a and b:
2009</p>
2010<div class="literalblock">
2011<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272012<pre><code>diff --git a/a b/b
Junio C Hamano7f9fa862010-10-19 23:51:142013rename from a
2014rename to b
2015diff --git a/b b/a
2016rename from b
Junio C Hamano9629d4f2012-12-19 00:28:272017rename to a</code></pre>
Junio C Hamano7f9fa862010-10-19 23:51:142018</div></div>
2019</li>
Junio C Hamano0868a302008-07-22 09:20:442020</ol></div>
Junio C Hamano7ae0ab22007-11-03 02:46:462021</div>
Junio C Hamano9629d4f2012-12-19 00:28:272022</div>
2023<div class="sect1">
Junio C Hamano0868a302008-07-22 09:20:442024<h2 id="_combined_diff_format">combined diff format</h2>
Junio C Hamano7ae0ab22007-11-03 02:46:462025<div class="sectionbody">
Junio C Hamano9629d4f2012-12-19 00:28:272026<div class="paragraph"><p>Any diff-generating command can take the &#8216;-c` or <code>--cc</code> option to
Junio C Hamanoc5be4cc2011-03-09 07:20:432027produce a <em>combined diff</em> when showing a merge. This is the default
Junio C Hamanoa28a9202012-06-21 07:08:232028format when showing merges with <a href="git-diff.html">git-diff(1)</a> or
2029<a href="git-show.html">git-show(1)</a>. Note also that you can give the `-m&#8217; option to any
Junio C Hamanoc5be4cc2011-03-09 07:20:432030of these commands to force generation of diffs with individual parents
2031of a merge.</p></div>
2032<div class="paragraph"><p>A <em>combined diff</em> format looks like this:</p></div>
Junio C Hamano7ae0ab22007-11-03 02:46:462033<div class="listingblock">
2034<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272035<pre><code>diff --combined describe.c
Junio C Hamano7ae0ab22007-11-03 02:46:462036index fabadb8,cc95eb0..4866510
2037--- a/describe.c
2038+++ b/describe.c
2039@@@ -98,20 -98,12 +98,20 @@@
2040 return (a_date &gt; b_date) ? -1 : (a_date == b_date) ? 0 : 1;
2041 }
2042
2043- static void describe(char *arg)
2044 -static void describe(struct commit *cmit, int last_one)
2045++static void describe(char *arg, int last_one)
2046 {
2047 + unsigned char sha1[20];
2048 + struct commit *cmit;
2049 struct commit_list *list;
2050 static int initialized = 0;
2051 struct commit_name *n;
2052
2053 + if (get_sha1(arg, sha1) &lt; 0)
2054 + usage(describe_usage);
2055 + cmit = lookup_commit_reference(sha1);
2056 + if (!cmit)
2057 + usage(describe_usage);
2058 +
2059 if (!initialized) {
2060 initialized = 1;
Junio C Hamano9629d4f2012-12-19 00:28:272061 for_each_ref(get_name);</code></pre>
Junio C Hamano7ae0ab22007-11-03 02:46:462062</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592063<div class="olist arabic"><ol class="arabic">
Junio C Hamano7ae0ab22007-11-03 02:46:462064<li>
2065<p>
2066It is preceded with a "git diff" header, that looks like
2067 this (when <em>-c</em> option is used):
2068</p>
2069<div class="literalblock">
2070<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272071<pre><code>diff --combined file</code></pre>
Junio C Hamano7ae0ab22007-11-03 02:46:462072</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592073<div class="paragraph"><p>or like this (when <em>--cc</em> option is used):</p></div>
Junio C Hamano7ae0ab22007-11-03 02:46:462074<div class="literalblock">
2075<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272076<pre><code>diff --cc file</code></pre>
Junio C Hamano7ae0ab22007-11-03 02:46:462077</div></div>
2078</li>
2079<li>
2080<p>
2081It is followed by one or more extended header lines
2082 (this example shows a merge with two parents):
2083</p>
2084<div class="literalblock">
2085<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272086<pre><code>index &lt;hash&gt;,&lt;hash&gt;..&lt;hash&gt;
Junio C Hamano7ae0ab22007-11-03 02:46:462087mode &lt;mode&gt;,&lt;mode&gt;..&lt;mode&gt;
2088new file mode &lt;mode&gt;
Junio C Hamano9629d4f2012-12-19 00:28:272089deleted file mode &lt;mode&gt;,&lt;mode&gt;</code></pre>
Junio C Hamano7ae0ab22007-11-03 02:46:462090</div></div>
Junio C Hamano9629d4f2012-12-19 00:28:272091<div class="paragraph"><p>The <code>mode &lt;mode&gt;,&lt;mode&gt;..&lt;mode&gt;</code> line appears only if at least one of
Junio C Hamano7ae0ab22007-11-03 02:46:462092the &lt;mode&gt; is different from the rest. Extended headers with
2093information about detected contents movement (renames and
2094copying detection) are designed to work with diff of two
Junio C Hamano0868a302008-07-22 09:20:442095&lt;tree-ish&gt; and are not used by combined diff format.</p></div>
Junio C Hamano7ae0ab22007-11-03 02:46:462096</li>
2097<li>
2098<p>
2099It is followed by two-line from-file/to-file header
2100</p>
2101<div class="literalblock">
2102<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272103<pre><code>--- a/file
2104+++ b/file</code></pre>
Junio C Hamano7ae0ab22007-11-03 02:46:462105</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592106<div class="paragraph"><p>Similar to two-line header for traditional <em>unified</em> diff
Junio C Hamano9629d4f2012-12-19 00:28:272107format, <code>/dev/null</code> is used to signal created or deleted
Junio C Hamano0868a302008-07-22 09:20:442108files.</p></div>
Junio C Hamano7ae0ab22007-11-03 02:46:462109</li>
2110<li>
2111<p>
2112Chunk header format is modified to prevent people from
Junio C Hamano9629d4f2012-12-19 00:28:272113 accidentally feeding it to <code>patch -p1</code>. Combined diff format
Junio C Hamano7ae0ab22007-11-03 02:46:462114 was created for review of merge commit changes, and was not
2115 meant for apply. The change is similar to the change in the
2116 extended <em>index</em> header:
2117</p>
2118<div class="literalblock">
2119<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272120<pre><code>@@@ &lt;from-file-range&gt; &lt;from-file-range&gt; &lt;to-file-range&gt; @@@</code></pre>
Junio C Hamano7ae0ab22007-11-03 02:46:462121</div></div>
Junio C Hamano9629d4f2012-12-19 00:28:272122<div class="paragraph"><p>There are (number of parents + 1) <code>@</code> characters in the chunk
Junio C Hamano0868a302008-07-22 09:20:442123header for combined diff format.</p></div>
Junio C Hamano7ae0ab22007-11-03 02:46:462124</li>
Junio C Hamano0868a302008-07-22 09:20:442125</ol></div>
Junio C Hamano68cf15a2010-11-06 01:01:592126<div class="paragraph"><p>Unlike the traditional <em>unified</em> diff format, which shows two
Junio C Hamano9629d4f2012-12-19 00:28:272127files A and B with a single column that has <code>-</code> (minus&#8201;&#8212;&#8201;appears in A but removed in B), <code>+</code> (plus&#8201;&#8212;&#8201;missing in A but
2128added to B), or <code>" "</code> (space&#8201;&#8212;&#8201;unchanged) prefix, this format
Junio C Hamano7ae0ab22007-11-03 02:46:462129compares two or more files file1, file2,&#8230; with one file X, and
2130shows how X differs from each of fileN. One column for each of
Junio C Hamano68cf15a2010-11-06 01:01:592131fileN is prepended to the output line to note how X&#8217;s line is
Junio C Hamano0868a302008-07-22 09:20:442132different from it.</p></div>
Junio C Hamano9629d4f2012-12-19 00:28:272133<div class="paragraph"><p>A <code>-</code> character in the column N means that the line appears in
2134fileN but it does not appear in the result. A <code>+</code> character
Junio C Hamano54bf1e22008-12-20 06:30:112135in the column N means that the line appears in the result,
Junio C Hamano7ae0ab22007-11-03 02:46:462136and fileN does not have that line (in other words, the line was
Junio C Hamano0868a302008-07-22 09:20:442137added, from the point of view of that parent).</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592138<div class="paragraph"><p>In the above example output, the function signature was changed
Junio C Hamano9629d4f2012-12-19 00:28:272139from both files (hence two <code>-</code> removals from both file1 and
2140file2, plus <code>++</code> to mean one line that was added does not appear
Junio C Hamano54bf1e22008-12-20 06:30:112141in either file1 nor file2). Also eight other lines are the same
Junio C Hamano9629d4f2012-12-19 00:28:272142from file1 but do not appear in file2 (hence prefixed with <code>+</code>).</p></div>
2143<div class="paragraph"><p>When shown by <code>git diff-tree -c</code>, it compares the parents of a
Junio C Hamano7ae0ab22007-11-03 02:46:462144merge commit with the merge result (i.e. file1..fileN are the
Junio C Hamano9629d4f2012-12-19 00:28:272145parents). When shown by <code>git diff-files -c</code>, it compares the
Junio C Hamano7ae0ab22007-11-03 02:46:462146two unresolved merge parents with the working tree file
2147(i.e. file1 is stage 2 aka "our version", file2 is stage 3 aka
Junio C Hamano0868a302008-07-22 09:20:442148"their version").</p></div>
Junio C Hamano7ae0ab22007-11-03 02:46:462149</div>
Junio C Hamano9629d4f2012-12-19 00:28:272150</div>
2151<div class="sect1">
Junio C Hamano0868a302008-07-22 09:20:442152<h2 id="_other_diff_formats">other diff formats</h2>
Junio C Hamano3a702342007-12-12 21:34:022153<div class="sectionbody">
Junio C Hamano9629d4f2012-12-19 00:28:272154<div class="paragraph"><p>The <code>--summary</code> option describes newly added, deleted, renamed and
2155copied files. The <code>--stat</code> option adds diffstat(1) graph to the
Junio C Hamano3a702342007-12-12 21:34:022156output. These options can be combined with other options, such as
Junio C Hamano9629d4f2012-12-19 00:28:272157<code>-p</code>, and are meant for human consumption.</p></div>
2158<div class="paragraph"><p>When showing a change that involves a rename or a copy, <code>--stat</code> output
Junio C Hamano3a702342007-12-12 21:34:022159formats the pathnames compactly by combining common prefix and suffix of
Junio C Hamano9629d4f2012-12-19 00:28:272160the pathnames. For example, a change that moves <code>arch/i386/Makefile</code> to
2161<code>arch/x86/Makefile</code> while modifying 4 lines will be shown like this:</p></div>
Junio C Hamano3a702342007-12-12 21:34:022162<div class="listingblock">
2163<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272164<pre><code>arch/{i386 =&gt; x86}/Makefile | 4 +--</code></pre>
Junio C Hamano3a702342007-12-12 21:34:022165</div></div>
Junio C Hamano9629d4f2012-12-19 00:28:272166<div class="paragraph"><p>The <code>--numstat</code> option gives the diffstat(1) information but is designed
2167for easier machine consumption. An entry in <code>--numstat</code> output looks
Junio C Hamano0868a302008-07-22 09:20:442168like this:</p></div>
Junio C Hamano3a702342007-12-12 21:34:022169<div class="listingblock">
2170<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272171<pre><code>1 2 README
21723 1 arch/{i386 =&gt; x86}/Makefile</code></pre>
Junio C Hamano3a702342007-12-12 21:34:022173</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592174<div class="paragraph"><p>That is, from left to right:</p></div>
2175<div class="olist arabic"><ol class="arabic">
Junio C Hamano3a702342007-12-12 21:34:022176<li>
2177<p>
2178the number of added lines;
2179</p>
2180</li>
2181<li>
2182<p>
2183a tab;
2184</p>
2185</li>
2186<li>
2187<p>
2188the number of deleted lines;
2189</p>
2190</li>
2191<li>
2192<p>
2193a tab;
2194</p>
2195</li>
2196<li>
2197<p>
2198pathname (possibly with rename/copy information);
2199</p>
2200</li>
2201<li>
2202<p>
2203a newline.
2204</p>
2205</li>
Junio C Hamano0868a302008-07-22 09:20:442206</ol></div>
Junio C Hamano9629d4f2012-12-19 00:28:272207<div class="paragraph"><p>When <code>-z</code> output option is in effect, the output is formatted this way:</p></div>
Junio C Hamano3a702342007-12-12 21:34:022208<div class="listingblock">
2209<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272210<pre><code>1 2 README NUL
22113 1 NUL arch/i386/Makefile NUL arch/x86/Makefile NUL</code></pre>
Junio C Hamano3a702342007-12-12 21:34:022212</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592213<div class="paragraph"><p>That is:</p></div>
2214<div class="olist arabic"><ol class="arabic">
Junio C Hamano3a702342007-12-12 21:34:022215<li>
2216<p>
2217the number of added lines;
2218</p>
2219</li>
2220<li>
2221<p>
2222a tab;
2223</p>
2224</li>
2225<li>
2226<p>
2227the number of deleted lines;
2228</p>
2229</li>
2230<li>
2231<p>
2232a tab;
2233</p>
2234</li>
2235<li>
2236<p>
2237a NUL (only exists if renamed/copied);
2238</p>
2239</li>
2240<li>
2241<p>
2242pathname in preimage;
2243</p>
2244</li>
2245<li>
2246<p>
2247a NUL (only exists if renamed/copied);
2248</p>
2249</li>
2250<li>
2251<p>
2252pathname in postimage (only exists if renamed/copied);
2253</p>
2254</li>
2255<li>
2256<p>
2257a NUL.
2258</p>
2259</li>
Junio C Hamano0868a302008-07-22 09:20:442260</ol></div>
Junio C Hamano9629d4f2012-12-19 00:28:272261<div class="paragraph"><p>The extra <code>NUL</code> before the preimage path in renamed case is to allow
Junio C Hamano3a702342007-12-12 21:34:022262scripts that read the output to tell if the current record being read is
2263a single-path record or a rename/copy record without reading ahead.
Junio C Hamano9629d4f2012-12-19 00:28:272264After reading added and deleted lines, reading up to <code>NUL</code> would yield
2265the pathname, but if that is <code>NUL</code>, the record will show two paths.</p></div>
Junio C Hamano3a702342007-12-12 21:34:022266</div>
Junio C Hamano9629d4f2012-12-19 00:28:272267</div>
2268<div class="sect1">
Junio C Hamano0868a302008-07-22 09:20:442269<h2 id="_examples">EXAMPLES</h2>
Junio C Hamano1a4e8412005-12-27 08:17:232270<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:592271<div class="dlist"><dl>
2272<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:232273Various ways to check your working tree
2274</dt>
2275<dd>
2276<div class="listingblock">
2277<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272278<pre><code>$ git diff <b>&lt;1&gt;</b>
Junio C Hamano68cf15a2010-11-06 01:01:592279$ git diff --cached <b>&lt;2&gt;</b>
Junio C Hamano9629d4f2012-12-19 00:28:272280$ git diff HEAD <b>&lt;3&gt;</b></code></pre>
Junio C Hamano1a4e8412005-12-27 08:17:232281</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592282<div class="colist arabic"><ol>
Junio C Hamanoc8d88c22006-04-29 07:02:012283<li>
2284<p>
Junio C Hamano092f5f02007-08-02 07:23:382285Changes in the working tree not yet staged for the next commit.
Junio C Hamanoc8d88c22006-04-29 07:02:012286</p>
2287</li>
2288<li>
2289<p>
Junio C Hamano092f5f02007-08-02 07:23:382290Changes between the index and your last commit; what you
Junio C Hamanoc8d88c22006-04-29 07:02:012291would be committing if you run "git commit" without "-a" option.
2292</p>
2293</li>
2294<li>
2295<p>
Junio C Hamano092f5f02007-08-02 07:23:382296Changes in the working tree since your last commit; what you
Junio C Hamanoc8d88c22006-04-29 07:02:012297would be committing if you run "git commit -a"
2298</p>
2299</li>
Junio C Hamano0868a302008-07-22 09:20:442300</ol></div>
Junio C Hamano1a4e8412005-12-27 08:17:232301</dd>
Junio C Hamano68cf15a2010-11-06 01:01:592302<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:232303Comparing with arbitrary commits
2304</dt>
2305<dd>
2306<div class="listingblock">
2307<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272308<pre><code>$ git diff test <b>&lt;1&gt;</b>
Junio C Hamano68cf15a2010-11-06 01:01:592309$ git diff HEAD -- ./test <b>&lt;2&gt;</b>
Junio C Hamano9629d4f2012-12-19 00:28:272310$ git diff HEAD^ HEAD <b>&lt;3&gt;</b></code></pre>
Junio C Hamanoc8d88c22006-04-29 07:02:012311</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592312<div class="colist arabic"><ol>
Junio C Hamanoc8d88c22006-04-29 07:02:012313<li>
2314<p>
Junio C Hamano092f5f02007-08-02 07:23:382315Instead of using the tip of the current branch, compare with the
Junio C Hamano1a4e8412005-12-27 08:17:232316tip of "test" branch.
Junio C Hamanoc8d88c22006-04-29 07:02:012317</p>
2318</li>
2319<li>
2320<p>
Junio C Hamano092f5f02007-08-02 07:23:382321Instead of comparing with the tip of "test" branch, compare with
Junio C Hamano235a91e2006-01-07 01:13:582322the tip of the current branch, but limit the comparison to the
Junio C Hamano1a4e8412005-12-27 08:17:232323file "test".
Junio C Hamanoc8d88c22006-04-29 07:02:012324</p>
2325</li>
2326<li>
2327<p>
Junio C Hamano092f5f02007-08-02 07:23:382328Compare the version before the last commit and the last commit.
Junio C Hamanoc8d88c22006-04-29 07:02:012329</p>
2330</li>
Junio C Hamano0868a302008-07-22 09:20:442331</ol></div>
Junio C Hamano1a4e8412005-12-27 08:17:232332</dd>
Junio C Hamano68cf15a2010-11-06 01:01:592333<dt class="hdlist1">
Junio C Hamanoc435b1c2007-08-28 06:25:352334Comparing branches
2335</dt>
2336<dd>
2337<div class="listingblock">
2338<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272339<pre><code>$ git diff topic master <b>&lt;1&gt;</b>
Junio C Hamano68cf15a2010-11-06 01:01:592340$ git diff topic..master <b>&lt;2&gt;</b>
Junio C Hamano9629d4f2012-12-19 00:28:272341$ git diff topic...master <b>&lt;3&gt;</b></code></pre>
Junio C Hamanoc435b1c2007-08-28 06:25:352342</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592343<div class="colist arabic"><ol>
Junio C Hamanoc435b1c2007-08-28 06:25:352344<li>
2345<p>
2346Changes between the tips of the topic and the master branches.
2347</p>
2348</li>
2349<li>
2350<p>
2351Same as above.
2352</p>
2353</li>
2354<li>
2355<p>
Junio C Hamano764a6672007-10-23 01:23:312356Changes that occurred on the master branch since when the topic
Junio C Hamanoc435b1c2007-08-28 06:25:352357branch was started off it.
2358</p>
2359</li>
Junio C Hamano0868a302008-07-22 09:20:442360</ol></div>
Junio C Hamanoc435b1c2007-08-28 06:25:352361</dd>
Junio C Hamano68cf15a2010-11-06 01:01:592362<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:232363Limiting the diff output
2364</dt>
2365<dd>
2366<div class="listingblock">
2367<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272368<pre><code>$ git diff --diff-filter=MRC <b>&lt;1&gt;</b>
Junio C Hamano68cf15a2010-11-06 01:01:592369$ git diff --name-status <b>&lt;2&gt;</b>
Junio C Hamano9629d4f2012-12-19 00:28:272370$ git diff arch/i386 include/asm-i386 <b>&lt;3&gt;</b></code></pre>
Junio C Hamanoc8d88c22006-04-29 07:02:012371</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592372<div class="colist arabic"><ol>
Junio C Hamanoc8d88c22006-04-29 07:02:012373<li>
2374<p>
Junio C Hamano092f5f02007-08-02 07:23:382375Show only modification, rename and copy, but not addition
Junio C Hamano1a4e8412005-12-27 08:17:232376nor deletion.
Junio C Hamanoc8d88c22006-04-29 07:02:012377</p>
2378</li>
2379<li>
2380<p>
Junio C Hamano092f5f02007-08-02 07:23:382381Show only names and the nature of change, but not actual
Junio C Hamanobdeff822007-07-30 09:07:172382diff output.
Junio C Hamanoc8d88c22006-04-29 07:02:012383</p>
2384</li>
2385<li>
2386<p>
Junio C Hamano092f5f02007-08-02 07:23:382387Limit diff output to named subtrees.
Junio C Hamanoc8d88c22006-04-29 07:02:012388</p>
2389</li>
Junio C Hamano0868a302008-07-22 09:20:442390</ol></div>
Junio C Hamano1a4e8412005-12-27 08:17:232391</dd>
Junio C Hamano68cf15a2010-11-06 01:01:592392<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:232393Munging the diff output
2394</dt>
2395<dd>
2396<div class="listingblock">
2397<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272398<pre><code>$ git diff --find-copies-harder -B -C <b>&lt;1&gt;</b>
2399$ git diff -R <b>&lt;2&gt;</b></code></pre>
Junio C Hamano1a4e8412005-12-27 08:17:232400</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592401<div class="colist arabic"><ol>
Junio C Hamanoc8d88c22006-04-29 07:02:012402<li>
2403<p>
Junio C Hamano092f5f02007-08-02 07:23:382404Spend extra cycles to find renames, copies and complete
Junio C Hamanoc8d88c22006-04-29 07:02:012405rewrites (very expensive).
2406</p>
2407</li>
2408<li>
2409<p>
Junio C Hamano092f5f02007-08-02 07:23:382410Output diff in reverse.
Junio C Hamanoc8d88c22006-04-29 07:02:012411</p>
2412</li>
Junio C Hamano0868a302008-07-22 09:20:442413</ol></div>
Junio C Hamano1a4e8412005-12-27 08:17:232414</dd>
Junio C Hamano0868a302008-07-22 09:20:442415</dl></div>
Junio C Hamano1a4e8412005-12-27 08:17:232416</div>
Junio C Hamano9629d4f2012-12-19 00:28:272417</div>
2418<div class="sect1">
Junio C Hamanoa9701f02010-01-21 00:42:162419<h2 id="_see_also">SEE ALSO</h2>
2420<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:592421<div class="paragraph"><p>diff(1),
Junio C Hamanoa28a9202012-06-21 07:08:232422<a href="git-difftool.html">git-difftool(1)</a>,
2423<a href="git-log.html">git-log(1)</a>,
2424<a href="gitdiffcore.html">gitdiffcore(7)</a>,
2425<a href="git-format-patch.html">git-format-patch(1)</a>,
2426<a href="git-apply.html">git-apply(1)</a></p></div>
Junio C Hamanoa9701f02010-01-21 00:42:162427</div>
Junio C Hamano9629d4f2012-12-19 00:28:272428</div>
2429<div class="sect1">
Junio C Hamano0868a302008-07-22 09:20:442430<h2 id="_git">GIT</h2>
Junio C Hamano1a4e8412005-12-27 08:17:232431<div class="sectionbody">
Junio C Hamanoa28a9202012-06-21 07:08:232432<div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232433</div>
Junio C Hamano7bd050f2011-09-22 06:32:222434</div>
Junio C Hamano9629d4f2012-12-19 00:28:272435</div>
Junio C Hamano7bd050f2011-09-22 06:32:222436<div id="footnotes"><hr /></div>
Junio C Hamano1a4e8412005-12-27 08:17:232437<div id="footer">
2438<div id="footer-text">
Junio C Hamano076ffcc2013-02-06 05:13:212439Last updated 2013-02-05 21:07:26 PST
Junio C Hamano1a4e8412005-12-27 08:17:232440</div>
2441</div>
2442</body>
2443</html>