blob: 3cfa34b635f0f0d3f2b20495de064bb4a6802a96 [file] [log] [blame]
Junio C Hamano1a4e8412005-12-27 08:17:231<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
2 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
4<head>
Junio C Hamano9629d4f2012-12-19 00:28:275<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
Junio C Hamanoc14e6ad2014-10-31 20:25:536<meta name="generator" content="AsciiDoc 8.6.9" />
Junio C Hamano68cf15a2010-11-06 01:01:597<title>git-diff-files(1)</title>
Junio C Hamano1a4e8412005-12-27 08:17:238<style type="text/css">
Junio C Hamano9629d4f2012-12-19 00:28:279/* Shared CSS for AsciiDoc xhtml11 and html5 backends */
10
11/* Default font. */
12body {
13 font-family: Georgia,serif;
14}
15
16/* Title font. */
17h1, h2, h3, h4, h5, h6,
18div.title, caption.title,
19thead, p.table.header,
20#toctitle,
21#author, #revnumber, #revdate, #revremark,
22#footer {
23 font-family: Arial,Helvetica,sans-serif;
Junio C Hamano1a4e8412005-12-27 08:17:2324}
25
26body {
27 margin: 1em 5% 1em 5%;
28}
29
Junio C Hamanoba4b9282008-07-06 05:20:3130a {
31 color: blue;
32 text-decoration: underline;
33}
34a:visited {
35 color: fuchsia;
36}
Junio C Hamano1a4e8412005-12-27 08:17:2337
38em {
39 font-style: italic;
Junio C Hamano68cf15a2010-11-06 01:01:5940 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:2341}
42
43strong {
44 font-weight: bold;
Junio C Hamano68cf15a2010-11-06 01:01:5945 color: #083194;
Junio C Hamano1a4e8412005-12-27 08:17:2346}
47
Junio C Hamano1a4e8412005-12-27 08:17:2348h1, h2, h3, h4, h5, h6 {
49 color: #527bbd;
Junio C Hamano1a4e8412005-12-27 08:17:2350 margin-top: 1.2em;
51 margin-bottom: 0.5em;
52 line-height: 1.3;
53}
54
Junio C Hamanoba4b9282008-07-06 05:20:3155h1, h2, h3 {
Junio C Hamano1a4e8412005-12-27 08:17:2356 border-bottom: 2px solid silver;
57}
58h2 {
Junio C Hamano1a4e8412005-12-27 08:17:2359 padding-top: 0.5em;
60}
Junio C Hamanoba4b9282008-07-06 05:20:3161h3 {
62 float: left;
63}
64h3 + * {
65 clear: left;
66}
Junio C Hamano9629d4f2012-12-19 00:28:2767h5 {
68 font-size: 1.0em;
69}
Junio C Hamano1a4e8412005-12-27 08:17:2370
71div.sectionbody {
Junio C Hamano1a4e8412005-12-27 08:17:2372 margin-left: 0;
73}
74
75hr {
76 border: 1px solid silver;
77}
78
79p {
80 margin-top: 0.5em;
81 margin-bottom: 0.5em;
82}
83
Junio C Hamano68cf15a2010-11-06 01:01:5984ul, ol, li > p {
85 margin-top: 0;
86}
Junio C Hamano9629d4f2012-12-19 00:28:2787ul > li { color: #aaa; }
88ul > li > * { color: black; }
Junio C Hamano68cf15a2010-11-06 01:01:5989
Junio C Hamanoc14e6ad2014-10-31 20:25:5390.monospaced, code, pre {
91 font-family: "Courier New", Courier, monospace;
92 font-size: inherit;
93 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:2394 padding: 0;
95 margin: 0;
96}
Junio C Hamanoc14e6ad2014-10-31 20:25:5397pre {
98 white-space: pre-wrap;
99}
Junio C Hamano1a4e8412005-12-27 08:17:23100
Junio C Hamano9629d4f2012-12-19 00:28:27101#author {
Junio C Hamano1a4e8412005-12-27 08:17:23102 color: #527bbd;
Junio C Hamano1a4e8412005-12-27 08:17:23103 font-weight: bold;
Junio C Hamanoba4b9282008-07-06 05:20:31104 font-size: 1.1em;
Junio C Hamano1a4e8412005-12-27 08:17:23105}
Junio C Hamano9629d4f2012-12-19 00:28:27106#email {
Junio C Hamano1a4e8412005-12-27 08:17:23107}
Junio C Hamano9629d4f2012-12-19 00:28:27108#revnumber, #revdate, #revremark {
Junio C Hamano1a4e8412005-12-27 08:17:23109}
110
Junio C Hamano9629d4f2012-12-19 00:28:27111#footer {
Junio C Hamano1a4e8412005-12-27 08:17:23112 font-size: small;
113 border-top: 2px solid silver;
114 padding-top: 0.5em;
115 margin-top: 4.0em;
116}
Junio C Hamano9629d4f2012-12-19 00:28:27117#footer-text {
Junio C Hamano1a4e8412005-12-27 08:17:23118 float: left;
119 padding-bottom: 0.5em;
120}
Junio C Hamano9629d4f2012-12-19 00:28:27121#footer-badges {
Junio C Hamano1a4e8412005-12-27 08:17:23122 float: right;
123 padding-bottom: 0.5em;
124}
125
Junio C Hamano9629d4f2012-12-19 00:28:27126#preamble {
Junio C Hamano68cf15a2010-11-06 01:01:59127 margin-top: 1.5em;
128 margin-bottom: 1.5em;
129}
Junio C Hamano9629d4f2012-12-19 00:28:27130div.imageblock, div.exampleblock, div.verseblock,
Junio C Hamano1a4e8412005-12-27 08:17:23131div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
132div.admonitionblock {
Junio C Hamano7bd050f2011-09-22 06:32:22133 margin-top: 1.0em;
Junio C Hamano1a4e8412005-12-27 08:17:23134 margin-bottom: 1.5em;
135}
136div.admonitionblock {
Junio C Hamano7bd050f2011-09-22 06:32:22137 margin-top: 2.0em;
138 margin-bottom: 2.0em;
139 margin-right: 10%;
140 color: #606060;
Junio C Hamano1a4e8412005-12-27 08:17:23141}
142
143div.content { /* Block element content. */
144 padding: 0;
145}
146
147/* Block element titles. */
148div.title, caption.title {
Junio C Hamano68cf15a2010-11-06 01:01:59149 color: #527bbd;
Junio C Hamano1a4e8412005-12-27 08:17:23150 font-weight: bold;
151 text-align: left;
152 margin-top: 1.0em;
153 margin-bottom: 0.5em;
154}
155div.title + * {
156 margin-top: 0;
157}
158
159td div.title:first-child {
160 margin-top: 0.0em;
161}
162div.content div.title:first-child {
163 margin-top: 0.0em;
164}
165div.content + div.title {
166 margin-top: 0.0em;
167}
168
169div.sidebarblock > div.content {
170 background: #ffffee;
Junio C Hamano9629d4f2012-12-19 00:28:27171 border: 1px solid #dddddd;
172 border-left: 4px solid #f0f0f0;
Junio C Hamano1a4e8412005-12-27 08:17:23173 padding: 0.5em;
174}
175
176div.listingblock > div.content {
Junio C Hamano9629d4f2012-12-19 00:28:27177 border: 1px solid #dddddd;
178 border-left: 5px solid #f0f0f0;
179 background: #f8f8f8;
Junio C Hamano1a4e8412005-12-27 08:17:23180 padding: 0.5em;
181}
182
Junio C Hamano7bd050f2011-09-22 06:32:22183div.quoteblock, div.verseblock {
184 padding-left: 1.0em;
185 margin-left: 1.0em;
Junio C Hamano68cf15a2010-11-06 01:01:59186 margin-right: 10%;
Junio C Hamano9629d4f2012-12-19 00:28:27187 border-left: 5px solid #f0f0f0;
188 color: #888;
Junio C Hamano1a4e8412005-12-27 08:17:23189}
Junio C Hamano7bd050f2011-09-22 06:32:22190
Junio C Hamano68cf15a2010-11-06 01:01:59191div.quoteblock > div.attribution {
192 padding-top: 0.5em;
Junio C Hamano1a4e8412005-12-27 08:17:23193 text-align: right;
194}
Junio C Hamano68cf15a2010-11-06 01:01:59195
Junio C Hamano9629d4f2012-12-19 00:28:27196div.verseblock > pre.content {
197 font-family: inherit;
198 font-size: inherit;
Junio C Hamano68cf15a2010-11-06 01:01:59199}
200div.verseblock > div.attribution {
201 padding-top: 0.75em;
202 text-align: left;
203}
204/* DEPRECATED: Pre version 8.2.7 verse style literal block. */
Junio C Hamanoba4b9282008-07-06 05:20:31205div.verseblock + div.attribution {
206 text-align: left;
207}
Junio C Hamano1a4e8412005-12-27 08:17:23208
209div.admonitionblock .icon {
210 vertical-align: top;
211 font-size: 1.1em;
212 font-weight: bold;
213 text-decoration: underline;
214 color: #527bbd;
215 padding-right: 0.5em;
216}
217div.admonitionblock td.content {
218 padding-left: 0.5em;
Junio C Hamano7bd050f2011-09-22 06:32:22219 border-left: 3px solid #dddddd;
Junio C Hamano1a4e8412005-12-27 08:17:23220}
221
222div.exampleblock > div.content {
Junio C Hamano7bd050f2011-09-22 06:32:22223 border-left: 3px solid #dddddd;
224 padding-left: 0.5em;
Junio C Hamano1a4e8412005-12-27 08:17:23225}
226
Junio C Hamano1a4e8412005-12-27 08:17:23227div.imageblock div.content { padding-left: 0; }
Junio C Hamanoc14e6ad2014-10-31 20:25:53228span.image img { border-style: none; vertical-align: text-bottom; }
Junio C Hamano68cf15a2010-11-06 01:01:59229a.image:visited { color: white; }
Junio C Hamano1a4e8412005-12-27 08:17:23230
231dl {
232 margin-top: 0.8em;
233 margin-bottom: 0.8em;
234}
235dt {
236 margin-top: 0.5em;
237 margin-bottom: 0;
Junio C Hamano68cf15a2010-11-06 01:01:59238 font-style: normal;
239 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:23240}
241dd > *:first-child {
Junio C Hamano68cf15a2010-11-06 01:01:59242 margin-top: 0.1em;
Junio C Hamano1a4e8412005-12-27 08:17:23243}
244
245ul, ol {
246 list-style-position: outside;
247}
Junio C Hamano68cf15a2010-11-06 01:01:59248ol.arabic {
249 list-style-type: decimal;
250}
251ol.loweralpha {
Junio C Hamano1a4e8412005-12-27 08:17:23252 list-style-type: lower-alpha;
253}
Junio C Hamano68cf15a2010-11-06 01:01:59254ol.upperalpha {
255 list-style-type: upper-alpha;
256}
257ol.lowerroman {
258 list-style-type: lower-roman;
259}
260ol.upperroman {
261 list-style-type: upper-roman;
262}
263
264div.compact ul, div.compact ol,
265div.compact p, div.compact p,
266div.compact div, div.compact div {
267 margin-top: 0.1em;
268 margin-bottom: 0.1em;
269}
Junio C Hamano1a4e8412005-12-27 08:17:23270
Junio C Hamano1a4e8412005-12-27 08:17:23271tfoot {
272 font-weight: bold;
273}
Junio C Hamano68cf15a2010-11-06 01:01:59274td > div.verse {
275 white-space: pre;
276}
Junio C Hamano68cf15a2010-11-06 01:01:59277
278div.hdlist {
Junio C Hamano1a4e8412005-12-27 08:17:23279 margin-top: 0.8em;
280 margin-bottom: 0.8em;
281}
Junio C Hamano68cf15a2010-11-06 01:01:59282div.hdlist tr {
283 padding-bottom: 15px;
Junio C Hamanoba4b9282008-07-06 05:20:31284}
Junio C Hamano68cf15a2010-11-06 01:01:59285dt.hdlist1.strong, td.hdlist1.strong {
286 font-weight: bold;
287}
288td.hdlist1 {
Junio C Hamano1a4e8412005-12-27 08:17:23289 vertical-align: top;
Junio C Hamano68cf15a2010-11-06 01:01:59290 font-style: normal;
Junio C Hamano1a4e8412005-12-27 08:17:23291 padding-right: 0.8em;
Junio C Hamano68cf15a2010-11-06 01:01:59292 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:23293}
Junio C Hamano68cf15a2010-11-06 01:01:59294td.hdlist2 {
Junio C Hamano1a4e8412005-12-27 08:17:23295 vertical-align: top;
296}
Junio C Hamano68cf15a2010-11-06 01:01:59297div.hdlist.compact tr {
298 margin: 0;
299 padding-bottom: 0;
300}
301
302.comment {
303 background: yellow;
304}
Junio C Hamano1a4e8412005-12-27 08:17:23305
Junio C Hamano7bd050f2011-09-22 06:32:22306.footnote, .footnoteref {
307 font-size: 0.8em;
308}
309
310span.footnote, span.footnoteref {
311 vertical-align: super;
312}
313
314#footnotes {
315 margin: 20px 0 20px 0;
316 padding: 7px 0 0 0;
317}
318
319#footnotes div.footnote {
320 margin: 0 0 5px 0;
321}
322
323#footnotes hr {
324 border: none;
325 border-top: 1px solid silver;
326 height: 1px;
327 text-align: left;
328 margin-left: 0;
329 width: 20%;
330 min-width: 100px;
331}
332
Junio C Hamano9629d4f2012-12-19 00:28:27333div.colist td {
334 padding-right: 0.5em;
335 padding-bottom: 0.3em;
336 vertical-align: top;
337}
338div.colist td img {
339 margin-top: 0.3em;
Junio C Hamano1a4e8412005-12-27 08:17:23340}
Junio C Hamanoba4b9282008-07-06 05:20:31341
Junio C Hamano9629d4f2012-12-19 00:28:27342@media print {
343 #footer-badges { display: none; }
344}
345
346#toc {
Junio C Hamano7bd050f2011-09-22 06:32:22347 margin-bottom: 2.5em;
348}
349
Junio C Hamano9629d4f2012-12-19 00:28:27350#toctitle {
Junio C Hamanoba4b9282008-07-06 05:20:31351 color: #527bbd;
Junio C Hamanoba4b9282008-07-06 05:20:31352 font-size: 1.1em;
353 font-weight: bold;
354 margin-top: 1.0em;
355 margin-bottom: 0.1em;
356}
357
Junio C Hamanoc14e6ad2014-10-31 20:25:53358div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
Junio C Hamanoba4b9282008-07-06 05:20:31359 margin-top: 0;
360 margin-bottom: 0;
361}
362div.toclevel2 {
363 margin-left: 2em;
364 font-size: 0.9em;
365}
366div.toclevel3 {
367 margin-left: 4em;
368 font-size: 0.9em;
369}
370div.toclevel4 {
371 margin-left: 6em;
372 font-size: 0.9em;
373}
Junio C Hamano9629d4f2012-12-19 00:28:27374
375span.aqua { color: aqua; }
376span.black { color: black; }
377span.blue { color: blue; }
378span.fuchsia { color: fuchsia; }
379span.gray { color: gray; }
380span.green { color: green; }
381span.lime { color: lime; }
382span.maroon { color: maroon; }
383span.navy { color: navy; }
384span.olive { color: olive; }
385span.purple { color: purple; }
386span.red { color: red; }
387span.silver { color: silver; }
388span.teal { color: teal; }
389span.white { color: white; }
390span.yellow { color: yellow; }
391
392span.aqua-background { background: aqua; }
393span.black-background { background: black; }
394span.blue-background { background: blue; }
395span.fuchsia-background { background: fuchsia; }
396span.gray-background { background: gray; }
397span.green-background { background: green; }
398span.lime-background { background: lime; }
399span.maroon-background { background: maroon; }
400span.navy-background { background: navy; }
401span.olive-background { background: olive; }
402span.purple-background { background: purple; }
403span.red-background { background: red; }
404span.silver-background { background: silver; }
405span.teal-background { background: teal; }
406span.white-background { background: white; }
407span.yellow-background { background: yellow; }
408
409span.big { font-size: 2em; }
410span.small { font-size: 0.6em; }
411
412span.underline { text-decoration: underline; }
413span.overline { text-decoration: overline; }
414span.line-through { text-decoration: line-through; }
415
Junio C Hamanoc14e6ad2014-10-31 20:25:53416div.unbreakable { page-break-inside: avoid; }
417
Junio C Hamano9629d4f2012-12-19 00:28:27418
419/*
420 * xhtml11 specific
421 *
422 * */
423
424div.tableblock {
425 margin-top: 1.0em;
426 margin-bottom: 1.5em;
427}
428div.tableblock > table {
429 border: 3px solid #527bbd;
430}
431thead, p.table.header {
432 font-weight: bold;
433 color: #527bbd;
434}
435p.table {
436 margin-top: 0;
437}
438/* Because the table frame attribute is overriden by CSS in most browsers. */
439div.tableblock > table[frame="void"] {
440 border-style: none;
441}
442div.tableblock > table[frame="hsides"] {
443 border-left-style: none;
444 border-right-style: none;
445}
446div.tableblock > table[frame="vsides"] {
447 border-top-style: none;
448 border-bottom-style: none;
449}
450
451
452/*
453 * html5 specific
454 *
455 * */
456
457table.tableblock {
458 margin-top: 1.0em;
459 margin-bottom: 1.5em;
460}
461thead, p.tableblock.header {
462 font-weight: bold;
463 color: #527bbd;
464}
465p.tableblock {
466 margin-top: 0;
467}
468table.tableblock {
469 border-width: 3px;
470 border-spacing: 0px;
471 border-style: solid;
472 border-color: #527bbd;
473 border-collapse: collapse;
474}
475th.tableblock, td.tableblock {
476 border-width: 1px;
477 padding: 4px;
478 border-style: solid;
479 border-color: #527bbd;
480}
481
482table.tableblock.frame-topbot {
483 border-left-style: hidden;
484 border-right-style: hidden;
485}
486table.tableblock.frame-sides {
487 border-top-style: hidden;
488 border-bottom-style: hidden;
489}
490table.tableblock.frame-none {
491 border-style: hidden;
492}
493
494th.tableblock.halign-left, td.tableblock.halign-left {
495 text-align: left;
496}
497th.tableblock.halign-center, td.tableblock.halign-center {
498 text-align: center;
499}
500th.tableblock.halign-right, td.tableblock.halign-right {
501 text-align: right;
502}
503
504th.tableblock.valign-top, td.tableblock.valign-top {
505 vertical-align: top;
506}
507th.tableblock.valign-middle, td.tableblock.valign-middle {
508 vertical-align: middle;
509}
510th.tableblock.valign-bottom, td.tableblock.valign-bottom {
511 vertical-align: bottom;
512}
513
514
515/*
516 * manpage specific
517 *
518 * */
519
520body.manpage h1 {
Junio C Hamano68cf15a2010-11-06 01:01:59521 padding-top: 0.5em;
522 padding-bottom: 0.5em;
523 border-top: 2px solid silver;
524 border-bottom: 2px solid silver;
525}
Junio C Hamano9629d4f2012-12-19 00:28:27526body.manpage h2 {
Junio C Hamano68cf15a2010-11-06 01:01:59527 border-style: none;
528}
Junio C Hamano9629d4f2012-12-19 00:28:27529body.manpage div.sectionbody {
530 margin-left: 3em;
Junio C Hamano68cf15a2010-11-06 01:01:59531}
532
533@media print {
Junio C Hamano9629d4f2012-12-19 00:28:27534 body.manpage div#toc { display: none; }
Junio C Hamano68cf15a2010-11-06 01:01:59535}
Junio C Hamanoc14e6ad2014-10-31 20:25:53536
537
Junio C Hamano1a4e8412005-12-27 08:17:23538</style>
Junio C Hamano7bd050f2011-09-22 06:32:22539<script type="text/javascript">
540/*<![CDATA[*/
Junio C Hamano7bd050f2011-09-22 06:32:22541var asciidoc = { // Namespace.
542
543/////////////////////////////////////////////////////////////////////
544// Table Of Contents generator
545/////////////////////////////////////////////////////////////////////
546
547/* Author: Mihai Bazon, September 2002
548 * http://students.infoiasi.ro/~mishoo
549 *
550 * Table Of Content generator
551 * Version: 0.4
552 *
553 * Feel free to use this script under the terms of the GNU General Public
554 * License, as long as you do not remove or alter this notice.
555 */
556
557 /* modified by Troy D. Hanson, September 2006. License: GPL */
558 /* modified by Stuart Rackham, 2006, 2009. License: GPL */
559
560// toclevels = 1..4.
561toc: function (toclevels) {
562
563 function getText(el) {
564 var text = "";
565 for (var i = el.firstChild; i != null; i = i.nextSibling) {
566 if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
567 text += i.data;
568 else if (i.firstChild != null)
569 text += getText(i);
570 }
571 return text;
572 }
573
574 function TocEntry(el, text, toclevel) {
575 this.element = el;
576 this.text = text;
577 this.toclevel = toclevel;
578 }
579
580 function tocEntries(el, toclevels) {
581 var result = new Array;
Junio C Hamanoc14e6ad2014-10-31 20:25:53582 var re = new RegExp('[hH]([1-'+(toclevels+1)+'])');
Junio C Hamano7bd050f2011-09-22 06:32:22583 // Function that scans the DOM tree for header elements (the DOM2
584 // nodeIterator API would be a better technique but not supported by all
585 // browsers).
586 var iterate = function (el) {
587 for (var i = el.firstChild; i != null; i = i.nextSibling) {
588 if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
589 var mo = re.exec(i.tagName);
590 if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
591 result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
592 }
593 iterate(i);
594 }
595 }
596 }
597 iterate(el);
598 return result;
599 }
600
601 var toc = document.getElementById("toc");
Junio C Hamano9629d4f2012-12-19 00:28:27602 if (!toc) {
603 return;
604 }
605
606 // Delete existing TOC entries in case we're reloading the TOC.
607 var tocEntriesToRemove = [];
608 var i;
609 for (i = 0; i < toc.childNodes.length; i++) {
610 var entry = toc.childNodes[i];
Junio C Hamanoc14e6ad2014-10-31 20:25:53611 if (entry.nodeName.toLowerCase() == 'div'
Junio C Hamano9629d4f2012-12-19 00:28:27612 && entry.getAttribute("class")
613 && entry.getAttribute("class").match(/^toclevel/))
614 tocEntriesToRemove.push(entry);
615 }
616 for (i = 0; i < tocEntriesToRemove.length; i++) {
617 toc.removeChild(tocEntriesToRemove[i]);
618 }
619
620 // Rebuild TOC entries.
Junio C Hamano7bd050f2011-09-22 06:32:22621 var entries = tocEntries(document.getElementById("content"), toclevels);
622 for (var i = 0; i < entries.length; ++i) {
623 var entry = entries[i];
624 if (entry.element.id == "")
625 entry.element.id = "_toc_" + i;
626 var a = document.createElement("a");
627 a.href = "#" + entry.element.id;
628 a.appendChild(document.createTextNode(entry.text));
629 var div = document.createElement("div");
630 div.appendChild(a);
631 div.className = "toclevel" + entry.toclevel;
632 toc.appendChild(div);
633 }
634 if (entries.length == 0)
635 toc.parentNode.removeChild(toc);
636},
637
638
639/////////////////////////////////////////////////////////////////////
640// Footnotes generator
641/////////////////////////////////////////////////////////////////////
642
643/* Based on footnote generation code from:
644 * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
645 */
646
647footnotes: function () {
Junio C Hamano9629d4f2012-12-19 00:28:27648 // Delete existing footnote entries in case we're reloading the footnodes.
649 var i;
Junio C Hamano7bd050f2011-09-22 06:32:22650 var noteholder = document.getElementById("footnotes");
Junio C Hamano9629d4f2012-12-19 00:28:27651 if (!noteholder) {
652 return;
653 }
654 var entriesToRemove = [];
655 for (i = 0; i < noteholder.childNodes.length; i++) {
656 var entry = noteholder.childNodes[i];
Junio C Hamanoc14e6ad2014-10-31 20:25:53657 if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote")
Junio C Hamano9629d4f2012-12-19 00:28:27658 entriesToRemove.push(entry);
659 }
660 for (i = 0; i < entriesToRemove.length; i++) {
661 noteholder.removeChild(entriesToRemove[i]);
662 }
663
664 // Rebuild footnote entries.
665 var cont = document.getElementById("content");
Junio C Hamano7bd050f2011-09-22 06:32:22666 var spans = cont.getElementsByTagName("span");
667 var refs = {};
668 var n = 0;
669 for (i=0; i<spans.length; i++) {
670 if (spans[i].className == "footnote") {
671 n++;
Junio C Hamano9629d4f2012-12-19 00:28:27672 var note = spans[i].getAttribute("data-note");
673 if (!note) {
674 // Use [\s\S] in place of . so multi-line matches work.
675 // Because JavaScript has no s (dotall) regex flag.
676 note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
677 spans[i].innerHTML =
678 "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
679 "' title='View footnote' class='footnote'>" + n + "</a>]";
680 spans[i].setAttribute("data-note", note);
681 }
Junio C Hamano7bd050f2011-09-22 06:32:22682 noteholder.innerHTML +=
683 "<div class='footnote' id='_footnote_" + n + "'>" +
684 "<a href='#_footnoteref_" + n + "' title='Return to text'>" +
685 n + "</a>. " + note + "</div>";
Junio C Hamano7bd050f2011-09-22 06:32:22686 var id =spans[i].getAttribute("id");
687 if (id != null) refs["#"+id] = n;
688 }
689 }
690 if (n == 0)
691 noteholder.parentNode.removeChild(noteholder);
692 else {
693 // Process footnoterefs.
694 for (i=0; i<spans.length; i++) {
695 if (spans[i].className == "footnoteref") {
696 var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
697 href = href.match(/#.*/)[0]; // Because IE return full URL.
698 n = refs[href];
699 spans[i].innerHTML =
700 "[<a href='#_footnote_" + n +
701 "' title='View footnote' class='footnote'>" + n + "</a>]";
702 }
703 }
704 }
Junio C Hamano9629d4f2012-12-19 00:28:27705},
706
707install: function(toclevels) {
708 var timerId;
709
710 function reinstall() {
711 asciidoc.footnotes();
712 if (toclevels) {
713 asciidoc.toc(toclevels);
714 }
715 }
716
717 function reinstallAndRemoveTimer() {
718 clearInterval(timerId);
719 reinstall();
720 }
721
722 timerId = setInterval(reinstall, 500);
723 if (document.addEventListener)
724 document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false);
725 else
726 window.onload = reinstallAndRemoveTimer;
Junio C Hamano7bd050f2011-09-22 06:32:22727}
728
729}
Junio C Hamano9629d4f2012-12-19 00:28:27730asciidoc.install();
Junio C Hamano7bd050f2011-09-22 06:32:22731/*]]>*/
732</script>
Junio C Hamano1a4e8412005-12-27 08:17:23733</head>
Junio C Hamano9629d4f2012-12-19 00:28:27734<body class="manpage">
Junio C Hamano1a4e8412005-12-27 08:17:23735<div id="header">
736<h1>
737git-diff-files(1) Manual Page
738</h1>
739<h2>NAME</h2>
740<div class="sectionbody">
741<p>git-diff-files -
742 Compares files in the working tree and the index
743</p>
744</div>
745</div>
Junio C Hamano7bd050f2011-09-22 06:32:22746<div id="content">
Junio C Hamano9629d4f2012-12-19 00:28:27747<div class="sect1">
Junio C Hamano68cf15a2010-11-06 01:01:59748<h2 id="_synopsis">SYNOPSIS</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23749<div class="sectionbody">
Junio C Hamano15567bc2011-07-23 00:51:59750<div class="verseblock">
Junio C Hamano9629d4f2012-12-19 00:28:27751<pre class="content"><em>git diff-files</em> [-q] [-0|-1|-2|-3|-c|--cc] [&lt;common diff options&gt;] [&lt;path&gt;&#8230;]</pre>
752<div class="attribution">
Junio C Hamano15567bc2011-07-23 00:51:59753</div></div>
Junio C Hamano1a4e8412005-12-27 08:17:23754</div>
Junio C Hamano9629d4f2012-12-19 00:28:27755</div>
756<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:31757<h2 id="_description">DESCRIPTION</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23758<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:59759<div class="paragraph"><p>Compares the files in the working tree and the index. When paths
Junio C Hamano1a4e8412005-12-27 08:17:23760are specified, compares only those named paths. Otherwise all
761entries in the index are compared. The output format is the
Junio C Hamano1aa40d22010-01-21 17:46:43762same as for <em>git diff-index</em> and <em>git diff-tree</em>.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:23763</div>
Junio C Hamano9629d4f2012-12-19 00:28:27764</div>
765<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:31766<h2 id="_options">OPTIONS</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23767<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:59768<div class="dlist"><dl>
769<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:23770-p
771</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59772<dt class="hdlist1">
Junio C Hamanobbbb8652008-12-29 10:34:22773-u
774</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59775<dt class="hdlist1">
Junio C Hamanoe97d5772010-05-19 08:13:58776--patch
777</dt>
Junio C Hamano1a4e8412005-12-27 08:17:23778<dd>
779<p>
Junio C Hamanoff979792007-11-16 10:11:30780 Generate patch (see section on generating patches).
Junio C Hamano1a4e8412005-12-27 08:17:23781</p>
782</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59783<dt class="hdlist1">
Junio C Hamano58f587a2013-07-22 19:20:59784-s
785</dt>
786<dt class="hdlist1">
787--no-patch
788</dt>
789<dd>
790<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:53791 Suppress diff output. Useful for commands like <code>git show</code> that
792 show the patch by default, or to cancel the effect of <code>--patch</code>.
Junio C Hamano58f587a2013-07-22 19:20:59793</p>
794</dd>
795<dt class="hdlist1">
Junio C Hamano69361562007-07-26 02:14:34796-U&lt;n&gt;
797</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59798<dt class="hdlist1">
Junio C Hamano69361562007-07-26 02:14:34799--unified=&lt;n&gt;
800</dt>
801<dd>
802<p>
803 Generate diffs with &lt;n&gt; lines of context instead of
Junio C Hamano3b70d3c2009-11-21 17:37:37804 the usual three.
Junio C Hamanoc14e6ad2014-10-31 20:25:53805 Implies <code>-p</code>.
Junio C Hamano69361562007-07-26 02:14:34806</p>
807</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59808<dt class="hdlist1">
Junio C Hamano9ae1a062006-07-10 08:12:34809--raw
810</dt>
811<dd>
812<p>
Junio C Hamano85f1fde2015-06-01 20:37:32813 Generate the diff in raw format.
Junio C Hamano1dbca522015-05-22 20:48:55814 This is the default.
Junio C Hamano9ae1a062006-07-10 08:12:34815</p>
816</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59817<dt class="hdlist1">
Junio C Hamano54559c82006-04-13 07:45:12818--patch-with-raw
819</dt>
820<dd>
821<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:53822 Synonym for <code>-p --raw</code>.
Junio C Hamano54559c82006-04-13 07:45:12823</p>
824</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59825<dt class="hdlist1">
Junio C Hamanoad70bf02016-09-26 23:44:27826--indent-heuristic
827</dt>
Junio C Hamanoa65b6762017-11-06 04:45:42828<dd>
829<p>
830 Enable the heuristic that shift diff hunk boundaries to make patches
831 easier to read. This is the default.
832</p>
833</dd>
Junio C Hamanoad70bf02016-09-26 23:44:27834<dt class="hdlist1">
835--no-indent-heuristic
836</dt>
Junio C Hamano5f888332016-06-13 19:28:31837<dd>
838<p>
Junio C Hamanoa65b6762017-11-06 04:45:42839 Disable the indent heuristic.
Junio C Hamano5f888332016-06-13 19:28:31840</p>
841</dd>
842<dt class="hdlist1">
Junio C Hamano5a73f302011-10-14 05:58:34843--minimal
844</dt>
845<dd>
846<p>
847 Spend extra time to make sure the smallest possible
848 diff is produced.
849</p>
850</dd>
851<dt class="hdlist1">
Junio C Hamano20d47e32009-01-26 06:36:02852--patience
853</dt>
854<dd>
855<p>
856 Generate a diff using the "patience diff" algorithm.
857</p>
858</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59859<dt class="hdlist1">
Junio C Hamanoaea9e6b2012-03-07 00:17:11860--histogram
861</dt>
862<dd>
863<p>
864 Generate a diff using the "histogram diff" algorithm.
865</p>
866</dd>
867<dt class="hdlist1">
Junio C Hamano047135e2017-12-19 21:57:54868--anchored=&lt;text&gt;
869</dt>
870<dd>
871<p>
872 Generate a diff using the "anchored diff" algorithm.
873</p>
874<div class="paragraph"><p>This option may be specified more than once.</p></div>
875<div class="paragraph"><p>If a line exists in both the source and destination, exists only once,
876and starts with this text, this algorithm attempts to prevent it from
877appearing as a deletion or addition in the output. It uses the "patience
878diff" algorithm internally.</p></div>
879</dd>
880<dt class="hdlist1">
Junio C Hamano80ad00d2013-02-18 00:19:03881--diff-algorithm={patience|minimal|histogram|myers}
882</dt>
883<dd>
884<p>
885 Choose a diff algorithm. The variants are as follows:
886</p>
887<div class="openblock">
888<div class="content">
889<div class="dlist"><dl>
890<dt class="hdlist1">
Junio C Hamanoc14e6ad2014-10-31 20:25:53891<code>default</code>, <code>myers</code>
Junio C Hamano80ad00d2013-02-18 00:19:03892</dt>
893<dd>
894<p>
895 The basic greedy diff algorithm. Currently, this is the default.
896</p>
897</dd>
898<dt class="hdlist1">
Junio C Hamanoc14e6ad2014-10-31 20:25:53899<code>minimal</code>
Junio C Hamano80ad00d2013-02-18 00:19:03900</dt>
901<dd>
902<p>
903 Spend extra time to make sure the smallest possible diff is
904 produced.
905</p>
906</dd>
907<dt class="hdlist1">
Junio C Hamanoc14e6ad2014-10-31 20:25:53908<code>patience</code>
Junio C Hamano80ad00d2013-02-18 00:19:03909</dt>
910<dd>
911<p>
912 Use "patience diff" algorithm when generating patches.
913</p>
914</dd>
915<dt class="hdlist1">
Junio C Hamanoc14e6ad2014-10-31 20:25:53916<code>histogram</code>
Junio C Hamano80ad00d2013-02-18 00:19:03917</dt>
918<dd>
919<p>
920 This algorithm extends the patience algorithm to "support
921 low-occurrence common elements".
922</p>
923</dd>
924</dl></div>
925</div></div>
926<div class="paragraph"><p>For instance, if you configured diff.algorithm variable to a
927non-default value and want to use the default one, then you
Junio C Hamanoc14e6ad2014-10-31 20:25:53928have to use <code>--diff-algorithm=default</code> option.</p></div>
Junio C Hamano80ad00d2013-02-18 00:19:03929</dd>
930<dt class="hdlist1">
Junio C Hamano4c4b0122011-06-30 01:19:32931--stat[=&lt;width&gt;[,&lt;name-width&gt;[,&lt;count&gt;]]]
Junio C Hamanoba7c8d82006-04-15 06:17:42932</dt>
933<dd>
934<p>
Junio C Hamanoaea9e6b2012-03-07 00:17:11935 Generate a diffstat. By default, as much space as necessary
936 will be used for the filename part, and the rest for the graph
937 part. Maximum width defaults to terminal width, or 80 columns
Junio C Hamano7f2b3cb2012-06-22 22:42:39938 if not connected to a terminal, and can be overridden by
Junio C Hamanoc14e6ad2014-10-31 20:25:53939 <code>&lt;width&gt;</code>. The width of the filename part can be limited by
940 giving another width <code>&lt;name-width&gt;</code> after a comma. The width
Junio C Hamanoaea9e6b2012-03-07 00:17:11941 of the graph part can be limited by using
Junio C Hamanoc14e6ad2014-10-31 20:25:53942 <code>--stat-graph-width=&lt;width&gt;</code> (affects all commands generating
943 a stat graph) or by setting <code>diff.statGraphWidth=&lt;width&gt;</code>
944 (does not affect <code>git format-patch</code>).
945 By giving a third parameter <code>&lt;count&gt;</code>, you can limit the
946 output to the first <code>&lt;count&gt;</code> lines, followed by <code>...</code> if
Junio C Hamanoaea9e6b2012-03-07 00:17:11947 there are more.
Junio C Hamanoba7c8d82006-04-15 06:17:42948</p>
Junio C Hamanoc14e6ad2014-10-31 20:25:53949<div class="paragraph"><p>These parameters can also be set individually with <code>--stat-width=&lt;width&gt;</code>,
950<code>--stat-name-width=&lt;name-width&gt;</code> and <code>--stat-count=&lt;count&gt;</code>.</p></div>
Junio C Hamanoba7c8d82006-04-15 06:17:42951</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59952<dt class="hdlist1">
Junio C Hamano45badf02018-03-14 21:56:41953--compact-summary
954</dt>
955<dd>
956<p>
957 Output a condensed summary of extended header information such
958 as file creations or deletions ("new" or "gone", optionally "+l"
959 if it&#8217;s a symlink) and mode changes ("+x" or "-x" for adding
960 or removing executable bit respectively) in diffstat. The
961 information is put betwen the filename part and the graph
962 part. Implies <code>--stat</code>.
963</p>
964</dd>
965<dt class="hdlist1">
Junio C Hamanofbe00522006-10-19 05:58:48966--numstat
967</dt>
968<dd>
969<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:53970 Similar to <code>--stat</code>, but shows number of added and
Junio C Hamanofbe00522006-10-19 05:58:48971 deleted lines in decimal notation and pathname without
Junio C Hamanod793de52006-12-26 09:11:43972 abbreviation, to make it more machine friendly. For
Junio C Hamanoc14e6ad2014-10-31 20:25:53973 binary files, outputs two <code>-</code> instead of saying
974 <code>0 0</code>.
Junio C Hamanofbe00522006-10-19 05:58:48975</p>
976</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59977<dt class="hdlist1">
Junio C Hamano7d23f5e2006-12-16 07:44:04978--shortstat
979</dt>
980<dd>
981<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:53982 Output only the last line of the <code>--stat</code> format containing total
Junio C Hamano7d23f5e2006-12-16 07:44:04983 number of modified files, as well as number of added and deleted
984 lines.
985</p>
986</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59987<dt class="hdlist1">
Junio C Hamano1c222c52011-05-13 19:55:32988--dirstat[=&lt;param1,param2,&#8230;&gt;]
Junio C Hamano6a45be92008-04-22 08:19:03989</dt>
990<dd>
991<p>
Junio C Hamano1c222c52011-05-13 19:55:32992 Output the distribution of relative amount of changes for each
Junio C Hamanoc14e6ad2014-10-31 20:25:53993 sub-directory. The behavior of <code>--dirstat</code> can be customized by
Junio C Hamano1c222c52011-05-13 19:55:32994 passing it a comma separated list of parameters.
Junio C Hamanoc14e6ad2014-10-31 20:25:53995 The defaults are controlled by the <code>diff.dirstat</code> configuration
Junio C Hamanoa28a9202012-06-21 07:08:23996 variable (see <a href="git-config.html">git-config(1)</a>).
Junio C Hamano1c222c52011-05-13 19:55:32997 The following parameters are available:
Junio C Hamano6a45be92008-04-22 08:19:03998</p>
Junio C Hamano9629d4f2012-12-19 00:28:27999<div class="openblock">
1000<div class="content">
Junio C Hamano1c222c52011-05-13 19:55:321001<div class="dlist"><dl>
1002<dt class="hdlist1">
Junio C Hamanoc14e6ad2014-10-31 20:25:531003<code>changes</code>
Junio C Hamano1c222c52011-05-13 19:55:321004</dt>
1005<dd>
1006<p>
1007 Compute the dirstat numbers by counting the lines that have been
1008 removed from the source, or added to the destination. This ignores
1009 the amount of pure code movements within a file. In other words,
1010 rearranging lines in a file is not counted as much as other changes.
1011 This is the default behavior when no parameter is given.
1012</p>
Junio C Hamano6a45be92008-04-22 08:19:031013</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591014<dt class="hdlist1">
Junio C Hamanoc14e6ad2014-10-31 20:25:531015<code>lines</code>
Junio C Hamanoa476efa2008-10-10 15:31:421016</dt>
1017<dd>
1018<p>
Junio C Hamano1c222c52011-05-13 19:55:321019 Compute the dirstat numbers by doing the regular line-based diff
1020 analysis, and summing the removed/added line counts. (For binary
1021 files, count 64-byte chunks instead, since binary files have no
Junio C Hamanoc14e6ad2014-10-31 20:25:531022 natural concept of lines). This is a more expensive <code>--dirstat</code>
1023 behavior than the <code>changes</code> behavior, but it does count rearranged
Junio C Hamano1c222c52011-05-13 19:55:321024 lines within a file as much as other changes. The resulting output
Junio C Hamanoc14e6ad2014-10-31 20:25:531025 is consistent with what you get from the other <code>--*stat</code> options.
Junio C Hamanoa476efa2008-10-10 15:31:421026</p>
1027</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591028<dt class="hdlist1">
Junio C Hamanoc14e6ad2014-10-31 20:25:531029<code>files</code>
Junio C Hamano1c222c52011-05-13 19:55:321030</dt>
1031<dd>
1032<p>
1033 Compute the dirstat numbers by counting the number of files changed.
1034 Each changed file counts equally in the dirstat analysis. This is
Junio C Hamanoc14e6ad2014-10-31 20:25:531035 the computationally cheapest <code>--dirstat</code> behavior, since it does
Junio C Hamano1c222c52011-05-13 19:55:321036 not have to look at the file contents at all.
1037</p>
1038</dd>
1039<dt class="hdlist1">
Junio C Hamanoc14e6ad2014-10-31 20:25:531040<code>cumulative</code>
Junio C Hamano1c222c52011-05-13 19:55:321041</dt>
1042<dd>
1043<p>
1044 Count changes in a child directory for the parent directory as well.
Junio C Hamanoc14e6ad2014-10-31 20:25:531045 Note that when using <code>cumulative</code>, the sum of the percentages
Junio C Hamano1c222c52011-05-13 19:55:321046 reported may exceed 100%. The default (non-cumulative) behavior can
Junio C Hamanoc14e6ad2014-10-31 20:25:531047 be specified with the <code>noncumulative</code> parameter.
Junio C Hamano1c222c52011-05-13 19:55:321048</p>
1049</dd>
1050<dt class="hdlist1">
1051&lt;limit&gt;
1052</dt>
1053<dd>
1054<p>
1055 An integer parameter specifies a cut-off percent (3% by default).
1056 Directories contributing less than this percentage of the changes
1057 are not shown in the output.
1058</p>
1059</dd>
1060</dl></div>
Junio C Hamano9629d4f2012-12-19 00:28:271061</div></div>
Junio C Hamano1c222c52011-05-13 19:55:321062<div class="paragraph"><p>Example: The following will count changed files, while ignoring
1063directories with less than 10% of the total amount of changed files,
1064and accumulating child directory counts in the parent directories:
Junio C Hamanoc14e6ad2014-10-31 20:25:531065<code>--dirstat=files,10,cumulative</code>.</p></div>
Junio C Hamano1c222c52011-05-13 19:55:321066</dd>
1067<dt class="hdlist1">
Junio C Hamano6959c6c2006-05-17 10:34:111068--summary
1069</dt>
1070<dd>
1071<p>
1072 Output a condensed summary of extended header information
1073 such as creations, renames and mode changes.
1074</p>
1075</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591076<dt class="hdlist1">
Junio C Hamanod1308c92006-04-16 11:01:091077--patch-with-stat
1078</dt>
1079<dd>
1080<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:531081 Synonym for <code>-p --stat</code>.
Junio C Hamanod1308c92006-04-16 11:01:091082</p>
1083</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591084<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231085-z
1086</dt>
1087<dd>
1088<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:531089 When <code>--raw</code>, <code>--numstat</code>, <code>--name-only</code> or <code>--name-status</code> has been
Junio C Hamano0c053e82010-04-19 06:46:341090 given, do not munge pathnames and use NULs as output field terminators.
Junio C Hamano1a4e8412005-12-27 08:17:231091</p>
Junio C Hamano0f6f3bf2017-03-13 07:01:531092<div class="paragraph"><p>Without this option, pathnames with "unusual" characters are quoted as
1093explained for the configuration variable <code>core.quotePath</code> (see
1094<a href="git-config.html">git-config(1)</a>).</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231095</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591096<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231097--name-only
1098</dt>
1099<dd>
1100<p>
1101 Show only names of changed files.
1102</p>
1103</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591104<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231105--name-status
1106</dt>
1107<dd>
1108<p>
Junio C Hamanoa9aee782008-04-23 16:09:201109 Show only names and status of changed files. See the description
Junio C Hamanoc14e6ad2014-10-31 20:25:531110 of the <code>--diff-filter</code> option on what the status letters mean.
Junio C Hamano1a4e8412005-12-27 08:17:231111</p>
1112</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591113<dt class="hdlist1">
Junio C Hamanoc21ab052009-10-31 04:03:551114--submodule[=&lt;format&gt;]
1115</dt>
1116<dd>
1117<p>
Junio C Hamanocd451662016-09-13 00:54:091118 Specify how differences in submodules are shown. When specifying
1119 <code>--submodule=short</code> the <em>short</em> format is used. This format just
1120 shows the names of the commits at the beginning and end of the range.
1121 When <code>--submodule</code> or <code>--submodule=log</code> is specified, the <em>log</em>
1122 format is used. This format lists the commits in the range like
1123 <a href="git-submodule.html">git-submodule(1)</a> <code>summary</code> does. When <code>--submodule=diff</code>
1124 is specified, the <em>diff</em> format is used. This format shows an
1125 inline diff of the changes in the submodule contents between the
1126 commit range. Defaults to <code>diff.submodule</code> or the <em>short</em> format
1127 if the config option is unset.
Junio C Hamanoc21ab052009-10-31 04:03:551128</p>
1129</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591130<dt class="hdlist1">
Junio C Hamano4aa0bcc2010-03-03 05:13:121131--color[=&lt;when&gt;]
Junio C Hamano9ae1a062006-07-10 08:12:341132</dt>
1133<dd>
1134<p>
1135 Show colored diff.
Junio C Hamanoc14e6ad2014-10-31 20:25:531136 <code>--color</code> (i.e. without <em>=&lt;when&gt;</em>) is the same as <code>--color=always</code>.
1137 <em>&lt;when&gt;</em> can be one of <code>always</code>, <code>never</code>, or <code>auto</code>.
Junio C Hamano9ae1a062006-07-10 08:12:341138</p>
1139</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591140<dt class="hdlist1">
Junio C Hamano9ae1a062006-07-10 08:12:341141--no-color
1142</dt>
1143<dd>
1144<p>
Junio C Hamano5f2627d2011-05-06 20:23:481145 Turn off colored diff.
Junio C Hamanoc14e6ad2014-10-31 20:25:531146 It is the same as <code>--color=never</code>.
Junio C Hamano9ae1a062006-07-10 08:12:341147</p>
1148</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591149<dt class="hdlist1">
Junio C Hamanofb1fdf12017-08-27 06:14:591150--color-moved[=&lt;mode&gt;]
1151</dt>
1152<dd>
1153<p>
1154 Moved lines of code are colored differently.
1155 The &lt;mode&gt; defaults to <em>no</em> if the option is not given
1156 and to <em>zebra</em> if the option with no mode is given.
1157 The mode must be one of:
1158</p>
1159<div class="openblock">
1160<div class="content">
1161<div class="dlist"><dl>
1162<dt class="hdlist1">
1163no
1164</dt>
1165<dd>
1166<p>
1167 Moved lines are not highlighted.
1168</p>
1169</dd>
1170<dt class="hdlist1">
1171default
1172</dt>
1173<dd>
1174<p>
1175 Is a synonym for <code>zebra</code>. This may change to a more sensible mode
1176 in the future.
1177</p>
1178</dd>
1179<dt class="hdlist1">
1180plain
1181</dt>
1182<dd>
1183<p>
1184 Any line that is added in one location and was removed
1185 in another location will be colored with <em>color.diff.newMoved</em>.
1186 Similarly <em>color.diff.oldMoved</em> will be used for removed lines
1187 that are added somewhere else in the diff. This mode picks up any
1188 moved line, but it is not very useful in a review to determine
1189 if a block of code was moved without permutation.
1190</p>
1191</dd>
1192<dt class="hdlist1">
1193zebra
1194</dt>
1195<dd>
1196<p>
1197 Blocks of moved text of at least 20 alphanumeric characters
1198 are detected greedily. The detected blocks are
1199 painted using either the <em>color.diff.{old,new}Moved</em> color or
1200 <em>color.diff.{old,new}MovedAlternative</em>. The change between
1201 the two colors indicates that a new block was detected.
1202</p>
1203</dd>
1204<dt class="hdlist1">
1205dimmed_zebra
1206</dt>
1207<dd>
1208<p>
1209 Similar to <em>zebra</em>, but additional dimming of uninteresting parts
1210 of moved code is performed. The bordering lines of two adjacent
1211 blocks are considered interesting, the rest is uninteresting.
1212</p>
1213</dd>
1214</dl></div>
1215</div></div>
1216</dd>
1217<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531218--word-diff[=&lt;mode&gt;]
Junio C Hamano85e45fa2006-08-13 07:47:411219</dt>
1220<dd>
1221<p>
Junio C Hamanocc7636a2010-05-21 14:57:531222 Show a word diff, using the &lt;mode&gt; to delimit changed words.
1223 By default, words are delimited by whitespace; see
Junio C Hamanoc14e6ad2014-10-31 20:25:531224 <code>--word-diff-regex</code> below. The &lt;mode&gt; defaults to <em>plain</em>, and
Junio C Hamanocc7636a2010-05-21 14:57:531225 must be one of:
Junio C Hamano85e45fa2006-08-13 07:47:411226</p>
Junio C Hamano9629d4f2012-12-19 00:28:271227<div class="openblock">
1228<div class="content">
Junio C Hamano68cf15a2010-11-06 01:01:591229<div class="dlist"><dl>
1230<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531231color
1232</dt>
1233<dd>
1234<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:531235 Highlight changed words using only colors. Implies <code>--color</code>.
Junio C Hamanocc7636a2010-05-21 14:57:531236</p>
1237</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591238<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531239plain
1240</dt>
1241<dd>
1242<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:531243 Show words as <code>[-removed-]</code> and <code>{+added+}</code>. Makes no
Junio C Hamanocc7636a2010-05-21 14:57:531244 attempts to escape the delimiters if they appear in the input,
1245 so the output may be ambiguous.
1246</p>
1247</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591248<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531249porcelain
1250</dt>
1251<dd>
1252<p>
1253 Use a special line-based format intended for script
1254 consumption. Added/removed/unchanged runs are printed in the
Junio C Hamanoc14e6ad2014-10-31 20:25:531255 usual unified diff format, starting with a <code>+</code>/<code>-</code>/` `
Junio C Hamanocc7636a2010-05-21 14:57:531256 character at the beginning of the line and extending to the
1257 end of the line. Newlines in the input are represented by a
Junio C Hamanoc14e6ad2014-10-31 20:25:531258 tilde <code>~</code> on a line of its own.
Junio C Hamanocc7636a2010-05-21 14:57:531259</p>
1260</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591261<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531262none
1263</dt>
1264<dd>
1265<p>
1266 Disable word diff again.
1267</p>
1268</dd>
1269</dl></div>
Junio C Hamano9629d4f2012-12-19 00:28:271270</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591271<div class="paragraph"><p>Note that despite the name of the first mode, color is used to
Junio C Hamanocc7636a2010-05-21 14:57:531272highlight the changed parts in all modes if enabled.</p></div>
1273</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591274<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531275--word-diff-regex=&lt;regex&gt;
1276</dt>
1277<dd>
1278<p>
1279 Use &lt;regex&gt; to decide what a word is, instead of considering
1280 runs of non-whitespace to be a word. Also implies
Junio C Hamanoc14e6ad2014-10-31 20:25:531281 <code>--word-diff</code> unless it was already enabled.
Junio C Hamanocc7636a2010-05-21 14:57:531282</p>
Junio C Hamano68cf15a2010-11-06 01:01:591283<div class="paragraph"><p>Every non-overlapping match of the
Junio C Hamano20d47e32009-01-26 06:36:021284&lt;regex&gt; is considered a word. Anything between these matches is
1285considered whitespace and ignored(!) for the purposes of finding
Junio C Hamanoc14e6ad2014-10-31 20:25:531286differences. You may want to append <code>|[^[:space:]]</code> to your regular
Junio C Hamano20d47e32009-01-26 06:36:021287expression to make sure that it matches all non-whitespace characters.
1288A match that contains a newline is silently truncated(!) at the
1289newline.</p></div>
Junio C Hamano713eded2015-12-03 00:24:021290<div class="paragraph"><p>For example, <code>--word-diff-regex=.</code> will treat each character as a word
1291and, correspondingly, show differences character by character.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591292<div class="paragraph"><p>The regex can also be set via a diff driver or configuration option, see
Junio C Hamano198b1f12016-05-17 22:27:241293<a href="gitattributes.html">gitattributes(5)</a> or <a href="git-config.html">git-config(1)</a>. Giving it explicitly
Junio C Hamano20d47e32009-01-26 06:36:021294overrides any diff driver or configuration setting. Diff drivers
1295override configuration settings.</p></div>
Junio C Hamano85e45fa2006-08-13 07:47:411296</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591297<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531298--color-words[=&lt;regex&gt;]
1299</dt>
1300<dd>
1301<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:531302 Equivalent to <code>--word-diff=color</code> plus (if a regex was
1303 specified) <code>--word-diff-regex=&lt;regex&gt;</code>.
Junio C Hamanocc7636a2010-05-21 14:57:531304</p>
1305</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591306<dt class="hdlist1">
Junio C Hamano9ae1a062006-07-10 08:12:341307--no-renames
1308</dt>
1309<dd>
1310<p>
1311 Turn off rename detection, even when the configuration
1312 file gives the default to do so.
1313</p>
1314</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591315<dt class="hdlist1">
Junio C Hamanoa890c4f2007-01-28 10:29:211316--check
1317</dt>
1318<dd>
1319<p>
Junio C Hamano84ea1e42016-04-08 21:53:481320 Warn if changes introduce conflict markers or whitespace errors.
1321 What are considered whitespace errors is controlled by <code>core.whitespace</code>
Junio C Hamano6005bfa2011-06-23 00:51:221322 configuration. By default, trailing whitespaces (including
1323 lines that solely consist of whitespaces) and a space character
1324 that is immediately followed by a tab character inside the
1325 initial indent of the line are considered whitespace errors.
1326 Exits with non-zero status if problems are found. Not compatible
1327 with --exit-code.
Junio C Hamanoa890c4f2007-01-28 10:29:211328</p>
1329</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591330<dt class="hdlist1">
Junio C Hamano8c5d5942015-06-11 19:37:481331--ws-error-highlight=&lt;kind&gt;
1332</dt>
1333<dd>
1334<p>
Junio C Hamano4b2a6c12017-08-22 18:32:371335 Highlight whitespace errors in the <code>context</code>, <code>old</code> or <code>new</code>
1336 lines of the diff. Multiple values are separated by comma,
1337 <code>none</code> resets previous values, <code>default</code> reset the list to
1338 <code>new</code> and <code>all</code> is a shorthand for <code>old,new,context</code>. When
1339 this option is not given, and the configuration variable
1340 <code>diff.wsErrorHighlight</code> is not set, only whitespace errors in
1341 <code>new</code> lines are highlighted. The whitespace errors are colored
1342 whith <code>color.diff.whitespace</code>.
Junio C Hamano8c5d5942015-06-11 19:37:481343</p>
1344</dd>
1345<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231346--full-index
1347</dt>
1348<dd>
1349<p>
Junio C Hamano5cf43ca2008-08-20 09:14:141350 Instead of the first handful of characters, show the full
1351 pre- and post-image blob object names on the "index"
1352 line when generating patch format output.
Junio C Hamano1a4e8412005-12-27 08:17:231353</p>
1354</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591355<dt class="hdlist1">
Junio C Hamano9ae1a062006-07-10 08:12:341356--binary
1357</dt>
1358<dd>
1359<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:531360 In addition to <code>--full-index</code>, output a binary diff that
1361 can be applied with <code>git-apply</code>.
Junio C Hamano9ae1a062006-07-10 08:12:341362</p>
1363</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591364<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231365--abbrev[=&lt;n&gt;]
1366</dt>
1367<dd>
1368<p>
1369 Instead of showing the full 40-byte hexadecimal object
1370 name in diff-raw format output and diff-tree header
Junio C Hamano6efe3022009-01-13 16:47:561371 lines, show only a partial prefix. This is
Junio C Hamanoc14e6ad2014-10-31 20:25:531372 independent of the <code>--full-index</code> option above, which controls
Junio C Hamano1a4e8412005-12-27 08:17:231373 the diff-patch output format. Non default number of
Junio C Hamanoc14e6ad2014-10-31 20:25:531374 digits can be specified with <code>--abbrev=&lt;n&gt;</code>.
Junio C Hamano1a4e8412005-12-27 08:17:231375</p>
1376</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591377<dt class="hdlist1">
Junio C Hamanoe85e36f2010-08-10 05:30:141378-B[&lt;n&gt;][/&lt;m&gt;]
Junio C Hamano1a4e8412005-12-27 08:17:231379</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591380<dt class="hdlist1">
Junio C Hamano39c7a692010-10-27 06:08:541381--break-rewrites[=[&lt;n&gt;][/&lt;m&gt;]]
1382</dt>
Junio C Hamano1a4e8412005-12-27 08:17:231383<dd>
1384<p>
Junio C Hamanoe85e36f2010-08-10 05:30:141385 Break complete rewrite changes into pairs of delete and
1386 create. This serves two purposes:
Junio C Hamano1a4e8412005-12-27 08:17:231387</p>
Junio C Hamano68cf15a2010-11-06 01:01:591388<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:141389not as a series of deletion and insertion mixed together with a very
1390few lines that happen to match textually as the context, but as a
1391single deletion of everything old followed by a single insertion of
Junio C Hamanoc14e6ad2014-10-31 20:25:531392everything new, and the number <code>m</code> controls this aspect of the -B
1393option (defaults to 60%). <code>-B/70%</code> specifies that less than 30% of the
Junio C Hamano076ffcc2013-02-06 05:13:211394original should remain in the result for Git to consider it a total
Junio C Hamanoe85e36f2010-08-10 05:30:141395rewrite (i.e. otherwise the resulting patch will be a series of
1396deletion and insertion mixed together with context lines).</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591397<div class="paragraph"><p>When used with -M, a totally-rewritten file is also considered as the
Junio C Hamanoe85e36f2010-08-10 05:30:141398source of a rename (usually -M only considers a file that disappeared
Junio C Hamanoc14e6ad2014-10-31 20:25:531399as the source of a rename), and the number <code>n</code> controls this aspect of
1400the -B option (defaults to 50%). <code>-B20%</code> specifies that a change with
Junio C Hamano68cf15a2010-11-06 01:01:591401addition and deletion compared to 20% or more of the file&#8217;s size are
Junio C Hamanoe85e36f2010-08-10 05:30:141402eligible for being picked up as a possible source of a rename to
1403another file.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231404</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591405<dt class="hdlist1">
Junio C Hamanoe85e36f2010-08-10 05:30:141406-M[&lt;n&gt;]
Junio C Hamano1a4e8412005-12-27 08:17:231407</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591408<dt class="hdlist1">
Junio C Hamano0d75e872010-12-17 06:57:261409--find-renames[=&lt;n&gt;]
Junio C Hamano39c7a692010-10-27 06:08:541410</dt>
Junio C Hamano1a4e8412005-12-27 08:17:231411<dd>
1412<p>
1413 Detect renames.
Junio C Hamanoc14e6ad2014-10-31 20:25:531414 If <code>n</code> is specified, it is a threshold on the similarity
Junio C Hamanoe85e36f2010-08-10 05:30:141415 index (i.e. amount of addition/deletions compared to the
Junio C Hamanoc14e6ad2014-10-31 20:25:531416 file&#8217;s size). For example, <code>-M90%</code> means Git should consider a
Junio C Hamanoe85e36f2010-08-10 05:30:141417 delete/add pair to be a rename if more than 90% of the file
Junio C Hamanoc14e6ad2014-10-31 20:25:531418 hasn&#8217;t changed. Without a <code>%</code> sign, the number is to be read as
1419 a fraction, with a decimal point before it. I.e., <code>-M5</code> becomes
1420 0.5, and is thus the same as <code>-M50%</code>. Similarly, <code>-M05</code> is
1421 the same as <code>-M5%</code>. To limit detection to exact renames, use
1422 <code>-M100%</code>. The default similarity index is 50%.
Junio C Hamano1a4e8412005-12-27 08:17:231423</p>
1424</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591425<dt class="hdlist1">
Junio C Hamanoe85e36f2010-08-10 05:30:141426-C[&lt;n&gt;]
Junio C Hamano1a4e8412005-12-27 08:17:231427</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591428<dt class="hdlist1">
Junio C Hamano0d75e872010-12-17 06:57:261429--find-copies[=&lt;n&gt;]
Junio C Hamano39c7a692010-10-27 06:08:541430</dt>
Junio C Hamano1a4e8412005-12-27 08:17:231431<dd>
1432<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:531433 Detect copies as well as renames. See also <code>--find-copies-harder</code>.
1434 If <code>n</code> is specified, it has the same meaning as for <code>-M&lt;n&gt;</code>.
Junio C Hamano1a4e8412005-12-27 08:17:231435</p>
1436</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591437<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231438--find-copies-harder
1439</dt>
1440<dd>
1441<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:531442 For performance reasons, by default, <code>-C</code> option finds copies only
Junio C Hamano1a4e8412005-12-27 08:17:231443 if the original file of the copy was modified in the same
1444 changeset. This flag makes the command
1445 inspect unmodified files as candidates for the source of
1446 copy. This is a very expensive operation for large
Junio C Hamano16f98872007-06-12 16:09:141447 projects, so use it with caution. Giving more than one
Junio C Hamanoc14e6ad2014-10-31 20:25:531448 <code>-C</code> option has the same effect.
Junio C Hamano1a4e8412005-12-27 08:17:231449</p>
1450</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591451<dt class="hdlist1">
Junio C Hamanob02377c2011-04-28 22:26:021452-D
1453</dt>
1454<dt class="hdlist1">
1455--irreversible-delete
1456</dt>
1457<dd>
1458<p>
1459 Omit the preimage for deletes, i.e. print only the header but not
Junio C Hamanoc14e6ad2014-10-31 20:25:531460 the diff between the preimage and <code>/dev/null</code>. The resulting patch
1461 is not meant to be applied with <code>patch</code> or <code>git apply</code>; this is
Junio C Hamanob02377c2011-04-28 22:26:021462 solely for people who want to just concentrate on reviewing the
Junio C Hamanod16fd1b2017-08-04 16:41:511463 text after the change. In addition, the output obviously lacks
Junio C Hamanob02377c2011-04-28 22:26:021464 enough information to apply such a patch in reverse, even manually,
1465 hence the name of the option.
1466</p>
Junio C Hamanoc14e6ad2014-10-31 20:25:531467<div class="paragraph"><p>When used together with <code>-B</code>, omit also the preimage in the deletion part
Junio C Hamanob02377c2011-04-28 22:26:021468of a delete/create pair.</p></div>
1469</dd>
1470<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231471-l&lt;num&gt;
1472</dt>
1473<dd>
1474<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:531475 The <code>-M</code> and <code>-C</code> options require O(n^2) processing time where n
Junio C Hamano1a4e8412005-12-27 08:17:231476 is the number of potential rename/copy targets. This
1477 option prevents rename/copy detection from running if
1478 the number of rename/copy targets exceeds the specified
1479 number.
1480</p>
1481</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591482<dt class="hdlist1">
Junio C Hamano982eb112010-11-18 00:53:091483--diff-filter=[(A|C|D|M|R|T|U|X|B)&#8230;[*]]
1484</dt>
1485<dd>
1486<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:531487 Select only files that are Added (<code>A</code>), Copied (<code>C</code>),
1488 Deleted (<code>D</code>), Modified (<code>M</code>), Renamed (<code>R</code>), have their
1489 type (i.e. regular file, symlink, submodule, &#8230;) changed (<code>T</code>),
1490 are Unmerged (<code>U</code>), are
1491 Unknown (<code>X</code>), or have had their pairing Broken (<code>B</code>).
Junio C Hamano982eb112010-11-18 00:53:091492 Any combination of the filter characters (including none) can be used.
Junio C Hamanoc14e6ad2014-10-31 20:25:531493 When <code>*</code> (All-or-none) is added to the combination, all
Junio C Hamano982eb112010-11-18 00:53:091494 paths are selected if there is any file that matches
1495 other criteria in the comparison; if there is no file
1496 that matches other criteria, nothing is selected.
1497</p>
Junio C Hamanoeed15af2016-07-25 22:49:421498<div class="paragraph"><p>Also, these upper-case letters can be downcased to exclude. E.g.
1499<code>--diff-filter=ad</code> excludes added and deleted paths.</p></div>
Junio C Hamano3a34f152018-01-09 23:09:381500<div class="paragraph"><p>Note that not all diffs can feature all types. For instance, diffs
1501from the index to the working tree can never have Added entries
1502(because the set of paths included in the diff is limited by what is in
1503the index). Similarly, copied and renamed entries cannot appear if
1504detection for those types is disabled.</p></div>
Junio C Hamano982eb112010-11-18 00:53:091505</dd>
1506<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231507-S&lt;string&gt;
1508</dt>
1509<dd>
1510<p>
Junio C Hamanof1f5a7b2013-06-11 22:23:521511 Look for differences that change the number of occurrences of
1512 the specified string (i.e. addition/deletion) in a file.
1513 Intended for the scripter&#8217;s use.
Junio C Hamano1a4e8412005-12-27 08:17:231514</p>
Junio C Hamanof1f5a7b2013-06-11 22:23:521515<div class="paragraph"><p>It is useful when you&#8217;re looking for an exact block of code (like a
1516struct), and want to know the history of that block since it first
1517came into being: use the feature iteratively to feed the interesting
Junio C Hamanoc14e6ad2014-10-31 20:25:531518block in the preimage back into <code>-S</code>, and keep going until you get the
Junio C Hamanof1f5a7b2013-06-11 22:23:521519very first version of the block.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231520</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591521<dt class="hdlist1">
Junio C Hamano3b4609d2010-09-30 00:04:341522-G&lt;regex&gt;
1523</dt>
1524<dd>
1525<p>
Junio C Hamanof1f5a7b2013-06-11 22:23:521526 Look for differences whose patch text contains added/removed
1527 lines that match &lt;regex&gt;.
Junio C Hamano3b4609d2010-09-30 00:04:341528</p>
Junio C Hamanoc14e6ad2014-10-31 20:25:531529<div class="paragraph"><p>To illustrate the difference between <code>-S&lt;regex&gt; --pickaxe-regex</code> and
1530<code>-G&lt;regex&gt;</code>, consider a commit with the following diff in the same
Junio C Hamanof1f5a7b2013-06-11 22:23:521531file:</p></div>
1532<div class="listingblock">
1533<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531534<pre><code>+ return !regexec(regexp, two-&gt;ptr, 1, &amp;regmatch, 0);
Junio C Hamanof1f5a7b2013-06-11 22:23:521535...
Junio C Hamanoc14e6ad2014-10-31 20:25:531536- hit = !regexec(regexp, mf2.ptr, 1, &amp;regmatch, 0);</code></pre>
Junio C Hamanof1f5a7b2013-06-11 22:23:521537</div></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:531538<div class="paragraph"><p>While <code>git log -G"regexec\(regexp"</code> will show this commit, <code>git log
1539-S"regexec\(regexp" --pickaxe-regex</code> will not (because the number of
Junio C Hamanof1f5a7b2013-06-11 22:23:521540occurrences of that string did not change).</p></div>
1541<div class="paragraph"><p>See the <em>pickaxe</em> entry in <a href="gitdiffcore.html">gitdiffcore(7)</a> for more
1542information.</p></div>
Junio C Hamano3b4609d2010-09-30 00:04:341543</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591544<dt class="hdlist1">
Junio C Hamano7b9cce92018-01-23 22:34:271545--find-object=&lt;object-id&gt;
1546</dt>
1547<dd>
1548<p>
1549 Look for differences that change the number of occurrences of
1550 the specified object. Similar to <code>-S</code>, just the argument is different
1551 in that it doesn&#8217;t search for a specific string but for a specific
1552 object id.
1553</p>
1554<div class="paragraph"><p>The object can be a blob or a submodule commit. It implies the <code>-t</code> option in
1555<code>git-log</code> to also find trees.</p></div>
1556</dd>
1557<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231558--pickaxe-all
1559</dt>
1560<dd>
1561<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:531562 When <code>-S</code> or <code>-G</code> finds a change, show all the changes in that
Junio C Hamano1a4e8412005-12-27 08:17:231563 changeset, not just the files that contain the change
1564 in &lt;string&gt;.
1565</p>
1566</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591567<dt class="hdlist1">
Junio C Hamanobfe9e752006-04-05 21:43:281568--pickaxe-regex
1569</dt>
1570<dd>
1571<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:531572 Treat the &lt;string&gt; given to <code>-S</code> as an extended POSIX regular
Junio C Hamanof1f5a7b2013-06-11 22:23:521573 expression to match.
Junio C Hamanobfe9e752006-04-05 21:43:281574</p>
1575</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591576<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231577-O&lt;orderfile&gt;
1578</dt>
1579<dd>
1580<p>
Junio C Hamanobcd98f42017-01-24 00:12:161581 Control the order in which files appear in the output.
Junio C Hamano322c6242015-03-23 21:32:461582 This overrides the <code>diff.orderFile</code> configuration variable
1583 (see <a href="git-config.html">git-config(1)</a>). To cancel <code>diff.orderFile</code>,
Junio C Hamanoc14e6ad2014-10-31 20:25:531584 use <code>-O/dev/null</code>.
Junio C Hamano1a4e8412005-12-27 08:17:231585</p>
Junio C Hamanobcd98f42017-01-24 00:12:161586<div class="paragraph"><p>The output order is determined by the order of glob patterns in
1587&lt;orderfile&gt;.
1588All files with pathnames that match the first pattern are output
1589first, all files with pathnames that match the second pattern (but not
1590the first) are output next, and so on.
1591All files with pathnames that do not match any pattern are output
1592last, as if there was an implicit match-all pattern at the end of the
1593file.
1594If multiple pathnames have the same rank (they match the same pattern
1595but no earlier patterns), their output order relative to each other is
1596the normal order.</p></div>
1597<div class="paragraph"><p>&lt;orderfile&gt; is parsed as follows:</p></div>
1598<div class="openblock">
1599<div class="content">
1600<div class="ulist"><ul>
1601<li>
1602<p>
1603Blank lines are ignored, so they can be used as separators for
1604 readability.
1605</p>
1606</li>
1607<li>
1608<p>
1609Lines starting with a hash ("<code>#</code>") are ignored, so they can be used
1610 for comments. Add a backslash ("<code>\</code>") to the beginning of the
1611 pattern if it starts with a hash.
1612</p>
1613</li>
1614<li>
1615<p>
1616Each other line contains a single pattern.
1617</p>
1618</li>
1619</ul></div>
1620</div></div>
1621<div class="paragraph"><p>Patterns have the same syntax and semantics as patterns used for
1622fnmantch(3) without the FNM_PATHNAME flag, except a pathname also
1623matches a pattern if removing any number of the final pathname
1624components matches the pattern. For example, the pattern "<code>foo*bar</code>"
1625matches "<code>fooasdfbar</code>" and "<code>foo/bar/baz/asdf</code>" but not "<code>foobarx</code>".</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231626</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591627<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231628-R
1629</dt>
1630<dd>
1631<p>
1632 Swap two inputs; that is, show differences from index or
1633 on-disk file to tree contents.
1634</p>
1635</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591636<dt class="hdlist1">
Junio C Hamano24bc09a2008-02-28 00:27:441637--relative[=&lt;path&gt;]
1638</dt>
1639<dd>
1640<p>
1641 When run from a subdirectory of the project, it can be
1642 told to exclude changes outside the directory and show
1643 pathnames relative to it with this option. When you are
1644 not in a subdirectory (e.g. in a bare repository), you
1645 can name which subdirectory to make the output relative
1646 to by giving a &lt;path&gt; as an argument.
1647</p>
1648</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591649<dt class="hdlist1">
Junio C Hamanobbbb8652008-12-29 10:34:221650-a
1651</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591652<dt class="hdlist1">
Junio C Hamanoc26f5482006-07-09 09:38:141653--text
1654</dt>
1655<dd>
1656<p>
1657 Treat all files as text.
1658</p>
1659</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591660<dt class="hdlist1">
Junio C Hamano4886c772017-11-27 03:33:281661--ignore-cr-at-eol
1662</dt>
1663<dd>
1664<p>
1665 Ignore carrige-return at the end of line when doing a comparison.
1666</p>
1667</dd>
1668<dt class="hdlist1">
Junio C Hamanofd468962007-02-14 23:45:041669--ignore-space-at-eol
1670</dt>
1671<dd>
1672<p>
Junio C Hamano3a702342007-12-12 21:34:021673 Ignore changes in whitespace at EOL.
Junio C Hamanofd468962007-02-14 23:45:041674</p>
1675</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591676<dt class="hdlist1">
Junio C Hamanobbbb8652008-12-29 10:34:221677-b
1678</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591679<dt class="hdlist1">
Junio C Hamanod9c2d2f2006-12-06 08:59:071680--ignore-space-change
1681</dt>
1682<dd>
1683<p>
Junio C Hamano3a702342007-12-12 21:34:021684 Ignore changes in amount of whitespace. This ignores whitespace
1685 at line end, and considers all other sequences of one or
1686 more whitespace characters to be equivalent.
Junio C Hamanod9c2d2f2006-12-06 08:59:071687</p>
1688</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591689<dt class="hdlist1">
Junio C Hamanobbbb8652008-12-29 10:34:221690-w
Junio C Hamanod9c2d2f2006-12-06 08:59:071691</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591692<dt class="hdlist1">
Junio C Hamanod9c2d2f2006-12-06 08:59:071693--ignore-all-space
1694</dt>
1695<dd>
1696<p>
Junio C Hamano3a702342007-12-12 21:34:021697 Ignore whitespace when comparing lines. This ignores
1698 differences even if one line has whitespace where the other
Junio C Hamanod9c2d2f2006-12-06 08:59:071699 line has none.
1700</p>
1701</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591702<dt class="hdlist1">
Junio C Hamanoa1952302013-07-01 21:31:181703--ignore-blank-lines
1704</dt>
1705<dd>
1706<p>
1707 Ignore changes whose lines are all blank.
1708</p>
1709</dd>
1710<dt class="hdlist1">
Junio C Hamano1d40ee82009-01-07 10:14:161711--inter-hunk-context=&lt;lines&gt;
1712</dt>
1713<dd>
1714<p>
1715 Show the context between diff hunks, up to the specified number
1716 of lines, thereby fusing hunks that are close to each other.
Junio C Hamanobcd98f42017-01-24 00:12:161717 Defaults to <code>diff.interHunkContext</code> or 0 if the config option
1718 is unset.
Junio C Hamano1d40ee82009-01-07 10:14:161719</p>
1720</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591721<dt class="hdlist1">
Junio C Hamano11821ed2011-10-19 18:42:091722-W
1723</dt>
1724<dt class="hdlist1">
1725--function-context
1726</dt>
1727<dd>
1728<p>
1729 Show whole surrounding functions of changes.
1730</p>
1731</dd>
1732<dt class="hdlist1">
Junio C Hamano48fd2f62007-03-19 02:02:301733--exit-code
1734</dt>
1735<dd>
1736<p>
1737 Make the program exit with codes similar to diff(1).
1738 That is, it exits with 1 if there were differences and
1739 0 means no differences.
1740</p>
1741</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591742<dt class="hdlist1">
Junio C Hamano35e57552007-03-25 07:54:351743--quiet
1744</dt>
1745<dd>
1746<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:531747 Disable all output of the program. Implies <code>--exit-code</code>.
Junio C Hamano35e57552007-03-25 07:54:351748</p>
1749</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591750<dt class="hdlist1">
Junio C Hamanobb0f4042007-07-04 06:41:401751--ext-diff
1752</dt>
1753<dd>
1754<p>
1755 Allow an external diff helper to be executed. If you set an
Junio C Hamanoa28a9202012-06-21 07:08:231756 external diff driver with <a href="gitattributes.html">gitattributes(5)</a>, you need
1757 to use this option with <a href="git-log.html">git-log(1)</a> and friends.
Junio C Hamanobb0f4042007-07-04 06:41:401758</p>
1759</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591760<dt class="hdlist1">
Junio C Hamanobb0f4042007-07-04 06:41:401761--no-ext-diff
1762</dt>
1763<dd>
1764<p>
1765 Disallow external diff drivers.
1766</p>
1767</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591768<dt class="hdlist1">
Junio C Hamanoc652aed2011-07-07 01:14:311769--textconv
1770</dt>
1771<dt class="hdlist1">
1772--no-textconv
1773</dt>
1774<dd>
1775<p>
1776 Allow (or disallow) external text conversion filters to be run
Junio C Hamanoa28a9202012-06-21 07:08:231777 when comparing binary files. See <a href="gitattributes.html">gitattributes(5)</a> for
Junio C Hamanoc652aed2011-07-07 01:14:311778 details. Because textconv filters are typically a one-way
1779 conversion, the resulting diff is suitable for human
1780 consumption, but cannot be applied. For this reason, textconv
Junio C Hamanoa28a9202012-06-21 07:08:231781 filters are enabled by default only for <a href="git-diff.html">git-diff(1)</a> and
1782 <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:311783 diff plumbing commands.
1784</p>
1785</dd>
1786<dt class="hdlist1">
Junio C Hamano7d449522010-07-01 00:08:511787--ignore-submodules[=&lt;when&gt;]
Junio C Hamanodfccbb02008-05-26 01:16:141788</dt>
1789<dd>
1790<p>
Junio C Hamano7d449522010-07-01 00:08:511791 Ignore changes to submodules in the diff generation. &lt;when&gt; can be
Junio C Hamanoc7102962013-05-29 23:57:171792 either "none", "untracked", "dirty" or "all", which is the default.
Junio C Hamano619596a2010-08-18 22:15:351793 Using "none" will consider the submodule modified when it either contains
1794 untracked or modified files or its HEAD differs from the commit recorded
1795 in the superproject and can be used to override any settings of the
Junio C Hamanoa28a9202012-06-21 07:08:231796 <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:511797 "untracked" is used submodules are not considered dirty when they only
1798 contain untracked content (but they are still scanned for modified
1799 content). Using "dirty" ignores all changes to the work tree of submodules,
1800 only changes to the commits stored in the superproject are shown (this was
1801 the behavior until 1.7.0). Using "all" hides all changes to submodules.
Junio C Hamanodfccbb02008-05-26 01:16:141802</p>
1803</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591804<dt class="hdlist1">
Junio C Hamanoe27cbd22007-12-21 17:57:331805--src-prefix=&lt;prefix&gt;
1806</dt>
1807<dd>
1808<p>
1809 Show the given source prefix instead of "a/".
1810</p>
1811</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591812<dt class="hdlist1">
Junio C Hamanoe27cbd22007-12-21 17:57:331813--dst-prefix=&lt;prefix&gt;
1814</dt>
1815<dd>
1816<p>
1817 Show the given destination prefix instead of "b/".
1818</p>
1819</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591820<dt class="hdlist1">
Junio C Hamanoe27cbd22007-12-21 17:57:331821--no-prefix
1822</dt>
1823<dd>
1824<p>
1825 Do not show any source or destination prefix.
1826</p>
1827</dd>
Junio C Hamanocd451662016-09-13 00:54:091828<dt class="hdlist1">
1829--line-prefix=&lt;prefix&gt;
1830</dt>
1831<dd>
1832<p>
1833 Prepend an additional prefix to every line of output.
1834</p>
1835</dd>
Junio C Hamanof7017f12016-10-27 23:31:341836<dt class="hdlist1">
1837--ita-invisible-in-index
1838</dt>
1839<dd>
1840<p>
1841 By default entries added by "git add -N" appear as an existing
1842 empty file in "git diff" and a new file in "git diff --cached".
1843 This option makes the entry appear as a new file in "git diff"
1844 and non-existent in "git diff --cached". This option could be
1845 reverted with <code>--ita-visible-in-index</code>. Both options are
1846 experimental and could be removed in future.
1847</p>
1848</dd>
Junio C Hamanoba4b9282008-07-06 05:20:311849</dl></div>
Junio C Hamano68cf15a2010-11-06 01:01:591850<div class="paragraph"><p>For more detailed explanation on these common options, see also
Junio C Hamanoa28a9202012-06-21 07:08:231851<a href="gitdiffcore.html">gitdiffcore(7)</a>.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591852<div class="dlist"><dl>
1853<dt class="hdlist1">
Junio C Hamanobd53dbf2009-01-18 18:26:371854-1 --base
1855</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591856<dt class="hdlist1">
Junio C Hamanobd53dbf2009-01-18 18:26:371857-2 --ours
1858</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591859<dt class="hdlist1">
Junio C Hamanobd53dbf2009-01-18 18:26:371860-3 --theirs
1861</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591862<dt class="hdlist1">
Junio C Hamanobd53dbf2009-01-18 18:26:371863-0
Junio C Hamano1a4e8412005-12-27 08:17:231864</dt>
1865<dd>
1866<p>
1867 Diff against the "base" version, "our branch" or "their
1868 branch" respectively. With these options, diffs for
1869 merged entries are not shown.
1870</p>
Junio C Hamano68cf15a2010-11-06 01:01:591871<div class="paragraph"><p>The default is to diff against our branch (-2) and the
Junio C Hamano1a4e8412005-12-27 08:17:231872cleanly resolved paths. The option -0 can be given to
Junio C Hamanoba4b9282008-07-06 05:20:311873omit diff output for unmerged entries and just show "Unmerged".</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231874</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591875<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471876-c
1877</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591878<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471879--cc
Junio C Hamanofb56a962006-01-28 10:38:191880</dt>
1881<dd>
1882<p>
1883 This compares stage 2 (our branch), stage 3 (their
1884 branch) and the working tree file and outputs a combined
1885 diff, similar to the way <em>diff-tree</em> shows a merge
1886 commit with these flags.
1887</p>
1888</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591889<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231890-q
1891</dt>
1892<dd>
1893<p>
Junio C Hamano51c2ab02006-07-09 20:38:541894 Remain silent even on nonexistent files
Junio C Hamano1a4e8412005-12-27 08:17:231895</p>
1896</dd>
Junio C Hamanoba4b9282008-07-06 05:20:311897</dl></div>
Junio C Hamano1a4e8412005-12-27 08:17:231898</div>
Junio C Hamano9629d4f2012-12-19 00:28:271899</div>
1900<div class="sect1">
Junio C Hamano543f8d62009-07-29 08:35:211901<h2 id="_raw_output_format">Raw output format</h2>
Junio C Hamano1a4e8412005-12-27 08:17:231902<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:591903<div class="paragraph"><p>The raw output format from "git-diff-index", "git-diff-tree",
Junio C Hamanoba4b9282008-07-06 05:20:311904"git-diff-files" and "git diff --raw" are very similar.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591905<div class="paragraph"><p>These commands all compare two sets of things; what is
Junio C Hamanoba4b9282008-07-06 05:20:311906compared differs:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591907<div class="dlist"><dl>
1908<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231909git-diff-index &lt;tree-ish&gt;
1910</dt>
1911<dd>
1912<p>
1913 compares the &lt;tree-ish&gt; and the files on the filesystem.
1914</p>
1915</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591916<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231917git-diff-index --cached &lt;tree-ish&gt;
1918</dt>
1919<dd>
1920<p>
1921 compares the &lt;tree-ish&gt; and the index.
1922</p>
1923</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591924<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231925git-diff-tree [-r] &lt;tree-ish-1&gt; &lt;tree-ish-2&gt; [&lt;pattern&gt;&#8230;]
1926</dt>
1927<dd>
1928<p>
1929 compares the trees named by the two arguments.
1930</p>
1931</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591932<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231933git-diff-files [&lt;pattern&gt;&#8230;]
1934</dt>
1935<dd>
1936<p>
1937 compares the index and the files on the filesystem.
1938</p>
1939</dd>
Junio C Hamanoba4b9282008-07-06 05:20:311940</dl></div>
Junio C Hamano68cf15a2010-11-06 01:01:591941<div class="paragraph"><p>The "git-diff-tree" command begins its output by printing the hash of
Junio C Hamano543f8d62009-07-29 08:35:211942what is being compared. After that, all the commands print one output
1943line per changed file.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591944<div class="paragraph"><p>An output line is formatted this way:</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231945<div class="listingblock">
1946<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531947<pre><code>in-place edit :100644 100644 bcd1234... 0123456... M file0
Junio C Hamano1a4e8412005-12-27 08:17:231948copy-edit :100644 100644 abcd123... 1234567... C68 file1 file2
1949rename-edit :100644 100644 abcd123... 1234567... R86 file1 file3
1950create :000000 100644 0000000... 1234567... A file4
1951delete :100644 000000 1234567... 0000000... D file5
Junio C Hamanoc14e6ad2014-10-31 20:25:531952unmerged :000000 000000 0000000... 0000000... U file6</code></pre>
Junio C Hamano1a4e8412005-12-27 08:17:231953</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591954<div class="paragraph"><p>That is, from the left to the right:</p></div>
1955<div class="olist arabic"><ol class="arabic">
Junio C Hamano1a4e8412005-12-27 08:17:231956<li>
1957<p>
1958a colon.
1959</p>
1960</li>
1961<li>
1962<p>
1963mode for "src"; 000000 if creation or unmerged.
1964</p>
1965</li>
1966<li>
1967<p>
1968a space.
1969</p>
1970</li>
1971<li>
1972<p>
1973mode for "dst"; 000000 if deletion or unmerged.
1974</p>
1975</li>
1976<li>
1977<p>
1978a space.
1979</p>
1980</li>
1981<li>
1982<p>
1983sha1 for "src"; 0{40} if creation or unmerged.
1984</p>
1985</li>
1986<li>
1987<p>
1988a space.
1989</p>
1990</li>
1991<li>
1992<p>
1993sha1 for "dst"; 0{40} if creation, unmerged or "look at work tree".
1994</p>
1995</li>
1996<li>
1997<p>
1998a space.
1999</p>
2000</li>
2001<li>
2002<p>
2003status, followed by optional "score" number.
2004</p>
2005</li>
2006<li>
2007<p>
Junio C Hamano92d80372016-07-13 22:00:052008a tab or a NUL when <code>-z</code> option is used.
Junio C Hamano1a4e8412005-12-27 08:17:232009</p>
2010</li>
2011<li>
2012<p>
2013path for "src"
2014</p>
2015</li>
2016<li>
2017<p>
Junio C Hamano92d80372016-07-13 22:00:052018a tab or a NUL when <code>-z</code> option is used; only exists for C or R.
Junio C Hamano1a4e8412005-12-27 08:17:232019</p>
2020</li>
2021<li>
2022<p>
2023path for "dst"; only exists for C or R.
2024</p>
2025</li>
2026<li>
2027<p>
Junio C Hamano92d80372016-07-13 22:00:052028an LF or a NUL when <code>-z</code> option is used, to terminate the record.
Junio C Hamano1a4e8412005-12-27 08:17:232029</p>
2030</li>
Junio C Hamanoba4b9282008-07-06 05:20:312031</ol></div>
Junio C Hamano68cf15a2010-11-06 01:01:592032<div class="paragraph"><p>Possible status letters are:</p></div>
2033<div class="ulist"><ul>
Junio C Hamanoaa17c7c2008-11-03 04:36:582034<li>
2035<p>
2036A: addition of a file
2037</p>
2038</li>
2039<li>
2040<p>
2041C: copy of a file into a new one
2042</p>
2043</li>
2044<li>
2045<p>
2046D: deletion of a file
2047</p>
2048</li>
2049<li>
2050<p>
2051M: modification of the contents or mode of a file
2052</p>
2053</li>
2054<li>
2055<p>
2056R: renaming of a file
2057</p>
2058</li>
2059<li>
2060<p>
2061T: change in the type of the file
2062</p>
2063</li>
2064<li>
2065<p>
2066U: file is unmerged (you must complete the merge before it can
2067be committed)
2068</p>
2069</li>
2070<li>
2071<p>
2072X: "unknown" change type (most probably a bug, please report it)
2073</p>
2074</li>
2075</ul></div>
Junio C Hamano68cf15a2010-11-06 01:01:592076<div class="paragraph"><p>Status letters C and R are always followed by a score (denoting the
Junio C Hamanoaa17c7c2008-11-03 04:36:582077percentage of similarity between the source and target of the move or
Junio C Hamano6bb32e62015-02-17 22:11:262078copy). Status letter M may be followed by a score (denoting the
2079percentage of dissimilarity) for file rewrites.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592080<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:312081and it is out of sync with the index.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592082<div class="paragraph"><p>Example:</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232083<div class="listingblock">
2084<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:532085<pre><code>:100644 100644 5be4a4...... 000000...... M file.c</code></pre>
Junio C Hamano1a4e8412005-12-27 08:17:232086</div></div>
Junio C Hamano0f6f3bf2017-03-13 07:01:532087<div class="paragraph"><p>Without the <code>-z</code> option, pathnames with "unusual" characters are
2088quoted as explained for the configuration variable <code>core.quotePath</code>
2089(see <a href="git-config.html">git-config(1)</a>). Using <code>-z</code> the filename is output
2090verbatim and the line is terminated by a NUL byte.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232091</div>
Junio C Hamano9629d4f2012-12-19 00:28:272092</div>
2093<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:312094<h2 id="_diff_format_for_merges">diff format for merges</h2>
Junio C Hamano67fad6d2007-05-06 08:53:122095<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:592096<div class="paragraph"><p>"git-diff-tree", "git-diff-files" and "git-diff --raw"
Junio C Hamano92d80372016-07-13 22:00:052097can take <code>-c</code> or <code>--cc</code> option
Junio C Hamano67fad6d2007-05-06 08:53:122098to generate diff output also for merge commits. The output differs
Junio C Hamanoba4b9282008-07-06 05:20:312099from the format described above in the following way:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592100<div class="olist arabic"><ol class="arabic">
Junio C Hamano67fad6d2007-05-06 08:53:122101<li>
2102<p>
2103there is a colon for each parent
2104</p>
2105</li>
2106<li>
2107<p>
2108there are more "src" modes and "src" sha1
2109</p>
2110</li>
2111<li>
2112<p>
2113status is concatenated status characters for each parent
2114</p>
2115</li>
2116<li>
2117<p>
2118no optional "score" number
2119</p>
2120</li>
2121<li>
2122<p>
2123single path, only for "dst"
2124</p>
2125</li>
Junio C Hamanoba4b9282008-07-06 05:20:312126</ol></div>
Junio C Hamano68cf15a2010-11-06 01:01:592127<div class="paragraph"><p>Example:</p></div>
Junio C Hamano67fad6d2007-05-06 08:53:122128<div class="listingblock">
2129<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:532130<pre><code>::100644 100644 100644 fabadb8... cc95eb0... 4866510... MM describe.c</code></pre>
Junio C Hamano67fad6d2007-05-06 08:53:122131</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592132<div class="paragraph"><p>Note that <em>combined diff</em> lists only files which were modified from
Junio C Hamanoba4b9282008-07-06 05:20:312133all parents.</p></div>
Junio C Hamano67fad6d2007-05-06 08:53:122134</div>
Junio C Hamano9629d4f2012-12-19 00:28:272135</div>
2136<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:312137<h2 id="_generating_patches_with_p">Generating patches with -p</h2>
Junio C Hamano1a4e8412005-12-27 08:17:232138<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:592139<div class="paragraph"><p>When "git-diff-index", "git-diff-tree", or "git-diff-files" are run
Junio C Hamano92d80372016-07-13 22:00:052140with a <code>-p</code> option, "git diff" without the <code>--raw</code> option, or
Junio C Hamano00b8b632007-12-07 09:50:492141"git log" with the "-p" option, they
Junio C Hamano7ae0ab22007-11-03 02:46:462142do not produce the output described above; instead they produce a
2143patch file. You can customize the creation of such patches via the
Junio C Hamano042f2142016-06-27 18:05:052144<code>GIT_EXTERNAL_DIFF</code> and the <code>GIT_DIFF_OPTS</code> environment variables.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592145<div class="paragraph"><p>What the -p option produces is slightly different from the traditional
Junio C Hamano7f9fa862010-10-19 23:51:142146diff format:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592147<div class="olist arabic"><ol class="arabic">
Junio C Hamano1a4e8412005-12-27 08:17:232148<li>
2149<p>
Junio C Hamano7f9fa862010-10-19 23:51:142150It is preceded with a "git diff" header that looks like this:
Junio C Hamano1a4e8412005-12-27 08:17:232151</p>
2152<div class="literalblock">
2153<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:532154<pre><code>diff --git a/file1 b/file2</code></pre>
Junio C Hamano1a4e8412005-12-27 08:17:232155</div></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:532156<div class="paragraph"><p>The <code>a/</code> and <code>b/</code> filenames are the same unless rename/copy is
Junio C Hamano1a4e8412005-12-27 08:17:232157involved. Especially, even for a creation or a deletion,
Junio C Hamanoc14e6ad2014-10-31 20:25:532158<code>/dev/null</code> is <em>not</em> used in place of the <code>a/</code> or <code>b/</code> filenames.</p></div>
2159<div class="paragraph"><p>When rename/copy is involved, <code>file1</code> and <code>file2</code> show the
Junio C Hamano1a4e8412005-12-27 08:17:232160name of the source file of the rename/copy and the name of
Junio C Hamanoba4b9282008-07-06 05:20:312161the file that rename/copy produces, respectively.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232162</li>
2163<li>
2164<p>
2165It is followed by one or more extended header lines:
2166</p>
2167<div class="literalblock">
2168<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:532169<pre><code>old mode &lt;mode&gt;
Junio C Hamano1a4e8412005-12-27 08:17:232170new mode &lt;mode&gt;
2171deleted file mode &lt;mode&gt;
2172new file mode &lt;mode&gt;
2173copy from &lt;path&gt;
2174copy to &lt;path&gt;
2175rename from &lt;path&gt;
2176rename to &lt;path&gt;
2177similarity index &lt;number&gt;
2178dissimilarity index &lt;number&gt;
Junio C Hamanoc14e6ad2014-10-31 20:25:532179index &lt;hash&gt;..&lt;hash&gt; &lt;mode&gt;</code></pre>
Junio C Hamano1a4e8412005-12-27 08:17:232180</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592181<div class="paragraph"><p>File modes are printed as 6-digit octal numbers including the file type
Junio C Hamano7f9fa862010-10-19 23:51:142182and file permission bits.</p></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:532183<div class="paragraph"><p>Path names in extended headers do not include the <code>a/</code> and <code>b/</code> prefixes.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592184<div class="paragraph"><p>The similarity index is the percentage of unchanged lines, and
Junio C Hamano7f9fa862010-10-19 23:51:142185the dissimilarity index is the percentage of changed lines. It
2186is a rounded down integer, followed by a percent sign. The
2187similarity index value of 100% is thus reserved for two equal
2188files, while 100% dissimilarity means that no line from the old
2189file made it into the new one.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592190<div class="paragraph"><p>The index line includes the SHA-1 checksum before and after the change.
Junio C Hamano7f9fa862010-10-19 23:51:142191The &lt;mode&gt; is included if the file mode does not change; otherwise,
2192separate lines indicate the old and the new mode.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232193</li>
2194<li>
2195<p>
Junio C Hamano0f6f3bf2017-03-13 07:01:532196Pathnames with "unusual" characters are quoted as explained for
2197 the configuration variable <code>core.quotePath</code> (see
2198 <a href="git-config.html">git-config(1)</a>).
Junio C Hamano1a4e8412005-12-27 08:17:232199</p>
2200</li>
Junio C Hamano7f9fa862010-10-19 23:51:142201<li>
2202<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:532203All the <code>file1</code> files in the output refer to files before the
2204 commit, and all the <code>file2</code> files refer to files after the commit.
Junio C Hamano7f9fa862010-10-19 23:51:142205 It is incorrect to apply each change to each file sequentially. For
2206 example, this patch will swap a and b:
2207</p>
2208<div class="literalblock">
2209<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:532210<pre><code>diff --git a/a b/b
Junio C Hamano7f9fa862010-10-19 23:51:142211rename from a
2212rename to b
2213diff --git a/b b/a
2214rename from b
Junio C Hamanoc14e6ad2014-10-31 20:25:532215rename to a</code></pre>
Junio C Hamano7f9fa862010-10-19 23:51:142216</div></div>
2217</li>
Junio C Hamanoba4b9282008-07-06 05:20:312218</ol></div>
Junio C Hamano1a4e8412005-12-27 08:17:232219</div>
Junio C Hamano9629d4f2012-12-19 00:28:272220</div>
2221<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:312222<h2 id="_combined_diff_format">combined diff format</h2>
Junio C Hamanofb56a962006-01-28 10:38:192223<div class="sectionbody">
Junio C Hamano1dbca522015-05-22 20:48:552224<div class="paragraph"><p>Any diff-generating command can take the <code>-c</code> or <code>--cc</code> option to
Junio C Hamanoc5be4cc2011-03-09 07:20:432225produce a <em>combined diff</em> when showing a merge. This is the default
Junio C Hamanoa28a9202012-06-21 07:08:232226format when showing merges with <a href="git-diff.html">git-diff(1)</a> or
Junio C Hamano1dbca522015-05-22 20:48:552227<a href="git-show.html">git-show(1)</a>. Note also that you can give the <code>-m</code> option to any
Junio C Hamanoc5be4cc2011-03-09 07:20:432228of these commands to force generation of diffs with individual parents
2229of a merge.</p></div>
2230<div class="paragraph"><p>A <em>combined diff</em> format looks like this:</p></div>
Junio C Hamanofb56a962006-01-28 10:38:192231<div class="listingblock">
2232<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:532233<pre><code>diff --combined describe.c
Junio C Hamano29f14312006-10-26 08:47:292234index fabadb8,cc95eb0..4866510
2235--- a/describe.c
2236+++ b/describe.c
2237@@@ -98,20 -98,12 +98,20 @@@
2238 return (a_date &gt; b_date) ? -1 : (a_date == b_date) ? 0 : 1;
Junio C Hamanofb56a962006-01-28 10:38:192239 }
2240
2241- static void describe(char *arg)
2242 -static void describe(struct commit *cmit, int last_one)
2243++static void describe(char *arg, int last_one)
2244 {
Junio C Hamano29f14312006-10-26 08:47:292245 + unsigned char sha1[20];
2246 + struct commit *cmit;
2247 struct commit_list *list;
2248 static int initialized = 0;
2249 struct commit_name *n;
2250
2251 + if (get_sha1(arg, sha1) &lt; 0)
2252 + usage(describe_usage);
2253 + cmit = lookup_commit_reference(sha1);
2254 + if (!cmit)
2255 + usage(describe_usage);
2256 +
2257 if (!initialized) {
2258 initialized = 1;
Junio C Hamanoc14e6ad2014-10-31 20:25:532259 for_each_ref(get_name);</code></pre>
Junio C Hamanofb56a962006-01-28 10:38:192260</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592261<div class="olist arabic"><ol class="arabic">
Junio C Hamano29f14312006-10-26 08:47:292262<li>
2263<p>
2264It is preceded with a "git diff" header, that looks like
Junio C Hamano92d80372016-07-13 22:00:052265 this (when <code>-c</code> option is used):
Junio C Hamano29f14312006-10-26 08:47:292266</p>
2267<div class="literalblock">
2268<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:532269<pre><code>diff --combined file</code></pre>
Junio C Hamano29f14312006-10-26 08:47:292270</div></div>
Junio C Hamano92d80372016-07-13 22:00:052271<div class="paragraph"><p>or like this (when <code>--cc</code> option is used):</p></div>
Junio C Hamano29f14312006-10-26 08:47:292272<div class="literalblock">
2273<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:532274<pre><code>diff --cc file</code></pre>
Junio C Hamano29f14312006-10-26 08:47:292275</div></div>
2276</li>
2277<li>
2278<p>
2279It is followed by one or more extended header lines
2280 (this example shows a merge with two parents):
2281</p>
2282<div class="literalblock">
2283<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:532284<pre><code>index &lt;hash&gt;,&lt;hash&gt;..&lt;hash&gt;
Junio C Hamano29f14312006-10-26 08:47:292285mode &lt;mode&gt;,&lt;mode&gt;..&lt;mode&gt;
2286new file mode &lt;mode&gt;
Junio C Hamanoc14e6ad2014-10-31 20:25:532287deleted file mode &lt;mode&gt;,&lt;mode&gt;</code></pre>
Junio C Hamano29f14312006-10-26 08:47:292288</div></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:532289<div class="paragraph"><p>The <code>mode &lt;mode&gt;,&lt;mode&gt;..&lt;mode&gt;</code> line appears only if at least one of
Junio C Hamanoee1e4282007-02-04 08:32:042290the &lt;mode&gt; is different from the rest. Extended headers with
Junio C Hamano29f14312006-10-26 08:47:292291information about detected contents movement (renames and
2292copying detection) are designed to work with diff of two
Junio C Hamanoba4b9282008-07-06 05:20:312293&lt;tree-ish&gt; and are not used by combined diff format.</p></div>
Junio C Hamano29f14312006-10-26 08:47:292294</li>
2295<li>
2296<p>
2297It is followed by two-line from-file/to-file header
2298</p>
2299<div class="literalblock">
2300<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:532301<pre><code>--- a/file
2302+++ b/file</code></pre>
Junio C Hamano29f14312006-10-26 08:47:292303</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592304<div class="paragraph"><p>Similar to two-line header for traditional <em>unified</em> diff
Junio C Hamanoc14e6ad2014-10-31 20:25:532305format, <code>/dev/null</code> is used to signal created or deleted
Junio C Hamanoba4b9282008-07-06 05:20:312306files.</p></div>
Junio C Hamano29f14312006-10-26 08:47:292307</li>
2308<li>
2309<p>
2310Chunk header format is modified to prevent people from
Junio C Hamanoc14e6ad2014-10-31 20:25:532311 accidentally feeding it to <code>patch -p1</code>. Combined diff format
Junio C Hamano29f14312006-10-26 08:47:292312 was created for review of merge commit changes, and was not
2313 meant for apply. The change is similar to the change in the
2314 extended <em>index</em> header:
2315</p>
2316<div class="literalblock">
2317<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:532318<pre><code>@@@ &lt;from-file-range&gt; &lt;from-file-range&gt; &lt;to-file-range&gt; @@@</code></pre>
Junio C Hamano29f14312006-10-26 08:47:292319</div></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:532320<div class="paragraph"><p>There are (number of parents + 1) <code>@</code> characters in the chunk
Junio C Hamanoba4b9282008-07-06 05:20:312321header for combined diff format.</p></div>
Junio C Hamano29f14312006-10-26 08:47:292322</li>
Junio C Hamanoba4b9282008-07-06 05:20:312323</ol></div>
Junio C Hamano68cf15a2010-11-06 01:01:592324<div class="paragraph"><p>Unlike the traditional <em>unified</em> diff format, which shows two
Junio C Hamanoc14e6ad2014-10-31 20:25:532325files A and B with a single column that has <code>-</code> (minus&#8201;&#8212;&#8201;appears in A but removed in B), <code>+</code> (plus&#8201;&#8212;&#8201;missing in A but
2326added to B), or <code>" "</code> (space&#8201;&#8212;&#8201;unchanged) prefix, this format
Junio C Hamanofb56a962006-01-28 10:38:192327compares two or more files file1, file2,&#8230; with one file X, and
2328shows how X differs from each of fileN. One column for each of
Junio C Hamano68cf15a2010-11-06 01:01:592329fileN is prepended to the output line to note how X&#8217;s line is
Junio C Hamanoba4b9282008-07-06 05:20:312330different from it.</p></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:532331<div class="paragraph"><p>A <code>-</code> character in the column N means that the line appears in
2332fileN but it does not appear in the result. A <code>+</code> character
Junio C Hamano54bf1e22008-12-20 06:30:112333in the column N means that the line appears in the result,
Junio C Hamano29f14312006-10-26 08:47:292334and fileN does not have that line (in other words, the line was
Junio C Hamanoba4b9282008-07-06 05:20:312335added, from the point of view of that parent).</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592336<div class="paragraph"><p>In the above example output, the function signature was changed
Junio C Hamanoc14e6ad2014-10-31 20:25:532337from both files (hence two <code>-</code> removals from both file1 and
2338file2, plus <code>++</code> to mean one line that was added does not appear
Junio C Hamanod75148a2014-04-08 19:48:382339in either file1 or file2). Also eight other lines are the same
Junio C Hamanoc14e6ad2014-10-31 20:25:532340from file1 but do not appear in file2 (hence prefixed with <code>+</code>).</p></div>
2341<div class="paragraph"><p>When shown by <code>git diff-tree -c</code>, it compares the parents of a
Junio C Hamanofb56a962006-01-28 10:38:192342merge commit with the merge result (i.e. file1..fileN are the
Junio C Hamanoc14e6ad2014-10-31 20:25:532343parents). When shown by <code>git diff-files -c</code>, it compares the
Junio C Hamanofb56a962006-01-28 10:38:192344two unresolved merge parents with the working tree file
2345(i.e. file1 is stage 2 aka "our version", file2 is stage 3 aka
Junio C Hamanoba4b9282008-07-06 05:20:312346"their version").</p></div>
Junio C Hamanofb56a962006-01-28 10:38:192347</div>
Junio C Hamano9629d4f2012-12-19 00:28:272348</div>
2349<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:312350<h2 id="_other_diff_formats">other diff formats</h2>
Junio C Hamano3a702342007-12-12 21:34:022351<div class="sectionbody">
Junio C Hamanoc14e6ad2014-10-31 20:25:532352<div class="paragraph"><p>The <code>--summary</code> option describes newly added, deleted, renamed and
2353copied files. The <code>--stat</code> option adds diffstat(1) graph to the
Junio C Hamano3a702342007-12-12 21:34:022354output. These options can be combined with other options, such as
Junio C Hamanoc14e6ad2014-10-31 20:25:532355<code>-p</code>, and are meant for human consumption.</p></div>
2356<div class="paragraph"><p>When showing a change that involves a rename or a copy, <code>--stat</code> output
Junio C Hamano3a702342007-12-12 21:34:022357formats the pathnames compactly by combining common prefix and suffix of
Junio C Hamanoc14e6ad2014-10-31 20:25:532358the pathnames. For example, a change that moves <code>arch/i386/Makefile</code> to
2359<code>arch/x86/Makefile</code> while modifying 4 lines will be shown like this:</p></div>
Junio C Hamano3a702342007-12-12 21:34:022360<div class="listingblock">
2361<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:532362<pre><code>arch/{i386 =&gt; x86}/Makefile | 4 +--</code></pre>
Junio C Hamano3a702342007-12-12 21:34:022363</div></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:532364<div class="paragraph"><p>The <code>--numstat</code> option gives the diffstat(1) information but is designed
2365for easier machine consumption. An entry in <code>--numstat</code> output looks
Junio C Hamanoba4b9282008-07-06 05:20:312366like this:</p></div>
Junio C Hamano3a702342007-12-12 21:34:022367<div class="listingblock">
2368<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:532369<pre><code>1 2 README
23703 1 arch/{i386 =&gt; x86}/Makefile</code></pre>
Junio C Hamano3a702342007-12-12 21:34:022371</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592372<div class="paragraph"><p>That is, from left to right:</p></div>
2373<div class="olist arabic"><ol class="arabic">
Junio C Hamano3a702342007-12-12 21:34:022374<li>
2375<p>
2376the number of added lines;
2377</p>
2378</li>
2379<li>
2380<p>
2381a tab;
2382</p>
2383</li>
2384<li>
2385<p>
2386the number of deleted lines;
2387</p>
2388</li>
2389<li>
2390<p>
2391a tab;
2392</p>
2393</li>
2394<li>
2395<p>
2396pathname (possibly with rename/copy information);
2397</p>
2398</li>
2399<li>
2400<p>
2401a newline.
2402</p>
2403</li>
Junio C Hamanoba4b9282008-07-06 05:20:312404</ol></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:532405<div class="paragraph"><p>When <code>-z</code> output option is in effect, the output is formatted this way:</p></div>
Junio C Hamano3a702342007-12-12 21:34:022406<div class="listingblock">
2407<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:532408<pre><code>1 2 README NUL
24093 1 NUL arch/i386/Makefile NUL arch/x86/Makefile NUL</code></pre>
Junio C Hamano3a702342007-12-12 21:34:022410</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592411<div class="paragraph"><p>That is:</p></div>
2412<div class="olist arabic"><ol class="arabic">
Junio C Hamano3a702342007-12-12 21:34:022413<li>
2414<p>
2415the number of added lines;
2416</p>
2417</li>
2418<li>
2419<p>
2420a tab;
2421</p>
2422</li>
2423<li>
2424<p>
2425the number of deleted lines;
2426</p>
2427</li>
2428<li>
2429<p>
2430a tab;
2431</p>
2432</li>
2433<li>
2434<p>
2435a NUL (only exists if renamed/copied);
2436</p>
2437</li>
2438<li>
2439<p>
2440pathname in preimage;
2441</p>
2442</li>
2443<li>
2444<p>
2445a NUL (only exists if renamed/copied);
2446</p>
2447</li>
2448<li>
2449<p>
2450pathname in postimage (only exists if renamed/copied);
2451</p>
2452</li>
2453<li>
2454<p>
2455a NUL.
2456</p>
2457</li>
Junio C Hamanoba4b9282008-07-06 05:20:312458</ol></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:532459<div class="paragraph"><p>The extra <code>NUL</code> before the preimage path in renamed case is to allow
Junio C Hamano3a702342007-12-12 21:34:022460scripts that read the output to tell if the current record being read is
2461a single-path record or a rename/copy record without reading ahead.
Junio C Hamanoc14e6ad2014-10-31 20:25:532462After reading added and deleted lines, reading up to <code>NUL</code> would yield
2463the pathname, but if that is <code>NUL</code>, the record will show two paths.</p></div>
Junio C Hamano3a702342007-12-12 21:34:022464</div>
Junio C Hamano9629d4f2012-12-19 00:28:272465</div>
2466<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:312467<h2 id="_git">GIT</h2>
Junio C Hamano1a4e8412005-12-27 08:17:232468<div class="sectionbody">
Junio C Hamanoa28a9202012-06-21 07:08:232469<div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232470</div>
Junio C Hamano7bd050f2011-09-22 06:32:222471</div>
Junio C Hamano9629d4f2012-12-19 00:28:272472</div>
Junio C Hamano7bd050f2011-09-22 06:32:222473<div id="footnotes"><hr /></div>
Junio C Hamano1a4e8412005-12-27 08:17:232474<div id="footer">
2475<div id="footer-text">
Junio C Hamano2ef0ba32018-01-26 23:13:532476Last updated
2477 2018-01-26 15:11:04 PST
Junio C Hamano1a4e8412005-12-27 08:17:232478</div>
2479</div>
2480</body>
2481</html>