blob: fec853d9f53ec6c4189a2f8077c4598f142fd8a4 [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-files(1)</title>
Junio C Hamano1a4e8412005-12-27 08:17:238<style type="text/css">
Junio C Hamano9629d4f2012-12-19 00:28:279/* Shared CSS for AsciiDoc xhtml11 and html5 backends */
10
11/* Default font. */
12body {
13 font-family: Georgia,serif;
14}
15
16/* Title font. */
17h1, h2, h3, h4, h5, h6,
18div.title, caption.title,
19thead, p.table.header,
20#toctitle,
21#author, #revnumber, #revdate, #revremark,
22#footer {
23 font-family: Arial,Helvetica,sans-serif;
Junio C Hamano1a4e8412005-12-27 08:17:2324}
25
26body {
27 margin: 1em 5% 1em 5%;
28}
29
Junio C Hamanoba4b9282008-07-06 05:20:3130a {
31 color: blue;
32 text-decoration: underline;
33}
34a:visited {
35 color: fuchsia;
36}
Junio C Hamano1a4e8412005-12-27 08:17:2337
38em {
39 font-style: italic;
Junio C Hamano68cf15a2010-11-06 01:01:5940 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:2341}
42
43strong {
44 font-weight: bold;
Junio C Hamano68cf15a2010-11-06 01:01:5945 color: #083194;
Junio C Hamano1a4e8412005-12-27 08:17:2346}
47
Junio C Hamano1a4e8412005-12-27 08:17:2348h1, h2, h3, h4, h5, h6 {
49 color: #527bbd;
Junio C Hamano1a4e8412005-12-27 08:17:2350 margin-top: 1.2em;
51 margin-bottom: 0.5em;
52 line-height: 1.3;
53}
54
Junio C Hamanoba4b9282008-07-06 05:20:3155h1, h2, h3 {
Junio C Hamano1a4e8412005-12-27 08:17:2356 border-bottom: 2px solid silver;
57}
58h2 {
Junio C Hamano1a4e8412005-12-27 08:17:2359 padding-top: 0.5em;
60}
Junio C Hamanoba4b9282008-07-06 05:20:3161h3 {
62 float: left;
63}
64h3 + * {
65 clear: left;
66}
Junio C Hamano9629d4f2012-12-19 00:28:2767h5 {
68 font-size: 1.0em;
69}
Junio C Hamano1a4e8412005-12-27 08:17:2370
71div.sectionbody {
Junio C Hamano1a4e8412005-12-27 08:17:2372 margin-left: 0;
73}
74
75hr {
76 border: 1px solid silver;
77}
78
79p {
80 margin-top: 0.5em;
81 margin-bottom: 0.5em;
82}
83
Junio C Hamano68cf15a2010-11-06 01:01:5984ul, ol, li > p {
85 margin-top: 0;
86}
Junio C Hamano9629d4f2012-12-19 00:28:2787ul > li { color: #aaa; }
88ul > li > * { color: black; }
Junio C Hamano68cf15a2010-11-06 01:01:5989
Junio C Hamano9629d4f2012-12-19 00:28:2790.monospaced, code, pre {
91 font-family: "Courier New", Courier, monospace;
92 font-size: inherit;
93 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:2394 padding: 0;
95 margin: 0;
96}
97
Junio C Hamano9629d4f2012-12-19 00:28:2798
99#author {
Junio C Hamano1a4e8412005-12-27 08:17:23100 color: #527bbd;
Junio C Hamano1a4e8412005-12-27 08:17:23101 font-weight: bold;
Junio C Hamanoba4b9282008-07-06 05:20:31102 font-size: 1.1em;
Junio C Hamano1a4e8412005-12-27 08:17:23103}
Junio C Hamano9629d4f2012-12-19 00:28:27104#email {
Junio C Hamano1a4e8412005-12-27 08:17:23105}
Junio C Hamano9629d4f2012-12-19 00:28:27106#revnumber, #revdate, #revremark {
Junio C Hamano1a4e8412005-12-27 08:17:23107}
108
Junio C Hamano9629d4f2012-12-19 00:28:27109#footer {
Junio C Hamano1a4e8412005-12-27 08:17:23110 font-size: small;
111 border-top: 2px solid silver;
112 padding-top: 0.5em;
113 margin-top: 4.0em;
114}
Junio C Hamano9629d4f2012-12-19 00:28:27115#footer-text {
Junio C Hamano1a4e8412005-12-27 08:17:23116 float: left;
117 padding-bottom: 0.5em;
118}
Junio C Hamano9629d4f2012-12-19 00:28:27119#footer-badges {
Junio C Hamano1a4e8412005-12-27 08:17:23120 float: right;
121 padding-bottom: 0.5em;
122}
123
Junio C Hamano9629d4f2012-12-19 00:28:27124#preamble {
Junio C Hamano68cf15a2010-11-06 01:01:59125 margin-top: 1.5em;
126 margin-bottom: 1.5em;
127}
Junio C Hamano9629d4f2012-12-19 00:28:27128div.imageblock, div.exampleblock, div.verseblock,
Junio C Hamano1a4e8412005-12-27 08:17:23129div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
130div.admonitionblock {
Junio C Hamano7bd050f2011-09-22 06:32:22131 margin-top: 1.0em;
Junio C Hamano1a4e8412005-12-27 08:17:23132 margin-bottom: 1.5em;
133}
134div.admonitionblock {
Junio C Hamano7bd050f2011-09-22 06:32:22135 margin-top: 2.0em;
136 margin-bottom: 2.0em;
137 margin-right: 10%;
138 color: #606060;
Junio C Hamano1a4e8412005-12-27 08:17:23139}
140
141div.content { /* Block element content. */
142 padding: 0;
143}
144
145/* Block element titles. */
146div.title, caption.title {
Junio C Hamano68cf15a2010-11-06 01:01:59147 color: #527bbd;
Junio C Hamano1a4e8412005-12-27 08:17:23148 font-weight: bold;
149 text-align: left;
150 margin-top: 1.0em;
151 margin-bottom: 0.5em;
152}
153div.title + * {
154 margin-top: 0;
155}
156
157td div.title:first-child {
158 margin-top: 0.0em;
159}
160div.content div.title:first-child {
161 margin-top: 0.0em;
162}
163div.content + div.title {
164 margin-top: 0.0em;
165}
166
167div.sidebarblock > div.content {
168 background: #ffffee;
Junio C Hamano9629d4f2012-12-19 00:28:27169 border: 1px solid #dddddd;
170 border-left: 4px solid #f0f0f0;
Junio C Hamano1a4e8412005-12-27 08:17:23171 padding: 0.5em;
172}
173
174div.listingblock > div.content {
Junio C Hamano9629d4f2012-12-19 00:28:27175 border: 1px solid #dddddd;
176 border-left: 5px solid #f0f0f0;
177 background: #f8f8f8;
Junio C Hamano1a4e8412005-12-27 08:17:23178 padding: 0.5em;
179}
180
Junio C Hamano7bd050f2011-09-22 06:32:22181div.quoteblock, div.verseblock {
182 padding-left: 1.0em;
183 margin-left: 1.0em;
Junio C Hamano68cf15a2010-11-06 01:01:59184 margin-right: 10%;
Junio C Hamano9629d4f2012-12-19 00:28:27185 border-left: 5px solid #f0f0f0;
186 color: #888;
Junio C Hamano1a4e8412005-12-27 08:17:23187}
Junio C Hamano7bd050f2011-09-22 06:32:22188
Junio C Hamano68cf15a2010-11-06 01:01:59189div.quoteblock > div.attribution {
190 padding-top: 0.5em;
Junio C Hamano1a4e8412005-12-27 08:17:23191 text-align: right;
192}
Junio C Hamano68cf15a2010-11-06 01:01:59193
Junio C Hamano9629d4f2012-12-19 00:28:27194div.verseblock > pre.content {
195 font-family: inherit;
196 font-size: inherit;
Junio C Hamano68cf15a2010-11-06 01:01:59197}
198div.verseblock > div.attribution {
199 padding-top: 0.75em;
200 text-align: left;
201}
202/* DEPRECATED: Pre version 8.2.7 verse style literal block. */
Junio C Hamanoba4b9282008-07-06 05:20:31203div.verseblock + div.attribution {
204 text-align: left;
205}
Junio C Hamano1a4e8412005-12-27 08:17:23206
207div.admonitionblock .icon {
208 vertical-align: top;
209 font-size: 1.1em;
210 font-weight: bold;
211 text-decoration: underline;
212 color: #527bbd;
213 padding-right: 0.5em;
214}
215div.admonitionblock td.content {
216 padding-left: 0.5em;
Junio C Hamano7bd050f2011-09-22 06:32:22217 border-left: 3px solid #dddddd;
Junio C Hamano1a4e8412005-12-27 08:17:23218}
219
220div.exampleblock > div.content {
Junio C Hamano7bd050f2011-09-22 06:32:22221 border-left: 3px solid #dddddd;
222 padding-left: 0.5em;
Junio C Hamano1a4e8412005-12-27 08:17:23223}
224
Junio C Hamano1a4e8412005-12-27 08:17:23225div.imageblock div.content { padding-left: 0; }
Junio C Hamano1a4e8412005-12-27 08:17:23226span.image img { border-style: none; }
Junio C Hamano68cf15a2010-11-06 01:01:59227a.image:visited { color: white; }
Junio C Hamano1a4e8412005-12-27 08:17:23228
229dl {
230 margin-top: 0.8em;
231 margin-bottom: 0.8em;
232}
233dt {
234 margin-top: 0.5em;
235 margin-bottom: 0;
Junio C Hamano68cf15a2010-11-06 01:01:59236 font-style: normal;
237 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:23238}
239dd > *:first-child {
Junio C Hamano68cf15a2010-11-06 01:01:59240 margin-top: 0.1em;
Junio C Hamano1a4e8412005-12-27 08:17:23241}
242
243ul, ol {
244 list-style-position: outside;
245}
Junio C Hamano68cf15a2010-11-06 01:01:59246ol.arabic {
247 list-style-type: decimal;
248}
249ol.loweralpha {
Junio C Hamano1a4e8412005-12-27 08:17:23250 list-style-type: lower-alpha;
251}
Junio C Hamano68cf15a2010-11-06 01:01:59252ol.upperalpha {
253 list-style-type: upper-alpha;
254}
255ol.lowerroman {
256 list-style-type: lower-roman;
257}
258ol.upperroman {
259 list-style-type: upper-roman;
260}
261
262div.compact ul, div.compact ol,
263div.compact p, div.compact p,
264div.compact div, div.compact div {
265 margin-top: 0.1em;
266 margin-bottom: 0.1em;
267}
Junio C Hamano1a4e8412005-12-27 08:17:23268
Junio C Hamano1a4e8412005-12-27 08:17:23269tfoot {
270 font-weight: bold;
271}
Junio C Hamano68cf15a2010-11-06 01:01:59272td > div.verse {
273 white-space: pre;
274}
Junio C Hamano68cf15a2010-11-06 01:01:59275
276div.hdlist {
Junio C Hamano1a4e8412005-12-27 08:17:23277 margin-top: 0.8em;
278 margin-bottom: 0.8em;
279}
Junio C Hamano68cf15a2010-11-06 01:01:59280div.hdlist tr {
281 padding-bottom: 15px;
Junio C Hamanoba4b9282008-07-06 05:20:31282}
Junio C Hamano68cf15a2010-11-06 01:01:59283dt.hdlist1.strong, td.hdlist1.strong {
284 font-weight: bold;
285}
286td.hdlist1 {
Junio C Hamano1a4e8412005-12-27 08:17:23287 vertical-align: top;
Junio C Hamano68cf15a2010-11-06 01:01:59288 font-style: normal;
Junio C Hamano1a4e8412005-12-27 08:17:23289 padding-right: 0.8em;
Junio C Hamano68cf15a2010-11-06 01:01:59290 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:23291}
Junio C Hamano68cf15a2010-11-06 01:01:59292td.hdlist2 {
Junio C Hamano1a4e8412005-12-27 08:17:23293 vertical-align: top;
294}
Junio C Hamano68cf15a2010-11-06 01:01:59295div.hdlist.compact tr {
296 margin: 0;
297 padding-bottom: 0;
298}
299
300.comment {
301 background: yellow;
302}
Junio C Hamano1a4e8412005-12-27 08:17:23303
Junio C Hamano7bd050f2011-09-22 06:32:22304.footnote, .footnoteref {
305 font-size: 0.8em;
306}
307
308span.footnote, span.footnoteref {
309 vertical-align: super;
310}
311
312#footnotes {
313 margin: 20px 0 20px 0;
314 padding: 7px 0 0 0;
315}
316
317#footnotes div.footnote {
318 margin: 0 0 5px 0;
319}
320
321#footnotes hr {
322 border: none;
323 border-top: 1px solid silver;
324 height: 1px;
325 text-align: left;
326 margin-left: 0;
327 width: 20%;
328 min-width: 100px;
329}
330
Junio C Hamano9629d4f2012-12-19 00:28:27331div.colist td {
332 padding-right: 0.5em;
333 padding-bottom: 0.3em;
334 vertical-align: top;
335}
336div.colist td img {
337 margin-top: 0.3em;
Junio C Hamano1a4e8412005-12-27 08:17:23338}
Junio C Hamanoba4b9282008-07-06 05:20:31339
Junio C Hamano9629d4f2012-12-19 00:28:27340@media print {
341 #footer-badges { display: none; }
342}
343
344#toc {
Junio C Hamano7bd050f2011-09-22 06:32:22345 margin-bottom: 2.5em;
346}
347
Junio C Hamano9629d4f2012-12-19 00:28:27348#toctitle {
Junio C Hamanoba4b9282008-07-06 05:20:31349 color: #527bbd;
Junio C Hamanoba4b9282008-07-06 05:20:31350 font-size: 1.1em;
351 font-weight: bold;
352 margin-top: 1.0em;
353 margin-bottom: 0.1em;
354}
355
Junio C Hamano9629d4f2012-12-19 00:28:27356div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
Junio C Hamanoba4b9282008-07-06 05:20:31357 margin-top: 0;
358 margin-bottom: 0;
359}
360div.toclevel2 {
361 margin-left: 2em;
362 font-size: 0.9em;
363}
364div.toclevel3 {
365 margin-left: 4em;
366 font-size: 0.9em;
367}
368div.toclevel4 {
369 margin-left: 6em;
370 font-size: 0.9em;
371}
Junio C Hamano9629d4f2012-12-19 00:28:27372
373span.aqua { color: aqua; }
374span.black { color: black; }
375span.blue { color: blue; }
376span.fuchsia { color: fuchsia; }
377span.gray { color: gray; }
378span.green { color: green; }
379span.lime { color: lime; }
380span.maroon { color: maroon; }
381span.navy { color: navy; }
382span.olive { color: olive; }
383span.purple { color: purple; }
384span.red { color: red; }
385span.silver { color: silver; }
386span.teal { color: teal; }
387span.white { color: white; }
388span.yellow { color: yellow; }
389
390span.aqua-background { background: aqua; }
391span.black-background { background: black; }
392span.blue-background { background: blue; }
393span.fuchsia-background { background: fuchsia; }
394span.gray-background { background: gray; }
395span.green-background { background: green; }
396span.lime-background { background: lime; }
397span.maroon-background { background: maroon; }
398span.navy-background { background: navy; }
399span.olive-background { background: olive; }
400span.purple-background { background: purple; }
401span.red-background { background: red; }
402span.silver-background { background: silver; }
403span.teal-background { background: teal; }
404span.white-background { background: white; }
405span.yellow-background { background: yellow; }
406
407span.big { font-size: 2em; }
408span.small { font-size: 0.6em; }
409
410span.underline { text-decoration: underline; }
411span.overline { text-decoration: overline; }
412span.line-through { text-decoration: line-through; }
413
414div.unbreakable { page-break-inside: avoid; }
415
416
417/*
418 * xhtml11 specific
419 *
420 * */
421
422div.tableblock {
423 margin-top: 1.0em;
424 margin-bottom: 1.5em;
425}
426div.tableblock > table {
427 border: 3px solid #527bbd;
428}
429thead, p.table.header {
430 font-weight: bold;
431 color: #527bbd;
432}
433p.table {
434 margin-top: 0;
435}
436/* Because the table frame attribute is overriden by CSS in most browsers. */
437div.tableblock > table[frame="void"] {
438 border-style: none;
439}
440div.tableblock > table[frame="hsides"] {
441 border-left-style: none;
442 border-right-style: none;
443}
444div.tableblock > table[frame="vsides"] {
445 border-top-style: none;
446 border-bottom-style: none;
447}
448
449
450/*
451 * html5 specific
452 *
453 * */
454
455table.tableblock {
456 margin-top: 1.0em;
457 margin-bottom: 1.5em;
458}
459thead, p.tableblock.header {
460 font-weight: bold;
461 color: #527bbd;
462}
463p.tableblock {
464 margin-top: 0;
465}
466table.tableblock {
467 border-width: 3px;
468 border-spacing: 0px;
469 border-style: solid;
470 border-color: #527bbd;
471 border-collapse: collapse;
472}
473th.tableblock, td.tableblock {
474 border-width: 1px;
475 padding: 4px;
476 border-style: solid;
477 border-color: #527bbd;
478}
479
480table.tableblock.frame-topbot {
481 border-left-style: hidden;
482 border-right-style: hidden;
483}
484table.tableblock.frame-sides {
485 border-top-style: hidden;
486 border-bottom-style: hidden;
487}
488table.tableblock.frame-none {
489 border-style: hidden;
490}
491
492th.tableblock.halign-left, td.tableblock.halign-left {
493 text-align: left;
494}
495th.tableblock.halign-center, td.tableblock.halign-center {
496 text-align: center;
497}
498th.tableblock.halign-right, td.tableblock.halign-right {
499 text-align: right;
500}
501
502th.tableblock.valign-top, td.tableblock.valign-top {
503 vertical-align: top;
504}
505th.tableblock.valign-middle, td.tableblock.valign-middle {
506 vertical-align: middle;
507}
508th.tableblock.valign-bottom, td.tableblock.valign-bottom {
509 vertical-align: bottom;
510}
511
512
513/*
514 * manpage specific
515 *
516 * */
517
518body.manpage h1 {
Junio C Hamano68cf15a2010-11-06 01:01:59519 padding-top: 0.5em;
520 padding-bottom: 0.5em;
521 border-top: 2px solid silver;
522 border-bottom: 2px solid silver;
523}
Junio C Hamano9629d4f2012-12-19 00:28:27524body.manpage h2 {
Junio C Hamano68cf15a2010-11-06 01:01:59525 border-style: none;
526}
Junio C Hamano9629d4f2012-12-19 00:28:27527body.manpage div.sectionbody {
528 margin-left: 3em;
Junio C Hamano68cf15a2010-11-06 01:01:59529}
530
531@media print {
Junio C Hamano9629d4f2012-12-19 00:28:27532 body.manpage div#toc { display: none; }
Junio C Hamano68cf15a2010-11-06 01:01:59533}
534
Junio C Hamano1a4e8412005-12-27 08:17:23535
Junio C Hamano1a4e8412005-12-27 08:17:23536</style>
Junio C Hamano7bd050f2011-09-22 06:32:22537<script type="text/javascript">
538/*<![CDATA[*/
Junio C Hamano7bd050f2011-09-22 06:32:22539var asciidoc = { // Namespace.
540
541/////////////////////////////////////////////////////////////////////
542// Table Of Contents generator
543/////////////////////////////////////////////////////////////////////
544
545/* Author: Mihai Bazon, September 2002
546 * http://students.infoiasi.ro/~mishoo
547 *
548 * Table Of Content generator
549 * Version: 0.4
550 *
551 * Feel free to use this script under the terms of the GNU General Public
552 * License, as long as you do not remove or alter this notice.
553 */
554
555 /* modified by Troy D. Hanson, September 2006. License: GPL */
556 /* modified by Stuart Rackham, 2006, 2009. License: GPL */
557
558// toclevels = 1..4.
559toc: function (toclevels) {
560
561 function getText(el) {
562 var text = "";
563 for (var i = el.firstChild; i != null; i = i.nextSibling) {
564 if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
565 text += i.data;
566 else if (i.firstChild != null)
567 text += getText(i);
568 }
569 return text;
570 }
571
572 function TocEntry(el, text, toclevel) {
573 this.element = el;
574 this.text = text;
575 this.toclevel = toclevel;
576 }
577
578 function tocEntries(el, toclevels) {
579 var result = new Array;
Junio C Hamano9629d4f2012-12-19 00:28:27580 var re = new RegExp('[hH]([1-'+(toclevels+1)+'])');
Junio C Hamano7bd050f2011-09-22 06:32:22581 // Function that scans the DOM tree for header elements (the DOM2
582 // nodeIterator API would be a better technique but not supported by all
583 // browsers).
584 var iterate = function (el) {
585 for (var i = el.firstChild; i != null; i = i.nextSibling) {
586 if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
587 var mo = re.exec(i.tagName);
588 if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
589 result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
590 }
591 iterate(i);
592 }
593 }
594 }
595 iterate(el);
596 return result;
597 }
598
599 var toc = document.getElementById("toc");
Junio C Hamano9629d4f2012-12-19 00:28:27600 if (!toc) {
601 return;
602 }
603
604 // Delete existing TOC entries in case we're reloading the TOC.
605 var tocEntriesToRemove = [];
606 var i;
607 for (i = 0; i < toc.childNodes.length; i++) {
608 var entry = toc.childNodes[i];
609 if (entry.nodeName.toLowerCase() == 'div'
610 && entry.getAttribute("class")
611 && entry.getAttribute("class").match(/^toclevel/))
612 tocEntriesToRemove.push(entry);
613 }
614 for (i = 0; i < tocEntriesToRemove.length; i++) {
615 toc.removeChild(tocEntriesToRemove[i]);
616 }
617
618 // Rebuild TOC entries.
Junio C Hamano7bd050f2011-09-22 06:32:22619 var entries = tocEntries(document.getElementById("content"), toclevels);
620 for (var i = 0; i < entries.length; ++i) {
621 var entry = entries[i];
622 if (entry.element.id == "")
623 entry.element.id = "_toc_" + i;
624 var a = document.createElement("a");
625 a.href = "#" + entry.element.id;
626 a.appendChild(document.createTextNode(entry.text));
627 var div = document.createElement("div");
628 div.appendChild(a);
629 div.className = "toclevel" + entry.toclevel;
630 toc.appendChild(div);
631 }
632 if (entries.length == 0)
633 toc.parentNode.removeChild(toc);
634},
635
636
637/////////////////////////////////////////////////////////////////////
638// Footnotes generator
639/////////////////////////////////////////////////////////////////////
640
641/* Based on footnote generation code from:
642 * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
643 */
644
645footnotes: function () {
Junio C Hamano9629d4f2012-12-19 00:28:27646 // Delete existing footnote entries in case we're reloading the footnodes.
647 var i;
Junio C Hamano7bd050f2011-09-22 06:32:22648 var noteholder = document.getElementById("footnotes");
Junio C Hamano9629d4f2012-12-19 00:28:27649 if (!noteholder) {
650 return;
651 }
652 var entriesToRemove = [];
653 for (i = 0; i < noteholder.childNodes.length; i++) {
654 var entry = noteholder.childNodes[i];
655 if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote")
656 entriesToRemove.push(entry);
657 }
658 for (i = 0; i < entriesToRemove.length; i++) {
659 noteholder.removeChild(entriesToRemove[i]);
660 }
661
662 // Rebuild footnote entries.
663 var cont = document.getElementById("content");
Junio C Hamano7bd050f2011-09-22 06:32:22664 var spans = cont.getElementsByTagName("span");
665 var refs = {};
666 var n = 0;
667 for (i=0; i<spans.length; i++) {
668 if (spans[i].className == "footnote") {
669 n++;
Junio C Hamano9629d4f2012-12-19 00:28:27670 var note = spans[i].getAttribute("data-note");
671 if (!note) {
672 // Use [\s\S] in place of . so multi-line matches work.
673 // Because JavaScript has no s (dotall) regex flag.
674 note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
675 spans[i].innerHTML =
676 "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
677 "' title='View footnote' class='footnote'>" + n + "</a>]";
678 spans[i].setAttribute("data-note", note);
679 }
Junio C Hamano7bd050f2011-09-22 06:32:22680 noteholder.innerHTML +=
681 "<div class='footnote' id='_footnote_" + n + "'>" +
682 "<a href='#_footnoteref_" + n + "' title='Return to text'>" +
683 n + "</a>. " + note + "</div>";
Junio C Hamano7bd050f2011-09-22 06:32:22684 var id =spans[i].getAttribute("id");
685 if (id != null) refs["#"+id] = n;
686 }
687 }
688 if (n == 0)
689 noteholder.parentNode.removeChild(noteholder);
690 else {
691 // Process footnoterefs.
692 for (i=0; i<spans.length; i++) {
693 if (spans[i].className == "footnoteref") {
694 var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
695 href = href.match(/#.*/)[0]; // Because IE return full URL.
696 n = refs[href];
697 spans[i].innerHTML =
698 "[<a href='#_footnote_" + n +
699 "' title='View footnote' class='footnote'>" + n + "</a>]";
700 }
701 }
702 }
Junio C Hamano9629d4f2012-12-19 00:28:27703},
704
705install: function(toclevels) {
706 var timerId;
707
708 function reinstall() {
709 asciidoc.footnotes();
710 if (toclevels) {
711 asciidoc.toc(toclevels);
712 }
713 }
714
715 function reinstallAndRemoveTimer() {
716 clearInterval(timerId);
717 reinstall();
718 }
719
720 timerId = setInterval(reinstall, 500);
721 if (document.addEventListener)
722 document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false);
723 else
724 window.onload = reinstallAndRemoveTimer;
Junio C Hamano7bd050f2011-09-22 06:32:22725}
726
727}
Junio C Hamano9629d4f2012-12-19 00:28:27728asciidoc.install();
Junio C Hamano7bd050f2011-09-22 06:32:22729/*]]>*/
730</script>
Junio C Hamano1a4e8412005-12-27 08:17:23731</head>
Junio C Hamano9629d4f2012-12-19 00:28:27732<body class="manpage">
Junio C Hamano1a4e8412005-12-27 08:17:23733<div id="header">
734<h1>
735git-diff-files(1) Manual Page
736</h1>
737<h2>NAME</h2>
738<div class="sectionbody">
739<p>git-diff-files -
740 Compares files in the working tree and the index
741</p>
742</div>
743</div>
Junio C Hamano7bd050f2011-09-22 06:32:22744<div id="content">
Junio C Hamano9629d4f2012-12-19 00:28:27745<div class="sect1">
Junio C Hamano68cf15a2010-11-06 01:01:59746<h2 id="_synopsis">SYNOPSIS</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23747<div class="sectionbody">
Junio C Hamano15567bc2011-07-23 00:51:59748<div class="verseblock">
Junio C Hamano9629d4f2012-12-19 00:28:27749<pre class="content"><em>git diff-files</em> [-q] [-0|-1|-2|-3|-c|--cc] [&lt;common diff options&gt;] [&lt;path&gt;&#8230;]</pre>
750<div class="attribution">
Junio C Hamano15567bc2011-07-23 00:51:59751</div></div>
Junio C Hamano1a4e8412005-12-27 08:17:23752</div>
Junio C Hamano9629d4f2012-12-19 00:28:27753</div>
754<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:31755<h2 id="_description">DESCRIPTION</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23756<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:59757<div class="paragraph"><p>Compares the files in the working tree and the index. When paths
Junio C Hamano1a4e8412005-12-27 08:17:23758are specified, compares only those named paths. Otherwise all
759entries in the index are compared. The output format is the
Junio C Hamano1aa40d22010-01-21 17:46:43760same as for <em>git diff-index</em> and <em>git diff-tree</em>.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:23761</div>
Junio C Hamano9629d4f2012-12-19 00:28:27762</div>
763<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:31764<h2 id="_options">OPTIONS</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23765<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:59766<div class="dlist"><dl>
767<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:23768-p
769</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59770<dt class="hdlist1">
Junio C Hamanobbbb8652008-12-29 10:34:22771-u
772</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59773<dt class="hdlist1">
Junio C Hamanoe97d5772010-05-19 08:13:58774--patch
775</dt>
Junio C Hamano1a4e8412005-12-27 08:17:23776<dd>
777<p>
Junio C Hamanoff979792007-11-16 10:11:30778 Generate patch (see section on generating patches).
779
Junio C Hamano1a4e8412005-12-27 08:17:23780</p>
781</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59782<dt class="hdlist1">
Junio C Hamano69361562007-07-26 02:14:34783-U&lt;n&gt;
784</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59785<dt class="hdlist1">
Junio C Hamano69361562007-07-26 02:14:34786--unified=&lt;n&gt;
787</dt>
788<dd>
789<p>
790 Generate diffs with &lt;n&gt; lines of context instead of
Junio C Hamano3b70d3c2009-11-21 17:37:37791 the usual three.
Junio C Hamano9629d4f2012-12-19 00:28:27792 Implies <code>-p</code>.
Junio C Hamano69361562007-07-26 02:14:34793</p>
794</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59795<dt class="hdlist1">
Junio C Hamano9ae1a062006-07-10 08:12:34796--raw
797</dt>
798<dd>
799<p>
800 Generate the raw format.
Junio C Hamanoff979792007-11-16 10:11:30801 This is the default.
Junio C Hamano9ae1a062006-07-10 08:12:34802</p>
803</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59804<dt class="hdlist1">
Junio C Hamano54559c82006-04-13 07:45:12805--patch-with-raw
806</dt>
807<dd>
808<p>
Junio C Hamano9629d4f2012-12-19 00:28:27809 Synonym for <code>-p --raw</code>.
Junio C Hamano54559c82006-04-13 07:45:12810</p>
811</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59812<dt class="hdlist1">
Junio C Hamano5a73f302011-10-14 05:58:34813--minimal
814</dt>
815<dd>
816<p>
817 Spend extra time to make sure the smallest possible
818 diff is produced.
819</p>
820</dd>
821<dt class="hdlist1">
Junio C Hamano20d47e32009-01-26 06:36:02822--patience
823</dt>
824<dd>
825<p>
826 Generate a diff using the "patience diff" algorithm.
827</p>
828</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59829<dt class="hdlist1">
Junio C Hamanoaea9e6b2012-03-07 00:17:11830--histogram
831</dt>
832<dd>
833<p>
834 Generate a diff using the "histogram diff" algorithm.
835</p>
836</dd>
837<dt class="hdlist1">
Junio C Hamano80ad00d2013-02-18 00:19:03838--diff-algorithm={patience|minimal|histogram|myers}
839</dt>
840<dd>
841<p>
842 Choose a diff algorithm. The variants are as follows:
843</p>
844<div class="openblock">
845<div class="content">
846<div class="dlist"><dl>
847<dt class="hdlist1">
848<code>default</code>, <code>myers</code>
849</dt>
850<dd>
851<p>
852 The basic greedy diff algorithm. Currently, this is the default.
853</p>
854</dd>
855<dt class="hdlist1">
856<code>minimal</code>
857</dt>
858<dd>
859<p>
860 Spend extra time to make sure the smallest possible diff is
861 produced.
862</p>
863</dd>
864<dt class="hdlist1">
865<code>patience</code>
866</dt>
867<dd>
868<p>
869 Use "patience diff" algorithm when generating patches.
870</p>
871</dd>
872<dt class="hdlist1">
873<code>histogram</code>
874</dt>
875<dd>
876<p>
877 This algorithm extends the patience algorithm to "support
878 low-occurrence common elements".
879</p>
880</dd>
881</dl></div>
882</div></div>
883<div class="paragraph"><p>For instance, if you configured diff.algorithm variable to a
884non-default value and want to use the default one, then you
885have to use <code>--diff-algorithm=default</code> option.</p></div>
886</dd>
887<dt class="hdlist1">
Junio C Hamano4c4b0122011-06-30 01:19:32888--stat[=&lt;width&gt;[,&lt;name-width&gt;[,&lt;count&gt;]]]
Junio C Hamanoba7c8d82006-04-15 06:17:42889</dt>
890<dd>
891<p>
Junio C Hamanoaea9e6b2012-03-07 00:17:11892 Generate a diffstat. By default, as much space as necessary
893 will be used for the filename part, and the rest for the graph
894 part. Maximum width defaults to terminal width, or 80 columns
Junio C Hamano7f2b3cb2012-06-22 22:42:39895 if not connected to a terminal, and can be overridden by
Junio C Hamano9629d4f2012-12-19 00:28:27896 <code>&lt;width&gt;</code>. The width of the filename part can be limited by
897 giving another width <code>&lt;name-width&gt;</code> after a comma. The width
Junio C Hamanoaea9e6b2012-03-07 00:17:11898 of the graph part can be limited by using
Junio C Hamano9629d4f2012-12-19 00:28:27899 <code>--stat-graph-width=&lt;width&gt;</code> (affects all commands generating
900 a stat graph) or by setting <code>diff.statGraphWidth=&lt;width&gt;</code>
901 (does not affect <code>git format-patch</code>).
902 By giving a third parameter <code>&lt;count&gt;</code>, you can limit the
903 output to the first <code>&lt;count&gt;</code> lines, followed by <code>...</code> if
Junio C Hamanoaea9e6b2012-03-07 00:17:11904 there are more.
Junio C Hamanoba7c8d82006-04-15 06:17:42905</p>
Junio C Hamano9629d4f2012-12-19 00:28:27906<div class="paragraph"><p>These parameters can also be set individually with <code>--stat-width=&lt;width&gt;</code>,
907<code>--stat-name-width=&lt;name-width&gt;</code> and <code>--stat-count=&lt;count&gt;</code>.</p></div>
Junio C Hamanoba7c8d82006-04-15 06:17:42908</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59909<dt class="hdlist1">
Junio C Hamanofbe00522006-10-19 05:58:48910--numstat
911</dt>
912<dd>
913<p>
Junio C Hamano9629d4f2012-12-19 00:28:27914 Similar to <code>--stat</code>, but shows number of added and
Junio C Hamanofbe00522006-10-19 05:58:48915 deleted lines in decimal notation and pathname without
Junio C Hamanod793de52006-12-26 09:11:43916 abbreviation, to make it more machine friendly. For
Junio C Hamano9629d4f2012-12-19 00:28:27917 binary files, outputs two <code>-</code> instead of saying
918 <code>0 0</code>.
Junio C Hamanofbe00522006-10-19 05:58:48919</p>
920</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59921<dt class="hdlist1">
Junio C Hamano7d23f5e2006-12-16 07:44:04922--shortstat
923</dt>
924<dd>
925<p>
Junio C Hamano9629d4f2012-12-19 00:28:27926 Output only the last line of the <code>--stat</code> format containing total
Junio C Hamano7d23f5e2006-12-16 07:44:04927 number of modified files, as well as number of added and deleted
928 lines.
929</p>
930</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59931<dt class="hdlist1">
Junio C Hamano1c222c52011-05-13 19:55:32932--dirstat[=&lt;param1,param2,&#8230;&gt;]
Junio C Hamano6a45be92008-04-22 08:19:03933</dt>
934<dd>
935<p>
Junio C Hamano1c222c52011-05-13 19:55:32936 Output the distribution of relative amount of changes for each
Junio C Hamano9629d4f2012-12-19 00:28:27937 sub-directory. The behavior of <code>--dirstat</code> can be customized by
Junio C Hamano1c222c52011-05-13 19:55:32938 passing it a comma separated list of parameters.
Junio C Hamano9629d4f2012-12-19 00:28:27939 The defaults are controlled by the <code>diff.dirstat</code> configuration
Junio C Hamanoa28a9202012-06-21 07:08:23940 variable (see <a href="git-config.html">git-config(1)</a>).
Junio C Hamano1c222c52011-05-13 19:55:32941 The following parameters are available:
Junio C Hamano6a45be92008-04-22 08:19:03942</p>
Junio C Hamano9629d4f2012-12-19 00:28:27943<div class="openblock">
944<div class="content">
Junio C Hamano1c222c52011-05-13 19:55:32945<div class="dlist"><dl>
946<dt class="hdlist1">
Junio C Hamano9629d4f2012-12-19 00:28:27947<code>changes</code>
Junio C Hamano1c222c52011-05-13 19:55:32948</dt>
949<dd>
950<p>
951 Compute the dirstat numbers by counting the lines that have been
952 removed from the source, or added to the destination. This ignores
953 the amount of pure code movements within a file. In other words,
954 rearranging lines in a file is not counted as much as other changes.
955 This is the default behavior when no parameter is given.
956</p>
Junio C Hamano6a45be92008-04-22 08:19:03957</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59958<dt class="hdlist1">
Junio C Hamano9629d4f2012-12-19 00:28:27959<code>lines</code>
Junio C Hamanoa476efa2008-10-10 15:31:42960</dt>
961<dd>
962<p>
Junio C Hamano1c222c52011-05-13 19:55:32963 Compute the dirstat numbers by doing the regular line-based diff
964 analysis, and summing the removed/added line counts. (For binary
965 files, count 64-byte chunks instead, since binary files have no
Junio C Hamano9629d4f2012-12-19 00:28:27966 natural concept of lines). This is a more expensive <code>--dirstat</code>
967 behavior than the <code>changes</code> behavior, but it does count rearranged
Junio C Hamano1c222c52011-05-13 19:55:32968 lines within a file as much as other changes. The resulting output
Junio C Hamano9629d4f2012-12-19 00:28:27969 is consistent with what you get from the other <code>--*stat</code> options.
Junio C Hamanoa476efa2008-10-10 15:31:42970</p>
971</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59972<dt class="hdlist1">
Junio C Hamano9629d4f2012-12-19 00:28:27973<code>files</code>
Junio C Hamano1c222c52011-05-13 19:55:32974</dt>
975<dd>
976<p>
977 Compute the dirstat numbers by counting the number of files changed.
978 Each changed file counts equally in the dirstat analysis. This is
Junio C Hamano9629d4f2012-12-19 00:28:27979 the computationally cheapest <code>--dirstat</code> behavior, since it does
Junio C Hamano1c222c52011-05-13 19:55:32980 not have to look at the file contents at all.
981</p>
982</dd>
983<dt class="hdlist1">
Junio C Hamano9629d4f2012-12-19 00:28:27984<code>cumulative</code>
Junio C Hamano1c222c52011-05-13 19:55:32985</dt>
986<dd>
987<p>
988 Count changes in a child directory for the parent directory as well.
Junio C Hamano9629d4f2012-12-19 00:28:27989 Note that when using <code>cumulative</code>, the sum of the percentages
Junio C Hamano1c222c52011-05-13 19:55:32990 reported may exceed 100%. The default (non-cumulative) behavior can
Junio C Hamano9629d4f2012-12-19 00:28:27991 be specified with the <code>noncumulative</code> parameter.
Junio C Hamano1c222c52011-05-13 19:55:32992</p>
993</dd>
994<dt class="hdlist1">
995&lt;limit&gt;
996</dt>
997<dd>
998<p>
999 An integer parameter specifies a cut-off percent (3% by default).
1000 Directories contributing less than this percentage of the changes
1001 are not shown in the output.
1002</p>
1003</dd>
1004</dl></div>
Junio C Hamano9629d4f2012-12-19 00:28:271005</div></div>
Junio C Hamano1c222c52011-05-13 19:55:321006<div class="paragraph"><p>Example: The following will count changed files, while ignoring
1007directories with less than 10% of the total amount of changed files,
1008and accumulating child directory counts in the parent directories:
Junio C Hamano9629d4f2012-12-19 00:28:271009<code>--dirstat=files,10,cumulative</code>.</p></div>
Junio C Hamano1c222c52011-05-13 19:55:321010</dd>
1011<dt class="hdlist1">
Junio C Hamano6959c6c2006-05-17 10:34:111012--summary
1013</dt>
1014<dd>
1015<p>
1016 Output a condensed summary of extended header information
1017 such as creations, renames and mode changes.
1018</p>
1019</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591020<dt class="hdlist1">
Junio C Hamanod1308c92006-04-16 11:01:091021--patch-with-stat
1022</dt>
1023<dd>
1024<p>
Junio C Hamano9629d4f2012-12-19 00:28:271025 Synonym for <code>-p --stat</code>.
Junio C Hamanod1308c92006-04-16 11:01:091026</p>
1027</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591028<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231029-z
1030</dt>
1031<dd>
1032<p>
Junio C Hamano9629d4f2012-12-19 00:28:271033 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:341034 given, do not munge pathnames and use NULs as output field terminators.
Junio C Hamano1a4e8412005-12-27 08:17:231035</p>
Junio C Hamano68cf15a2010-11-06 01:01:591036<div class="paragraph"><p>Without this option, each pathname output will have TAB, LF, double quotes,
Junio C Hamano9629d4f2012-12-19 00:28:271037and backslash characters replaced with <code>\t</code>, <code>\n</code>, <code>\"</code>, and <code>\\</code>,
Junio C Hamano5706e0b2009-11-24 10:54:161038respectively, and the pathname will be enclosed in double quotes if
1039any of those replacements occurred.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231040</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591041<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231042--name-only
1043</dt>
1044<dd>
1045<p>
1046 Show only names of changed files.
1047</p>
1048</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591049<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231050--name-status
1051</dt>
1052<dd>
1053<p>
Junio C Hamanoa9aee782008-04-23 16:09:201054 Show only names and status of changed files. See the description
Junio C Hamano9629d4f2012-12-19 00:28:271055 of the <code>--diff-filter</code> option on what the status letters mean.
Junio C Hamano1a4e8412005-12-27 08:17:231056</p>
1057</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591058<dt class="hdlist1">
Junio C Hamanoc21ab052009-10-31 04:03:551059--submodule[=&lt;format&gt;]
1060</dt>
1061<dd>
1062<p>
Junio C Hamano9629d4f2012-12-19 00:28:271063 Specify how differences in submodules are shown. When <code>--submodule</code>
1064 or <code>--submodule=log</code> is given, the <em>log</em> format is used. This format lists
1065 the commits in the range like <a href="git-submodule.html">git-submodule(1)</a> <code>summary</code> does.
1066 Omitting the <code>--submodule</code> option or specifying <code>--submodule=short</code>,
Junio C Hamanoe768cc12012-03-16 05:43:051067 uses the <em>short</em> format. This format just shows the names of the commits
Junio C Hamanob4e58b12012-11-26 03:13:061068 at the beginning and end of the range. Can be tweaked via the
Junio C Hamano9629d4f2012-12-19 00:28:271069 <code>diff.submodule</code> configuration variable.
Junio C Hamanoc21ab052009-10-31 04:03:551070</p>
1071</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591072<dt class="hdlist1">
Junio C Hamano4aa0bcc2010-03-03 05:13:121073--color[=&lt;when&gt;]
Junio C Hamano9ae1a062006-07-10 08:12:341074</dt>
1075<dd>
1076<p>
1077 Show colored diff.
Junio C Hamano947ab822013-03-19 23:07:291078 <code>--color</code> (i.e. without <em>=&lt;when&gt;</em>) is the same as <code>--color=always</code>.
1079 <em>&lt;when&gt;</em> can be one of <code>always</code>, <code>never</code>, or <code>auto</code>.
Junio C Hamano9ae1a062006-07-10 08:12:341080</p>
1081</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591082<dt class="hdlist1">
Junio C Hamano9ae1a062006-07-10 08:12:341083--no-color
1084</dt>
1085<dd>
1086<p>
Junio C Hamano5f2627d2011-05-06 20:23:481087 Turn off colored diff.
Junio C Hamano9629d4f2012-12-19 00:28:271088 It is the same as <code>--color=never</code>.
Junio C Hamano9ae1a062006-07-10 08:12:341089</p>
1090</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591091<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531092--word-diff[=&lt;mode&gt;]
Junio C Hamano85e45fa2006-08-13 07:47:411093</dt>
1094<dd>
1095<p>
Junio C Hamanocc7636a2010-05-21 14:57:531096 Show a word diff, using the &lt;mode&gt; to delimit changed words.
1097 By default, words are delimited by whitespace; see
Junio C Hamano9629d4f2012-12-19 00:28:271098 <code>--word-diff-regex</code> below. The &lt;mode&gt; defaults to <em>plain</em>, and
Junio C Hamanocc7636a2010-05-21 14:57:531099 must be one of:
Junio C Hamano85e45fa2006-08-13 07:47:411100</p>
Junio C Hamano9629d4f2012-12-19 00:28:271101<div class="openblock">
1102<div class="content">
Junio C Hamano68cf15a2010-11-06 01:01:591103<div class="dlist"><dl>
1104<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531105color
1106</dt>
1107<dd>
1108<p>
Junio C Hamano9629d4f2012-12-19 00:28:271109 Highlight changed words using only colors. Implies <code>--color</code>.
Junio C Hamanocc7636a2010-05-21 14:57:531110</p>
1111</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591112<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531113plain
1114</dt>
1115<dd>
1116<p>
Junio C Hamano9629d4f2012-12-19 00:28:271117 Show words as <code>[-removed-]</code> and <code>{+added+}</code>. Makes no
Junio C Hamanocc7636a2010-05-21 14:57:531118 attempts to escape the delimiters if they appear in the input,
1119 so the output may be ambiguous.
1120</p>
1121</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591122<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531123porcelain
1124</dt>
1125<dd>
1126<p>
1127 Use a special line-based format intended for script
1128 consumption. Added/removed/unchanged runs are printed in the
Junio C Hamano9629d4f2012-12-19 00:28:271129 usual unified diff format, starting with a <code>+</code>/<code>-</code>/` `
Junio C Hamanocc7636a2010-05-21 14:57:531130 character at the beginning of the line and extending to the
1131 end of the line. Newlines in the input are represented by a
Junio C Hamano9629d4f2012-12-19 00:28:271132 tilde <code>~</code> on a line of its own.
Junio C Hamanocc7636a2010-05-21 14:57:531133</p>
1134</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591135<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531136none
1137</dt>
1138<dd>
1139<p>
1140 Disable word diff again.
1141</p>
1142</dd>
1143</dl></div>
Junio C Hamano9629d4f2012-12-19 00:28:271144</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591145<div class="paragraph"><p>Note that despite the name of the first mode, color is used to
Junio C Hamanocc7636a2010-05-21 14:57:531146highlight the changed parts in all modes if enabled.</p></div>
1147</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591148<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531149--word-diff-regex=&lt;regex&gt;
1150</dt>
1151<dd>
1152<p>
1153 Use &lt;regex&gt; to decide what a word is, instead of considering
1154 runs of non-whitespace to be a word. Also implies
Junio C Hamano9629d4f2012-12-19 00:28:271155 <code>--word-diff</code> unless it was already enabled.
Junio C Hamanocc7636a2010-05-21 14:57:531156</p>
Junio C Hamano68cf15a2010-11-06 01:01:591157<div class="paragraph"><p>Every non-overlapping match of the
Junio C Hamano20d47e32009-01-26 06:36:021158&lt;regex&gt; is considered a word. Anything between these matches is
1159considered whitespace and ignored(!) for the purposes of finding
Junio C Hamano9629d4f2012-12-19 00:28:271160differences. You may want to append <code>|[^[:space:]]</code> to your regular
Junio C Hamano20d47e32009-01-26 06:36:021161expression to make sure that it matches all non-whitespace characters.
1162A match that contains a newline is silently truncated(!) at the
1163newline.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591164<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:231165<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:021166overrides any diff driver or configuration setting. Diff drivers
1167override configuration settings.</p></div>
Junio C Hamano85e45fa2006-08-13 07:47:411168</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591169<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531170--color-words[=&lt;regex&gt;]
1171</dt>
1172<dd>
1173<p>
Junio C Hamano9629d4f2012-12-19 00:28:271174 Equivalent to <code>--word-diff=color</code> plus (if a regex was
1175 specified) <code>--word-diff-regex=&lt;regex&gt;</code>.
Junio C Hamanocc7636a2010-05-21 14:57:531176</p>
1177</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591178<dt class="hdlist1">
Junio C Hamano9ae1a062006-07-10 08:12:341179--no-renames
1180</dt>
1181<dd>
1182<p>
1183 Turn off rename detection, even when the configuration
1184 file gives the default to do so.
1185</p>
1186</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591187<dt class="hdlist1">
Junio C Hamanoa890c4f2007-01-28 10:29:211188--check
1189</dt>
1190<dd>
1191<p>
Junio C Hamano6005bfa2011-06-23 00:51:221192 Warn if changes introduce whitespace errors. What are
Junio C Hamano9629d4f2012-12-19 00:28:271193 considered whitespace errors is controlled by <code>core.whitespace</code>
Junio C Hamano6005bfa2011-06-23 00:51:221194 configuration. By default, trailing whitespaces (including
1195 lines that solely consist of whitespaces) and a space character
1196 that is immediately followed by a tab character inside the
1197 initial indent of the line are considered whitespace errors.
1198 Exits with non-zero status if problems are found. Not compatible
1199 with --exit-code.
Junio C Hamanoa890c4f2007-01-28 10:29:211200</p>
1201</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591202<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231203--full-index
1204</dt>
1205<dd>
1206<p>
Junio C Hamano5cf43ca2008-08-20 09:14:141207 Instead of the first handful of characters, show the full
1208 pre- and post-image blob object names on the "index"
1209 line when generating patch format output.
Junio C Hamano1a4e8412005-12-27 08:17:231210</p>
1211</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591212<dt class="hdlist1">
Junio C Hamano9ae1a062006-07-10 08:12:341213--binary
1214</dt>
1215<dd>
1216<p>
Junio C Hamano9629d4f2012-12-19 00:28:271217 In addition to <code>--full-index</code>, output a binary diff that
1218 can be applied with <code>git-apply</code>.
Junio C Hamano9ae1a062006-07-10 08:12:341219</p>
1220</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591221<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231222--abbrev[=&lt;n&gt;]
1223</dt>
1224<dd>
1225<p>
1226 Instead of showing the full 40-byte hexadecimal object
1227 name in diff-raw format output and diff-tree header
Junio C Hamano6efe3022009-01-13 16:47:561228 lines, show only a partial prefix. This is
Junio C Hamano9629d4f2012-12-19 00:28:271229 independent of the <code>--full-index</code> option above, which controls
Junio C Hamano1a4e8412005-12-27 08:17:231230 the diff-patch output format. Non default number of
Junio C Hamano9629d4f2012-12-19 00:28:271231 digits can be specified with <code>--abbrev=&lt;n&gt;</code>.
Junio C Hamano1a4e8412005-12-27 08:17:231232</p>
1233</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591234<dt class="hdlist1">
Junio C Hamanoe85e36f2010-08-10 05:30:141235-B[&lt;n&gt;][/&lt;m&gt;]
Junio C Hamano1a4e8412005-12-27 08:17:231236</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591237<dt class="hdlist1">
Junio C Hamano39c7a692010-10-27 06:08:541238--break-rewrites[=[&lt;n&gt;][/&lt;m&gt;]]
1239</dt>
Junio C Hamano1a4e8412005-12-27 08:17:231240<dd>
1241<p>
Junio C Hamanoe85e36f2010-08-10 05:30:141242 Break complete rewrite changes into pairs of delete and
1243 create. This serves two purposes:
Junio C Hamano1a4e8412005-12-27 08:17:231244</p>
Junio C Hamano68cf15a2010-11-06 01:01:591245<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:141246not as a series of deletion and insertion mixed together with a very
1247few lines that happen to match textually as the context, but as a
1248single deletion of everything old followed by a single insertion of
Junio C Hamano9629d4f2012-12-19 00:28:271249everything new, and the number <code>m</code> controls this aspect of the -B
1250option (defaults to 60%). <code>-B/70%</code> specifies that less than 30% of the
Junio C Hamano076ffcc2013-02-06 05:13:211251original should remain in the result for Git to consider it a total
Junio C Hamanoe85e36f2010-08-10 05:30:141252rewrite (i.e. otherwise the resulting patch will be a series of
1253deletion and insertion mixed together with context lines).</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591254<div class="paragraph"><p>When used with -M, a totally-rewritten file is also considered as the
Junio C Hamanoe85e36f2010-08-10 05:30:141255source of a rename (usually -M only considers a file that disappeared
Junio C Hamano9629d4f2012-12-19 00:28:271256as the source of a rename), and the number <code>n</code> controls this aspect of
1257the -B option (defaults to 50%). <code>-B20%</code> specifies that a change with
Junio C Hamano68cf15a2010-11-06 01:01:591258addition and deletion compared to 20% or more of the file&#8217;s size are
Junio C Hamanoe85e36f2010-08-10 05:30:141259eligible for being picked up as a possible source of a rename to
1260another file.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231261</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591262<dt class="hdlist1">
Junio C Hamanoe85e36f2010-08-10 05:30:141263-M[&lt;n&gt;]
Junio C Hamano1a4e8412005-12-27 08:17:231264</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591265<dt class="hdlist1">
Junio C Hamano0d75e872010-12-17 06:57:261266--find-renames[=&lt;n&gt;]
Junio C Hamano39c7a692010-10-27 06:08:541267</dt>
Junio C Hamano1a4e8412005-12-27 08:17:231268<dd>
1269<p>
1270 Detect renames.
Junio C Hamano9629d4f2012-12-19 00:28:271271 If <code>n</code> is specified, it is a threshold on the similarity
Junio C Hamanoe85e36f2010-08-10 05:30:141272 index (i.e. amount of addition/deletions compared to the
Junio C Hamano076ffcc2013-02-06 05:13:211273 file&#8217;s size). For example, <code>-M90%</code> means Git should consider a
Junio C Hamanoe85e36f2010-08-10 05:30:141274 delete/add pair to be a rename if more than 90% of the file
Junio C Hamano9629d4f2012-12-19 00:28:271275 hasn&#8217;t changed. Without a <code>%</code> sign, the number is to be read as
1276 a fraction, with a decimal point before it. I.e., <code>-M5</code> becomes
1277 0.5, and is thus the same as <code>-M50%</code>. Similarly, <code>-M05</code> is
1278 the same as <code>-M5%</code>. To limit detection to exact renames, use
1279 <code>-M100%</code>.
Junio C Hamano1a4e8412005-12-27 08:17:231280</p>
1281</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591282<dt class="hdlist1">
Junio C Hamanoe85e36f2010-08-10 05:30:141283-C[&lt;n&gt;]
Junio C Hamano1a4e8412005-12-27 08:17:231284</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591285<dt class="hdlist1">
Junio C Hamano0d75e872010-12-17 06:57:261286--find-copies[=&lt;n&gt;]
Junio C Hamano39c7a692010-10-27 06:08:541287</dt>
Junio C Hamano1a4e8412005-12-27 08:17:231288<dd>
1289<p>
Junio C Hamano9629d4f2012-12-19 00:28:271290 Detect copies as well as renames. See also <code>--find-copies-harder</code>.
1291 If <code>n</code> is specified, it has the same meaning as for <code>-M&lt;n&gt;</code>.
Junio C Hamano1a4e8412005-12-27 08:17:231292</p>
1293</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591294<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231295--find-copies-harder
1296</dt>
1297<dd>
1298<p>
Junio C Hamano9629d4f2012-12-19 00:28:271299 For performance reasons, by default, <code>-C</code> option finds copies only
Junio C Hamano1a4e8412005-12-27 08:17:231300 if the original file of the copy was modified in the same
1301 changeset. This flag makes the command
1302 inspect unmodified files as candidates for the source of
1303 copy. This is a very expensive operation for large
Junio C Hamano16f98872007-06-12 16:09:141304 projects, so use it with caution. Giving more than one
Junio C Hamano9629d4f2012-12-19 00:28:271305 <code>-C</code> option has the same effect.
Junio C Hamano1a4e8412005-12-27 08:17:231306</p>
1307</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591308<dt class="hdlist1">
Junio C Hamanob02377c2011-04-28 22:26:021309-D
1310</dt>
1311<dt class="hdlist1">
1312--irreversible-delete
1313</dt>
1314<dd>
1315<p>
1316 Omit the preimage for deletes, i.e. print only the header but not
Junio C Hamano9629d4f2012-12-19 00:28:271317 the diff between the preimage and <code>/dev/null</code>. The resulting patch
1318 is not meant to be applied with <code>patch</code> nor <code>git apply</code>; this is
Junio C Hamanob02377c2011-04-28 22:26:021319 solely for people who want to just concentrate on reviewing the
1320 text after the change. In addition, the output obviously lack
1321 enough information to apply such a patch in reverse, even manually,
1322 hence the name of the option.
1323</p>
Junio C Hamano9629d4f2012-12-19 00:28:271324<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:021325of a delete/create pair.</p></div>
1326</dd>
1327<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231328-l&lt;num&gt;
1329</dt>
1330<dd>
1331<p>
Junio C Hamano9629d4f2012-12-19 00:28:271332 The <code>-M</code> and <code>-C</code> options require O(n^2) processing time where n
Junio C Hamano1a4e8412005-12-27 08:17:231333 is the number of potential rename/copy targets. This
1334 option prevents rename/copy detection from running if
1335 the number of rename/copy targets exceeds the specified
1336 number.
1337</p>
1338</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591339<dt class="hdlist1">
Junio C Hamano982eb112010-11-18 00:53:091340--diff-filter=[(A|C|D|M|R|T|U|X|B)&#8230;[*]]
1341</dt>
1342<dd>
1343<p>
Junio C Hamano9629d4f2012-12-19 00:28:271344 Select only files that are Added (<code>A</code>), Copied (<code>C</code>),
1345 Deleted (<code>D</code>), Modified (<code>M</code>), Renamed (<code>R</code>), have their
1346 type (i.e. regular file, symlink, submodule, &#8230;) changed (<code>T</code>),
1347 are Unmerged (<code>U</code>), are
1348 Unknown (<code>X</code>), or have had their pairing Broken (<code>B</code>).
Junio C Hamano982eb112010-11-18 00:53:091349 Any combination of the filter characters (including none) can be used.
Junio C Hamano9629d4f2012-12-19 00:28:271350 When <code>*</code> (All-or-none) is added to the combination, all
Junio C Hamano982eb112010-11-18 00:53:091351 paths are selected if there is any file that matches
1352 other criteria in the comparison; if there is no file
1353 that matches other criteria, nothing is selected.
1354</p>
1355</dd>
1356<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231357-S&lt;string&gt;
1358</dt>
1359<dd>
1360<p>
Junio C Hamanof1f5a7b2013-06-11 22:23:521361 Look for differences that change the number of occurrences of
1362 the specified string (i.e. addition/deletion) in a file.
1363 Intended for the scripter&#8217;s use.
Junio C Hamano1a4e8412005-12-27 08:17:231364</p>
Junio C Hamanof1f5a7b2013-06-11 22:23:521365<div class="paragraph"><p>It is useful when you&#8217;re looking for an exact block of code (like a
1366struct), and want to know the history of that block since it first
1367came into being: use the feature iteratively to feed the interesting
1368block in the preimage back into <code>-S</code>, and keep going until you get the
1369very first version of the block.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231370</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591371<dt class="hdlist1">
Junio C Hamano3b4609d2010-09-30 00:04:341372-G&lt;regex&gt;
1373</dt>
1374<dd>
1375<p>
Junio C Hamanof1f5a7b2013-06-11 22:23:521376 Look for differences whose patch text contains added/removed
1377 lines that match &lt;regex&gt;.
Junio C Hamano3b4609d2010-09-30 00:04:341378</p>
Junio C Hamanof1f5a7b2013-06-11 22:23:521379<div class="paragraph"><p>To illustrate the difference between <code>-S&lt;regex&gt; --pickaxe-regex</code> and
1380<code>-G&lt;regex&gt;</code>, consider a commit with the following diff in the same
1381file:</p></div>
1382<div class="listingblock">
1383<div class="content">
1384<pre><code>+ return !regexec(regexp, two-&gt;ptr, 1, &amp;regmatch, 0);
1385...
1386- hit = !regexec(regexp, mf2.ptr, 1, &amp;regmatch, 0);</code></pre>
1387</div></div>
1388<div class="paragraph"><p>While <code>git log -G"regexec\(regexp"</code> will show this commit, <code>git log
1389-S"regexec\(regexp" --pickaxe-regex</code> will not (because the number of
1390occurrences of that string did not change).</p></div>
1391<div class="paragraph"><p>See the <em>pickaxe</em> entry in <a href="gitdiffcore.html">gitdiffcore(7)</a> for more
1392information.</p></div>
Junio C Hamano3b4609d2010-09-30 00:04:341393</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591394<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231395--pickaxe-all
1396</dt>
1397<dd>
1398<p>
Junio C Hamano9629d4f2012-12-19 00:28:271399 When <code>-S</code> or <code>-G</code> finds a change, show all the changes in that
Junio C Hamano1a4e8412005-12-27 08:17:231400 changeset, not just the files that contain the change
1401 in &lt;string&gt;.
1402</p>
1403</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591404<dt class="hdlist1">
Junio C Hamanobfe9e752006-04-05 21:43:281405--pickaxe-regex
1406</dt>
1407<dd>
1408<p>
Junio C Hamanof1f5a7b2013-06-11 22:23:521409 Treat the &lt;string&gt; given to <code>-S</code> as an extended POSIX regular
1410 expression to match.
Junio C Hamanobfe9e752006-04-05 21:43:281411</p>
1412</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591413<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231414-O&lt;orderfile&gt;
1415</dt>
1416<dd>
1417<p>
1418 Output the patch in the order specified in the
1419 &lt;orderfile&gt;, which has one shell glob pattern per line.
1420</p>
1421</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591422<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231423-R
1424</dt>
1425<dd>
1426<p>
1427 Swap two inputs; that is, show differences from index or
1428 on-disk file to tree contents.
1429</p>
1430</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591431<dt class="hdlist1">
Junio C Hamano24bc09a2008-02-28 00:27:441432--relative[=&lt;path&gt;]
1433</dt>
1434<dd>
1435<p>
1436 When run from a subdirectory of the project, it can be
1437 told to exclude changes outside the directory and show
1438 pathnames relative to it with this option. When you are
1439 not in a subdirectory (e.g. in a bare repository), you
1440 can name which subdirectory to make the output relative
1441 to by giving a &lt;path&gt; as an argument.
1442</p>
1443</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591444<dt class="hdlist1">
Junio C Hamanobbbb8652008-12-29 10:34:221445-a
1446</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591447<dt class="hdlist1">
Junio C Hamanoc26f5482006-07-09 09:38:141448--text
1449</dt>
1450<dd>
1451<p>
1452 Treat all files as text.
1453</p>
1454</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591455<dt class="hdlist1">
Junio C Hamanofd468962007-02-14 23:45:041456--ignore-space-at-eol
1457</dt>
1458<dd>
1459<p>
Junio C Hamano3a702342007-12-12 21:34:021460 Ignore changes in whitespace at EOL.
Junio C Hamanofd468962007-02-14 23:45:041461</p>
1462</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591463<dt class="hdlist1">
Junio C Hamanobbbb8652008-12-29 10:34:221464-b
1465</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591466<dt class="hdlist1">
Junio C Hamanod9c2d2f2006-12-06 08:59:071467--ignore-space-change
1468</dt>
1469<dd>
1470<p>
Junio C Hamano3a702342007-12-12 21:34:021471 Ignore changes in amount of whitespace. This ignores whitespace
1472 at line end, and considers all other sequences of one or
1473 more whitespace characters to be equivalent.
Junio C Hamanod9c2d2f2006-12-06 08:59:071474</p>
1475</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591476<dt class="hdlist1">
Junio C Hamanobbbb8652008-12-29 10:34:221477-w
Junio C Hamanod9c2d2f2006-12-06 08:59:071478</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591479<dt class="hdlist1">
Junio C Hamanod9c2d2f2006-12-06 08:59:071480--ignore-all-space
1481</dt>
1482<dd>
1483<p>
Junio C Hamano3a702342007-12-12 21:34:021484 Ignore whitespace when comparing lines. This ignores
1485 differences even if one line has whitespace where the other
Junio C Hamanod9c2d2f2006-12-06 08:59:071486 line has none.
1487</p>
1488</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591489<dt class="hdlist1">
Junio C Hamanoa1952302013-07-01 21:31:181490--ignore-blank-lines
1491</dt>
1492<dd>
1493<p>
1494 Ignore changes whose lines are all blank.
1495</p>
1496</dd>
1497<dt class="hdlist1">
Junio C Hamano1d40ee82009-01-07 10:14:161498--inter-hunk-context=&lt;lines&gt;
1499</dt>
1500<dd>
1501<p>
1502 Show the context between diff hunks, up to the specified number
1503 of lines, thereby fusing hunks that are close to each other.
1504</p>
1505</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591506<dt class="hdlist1">
Junio C Hamano11821ed2011-10-19 18:42:091507-W
1508</dt>
1509<dt class="hdlist1">
1510--function-context
1511</dt>
1512<dd>
1513<p>
1514 Show whole surrounding functions of changes.
1515</p>
1516</dd>
1517<dt class="hdlist1">
Junio C Hamano48fd2f62007-03-19 02:02:301518--exit-code
1519</dt>
1520<dd>
1521<p>
1522 Make the program exit with codes similar to diff(1).
1523 That is, it exits with 1 if there were differences and
1524 0 means no differences.
1525</p>
1526</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591527<dt class="hdlist1">
Junio C Hamano35e57552007-03-25 07:54:351528--quiet
1529</dt>
1530<dd>
1531<p>
Junio C Hamano9629d4f2012-12-19 00:28:271532 Disable all output of the program. Implies <code>--exit-code</code>.
Junio C Hamano35e57552007-03-25 07:54:351533</p>
1534</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591535<dt class="hdlist1">
Junio C Hamanobb0f4042007-07-04 06:41:401536--ext-diff
1537</dt>
1538<dd>
1539<p>
1540 Allow an external diff helper to be executed. If you set an
Junio C Hamanoa28a9202012-06-21 07:08:231541 external diff driver with <a href="gitattributes.html">gitattributes(5)</a>, you need
1542 to use this option with <a href="git-log.html">git-log(1)</a> and friends.
Junio C Hamanobb0f4042007-07-04 06:41:401543</p>
1544</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591545<dt class="hdlist1">
Junio C Hamanobb0f4042007-07-04 06:41:401546--no-ext-diff
1547</dt>
1548<dd>
1549<p>
1550 Disallow external diff drivers.
1551</p>
1552</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591553<dt class="hdlist1">
Junio C Hamanoc652aed2011-07-07 01:14:311554--textconv
1555</dt>
1556<dt class="hdlist1">
1557--no-textconv
1558</dt>
1559<dd>
1560<p>
1561 Allow (or disallow) external text conversion filters to be run
Junio C Hamanoa28a9202012-06-21 07:08:231562 when comparing binary files. See <a href="gitattributes.html">gitattributes(5)</a> for
Junio C Hamanoc652aed2011-07-07 01:14:311563 details. Because textconv filters are typically a one-way
1564 conversion, the resulting diff is suitable for human
1565 consumption, but cannot be applied. For this reason, textconv
Junio C Hamanoa28a9202012-06-21 07:08:231566 filters are enabled by default only for <a href="git-diff.html">git-diff(1)</a> and
1567 <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:311568 diff plumbing commands.
1569</p>
1570</dd>
1571<dt class="hdlist1">
Junio C Hamano7d449522010-07-01 00:08:511572--ignore-submodules[=&lt;when&gt;]
Junio C Hamanodfccbb02008-05-26 01:16:141573</dt>
1574<dd>
1575<p>
Junio C Hamano7d449522010-07-01 00:08:511576 Ignore changes to submodules in the diff generation. &lt;when&gt; can be
Junio C Hamanoc7102962013-05-29 23:57:171577 either "none", "untracked", "dirty" or "all", which is the default.
Junio C Hamano619596a2010-08-18 22:15:351578 Using "none" will consider the submodule modified when it either contains
1579 untracked or modified files or its HEAD differs from the commit recorded
1580 in the superproject and can be used to override any settings of the
Junio C Hamanoa28a9202012-06-21 07:08:231581 <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:511582 "untracked" is used submodules are not considered dirty when they only
1583 contain untracked content (but they are still scanned for modified
1584 content). Using "dirty" ignores all changes to the work tree of submodules,
1585 only changes to the commits stored in the superproject are shown (this was
1586 the behavior until 1.7.0). Using "all" hides all changes to submodules.
Junio C Hamanodfccbb02008-05-26 01:16:141587</p>
1588</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591589<dt class="hdlist1">
Junio C Hamanoe27cbd22007-12-21 17:57:331590--src-prefix=&lt;prefix&gt;
1591</dt>
1592<dd>
1593<p>
1594 Show the given source prefix instead of "a/".
1595</p>
1596</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591597<dt class="hdlist1">
Junio C Hamanoe27cbd22007-12-21 17:57:331598--dst-prefix=&lt;prefix&gt;
1599</dt>
1600<dd>
1601<p>
1602 Show the given destination prefix instead of "b/".
1603</p>
1604</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591605<dt class="hdlist1">
Junio C Hamanoe27cbd22007-12-21 17:57:331606--no-prefix
1607</dt>
1608<dd>
1609<p>
1610 Do not show any source or destination prefix.
1611</p>
1612</dd>
Junio C Hamanoba4b9282008-07-06 05:20:311613</dl></div>
Junio C Hamano68cf15a2010-11-06 01:01:591614<div class="paragraph"><p>For more detailed explanation on these common options, see also
Junio C Hamanoa28a9202012-06-21 07:08:231615<a href="gitdiffcore.html">gitdiffcore(7)</a>.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591616<div class="dlist"><dl>
1617<dt class="hdlist1">
Junio C Hamanobd53dbf2009-01-18 18:26:371618-1 --base
1619</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591620<dt class="hdlist1">
Junio C Hamanobd53dbf2009-01-18 18:26:371621-2 --ours
1622</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591623<dt class="hdlist1">
Junio C Hamanobd53dbf2009-01-18 18:26:371624-3 --theirs
1625</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591626<dt class="hdlist1">
Junio C Hamanobd53dbf2009-01-18 18:26:371627-0
Junio C Hamano1a4e8412005-12-27 08:17:231628</dt>
1629<dd>
1630<p>
1631 Diff against the "base" version, "our branch" or "their
1632 branch" respectively. With these options, diffs for
1633 merged entries are not shown.
1634</p>
Junio C Hamano68cf15a2010-11-06 01:01:591635<div class="paragraph"><p>The default is to diff against our branch (-2) and the
Junio C Hamano1a4e8412005-12-27 08:17:231636cleanly resolved paths. The option -0 can be given to
Junio C Hamanoba4b9282008-07-06 05:20:311637omit diff output for unmerged entries and just show "Unmerged".</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231638</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591639<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471640-c
1641</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591642<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471643--cc
Junio C Hamanofb56a962006-01-28 10:38:191644</dt>
1645<dd>
1646<p>
1647 This compares stage 2 (our branch), stage 3 (their
1648 branch) and the working tree file and outputs a combined
1649 diff, similar to the way <em>diff-tree</em> shows a merge
1650 commit with these flags.
1651</p>
1652</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591653<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231654-q
1655</dt>
1656<dd>
1657<p>
Junio C Hamano51c2ab02006-07-09 20:38:541658 Remain silent even on nonexistent files
Junio C Hamano1a4e8412005-12-27 08:17:231659</p>
1660</dd>
Junio C Hamanoba4b9282008-07-06 05:20:311661</dl></div>
Junio C Hamano1a4e8412005-12-27 08:17:231662</div>
Junio C Hamano9629d4f2012-12-19 00:28:271663</div>
1664<div class="sect1">
Junio C Hamano543f8d62009-07-29 08:35:211665<h2 id="_raw_output_format">Raw output format</h2>
Junio C Hamano1a4e8412005-12-27 08:17:231666<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:591667<div class="paragraph"><p>The raw output format from "git-diff-index", "git-diff-tree",
Junio C Hamanoba4b9282008-07-06 05:20:311668"git-diff-files" and "git diff --raw" are very similar.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591669<div class="paragraph"><p>These commands all compare two sets of things; what is
Junio C Hamanoba4b9282008-07-06 05:20:311670compared differs:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591671<div class="dlist"><dl>
1672<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231673git-diff-index &lt;tree-ish&gt;
1674</dt>
1675<dd>
1676<p>
1677 compares the &lt;tree-ish&gt; and the files on the filesystem.
1678</p>
1679</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591680<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231681git-diff-index --cached &lt;tree-ish&gt;
1682</dt>
1683<dd>
1684<p>
1685 compares the &lt;tree-ish&gt; and the index.
1686</p>
1687</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591688<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231689git-diff-tree [-r] &lt;tree-ish-1&gt; &lt;tree-ish-2&gt; [&lt;pattern&gt;&#8230;]
1690</dt>
1691<dd>
1692<p>
1693 compares the trees named by the two arguments.
1694</p>
1695</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591696<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231697git-diff-files [&lt;pattern&gt;&#8230;]
1698</dt>
1699<dd>
1700<p>
1701 compares the index and the files on the filesystem.
1702</p>
1703</dd>
Junio C Hamanoba4b9282008-07-06 05:20:311704</dl></div>
Junio C Hamano68cf15a2010-11-06 01:01:591705<div class="paragraph"><p>The "git-diff-tree" command begins its output by printing the hash of
Junio C Hamano543f8d62009-07-29 08:35:211706what is being compared. After that, all the commands print one output
1707line per changed file.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591708<div class="paragraph"><p>An output line is formatted this way:</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231709<div class="listingblock">
1710<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:271711<pre><code>in-place edit :100644 100644 bcd1234... 0123456... M file0
Junio C Hamano1a4e8412005-12-27 08:17:231712copy-edit :100644 100644 abcd123... 1234567... C68 file1 file2
1713rename-edit :100644 100644 abcd123... 1234567... R86 file1 file3
1714create :000000 100644 0000000... 1234567... A file4
1715delete :100644 000000 1234567... 0000000... D file5
Junio C Hamano9629d4f2012-12-19 00:28:271716unmerged :000000 000000 0000000... 0000000... U file6</code></pre>
Junio C Hamano1a4e8412005-12-27 08:17:231717</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591718<div class="paragraph"><p>That is, from the left to the right:</p></div>
1719<div class="olist arabic"><ol class="arabic">
Junio C Hamano1a4e8412005-12-27 08:17:231720<li>
1721<p>
1722a colon.
1723</p>
1724</li>
1725<li>
1726<p>
1727mode for "src"; 000000 if creation or unmerged.
1728</p>
1729</li>
1730<li>
1731<p>
1732a space.
1733</p>
1734</li>
1735<li>
1736<p>
1737mode for "dst"; 000000 if deletion or unmerged.
1738</p>
1739</li>
1740<li>
1741<p>
1742a space.
1743</p>
1744</li>
1745<li>
1746<p>
1747sha1 for "src"; 0{40} if creation or unmerged.
1748</p>
1749</li>
1750<li>
1751<p>
1752a space.
1753</p>
1754</li>
1755<li>
1756<p>
1757sha1 for "dst"; 0{40} if creation, unmerged or "look at work tree".
1758</p>
1759</li>
1760<li>
1761<p>
1762a space.
1763</p>
1764</li>
1765<li>
1766<p>
1767status, followed by optional "score" number.
1768</p>
1769</li>
1770<li>
1771<p>
1772a tab or a NUL when <em>-z</em> option is used.
1773</p>
1774</li>
1775<li>
1776<p>
1777path for "src"
1778</p>
1779</li>
1780<li>
1781<p>
1782a tab or a NUL when <em>-z</em> option is used; only exists for C or R.
1783</p>
1784</li>
1785<li>
1786<p>
1787path for "dst"; only exists for C or R.
1788</p>
1789</li>
1790<li>
1791<p>
1792an LF or a NUL when <em>-z</em> option is used, to terminate the record.
1793</p>
1794</li>
Junio C Hamanoba4b9282008-07-06 05:20:311795</ol></div>
Junio C Hamano68cf15a2010-11-06 01:01:591796<div class="paragraph"><p>Possible status letters are:</p></div>
1797<div class="ulist"><ul>
Junio C Hamanoaa17c7c2008-11-03 04:36:581798<li>
1799<p>
1800A: addition of a file
1801</p>
1802</li>
1803<li>
1804<p>
1805C: copy of a file into a new one
1806</p>
1807</li>
1808<li>
1809<p>
1810D: deletion of a file
1811</p>
1812</li>
1813<li>
1814<p>
1815M: modification of the contents or mode of a file
1816</p>
1817</li>
1818<li>
1819<p>
1820R: renaming of a file
1821</p>
1822</li>
1823<li>
1824<p>
1825T: change in the type of the file
1826</p>
1827</li>
1828<li>
1829<p>
1830U: file is unmerged (you must complete the merge before it can
1831be committed)
1832</p>
1833</li>
1834<li>
1835<p>
1836X: "unknown" change type (most probably a bug, please report it)
1837</p>
1838</li>
1839</ul></div>
Junio C Hamano68cf15a2010-11-06 01:01:591840<div class="paragraph"><p>Status letters C and R are always followed by a score (denoting the
Junio C Hamanoaa17c7c2008-11-03 04:36:581841percentage of similarity between the source and target of the move or
1842copy), and are the only ones to be so.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591843<div class="paragraph"><p>&lt;sha1&gt; is shown as all 0&#8217;s if a file is new on the filesystem
Junio C Hamanoba4b9282008-07-06 05:20:311844and it is out of sync with the index.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591845<div class="paragraph"><p>Example:</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231846<div class="listingblock">
1847<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:271848<pre><code>:100644 100644 5be4a4...... 000000...... M file.c</code></pre>
Junio C Hamano1a4e8412005-12-27 08:17:231849</div></div>
Junio C Hamano9629d4f2012-12-19 00:28:271850<div class="paragraph"><p>When <code>-z</code> option is not used, TAB, LF, and backslash characters
1851in pathnames are represented as <code>\t</code>, <code>\n</code>, and <code>\\</code>,
Junio C Hamanoba4b9282008-07-06 05:20:311852respectively.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231853</div>
Junio C Hamano9629d4f2012-12-19 00:28:271854</div>
1855<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:311856<h2 id="_diff_format_for_merges">diff format for merges</h2>
Junio C Hamano67fad6d2007-05-06 08:53:121857<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:591858<div class="paragraph"><p>"git-diff-tree", "git-diff-files" and "git-diff --raw"
Junio C Hamano7ae0ab22007-11-03 02:46:461859can take <em>-c</em> or <em>--cc</em> option
Junio C Hamano67fad6d2007-05-06 08:53:121860to generate diff output also for merge commits. The output differs
Junio C Hamanoba4b9282008-07-06 05:20:311861from the format described above in the following way:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591862<div class="olist arabic"><ol class="arabic">
Junio C Hamano67fad6d2007-05-06 08:53:121863<li>
1864<p>
1865there is a colon for each parent
1866</p>
1867</li>
1868<li>
1869<p>
1870there are more "src" modes and "src" sha1
1871</p>
1872</li>
1873<li>
1874<p>
1875status is concatenated status characters for each parent
1876</p>
1877</li>
1878<li>
1879<p>
1880no optional "score" number
1881</p>
1882</li>
1883<li>
1884<p>
1885single path, only for "dst"
1886</p>
1887</li>
Junio C Hamanoba4b9282008-07-06 05:20:311888</ol></div>
Junio C Hamano68cf15a2010-11-06 01:01:591889<div class="paragraph"><p>Example:</p></div>
Junio C Hamano67fad6d2007-05-06 08:53:121890<div class="listingblock">
1891<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:271892<pre><code>::100644 100644 100644 fabadb8... cc95eb0... 4866510... MM describe.c</code></pre>
Junio C Hamano67fad6d2007-05-06 08:53:121893</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591894<div class="paragraph"><p>Note that <em>combined diff</em> lists only files which were modified from
Junio C Hamanoba4b9282008-07-06 05:20:311895all parents.</p></div>
Junio C Hamano67fad6d2007-05-06 08:53:121896</div>
Junio C Hamano9629d4f2012-12-19 00:28:271897</div>
1898<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:311899<h2 id="_generating_patches_with_p">Generating patches with -p</h2>
Junio C Hamano1a4e8412005-12-27 08:17:231900<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:591901<div class="paragraph"><p>When "git-diff-index", "git-diff-tree", or "git-diff-files" are run
Junio C Hamano00b8b632007-12-07 09:50:491902with a <em>-p</em> option, "git diff" without the <em>--raw</em> option, or
1903"git log" with the "-p" option, they
Junio C Hamano7ae0ab22007-11-03 02:46:461904do not produce the output described above; instead they produce a
1905patch file. You can customize the creation of such patches via the
Junio C Hamanoba4b9282008-07-06 05:20:311906GIT_EXTERNAL_DIFF and the GIT_DIFF_OPTS environment variables.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591907<div class="paragraph"><p>What the -p option produces is slightly different from the traditional
Junio C Hamano7f9fa862010-10-19 23:51:141908diff format:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591909<div class="olist arabic"><ol class="arabic">
Junio C Hamano1a4e8412005-12-27 08:17:231910<li>
1911<p>
Junio C Hamano7f9fa862010-10-19 23:51:141912It is preceded with a "git diff" header that looks like this:
Junio C Hamano1a4e8412005-12-27 08:17:231913</p>
1914<div class="literalblock">
1915<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:271916<pre><code>diff --git a/file1 b/file2</code></pre>
Junio C Hamano1a4e8412005-12-27 08:17:231917</div></div>
Junio C Hamano9629d4f2012-12-19 00:28:271918<div class="paragraph"><p>The <code>a/</code> and <code>b/</code> filenames are the same unless rename/copy is
Junio C Hamano1a4e8412005-12-27 08:17:231919involved. Especially, even for a creation or a deletion,
Junio C Hamano9629d4f2012-12-19 00:28:271920<code>/dev/null</code> is <em>not</em> used in place of the <code>a/</code> or <code>b/</code> filenames.</p></div>
1921<div class="paragraph"><p>When rename/copy is involved, <code>file1</code> and <code>file2</code> show the
Junio C Hamano1a4e8412005-12-27 08:17:231922name of the source file of the rename/copy and the name of
Junio C Hamanoba4b9282008-07-06 05:20:311923the file that rename/copy produces, respectively.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231924</li>
1925<li>
1926<p>
1927It is followed by one or more extended header lines:
1928</p>
1929<div class="literalblock">
1930<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:271931<pre><code>old mode &lt;mode&gt;
Junio C Hamano1a4e8412005-12-27 08:17:231932new mode &lt;mode&gt;
1933deleted file mode &lt;mode&gt;
1934new file mode &lt;mode&gt;
1935copy from &lt;path&gt;
1936copy to &lt;path&gt;
1937rename from &lt;path&gt;
1938rename to &lt;path&gt;
1939similarity index &lt;number&gt;
1940dissimilarity index &lt;number&gt;
Junio C Hamano9629d4f2012-12-19 00:28:271941index &lt;hash&gt;..&lt;hash&gt; &lt;mode&gt;</code></pre>
Junio C Hamano1a4e8412005-12-27 08:17:231942</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591943<div class="paragraph"><p>File modes are printed as 6-digit octal numbers including the file type
Junio C Hamano7f9fa862010-10-19 23:51:141944and file permission bits.</p></div>
Junio C Hamano9629d4f2012-12-19 00:28:271945<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:591946<div class="paragraph"><p>The similarity index is the percentage of unchanged lines, and
Junio C Hamano7f9fa862010-10-19 23:51:141947the dissimilarity index is the percentage of changed lines. It
1948is a rounded down integer, followed by a percent sign. The
1949similarity index value of 100% is thus reserved for two equal
1950files, while 100% dissimilarity means that no line from the old
1951file made it into the new one.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591952<div class="paragraph"><p>The index line includes the SHA-1 checksum before and after the change.
Junio C Hamano7f9fa862010-10-19 23:51:141953The &lt;mode&gt; is included if the file mode does not change; otherwise,
1954separate lines indicate the old and the new mode.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231955</li>
1956<li>
1957<p>
Junio C Hamanoa053d542006-10-27 09:29:131958TAB, LF, double quote and backslash characters in pathnames
Junio C Hamano9629d4f2012-12-19 00:28:271959 are represented as <code>\t</code>, <code>\n</code>, <code>\"</code> and <code>\\</code>, respectively.
Junio C Hamanoa053d542006-10-27 09:29:131960 If there is need for such substitution then the whole
1961 pathname is put in double quotes.
Junio C Hamano1a4e8412005-12-27 08:17:231962</p>
1963</li>
Junio C Hamano7f9fa862010-10-19 23:51:141964<li>
1965<p>
Junio C Hamano9629d4f2012-12-19 00:28:271966All the <code>file1</code> files in the output refer to files before the
1967 commit, and all the <code>file2</code> files refer to files after the commit.
Junio C Hamano7f9fa862010-10-19 23:51:141968 It is incorrect to apply each change to each file sequentially. For
1969 example, this patch will swap a and b:
1970</p>
1971<div class="literalblock">
1972<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:271973<pre><code>diff --git a/a b/b
Junio C Hamano7f9fa862010-10-19 23:51:141974rename from a
1975rename to b
1976diff --git a/b b/a
1977rename from b
Junio C Hamano9629d4f2012-12-19 00:28:271978rename to a</code></pre>
Junio C Hamano7f9fa862010-10-19 23:51:141979</div></div>
1980</li>
Junio C Hamanoba4b9282008-07-06 05:20:311981</ol></div>
Junio C Hamano1a4e8412005-12-27 08:17:231982</div>
Junio C Hamano9629d4f2012-12-19 00:28:271983</div>
1984<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:311985<h2 id="_combined_diff_format">combined diff format</h2>
Junio C Hamanofb56a962006-01-28 10:38:191986<div class="sectionbody">
Junio C Hamano9629d4f2012-12-19 00:28:271987<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:431988produce a <em>combined diff</em> when showing a merge. This is the default
Junio C Hamanoa28a9202012-06-21 07:08:231989format when showing merges with <a href="git-diff.html">git-diff(1)</a> or
1990<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:431991of these commands to force generation of diffs with individual parents
1992of a merge.</p></div>
1993<div class="paragraph"><p>A <em>combined diff</em> format looks like this:</p></div>
Junio C Hamanofb56a962006-01-28 10:38:191994<div class="listingblock">
1995<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:271996<pre><code>diff --combined describe.c
Junio C Hamano29f14312006-10-26 08:47:291997index fabadb8,cc95eb0..4866510
1998--- a/describe.c
1999+++ b/describe.c
2000@@@ -98,20 -98,12 +98,20 @@@
2001 return (a_date &gt; b_date) ? -1 : (a_date == b_date) ? 0 : 1;
Junio C Hamanofb56a962006-01-28 10:38:192002 }
2003
2004- static void describe(char *arg)
2005 -static void describe(struct commit *cmit, int last_one)
2006++static void describe(char *arg, int last_one)
2007 {
Junio C Hamano29f14312006-10-26 08:47:292008 + unsigned char sha1[20];
2009 + struct commit *cmit;
2010 struct commit_list *list;
2011 static int initialized = 0;
2012 struct commit_name *n;
2013
2014 + if (get_sha1(arg, sha1) &lt; 0)
2015 + usage(describe_usage);
2016 + cmit = lookup_commit_reference(sha1);
2017 + if (!cmit)
2018 + usage(describe_usage);
2019 +
2020 if (!initialized) {
2021 initialized = 1;
Junio C Hamano9629d4f2012-12-19 00:28:272022 for_each_ref(get_name);</code></pre>
Junio C Hamanofb56a962006-01-28 10:38:192023</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592024<div class="olist arabic"><ol class="arabic">
Junio C Hamano29f14312006-10-26 08:47:292025<li>
2026<p>
2027It is preceded with a "git diff" header, that looks like
2028 this (when <em>-c</em> option is used):
2029</p>
2030<div class="literalblock">
2031<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272032<pre><code>diff --combined file</code></pre>
Junio C Hamano29f14312006-10-26 08:47:292033</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592034<div class="paragraph"><p>or like this (when <em>--cc</em> option is used):</p></div>
Junio C Hamano29f14312006-10-26 08:47:292035<div class="literalblock">
2036<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272037<pre><code>diff --cc file</code></pre>
Junio C Hamano29f14312006-10-26 08:47:292038</div></div>
2039</li>
2040<li>
2041<p>
2042It is followed by one or more extended header lines
2043 (this example shows a merge with two parents):
2044</p>
2045<div class="literalblock">
2046<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272047<pre><code>index &lt;hash&gt;,&lt;hash&gt;..&lt;hash&gt;
Junio C Hamano29f14312006-10-26 08:47:292048mode &lt;mode&gt;,&lt;mode&gt;..&lt;mode&gt;
2049new file mode &lt;mode&gt;
Junio C Hamano9629d4f2012-12-19 00:28:272050deleted file mode &lt;mode&gt;,&lt;mode&gt;</code></pre>
Junio C Hamano29f14312006-10-26 08:47:292051</div></div>
Junio C Hamano9629d4f2012-12-19 00:28:272052<div class="paragraph"><p>The <code>mode &lt;mode&gt;,&lt;mode&gt;..&lt;mode&gt;</code> line appears only if at least one of
Junio C Hamanoee1e4282007-02-04 08:32:042053the &lt;mode&gt; is different from the rest. Extended headers with
Junio C Hamano29f14312006-10-26 08:47:292054information about detected contents movement (renames and
2055copying detection) are designed to work with diff of two
Junio C Hamanoba4b9282008-07-06 05:20:312056&lt;tree-ish&gt; and are not used by combined diff format.</p></div>
Junio C Hamano29f14312006-10-26 08:47:292057</li>
2058<li>
2059<p>
2060It is followed by two-line from-file/to-file header
2061</p>
2062<div class="literalblock">
2063<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272064<pre><code>--- a/file
2065+++ b/file</code></pre>
Junio C Hamano29f14312006-10-26 08:47:292066</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592067<div class="paragraph"><p>Similar to two-line header for traditional <em>unified</em> diff
Junio C Hamano9629d4f2012-12-19 00:28:272068format, <code>/dev/null</code> is used to signal created or deleted
Junio C Hamanoba4b9282008-07-06 05:20:312069files.</p></div>
Junio C Hamano29f14312006-10-26 08:47:292070</li>
2071<li>
2072<p>
2073Chunk header format is modified to prevent people from
Junio C Hamano9629d4f2012-12-19 00:28:272074 accidentally feeding it to <code>patch -p1</code>. Combined diff format
Junio C Hamano29f14312006-10-26 08:47:292075 was created for review of merge commit changes, and was not
2076 meant for apply. The change is similar to the change in the
2077 extended <em>index</em> header:
2078</p>
2079<div class="literalblock">
2080<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272081<pre><code>@@@ &lt;from-file-range&gt; &lt;from-file-range&gt; &lt;to-file-range&gt; @@@</code></pre>
Junio C Hamano29f14312006-10-26 08:47:292082</div></div>
Junio C Hamano9629d4f2012-12-19 00:28:272083<div class="paragraph"><p>There are (number of parents + 1) <code>@</code> characters in the chunk
Junio C Hamanoba4b9282008-07-06 05:20:312084header for combined diff format.</p></div>
Junio C Hamano29f14312006-10-26 08:47:292085</li>
Junio C Hamanoba4b9282008-07-06 05:20:312086</ol></div>
Junio C Hamano68cf15a2010-11-06 01:01:592087<div class="paragraph"><p>Unlike the traditional <em>unified</em> diff format, which shows two
Junio C Hamano9629d4f2012-12-19 00:28:272088files 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
2089added to B), or <code>" "</code> (space&#8201;&#8212;&#8201;unchanged) prefix, this format
Junio C Hamanofb56a962006-01-28 10:38:192090compares two or more files file1, file2,&#8230; with one file X, and
2091shows how X differs from each of fileN. One column for each of
Junio C Hamano68cf15a2010-11-06 01:01:592092fileN is prepended to the output line to note how X&#8217;s line is
Junio C Hamanoba4b9282008-07-06 05:20:312093different from it.</p></div>
Junio C Hamano9629d4f2012-12-19 00:28:272094<div class="paragraph"><p>A <code>-</code> character in the column N means that the line appears in
2095fileN but it does not appear in the result. A <code>+</code> character
Junio C Hamano54bf1e22008-12-20 06:30:112096in the column N means that the line appears in the result,
Junio C Hamano29f14312006-10-26 08:47:292097and fileN does not have that line (in other words, the line was
Junio C Hamanoba4b9282008-07-06 05:20:312098added, from the point of view of that parent).</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592099<div class="paragraph"><p>In the above example output, the function signature was changed
Junio C Hamano9629d4f2012-12-19 00:28:272100from both files (hence two <code>-</code> removals from both file1 and
2101file2, plus <code>++</code> to mean one line that was added does not appear
Junio C Hamano54bf1e22008-12-20 06:30:112102in either file1 nor file2). Also eight other lines are the same
Junio C Hamano9629d4f2012-12-19 00:28:272103from file1 but do not appear in file2 (hence prefixed with <code>+</code>).</p></div>
2104<div class="paragraph"><p>When shown by <code>git diff-tree -c</code>, it compares the parents of a
Junio C Hamanofb56a962006-01-28 10:38:192105merge commit with the merge result (i.e. file1..fileN are the
Junio C Hamano9629d4f2012-12-19 00:28:272106parents). When shown by <code>git diff-files -c</code>, it compares the
Junio C Hamanofb56a962006-01-28 10:38:192107two unresolved merge parents with the working tree file
2108(i.e. file1 is stage 2 aka "our version", file2 is stage 3 aka
Junio C Hamanoba4b9282008-07-06 05:20:312109"their version").</p></div>
Junio C Hamanofb56a962006-01-28 10:38:192110</div>
Junio C Hamano9629d4f2012-12-19 00:28:272111</div>
2112<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:312113<h2 id="_other_diff_formats">other diff formats</h2>
Junio C Hamano3a702342007-12-12 21:34:022114<div class="sectionbody">
Junio C Hamano9629d4f2012-12-19 00:28:272115<div class="paragraph"><p>The <code>--summary</code> option describes newly added, deleted, renamed and
2116copied files. The <code>--stat</code> option adds diffstat(1) graph to the
Junio C Hamano3a702342007-12-12 21:34:022117output. These options can be combined with other options, such as
Junio C Hamano9629d4f2012-12-19 00:28:272118<code>-p</code>, and are meant for human consumption.</p></div>
2119<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:022120formats the pathnames compactly by combining common prefix and suffix of
Junio C Hamano9629d4f2012-12-19 00:28:272121the pathnames. For example, a change that moves <code>arch/i386/Makefile</code> to
2122<code>arch/x86/Makefile</code> while modifying 4 lines will be shown like this:</p></div>
Junio C Hamano3a702342007-12-12 21:34:022123<div class="listingblock">
2124<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272125<pre><code>arch/{i386 =&gt; x86}/Makefile | 4 +--</code></pre>
Junio C Hamano3a702342007-12-12 21:34:022126</div></div>
Junio C Hamano9629d4f2012-12-19 00:28:272127<div class="paragraph"><p>The <code>--numstat</code> option gives the diffstat(1) information but is designed
2128for easier machine consumption. An entry in <code>--numstat</code> output looks
Junio C Hamanoba4b9282008-07-06 05:20:312129like this:</p></div>
Junio C Hamano3a702342007-12-12 21:34:022130<div class="listingblock">
2131<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272132<pre><code>1 2 README
21333 1 arch/{i386 =&gt; x86}/Makefile</code></pre>
Junio C Hamano3a702342007-12-12 21:34:022134</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592135<div class="paragraph"><p>That is, from left to right:</p></div>
2136<div class="olist arabic"><ol class="arabic">
Junio C Hamano3a702342007-12-12 21:34:022137<li>
2138<p>
2139the number of added lines;
2140</p>
2141</li>
2142<li>
2143<p>
2144a tab;
2145</p>
2146</li>
2147<li>
2148<p>
2149the number of deleted lines;
2150</p>
2151</li>
2152<li>
2153<p>
2154a tab;
2155</p>
2156</li>
2157<li>
2158<p>
2159pathname (possibly with rename/copy information);
2160</p>
2161</li>
2162<li>
2163<p>
2164a newline.
2165</p>
2166</li>
Junio C Hamanoba4b9282008-07-06 05:20:312167</ol></div>
Junio C Hamano9629d4f2012-12-19 00:28:272168<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:022169<div class="listingblock">
2170<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272171<pre><code>1 2 README NUL
21723 1 NUL arch/i386/Makefile NUL arch/x86/Makefile NUL</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:</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>
2198a NUL (only exists if renamed/copied);
2199</p>
2200</li>
2201<li>
2202<p>
2203pathname in preimage;
2204</p>
2205</li>
2206<li>
2207<p>
2208a NUL (only exists if renamed/copied);
2209</p>
2210</li>
2211<li>
2212<p>
2213pathname in postimage (only exists if renamed/copied);
2214</p>
2215</li>
2216<li>
2217<p>
2218a NUL.
2219</p>
2220</li>
Junio C Hamanoba4b9282008-07-06 05:20:312221</ol></div>
Junio C Hamano9629d4f2012-12-19 00:28:272222<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:022223scripts that read the output to tell if the current record being read is
2224a single-path record or a rename/copy record without reading ahead.
Junio C Hamano9629d4f2012-12-19 00:28:272225After reading added and deleted lines, reading up to <code>NUL</code> would yield
2226the pathname, but if that is <code>NUL</code>, the record will show two paths.</p></div>
Junio C Hamano3a702342007-12-12 21:34:022227</div>
Junio C Hamano9629d4f2012-12-19 00:28:272228</div>
2229<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:312230<h2 id="_git">GIT</h2>
Junio C Hamano1a4e8412005-12-27 08:17:232231<div class="sectionbody">
Junio C Hamanoa28a9202012-06-21 07:08:232232<div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232233</div>
Junio C Hamano7bd050f2011-09-22 06:32:222234</div>
Junio C Hamano9629d4f2012-12-19 00:28:272235</div>
Junio C Hamano7bd050f2011-09-22 06:32:222236<div id="footnotes"><hr /></div>
Junio C Hamano1a4e8412005-12-27 08:17:232237<div id="footer">
2238<div id="footer-text">
Junio C Hamano9629d4f2012-12-19 00:28:272239Last updated 2011-11-15 13:45:02 PST
Junio C Hamano1a4e8412005-12-27 08:17:232240</div>
2241</div>
2242</body>
2243</html>