blob: 5345859a79e5a9bd5d86fc56c5aa361c4ee40b38 [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" />
Junio C Hamanoc14e6ad2014-10-31 20:25:536<meta name="generator" content="AsciiDoc 8.6.9" />
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 Hamanoc14e6ad2014-10-31 20:25:5390.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}
Junio C Hamanoc14e6ad2014-10-31 20:25:5397pre {
98 white-space: pre-wrap;
99}
Junio C Hamano1a4e8412005-12-27 08:17:23100
Junio C Hamano9629d4f2012-12-19 00:28:27101#author {
Junio C Hamano1a4e8412005-12-27 08:17:23102 color: #527bbd;
Junio C Hamano1a4e8412005-12-27 08:17:23103 font-weight: bold;
Junio C Hamanoba4b9282008-07-06 05:20:31104 font-size: 1.1em;
Junio C Hamano1a4e8412005-12-27 08:17:23105}
Junio C Hamano9629d4f2012-12-19 00:28:27106#email {
Junio C Hamano1a4e8412005-12-27 08:17:23107}
Junio C Hamano9629d4f2012-12-19 00:28:27108#revnumber, #revdate, #revremark {
Junio C Hamano1a4e8412005-12-27 08:17:23109}
110
Junio C Hamano9629d4f2012-12-19 00:28:27111#footer {
Junio C Hamano1a4e8412005-12-27 08:17:23112 font-size: small;
113 border-top: 2px solid silver;
114 padding-top: 0.5em;
115 margin-top: 4.0em;
116}
Junio C Hamano9629d4f2012-12-19 00:28:27117#footer-text {
Junio C Hamano1a4e8412005-12-27 08:17:23118 float: left;
119 padding-bottom: 0.5em;
120}
Junio C Hamano9629d4f2012-12-19 00:28:27121#footer-badges {
Junio C Hamano1a4e8412005-12-27 08:17:23122 float: right;
123 padding-bottom: 0.5em;
124}
125
Junio C Hamano9629d4f2012-12-19 00:28:27126#preamble {
Junio C Hamano68cf15a2010-11-06 01:01:59127 margin-top: 1.5em;
128 margin-bottom: 1.5em;
129}
Junio C Hamano9629d4f2012-12-19 00:28:27130div.imageblock, div.exampleblock, div.verseblock,
Junio C Hamano1a4e8412005-12-27 08:17:23131div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
132div.admonitionblock {
Junio C Hamano7bd050f2011-09-22 06:32:22133 margin-top: 1.0em;
Junio C Hamano1a4e8412005-12-27 08:17:23134 margin-bottom: 1.5em;
135}
136div.admonitionblock {
Junio C Hamano7bd050f2011-09-22 06:32:22137 margin-top: 2.0em;
138 margin-bottom: 2.0em;
139 margin-right: 10%;
140 color: #606060;
Junio C Hamano1a4e8412005-12-27 08:17:23141}
142
143div.content { /* Block element content. */
144 padding: 0;
145}
146
147/* Block element titles. */
148div.title, caption.title {
Junio C Hamano68cf15a2010-11-06 01:01:59149 color: #527bbd;
Junio C Hamano1a4e8412005-12-27 08:17:23150 font-weight: bold;
151 text-align: left;
152 margin-top: 1.0em;
153 margin-bottom: 0.5em;
154}
155div.title + * {
156 margin-top: 0;
157}
158
159td div.title:first-child {
160 margin-top: 0.0em;
161}
162div.content div.title:first-child {
163 margin-top: 0.0em;
164}
165div.content + div.title {
166 margin-top: 0.0em;
167}
168
169div.sidebarblock > div.content {
170 background: #ffffee;
Junio C Hamano9629d4f2012-12-19 00:28:27171 border: 1px solid #dddddd;
172 border-left: 4px solid #f0f0f0;
Junio C Hamano1a4e8412005-12-27 08:17:23173 padding: 0.5em;
174}
175
176div.listingblock > div.content {
Junio C Hamano9629d4f2012-12-19 00:28:27177 border: 1px solid #dddddd;
178 border-left: 5px solid #f0f0f0;
179 background: #f8f8f8;
Junio C Hamano1a4e8412005-12-27 08:17:23180 padding: 0.5em;
181}
182
Junio C Hamano7bd050f2011-09-22 06:32:22183div.quoteblock, div.verseblock {
184 padding-left: 1.0em;
185 margin-left: 1.0em;
Junio C Hamano68cf15a2010-11-06 01:01:59186 margin-right: 10%;
Junio C Hamano9629d4f2012-12-19 00:28:27187 border-left: 5px solid #f0f0f0;
188 color: #888;
Junio C Hamano1a4e8412005-12-27 08:17:23189}
Junio C Hamano7bd050f2011-09-22 06:32:22190
Junio C Hamano68cf15a2010-11-06 01:01:59191div.quoteblock > div.attribution {
192 padding-top: 0.5em;
Junio C Hamano1a4e8412005-12-27 08:17:23193 text-align: right;
194}
Junio C Hamano68cf15a2010-11-06 01:01:59195
Junio C Hamano9629d4f2012-12-19 00:28:27196div.verseblock > pre.content {
197 font-family: inherit;
198 font-size: inherit;
Junio C Hamano68cf15a2010-11-06 01:01:59199}
200div.verseblock > div.attribution {
201 padding-top: 0.75em;
202 text-align: left;
203}
204/* DEPRECATED: Pre version 8.2.7 verse style literal block. */
Junio C Hamanoba4b9282008-07-06 05:20:31205div.verseblock + div.attribution {
206 text-align: left;
207}
Junio C Hamano1a4e8412005-12-27 08:17:23208
209div.admonitionblock .icon {
210 vertical-align: top;
211 font-size: 1.1em;
212 font-weight: bold;
213 text-decoration: underline;
214 color: #527bbd;
215 padding-right: 0.5em;
216}
217div.admonitionblock td.content {
218 padding-left: 0.5em;
Junio C Hamano7bd050f2011-09-22 06:32:22219 border-left: 3px solid #dddddd;
Junio C Hamano1a4e8412005-12-27 08:17:23220}
221
222div.exampleblock > div.content {
Junio C Hamano7bd050f2011-09-22 06:32:22223 border-left: 3px solid #dddddd;
224 padding-left: 0.5em;
Junio C Hamano1a4e8412005-12-27 08:17:23225}
226
Junio C Hamano1a4e8412005-12-27 08:17:23227div.imageblock div.content { padding-left: 0; }
Junio C Hamanoc14e6ad2014-10-31 20:25:53228span.image img { border-style: none; vertical-align: text-bottom; }
Junio C Hamano68cf15a2010-11-06 01:01:59229a.image:visited { color: white; }
Junio C Hamano1a4e8412005-12-27 08:17:23230
231dl {
232 margin-top: 0.8em;
233 margin-bottom: 0.8em;
234}
235dt {
236 margin-top: 0.5em;
237 margin-bottom: 0;
Junio C Hamano68cf15a2010-11-06 01:01:59238 font-style: normal;
239 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:23240}
241dd > *:first-child {
Junio C Hamano68cf15a2010-11-06 01:01:59242 margin-top: 0.1em;
Junio C Hamano1a4e8412005-12-27 08:17:23243}
244
245ul, ol {
246 list-style-position: outside;
247}
Junio C Hamano68cf15a2010-11-06 01:01:59248ol.arabic {
249 list-style-type: decimal;
250}
251ol.loweralpha {
Junio C Hamano1a4e8412005-12-27 08:17:23252 list-style-type: lower-alpha;
253}
Junio C Hamano68cf15a2010-11-06 01:01:59254ol.upperalpha {
255 list-style-type: upper-alpha;
256}
257ol.lowerroman {
258 list-style-type: lower-roman;
259}
260ol.upperroman {
261 list-style-type: upper-roman;
262}
263
264div.compact ul, div.compact ol,
265div.compact p, div.compact p,
266div.compact div, div.compact div {
267 margin-top: 0.1em;
268 margin-bottom: 0.1em;
269}
Junio C Hamano1a4e8412005-12-27 08:17:23270
Junio C Hamano1a4e8412005-12-27 08:17:23271tfoot {
272 font-weight: bold;
273}
Junio C Hamano68cf15a2010-11-06 01:01:59274td > div.verse {
275 white-space: pre;
276}
Junio C Hamano68cf15a2010-11-06 01:01:59277
278div.hdlist {
Junio C Hamano1a4e8412005-12-27 08:17:23279 margin-top: 0.8em;
280 margin-bottom: 0.8em;
281}
Junio C Hamano68cf15a2010-11-06 01:01:59282div.hdlist tr {
283 padding-bottom: 15px;
Junio C Hamanoba4b9282008-07-06 05:20:31284}
Junio C Hamano68cf15a2010-11-06 01:01:59285dt.hdlist1.strong, td.hdlist1.strong {
286 font-weight: bold;
287}
288td.hdlist1 {
Junio C Hamano1a4e8412005-12-27 08:17:23289 vertical-align: top;
Junio C Hamano68cf15a2010-11-06 01:01:59290 font-style: normal;
Junio C Hamano1a4e8412005-12-27 08:17:23291 padding-right: 0.8em;
Junio C Hamano68cf15a2010-11-06 01:01:59292 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:23293}
Junio C Hamano68cf15a2010-11-06 01:01:59294td.hdlist2 {
Junio C Hamano1a4e8412005-12-27 08:17:23295 vertical-align: top;
296}
Junio C Hamano68cf15a2010-11-06 01:01:59297div.hdlist.compact tr {
298 margin: 0;
299 padding-bottom: 0;
300}
301
302.comment {
303 background: yellow;
304}
Junio C Hamano1a4e8412005-12-27 08:17:23305
Junio C Hamano7bd050f2011-09-22 06:32:22306.footnote, .footnoteref {
307 font-size: 0.8em;
308}
309
310span.footnote, span.footnoteref {
311 vertical-align: super;
312}
313
314#footnotes {
315 margin: 20px 0 20px 0;
316 padding: 7px 0 0 0;
317}
318
319#footnotes div.footnote {
320 margin: 0 0 5px 0;
321}
322
323#footnotes hr {
324 border: none;
325 border-top: 1px solid silver;
326 height: 1px;
327 text-align: left;
328 margin-left: 0;
329 width: 20%;
330 min-width: 100px;
331}
332
Junio C Hamano9629d4f2012-12-19 00:28:27333div.colist td {
334 padding-right: 0.5em;
335 padding-bottom: 0.3em;
336 vertical-align: top;
337}
338div.colist td img {
339 margin-top: 0.3em;
Junio C Hamano1a4e8412005-12-27 08:17:23340}
Junio C Hamanoba4b9282008-07-06 05:20:31341
Junio C Hamano9629d4f2012-12-19 00:28:27342@media print {
343 #footer-badges { display: none; }
344}
345
346#toc {
Junio C Hamano7bd050f2011-09-22 06:32:22347 margin-bottom: 2.5em;
348}
349
Junio C Hamano9629d4f2012-12-19 00:28:27350#toctitle {
Junio C Hamanoba4b9282008-07-06 05:20:31351 color: #527bbd;
Junio C Hamanoba4b9282008-07-06 05:20:31352 font-size: 1.1em;
353 font-weight: bold;
354 margin-top: 1.0em;
355 margin-bottom: 0.1em;
356}
357
Junio C Hamanoc14e6ad2014-10-31 20:25:53358div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
Junio C Hamanoba4b9282008-07-06 05:20:31359 margin-top: 0;
360 margin-bottom: 0;
361}
362div.toclevel2 {
363 margin-left: 2em;
364 font-size: 0.9em;
365}
366div.toclevel3 {
367 margin-left: 4em;
368 font-size: 0.9em;
369}
370div.toclevel4 {
371 margin-left: 6em;
372 font-size: 0.9em;
373}
Junio C Hamano9629d4f2012-12-19 00:28:27374
375span.aqua { color: aqua; }
376span.black { color: black; }
377span.blue { color: blue; }
378span.fuchsia { color: fuchsia; }
379span.gray { color: gray; }
380span.green { color: green; }
381span.lime { color: lime; }
382span.maroon { color: maroon; }
383span.navy { color: navy; }
384span.olive { color: olive; }
385span.purple { color: purple; }
386span.red { color: red; }
387span.silver { color: silver; }
388span.teal { color: teal; }
389span.white { color: white; }
390span.yellow { color: yellow; }
391
392span.aqua-background { background: aqua; }
393span.black-background { background: black; }
394span.blue-background { background: blue; }
395span.fuchsia-background { background: fuchsia; }
396span.gray-background { background: gray; }
397span.green-background { background: green; }
398span.lime-background { background: lime; }
399span.maroon-background { background: maroon; }
400span.navy-background { background: navy; }
401span.olive-background { background: olive; }
402span.purple-background { background: purple; }
403span.red-background { background: red; }
404span.silver-background { background: silver; }
405span.teal-background { background: teal; }
406span.white-background { background: white; }
407span.yellow-background { background: yellow; }
408
409span.big { font-size: 2em; }
410span.small { font-size: 0.6em; }
411
412span.underline { text-decoration: underline; }
413span.overline { text-decoration: overline; }
414span.line-through { text-decoration: line-through; }
415
Junio C Hamanoc14e6ad2014-10-31 20:25:53416div.unbreakable { page-break-inside: avoid; }
417
Junio C Hamano9629d4f2012-12-19 00:28:27418
419/*
420 * xhtml11 specific
421 *
422 * */
423
424div.tableblock {
425 margin-top: 1.0em;
426 margin-bottom: 1.5em;
427}
428div.tableblock > table {
429 border: 3px solid #527bbd;
430}
431thead, p.table.header {
432 font-weight: bold;
433 color: #527bbd;
434}
435p.table {
436 margin-top: 0;
437}
438/* Because the table frame attribute is overriden by CSS in most browsers. */
439div.tableblock > table[frame="void"] {
440 border-style: none;
441}
442div.tableblock > table[frame="hsides"] {
443 border-left-style: none;
444 border-right-style: none;
445}
446div.tableblock > table[frame="vsides"] {
447 border-top-style: none;
448 border-bottom-style: none;
449}
450
451
452/*
453 * html5 specific
454 *
455 * */
456
457table.tableblock {
458 margin-top: 1.0em;
459 margin-bottom: 1.5em;
460}
461thead, p.tableblock.header {
462 font-weight: bold;
463 color: #527bbd;
464}
465p.tableblock {
466 margin-top: 0;
467}
468table.tableblock {
469 border-width: 3px;
470 border-spacing: 0px;
471 border-style: solid;
472 border-color: #527bbd;
473 border-collapse: collapse;
474}
475th.tableblock, td.tableblock {
476 border-width: 1px;
477 padding: 4px;
478 border-style: solid;
479 border-color: #527bbd;
480}
481
482table.tableblock.frame-topbot {
483 border-left-style: hidden;
484 border-right-style: hidden;
485}
486table.tableblock.frame-sides {
487 border-top-style: hidden;
488 border-bottom-style: hidden;
489}
490table.tableblock.frame-none {
491 border-style: hidden;
492}
493
494th.tableblock.halign-left, td.tableblock.halign-left {
495 text-align: left;
496}
497th.tableblock.halign-center, td.tableblock.halign-center {
498 text-align: center;
499}
500th.tableblock.halign-right, td.tableblock.halign-right {
501 text-align: right;
502}
503
504th.tableblock.valign-top, td.tableblock.valign-top {
505 vertical-align: top;
506}
507th.tableblock.valign-middle, td.tableblock.valign-middle {
508 vertical-align: middle;
509}
510th.tableblock.valign-bottom, td.tableblock.valign-bottom {
511 vertical-align: bottom;
512}
513
514
515/*
516 * manpage specific
517 *
518 * */
519
520body.manpage h1 {
Junio C Hamano68cf15a2010-11-06 01:01:59521 padding-top: 0.5em;
522 padding-bottom: 0.5em;
523 border-top: 2px solid silver;
524 border-bottom: 2px solid silver;
525}
Junio C Hamano9629d4f2012-12-19 00:28:27526body.manpage h2 {
Junio C Hamano68cf15a2010-11-06 01:01:59527 border-style: none;
528}
Junio C Hamano9629d4f2012-12-19 00:28:27529body.manpage div.sectionbody {
530 margin-left: 3em;
Junio C Hamano68cf15a2010-11-06 01:01:59531}
532
533@media print {
Junio C Hamano9629d4f2012-12-19 00:28:27534 body.manpage div#toc { display: none; }
Junio C Hamano68cf15a2010-11-06 01:01:59535}
Junio C Hamanoc14e6ad2014-10-31 20:25:53536
537
Junio C Hamano1a4e8412005-12-27 08:17:23538</style>
Junio C Hamano7bd050f2011-09-22 06:32:22539<script type="text/javascript">
540/*<![CDATA[*/
Junio C Hamano7bd050f2011-09-22 06:32:22541var asciidoc = { // Namespace.
542
543/////////////////////////////////////////////////////////////////////
544// Table Of Contents generator
545/////////////////////////////////////////////////////////////////////
546
547/* Author: Mihai Bazon, September 2002
548 * http://students.infoiasi.ro/~mishoo
549 *
550 * Table Of Content generator
551 * Version: 0.4
552 *
553 * Feel free to use this script under the terms of the GNU General Public
554 * License, as long as you do not remove or alter this notice.
555 */
556
557 /* modified by Troy D. Hanson, September 2006. License: GPL */
558 /* modified by Stuart Rackham, 2006, 2009. License: GPL */
559
560// toclevels = 1..4.
561toc: function (toclevels) {
562
563 function getText(el) {
564 var text = "";
565 for (var i = el.firstChild; i != null; i = i.nextSibling) {
566 if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
567 text += i.data;
568 else if (i.firstChild != null)
569 text += getText(i);
570 }
571 return text;
572 }
573
574 function TocEntry(el, text, toclevel) {
575 this.element = el;
576 this.text = text;
577 this.toclevel = toclevel;
578 }
579
580 function tocEntries(el, toclevels) {
581 var result = new Array;
Junio C Hamanoc14e6ad2014-10-31 20:25:53582 var re = new RegExp('[hH]([1-'+(toclevels+1)+'])');
Junio C Hamano7bd050f2011-09-22 06:32:22583 // Function that scans the DOM tree for header elements (the DOM2
584 // nodeIterator API would be a better technique but not supported by all
585 // browsers).
586 var iterate = function (el) {
587 for (var i = el.firstChild; i != null; i = i.nextSibling) {
588 if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
589 var mo = re.exec(i.tagName);
590 if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
591 result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
592 }
593 iterate(i);
594 }
595 }
596 }
597 iterate(el);
598 return result;
599 }
600
601 var toc = document.getElementById("toc");
Junio C Hamano9629d4f2012-12-19 00:28:27602 if (!toc) {
603 return;
604 }
605
606 // Delete existing TOC entries in case we're reloading the TOC.
607 var tocEntriesToRemove = [];
608 var i;
609 for (i = 0; i < toc.childNodes.length; i++) {
610 var entry = toc.childNodes[i];
Junio C Hamanoc14e6ad2014-10-31 20:25:53611 if (entry.nodeName.toLowerCase() == 'div'
Junio C Hamano9629d4f2012-12-19 00:28:27612 && entry.getAttribute("class")
613 && entry.getAttribute("class").match(/^toclevel/))
614 tocEntriesToRemove.push(entry);
615 }
616 for (i = 0; i < tocEntriesToRemove.length; i++) {
617 toc.removeChild(tocEntriesToRemove[i]);
618 }
619
620 // Rebuild TOC entries.
Junio C Hamano7bd050f2011-09-22 06:32:22621 var entries = tocEntries(document.getElementById("content"), toclevels);
622 for (var i = 0; i < entries.length; ++i) {
623 var entry = entries[i];
624 if (entry.element.id == "")
625 entry.element.id = "_toc_" + i;
626 var a = document.createElement("a");
627 a.href = "#" + entry.element.id;
628 a.appendChild(document.createTextNode(entry.text));
629 var div = document.createElement("div");
630 div.appendChild(a);
631 div.className = "toclevel" + entry.toclevel;
632 toc.appendChild(div);
633 }
634 if (entries.length == 0)
635 toc.parentNode.removeChild(toc);
636},
637
638
639/////////////////////////////////////////////////////////////////////
640// Footnotes generator
641/////////////////////////////////////////////////////////////////////
642
643/* Based on footnote generation code from:
644 * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
645 */
646
647footnotes: function () {
Junio C Hamano9629d4f2012-12-19 00:28:27648 // Delete existing footnote entries in case we're reloading the footnodes.
649 var i;
Junio C Hamano7bd050f2011-09-22 06:32:22650 var noteholder = document.getElementById("footnotes");
Junio C Hamano9629d4f2012-12-19 00:28:27651 if (!noteholder) {
652 return;
653 }
654 var entriesToRemove = [];
655 for (i = 0; i < noteholder.childNodes.length; i++) {
656 var entry = noteholder.childNodes[i];
Junio C Hamanoc14e6ad2014-10-31 20:25:53657 if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote")
Junio C Hamano9629d4f2012-12-19 00:28:27658 entriesToRemove.push(entry);
659 }
660 for (i = 0; i < entriesToRemove.length; i++) {
661 noteholder.removeChild(entriesToRemove[i]);
662 }
663
664 // Rebuild footnote entries.
665 var cont = document.getElementById("content");
Junio C Hamano7bd050f2011-09-22 06:32:22666 var spans = cont.getElementsByTagName("span");
667 var refs = {};
668 var n = 0;
669 for (i=0; i<spans.length; i++) {
670 if (spans[i].className == "footnote") {
671 n++;
Junio C Hamano9629d4f2012-12-19 00:28:27672 var note = spans[i].getAttribute("data-note");
673 if (!note) {
674 // Use [\s\S] in place of . so multi-line matches work.
675 // Because JavaScript has no s (dotall) regex flag.
676 note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
677 spans[i].innerHTML =
678 "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
679 "' title='View footnote' class='footnote'>" + n + "</a>]";
680 spans[i].setAttribute("data-note", note);
681 }
Junio C Hamano7bd050f2011-09-22 06:32:22682 noteholder.innerHTML +=
683 "<div class='footnote' id='_footnote_" + n + "'>" +
684 "<a href='#_footnoteref_" + n + "' title='Return to text'>" +
685 n + "</a>. " + note + "</div>";
Junio C Hamano7bd050f2011-09-22 06:32:22686 var id =spans[i].getAttribute("id");
687 if (id != null) refs["#"+id] = n;
688 }
689 }
690 if (n == 0)
691 noteholder.parentNode.removeChild(noteholder);
692 else {
693 // Process footnoterefs.
694 for (i=0; i<spans.length; i++) {
695 if (spans[i].className == "footnoteref") {
696 var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
697 href = href.match(/#.*/)[0]; // Because IE return full URL.
698 n = refs[href];
699 spans[i].innerHTML =
700 "[<a href='#_footnote_" + n +
701 "' title='View footnote' class='footnote'>" + n + "</a>]";
702 }
703 }
704 }
Junio C Hamano9629d4f2012-12-19 00:28:27705},
706
707install: function(toclevels) {
708 var timerId;
709
710 function reinstall() {
711 asciidoc.footnotes();
712 if (toclevels) {
713 asciidoc.toc(toclevels);
714 }
715 }
716
717 function reinstallAndRemoveTimer() {
718 clearInterval(timerId);
719 reinstall();
720 }
721
722 timerId = setInterval(reinstall, 500);
723 if (document.addEventListener)
724 document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false);
725 else
726 window.onload = reinstallAndRemoveTimer;
Junio C Hamano7bd050f2011-09-22 06:32:22727}
728
729}
Junio C Hamano9629d4f2012-12-19 00:28:27730asciidoc.install();
Junio C Hamano7bd050f2011-09-22 06:32:22731/*]]>*/
732</script>
Junio C Hamano1a4e8412005-12-27 08:17:23733</head>
Junio C Hamano9629d4f2012-12-19 00:28:27734<body class="manpage">
Junio C Hamano1a4e8412005-12-27 08:17:23735<div id="header">
736<h1>
737git-diff-files(1) Manual Page
738</h1>
739<h2>NAME</h2>
740<div class="sectionbody">
741<p>git-diff-files -
742 Compares files in the working tree and the index
743</p>
744</div>
745</div>
Junio C Hamano7bd050f2011-09-22 06:32:22746<div id="content">
Junio C Hamano9629d4f2012-12-19 00:28:27747<div class="sect1">
Junio C Hamano68cf15a2010-11-06 01:01:59748<h2 id="_synopsis">SYNOPSIS</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23749<div class="sectionbody">
Junio C Hamano15567bc2011-07-23 00:51:59750<div class="verseblock">
Junio C Hamano9629d4f2012-12-19 00:28:27751<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>
752<div class="attribution">
Junio C Hamano15567bc2011-07-23 00:51:59753</div></div>
Junio C Hamano1a4e8412005-12-27 08:17:23754</div>
Junio C Hamano9629d4f2012-12-19 00:28:27755</div>
756<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:31757<h2 id="_description">DESCRIPTION</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23758<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:59759<div class="paragraph"><p>Compares the files in the working tree and the index. When paths
Junio C Hamano1a4e8412005-12-27 08:17:23760are specified, compares only those named paths. Otherwise all
761entries in the index are compared. The output format is the
Junio C Hamano1aa40d22010-01-21 17:46:43762same as for <em>git diff-index</em> and <em>git diff-tree</em>.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:23763</div>
Junio C Hamano9629d4f2012-12-19 00:28:27764</div>
765<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:31766<h2 id="_options">OPTIONS</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23767<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:59768<div class="dlist"><dl>
769<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:23770-p
771</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59772<dt class="hdlist1">
Junio C Hamanobbbb8652008-12-29 10:34:22773-u
774</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59775<dt class="hdlist1">
Junio C Hamanoe97d5772010-05-19 08:13:58776--patch
777</dt>
Junio C Hamano1a4e8412005-12-27 08:17:23778<dd>
779<p>
Junio C Hamanoff979792007-11-16 10:11:30780 Generate patch (see section on generating patches).
Junio C Hamano1a4e8412005-12-27 08:17:23781</p>
782</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59783<dt class="hdlist1">
Junio C Hamano58f587a2013-07-22 19:20:59784-s
785</dt>
786<dt class="hdlist1">
787--no-patch
788</dt>
789<dd>
790<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:53791 Suppress diff output. Useful for commands like <code>git show</code> that
792 show the patch by default, or to cancel the effect of <code>--patch</code>.
Junio C Hamano58f587a2013-07-22 19:20:59793</p>
794</dd>
795<dt class="hdlist1">
Junio C Hamano69361562007-07-26 02:14:34796-U&lt;n&gt;
797</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59798<dt class="hdlist1">
Junio C Hamano69361562007-07-26 02:14:34799--unified=&lt;n&gt;
800</dt>
801<dd>
802<p>
803 Generate diffs with &lt;n&gt; lines of context instead of
Junio C Hamano3b70d3c2009-11-21 17:37:37804 the usual three.
Junio C Hamanoc14e6ad2014-10-31 20:25:53805 Implies <code>-p</code>.
Junio C Hamano69361562007-07-26 02:14:34806</p>
807</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59808<dt class="hdlist1">
Junio C Hamano9ae1a062006-07-10 08:12:34809--raw
810</dt>
811<dd>
812<p>
Junio C Hamano85f1fde2015-06-01 20:37:32813 Generate the diff in raw format.
Junio C Hamano1dbca522015-05-22 20:48:55814 This is the default.
Junio C Hamano9ae1a062006-07-10 08:12:34815</p>
816</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59817<dt class="hdlist1">
Junio C Hamano54559c82006-04-13 07:45:12818--patch-with-raw
819</dt>
820<dd>
821<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:53822 Synonym for <code>-p --raw</code>.
Junio C Hamano54559c82006-04-13 07:45:12823</p>
824</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59825<dt class="hdlist1">
Junio C Hamano5a73f302011-10-14 05:58:34826--minimal
827</dt>
828<dd>
829<p>
830 Spend extra time to make sure the smallest possible
831 diff is produced.
832</p>
833</dd>
834<dt class="hdlist1">
Junio C Hamano20d47e32009-01-26 06:36:02835--patience
836</dt>
837<dd>
838<p>
839 Generate a diff using the "patience diff" algorithm.
840</p>
841</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59842<dt class="hdlist1">
Junio C Hamanoaea9e6b2012-03-07 00:17:11843--histogram
844</dt>
845<dd>
846<p>
847 Generate a diff using the "histogram diff" algorithm.
848</p>
849</dd>
850<dt class="hdlist1">
Junio C Hamano80ad00d2013-02-18 00:19:03851--diff-algorithm={patience|minimal|histogram|myers}
852</dt>
853<dd>
854<p>
855 Choose a diff algorithm. The variants are as follows:
856</p>
857<div class="openblock">
858<div class="content">
859<div class="dlist"><dl>
860<dt class="hdlist1">
Junio C Hamanoc14e6ad2014-10-31 20:25:53861<code>default</code>, <code>myers</code>
Junio C Hamano80ad00d2013-02-18 00:19:03862</dt>
863<dd>
864<p>
865 The basic greedy diff algorithm. Currently, this is the default.
866</p>
867</dd>
868<dt class="hdlist1">
Junio C Hamanoc14e6ad2014-10-31 20:25:53869<code>minimal</code>
Junio C Hamano80ad00d2013-02-18 00:19:03870</dt>
871<dd>
872<p>
873 Spend extra time to make sure the smallest possible diff is
874 produced.
875</p>
876</dd>
877<dt class="hdlist1">
Junio C Hamanoc14e6ad2014-10-31 20:25:53878<code>patience</code>
Junio C Hamano80ad00d2013-02-18 00:19:03879</dt>
880<dd>
881<p>
882 Use "patience diff" algorithm when generating patches.
883</p>
884</dd>
885<dt class="hdlist1">
Junio C Hamanoc14e6ad2014-10-31 20:25:53886<code>histogram</code>
Junio C Hamano80ad00d2013-02-18 00:19:03887</dt>
888<dd>
889<p>
890 This algorithm extends the patience algorithm to "support
891 low-occurrence common elements".
892</p>
893</dd>
894</dl></div>
895</div></div>
896<div class="paragraph"><p>For instance, if you configured diff.algorithm variable to a
897non-default value and want to use the default one, then you
Junio C Hamanoc14e6ad2014-10-31 20:25:53898have to use <code>--diff-algorithm=default</code> option.</p></div>
Junio C Hamano80ad00d2013-02-18 00:19:03899</dd>
900<dt class="hdlist1">
Junio C Hamano4c4b0122011-06-30 01:19:32901--stat[=&lt;width&gt;[,&lt;name-width&gt;[,&lt;count&gt;]]]
Junio C Hamanoba7c8d82006-04-15 06:17:42902</dt>
903<dd>
904<p>
Junio C Hamanoaea9e6b2012-03-07 00:17:11905 Generate a diffstat. By default, as much space as necessary
906 will be used for the filename part, and the rest for the graph
907 part. Maximum width defaults to terminal width, or 80 columns
Junio C Hamano7f2b3cb2012-06-22 22:42:39908 if not connected to a terminal, and can be overridden by
Junio C Hamanoc14e6ad2014-10-31 20:25:53909 <code>&lt;width&gt;</code>. The width of the filename part can be limited by
910 giving another width <code>&lt;name-width&gt;</code> after a comma. The width
Junio C Hamanoaea9e6b2012-03-07 00:17:11911 of the graph part can be limited by using
Junio C Hamanoc14e6ad2014-10-31 20:25:53912 <code>--stat-graph-width=&lt;width&gt;</code> (affects all commands generating
913 a stat graph) or by setting <code>diff.statGraphWidth=&lt;width&gt;</code>
914 (does not affect <code>git format-patch</code>).
915 By giving a third parameter <code>&lt;count&gt;</code>, you can limit the
916 output to the first <code>&lt;count&gt;</code> lines, followed by <code>...</code> if
Junio C Hamanoaea9e6b2012-03-07 00:17:11917 there are more.
Junio C Hamanoba7c8d82006-04-15 06:17:42918</p>
Junio C Hamanoc14e6ad2014-10-31 20:25:53919<div class="paragraph"><p>These parameters can also be set individually with <code>--stat-width=&lt;width&gt;</code>,
920<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:42921</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59922<dt class="hdlist1">
Junio C Hamanofbe00522006-10-19 05:58:48923--numstat
924</dt>
925<dd>
926<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:53927 Similar to <code>--stat</code>, but shows number of added and
Junio C Hamanofbe00522006-10-19 05:58:48928 deleted lines in decimal notation and pathname without
Junio C Hamanod793de52006-12-26 09:11:43929 abbreviation, to make it more machine friendly. For
Junio C Hamanoc14e6ad2014-10-31 20:25:53930 binary files, outputs two <code>-</code> instead of saying
931 <code>0 0</code>.
Junio C Hamanofbe00522006-10-19 05:58:48932</p>
933</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59934<dt class="hdlist1">
Junio C Hamano7d23f5e2006-12-16 07:44:04935--shortstat
936</dt>
937<dd>
938<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:53939 Output only the last line of the <code>--stat</code> format containing total
Junio C Hamano7d23f5e2006-12-16 07:44:04940 number of modified files, as well as number of added and deleted
941 lines.
942</p>
943</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59944<dt class="hdlist1">
Junio C Hamano1c222c52011-05-13 19:55:32945--dirstat[=&lt;param1,param2,&#8230;&gt;]
Junio C Hamano6a45be92008-04-22 08:19:03946</dt>
947<dd>
948<p>
Junio C Hamano1c222c52011-05-13 19:55:32949 Output the distribution of relative amount of changes for each
Junio C Hamanoc14e6ad2014-10-31 20:25:53950 sub-directory. The behavior of <code>--dirstat</code> can be customized by
Junio C Hamano1c222c52011-05-13 19:55:32951 passing it a comma separated list of parameters.
Junio C Hamanoc14e6ad2014-10-31 20:25:53952 The defaults are controlled by the <code>diff.dirstat</code> configuration
Junio C Hamanoa28a9202012-06-21 07:08:23953 variable (see <a href="git-config.html">git-config(1)</a>).
Junio C Hamano1c222c52011-05-13 19:55:32954 The following parameters are available:
Junio C Hamano6a45be92008-04-22 08:19:03955</p>
Junio C Hamano9629d4f2012-12-19 00:28:27956<div class="openblock">
957<div class="content">
Junio C Hamano1c222c52011-05-13 19:55:32958<div class="dlist"><dl>
959<dt class="hdlist1">
Junio C Hamanoc14e6ad2014-10-31 20:25:53960<code>changes</code>
Junio C Hamano1c222c52011-05-13 19:55:32961</dt>
962<dd>
963<p>
964 Compute the dirstat numbers by counting the lines that have been
965 removed from the source, or added to the destination. This ignores
966 the amount of pure code movements within a file. In other words,
967 rearranging lines in a file is not counted as much as other changes.
968 This is the default behavior when no parameter is given.
969</p>
Junio C Hamano6a45be92008-04-22 08:19:03970</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59971<dt class="hdlist1">
Junio C Hamanoc14e6ad2014-10-31 20:25:53972<code>lines</code>
Junio C Hamanoa476efa2008-10-10 15:31:42973</dt>
974<dd>
975<p>
Junio C Hamano1c222c52011-05-13 19:55:32976 Compute the dirstat numbers by doing the regular line-based diff
977 analysis, and summing the removed/added line counts. (For binary
978 files, count 64-byte chunks instead, since binary files have no
Junio C Hamanoc14e6ad2014-10-31 20:25:53979 natural concept of lines). This is a more expensive <code>--dirstat</code>
980 behavior than the <code>changes</code> behavior, but it does count rearranged
Junio C Hamano1c222c52011-05-13 19:55:32981 lines within a file as much as other changes. The resulting output
Junio C Hamanoc14e6ad2014-10-31 20:25:53982 is consistent with what you get from the other <code>--*stat</code> options.
Junio C Hamanoa476efa2008-10-10 15:31:42983</p>
984</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59985<dt class="hdlist1">
Junio C Hamanoc14e6ad2014-10-31 20:25:53986<code>files</code>
Junio C Hamano1c222c52011-05-13 19:55:32987</dt>
988<dd>
989<p>
990 Compute the dirstat numbers by counting the number of files changed.
991 Each changed file counts equally in the dirstat analysis. This is
Junio C Hamanoc14e6ad2014-10-31 20:25:53992 the computationally cheapest <code>--dirstat</code> behavior, since it does
Junio C Hamano1c222c52011-05-13 19:55:32993 not have to look at the file contents at all.
994</p>
995</dd>
996<dt class="hdlist1">
Junio C Hamanoc14e6ad2014-10-31 20:25:53997<code>cumulative</code>
Junio C Hamano1c222c52011-05-13 19:55:32998</dt>
999<dd>
1000<p>
1001 Count changes in a child directory for the parent directory as well.
Junio C Hamanoc14e6ad2014-10-31 20:25:531002 Note that when using <code>cumulative</code>, the sum of the percentages
Junio C Hamano1c222c52011-05-13 19:55:321003 reported may exceed 100%. The default (non-cumulative) behavior can
Junio C Hamanoc14e6ad2014-10-31 20:25:531004 be specified with the <code>noncumulative</code> parameter.
Junio C Hamano1c222c52011-05-13 19:55:321005</p>
1006</dd>
1007<dt class="hdlist1">
1008&lt;limit&gt;
1009</dt>
1010<dd>
1011<p>
1012 An integer parameter specifies a cut-off percent (3% by default).
1013 Directories contributing less than this percentage of the changes
1014 are not shown in the output.
1015</p>
1016</dd>
1017</dl></div>
Junio C Hamano9629d4f2012-12-19 00:28:271018</div></div>
Junio C Hamano1c222c52011-05-13 19:55:321019<div class="paragraph"><p>Example: The following will count changed files, while ignoring
1020directories with less than 10% of the total amount of changed files,
1021and accumulating child directory counts in the parent directories:
Junio C Hamanoc14e6ad2014-10-31 20:25:531022<code>--dirstat=files,10,cumulative</code>.</p></div>
Junio C Hamano1c222c52011-05-13 19:55:321023</dd>
1024<dt class="hdlist1">
Junio C Hamano6959c6c2006-05-17 10:34:111025--summary
1026</dt>
1027<dd>
1028<p>
1029 Output a condensed summary of extended header information
1030 such as creations, renames and mode changes.
1031</p>
1032</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591033<dt class="hdlist1">
Junio C Hamanod1308c92006-04-16 11:01:091034--patch-with-stat
1035</dt>
1036<dd>
1037<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:531038 Synonym for <code>-p --stat</code>.
Junio C Hamanod1308c92006-04-16 11:01:091039</p>
1040</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591041<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231042-z
1043</dt>
1044<dd>
1045<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:531046 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:341047 given, do not munge pathnames and use NULs as output field terminators.
Junio C Hamano1a4e8412005-12-27 08:17:231048</p>
Junio C Hamano68cf15a2010-11-06 01:01:591049<div class="paragraph"><p>Without this option, each pathname output will have TAB, LF, double quotes,
Junio C Hamanoc14e6ad2014-10-31 20:25:531050and backslash characters replaced with <code>\t</code>, <code>\n</code>, <code>\"</code>, and <code>\\</code>,
Junio C Hamano5706e0b2009-11-24 10:54:161051respectively, and the pathname will be enclosed in double quotes if
1052any of those replacements occurred.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231053</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591054<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231055--name-only
1056</dt>
1057<dd>
1058<p>
1059 Show only names of changed files.
1060</p>
1061</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591062<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231063--name-status
1064</dt>
1065<dd>
1066<p>
Junio C Hamanoa9aee782008-04-23 16:09:201067 Show only names and status of changed files. See the description
Junio C Hamanoc14e6ad2014-10-31 20:25:531068 of the <code>--diff-filter</code> option on what the status letters mean.
Junio C Hamano1a4e8412005-12-27 08:17:231069</p>
1070</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591071<dt class="hdlist1">
Junio C Hamanoc21ab052009-10-31 04:03:551072--submodule[=&lt;format&gt;]
1073</dt>
1074<dd>
1075<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:531076 Specify how differences in submodules are shown. When <code>--submodule</code>
1077 or <code>--submodule=log</code> is given, the <em>log</em> format is used. This format lists
1078 the commits in the range like <a href="git-submodule.html">git-submodule(1)</a> <code>summary</code> does.
1079 Omitting the <code>--submodule</code> option or specifying <code>--submodule=short</code>,
Junio C Hamanoe768cc12012-03-16 05:43:051080 uses the <em>short</em> format. This format just shows the names of the commits
Junio C Hamanob4e58b12012-11-26 03:13:061081 at the beginning and end of the range. Can be tweaked via the
Junio C Hamanoc14e6ad2014-10-31 20:25:531082 <code>diff.submodule</code> configuration variable.
Junio C Hamanoc21ab052009-10-31 04:03:551083</p>
1084</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591085<dt class="hdlist1">
Junio C Hamano4aa0bcc2010-03-03 05:13:121086--color[=&lt;when&gt;]
Junio C Hamano9ae1a062006-07-10 08:12:341087</dt>
1088<dd>
1089<p>
1090 Show colored diff.
Junio C Hamanoc14e6ad2014-10-31 20:25:531091 <code>--color</code> (i.e. without <em>=&lt;when&gt;</em>) is the same as <code>--color=always</code>.
1092 <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:341093</p>
1094</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591095<dt class="hdlist1">
Junio C Hamano9ae1a062006-07-10 08:12:341096--no-color
1097</dt>
1098<dd>
1099<p>
Junio C Hamano5f2627d2011-05-06 20:23:481100 Turn off colored diff.
Junio C Hamanoc14e6ad2014-10-31 20:25:531101 It is the same as <code>--color=never</code>.
Junio C Hamano9ae1a062006-07-10 08:12:341102</p>
1103</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591104<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531105--word-diff[=&lt;mode&gt;]
Junio C Hamano85e45fa2006-08-13 07:47:411106</dt>
1107<dd>
1108<p>
Junio C Hamanocc7636a2010-05-21 14:57:531109 Show a word diff, using the &lt;mode&gt; to delimit changed words.
1110 By default, words are delimited by whitespace; see
Junio C Hamanoc14e6ad2014-10-31 20:25:531111 <code>--word-diff-regex</code> below. The &lt;mode&gt; defaults to <em>plain</em>, and
Junio C Hamanocc7636a2010-05-21 14:57:531112 must be one of:
Junio C Hamano85e45fa2006-08-13 07:47:411113</p>
Junio C Hamano9629d4f2012-12-19 00:28:271114<div class="openblock">
1115<div class="content">
Junio C Hamano68cf15a2010-11-06 01:01:591116<div class="dlist"><dl>
1117<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531118color
1119</dt>
1120<dd>
1121<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:531122 Highlight changed words using only colors. Implies <code>--color</code>.
Junio C Hamanocc7636a2010-05-21 14:57:531123</p>
1124</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591125<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531126plain
1127</dt>
1128<dd>
1129<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:531130 Show words as <code>[-removed-]</code> and <code>{+added+}</code>. Makes no
Junio C Hamanocc7636a2010-05-21 14:57:531131 attempts to escape the delimiters if they appear in the input,
1132 so the output may be ambiguous.
1133</p>
1134</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591135<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531136porcelain
1137</dt>
1138<dd>
1139<p>
1140 Use a special line-based format intended for script
1141 consumption. Added/removed/unchanged runs are printed in the
Junio C Hamanoc14e6ad2014-10-31 20:25:531142 usual unified diff format, starting with a <code>+</code>/<code>-</code>/` `
Junio C Hamanocc7636a2010-05-21 14:57:531143 character at the beginning of the line and extending to the
1144 end of the line. Newlines in the input are represented by a
Junio C Hamanoc14e6ad2014-10-31 20:25:531145 tilde <code>~</code> on a line of its own.
Junio C Hamanocc7636a2010-05-21 14:57:531146</p>
1147</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591148<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531149none
1150</dt>
1151<dd>
1152<p>
1153 Disable word diff again.
1154</p>
1155</dd>
1156</dl></div>
Junio C Hamano9629d4f2012-12-19 00:28:271157</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591158<div class="paragraph"><p>Note that despite the name of the first mode, color is used to
Junio C Hamanocc7636a2010-05-21 14:57:531159highlight the changed parts in all modes if enabled.</p></div>
1160</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591161<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531162--word-diff-regex=&lt;regex&gt;
1163</dt>
1164<dd>
1165<p>
1166 Use &lt;regex&gt; to decide what a word is, instead of considering
1167 runs of non-whitespace to be a word. Also implies
Junio C Hamanoc14e6ad2014-10-31 20:25:531168 <code>--word-diff</code> unless it was already enabled.
Junio C Hamanocc7636a2010-05-21 14:57:531169</p>
Junio C Hamano68cf15a2010-11-06 01:01:591170<div class="paragraph"><p>Every non-overlapping match of the
Junio C Hamano20d47e32009-01-26 06:36:021171&lt;regex&gt; is considered a word. Anything between these matches is
1172considered whitespace and ignored(!) for the purposes of finding
Junio C Hamanoc14e6ad2014-10-31 20:25:531173differences. You may want to append <code>|[^[:space:]]</code> to your regular
Junio C Hamano20d47e32009-01-26 06:36:021174expression to make sure that it matches all non-whitespace characters.
1175A match that contains a newline is silently truncated(!) at the
1176newline.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591177<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:231178<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:021179overrides any diff driver or configuration setting. Diff drivers
1180override configuration settings.</p></div>
Junio C Hamano85e45fa2006-08-13 07:47:411181</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591182<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531183--color-words[=&lt;regex&gt;]
1184</dt>
1185<dd>
1186<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:531187 Equivalent to <code>--word-diff=color</code> plus (if a regex was
1188 specified) <code>--word-diff-regex=&lt;regex&gt;</code>.
Junio C Hamanocc7636a2010-05-21 14:57:531189</p>
1190</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591191<dt class="hdlist1">
Junio C Hamano9ae1a062006-07-10 08:12:341192--no-renames
1193</dt>
1194<dd>
1195<p>
1196 Turn off rename detection, even when the configuration
1197 file gives the default to do so.
1198</p>
1199</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591200<dt class="hdlist1">
Junio C Hamanoa890c4f2007-01-28 10:29:211201--check
1202</dt>
1203<dd>
1204<p>
Junio C Hamano6005bfa2011-06-23 00:51:221205 Warn if changes introduce whitespace errors. What are
Junio C Hamanoc14e6ad2014-10-31 20:25:531206 considered whitespace errors is controlled by <code>core.whitespace</code>
Junio C Hamano6005bfa2011-06-23 00:51:221207 configuration. By default, trailing whitespaces (including
1208 lines that solely consist of whitespaces) and a space character
1209 that is immediately followed by a tab character inside the
1210 initial indent of the line are considered whitespace errors.
1211 Exits with non-zero status if problems are found. Not compatible
1212 with --exit-code.
Junio C Hamanoa890c4f2007-01-28 10:29:211213</p>
1214</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591215<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231216--full-index
1217</dt>
1218<dd>
1219<p>
Junio C Hamano5cf43ca2008-08-20 09:14:141220 Instead of the first handful of characters, show the full
1221 pre- and post-image blob object names on the "index"
1222 line when generating patch format output.
Junio C Hamano1a4e8412005-12-27 08:17:231223</p>
1224</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591225<dt class="hdlist1">
Junio C Hamano9ae1a062006-07-10 08:12:341226--binary
1227</dt>
1228<dd>
1229<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:531230 In addition to <code>--full-index</code>, output a binary diff that
1231 can be applied with <code>git-apply</code>.
Junio C Hamano9ae1a062006-07-10 08:12:341232</p>
1233</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591234<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231235--abbrev[=&lt;n&gt;]
1236</dt>
1237<dd>
1238<p>
1239 Instead of showing the full 40-byte hexadecimal object
1240 name in diff-raw format output and diff-tree header
Junio C Hamano6efe3022009-01-13 16:47:561241 lines, show only a partial prefix. This is
Junio C Hamanoc14e6ad2014-10-31 20:25:531242 independent of the <code>--full-index</code> option above, which controls
Junio C Hamano1a4e8412005-12-27 08:17:231243 the diff-patch output format. Non default number of
Junio C Hamanoc14e6ad2014-10-31 20:25:531244 digits can be specified with <code>--abbrev=&lt;n&gt;</code>.
Junio C Hamano1a4e8412005-12-27 08:17:231245</p>
1246</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591247<dt class="hdlist1">
Junio C Hamanoe85e36f2010-08-10 05:30:141248-B[&lt;n&gt;][/&lt;m&gt;]
Junio C Hamano1a4e8412005-12-27 08:17:231249</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591250<dt class="hdlist1">
Junio C Hamano39c7a692010-10-27 06:08:541251--break-rewrites[=[&lt;n&gt;][/&lt;m&gt;]]
1252</dt>
Junio C Hamano1a4e8412005-12-27 08:17:231253<dd>
1254<p>
Junio C Hamanoe85e36f2010-08-10 05:30:141255 Break complete rewrite changes into pairs of delete and
1256 create. This serves two purposes:
Junio C Hamano1a4e8412005-12-27 08:17:231257</p>
Junio C Hamano68cf15a2010-11-06 01:01:591258<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:141259not as a series of deletion and insertion mixed together with a very
1260few lines that happen to match textually as the context, but as a
1261single deletion of everything old followed by a single insertion of
Junio C Hamanoc14e6ad2014-10-31 20:25:531262everything new, and the number <code>m</code> controls this aspect of the -B
1263option (defaults to 60%). <code>-B/70%</code> specifies that less than 30% of the
Junio C Hamano076ffcc2013-02-06 05:13:211264original should remain in the result for Git to consider it a total
Junio C Hamanoe85e36f2010-08-10 05:30:141265rewrite (i.e. otherwise the resulting patch will be a series of
1266deletion and insertion mixed together with context lines).</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591267<div class="paragraph"><p>When used with -M, a totally-rewritten file is also considered as the
Junio C Hamanoe85e36f2010-08-10 05:30:141268source of a rename (usually -M only considers a file that disappeared
Junio C Hamanoc14e6ad2014-10-31 20:25:531269as the source of a rename), and the number <code>n</code> controls this aspect of
1270the -B option (defaults to 50%). <code>-B20%</code> specifies that a change with
Junio C Hamano68cf15a2010-11-06 01:01:591271addition and deletion compared to 20% or more of the file&#8217;s size are
Junio C Hamanoe85e36f2010-08-10 05:30:141272eligible for being picked up as a possible source of a rename to
1273another file.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231274</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591275<dt class="hdlist1">
Junio C Hamanoe85e36f2010-08-10 05:30:141276-M[&lt;n&gt;]
Junio C Hamano1a4e8412005-12-27 08:17:231277</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591278<dt class="hdlist1">
Junio C Hamano0d75e872010-12-17 06:57:261279--find-renames[=&lt;n&gt;]
Junio C Hamano39c7a692010-10-27 06:08:541280</dt>
Junio C Hamano1a4e8412005-12-27 08:17:231281<dd>
1282<p>
1283 Detect renames.
Junio C Hamanoc14e6ad2014-10-31 20:25:531284 If <code>n</code> is specified, it is a threshold on the similarity
Junio C Hamanoe85e36f2010-08-10 05:30:141285 index (i.e. amount of addition/deletions compared to the
Junio C Hamanoc14e6ad2014-10-31 20:25:531286 file&#8217;s size). For example, <code>-M90%</code> means Git should consider a
Junio C Hamanoe85e36f2010-08-10 05:30:141287 delete/add pair to be a rename if more than 90% of the file
Junio C Hamanoc14e6ad2014-10-31 20:25:531288 hasn&#8217;t changed. Without a <code>%</code> sign, the number is to be read as
1289 a fraction, with a decimal point before it. I.e., <code>-M5</code> becomes
1290 0.5, and is thus the same as <code>-M50%</code>. Similarly, <code>-M05</code> is
1291 the same as <code>-M5%</code>. To limit detection to exact renames, use
1292 <code>-M100%</code>. The default similarity index is 50%.
Junio C Hamano1a4e8412005-12-27 08:17:231293</p>
1294</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591295<dt class="hdlist1">
Junio C Hamanoe85e36f2010-08-10 05:30:141296-C[&lt;n&gt;]
Junio C Hamano1a4e8412005-12-27 08:17:231297</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591298<dt class="hdlist1">
Junio C Hamano0d75e872010-12-17 06:57:261299--find-copies[=&lt;n&gt;]
Junio C Hamano39c7a692010-10-27 06:08:541300</dt>
Junio C Hamano1a4e8412005-12-27 08:17:231301<dd>
1302<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:531303 Detect copies as well as renames. See also <code>--find-copies-harder</code>.
1304 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:231305</p>
1306</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591307<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231308--find-copies-harder
1309</dt>
1310<dd>
1311<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:531312 For performance reasons, by default, <code>-C</code> option finds copies only
Junio C Hamano1a4e8412005-12-27 08:17:231313 if the original file of the copy was modified in the same
1314 changeset. This flag makes the command
1315 inspect unmodified files as candidates for the source of
1316 copy. This is a very expensive operation for large
Junio C Hamano16f98872007-06-12 16:09:141317 projects, so use it with caution. Giving more than one
Junio C Hamanoc14e6ad2014-10-31 20:25:531318 <code>-C</code> option has the same effect.
Junio C Hamano1a4e8412005-12-27 08:17:231319</p>
1320</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591321<dt class="hdlist1">
Junio C Hamanob02377c2011-04-28 22:26:021322-D
1323</dt>
1324<dt class="hdlist1">
1325--irreversible-delete
1326</dt>
1327<dd>
1328<p>
1329 Omit the preimage for deletes, i.e. print only the header but not
Junio C Hamanoc14e6ad2014-10-31 20:25:531330 the diff between the preimage and <code>/dev/null</code>. The resulting patch
1331 is not meant to be applied with <code>patch</code> or <code>git apply</code>; this is
Junio C Hamanob02377c2011-04-28 22:26:021332 solely for people who want to just concentrate on reviewing the
1333 text after the change. In addition, the output obviously lack
1334 enough information to apply such a patch in reverse, even manually,
1335 hence the name of the option.
1336</p>
Junio C Hamanoc14e6ad2014-10-31 20:25:531337<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:021338of a delete/create pair.</p></div>
1339</dd>
1340<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231341-l&lt;num&gt;
1342</dt>
1343<dd>
1344<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:531345 The <code>-M</code> and <code>-C</code> options require O(n^2) processing time where n
Junio C Hamano1a4e8412005-12-27 08:17:231346 is the number of potential rename/copy targets. This
1347 option prevents rename/copy detection from running if
1348 the number of rename/copy targets exceeds the specified
1349 number.
1350</p>
1351</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591352<dt class="hdlist1">
Junio C Hamano982eb112010-11-18 00:53:091353--diff-filter=[(A|C|D|M|R|T|U|X|B)&#8230;[*]]
1354</dt>
1355<dd>
1356<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:531357 Select only files that are Added (<code>A</code>), Copied (<code>C</code>),
1358 Deleted (<code>D</code>), Modified (<code>M</code>), Renamed (<code>R</code>), have their
1359 type (i.e. regular file, symlink, submodule, &#8230;) changed (<code>T</code>),
1360 are Unmerged (<code>U</code>), are
1361 Unknown (<code>X</code>), or have had their pairing Broken (<code>B</code>).
Junio C Hamano982eb112010-11-18 00:53:091362 Any combination of the filter characters (including none) can be used.
Junio C Hamanoc14e6ad2014-10-31 20:25:531363 When <code>*</code> (All-or-none) is added to the combination, all
Junio C Hamano982eb112010-11-18 00:53:091364 paths are selected if there is any file that matches
1365 other criteria in the comparison; if there is no file
1366 that matches other criteria, nothing is selected.
1367</p>
1368</dd>
1369<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231370-S&lt;string&gt;
1371</dt>
1372<dd>
1373<p>
Junio C Hamanof1f5a7b2013-06-11 22:23:521374 Look for differences that change the number of occurrences of
1375 the specified string (i.e. addition/deletion) in a file.
1376 Intended for the scripter&#8217;s use.
Junio C Hamano1a4e8412005-12-27 08:17:231377</p>
Junio C Hamanof1f5a7b2013-06-11 22:23:521378<div class="paragraph"><p>It is useful when you&#8217;re looking for an exact block of code (like a
1379struct), and want to know the history of that block since it first
1380came into being: use the feature iteratively to feed the interesting
Junio C Hamanoc14e6ad2014-10-31 20:25:531381block in the preimage back into <code>-S</code>, and keep going until you get the
Junio C Hamanof1f5a7b2013-06-11 22:23:521382very first version of the block.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231383</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591384<dt class="hdlist1">
Junio C Hamano3b4609d2010-09-30 00:04:341385-G&lt;regex&gt;
1386</dt>
1387<dd>
1388<p>
Junio C Hamanof1f5a7b2013-06-11 22:23:521389 Look for differences whose patch text contains added/removed
1390 lines that match &lt;regex&gt;.
Junio C Hamano3b4609d2010-09-30 00:04:341391</p>
Junio C Hamanoc14e6ad2014-10-31 20:25:531392<div class="paragraph"><p>To illustrate the difference between <code>-S&lt;regex&gt; --pickaxe-regex</code> and
1393<code>-G&lt;regex&gt;</code>, consider a commit with the following diff in the same
Junio C Hamanof1f5a7b2013-06-11 22:23:521394file:</p></div>
1395<div class="listingblock">
1396<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531397<pre><code>+ return !regexec(regexp, two-&gt;ptr, 1, &amp;regmatch, 0);
Junio C Hamanof1f5a7b2013-06-11 22:23:521398...
Junio C Hamanoc14e6ad2014-10-31 20:25:531399- hit = !regexec(regexp, mf2.ptr, 1, &amp;regmatch, 0);</code></pre>
Junio C Hamanof1f5a7b2013-06-11 22:23:521400</div></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:531401<div class="paragraph"><p>While <code>git log -G"regexec\(regexp"</code> will show this commit, <code>git log
1402-S"regexec\(regexp" --pickaxe-regex</code> will not (because the number of
Junio C Hamanof1f5a7b2013-06-11 22:23:521403occurrences of that string did not change).</p></div>
1404<div class="paragraph"><p>See the <em>pickaxe</em> entry in <a href="gitdiffcore.html">gitdiffcore(7)</a> for more
1405information.</p></div>
Junio C Hamano3b4609d2010-09-30 00:04:341406</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591407<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231408--pickaxe-all
1409</dt>
1410<dd>
1411<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:531412 When <code>-S</code> or <code>-G</code> finds a change, show all the changes in that
Junio C Hamano1a4e8412005-12-27 08:17:231413 changeset, not just the files that contain the change
1414 in &lt;string&gt;.
1415</p>
1416</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591417<dt class="hdlist1">
Junio C Hamanobfe9e752006-04-05 21:43:281418--pickaxe-regex
1419</dt>
1420<dd>
1421<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:531422 Treat the &lt;string&gt; given to <code>-S</code> as an extended POSIX regular
Junio C Hamanof1f5a7b2013-06-11 22:23:521423 expression to match.
Junio C Hamanobfe9e752006-04-05 21:43:281424</p>
1425</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591426<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231427-O&lt;orderfile&gt;
1428</dt>
1429<dd>
1430<p>
1431 Output the patch in the order specified in the
1432 &lt;orderfile&gt;, which has one shell glob pattern per line.
Junio C Hamano322c6242015-03-23 21:32:461433 This overrides the <code>diff.orderFile</code> configuration variable
1434 (see <a href="git-config.html">git-config(1)</a>). To cancel <code>diff.orderFile</code>,
Junio C Hamanoc14e6ad2014-10-31 20:25:531435 use <code>-O/dev/null</code>.
Junio C Hamano1a4e8412005-12-27 08:17:231436</p>
1437</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591438<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231439-R
1440</dt>
1441<dd>
1442<p>
1443 Swap two inputs; that is, show differences from index or
1444 on-disk file to tree contents.
1445</p>
1446</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591447<dt class="hdlist1">
Junio C Hamano24bc09a2008-02-28 00:27:441448--relative[=&lt;path&gt;]
1449</dt>
1450<dd>
1451<p>
1452 When run from a subdirectory of the project, it can be
1453 told to exclude changes outside the directory and show
1454 pathnames relative to it with this option. When you are
1455 not in a subdirectory (e.g. in a bare repository), you
1456 can name which subdirectory to make the output relative
1457 to by giving a &lt;path&gt; as an argument.
1458</p>
1459</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591460<dt class="hdlist1">
Junio C Hamanobbbb8652008-12-29 10:34:221461-a
1462</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591463<dt class="hdlist1">
Junio C Hamanoc26f5482006-07-09 09:38:141464--text
1465</dt>
1466<dd>
1467<p>
1468 Treat all files as text.
1469</p>
1470</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591471<dt class="hdlist1">
Junio C Hamanofd468962007-02-14 23:45:041472--ignore-space-at-eol
1473</dt>
1474<dd>
1475<p>
Junio C Hamano3a702342007-12-12 21:34:021476 Ignore changes in whitespace at EOL.
Junio C Hamanofd468962007-02-14 23:45:041477</p>
1478</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591479<dt class="hdlist1">
Junio C Hamanobbbb8652008-12-29 10:34:221480-b
1481</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591482<dt class="hdlist1">
Junio C Hamanod9c2d2f2006-12-06 08:59:071483--ignore-space-change
1484</dt>
1485<dd>
1486<p>
Junio C Hamano3a702342007-12-12 21:34:021487 Ignore changes in amount of whitespace. This ignores whitespace
1488 at line end, and considers all other sequences of one or
1489 more whitespace characters to be equivalent.
Junio C Hamanod9c2d2f2006-12-06 08:59:071490</p>
1491</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591492<dt class="hdlist1">
Junio C Hamanobbbb8652008-12-29 10:34:221493-w
Junio C Hamanod9c2d2f2006-12-06 08:59:071494</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591495<dt class="hdlist1">
Junio C Hamanod9c2d2f2006-12-06 08:59:071496--ignore-all-space
1497</dt>
1498<dd>
1499<p>
Junio C Hamano3a702342007-12-12 21:34:021500 Ignore whitespace when comparing lines. This ignores
1501 differences even if one line has whitespace where the other
Junio C Hamanod9c2d2f2006-12-06 08:59:071502 line has none.
1503</p>
1504</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591505<dt class="hdlist1">
Junio C Hamanoa1952302013-07-01 21:31:181506--ignore-blank-lines
1507</dt>
1508<dd>
1509<p>
1510 Ignore changes whose lines are all blank.
1511</p>
1512</dd>
1513<dt class="hdlist1">
Junio C Hamano1d40ee82009-01-07 10:14:161514--inter-hunk-context=&lt;lines&gt;
1515</dt>
1516<dd>
1517<p>
1518 Show the context between diff hunks, up to the specified number
1519 of lines, thereby fusing hunks that are close to each other.
1520</p>
1521</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591522<dt class="hdlist1">
Junio C Hamano11821ed2011-10-19 18:42:091523-W
1524</dt>
1525<dt class="hdlist1">
1526--function-context
1527</dt>
1528<dd>
1529<p>
1530 Show whole surrounding functions of changes.
1531</p>
1532</dd>
1533<dt class="hdlist1">
Junio C Hamano48fd2f62007-03-19 02:02:301534--exit-code
1535</dt>
1536<dd>
1537<p>
1538 Make the program exit with codes similar to diff(1).
1539 That is, it exits with 1 if there were differences and
1540 0 means no differences.
1541</p>
1542</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591543<dt class="hdlist1">
Junio C Hamano35e57552007-03-25 07:54:351544--quiet
1545</dt>
1546<dd>
1547<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:531548 Disable all output of the program. Implies <code>--exit-code</code>.
Junio C Hamano35e57552007-03-25 07:54:351549</p>
1550</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591551<dt class="hdlist1">
Junio C Hamanobb0f4042007-07-04 06:41:401552--ext-diff
1553</dt>
1554<dd>
1555<p>
1556 Allow an external diff helper to be executed. If you set an
Junio C Hamanoa28a9202012-06-21 07:08:231557 external diff driver with <a href="gitattributes.html">gitattributes(5)</a>, you need
1558 to use this option with <a href="git-log.html">git-log(1)</a> and friends.
Junio C Hamanobb0f4042007-07-04 06:41:401559</p>
1560</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591561<dt class="hdlist1">
Junio C Hamanobb0f4042007-07-04 06:41:401562--no-ext-diff
1563</dt>
1564<dd>
1565<p>
1566 Disallow external diff drivers.
1567</p>
1568</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591569<dt class="hdlist1">
Junio C Hamanoc652aed2011-07-07 01:14:311570--textconv
1571</dt>
1572<dt class="hdlist1">
1573--no-textconv
1574</dt>
1575<dd>
1576<p>
1577 Allow (or disallow) external text conversion filters to be run
Junio C Hamanoa28a9202012-06-21 07:08:231578 when comparing binary files. See <a href="gitattributes.html">gitattributes(5)</a> for
Junio C Hamanoc652aed2011-07-07 01:14:311579 details. Because textconv filters are typically a one-way
1580 conversion, the resulting diff is suitable for human
1581 consumption, but cannot be applied. For this reason, textconv
Junio C Hamanoa28a9202012-06-21 07:08:231582 filters are enabled by default only for <a href="git-diff.html">git-diff(1)</a> and
1583 <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:311584 diff plumbing commands.
1585</p>
1586</dd>
1587<dt class="hdlist1">
Junio C Hamano7d449522010-07-01 00:08:511588--ignore-submodules[=&lt;when&gt;]
Junio C Hamanodfccbb02008-05-26 01:16:141589</dt>
1590<dd>
1591<p>
Junio C Hamano7d449522010-07-01 00:08:511592 Ignore changes to submodules in the diff generation. &lt;when&gt; can be
Junio C Hamanoc7102962013-05-29 23:57:171593 either "none", "untracked", "dirty" or "all", which is the default.
Junio C Hamano619596a2010-08-18 22:15:351594 Using "none" will consider the submodule modified when it either contains
1595 untracked or modified files or its HEAD differs from the commit recorded
1596 in the superproject and can be used to override any settings of the
Junio C Hamanoa28a9202012-06-21 07:08:231597 <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:511598 "untracked" is used submodules are not considered dirty when they only
1599 contain untracked content (but they are still scanned for modified
1600 content). Using "dirty" ignores all changes to the work tree of submodules,
1601 only changes to the commits stored in the superproject are shown (this was
1602 the behavior until 1.7.0). Using "all" hides all changes to submodules.
Junio C Hamanodfccbb02008-05-26 01:16:141603</p>
1604</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591605<dt class="hdlist1">
Junio C Hamanoe27cbd22007-12-21 17:57:331606--src-prefix=&lt;prefix&gt;
1607</dt>
1608<dd>
1609<p>
1610 Show the given source prefix instead of "a/".
1611</p>
1612</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591613<dt class="hdlist1">
Junio C Hamanoe27cbd22007-12-21 17:57:331614--dst-prefix=&lt;prefix&gt;
1615</dt>
1616<dd>
1617<p>
1618 Show the given destination prefix instead of "b/".
1619</p>
1620</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591621<dt class="hdlist1">
Junio C Hamanoe27cbd22007-12-21 17:57:331622--no-prefix
1623</dt>
1624<dd>
1625<p>
1626 Do not show any source or destination prefix.
1627</p>
1628</dd>
Junio C Hamanoba4b9282008-07-06 05:20:311629</dl></div>
Junio C Hamano68cf15a2010-11-06 01:01:591630<div class="paragraph"><p>For more detailed explanation on these common options, see also
Junio C Hamanoa28a9202012-06-21 07:08:231631<a href="gitdiffcore.html">gitdiffcore(7)</a>.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591632<div class="dlist"><dl>
1633<dt class="hdlist1">
Junio C Hamanobd53dbf2009-01-18 18:26:371634-1 --base
1635</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591636<dt class="hdlist1">
Junio C Hamanobd53dbf2009-01-18 18:26:371637-2 --ours
1638</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591639<dt class="hdlist1">
Junio C Hamanobd53dbf2009-01-18 18:26:371640-3 --theirs
1641</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591642<dt class="hdlist1">
Junio C Hamanobd53dbf2009-01-18 18:26:371643-0
Junio C Hamano1a4e8412005-12-27 08:17:231644</dt>
1645<dd>
1646<p>
1647 Diff against the "base" version, "our branch" or "their
1648 branch" respectively. With these options, diffs for
1649 merged entries are not shown.
1650</p>
Junio C Hamano68cf15a2010-11-06 01:01:591651<div class="paragraph"><p>The default is to diff against our branch (-2) and the
Junio C Hamano1a4e8412005-12-27 08:17:231652cleanly resolved paths. The option -0 can be given to
Junio C Hamanoba4b9282008-07-06 05:20:311653omit diff output for unmerged entries and just show "Unmerged".</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231654</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591655<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471656-c
1657</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591658<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471659--cc
Junio C Hamanofb56a962006-01-28 10:38:191660</dt>
1661<dd>
1662<p>
1663 This compares stage 2 (our branch), stage 3 (their
1664 branch) and the working tree file and outputs a combined
1665 diff, similar to the way <em>diff-tree</em> shows a merge
1666 commit with these flags.
1667</p>
1668</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591669<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231670-q
1671</dt>
1672<dd>
1673<p>
Junio C Hamano51c2ab02006-07-09 20:38:541674 Remain silent even on nonexistent files
Junio C Hamano1a4e8412005-12-27 08:17:231675</p>
1676</dd>
Junio C Hamanoba4b9282008-07-06 05:20:311677</dl></div>
Junio C Hamano1a4e8412005-12-27 08:17:231678</div>
Junio C Hamano9629d4f2012-12-19 00:28:271679</div>
1680<div class="sect1">
Junio C Hamano543f8d62009-07-29 08:35:211681<h2 id="_raw_output_format">Raw output format</h2>
Junio C Hamano1a4e8412005-12-27 08:17:231682<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:591683<div class="paragraph"><p>The raw output format from "git-diff-index", "git-diff-tree",
Junio C Hamanoba4b9282008-07-06 05:20:311684"git-diff-files" and "git diff --raw" are very similar.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591685<div class="paragraph"><p>These commands all compare two sets of things; what is
Junio C Hamanoba4b9282008-07-06 05:20:311686compared differs:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591687<div class="dlist"><dl>
1688<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231689git-diff-index &lt;tree-ish&gt;
1690</dt>
1691<dd>
1692<p>
1693 compares the &lt;tree-ish&gt; and the files on the filesystem.
1694</p>
1695</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591696<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231697git-diff-index --cached &lt;tree-ish&gt;
1698</dt>
1699<dd>
1700<p>
1701 compares the &lt;tree-ish&gt; and the index.
1702</p>
1703</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591704<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231705git-diff-tree [-r] &lt;tree-ish-1&gt; &lt;tree-ish-2&gt; [&lt;pattern&gt;&#8230;]
1706</dt>
1707<dd>
1708<p>
1709 compares the trees named by the two arguments.
1710</p>
1711</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591712<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231713git-diff-files [&lt;pattern&gt;&#8230;]
1714</dt>
1715<dd>
1716<p>
1717 compares the index and the files on the filesystem.
1718</p>
1719</dd>
Junio C Hamanoba4b9282008-07-06 05:20:311720</dl></div>
Junio C Hamano68cf15a2010-11-06 01:01:591721<div class="paragraph"><p>The "git-diff-tree" command begins its output by printing the hash of
Junio C Hamano543f8d62009-07-29 08:35:211722what is being compared. After that, all the commands print one output
1723line per changed file.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591724<div class="paragraph"><p>An output line is formatted this way:</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231725<div class="listingblock">
1726<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531727<pre><code>in-place edit :100644 100644 bcd1234... 0123456... M file0
Junio C Hamano1a4e8412005-12-27 08:17:231728copy-edit :100644 100644 abcd123... 1234567... C68 file1 file2
1729rename-edit :100644 100644 abcd123... 1234567... R86 file1 file3
1730create :000000 100644 0000000... 1234567... A file4
1731delete :100644 000000 1234567... 0000000... D file5
Junio C Hamanoc14e6ad2014-10-31 20:25:531732unmerged :000000 000000 0000000... 0000000... U file6</code></pre>
Junio C Hamano1a4e8412005-12-27 08:17:231733</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591734<div class="paragraph"><p>That is, from the left to the right:</p></div>
1735<div class="olist arabic"><ol class="arabic">
Junio C Hamano1a4e8412005-12-27 08:17:231736<li>
1737<p>
1738a colon.
1739</p>
1740</li>
1741<li>
1742<p>
1743mode for "src"; 000000 if creation or unmerged.
1744</p>
1745</li>
1746<li>
1747<p>
1748a space.
1749</p>
1750</li>
1751<li>
1752<p>
1753mode for "dst"; 000000 if deletion or unmerged.
1754</p>
1755</li>
1756<li>
1757<p>
1758a space.
1759</p>
1760</li>
1761<li>
1762<p>
1763sha1 for "src"; 0{40} if creation or unmerged.
1764</p>
1765</li>
1766<li>
1767<p>
1768a space.
1769</p>
1770</li>
1771<li>
1772<p>
1773sha1 for "dst"; 0{40} if creation, unmerged or "look at work tree".
1774</p>
1775</li>
1776<li>
1777<p>
1778a space.
1779</p>
1780</li>
1781<li>
1782<p>
1783status, followed by optional "score" number.
1784</p>
1785</li>
1786<li>
1787<p>
1788a tab or a NUL when <em>-z</em> option is used.
1789</p>
1790</li>
1791<li>
1792<p>
1793path for "src"
1794</p>
1795</li>
1796<li>
1797<p>
1798a tab or a NUL when <em>-z</em> option is used; only exists for C or R.
1799</p>
1800</li>
1801<li>
1802<p>
1803path for "dst"; only exists for C or R.
1804</p>
1805</li>
1806<li>
1807<p>
1808an LF or a NUL when <em>-z</em> option is used, to terminate the record.
1809</p>
1810</li>
Junio C Hamanoba4b9282008-07-06 05:20:311811</ol></div>
Junio C Hamano68cf15a2010-11-06 01:01:591812<div class="paragraph"><p>Possible status letters are:</p></div>
1813<div class="ulist"><ul>
Junio C Hamanoaa17c7c2008-11-03 04:36:581814<li>
1815<p>
1816A: addition of a file
1817</p>
1818</li>
1819<li>
1820<p>
1821C: copy of a file into a new one
1822</p>
1823</li>
1824<li>
1825<p>
1826D: deletion of a file
1827</p>
1828</li>
1829<li>
1830<p>
1831M: modification of the contents or mode of a file
1832</p>
1833</li>
1834<li>
1835<p>
1836R: renaming of a file
1837</p>
1838</li>
1839<li>
1840<p>
1841T: change in the type of the file
1842</p>
1843</li>
1844<li>
1845<p>
1846U: file is unmerged (you must complete the merge before it can
1847be committed)
1848</p>
1849</li>
1850<li>
1851<p>
1852X: "unknown" change type (most probably a bug, please report it)
1853</p>
1854</li>
1855</ul></div>
Junio C Hamano68cf15a2010-11-06 01:01:591856<div class="paragraph"><p>Status letters C and R are always followed by a score (denoting the
Junio C Hamanoaa17c7c2008-11-03 04:36:581857percentage of similarity between the source and target of the move or
Junio C Hamano6bb32e62015-02-17 22:11:261858copy). Status letter M may be followed by a score (denoting the
1859percentage of dissimilarity) for file rewrites.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591860<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:311861and it is out of sync with the index.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591862<div class="paragraph"><p>Example:</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231863<div class="listingblock">
1864<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531865<pre><code>:100644 100644 5be4a4...... 000000...... M file.c</code></pre>
Junio C Hamano1a4e8412005-12-27 08:17:231866</div></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:531867<div class="paragraph"><p>When <code>-z</code> option is not used, TAB, LF, and backslash characters
1868in pathnames are represented as <code>\t</code>, <code>\n</code>, and <code>\\</code>,
Junio C Hamanoba4b9282008-07-06 05:20:311869respectively.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231870</div>
Junio C Hamano9629d4f2012-12-19 00:28:271871</div>
1872<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:311873<h2 id="_diff_format_for_merges">diff format for merges</h2>
Junio C Hamano67fad6d2007-05-06 08:53:121874<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:591875<div class="paragraph"><p>"git-diff-tree", "git-diff-files" and "git-diff --raw"
Junio C Hamano7ae0ab22007-11-03 02:46:461876can take <em>-c</em> or <em>--cc</em> option
Junio C Hamano67fad6d2007-05-06 08:53:121877to generate diff output also for merge commits. The output differs
Junio C Hamanoba4b9282008-07-06 05:20:311878from the format described above in the following way:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591879<div class="olist arabic"><ol class="arabic">
Junio C Hamano67fad6d2007-05-06 08:53:121880<li>
1881<p>
1882there is a colon for each parent
1883</p>
1884</li>
1885<li>
1886<p>
1887there are more "src" modes and "src" sha1
1888</p>
1889</li>
1890<li>
1891<p>
1892status is concatenated status characters for each parent
1893</p>
1894</li>
1895<li>
1896<p>
1897no optional "score" number
1898</p>
1899</li>
1900<li>
1901<p>
1902single path, only for "dst"
1903</p>
1904</li>
Junio C Hamanoba4b9282008-07-06 05:20:311905</ol></div>
Junio C Hamano68cf15a2010-11-06 01:01:591906<div class="paragraph"><p>Example:</p></div>
Junio C Hamano67fad6d2007-05-06 08:53:121907<div class="listingblock">
1908<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531909<pre><code>::100644 100644 100644 fabadb8... cc95eb0... 4866510... MM describe.c</code></pre>
Junio C Hamano67fad6d2007-05-06 08:53:121910</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591911<div class="paragraph"><p>Note that <em>combined diff</em> lists only files which were modified from
Junio C Hamanoba4b9282008-07-06 05:20:311912all parents.</p></div>
Junio C Hamano67fad6d2007-05-06 08:53:121913</div>
Junio C Hamano9629d4f2012-12-19 00:28:271914</div>
1915<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:311916<h2 id="_generating_patches_with_p">Generating patches with -p</h2>
Junio C Hamano1a4e8412005-12-27 08:17:231917<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:591918<div class="paragraph"><p>When "git-diff-index", "git-diff-tree", or "git-diff-files" are run
Junio C Hamano00b8b632007-12-07 09:50:491919with a <em>-p</em> option, "git diff" without the <em>--raw</em> option, or
1920"git log" with the "-p" option, they
Junio C Hamano7ae0ab22007-11-03 02:46:461921do not produce the output described above; instead they produce a
1922patch file. You can customize the creation of such patches via the
Junio C Hamanoba4b9282008-07-06 05:20:311923GIT_EXTERNAL_DIFF and the GIT_DIFF_OPTS environment variables.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591924<div class="paragraph"><p>What the -p option produces is slightly different from the traditional
Junio C Hamano7f9fa862010-10-19 23:51:141925diff format:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591926<div class="olist arabic"><ol class="arabic">
Junio C Hamano1a4e8412005-12-27 08:17:231927<li>
1928<p>
Junio C Hamano7f9fa862010-10-19 23:51:141929It is preceded with a "git diff" header that looks like this:
Junio C Hamano1a4e8412005-12-27 08:17:231930</p>
1931<div class="literalblock">
1932<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531933<pre><code>diff --git a/file1 b/file2</code></pre>
Junio C Hamano1a4e8412005-12-27 08:17:231934</div></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:531935<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:231936involved. Especially, even for a creation or a deletion,
Junio C Hamanoc14e6ad2014-10-31 20:25:531937<code>/dev/null</code> is <em>not</em> used in place of the <code>a/</code> or <code>b/</code> filenames.</p></div>
1938<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:231939name of the source file of the rename/copy and the name of
Junio C Hamanoba4b9282008-07-06 05:20:311940the file that rename/copy produces, respectively.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231941</li>
1942<li>
1943<p>
1944It is followed by one or more extended header lines:
1945</p>
1946<div class="literalblock">
1947<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531948<pre><code>old mode &lt;mode&gt;
Junio C Hamano1a4e8412005-12-27 08:17:231949new mode &lt;mode&gt;
1950deleted file mode &lt;mode&gt;
1951new file mode &lt;mode&gt;
1952copy from &lt;path&gt;
1953copy to &lt;path&gt;
1954rename from &lt;path&gt;
1955rename to &lt;path&gt;
1956similarity index &lt;number&gt;
1957dissimilarity index &lt;number&gt;
Junio C Hamanoc14e6ad2014-10-31 20:25:531958index &lt;hash&gt;..&lt;hash&gt; &lt;mode&gt;</code></pre>
Junio C Hamano1a4e8412005-12-27 08:17:231959</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591960<div class="paragraph"><p>File modes are printed as 6-digit octal numbers including the file type
Junio C Hamano7f9fa862010-10-19 23:51:141961and file permission bits.</p></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:531962<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:591963<div class="paragraph"><p>The similarity index is the percentage of unchanged lines, and
Junio C Hamano7f9fa862010-10-19 23:51:141964the dissimilarity index is the percentage of changed lines. It
1965is a rounded down integer, followed by a percent sign. The
1966similarity index value of 100% is thus reserved for two equal
1967files, while 100% dissimilarity means that no line from the old
1968file made it into the new one.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591969<div class="paragraph"><p>The index line includes the SHA-1 checksum before and after the change.
Junio C Hamano7f9fa862010-10-19 23:51:141970The &lt;mode&gt; is included if the file mode does not change; otherwise,
1971separate lines indicate the old and the new mode.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231972</li>
1973<li>
1974<p>
Junio C Hamanoa053d542006-10-27 09:29:131975TAB, LF, double quote and backslash characters in pathnames
Junio C Hamanoc14e6ad2014-10-31 20:25:531976 are represented as <code>\t</code>, <code>\n</code>, <code>\"</code> and <code>\\</code>, respectively.
Junio C Hamanoa053d542006-10-27 09:29:131977 If there is need for such substitution then the whole
1978 pathname is put in double quotes.
Junio C Hamano1a4e8412005-12-27 08:17:231979</p>
1980</li>
Junio C Hamano7f9fa862010-10-19 23:51:141981<li>
1982<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:531983All the <code>file1</code> files in the output refer to files before the
1984 commit, and all the <code>file2</code> files refer to files after the commit.
Junio C Hamano7f9fa862010-10-19 23:51:141985 It is incorrect to apply each change to each file sequentially. For
1986 example, this patch will swap a and b:
1987</p>
1988<div class="literalblock">
1989<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531990<pre><code>diff --git a/a b/b
Junio C Hamano7f9fa862010-10-19 23:51:141991rename from a
1992rename to b
1993diff --git a/b b/a
1994rename from b
Junio C Hamanoc14e6ad2014-10-31 20:25:531995rename to a</code></pre>
Junio C Hamano7f9fa862010-10-19 23:51:141996</div></div>
1997</li>
Junio C Hamanoba4b9282008-07-06 05:20:311998</ol></div>
Junio C Hamano1a4e8412005-12-27 08:17:231999</div>
Junio C Hamano9629d4f2012-12-19 00:28:272000</div>
2001<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:312002<h2 id="_combined_diff_format">combined diff format</h2>
Junio C Hamanofb56a962006-01-28 10:38:192003<div class="sectionbody">
Junio C Hamano1dbca522015-05-22 20:48:552004<div class="paragraph"><p>Any diff-generating command can take the <code>-c</code> or <code>--cc</code> option to
Junio C Hamanoc5be4cc2011-03-09 07:20:432005produce a <em>combined diff</em> when showing a merge. This is the default
Junio C Hamanoa28a9202012-06-21 07:08:232006format when showing merges with <a href="git-diff.html">git-diff(1)</a> or
Junio C Hamano1dbca522015-05-22 20:48:552007<a href="git-show.html">git-show(1)</a>. Note also that you can give the <code>-m</code> option to any
Junio C Hamanoc5be4cc2011-03-09 07:20:432008of these commands to force generation of diffs with individual parents
2009of a merge.</p></div>
2010<div class="paragraph"><p>A <em>combined diff</em> format looks like this:</p></div>
Junio C Hamanofb56a962006-01-28 10:38:192011<div class="listingblock">
2012<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:532013<pre><code>diff --combined describe.c
Junio C Hamano29f14312006-10-26 08:47:292014index fabadb8,cc95eb0..4866510
2015--- a/describe.c
2016+++ b/describe.c
2017@@@ -98,20 -98,12 +98,20 @@@
2018 return (a_date &gt; b_date) ? -1 : (a_date == b_date) ? 0 : 1;
Junio C Hamanofb56a962006-01-28 10:38:192019 }
2020
2021- static void describe(char *arg)
2022 -static void describe(struct commit *cmit, int last_one)
2023++static void describe(char *arg, int last_one)
2024 {
Junio C Hamano29f14312006-10-26 08:47:292025 + unsigned char sha1[20];
2026 + struct commit *cmit;
2027 struct commit_list *list;
2028 static int initialized = 0;
2029 struct commit_name *n;
2030
2031 + if (get_sha1(arg, sha1) &lt; 0)
2032 + usage(describe_usage);
2033 + cmit = lookup_commit_reference(sha1);
2034 + if (!cmit)
2035 + usage(describe_usage);
2036 +
2037 if (!initialized) {
2038 initialized = 1;
Junio C Hamanoc14e6ad2014-10-31 20:25:532039 for_each_ref(get_name);</code></pre>
Junio C Hamanofb56a962006-01-28 10:38:192040</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592041<div class="olist arabic"><ol class="arabic">
Junio C Hamano29f14312006-10-26 08:47:292042<li>
2043<p>
2044It is preceded with a "git diff" header, that looks like
2045 this (when <em>-c</em> option is used):
2046</p>
2047<div class="literalblock">
2048<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:532049<pre><code>diff --combined file</code></pre>
Junio C Hamano29f14312006-10-26 08:47:292050</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592051<div class="paragraph"><p>or like this (when <em>--cc</em> option is used):</p></div>
Junio C Hamano29f14312006-10-26 08:47:292052<div class="literalblock">
2053<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:532054<pre><code>diff --cc file</code></pre>
Junio C Hamano29f14312006-10-26 08:47:292055</div></div>
2056</li>
2057<li>
2058<p>
2059It is followed by one or more extended header lines
2060 (this example shows a merge with two parents):
2061</p>
2062<div class="literalblock">
2063<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:532064<pre><code>index &lt;hash&gt;,&lt;hash&gt;..&lt;hash&gt;
Junio C Hamano29f14312006-10-26 08:47:292065mode &lt;mode&gt;,&lt;mode&gt;..&lt;mode&gt;
2066new file mode &lt;mode&gt;
Junio C Hamanoc14e6ad2014-10-31 20:25:532067deleted file mode &lt;mode&gt;,&lt;mode&gt;</code></pre>
Junio C Hamano29f14312006-10-26 08:47:292068</div></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:532069<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:042070the &lt;mode&gt; is different from the rest. Extended headers with
Junio C Hamano29f14312006-10-26 08:47:292071information about detected contents movement (renames and
2072copying detection) are designed to work with diff of two
Junio C Hamanoba4b9282008-07-06 05:20:312073&lt;tree-ish&gt; and are not used by combined diff format.</p></div>
Junio C Hamano29f14312006-10-26 08:47:292074</li>
2075<li>
2076<p>
2077It is followed by two-line from-file/to-file header
2078</p>
2079<div class="literalblock">
2080<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:532081<pre><code>--- a/file
2082+++ b/file</code></pre>
Junio C Hamano29f14312006-10-26 08:47:292083</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592084<div class="paragraph"><p>Similar to two-line header for traditional <em>unified</em> diff
Junio C Hamanoc14e6ad2014-10-31 20:25:532085format, <code>/dev/null</code> is used to signal created or deleted
Junio C Hamanoba4b9282008-07-06 05:20:312086files.</p></div>
Junio C Hamano29f14312006-10-26 08:47:292087</li>
2088<li>
2089<p>
2090Chunk header format is modified to prevent people from
Junio C Hamanoc14e6ad2014-10-31 20:25:532091 accidentally feeding it to <code>patch -p1</code>. Combined diff format
Junio C Hamano29f14312006-10-26 08:47:292092 was created for review of merge commit changes, and was not
2093 meant for apply. The change is similar to the change in the
2094 extended <em>index</em> header:
2095</p>
2096<div class="literalblock">
2097<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:532098<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:292099</div></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:532100<div class="paragraph"><p>There are (number of parents + 1) <code>@</code> characters in the chunk
Junio C Hamanoba4b9282008-07-06 05:20:312101header for combined diff format.</p></div>
Junio C Hamano29f14312006-10-26 08:47:292102</li>
Junio C Hamanoba4b9282008-07-06 05:20:312103</ol></div>
Junio C Hamano68cf15a2010-11-06 01:01:592104<div class="paragraph"><p>Unlike the traditional <em>unified</em> diff format, which shows two
Junio C Hamanoc14e6ad2014-10-31 20:25:532105files 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
2106added to B), or <code>" "</code> (space&#8201;&#8212;&#8201;unchanged) prefix, this format
Junio C Hamanofb56a962006-01-28 10:38:192107compares two or more files file1, file2,&#8230; with one file X, and
2108shows how X differs from each of fileN. One column for each of
Junio C Hamano68cf15a2010-11-06 01:01:592109fileN is prepended to the output line to note how X&#8217;s line is
Junio C Hamanoba4b9282008-07-06 05:20:312110different from it.</p></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:532111<div class="paragraph"><p>A <code>-</code> character in the column N means that the line appears in
2112fileN but it does not appear in the result. A <code>+</code> character
Junio C Hamano54bf1e22008-12-20 06:30:112113in the column N means that the line appears in the result,
Junio C Hamano29f14312006-10-26 08:47:292114and fileN does not have that line (in other words, the line was
Junio C Hamanoba4b9282008-07-06 05:20:312115added, from the point of view of that parent).</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592116<div class="paragraph"><p>In the above example output, the function signature was changed
Junio C Hamanoc14e6ad2014-10-31 20:25:532117from both files (hence two <code>-</code> removals from both file1 and
2118file2, plus <code>++</code> to mean one line that was added does not appear
Junio C Hamanod75148a2014-04-08 19:48:382119in either file1 or file2). Also eight other lines are the same
Junio C Hamanoc14e6ad2014-10-31 20:25:532120from file1 but do not appear in file2 (hence prefixed with <code>+</code>).</p></div>
2121<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:192122merge commit with the merge result (i.e. file1..fileN are the
Junio C Hamanoc14e6ad2014-10-31 20:25:532123parents). When shown by <code>git diff-files -c</code>, it compares the
Junio C Hamanofb56a962006-01-28 10:38:192124two unresolved merge parents with the working tree file
2125(i.e. file1 is stage 2 aka "our version", file2 is stage 3 aka
Junio C Hamanoba4b9282008-07-06 05:20:312126"their version").</p></div>
Junio C Hamanofb56a962006-01-28 10:38:192127</div>
Junio C Hamano9629d4f2012-12-19 00:28:272128</div>
2129<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:312130<h2 id="_other_diff_formats">other diff formats</h2>
Junio C Hamano3a702342007-12-12 21:34:022131<div class="sectionbody">
Junio C Hamanoc14e6ad2014-10-31 20:25:532132<div class="paragraph"><p>The <code>--summary</code> option describes newly added, deleted, renamed and
2133copied files. The <code>--stat</code> option adds diffstat(1) graph to the
Junio C Hamano3a702342007-12-12 21:34:022134output. These options can be combined with other options, such as
Junio C Hamanoc14e6ad2014-10-31 20:25:532135<code>-p</code>, and are meant for human consumption.</p></div>
2136<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:022137formats the pathnames compactly by combining common prefix and suffix of
Junio C Hamanoc14e6ad2014-10-31 20:25:532138the pathnames. For example, a change that moves <code>arch/i386/Makefile</code> to
2139<code>arch/x86/Makefile</code> while modifying 4 lines will be shown like this:</p></div>
Junio C Hamano3a702342007-12-12 21:34:022140<div class="listingblock">
2141<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:532142<pre><code>arch/{i386 =&gt; x86}/Makefile | 4 +--</code></pre>
Junio C Hamano3a702342007-12-12 21:34:022143</div></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:532144<div class="paragraph"><p>The <code>--numstat</code> option gives the diffstat(1) information but is designed
2145for easier machine consumption. An entry in <code>--numstat</code> output looks
Junio C Hamanoba4b9282008-07-06 05:20:312146like this:</p></div>
Junio C Hamano3a702342007-12-12 21:34:022147<div class="listingblock">
2148<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:532149<pre><code>1 2 README
21503 1 arch/{i386 =&gt; x86}/Makefile</code></pre>
Junio C Hamano3a702342007-12-12 21:34:022151</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592152<div class="paragraph"><p>That is, from left to right:</p></div>
2153<div class="olist arabic"><ol class="arabic">
Junio C Hamano3a702342007-12-12 21:34:022154<li>
2155<p>
2156the number of added lines;
2157</p>
2158</li>
2159<li>
2160<p>
2161a tab;
2162</p>
2163</li>
2164<li>
2165<p>
2166the number of deleted lines;
2167</p>
2168</li>
2169<li>
2170<p>
2171a tab;
2172</p>
2173</li>
2174<li>
2175<p>
2176pathname (possibly with rename/copy information);
2177</p>
2178</li>
2179<li>
2180<p>
2181a newline.
2182</p>
2183</li>
Junio C Hamanoba4b9282008-07-06 05:20:312184</ol></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:532185<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:022186<div class="listingblock">
2187<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:532188<pre><code>1 2 README NUL
21893 1 NUL arch/i386/Makefile NUL arch/x86/Makefile NUL</code></pre>
Junio C Hamano3a702342007-12-12 21:34:022190</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592191<div class="paragraph"><p>That is:</p></div>
2192<div class="olist arabic"><ol class="arabic">
Junio C Hamano3a702342007-12-12 21:34:022193<li>
2194<p>
2195the number of added lines;
2196</p>
2197</li>
2198<li>
2199<p>
2200a tab;
2201</p>
2202</li>
2203<li>
2204<p>
2205the number of deleted lines;
2206</p>
2207</li>
2208<li>
2209<p>
2210a tab;
2211</p>
2212</li>
2213<li>
2214<p>
2215a NUL (only exists if renamed/copied);
2216</p>
2217</li>
2218<li>
2219<p>
2220pathname in preimage;
2221</p>
2222</li>
2223<li>
2224<p>
2225a NUL (only exists if renamed/copied);
2226</p>
2227</li>
2228<li>
2229<p>
2230pathname in postimage (only exists if renamed/copied);
2231</p>
2232</li>
2233<li>
2234<p>
2235a NUL.
2236</p>
2237</li>
Junio C Hamanoba4b9282008-07-06 05:20:312238</ol></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:532239<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:022240scripts that read the output to tell if the current record being read is
2241a single-path record or a rename/copy record without reading ahead.
Junio C Hamanoc14e6ad2014-10-31 20:25:532242After reading added and deleted lines, reading up to <code>NUL</code> would yield
2243the pathname, but if that is <code>NUL</code>, the record will show two paths.</p></div>
Junio C Hamano3a702342007-12-12 21:34:022244</div>
Junio C Hamano9629d4f2012-12-19 00:28:272245</div>
2246<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:312247<h2 id="_git">GIT</h2>
Junio C Hamano1a4e8412005-12-27 08:17:232248<div class="sectionbody">
Junio C Hamanoa28a9202012-06-21 07:08:232249<div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232250</div>
Junio C Hamano7bd050f2011-09-22 06:32:222251</div>
Junio C Hamano9629d4f2012-12-19 00:28:272252</div>
Junio C Hamano7bd050f2011-09-22 06:32:222253<div id="footnotes"><hr /></div>
Junio C Hamano1a4e8412005-12-27 08:17:232254<div id="footer">
2255<div id="footer-text">
Junio C Hamano683a8612013-08-23 20:50:092256Last updated 2013-08-20 08:40:27 PDT
Junio C Hamano1a4e8412005-12-27 08:17:232257</div>
2258</div>
2259</body>
2260</html>