blob: f4447688528f7b76c4e59879a4007a4a299cc562 [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 Hamano61525f92014-01-17 22:46:496<meta name="generator" content="AsciiDoc 8.6.6" />
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 Hamano61525f92014-01-17 22:46:4990pre {
Junio C Hamano1a4e8412005-12-27 08:17:2391 padding: 0;
92 margin: 0;
93}
94
Junio C Hamano9629d4f2012-12-19 00:28:2795#author {
Junio C Hamano1a4e8412005-12-27 08:17:2396 color: #527bbd;
Junio C Hamano1a4e8412005-12-27 08:17:2397 font-weight: bold;
Junio C Hamanoba4b9282008-07-06 05:20:3198 font-size: 1.1em;
Junio C Hamano1a4e8412005-12-27 08:17:2399}
Junio C Hamano9629d4f2012-12-19 00:28:27100#email {
Junio C Hamano1a4e8412005-12-27 08:17:23101}
Junio C Hamano9629d4f2012-12-19 00:28:27102#revnumber, #revdate, #revremark {
Junio C Hamano1a4e8412005-12-27 08:17:23103}
104
Junio C Hamano9629d4f2012-12-19 00:28:27105#footer {
Junio C Hamano1a4e8412005-12-27 08:17:23106 font-size: small;
107 border-top: 2px solid silver;
108 padding-top: 0.5em;
109 margin-top: 4.0em;
110}
Junio C Hamano9629d4f2012-12-19 00:28:27111#footer-text {
Junio C Hamano1a4e8412005-12-27 08:17:23112 float: left;
113 padding-bottom: 0.5em;
114}
Junio C Hamano9629d4f2012-12-19 00:28:27115#footer-badges {
Junio C Hamano1a4e8412005-12-27 08:17:23116 float: right;
117 padding-bottom: 0.5em;
118}
119
Junio C Hamano9629d4f2012-12-19 00:28:27120#preamble {
Junio C Hamano68cf15a2010-11-06 01:01:59121 margin-top: 1.5em;
122 margin-bottom: 1.5em;
123}
Junio C Hamano9629d4f2012-12-19 00:28:27124div.imageblock, div.exampleblock, div.verseblock,
Junio C Hamano1a4e8412005-12-27 08:17:23125div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
126div.admonitionblock {
Junio C Hamano7bd050f2011-09-22 06:32:22127 margin-top: 1.0em;
Junio C Hamano1a4e8412005-12-27 08:17:23128 margin-bottom: 1.5em;
129}
130div.admonitionblock {
Junio C Hamano7bd050f2011-09-22 06:32:22131 margin-top: 2.0em;
132 margin-bottom: 2.0em;
133 margin-right: 10%;
134 color: #606060;
Junio C Hamano1a4e8412005-12-27 08:17:23135}
136
137div.content { /* Block element content. */
138 padding: 0;
139}
140
141/* Block element titles. */
142div.title, caption.title {
Junio C Hamano68cf15a2010-11-06 01:01:59143 color: #527bbd;
Junio C Hamano1a4e8412005-12-27 08:17:23144 font-weight: bold;
145 text-align: left;
146 margin-top: 1.0em;
147 margin-bottom: 0.5em;
148}
149div.title + * {
150 margin-top: 0;
151}
152
153td div.title:first-child {
154 margin-top: 0.0em;
155}
156div.content div.title:first-child {
157 margin-top: 0.0em;
158}
159div.content + div.title {
160 margin-top: 0.0em;
161}
162
163div.sidebarblock > div.content {
164 background: #ffffee;
Junio C Hamano9629d4f2012-12-19 00:28:27165 border: 1px solid #dddddd;
166 border-left: 4px solid #f0f0f0;
Junio C Hamano1a4e8412005-12-27 08:17:23167 padding: 0.5em;
168}
169
170div.listingblock > div.content {
Junio C Hamano9629d4f2012-12-19 00:28:27171 border: 1px solid #dddddd;
172 border-left: 5px solid #f0f0f0;
173 background: #f8f8f8;
Junio C Hamano1a4e8412005-12-27 08:17:23174 padding: 0.5em;
175}
176
Junio C Hamano7bd050f2011-09-22 06:32:22177div.quoteblock, div.verseblock {
178 padding-left: 1.0em;
179 margin-left: 1.0em;
Junio C Hamano68cf15a2010-11-06 01:01:59180 margin-right: 10%;
Junio C Hamano9629d4f2012-12-19 00:28:27181 border-left: 5px solid #f0f0f0;
182 color: #888;
Junio C Hamano1a4e8412005-12-27 08:17:23183}
Junio C Hamano7bd050f2011-09-22 06:32:22184
Junio C Hamano68cf15a2010-11-06 01:01:59185div.quoteblock > div.attribution {
186 padding-top: 0.5em;
Junio C Hamano1a4e8412005-12-27 08:17:23187 text-align: right;
188}
Junio C Hamano68cf15a2010-11-06 01:01:59189
Junio C Hamano9629d4f2012-12-19 00:28:27190div.verseblock > pre.content {
191 font-family: inherit;
192 font-size: inherit;
Junio C Hamano68cf15a2010-11-06 01:01:59193}
194div.verseblock > div.attribution {
195 padding-top: 0.75em;
196 text-align: left;
197}
198/* DEPRECATED: Pre version 8.2.7 verse style literal block. */
Junio C Hamanoba4b9282008-07-06 05:20:31199div.verseblock + div.attribution {
200 text-align: left;
201}
Junio C Hamano1a4e8412005-12-27 08:17:23202
203div.admonitionblock .icon {
204 vertical-align: top;
205 font-size: 1.1em;
206 font-weight: bold;
207 text-decoration: underline;
208 color: #527bbd;
209 padding-right: 0.5em;
210}
211div.admonitionblock td.content {
212 padding-left: 0.5em;
Junio C Hamano7bd050f2011-09-22 06:32:22213 border-left: 3px solid #dddddd;
Junio C Hamano1a4e8412005-12-27 08:17:23214}
215
216div.exampleblock > div.content {
Junio C Hamano7bd050f2011-09-22 06:32:22217 border-left: 3px solid #dddddd;
218 padding-left: 0.5em;
Junio C Hamano1a4e8412005-12-27 08:17:23219}
220
Junio C Hamano1a4e8412005-12-27 08:17:23221div.imageblock div.content { padding-left: 0; }
Junio C Hamano1a4e8412005-12-27 08:17:23222span.image img { border-style: none; }
Junio C Hamano68cf15a2010-11-06 01:01:59223a.image:visited { color: white; }
Junio C Hamano1a4e8412005-12-27 08:17:23224
225dl {
226 margin-top: 0.8em;
227 margin-bottom: 0.8em;
228}
229dt {
230 margin-top: 0.5em;
231 margin-bottom: 0;
Junio C Hamano68cf15a2010-11-06 01:01:59232 font-style: normal;
233 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:23234}
235dd > *:first-child {
Junio C Hamano68cf15a2010-11-06 01:01:59236 margin-top: 0.1em;
Junio C Hamano1a4e8412005-12-27 08:17:23237}
238
239ul, ol {
240 list-style-position: outside;
241}
Junio C Hamano68cf15a2010-11-06 01:01:59242ol.arabic {
243 list-style-type: decimal;
244}
245ol.loweralpha {
Junio C Hamano1a4e8412005-12-27 08:17:23246 list-style-type: lower-alpha;
247}
Junio C Hamano68cf15a2010-11-06 01:01:59248ol.upperalpha {
249 list-style-type: upper-alpha;
250}
251ol.lowerroman {
252 list-style-type: lower-roman;
253}
254ol.upperroman {
255 list-style-type: upper-roman;
256}
257
258div.compact ul, div.compact ol,
259div.compact p, div.compact p,
260div.compact div, div.compact div {
261 margin-top: 0.1em;
262 margin-bottom: 0.1em;
263}
Junio C Hamano1a4e8412005-12-27 08:17:23264
Junio C Hamano1a4e8412005-12-27 08:17:23265tfoot {
266 font-weight: bold;
267}
Junio C Hamano68cf15a2010-11-06 01:01:59268td > div.verse {
269 white-space: pre;
270}
Junio C Hamano68cf15a2010-11-06 01:01:59271
272div.hdlist {
Junio C Hamano1a4e8412005-12-27 08:17:23273 margin-top: 0.8em;
274 margin-bottom: 0.8em;
275}
Junio C Hamano68cf15a2010-11-06 01:01:59276div.hdlist tr {
277 padding-bottom: 15px;
Junio C Hamanoba4b9282008-07-06 05:20:31278}
Junio C Hamano68cf15a2010-11-06 01:01:59279dt.hdlist1.strong, td.hdlist1.strong {
280 font-weight: bold;
281}
282td.hdlist1 {
Junio C Hamano1a4e8412005-12-27 08:17:23283 vertical-align: top;
Junio C Hamano68cf15a2010-11-06 01:01:59284 font-style: normal;
Junio C Hamano1a4e8412005-12-27 08:17:23285 padding-right: 0.8em;
Junio C Hamano68cf15a2010-11-06 01:01:59286 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:23287}
Junio C Hamano68cf15a2010-11-06 01:01:59288td.hdlist2 {
Junio C Hamano1a4e8412005-12-27 08:17:23289 vertical-align: top;
290}
Junio C Hamano68cf15a2010-11-06 01:01:59291div.hdlist.compact tr {
292 margin: 0;
293 padding-bottom: 0;
294}
295
296.comment {
297 background: yellow;
298}
Junio C Hamano1a4e8412005-12-27 08:17:23299
Junio C Hamano7bd050f2011-09-22 06:32:22300.footnote, .footnoteref {
301 font-size: 0.8em;
302}
303
304span.footnote, span.footnoteref {
305 vertical-align: super;
306}
307
308#footnotes {
309 margin: 20px 0 20px 0;
310 padding: 7px 0 0 0;
311}
312
313#footnotes div.footnote {
314 margin: 0 0 5px 0;
315}
316
317#footnotes hr {
318 border: none;
319 border-top: 1px solid silver;
320 height: 1px;
321 text-align: left;
322 margin-left: 0;
323 width: 20%;
324 min-width: 100px;
325}
326
Junio C Hamano9629d4f2012-12-19 00:28:27327div.colist td {
328 padding-right: 0.5em;
329 padding-bottom: 0.3em;
330 vertical-align: top;
331}
332div.colist td img {
333 margin-top: 0.3em;
Junio C Hamano1a4e8412005-12-27 08:17:23334}
Junio C Hamanoba4b9282008-07-06 05:20:31335
Junio C Hamano9629d4f2012-12-19 00:28:27336@media print {
337 #footer-badges { display: none; }
338}
339
340#toc {
Junio C Hamano7bd050f2011-09-22 06:32:22341 margin-bottom: 2.5em;
342}
343
Junio C Hamano9629d4f2012-12-19 00:28:27344#toctitle {
Junio C Hamanoba4b9282008-07-06 05:20:31345 color: #527bbd;
Junio C Hamanoba4b9282008-07-06 05:20:31346 font-size: 1.1em;
347 font-weight: bold;
348 margin-top: 1.0em;
349 margin-bottom: 0.1em;
350}
351
Junio C Hamano61525f92014-01-17 22:46:49352div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
Junio C Hamanoba4b9282008-07-06 05:20:31353 margin-top: 0;
354 margin-bottom: 0;
355}
356div.toclevel2 {
357 margin-left: 2em;
358 font-size: 0.9em;
359}
360div.toclevel3 {
361 margin-left: 4em;
362 font-size: 0.9em;
363}
364div.toclevel4 {
365 margin-left: 6em;
366 font-size: 0.9em;
367}
Junio C Hamano9629d4f2012-12-19 00:28:27368
369span.aqua { color: aqua; }
370span.black { color: black; }
371span.blue { color: blue; }
372span.fuchsia { color: fuchsia; }
373span.gray { color: gray; }
374span.green { color: green; }
375span.lime { color: lime; }
376span.maroon { color: maroon; }
377span.navy { color: navy; }
378span.olive { color: olive; }
379span.purple { color: purple; }
380span.red { color: red; }
381span.silver { color: silver; }
382span.teal { color: teal; }
383span.white { color: white; }
384span.yellow { color: yellow; }
385
386span.aqua-background { background: aqua; }
387span.black-background { background: black; }
388span.blue-background { background: blue; }
389span.fuchsia-background { background: fuchsia; }
390span.gray-background { background: gray; }
391span.green-background { background: green; }
392span.lime-background { background: lime; }
393span.maroon-background { background: maroon; }
394span.navy-background { background: navy; }
395span.olive-background { background: olive; }
396span.purple-background { background: purple; }
397span.red-background { background: red; }
398span.silver-background { background: silver; }
399span.teal-background { background: teal; }
400span.white-background { background: white; }
401span.yellow-background { background: yellow; }
402
403span.big { font-size: 2em; }
404span.small { font-size: 0.6em; }
405
406span.underline { text-decoration: underline; }
407span.overline { text-decoration: overline; }
408span.line-through { text-decoration: line-through; }
409
Junio C Hamano9629d4f2012-12-19 00:28:27410
411/*
412 * xhtml11 specific
413 *
414 * */
415
Junio C Hamano61525f92014-01-17 22:46:49416tt {
417 font-family: monospace;
418 font-size: inherit;
419 color: navy;
420}
421
Junio C Hamano9629d4f2012-12-19 00:28:27422div.tableblock {
423 margin-top: 1.0em;
424 margin-bottom: 1.5em;
425}
426div.tableblock > table {
427 border: 3px solid #527bbd;
428}
429thead, p.table.header {
430 font-weight: bold;
431 color: #527bbd;
432}
433p.table {
434 margin-top: 0;
435}
436/* Because the table frame attribute is overriden by CSS in most browsers. */
437div.tableblock > table[frame="void"] {
438 border-style: none;
439}
440div.tableblock > table[frame="hsides"] {
441 border-left-style: none;
442 border-right-style: none;
443}
444div.tableblock > table[frame="vsides"] {
445 border-top-style: none;
446 border-bottom-style: none;
447}
448
449
450/*
451 * html5 specific
452 *
453 * */
454
Junio C Hamano61525f92014-01-17 22:46:49455.monospaced {
456 font-family: monospace;
457 font-size: inherit;
458 color: navy;
459}
460
Junio C Hamano9629d4f2012-12-19 00:28:27461table.tableblock {
462 margin-top: 1.0em;
463 margin-bottom: 1.5em;
464}
465thead, p.tableblock.header {
466 font-weight: bold;
467 color: #527bbd;
468}
469p.tableblock {
470 margin-top: 0;
471}
472table.tableblock {
473 border-width: 3px;
474 border-spacing: 0px;
475 border-style: solid;
476 border-color: #527bbd;
477 border-collapse: collapse;
478}
479th.tableblock, td.tableblock {
480 border-width: 1px;
481 padding: 4px;
482 border-style: solid;
483 border-color: #527bbd;
484}
485
486table.tableblock.frame-topbot {
487 border-left-style: hidden;
488 border-right-style: hidden;
489}
490table.tableblock.frame-sides {
491 border-top-style: hidden;
492 border-bottom-style: hidden;
493}
494table.tableblock.frame-none {
495 border-style: hidden;
496}
497
498th.tableblock.halign-left, td.tableblock.halign-left {
499 text-align: left;
500}
501th.tableblock.halign-center, td.tableblock.halign-center {
502 text-align: center;
503}
504th.tableblock.halign-right, td.tableblock.halign-right {
505 text-align: right;
506}
507
508th.tableblock.valign-top, td.tableblock.valign-top {
509 vertical-align: top;
510}
511th.tableblock.valign-middle, td.tableblock.valign-middle {
512 vertical-align: middle;
513}
514th.tableblock.valign-bottom, td.tableblock.valign-bottom {
515 vertical-align: bottom;
516}
517
518
519/*
520 * manpage specific
521 *
522 * */
523
524body.manpage h1 {
Junio C Hamano68cf15a2010-11-06 01:01:59525 padding-top: 0.5em;
526 padding-bottom: 0.5em;
527 border-top: 2px solid silver;
528 border-bottom: 2px solid silver;
529}
Junio C Hamano9629d4f2012-12-19 00:28:27530body.manpage h2 {
Junio C Hamano68cf15a2010-11-06 01:01:59531 border-style: none;
532}
Junio C Hamano9629d4f2012-12-19 00:28:27533body.manpage div.sectionbody {
534 margin-left: 3em;
Junio C Hamano68cf15a2010-11-06 01:01:59535}
536
537@media print {
Junio C Hamano9629d4f2012-12-19 00:28:27538 body.manpage div#toc { display: none; }
Junio C Hamano68cf15a2010-11-06 01:01:59539}
Junio C Hamano1a4e8412005-12-27 08:17:23540</style>
Junio C Hamano7bd050f2011-09-22 06:32:22541<script type="text/javascript">
542/*<![CDATA[*/
Junio C Hamano7bd050f2011-09-22 06:32:22543var asciidoc = { // Namespace.
544
545/////////////////////////////////////////////////////////////////////
546// Table Of Contents generator
547/////////////////////////////////////////////////////////////////////
548
549/* Author: Mihai Bazon, September 2002
550 * http://students.infoiasi.ro/~mishoo
551 *
552 * Table Of Content generator
553 * Version: 0.4
554 *
555 * Feel free to use this script under the terms of the GNU General Public
556 * License, as long as you do not remove or alter this notice.
557 */
558
559 /* modified by Troy D. Hanson, September 2006. License: GPL */
560 /* modified by Stuart Rackham, 2006, 2009. License: GPL */
561
562// toclevels = 1..4.
563toc: function (toclevels) {
564
565 function getText(el) {
566 var text = "";
567 for (var i = el.firstChild; i != null; i = i.nextSibling) {
568 if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
569 text += i.data;
570 else if (i.firstChild != null)
571 text += getText(i);
572 }
573 return text;
574 }
575
576 function TocEntry(el, text, toclevel) {
577 this.element = el;
578 this.text = text;
579 this.toclevel = toclevel;
580 }
581
582 function tocEntries(el, toclevels) {
583 var result = new Array;
Junio C Hamano61525f92014-01-17 22:46:49584 var re = new RegExp('[hH]([2-'+(toclevels+1)+'])');
Junio C Hamano7bd050f2011-09-22 06:32:22585 // Function that scans the DOM tree for header elements (the DOM2
586 // nodeIterator API would be a better technique but not supported by all
587 // browsers).
588 var iterate = function (el) {
589 for (var i = el.firstChild; i != null; i = i.nextSibling) {
590 if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
591 var mo = re.exec(i.tagName);
592 if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
593 result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
594 }
595 iterate(i);
596 }
597 }
598 }
599 iterate(el);
600 return result;
601 }
602
603 var toc = document.getElementById("toc");
Junio C Hamano9629d4f2012-12-19 00:28:27604 if (!toc) {
605 return;
606 }
607
608 // Delete existing TOC entries in case we're reloading the TOC.
609 var tocEntriesToRemove = [];
610 var i;
611 for (i = 0; i < toc.childNodes.length; i++) {
612 var entry = toc.childNodes[i];
Junio C Hamano61525f92014-01-17 22:46:49613 if (entry.nodeName == 'div'
Junio C Hamano9629d4f2012-12-19 00:28:27614 && entry.getAttribute("class")
615 && entry.getAttribute("class").match(/^toclevel/))
616 tocEntriesToRemove.push(entry);
617 }
618 for (i = 0; i < tocEntriesToRemove.length; i++) {
619 toc.removeChild(tocEntriesToRemove[i]);
620 }
621
622 // Rebuild TOC entries.
Junio C Hamano7bd050f2011-09-22 06:32:22623 var entries = tocEntries(document.getElementById("content"), toclevels);
624 for (var i = 0; i < entries.length; ++i) {
625 var entry = entries[i];
626 if (entry.element.id == "")
627 entry.element.id = "_toc_" + i;
628 var a = document.createElement("a");
629 a.href = "#" + entry.element.id;
630 a.appendChild(document.createTextNode(entry.text));
631 var div = document.createElement("div");
632 div.appendChild(a);
633 div.className = "toclevel" + entry.toclevel;
634 toc.appendChild(div);
635 }
636 if (entries.length == 0)
637 toc.parentNode.removeChild(toc);
638},
639
640
641/////////////////////////////////////////////////////////////////////
642// Footnotes generator
643/////////////////////////////////////////////////////////////////////
644
645/* Based on footnote generation code from:
646 * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
647 */
648
649footnotes: function () {
Junio C Hamano9629d4f2012-12-19 00:28:27650 // Delete existing footnote entries in case we're reloading the footnodes.
651 var i;
Junio C Hamano7bd050f2011-09-22 06:32:22652 var noteholder = document.getElementById("footnotes");
Junio C Hamano9629d4f2012-12-19 00:28:27653 if (!noteholder) {
654 return;
655 }
656 var entriesToRemove = [];
657 for (i = 0; i < noteholder.childNodes.length; i++) {
658 var entry = noteholder.childNodes[i];
Junio C Hamano61525f92014-01-17 22:46:49659 if (entry.nodeName == 'div' && entry.getAttribute("class") == "footnote")
Junio C Hamano9629d4f2012-12-19 00:28:27660 entriesToRemove.push(entry);
661 }
662 for (i = 0; i < entriesToRemove.length; i++) {
663 noteholder.removeChild(entriesToRemove[i]);
664 }
665
666 // Rebuild footnote entries.
667 var cont = document.getElementById("content");
Junio C Hamano7bd050f2011-09-22 06:32:22668 var spans = cont.getElementsByTagName("span");
669 var refs = {};
670 var n = 0;
671 for (i=0; i<spans.length; i++) {
672 if (spans[i].className == "footnote") {
673 n++;
Junio C Hamano9629d4f2012-12-19 00:28:27674 var note = spans[i].getAttribute("data-note");
675 if (!note) {
676 // Use [\s\S] in place of . so multi-line matches work.
677 // Because JavaScript has no s (dotall) regex flag.
678 note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
679 spans[i].innerHTML =
680 "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
681 "' title='View footnote' class='footnote'>" + n + "</a>]";
682 spans[i].setAttribute("data-note", note);
683 }
Junio C Hamano7bd050f2011-09-22 06:32:22684 noteholder.innerHTML +=
685 "<div class='footnote' id='_footnote_" + n + "'>" +
686 "<a href='#_footnoteref_" + n + "' title='Return to text'>" +
687 n + "</a>. " + note + "</div>";
Junio C Hamano7bd050f2011-09-22 06:32:22688 var id =spans[i].getAttribute("id");
689 if (id != null) refs["#"+id] = n;
690 }
691 }
692 if (n == 0)
693 noteholder.parentNode.removeChild(noteholder);
694 else {
695 // Process footnoterefs.
696 for (i=0; i<spans.length; i++) {
697 if (spans[i].className == "footnoteref") {
698 var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
699 href = href.match(/#.*/)[0]; // Because IE return full URL.
700 n = refs[href];
701 spans[i].innerHTML =
702 "[<a href='#_footnote_" + n +
703 "' title='View footnote' class='footnote'>" + n + "</a>]";
704 }
705 }
706 }
Junio C Hamano9629d4f2012-12-19 00:28:27707},
708
709install: function(toclevels) {
710 var timerId;
711
712 function reinstall() {
713 asciidoc.footnotes();
714 if (toclevels) {
715 asciidoc.toc(toclevels);
716 }
717 }
718
719 function reinstallAndRemoveTimer() {
720 clearInterval(timerId);
721 reinstall();
722 }
723
724 timerId = setInterval(reinstall, 500);
725 if (document.addEventListener)
726 document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false);
727 else
728 window.onload = reinstallAndRemoveTimer;
Junio C Hamano7bd050f2011-09-22 06:32:22729}
730
731}
Junio C Hamano9629d4f2012-12-19 00:28:27732asciidoc.install();
Junio C Hamano7bd050f2011-09-22 06:32:22733/*]]>*/
734</script>
Junio C Hamano1a4e8412005-12-27 08:17:23735</head>
Junio C Hamano9629d4f2012-12-19 00:28:27736<body class="manpage">
Junio C Hamano1a4e8412005-12-27 08:17:23737<div id="header">
738<h1>
739git-diff-files(1) Manual Page
740</h1>
741<h2>NAME</h2>
742<div class="sectionbody">
743<p>git-diff-files -
744 Compares files in the working tree and the index
745</p>
746</div>
747</div>
Junio C Hamano7bd050f2011-09-22 06:32:22748<div id="content">
Junio C Hamano9629d4f2012-12-19 00:28:27749<div class="sect1">
Junio C Hamano68cf15a2010-11-06 01:01:59750<h2 id="_synopsis">SYNOPSIS</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23751<div class="sectionbody">
Junio C Hamano15567bc2011-07-23 00:51:59752<div class="verseblock">
Junio C Hamano9629d4f2012-12-19 00:28:27753<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>
754<div class="attribution">
Junio C Hamano15567bc2011-07-23 00:51:59755</div></div>
Junio C Hamano1a4e8412005-12-27 08:17:23756</div>
Junio C Hamano9629d4f2012-12-19 00:28:27757</div>
758<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:31759<h2 id="_description">DESCRIPTION</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23760<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:59761<div class="paragraph"><p>Compares the files in the working tree and the index. When paths
Junio C Hamano1a4e8412005-12-27 08:17:23762are specified, compares only those named paths. Otherwise all
763entries in the index are compared. The output format is the
Junio C Hamano1aa40d22010-01-21 17:46:43764same as for <em>git diff-index</em> and <em>git diff-tree</em>.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:23765</div>
Junio C Hamano9629d4f2012-12-19 00:28:27766</div>
767<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:31768<h2 id="_options">OPTIONS</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23769<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:59770<div class="dlist"><dl>
771<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:23772-p
773</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59774<dt class="hdlist1">
Junio C Hamanobbbb8652008-12-29 10:34:22775-u
776</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59777<dt class="hdlist1">
Junio C Hamanoe97d5772010-05-19 08:13:58778--patch
779</dt>
Junio C Hamano1a4e8412005-12-27 08:17:23780<dd>
781<p>
Junio C Hamanoff979792007-11-16 10:11:30782 Generate patch (see section on generating patches).
783
Junio C Hamano1a4e8412005-12-27 08:17:23784</p>
785</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59786<dt class="hdlist1">
Junio C Hamano58f587a2013-07-22 19:20:59787-s
788</dt>
789<dt class="hdlist1">
790--no-patch
791</dt>
792<dd>
793<p>
Junio C Hamano61525f92014-01-17 22:46:49794 Suppress diff output. Useful for commands like <tt>git show</tt> that
795 show the patch by default, or to cancel the effect of <tt>--patch</tt>.
Junio C Hamano58f587a2013-07-22 19:20:59796</p>
797</dd>
798<dt class="hdlist1">
Junio C Hamano69361562007-07-26 02:14:34799-U&lt;n&gt;
800</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59801<dt class="hdlist1">
Junio C Hamano69361562007-07-26 02:14:34802--unified=&lt;n&gt;
803</dt>
804<dd>
805<p>
806 Generate diffs with &lt;n&gt; lines of context instead of
Junio C Hamano3b70d3c2009-11-21 17:37:37807 the usual three.
Junio C Hamano61525f92014-01-17 22:46:49808 Implies <tt>-p</tt>.
Junio C Hamano69361562007-07-26 02:14:34809</p>
810</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59811<dt class="hdlist1">
Junio C Hamano9ae1a062006-07-10 08:12:34812--raw
813</dt>
814<dd>
815<p>
816 Generate the raw format.
Junio C Hamanoff979792007-11-16 10:11:30817 This is the default.
Junio C Hamano9ae1a062006-07-10 08:12:34818</p>
819</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59820<dt class="hdlist1">
Junio C Hamano54559c82006-04-13 07:45:12821--patch-with-raw
822</dt>
823<dd>
824<p>
Junio C Hamano61525f92014-01-17 22:46:49825 Synonym for <tt>-p --raw</tt>.
Junio C Hamano54559c82006-04-13 07:45:12826</p>
827</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59828<dt class="hdlist1">
Junio C Hamano5a73f302011-10-14 05:58:34829--minimal
830</dt>
831<dd>
832<p>
833 Spend extra time to make sure the smallest possible
834 diff is produced.
835</p>
836</dd>
837<dt class="hdlist1">
Junio C Hamano20d47e32009-01-26 06:36:02838--patience
839</dt>
840<dd>
841<p>
842 Generate a diff using the "patience diff" algorithm.
843</p>
844</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59845<dt class="hdlist1">
Junio C Hamanoaea9e6b2012-03-07 00:17:11846--histogram
847</dt>
848<dd>
849<p>
850 Generate a diff using the "histogram diff" algorithm.
851</p>
852</dd>
853<dt class="hdlist1">
Junio C Hamano80ad00d2013-02-18 00:19:03854--diff-algorithm={patience|minimal|histogram|myers}
855</dt>
856<dd>
857<p>
858 Choose a diff algorithm. The variants are as follows:
859</p>
860<div class="openblock">
861<div class="content">
862<div class="dlist"><dl>
863<dt class="hdlist1">
Junio C Hamano61525f92014-01-17 22:46:49864<tt>default</tt>, <tt>myers</tt>
Junio C Hamano80ad00d2013-02-18 00:19:03865</dt>
866<dd>
867<p>
868 The basic greedy diff algorithm. Currently, this is the default.
869</p>
870</dd>
871<dt class="hdlist1">
Junio C Hamano61525f92014-01-17 22:46:49872<tt>minimal</tt>
Junio C Hamano80ad00d2013-02-18 00:19:03873</dt>
874<dd>
875<p>
876 Spend extra time to make sure the smallest possible diff is
877 produced.
878</p>
879</dd>
880<dt class="hdlist1">
Junio C Hamano61525f92014-01-17 22:46:49881<tt>patience</tt>
Junio C Hamano80ad00d2013-02-18 00:19:03882</dt>
883<dd>
884<p>
885 Use "patience diff" algorithm when generating patches.
886</p>
887</dd>
888<dt class="hdlist1">
Junio C Hamano61525f92014-01-17 22:46:49889<tt>histogram</tt>
Junio C Hamano80ad00d2013-02-18 00:19:03890</dt>
891<dd>
892<p>
893 This algorithm extends the patience algorithm to "support
894 low-occurrence common elements".
895</p>
896</dd>
897</dl></div>
898</div></div>
899<div class="paragraph"><p>For instance, if you configured diff.algorithm variable to a
900non-default value and want to use the default one, then you
Junio C Hamano61525f92014-01-17 22:46:49901have to use <tt>--diff-algorithm=default</tt> option.</p></div>
Junio C Hamano80ad00d2013-02-18 00:19:03902</dd>
903<dt class="hdlist1">
Junio C Hamano4c4b0122011-06-30 01:19:32904--stat[=&lt;width&gt;[,&lt;name-width&gt;[,&lt;count&gt;]]]
Junio C Hamanoba7c8d82006-04-15 06:17:42905</dt>
906<dd>
907<p>
Junio C Hamanoaea9e6b2012-03-07 00:17:11908 Generate a diffstat. By default, as much space as necessary
909 will be used for the filename part, and the rest for the graph
910 part. Maximum width defaults to terminal width, or 80 columns
Junio C Hamano7f2b3cb2012-06-22 22:42:39911 if not connected to a terminal, and can be overridden by
Junio C Hamano61525f92014-01-17 22:46:49912 <tt>&lt;width&gt;</tt>. The width of the filename part can be limited by
913 giving another width <tt>&lt;name-width&gt;</tt> after a comma. The width
Junio C Hamanoaea9e6b2012-03-07 00:17:11914 of the graph part can be limited by using
Junio C Hamano61525f92014-01-17 22:46:49915 <tt>--stat-graph-width=&lt;width&gt;</tt> (affects all commands generating
916 a stat graph) or by setting <tt>diff.statGraphWidth=&lt;width&gt;</tt>
917 (does not affect <tt>git format-patch</tt>).
918 By giving a third parameter <tt>&lt;count&gt;</tt>, you can limit the
919 output to the first <tt>&lt;count&gt;</tt> lines, followed by <tt>...</tt> if
Junio C Hamanoaea9e6b2012-03-07 00:17:11920 there are more.
Junio C Hamanoba7c8d82006-04-15 06:17:42921</p>
Junio C Hamano61525f92014-01-17 22:46:49922<div class="paragraph"><p>These parameters can also be set individually with <tt>--stat-width=&lt;width&gt;</tt>,
923<tt>--stat-name-width=&lt;name-width&gt;</tt> and <tt>--stat-count=&lt;count&gt;</tt>.</p></div>
Junio C Hamanoba7c8d82006-04-15 06:17:42924</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59925<dt class="hdlist1">
Junio C Hamanofbe00522006-10-19 05:58:48926--numstat
927</dt>
928<dd>
929<p>
Junio C Hamano61525f92014-01-17 22:46:49930 Similar to <tt>--stat</tt>, but shows number of added and
Junio C Hamanofbe00522006-10-19 05:58:48931 deleted lines in decimal notation and pathname without
Junio C Hamanod793de52006-12-26 09:11:43932 abbreviation, to make it more machine friendly. For
Junio C Hamano61525f92014-01-17 22:46:49933 binary files, outputs two <tt>-</tt> instead of saying
934 <tt>0 0</tt>.
Junio C Hamanofbe00522006-10-19 05:58:48935</p>
936</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59937<dt class="hdlist1">
Junio C Hamano7d23f5e2006-12-16 07:44:04938--shortstat
939</dt>
940<dd>
941<p>
Junio C Hamano61525f92014-01-17 22:46:49942 Output only the last line of the <tt>--stat</tt> format containing total
Junio C Hamano7d23f5e2006-12-16 07:44:04943 number of modified files, as well as number of added and deleted
944 lines.
945</p>
946</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59947<dt class="hdlist1">
Junio C Hamano1c222c52011-05-13 19:55:32948--dirstat[=&lt;param1,param2,&#8230;&gt;]
Junio C Hamano6a45be92008-04-22 08:19:03949</dt>
950<dd>
951<p>
Junio C Hamano1c222c52011-05-13 19:55:32952 Output the distribution of relative amount of changes for each
Junio C Hamano61525f92014-01-17 22:46:49953 sub-directory. The behavior of <tt>--dirstat</tt> can be customized by
Junio C Hamano1c222c52011-05-13 19:55:32954 passing it a comma separated list of parameters.
Junio C Hamano61525f92014-01-17 22:46:49955 The defaults are controlled by the <tt>diff.dirstat</tt> configuration
Junio C Hamanoa28a9202012-06-21 07:08:23956 variable (see <a href="git-config.html">git-config(1)</a>).
Junio C Hamano1c222c52011-05-13 19:55:32957 The following parameters are available:
Junio C Hamano6a45be92008-04-22 08:19:03958</p>
Junio C Hamano9629d4f2012-12-19 00:28:27959<div class="openblock">
960<div class="content">
Junio C Hamano1c222c52011-05-13 19:55:32961<div class="dlist"><dl>
962<dt class="hdlist1">
Junio C Hamano61525f92014-01-17 22:46:49963<tt>changes</tt>
Junio C Hamano1c222c52011-05-13 19:55:32964</dt>
965<dd>
966<p>
967 Compute the dirstat numbers by counting the lines that have been
968 removed from the source, or added to the destination. This ignores
969 the amount of pure code movements within a file. In other words,
970 rearranging lines in a file is not counted as much as other changes.
971 This is the default behavior when no parameter is given.
972</p>
Junio C Hamano6a45be92008-04-22 08:19:03973</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59974<dt class="hdlist1">
Junio C Hamano61525f92014-01-17 22:46:49975<tt>lines</tt>
Junio C Hamanoa476efa2008-10-10 15:31:42976</dt>
977<dd>
978<p>
Junio C Hamano1c222c52011-05-13 19:55:32979 Compute the dirstat numbers by doing the regular line-based diff
980 analysis, and summing the removed/added line counts. (For binary
981 files, count 64-byte chunks instead, since binary files have no
Junio C Hamano61525f92014-01-17 22:46:49982 natural concept of lines). This is a more expensive <tt>--dirstat</tt>
983 behavior than the <tt>changes</tt> behavior, but it does count rearranged
Junio C Hamano1c222c52011-05-13 19:55:32984 lines within a file as much as other changes. The resulting output
Junio C Hamano61525f92014-01-17 22:46:49985 is consistent with what you get from the other <tt>--*stat</tt> options.
Junio C Hamanoa476efa2008-10-10 15:31:42986</p>
987</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59988<dt class="hdlist1">
Junio C Hamano61525f92014-01-17 22:46:49989<tt>files</tt>
Junio C Hamano1c222c52011-05-13 19:55:32990</dt>
991<dd>
992<p>
993 Compute the dirstat numbers by counting the number of files changed.
994 Each changed file counts equally in the dirstat analysis. This is
Junio C Hamano61525f92014-01-17 22:46:49995 the computationally cheapest <tt>--dirstat</tt> behavior, since it does
Junio C Hamano1c222c52011-05-13 19:55:32996 not have to look at the file contents at all.
997</p>
998</dd>
999<dt class="hdlist1">
Junio C Hamano61525f92014-01-17 22:46:491000<tt>cumulative</tt>
Junio C Hamano1c222c52011-05-13 19:55:321001</dt>
1002<dd>
1003<p>
1004 Count changes in a child directory for the parent directory as well.
Junio C Hamano61525f92014-01-17 22:46:491005 Note that when using <tt>cumulative</tt>, the sum of the percentages
Junio C Hamano1c222c52011-05-13 19:55:321006 reported may exceed 100%. The default (non-cumulative) behavior can
Junio C Hamano61525f92014-01-17 22:46:491007 be specified with the <tt>noncumulative</tt> parameter.
Junio C Hamano1c222c52011-05-13 19:55:321008</p>
1009</dd>
1010<dt class="hdlist1">
1011&lt;limit&gt;
1012</dt>
1013<dd>
1014<p>
1015 An integer parameter specifies a cut-off percent (3% by default).
1016 Directories contributing less than this percentage of the changes
1017 are not shown in the output.
1018</p>
1019</dd>
1020</dl></div>
Junio C Hamano9629d4f2012-12-19 00:28:271021</div></div>
Junio C Hamano1c222c52011-05-13 19:55:321022<div class="paragraph"><p>Example: The following will count changed files, while ignoring
1023directories with less than 10% of the total amount of changed files,
1024and accumulating child directory counts in the parent directories:
Junio C Hamano61525f92014-01-17 22:46:491025<tt>--dirstat=files,10,cumulative</tt>.</p></div>
Junio C Hamano1c222c52011-05-13 19:55:321026</dd>
1027<dt class="hdlist1">
Junio C Hamano6959c6c2006-05-17 10:34:111028--summary
1029</dt>
1030<dd>
1031<p>
1032 Output a condensed summary of extended header information
1033 such as creations, renames and mode changes.
1034</p>
1035</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591036<dt class="hdlist1">
Junio C Hamanod1308c92006-04-16 11:01:091037--patch-with-stat
1038</dt>
1039<dd>
1040<p>
Junio C Hamano61525f92014-01-17 22:46:491041 Synonym for <tt>-p --stat</tt>.
Junio C Hamanod1308c92006-04-16 11:01:091042</p>
1043</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591044<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231045-z
1046</dt>
1047<dd>
1048<p>
Junio C Hamano61525f92014-01-17 22:46:491049 When <tt>--raw</tt>, <tt>--numstat</tt>, <tt>--name-only</tt> or <tt>--name-status</tt> has been
Junio C Hamano0c053e82010-04-19 06:46:341050 given, do not munge pathnames and use NULs as output field terminators.
Junio C Hamano1a4e8412005-12-27 08:17:231051</p>
Junio C Hamano68cf15a2010-11-06 01:01:591052<div class="paragraph"><p>Without this option, each pathname output will have TAB, LF, double quotes,
Junio C Hamano61525f92014-01-17 22:46:491053and backslash characters replaced with <tt>\t</tt>, <tt>\n</tt>, <tt>\"</tt>, and <tt>\\</tt>,
Junio C Hamano5706e0b2009-11-24 10:54:161054respectively, and the pathname will be enclosed in double quotes if
1055any of those replacements occurred.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231056</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591057<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231058--name-only
1059</dt>
1060<dd>
1061<p>
1062 Show only names of changed files.
1063</p>
1064</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591065<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231066--name-status
1067</dt>
1068<dd>
1069<p>
Junio C Hamanoa9aee782008-04-23 16:09:201070 Show only names and status of changed files. See the description
Junio C Hamano61525f92014-01-17 22:46:491071 of the <tt>--diff-filter</tt> option on what the status letters mean.
Junio C Hamano1a4e8412005-12-27 08:17:231072</p>
1073</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591074<dt class="hdlist1">
Junio C Hamanoc21ab052009-10-31 04:03:551075--submodule[=&lt;format&gt;]
1076</dt>
1077<dd>
1078<p>
Junio C Hamano61525f92014-01-17 22:46:491079 Specify how differences in submodules are shown. When <tt>--submodule</tt>
1080 or <tt>--submodule=log</tt> is given, the <em>log</em> format is used. This format lists
1081 the commits in the range like <a href="git-submodule.html">git-submodule(1)</a> <tt>summary</tt> does.
1082 Omitting the <tt>--submodule</tt> option or specifying <tt>--submodule=short</tt>,
Junio C Hamanoe768cc12012-03-16 05:43:051083 uses the <em>short</em> format. This format just shows the names of the commits
Junio C Hamanob4e58b12012-11-26 03:13:061084 at the beginning and end of the range. Can be tweaked via the
Junio C Hamano61525f92014-01-17 22:46:491085 <tt>diff.submodule</tt> configuration variable.
Junio C Hamanoc21ab052009-10-31 04:03:551086</p>
1087</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591088<dt class="hdlist1">
Junio C Hamano4aa0bcc2010-03-03 05:13:121089--color[=&lt;when&gt;]
Junio C Hamano9ae1a062006-07-10 08:12:341090</dt>
1091<dd>
1092<p>
1093 Show colored diff.
Junio C Hamano61525f92014-01-17 22:46:491094 <tt>--color</tt> (i.e. without <em>=&lt;when&gt;</em>) is the same as <tt>--color=always</tt>.
1095 <em>&lt;when&gt;</em> can be one of <tt>always</tt>, <tt>never</tt>, or <tt>auto</tt>.
Junio C Hamano9ae1a062006-07-10 08:12:341096</p>
1097</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591098<dt class="hdlist1">
Junio C Hamano9ae1a062006-07-10 08:12:341099--no-color
1100</dt>
1101<dd>
1102<p>
Junio C Hamano5f2627d2011-05-06 20:23:481103 Turn off colored diff.
Junio C Hamano61525f92014-01-17 22:46:491104 It is the same as <tt>--color=never</tt>.
Junio C Hamano9ae1a062006-07-10 08:12:341105</p>
1106</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591107<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531108--word-diff[=&lt;mode&gt;]
Junio C Hamano85e45fa2006-08-13 07:47:411109</dt>
1110<dd>
1111<p>
Junio C Hamanocc7636a2010-05-21 14:57:531112 Show a word diff, using the &lt;mode&gt; to delimit changed words.
1113 By default, words are delimited by whitespace; see
Junio C Hamano61525f92014-01-17 22:46:491114 <tt>--word-diff-regex</tt> below. The &lt;mode&gt; defaults to <em>plain</em>, and
Junio C Hamanocc7636a2010-05-21 14:57:531115 must be one of:
Junio C Hamano85e45fa2006-08-13 07:47:411116</p>
Junio C Hamano9629d4f2012-12-19 00:28:271117<div class="openblock">
1118<div class="content">
Junio C Hamano68cf15a2010-11-06 01:01:591119<div class="dlist"><dl>
1120<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531121color
1122</dt>
1123<dd>
1124<p>
Junio C Hamano61525f92014-01-17 22:46:491125 Highlight changed words using only colors. Implies <tt>--color</tt>.
Junio C Hamanocc7636a2010-05-21 14:57:531126</p>
1127</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591128<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531129plain
1130</dt>
1131<dd>
1132<p>
Junio C Hamano61525f92014-01-17 22:46:491133 Show words as <tt>[-removed-]</tt> and <tt>{+added+}</tt>. Makes no
Junio C Hamanocc7636a2010-05-21 14:57:531134 attempts to escape the delimiters if they appear in the input,
1135 so the output may be ambiguous.
1136</p>
1137</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591138<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531139porcelain
1140</dt>
1141<dd>
1142<p>
1143 Use a special line-based format intended for script
1144 consumption. Added/removed/unchanged runs are printed in the
Junio C Hamano61525f92014-01-17 22:46:491145 usual unified diff format, starting with a <tt>+</tt>/<tt>-</tt>/` `
Junio C Hamanocc7636a2010-05-21 14:57:531146 character at the beginning of the line and extending to the
1147 end of the line. Newlines in the input are represented by a
Junio C Hamano61525f92014-01-17 22:46:491148 tilde <tt>~</tt> on a line of its own.
Junio C Hamanocc7636a2010-05-21 14:57:531149</p>
1150</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591151<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531152none
1153</dt>
1154<dd>
1155<p>
1156 Disable word diff again.
1157</p>
1158</dd>
1159</dl></div>
Junio C Hamano9629d4f2012-12-19 00:28:271160</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591161<div class="paragraph"><p>Note that despite the name of the first mode, color is used to
Junio C Hamanocc7636a2010-05-21 14:57:531162highlight the changed parts in all modes if enabled.</p></div>
1163</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591164<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531165--word-diff-regex=&lt;regex&gt;
1166</dt>
1167<dd>
1168<p>
1169 Use &lt;regex&gt; to decide what a word is, instead of considering
1170 runs of non-whitespace to be a word. Also implies
Junio C Hamano61525f92014-01-17 22:46:491171 <tt>--word-diff</tt> unless it was already enabled.
Junio C Hamanocc7636a2010-05-21 14:57:531172</p>
Junio C Hamano68cf15a2010-11-06 01:01:591173<div class="paragraph"><p>Every non-overlapping match of the
Junio C Hamano20d47e32009-01-26 06:36:021174&lt;regex&gt; is considered a word. Anything between these matches is
1175considered whitespace and ignored(!) for the purposes of finding
Junio C Hamano61525f92014-01-17 22:46:491176differences. You may want to append <tt>|[^[:space:]]</tt> to your regular
Junio C Hamano20d47e32009-01-26 06:36:021177expression to make sure that it matches all non-whitespace characters.
1178A match that contains a newline is silently truncated(!) at the
1179newline.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591180<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:231181<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:021182overrides any diff driver or configuration setting. Diff drivers
1183override configuration settings.</p></div>
Junio C Hamano85e45fa2006-08-13 07:47:411184</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591185<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531186--color-words[=&lt;regex&gt;]
1187</dt>
1188<dd>
1189<p>
Junio C Hamano61525f92014-01-17 22:46:491190 Equivalent to <tt>--word-diff=color</tt> plus (if a regex was
1191 specified) <tt>--word-diff-regex=&lt;regex&gt;</tt>.
Junio C Hamanocc7636a2010-05-21 14:57:531192</p>
1193</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591194<dt class="hdlist1">
Junio C Hamano9ae1a062006-07-10 08:12:341195--no-renames
1196</dt>
1197<dd>
1198<p>
1199 Turn off rename detection, even when the configuration
1200 file gives the default to do so.
1201</p>
1202</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591203<dt class="hdlist1">
Junio C Hamanoa890c4f2007-01-28 10:29:211204--check
1205</dt>
1206<dd>
1207<p>
Junio C Hamano6005bfa2011-06-23 00:51:221208 Warn if changes introduce whitespace errors. What are
Junio C Hamano61525f92014-01-17 22:46:491209 considered whitespace errors is controlled by <tt>core.whitespace</tt>
Junio C Hamano6005bfa2011-06-23 00:51:221210 configuration. By default, trailing whitespaces (including
1211 lines that solely consist of whitespaces) and a space character
1212 that is immediately followed by a tab character inside the
1213 initial indent of the line are considered whitespace errors.
1214 Exits with non-zero status if problems are found. Not compatible
1215 with --exit-code.
Junio C Hamanoa890c4f2007-01-28 10:29:211216</p>
1217</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591218<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231219--full-index
1220</dt>
1221<dd>
1222<p>
Junio C Hamano5cf43ca2008-08-20 09:14:141223 Instead of the first handful of characters, show the full
1224 pre- and post-image blob object names on the "index"
1225 line when generating patch format output.
Junio C Hamano1a4e8412005-12-27 08:17:231226</p>
1227</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591228<dt class="hdlist1">
Junio C Hamano9ae1a062006-07-10 08:12:341229--binary
1230</dt>
1231<dd>
1232<p>
Junio C Hamano61525f92014-01-17 22:46:491233 In addition to <tt>--full-index</tt>, output a binary diff that
1234 can be applied with <tt>git-apply</tt>.
Junio C Hamano9ae1a062006-07-10 08:12:341235</p>
1236</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591237<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231238--abbrev[=&lt;n&gt;]
1239</dt>
1240<dd>
1241<p>
1242 Instead of showing the full 40-byte hexadecimal object
1243 name in diff-raw format output and diff-tree header
Junio C Hamano6efe3022009-01-13 16:47:561244 lines, show only a partial prefix. This is
Junio C Hamano61525f92014-01-17 22:46:491245 independent of the <tt>--full-index</tt> option above, which controls
Junio C Hamano1a4e8412005-12-27 08:17:231246 the diff-patch output format. Non default number of
Junio C Hamano61525f92014-01-17 22:46:491247 digits can be specified with <tt>--abbrev=&lt;n&gt;</tt>.
Junio C Hamano1a4e8412005-12-27 08:17:231248</p>
1249</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591250<dt class="hdlist1">
Junio C Hamanoe85e36f2010-08-10 05:30:141251-B[&lt;n&gt;][/&lt;m&gt;]
Junio C Hamano1a4e8412005-12-27 08:17:231252</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591253<dt class="hdlist1">
Junio C Hamano39c7a692010-10-27 06:08:541254--break-rewrites[=[&lt;n&gt;][/&lt;m&gt;]]
1255</dt>
Junio C Hamano1a4e8412005-12-27 08:17:231256<dd>
1257<p>
Junio C Hamanoe85e36f2010-08-10 05:30:141258 Break complete rewrite changes into pairs of delete and
1259 create. This serves two purposes:
Junio C Hamano1a4e8412005-12-27 08:17:231260</p>
Junio C Hamano68cf15a2010-11-06 01:01:591261<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:141262not as a series of deletion and insertion mixed together with a very
1263few lines that happen to match textually as the context, but as a
1264single deletion of everything old followed by a single insertion of
Junio C Hamano61525f92014-01-17 22:46:491265everything new, and the number <tt>m</tt> controls this aspect of the -B
1266option (defaults to 60%). <tt>-B/70%</tt> specifies that less than 30% of the
Junio C Hamano076ffcc2013-02-06 05:13:211267original should remain in the result for Git to consider it a total
Junio C Hamanoe85e36f2010-08-10 05:30:141268rewrite (i.e. otherwise the resulting patch will be a series of
1269deletion and insertion mixed together with context lines).</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591270<div class="paragraph"><p>When used with -M, a totally-rewritten file is also considered as the
Junio C Hamanoe85e36f2010-08-10 05:30:141271source of a rename (usually -M only considers a file that disappeared
Junio C Hamano61525f92014-01-17 22:46:491272as the source of a rename), and the number <tt>n</tt> controls this aspect of
1273the -B option (defaults to 50%). <tt>-B20%</tt> specifies that a change with
Junio C Hamano68cf15a2010-11-06 01:01:591274addition and deletion compared to 20% or more of the file&#8217;s size are
Junio C Hamanoe85e36f2010-08-10 05:30:141275eligible for being picked up as a possible source of a rename to
1276another file.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231277</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591278<dt class="hdlist1">
Junio C Hamanoe85e36f2010-08-10 05:30:141279-M[&lt;n&gt;]
Junio C Hamano1a4e8412005-12-27 08:17:231280</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591281<dt class="hdlist1">
Junio C Hamano0d75e872010-12-17 06:57:261282--find-renames[=&lt;n&gt;]
Junio C Hamano39c7a692010-10-27 06:08:541283</dt>
Junio C Hamano1a4e8412005-12-27 08:17:231284<dd>
1285<p>
1286 Detect renames.
Junio C Hamano61525f92014-01-17 22:46:491287 If <tt>n</tt> is specified, it is a threshold on the similarity
Junio C Hamanoe85e36f2010-08-10 05:30:141288 index (i.e. amount of addition/deletions compared to the
Junio C Hamano61525f92014-01-17 22:46:491289 file&#8217;s size). For example, <tt>-M90%</tt> means Git should consider a
Junio C Hamanoe85e36f2010-08-10 05:30:141290 delete/add pair to be a rename if more than 90% of the file
Junio C Hamano61525f92014-01-17 22:46:491291 hasn&#8217;t changed. Without a <tt>%</tt> sign, the number is to be read as
1292 a fraction, with a decimal point before it. I.e., <tt>-M5</tt> becomes
1293 0.5, and is thus the same as <tt>-M50%</tt>. Similarly, <tt>-M05</tt> is
1294 the same as <tt>-M5%</tt>. To limit detection to exact renames, use
1295 <tt>-M100%</tt>. The default similarity index is 50%.
Junio C Hamano1a4e8412005-12-27 08:17:231296</p>
1297</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591298<dt class="hdlist1">
Junio C Hamanoe85e36f2010-08-10 05:30:141299-C[&lt;n&gt;]
Junio C Hamano1a4e8412005-12-27 08:17:231300</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591301<dt class="hdlist1">
Junio C Hamano0d75e872010-12-17 06:57:261302--find-copies[=&lt;n&gt;]
Junio C Hamano39c7a692010-10-27 06:08:541303</dt>
Junio C Hamano1a4e8412005-12-27 08:17:231304<dd>
1305<p>
Junio C Hamano61525f92014-01-17 22:46:491306 Detect copies as well as renames. See also <tt>--find-copies-harder</tt>.
1307 If <tt>n</tt> is specified, it has the same meaning as for <tt>-M&lt;n&gt;</tt>.
Junio C Hamano1a4e8412005-12-27 08:17:231308</p>
1309</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591310<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231311--find-copies-harder
1312</dt>
1313<dd>
1314<p>
Junio C Hamano61525f92014-01-17 22:46:491315 For performance reasons, by default, <tt>-C</tt> option finds copies only
Junio C Hamano1a4e8412005-12-27 08:17:231316 if the original file of the copy was modified in the same
1317 changeset. This flag makes the command
1318 inspect unmodified files as candidates for the source of
1319 copy. This is a very expensive operation for large
Junio C Hamano16f98872007-06-12 16:09:141320 projects, so use it with caution. Giving more than one
Junio C Hamano61525f92014-01-17 22:46:491321 <tt>-C</tt> option has the same effect.
Junio C Hamano1a4e8412005-12-27 08:17:231322</p>
1323</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591324<dt class="hdlist1">
Junio C Hamanob02377c2011-04-28 22:26:021325-D
1326</dt>
1327<dt class="hdlist1">
1328--irreversible-delete
1329</dt>
1330<dd>
1331<p>
1332 Omit the preimage for deletes, i.e. print only the header but not
Junio C Hamano61525f92014-01-17 22:46:491333 the diff between the preimage and <tt>/dev/null</tt>. The resulting patch
Junio C Hamanod75148a2014-04-08 19:48:381334 is not meant to be applied with <tt>patch</tt> or <tt>git apply</tt>; this is
Junio C Hamanob02377c2011-04-28 22:26:021335 solely for people who want to just concentrate on reviewing the
1336 text after the change. In addition, the output obviously lack
1337 enough information to apply such a patch in reverse, even manually,
1338 hence the name of the option.
1339</p>
Junio C Hamano61525f92014-01-17 22:46:491340<div class="paragraph"><p>When used together with <tt>-B</tt>, omit also the preimage in the deletion part
Junio C Hamanob02377c2011-04-28 22:26:021341of a delete/create pair.</p></div>
1342</dd>
1343<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231344-l&lt;num&gt;
1345</dt>
1346<dd>
1347<p>
Junio C Hamano61525f92014-01-17 22:46:491348 The <tt>-M</tt> and <tt>-C</tt> options require O(n^2) processing time where n
Junio C Hamano1a4e8412005-12-27 08:17:231349 is the number of potential rename/copy targets. This
1350 option prevents rename/copy detection from running if
1351 the number of rename/copy targets exceeds the specified
1352 number.
1353</p>
1354</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591355<dt class="hdlist1">
Junio C Hamano982eb112010-11-18 00:53:091356--diff-filter=[(A|C|D|M|R|T|U|X|B)&#8230;[*]]
1357</dt>
1358<dd>
1359<p>
Junio C Hamano61525f92014-01-17 22:46:491360 Select only files that are Added (<tt>A</tt>), Copied (<tt>C</tt>),
1361 Deleted (<tt>D</tt>), Modified (<tt>M</tt>), Renamed (<tt>R</tt>), have their
1362 type (i.e. regular file, symlink, submodule, &#8230;) changed (<tt>T</tt>),
1363 are Unmerged (<tt>U</tt>), are
1364 Unknown (<tt>X</tt>), or have had their pairing Broken (<tt>B</tt>).
Junio C Hamano982eb112010-11-18 00:53:091365 Any combination of the filter characters (including none) can be used.
Junio C Hamano61525f92014-01-17 22:46:491366 When <tt>*</tt> (All-or-none) is added to the combination, all
Junio C Hamano982eb112010-11-18 00:53:091367 paths are selected if there is any file that matches
1368 other criteria in the comparison; if there is no file
1369 that matches other criteria, nothing is selected.
1370</p>
1371</dd>
1372<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231373-S&lt;string&gt;
1374</dt>
1375<dd>
1376<p>
Junio C Hamanof1f5a7b2013-06-11 22:23:521377 Look for differences that change the number of occurrences of
1378 the specified string (i.e. addition/deletion) in a file.
1379 Intended for the scripter&#8217;s use.
Junio C Hamano1a4e8412005-12-27 08:17:231380</p>
Junio C Hamanof1f5a7b2013-06-11 22:23:521381<div class="paragraph"><p>It is useful when you&#8217;re looking for an exact block of code (like a
1382struct), and want to know the history of that block since it first
1383came into being: use the feature iteratively to feed the interesting
Junio C Hamano61525f92014-01-17 22:46:491384block in the preimage back into <tt>-S</tt>, and keep going until you get the
Junio C Hamanof1f5a7b2013-06-11 22:23:521385very first version of the block.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231386</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591387<dt class="hdlist1">
Junio C Hamano3b4609d2010-09-30 00:04:341388-G&lt;regex&gt;
1389</dt>
1390<dd>
1391<p>
Junio C Hamanof1f5a7b2013-06-11 22:23:521392 Look for differences whose patch text contains added/removed
1393 lines that match &lt;regex&gt;.
Junio C Hamano3b4609d2010-09-30 00:04:341394</p>
Junio C Hamano61525f92014-01-17 22:46:491395<div class="paragraph"><p>To illustrate the difference between <tt>-S&lt;regex&gt; --pickaxe-regex</tt> and
1396<tt>-G&lt;regex&gt;</tt>, consider a commit with the following diff in the same
Junio C Hamanof1f5a7b2013-06-11 22:23:521397file:</p></div>
1398<div class="listingblock">
1399<div class="content">
Junio C Hamano61525f92014-01-17 22:46:491400<pre><tt>+ return !regexec(regexp, two-&gt;ptr, 1, &amp;regmatch, 0);
Junio C Hamanof1f5a7b2013-06-11 22:23:521401...
Junio C Hamano61525f92014-01-17 22:46:491402- hit = !regexec(regexp, mf2.ptr, 1, &amp;regmatch, 0);</tt></pre>
Junio C Hamanof1f5a7b2013-06-11 22:23:521403</div></div>
Junio C Hamano61525f92014-01-17 22:46:491404<div class="paragraph"><p>While <tt>git log -G"regexec\(regexp"</tt> will show this commit, <tt>git log
1405-S"regexec\(regexp" --pickaxe-regex</tt> will not (because the number of
Junio C Hamanof1f5a7b2013-06-11 22:23:521406occurrences of that string did not change).</p></div>
1407<div class="paragraph"><p>See the <em>pickaxe</em> entry in <a href="gitdiffcore.html">gitdiffcore(7)</a> for more
1408information.</p></div>
Junio C Hamano3b4609d2010-09-30 00:04:341409</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591410<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231411--pickaxe-all
1412</dt>
1413<dd>
1414<p>
Junio C Hamano61525f92014-01-17 22:46:491415 When <tt>-S</tt> or <tt>-G</tt> finds a change, show all the changes in that
Junio C Hamano1a4e8412005-12-27 08:17:231416 changeset, not just the files that contain the change
1417 in &lt;string&gt;.
1418</p>
1419</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591420<dt class="hdlist1">
Junio C Hamanobfe9e752006-04-05 21:43:281421--pickaxe-regex
1422</dt>
1423<dd>
1424<p>
Junio C Hamano61525f92014-01-17 22:46:491425 Treat the &lt;string&gt; given to <tt>-S</tt> as an extended POSIX regular
Junio C Hamanof1f5a7b2013-06-11 22:23:521426 expression to match.
Junio C Hamanobfe9e752006-04-05 21:43:281427</p>
1428</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591429<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231430-O&lt;orderfile&gt;
1431</dt>
1432<dd>
1433<p>
1434 Output the patch in the order specified in the
1435 &lt;orderfile&gt;, which has one shell glob pattern per line.
Junio C Hamano61525f92014-01-17 22:46:491436 This overrides the <tt>diff.orderfile</tt> configuration variable
1437 (see <a href="git-config.html">git-config(1)</a>). To cancel <tt>diff.orderfile</tt>,
1438 use <tt>-O/dev/null</tt>.
Junio C Hamano1a4e8412005-12-27 08:17:231439</p>
1440</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591441<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231442-R
1443</dt>
1444<dd>
1445<p>
1446 Swap two inputs; that is, show differences from index or
1447 on-disk file to tree contents.
1448</p>
1449</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591450<dt class="hdlist1">
Junio C Hamano24bc09a2008-02-28 00:27:441451--relative[=&lt;path&gt;]
1452</dt>
1453<dd>
1454<p>
1455 When run from a subdirectory of the project, it can be
1456 told to exclude changes outside the directory and show
1457 pathnames relative to it with this option. When you are
1458 not in a subdirectory (e.g. in a bare repository), you
1459 can name which subdirectory to make the output relative
1460 to by giving a &lt;path&gt; as an argument.
1461</p>
1462</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591463<dt class="hdlist1">
Junio C Hamanobbbb8652008-12-29 10:34:221464-a
1465</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591466<dt class="hdlist1">
Junio C Hamanoc26f5482006-07-09 09:38:141467--text
1468</dt>
1469<dd>
1470<p>
1471 Treat all files as text.
1472</p>
1473</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591474<dt class="hdlist1">
Junio C Hamanofd468962007-02-14 23:45:041475--ignore-space-at-eol
1476</dt>
1477<dd>
1478<p>
Junio C Hamano3a702342007-12-12 21:34:021479 Ignore changes in whitespace at EOL.
Junio C Hamanofd468962007-02-14 23:45:041480</p>
1481</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591482<dt class="hdlist1">
Junio C Hamanobbbb8652008-12-29 10:34:221483-b
1484</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591485<dt class="hdlist1">
Junio C Hamanod9c2d2f2006-12-06 08:59:071486--ignore-space-change
1487</dt>
1488<dd>
1489<p>
Junio C Hamano3a702342007-12-12 21:34:021490 Ignore changes in amount of whitespace. This ignores whitespace
1491 at line end, and considers all other sequences of one or
1492 more whitespace characters to be equivalent.
Junio C Hamanod9c2d2f2006-12-06 08:59:071493</p>
1494</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591495<dt class="hdlist1">
Junio C Hamanobbbb8652008-12-29 10:34:221496-w
Junio C Hamanod9c2d2f2006-12-06 08:59:071497</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591498<dt class="hdlist1">
Junio C Hamanod9c2d2f2006-12-06 08:59:071499--ignore-all-space
1500</dt>
1501<dd>
1502<p>
Junio C Hamano3a702342007-12-12 21:34:021503 Ignore whitespace when comparing lines. This ignores
1504 differences even if one line has whitespace where the other
Junio C Hamanod9c2d2f2006-12-06 08:59:071505 line has none.
1506</p>
1507</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591508<dt class="hdlist1">
Junio C Hamanoa1952302013-07-01 21:31:181509--ignore-blank-lines
1510</dt>
1511<dd>
1512<p>
1513 Ignore changes whose lines are all blank.
1514</p>
1515</dd>
1516<dt class="hdlist1">
Junio C Hamano1d40ee82009-01-07 10:14:161517--inter-hunk-context=&lt;lines&gt;
1518</dt>
1519<dd>
1520<p>
1521 Show the context between diff hunks, up to the specified number
1522 of lines, thereby fusing hunks that are close to each other.
1523</p>
1524</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591525<dt class="hdlist1">
Junio C Hamano11821ed2011-10-19 18:42:091526-W
1527</dt>
1528<dt class="hdlist1">
1529--function-context
1530</dt>
1531<dd>
1532<p>
1533 Show whole surrounding functions of changes.
1534</p>
1535</dd>
1536<dt class="hdlist1">
Junio C Hamano48fd2f62007-03-19 02:02:301537--exit-code
1538</dt>
1539<dd>
1540<p>
1541 Make the program exit with codes similar to diff(1).
1542 That is, it exits with 1 if there were differences and
1543 0 means no differences.
1544</p>
1545</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591546<dt class="hdlist1">
Junio C Hamano35e57552007-03-25 07:54:351547--quiet
1548</dt>
1549<dd>
1550<p>
Junio C Hamano61525f92014-01-17 22:46:491551 Disable all output of the program. Implies <tt>--exit-code</tt>.
Junio C Hamano35e57552007-03-25 07:54:351552</p>
1553</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591554<dt class="hdlist1">
Junio C Hamanobb0f4042007-07-04 06:41:401555--ext-diff
1556</dt>
1557<dd>
1558<p>
1559 Allow an external diff helper to be executed. If you set an
Junio C Hamanoa28a9202012-06-21 07:08:231560 external diff driver with <a href="gitattributes.html">gitattributes(5)</a>, you need
1561 to use this option with <a href="git-log.html">git-log(1)</a> and friends.
Junio C Hamanobb0f4042007-07-04 06:41:401562</p>
1563</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591564<dt class="hdlist1">
Junio C Hamanobb0f4042007-07-04 06:41:401565--no-ext-diff
1566</dt>
1567<dd>
1568<p>
1569 Disallow external diff drivers.
1570</p>
1571</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591572<dt class="hdlist1">
Junio C Hamanoc652aed2011-07-07 01:14:311573--textconv
1574</dt>
1575<dt class="hdlist1">
1576--no-textconv
1577</dt>
1578<dd>
1579<p>
1580 Allow (or disallow) external text conversion filters to be run
Junio C Hamanoa28a9202012-06-21 07:08:231581 when comparing binary files. See <a href="gitattributes.html">gitattributes(5)</a> for
Junio C Hamanoc652aed2011-07-07 01:14:311582 details. Because textconv filters are typically a one-way
1583 conversion, the resulting diff is suitable for human
1584 consumption, but cannot be applied. For this reason, textconv
Junio C Hamanoa28a9202012-06-21 07:08:231585 filters are enabled by default only for <a href="git-diff.html">git-diff(1)</a> and
1586 <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:311587 diff plumbing commands.
1588</p>
1589</dd>
1590<dt class="hdlist1">
Junio C Hamano7d449522010-07-01 00:08:511591--ignore-submodules[=&lt;when&gt;]
Junio C Hamanodfccbb02008-05-26 01:16:141592</dt>
1593<dd>
1594<p>
Junio C Hamano7d449522010-07-01 00:08:511595 Ignore changes to submodules in the diff generation. &lt;when&gt; can be
Junio C Hamanoc7102962013-05-29 23:57:171596 either "none", "untracked", "dirty" or "all", which is the default.
Junio C Hamano619596a2010-08-18 22:15:351597 Using "none" will consider the submodule modified when it either contains
1598 untracked or modified files or its HEAD differs from the commit recorded
1599 in the superproject and can be used to override any settings of the
Junio C Hamanoa28a9202012-06-21 07:08:231600 <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:511601 "untracked" is used submodules are not considered dirty when they only
1602 contain untracked content (but they are still scanned for modified
1603 content). Using "dirty" ignores all changes to the work tree of submodules,
1604 only changes to the commits stored in the superproject are shown (this was
1605 the behavior until 1.7.0). Using "all" hides all changes to submodules.
Junio C Hamanodfccbb02008-05-26 01:16:141606</p>
1607</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591608<dt class="hdlist1">
Junio C Hamanoe27cbd22007-12-21 17:57:331609--src-prefix=&lt;prefix&gt;
1610</dt>
1611<dd>
1612<p>
1613 Show the given source prefix instead of "a/".
1614</p>
1615</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591616<dt class="hdlist1">
Junio C Hamanoe27cbd22007-12-21 17:57:331617--dst-prefix=&lt;prefix&gt;
1618</dt>
1619<dd>
1620<p>
1621 Show the given destination prefix instead of "b/".
1622</p>
1623</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591624<dt class="hdlist1">
Junio C Hamanoe27cbd22007-12-21 17:57:331625--no-prefix
1626</dt>
1627<dd>
1628<p>
1629 Do not show any source or destination prefix.
1630</p>
1631</dd>
Junio C Hamanoba4b9282008-07-06 05:20:311632</dl></div>
Junio C Hamano68cf15a2010-11-06 01:01:591633<div class="paragraph"><p>For more detailed explanation on these common options, see also
Junio C Hamanoa28a9202012-06-21 07:08:231634<a href="gitdiffcore.html">gitdiffcore(7)</a>.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591635<div class="dlist"><dl>
1636<dt class="hdlist1">
Junio C Hamanobd53dbf2009-01-18 18:26:371637-1 --base
1638</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591639<dt class="hdlist1">
Junio C Hamanobd53dbf2009-01-18 18:26:371640-2 --ours
1641</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591642<dt class="hdlist1">
Junio C Hamanobd53dbf2009-01-18 18:26:371643-3 --theirs
1644</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591645<dt class="hdlist1">
Junio C Hamanobd53dbf2009-01-18 18:26:371646-0
Junio C Hamano1a4e8412005-12-27 08:17:231647</dt>
1648<dd>
1649<p>
1650 Diff against the "base" version, "our branch" or "their
1651 branch" respectively. With these options, diffs for
1652 merged entries are not shown.
1653</p>
Junio C Hamano68cf15a2010-11-06 01:01:591654<div class="paragraph"><p>The default is to diff against our branch (-2) and the
Junio C Hamano1a4e8412005-12-27 08:17:231655cleanly resolved paths. The option -0 can be given to
Junio C Hamanoba4b9282008-07-06 05:20:311656omit diff output for unmerged entries and just show "Unmerged".</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231657</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591658<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471659-c
1660</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591661<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471662--cc
Junio C Hamanofb56a962006-01-28 10:38:191663</dt>
1664<dd>
1665<p>
1666 This compares stage 2 (our branch), stage 3 (their
1667 branch) and the working tree file and outputs a combined
1668 diff, similar to the way <em>diff-tree</em> shows a merge
1669 commit with these flags.
1670</p>
1671</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591672<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231673-q
1674</dt>
1675<dd>
1676<p>
Junio C Hamano51c2ab02006-07-09 20:38:541677 Remain silent even on nonexistent files
Junio C Hamano1a4e8412005-12-27 08:17:231678</p>
1679</dd>
Junio C Hamanoba4b9282008-07-06 05:20:311680</dl></div>
Junio C Hamano1a4e8412005-12-27 08:17:231681</div>
Junio C Hamano9629d4f2012-12-19 00:28:271682</div>
1683<div class="sect1">
Junio C Hamano543f8d62009-07-29 08:35:211684<h2 id="_raw_output_format">Raw output format</h2>
Junio C Hamano1a4e8412005-12-27 08:17:231685<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:591686<div class="paragraph"><p>The raw output format from "git-diff-index", "git-diff-tree",
Junio C Hamanoba4b9282008-07-06 05:20:311687"git-diff-files" and "git diff --raw" are very similar.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591688<div class="paragraph"><p>These commands all compare two sets of things; what is
Junio C Hamanoba4b9282008-07-06 05:20:311689compared differs:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591690<div class="dlist"><dl>
1691<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231692git-diff-index &lt;tree-ish&gt;
1693</dt>
1694<dd>
1695<p>
1696 compares the &lt;tree-ish&gt; and the files on the filesystem.
1697</p>
1698</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591699<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231700git-diff-index --cached &lt;tree-ish&gt;
1701</dt>
1702<dd>
1703<p>
1704 compares the &lt;tree-ish&gt; and the index.
1705</p>
1706</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591707<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231708git-diff-tree [-r] &lt;tree-ish-1&gt; &lt;tree-ish-2&gt; [&lt;pattern&gt;&#8230;]
1709</dt>
1710<dd>
1711<p>
1712 compares the trees named by the two arguments.
1713</p>
1714</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591715<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231716git-diff-files [&lt;pattern&gt;&#8230;]
1717</dt>
1718<dd>
1719<p>
1720 compares the index and the files on the filesystem.
1721</p>
1722</dd>
Junio C Hamanoba4b9282008-07-06 05:20:311723</dl></div>
Junio C Hamano68cf15a2010-11-06 01:01:591724<div class="paragraph"><p>The "git-diff-tree" command begins its output by printing the hash of
Junio C Hamano543f8d62009-07-29 08:35:211725what is being compared. After that, all the commands print one output
1726line per changed file.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591727<div class="paragraph"><p>An output line is formatted this way:</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231728<div class="listingblock">
1729<div class="content">
Junio C Hamano61525f92014-01-17 22:46:491730<pre><tt>in-place edit :100644 100644 bcd1234... 0123456... M file0
Junio C Hamano1a4e8412005-12-27 08:17:231731copy-edit :100644 100644 abcd123... 1234567... C68 file1 file2
1732rename-edit :100644 100644 abcd123... 1234567... R86 file1 file3
1733create :000000 100644 0000000... 1234567... A file4
1734delete :100644 000000 1234567... 0000000... D file5
Junio C Hamano61525f92014-01-17 22:46:491735unmerged :000000 000000 0000000... 0000000... U file6</tt></pre>
Junio C Hamano1a4e8412005-12-27 08:17:231736</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591737<div class="paragraph"><p>That is, from the left to the right:</p></div>
1738<div class="olist arabic"><ol class="arabic">
Junio C Hamano1a4e8412005-12-27 08:17:231739<li>
1740<p>
1741a colon.
1742</p>
1743</li>
1744<li>
1745<p>
1746mode for "src"; 000000 if creation or unmerged.
1747</p>
1748</li>
1749<li>
1750<p>
1751a space.
1752</p>
1753</li>
1754<li>
1755<p>
1756mode for "dst"; 000000 if deletion or unmerged.
1757</p>
1758</li>
1759<li>
1760<p>
1761a space.
1762</p>
1763</li>
1764<li>
1765<p>
1766sha1 for "src"; 0{40} if creation or unmerged.
1767</p>
1768</li>
1769<li>
1770<p>
1771a space.
1772</p>
1773</li>
1774<li>
1775<p>
1776sha1 for "dst"; 0{40} if creation, unmerged or "look at work tree".
1777</p>
1778</li>
1779<li>
1780<p>
1781a space.
1782</p>
1783</li>
1784<li>
1785<p>
1786status, followed by optional "score" number.
1787</p>
1788</li>
1789<li>
1790<p>
1791a tab or a NUL when <em>-z</em> option is used.
1792</p>
1793</li>
1794<li>
1795<p>
1796path for "src"
1797</p>
1798</li>
1799<li>
1800<p>
1801a tab or a NUL when <em>-z</em> option is used; only exists for C or R.
1802</p>
1803</li>
1804<li>
1805<p>
1806path for "dst"; only exists for C or R.
1807</p>
1808</li>
1809<li>
1810<p>
1811an LF or a NUL when <em>-z</em> option is used, to terminate the record.
1812</p>
1813</li>
Junio C Hamanoba4b9282008-07-06 05:20:311814</ol></div>
Junio C Hamano68cf15a2010-11-06 01:01:591815<div class="paragraph"><p>Possible status letters are:</p></div>
1816<div class="ulist"><ul>
Junio C Hamanoaa17c7c2008-11-03 04:36:581817<li>
1818<p>
1819A: addition of a file
1820</p>
1821</li>
1822<li>
1823<p>
1824C: copy of a file into a new one
1825</p>
1826</li>
1827<li>
1828<p>
1829D: deletion of a file
1830</p>
1831</li>
1832<li>
1833<p>
1834M: modification of the contents or mode of a file
1835</p>
1836</li>
1837<li>
1838<p>
1839R: renaming of a file
1840</p>
1841</li>
1842<li>
1843<p>
1844T: change in the type of the file
1845</p>
1846</li>
1847<li>
1848<p>
1849U: file is unmerged (you must complete the merge before it can
1850be committed)
1851</p>
1852</li>
1853<li>
1854<p>
1855X: "unknown" change type (most probably a bug, please report it)
1856</p>
1857</li>
1858</ul></div>
Junio C Hamano68cf15a2010-11-06 01:01:591859<div class="paragraph"><p>Status letters C and R are always followed by a score (denoting the
Junio C Hamanoaa17c7c2008-11-03 04:36:581860percentage of similarity between the source and target of the move or
1861copy), and are the only ones to be so.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591862<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:311863and it is out of sync with the index.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591864<div class="paragraph"><p>Example:</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231865<div class="listingblock">
1866<div class="content">
Junio C Hamano61525f92014-01-17 22:46:491867<pre><tt>:100644 100644 5be4a4...... 000000...... M file.c</tt></pre>
Junio C Hamano1a4e8412005-12-27 08:17:231868</div></div>
Junio C Hamano61525f92014-01-17 22:46:491869<div class="paragraph"><p>When <tt>-z</tt> option is not used, TAB, LF, and backslash characters
1870in pathnames are represented as <tt>\t</tt>, <tt>\n</tt>, and <tt>\\</tt>,
Junio C Hamanoba4b9282008-07-06 05:20:311871respectively.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231872</div>
Junio C Hamano9629d4f2012-12-19 00:28:271873</div>
1874<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:311875<h2 id="_diff_format_for_merges">diff format for merges</h2>
Junio C Hamano67fad6d2007-05-06 08:53:121876<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:591877<div class="paragraph"><p>"git-diff-tree", "git-diff-files" and "git-diff --raw"
Junio C Hamano7ae0ab22007-11-03 02:46:461878can take <em>-c</em> or <em>--cc</em> option
Junio C Hamano67fad6d2007-05-06 08:53:121879to generate diff output also for merge commits. The output differs
Junio C Hamanoba4b9282008-07-06 05:20:311880from the format described above in the following way:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591881<div class="olist arabic"><ol class="arabic">
Junio C Hamano67fad6d2007-05-06 08:53:121882<li>
1883<p>
1884there is a colon for each parent
1885</p>
1886</li>
1887<li>
1888<p>
1889there are more "src" modes and "src" sha1
1890</p>
1891</li>
1892<li>
1893<p>
1894status is concatenated status characters for each parent
1895</p>
1896</li>
1897<li>
1898<p>
1899no optional "score" number
1900</p>
1901</li>
1902<li>
1903<p>
1904single path, only for "dst"
1905</p>
1906</li>
Junio C Hamanoba4b9282008-07-06 05:20:311907</ol></div>
Junio C Hamano68cf15a2010-11-06 01:01:591908<div class="paragraph"><p>Example:</p></div>
Junio C Hamano67fad6d2007-05-06 08:53:121909<div class="listingblock">
1910<div class="content">
Junio C Hamano61525f92014-01-17 22:46:491911<pre><tt>::100644 100644 100644 fabadb8... cc95eb0... 4866510... MM describe.c</tt></pre>
Junio C Hamano67fad6d2007-05-06 08:53:121912</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591913<div class="paragraph"><p>Note that <em>combined diff</em> lists only files which were modified from
Junio C Hamanoba4b9282008-07-06 05:20:311914all parents.</p></div>
Junio C Hamano67fad6d2007-05-06 08:53:121915</div>
Junio C Hamano9629d4f2012-12-19 00:28:271916</div>
1917<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:311918<h2 id="_generating_patches_with_p">Generating patches with -p</h2>
Junio C Hamano1a4e8412005-12-27 08:17:231919<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:591920<div class="paragraph"><p>When "git-diff-index", "git-diff-tree", or "git-diff-files" are run
Junio C Hamano00b8b632007-12-07 09:50:491921with a <em>-p</em> option, "git diff" without the <em>--raw</em> option, or
1922"git log" with the "-p" option, they
Junio C Hamano7ae0ab22007-11-03 02:46:461923do not produce the output described above; instead they produce a
1924patch file. You can customize the creation of such patches via the
Junio C Hamanoba4b9282008-07-06 05:20:311925GIT_EXTERNAL_DIFF and the GIT_DIFF_OPTS environment variables.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591926<div class="paragraph"><p>What the -p option produces is slightly different from the traditional
Junio C Hamano7f9fa862010-10-19 23:51:141927diff format:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591928<div class="olist arabic"><ol class="arabic">
Junio C Hamano1a4e8412005-12-27 08:17:231929<li>
1930<p>
Junio C Hamano7f9fa862010-10-19 23:51:141931It is preceded with a "git diff" header that looks like this:
Junio C Hamano1a4e8412005-12-27 08:17:231932</p>
1933<div class="literalblock">
1934<div class="content">
Junio C Hamano61525f92014-01-17 22:46:491935<pre><tt>diff --git a/file1 b/file2</tt></pre>
Junio C Hamano1a4e8412005-12-27 08:17:231936</div></div>
Junio C Hamano61525f92014-01-17 22:46:491937<div class="paragraph"><p>The <tt>a/</tt> and <tt>b/</tt> filenames are the same unless rename/copy is
Junio C Hamano1a4e8412005-12-27 08:17:231938involved. Especially, even for a creation or a deletion,
Junio C Hamano61525f92014-01-17 22:46:491939<tt>/dev/null</tt> is <em>not</em> used in place of the <tt>a/</tt> or <tt>b/</tt> filenames.</p></div>
1940<div class="paragraph"><p>When rename/copy is involved, <tt>file1</tt> and <tt>file2</tt> show the
Junio C Hamano1a4e8412005-12-27 08:17:231941name of the source file of the rename/copy and the name of
Junio C Hamanoba4b9282008-07-06 05:20:311942the file that rename/copy produces, respectively.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231943</li>
1944<li>
1945<p>
1946It is followed by one or more extended header lines:
1947</p>
1948<div class="literalblock">
1949<div class="content">
Junio C Hamano61525f92014-01-17 22:46:491950<pre><tt>old mode &lt;mode&gt;
Junio C Hamano1a4e8412005-12-27 08:17:231951new mode &lt;mode&gt;
1952deleted file mode &lt;mode&gt;
1953new file mode &lt;mode&gt;
1954copy from &lt;path&gt;
1955copy to &lt;path&gt;
1956rename from &lt;path&gt;
1957rename to &lt;path&gt;
1958similarity index &lt;number&gt;
1959dissimilarity index &lt;number&gt;
Junio C Hamano61525f92014-01-17 22:46:491960index &lt;hash&gt;..&lt;hash&gt; &lt;mode&gt;</tt></pre>
Junio C Hamano1a4e8412005-12-27 08:17:231961</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591962<div class="paragraph"><p>File modes are printed as 6-digit octal numbers including the file type
Junio C Hamano7f9fa862010-10-19 23:51:141963and file permission bits.</p></div>
Junio C Hamano61525f92014-01-17 22:46:491964<div class="paragraph"><p>Path names in extended headers do not include the <tt>a/</tt> and <tt>b/</tt> prefixes.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591965<div class="paragraph"><p>The similarity index is the percentage of unchanged lines, and
Junio C Hamano7f9fa862010-10-19 23:51:141966the dissimilarity index is the percentage of changed lines. It
1967is a rounded down integer, followed by a percent sign. The
1968similarity index value of 100% is thus reserved for two equal
1969files, while 100% dissimilarity means that no line from the old
1970file made it into the new one.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591971<div class="paragraph"><p>The index line includes the SHA-1 checksum before and after the change.
Junio C Hamano7f9fa862010-10-19 23:51:141972The &lt;mode&gt; is included if the file mode does not change; otherwise,
1973separate lines indicate the old and the new mode.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231974</li>
1975<li>
1976<p>
Junio C Hamanoa053d542006-10-27 09:29:131977TAB, LF, double quote and backslash characters in pathnames
Junio C Hamano61525f92014-01-17 22:46:491978 are represented as <tt>\t</tt>, <tt>\n</tt>, <tt>\"</tt> and <tt>\\</tt>, respectively.
Junio C Hamanoa053d542006-10-27 09:29:131979 If there is need for such substitution then the whole
1980 pathname is put in double quotes.
Junio C Hamano1a4e8412005-12-27 08:17:231981</p>
1982</li>
Junio C Hamano7f9fa862010-10-19 23:51:141983<li>
1984<p>
Junio C Hamano61525f92014-01-17 22:46:491985All the <tt>file1</tt> files in the output refer to files before the
1986 commit, and all the <tt>file2</tt> files refer to files after the commit.
Junio C Hamano7f9fa862010-10-19 23:51:141987 It is incorrect to apply each change to each file sequentially. For
1988 example, this patch will swap a and b:
1989</p>
1990<div class="literalblock">
1991<div class="content">
Junio C Hamano61525f92014-01-17 22:46:491992<pre><tt>diff --git a/a b/b
Junio C Hamano7f9fa862010-10-19 23:51:141993rename from a
1994rename to b
1995diff --git a/b b/a
1996rename from b
Junio C Hamano61525f92014-01-17 22:46:491997rename to a</tt></pre>
Junio C Hamano7f9fa862010-10-19 23:51:141998</div></div>
1999</li>
Junio C Hamanoba4b9282008-07-06 05:20:312000</ol></div>
Junio C Hamano1a4e8412005-12-27 08:17:232001</div>
Junio C Hamano9629d4f2012-12-19 00:28:272002</div>
2003<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:312004<h2 id="_combined_diff_format">combined diff format</h2>
Junio C Hamanofb56a962006-01-28 10:38:192005<div class="sectionbody">
Junio C Hamano61525f92014-01-17 22:46:492006<div class="paragraph"><p>Any diff-generating command can take the &#8216;-c` or <tt>--cc</tt> option to
Junio C Hamanoc5be4cc2011-03-09 07:20:432007produce a <em>combined diff</em> when showing a merge. This is the default
Junio C Hamanoa28a9202012-06-21 07:08:232008format when showing merges with <a href="git-diff.html">git-diff(1)</a> or
2009<a href="git-show.html">git-show(1)</a>. Note also that you can give the `-m&#8217; option to any
Junio C Hamanoc5be4cc2011-03-09 07:20:432010of these commands to force generation of diffs with individual parents
2011of a merge.</p></div>
2012<div class="paragraph"><p>A <em>combined diff</em> format looks like this:</p></div>
Junio C Hamanofb56a962006-01-28 10:38:192013<div class="listingblock">
2014<div class="content">
Junio C Hamano61525f92014-01-17 22:46:492015<pre><tt>diff --combined describe.c
Junio C Hamano29f14312006-10-26 08:47:292016index fabadb8,cc95eb0..4866510
2017--- a/describe.c
2018+++ b/describe.c
2019@@@ -98,20 -98,12 +98,20 @@@
2020 return (a_date &gt; b_date) ? -1 : (a_date == b_date) ? 0 : 1;
Junio C Hamanofb56a962006-01-28 10:38:192021 }
2022
2023- static void describe(char *arg)
2024 -static void describe(struct commit *cmit, int last_one)
2025++static void describe(char *arg, int last_one)
2026 {
Junio C Hamano29f14312006-10-26 08:47:292027 + unsigned char sha1[20];
2028 + struct commit *cmit;
2029 struct commit_list *list;
2030 static int initialized = 0;
2031 struct commit_name *n;
2032
2033 + if (get_sha1(arg, sha1) &lt; 0)
2034 + usage(describe_usage);
2035 + cmit = lookup_commit_reference(sha1);
2036 + if (!cmit)
2037 + usage(describe_usage);
2038 +
2039 if (!initialized) {
2040 initialized = 1;
Junio C Hamano61525f92014-01-17 22:46:492041 for_each_ref(get_name);</tt></pre>
Junio C Hamanofb56a962006-01-28 10:38:192042</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592043<div class="olist arabic"><ol class="arabic">
Junio C Hamano29f14312006-10-26 08:47:292044<li>
2045<p>
2046It is preceded with a "git diff" header, that looks like
2047 this (when <em>-c</em> option is used):
2048</p>
2049<div class="literalblock">
2050<div class="content">
Junio C Hamano61525f92014-01-17 22:46:492051<pre><tt>diff --combined file</tt></pre>
Junio C Hamano29f14312006-10-26 08:47:292052</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592053<div class="paragraph"><p>or like this (when <em>--cc</em> option is used):</p></div>
Junio C Hamano29f14312006-10-26 08:47:292054<div class="literalblock">
2055<div class="content">
Junio C Hamano61525f92014-01-17 22:46:492056<pre><tt>diff --cc file</tt></pre>
Junio C Hamano29f14312006-10-26 08:47:292057</div></div>
2058</li>
2059<li>
2060<p>
2061It is followed by one or more extended header lines
2062 (this example shows a merge with two parents):
2063</p>
2064<div class="literalblock">
2065<div class="content">
Junio C Hamano61525f92014-01-17 22:46:492066<pre><tt>index &lt;hash&gt;,&lt;hash&gt;..&lt;hash&gt;
Junio C Hamano29f14312006-10-26 08:47:292067mode &lt;mode&gt;,&lt;mode&gt;..&lt;mode&gt;
2068new file mode &lt;mode&gt;
Junio C Hamano61525f92014-01-17 22:46:492069deleted file mode &lt;mode&gt;,&lt;mode&gt;</tt></pre>
Junio C Hamano29f14312006-10-26 08:47:292070</div></div>
Junio C Hamano61525f92014-01-17 22:46:492071<div class="paragraph"><p>The <tt>mode &lt;mode&gt;,&lt;mode&gt;..&lt;mode&gt;</tt> line appears only if at least one of
Junio C Hamanoee1e4282007-02-04 08:32:042072the &lt;mode&gt; is different from the rest. Extended headers with
Junio C Hamano29f14312006-10-26 08:47:292073information about detected contents movement (renames and
2074copying detection) are designed to work with diff of two
Junio C Hamanoba4b9282008-07-06 05:20:312075&lt;tree-ish&gt; and are not used by combined diff format.</p></div>
Junio C Hamano29f14312006-10-26 08:47:292076</li>
2077<li>
2078<p>
2079It is followed by two-line from-file/to-file header
2080</p>
2081<div class="literalblock">
2082<div class="content">
Junio C Hamano61525f92014-01-17 22:46:492083<pre><tt>--- a/file
2084+++ b/file</tt></pre>
Junio C Hamano29f14312006-10-26 08:47:292085</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592086<div class="paragraph"><p>Similar to two-line header for traditional <em>unified</em> diff
Junio C Hamano61525f92014-01-17 22:46:492087format, <tt>/dev/null</tt> is used to signal created or deleted
Junio C Hamanoba4b9282008-07-06 05:20:312088files.</p></div>
Junio C Hamano29f14312006-10-26 08:47:292089</li>
2090<li>
2091<p>
2092Chunk header format is modified to prevent people from
Junio C Hamano61525f92014-01-17 22:46:492093 accidentally feeding it to <tt>patch -p1</tt>. Combined diff format
Junio C Hamano29f14312006-10-26 08:47:292094 was created for review of merge commit changes, and was not
2095 meant for apply. The change is similar to the change in the
2096 extended <em>index</em> header:
2097</p>
2098<div class="literalblock">
2099<div class="content">
Junio C Hamano61525f92014-01-17 22:46:492100<pre><tt>@@@ &lt;from-file-range&gt; &lt;from-file-range&gt; &lt;to-file-range&gt; @@@</tt></pre>
Junio C Hamano29f14312006-10-26 08:47:292101</div></div>
Junio C Hamano61525f92014-01-17 22:46:492102<div class="paragraph"><p>There are (number of parents + 1) <tt>@</tt> characters in the chunk
Junio C Hamanoba4b9282008-07-06 05:20:312103header for combined diff format.</p></div>
Junio C Hamano29f14312006-10-26 08:47:292104</li>
Junio C Hamanoba4b9282008-07-06 05:20:312105</ol></div>
Junio C Hamano68cf15a2010-11-06 01:01:592106<div class="paragraph"><p>Unlike the traditional <em>unified</em> diff format, which shows two
Junio C Hamano61525f92014-01-17 22:46:492107files A and B with a single column that has <tt>-</tt> (minus&#8201;&#8212;&#8201;appears in A but removed in B), <tt>+</tt> (plus&#8201;&#8212;&#8201;missing in A but
2108added to B), or <tt>" "</tt> (space&#8201;&#8212;&#8201;unchanged) prefix, this format
Junio C Hamanofb56a962006-01-28 10:38:192109compares two or more files file1, file2,&#8230; with one file X, and
2110shows how X differs from each of fileN. One column for each of
Junio C Hamano68cf15a2010-11-06 01:01:592111fileN is prepended to the output line to note how X&#8217;s line is
Junio C Hamanoba4b9282008-07-06 05:20:312112different from it.</p></div>
Junio C Hamano61525f92014-01-17 22:46:492113<div class="paragraph"><p>A <tt>-</tt> character in the column N means that the line appears in
2114fileN but it does not appear in the result. A <tt>+</tt> character
Junio C Hamano54bf1e22008-12-20 06:30:112115in the column N means that the line appears in the result,
Junio C Hamano29f14312006-10-26 08:47:292116and fileN does not have that line (in other words, the line was
Junio C Hamanoba4b9282008-07-06 05:20:312117added, from the point of view of that parent).</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592118<div class="paragraph"><p>In the above example output, the function signature was changed
Junio C Hamano61525f92014-01-17 22:46:492119from both files (hence two <tt>-</tt> removals from both file1 and
2120file2, plus <tt>++</tt> to mean one line that was added does not appear
Junio C Hamanod75148a2014-04-08 19:48:382121in either file1 or file2). Also eight other lines are the same
Junio C Hamano61525f92014-01-17 22:46:492122from file1 but do not appear in file2 (hence prefixed with <tt>+</tt>).</p></div>
2123<div class="paragraph"><p>When shown by <tt>git diff-tree -c</tt>, it compares the parents of a
Junio C Hamanofb56a962006-01-28 10:38:192124merge commit with the merge result (i.e. file1..fileN are the
Junio C Hamano61525f92014-01-17 22:46:492125parents). When shown by <tt>git diff-files -c</tt>, it compares the
Junio C Hamanofb56a962006-01-28 10:38:192126two unresolved merge parents with the working tree file
2127(i.e. file1 is stage 2 aka "our version", file2 is stage 3 aka
Junio C Hamanoba4b9282008-07-06 05:20:312128"their version").</p></div>
Junio C Hamanofb56a962006-01-28 10:38:192129</div>
Junio C Hamano9629d4f2012-12-19 00:28:272130</div>
2131<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:312132<h2 id="_other_diff_formats">other diff formats</h2>
Junio C Hamano3a702342007-12-12 21:34:022133<div class="sectionbody">
Junio C Hamano61525f92014-01-17 22:46:492134<div class="paragraph"><p>The <tt>--summary</tt> option describes newly added, deleted, renamed and
2135copied files. The <tt>--stat</tt> option adds diffstat(1) graph to the
Junio C Hamano3a702342007-12-12 21:34:022136output. These options can be combined with other options, such as
Junio C Hamano61525f92014-01-17 22:46:492137<tt>-p</tt>, and are meant for human consumption.</p></div>
2138<div class="paragraph"><p>When showing a change that involves a rename or a copy, <tt>--stat</tt> output
Junio C Hamano3a702342007-12-12 21:34:022139formats the pathnames compactly by combining common prefix and suffix of
Junio C Hamano61525f92014-01-17 22:46:492140the pathnames. For example, a change that moves <tt>arch/i386/Makefile</tt> to
2141<tt>arch/x86/Makefile</tt> while modifying 4 lines will be shown like this:</p></div>
Junio C Hamano3a702342007-12-12 21:34:022142<div class="listingblock">
2143<div class="content">
Junio C Hamano61525f92014-01-17 22:46:492144<pre><tt>arch/{i386 =&gt; x86}/Makefile | 4 +--</tt></pre>
Junio C Hamano3a702342007-12-12 21:34:022145</div></div>
Junio C Hamano61525f92014-01-17 22:46:492146<div class="paragraph"><p>The <tt>--numstat</tt> option gives the diffstat(1) information but is designed
2147for easier machine consumption. An entry in <tt>--numstat</tt> output looks
Junio C Hamanoba4b9282008-07-06 05:20:312148like this:</p></div>
Junio C Hamano3a702342007-12-12 21:34:022149<div class="listingblock">
2150<div class="content">
Junio C Hamano61525f92014-01-17 22:46:492151<pre><tt>1 2 README
21523 1 arch/{i386 =&gt; x86}/Makefile</tt></pre>
Junio C Hamano3a702342007-12-12 21:34:022153</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592154<div class="paragraph"><p>That is, from left to right:</p></div>
2155<div class="olist arabic"><ol class="arabic">
Junio C Hamano3a702342007-12-12 21:34:022156<li>
2157<p>
2158the number of added lines;
2159</p>
2160</li>
2161<li>
2162<p>
2163a tab;
2164</p>
2165</li>
2166<li>
2167<p>
2168the number of deleted lines;
2169</p>
2170</li>
2171<li>
2172<p>
2173a tab;
2174</p>
2175</li>
2176<li>
2177<p>
2178pathname (possibly with rename/copy information);
2179</p>
2180</li>
2181<li>
2182<p>
2183a newline.
2184</p>
2185</li>
Junio C Hamanoba4b9282008-07-06 05:20:312186</ol></div>
Junio C Hamano61525f92014-01-17 22:46:492187<div class="paragraph"><p>When <tt>-z</tt> output option is in effect, the output is formatted this way:</p></div>
Junio C Hamano3a702342007-12-12 21:34:022188<div class="listingblock">
2189<div class="content">
Junio C Hamano61525f92014-01-17 22:46:492190<pre><tt>1 2 README NUL
21913 1 NUL arch/i386/Makefile NUL arch/x86/Makefile NUL</tt></pre>
Junio C Hamano3a702342007-12-12 21:34:022192</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592193<div class="paragraph"><p>That is:</p></div>
2194<div class="olist arabic"><ol class="arabic">
Junio C Hamano3a702342007-12-12 21:34:022195<li>
2196<p>
2197the number of added lines;
2198</p>
2199</li>
2200<li>
2201<p>
2202a tab;
2203</p>
2204</li>
2205<li>
2206<p>
2207the number of deleted lines;
2208</p>
2209</li>
2210<li>
2211<p>
2212a tab;
2213</p>
2214</li>
2215<li>
2216<p>
2217a NUL (only exists if renamed/copied);
2218</p>
2219</li>
2220<li>
2221<p>
2222pathname in preimage;
2223</p>
2224</li>
2225<li>
2226<p>
2227a NUL (only exists if renamed/copied);
2228</p>
2229</li>
2230<li>
2231<p>
2232pathname in postimage (only exists if renamed/copied);
2233</p>
2234</li>
2235<li>
2236<p>
2237a NUL.
2238</p>
2239</li>
Junio C Hamanoba4b9282008-07-06 05:20:312240</ol></div>
Junio C Hamano61525f92014-01-17 22:46:492241<div class="paragraph"><p>The extra <tt>NUL</tt> before the preimage path in renamed case is to allow
Junio C Hamano3a702342007-12-12 21:34:022242scripts that read the output to tell if the current record being read is
2243a single-path record or a rename/copy record without reading ahead.
Junio C Hamano61525f92014-01-17 22:46:492244After reading added and deleted lines, reading up to <tt>NUL</tt> would yield
2245the pathname, but if that is <tt>NUL</tt>, the record will show two paths.</p></div>
Junio C Hamano3a702342007-12-12 21:34:022246</div>
Junio C Hamano9629d4f2012-12-19 00:28:272247</div>
2248<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:312249<h2 id="_git">GIT</h2>
Junio C Hamano1a4e8412005-12-27 08:17:232250<div class="sectionbody">
Junio C Hamanoa28a9202012-06-21 07:08:232251<div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232252</div>
Junio C Hamano7bd050f2011-09-22 06:32:222253</div>
Junio C Hamano9629d4f2012-12-19 00:28:272254</div>
Junio C Hamano7bd050f2011-09-22 06:32:222255<div id="footnotes"><hr /></div>
Junio C Hamano1a4e8412005-12-27 08:17:232256<div id="footer">
2257<div id="footer-text">
Junio C Hamano683a8612013-08-23 20:50:092258Last updated 2013-08-20 08:40:27 PDT
Junio C Hamano1a4e8412005-12-27 08:17:232259</div>
2260</div>
2261</body>
2262</html>