blob: cab71965e5f246129303f720439fa7ff53f1c103 [file] [log] [blame]
Junio C Hamano96153bf2018-04-25 08:25:341<?xml version="1.0" encoding="UTF-8"?>
Junio C Hamano1a4e8412005-12-27 08:17:232<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
3 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
4<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
5<head>
Junio C Hamano9629d4f2012-12-19 00:28:276<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
Junio C Hamano96153bf2018-04-25 08:25:347<meta name="generator" content="AsciiDoc 8.6.10" />
Junio C Hamano68cf15a2010-11-06 01:01:598<title>git-diff-files(1)</title>
Junio C Hamano1a4e8412005-12-27 08:17:239<style type="text/css">
Junio C Hamano9629d4f2012-12-19 00:28:2710/* Shared CSS for AsciiDoc xhtml11 and html5 backends */
11
12/* Default font. */
13body {
14 font-family: Georgia,serif;
15}
16
17/* Title font. */
18h1, h2, h3, h4, h5, h6,
19div.title, caption.title,
20thead, p.table.header,
21#toctitle,
22#author, #revnumber, #revdate, #revremark,
23#footer {
24 font-family: Arial,Helvetica,sans-serif;
Junio C Hamano1a4e8412005-12-27 08:17:2325}
26
27body {
28 margin: 1em 5% 1em 5%;
29}
30
Junio C Hamanoba4b9282008-07-06 05:20:3131a {
32 color: blue;
33 text-decoration: underline;
34}
35a:visited {
36 color: fuchsia;
37}
Junio C Hamano1a4e8412005-12-27 08:17:2338
39em {
40 font-style: italic;
Junio C Hamano68cf15a2010-11-06 01:01:5941 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:2342}
43
44strong {
45 font-weight: bold;
Junio C Hamano68cf15a2010-11-06 01:01:5946 color: #083194;
Junio C Hamano1a4e8412005-12-27 08:17:2347}
48
Junio C Hamano1a4e8412005-12-27 08:17:2349h1, h2, h3, h4, h5, h6 {
50 color: #527bbd;
Junio C Hamano1a4e8412005-12-27 08:17:2351 margin-top: 1.2em;
52 margin-bottom: 0.5em;
53 line-height: 1.3;
54}
55
Junio C Hamanoba4b9282008-07-06 05:20:3156h1, h2, h3 {
Junio C Hamano1a4e8412005-12-27 08:17:2357 border-bottom: 2px solid silver;
58}
59h2 {
Junio C Hamano1a4e8412005-12-27 08:17:2360 padding-top: 0.5em;
61}
Junio C Hamanoba4b9282008-07-06 05:20:3162h3 {
63 float: left;
64}
65h3 + * {
66 clear: left;
67}
Junio C Hamano9629d4f2012-12-19 00:28:2768h5 {
69 font-size: 1.0em;
70}
Junio C Hamano1a4e8412005-12-27 08:17:2371
72div.sectionbody {
Junio C Hamano1a4e8412005-12-27 08:17:2373 margin-left: 0;
74}
75
76hr {
77 border: 1px solid silver;
78}
79
80p {
81 margin-top: 0.5em;
82 margin-bottom: 0.5em;
83}
84
Junio C Hamano68cf15a2010-11-06 01:01:5985ul, ol, li > p {
86 margin-top: 0;
87}
Junio C Hamano9629d4f2012-12-19 00:28:2788ul > li { color: #aaa; }
89ul > li > * { color: black; }
Junio C Hamano68cf15a2010-11-06 01:01:5990
Junio C Hamanoc14e6ad2014-10-31 20:25:5391.monospaced, code, pre {
92 font-family: "Courier New", Courier, monospace;
93 font-size: inherit;
94 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:2395 padding: 0;
96 margin: 0;
97}
Junio C Hamanoc14e6ad2014-10-31 20:25:5398pre {
99 white-space: pre-wrap;
100}
Junio C Hamano1a4e8412005-12-27 08:17:23101
Junio C Hamano9629d4f2012-12-19 00:28:27102#author {
Junio C Hamano1a4e8412005-12-27 08:17:23103 color: #527bbd;
Junio C Hamano1a4e8412005-12-27 08:17:23104 font-weight: bold;
Junio C Hamanoba4b9282008-07-06 05:20:31105 font-size: 1.1em;
Junio C Hamano1a4e8412005-12-27 08:17:23106}
Junio C Hamano9629d4f2012-12-19 00:28:27107#email {
Junio C Hamano1a4e8412005-12-27 08:17:23108}
Junio C Hamano9629d4f2012-12-19 00:28:27109#revnumber, #revdate, #revremark {
Junio C Hamano1a4e8412005-12-27 08:17:23110}
111
Junio C Hamano9629d4f2012-12-19 00:28:27112#footer {
Junio C Hamano1a4e8412005-12-27 08:17:23113 font-size: small;
114 border-top: 2px solid silver;
115 padding-top: 0.5em;
116 margin-top: 4.0em;
117}
Junio C Hamano9629d4f2012-12-19 00:28:27118#footer-text {
Junio C Hamano1a4e8412005-12-27 08:17:23119 float: left;
120 padding-bottom: 0.5em;
121}
Junio C Hamano9629d4f2012-12-19 00:28:27122#footer-badges {
Junio C Hamano1a4e8412005-12-27 08:17:23123 float: right;
124 padding-bottom: 0.5em;
125}
126
Junio C Hamano9629d4f2012-12-19 00:28:27127#preamble {
Junio C Hamano68cf15a2010-11-06 01:01:59128 margin-top: 1.5em;
129 margin-bottom: 1.5em;
130}
Junio C Hamano9629d4f2012-12-19 00:28:27131div.imageblock, div.exampleblock, div.verseblock,
Junio C Hamano1a4e8412005-12-27 08:17:23132div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
133div.admonitionblock {
Junio C Hamano7bd050f2011-09-22 06:32:22134 margin-top: 1.0em;
Junio C Hamano1a4e8412005-12-27 08:17:23135 margin-bottom: 1.5em;
136}
137div.admonitionblock {
Junio C Hamano7bd050f2011-09-22 06:32:22138 margin-top: 2.0em;
139 margin-bottom: 2.0em;
140 margin-right: 10%;
141 color: #606060;
Junio C Hamano1a4e8412005-12-27 08:17:23142}
143
144div.content { /* Block element content. */
145 padding: 0;
146}
147
148/* Block element titles. */
149div.title, caption.title {
Junio C Hamano68cf15a2010-11-06 01:01:59150 color: #527bbd;
Junio C Hamano1a4e8412005-12-27 08:17:23151 font-weight: bold;
152 text-align: left;
153 margin-top: 1.0em;
154 margin-bottom: 0.5em;
155}
156div.title + * {
157 margin-top: 0;
158}
159
160td div.title:first-child {
161 margin-top: 0.0em;
162}
163div.content div.title:first-child {
164 margin-top: 0.0em;
165}
166div.content + div.title {
167 margin-top: 0.0em;
168}
169
170div.sidebarblock > div.content {
171 background: #ffffee;
Junio C Hamano9629d4f2012-12-19 00:28:27172 border: 1px solid #dddddd;
173 border-left: 4px solid #f0f0f0;
Junio C Hamano1a4e8412005-12-27 08:17:23174 padding: 0.5em;
175}
176
177div.listingblock > div.content {
Junio C Hamano9629d4f2012-12-19 00:28:27178 border: 1px solid #dddddd;
179 border-left: 5px solid #f0f0f0;
180 background: #f8f8f8;
Junio C Hamano1a4e8412005-12-27 08:17:23181 padding: 0.5em;
182}
183
Junio C Hamano7bd050f2011-09-22 06:32:22184div.quoteblock, div.verseblock {
185 padding-left: 1.0em;
186 margin-left: 1.0em;
Junio C Hamano68cf15a2010-11-06 01:01:59187 margin-right: 10%;
Junio C Hamano9629d4f2012-12-19 00:28:27188 border-left: 5px solid #f0f0f0;
189 color: #888;
Junio C Hamano1a4e8412005-12-27 08:17:23190}
Junio C Hamano7bd050f2011-09-22 06:32:22191
Junio C Hamano68cf15a2010-11-06 01:01:59192div.quoteblock > div.attribution {
193 padding-top: 0.5em;
Junio C Hamano1a4e8412005-12-27 08:17:23194 text-align: right;
195}
Junio C Hamano68cf15a2010-11-06 01:01:59196
Junio C Hamano9629d4f2012-12-19 00:28:27197div.verseblock > pre.content {
198 font-family: inherit;
199 font-size: inherit;
Junio C Hamano68cf15a2010-11-06 01:01:59200}
201div.verseblock > div.attribution {
202 padding-top: 0.75em;
203 text-align: left;
204}
205/* DEPRECATED: Pre version 8.2.7 verse style literal block. */
Junio C Hamanoba4b9282008-07-06 05:20:31206div.verseblock + div.attribution {
207 text-align: left;
208}
Junio C Hamano1a4e8412005-12-27 08:17:23209
210div.admonitionblock .icon {
211 vertical-align: top;
212 font-size: 1.1em;
213 font-weight: bold;
214 text-decoration: underline;
215 color: #527bbd;
216 padding-right: 0.5em;
217}
218div.admonitionblock td.content {
219 padding-left: 0.5em;
Junio C Hamano7bd050f2011-09-22 06:32:22220 border-left: 3px solid #dddddd;
Junio C Hamano1a4e8412005-12-27 08:17:23221}
222
223div.exampleblock > div.content {
Junio C Hamano7bd050f2011-09-22 06:32:22224 border-left: 3px solid #dddddd;
225 padding-left: 0.5em;
Junio C Hamano1a4e8412005-12-27 08:17:23226}
227
Junio C Hamano1a4e8412005-12-27 08:17:23228div.imageblock div.content { padding-left: 0; }
Junio C Hamanoc14e6ad2014-10-31 20:25:53229span.image img { border-style: none; vertical-align: text-bottom; }
Junio C Hamano68cf15a2010-11-06 01:01:59230a.image:visited { color: white; }
Junio C Hamano1a4e8412005-12-27 08:17:23231
232dl {
233 margin-top: 0.8em;
234 margin-bottom: 0.8em;
235}
236dt {
237 margin-top: 0.5em;
238 margin-bottom: 0;
Junio C Hamano68cf15a2010-11-06 01:01:59239 font-style: normal;
240 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:23241}
242dd > *:first-child {
Junio C Hamano68cf15a2010-11-06 01:01:59243 margin-top: 0.1em;
Junio C Hamano1a4e8412005-12-27 08:17:23244}
245
246ul, ol {
247 list-style-position: outside;
248}
Junio C Hamano68cf15a2010-11-06 01:01:59249ol.arabic {
250 list-style-type: decimal;
251}
252ol.loweralpha {
Junio C Hamano1a4e8412005-12-27 08:17:23253 list-style-type: lower-alpha;
254}
Junio C Hamano68cf15a2010-11-06 01:01:59255ol.upperalpha {
256 list-style-type: upper-alpha;
257}
258ol.lowerroman {
259 list-style-type: lower-roman;
260}
261ol.upperroman {
262 list-style-type: upper-roman;
263}
264
265div.compact ul, div.compact ol,
266div.compact p, div.compact p,
267div.compact div, div.compact div {
268 margin-top: 0.1em;
269 margin-bottom: 0.1em;
270}
Junio C Hamano1a4e8412005-12-27 08:17:23271
Junio C Hamano1a4e8412005-12-27 08:17:23272tfoot {
273 font-weight: bold;
274}
Junio C Hamano68cf15a2010-11-06 01:01:59275td > div.verse {
276 white-space: pre;
277}
Junio C Hamano68cf15a2010-11-06 01:01:59278
279div.hdlist {
Junio C Hamano1a4e8412005-12-27 08:17:23280 margin-top: 0.8em;
281 margin-bottom: 0.8em;
282}
Junio C Hamano68cf15a2010-11-06 01:01:59283div.hdlist tr {
284 padding-bottom: 15px;
Junio C Hamanoba4b9282008-07-06 05:20:31285}
Junio C Hamano68cf15a2010-11-06 01:01:59286dt.hdlist1.strong, td.hdlist1.strong {
287 font-weight: bold;
288}
289td.hdlist1 {
Junio C Hamano1a4e8412005-12-27 08:17:23290 vertical-align: top;
Junio C Hamano68cf15a2010-11-06 01:01:59291 font-style: normal;
Junio C Hamano1a4e8412005-12-27 08:17:23292 padding-right: 0.8em;
Junio C Hamano68cf15a2010-11-06 01:01:59293 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:23294}
Junio C Hamano68cf15a2010-11-06 01:01:59295td.hdlist2 {
Junio C Hamano1a4e8412005-12-27 08:17:23296 vertical-align: top;
297}
Junio C Hamano68cf15a2010-11-06 01:01:59298div.hdlist.compact tr {
299 margin: 0;
300 padding-bottom: 0;
301}
302
303.comment {
304 background: yellow;
305}
Junio C Hamano1a4e8412005-12-27 08:17:23306
Junio C Hamano7bd050f2011-09-22 06:32:22307.footnote, .footnoteref {
308 font-size: 0.8em;
309}
310
311span.footnote, span.footnoteref {
312 vertical-align: super;
313}
314
315#footnotes {
316 margin: 20px 0 20px 0;
317 padding: 7px 0 0 0;
318}
319
320#footnotes div.footnote {
321 margin: 0 0 5px 0;
322}
323
324#footnotes hr {
325 border: none;
326 border-top: 1px solid silver;
327 height: 1px;
328 text-align: left;
329 margin-left: 0;
330 width: 20%;
331 min-width: 100px;
332}
333
Junio C Hamano9629d4f2012-12-19 00:28:27334div.colist td {
335 padding-right: 0.5em;
336 padding-bottom: 0.3em;
337 vertical-align: top;
338}
339div.colist td img {
340 margin-top: 0.3em;
Junio C Hamano1a4e8412005-12-27 08:17:23341}
Junio C Hamanoba4b9282008-07-06 05:20:31342
Junio C Hamano9629d4f2012-12-19 00:28:27343@media print {
344 #footer-badges { display: none; }
345}
346
347#toc {
Junio C Hamano7bd050f2011-09-22 06:32:22348 margin-bottom: 2.5em;
349}
350
Junio C Hamano9629d4f2012-12-19 00:28:27351#toctitle {
Junio C Hamanoba4b9282008-07-06 05:20:31352 color: #527bbd;
Junio C Hamanoba4b9282008-07-06 05:20:31353 font-size: 1.1em;
354 font-weight: bold;
355 margin-top: 1.0em;
356 margin-bottom: 0.1em;
357}
358
Junio C Hamanoc14e6ad2014-10-31 20:25:53359div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
Junio C Hamanoba4b9282008-07-06 05:20:31360 margin-top: 0;
361 margin-bottom: 0;
362}
363div.toclevel2 {
364 margin-left: 2em;
365 font-size: 0.9em;
366}
367div.toclevel3 {
368 margin-left: 4em;
369 font-size: 0.9em;
370}
371div.toclevel4 {
372 margin-left: 6em;
373 font-size: 0.9em;
374}
Junio C Hamano9629d4f2012-12-19 00:28:27375
376span.aqua { color: aqua; }
377span.black { color: black; }
378span.blue { color: blue; }
379span.fuchsia { color: fuchsia; }
380span.gray { color: gray; }
381span.green { color: green; }
382span.lime { color: lime; }
383span.maroon { color: maroon; }
384span.navy { color: navy; }
385span.olive { color: olive; }
386span.purple { color: purple; }
387span.red { color: red; }
388span.silver { color: silver; }
389span.teal { color: teal; }
390span.white { color: white; }
391span.yellow { color: yellow; }
392
393span.aqua-background { background: aqua; }
394span.black-background { background: black; }
395span.blue-background { background: blue; }
396span.fuchsia-background { background: fuchsia; }
397span.gray-background { background: gray; }
398span.green-background { background: green; }
399span.lime-background { background: lime; }
400span.maroon-background { background: maroon; }
401span.navy-background { background: navy; }
402span.olive-background { background: olive; }
403span.purple-background { background: purple; }
404span.red-background { background: red; }
405span.silver-background { background: silver; }
406span.teal-background { background: teal; }
407span.white-background { background: white; }
408span.yellow-background { background: yellow; }
409
410span.big { font-size: 2em; }
411span.small { font-size: 0.6em; }
412
413span.underline { text-decoration: underline; }
414span.overline { text-decoration: overline; }
415span.line-through { text-decoration: line-through; }
416
Junio C Hamanoc14e6ad2014-10-31 20:25:53417div.unbreakable { page-break-inside: avoid; }
418
Junio C Hamano9629d4f2012-12-19 00:28:27419
420/*
421 * xhtml11 specific
422 *
423 * */
424
425div.tableblock {
426 margin-top: 1.0em;
427 margin-bottom: 1.5em;
428}
429div.tableblock > table {
430 border: 3px solid #527bbd;
431}
432thead, p.table.header {
433 font-weight: bold;
434 color: #527bbd;
435}
436p.table {
437 margin-top: 0;
438}
439/* Because the table frame attribute is overriden by CSS in most browsers. */
440div.tableblock > table[frame="void"] {
441 border-style: none;
442}
443div.tableblock > table[frame="hsides"] {
444 border-left-style: none;
445 border-right-style: none;
446}
447div.tableblock > table[frame="vsides"] {
448 border-top-style: none;
449 border-bottom-style: none;
450}
451
452
453/*
454 * html5 specific
455 *
456 * */
457
458table.tableblock {
459 margin-top: 1.0em;
460 margin-bottom: 1.5em;
461}
462thead, p.tableblock.header {
463 font-weight: bold;
464 color: #527bbd;
465}
466p.tableblock {
467 margin-top: 0;
468}
469table.tableblock {
470 border-width: 3px;
471 border-spacing: 0px;
472 border-style: solid;
473 border-color: #527bbd;
474 border-collapse: collapse;
475}
476th.tableblock, td.tableblock {
477 border-width: 1px;
478 padding: 4px;
479 border-style: solid;
480 border-color: #527bbd;
481}
482
483table.tableblock.frame-topbot {
484 border-left-style: hidden;
485 border-right-style: hidden;
486}
487table.tableblock.frame-sides {
488 border-top-style: hidden;
489 border-bottom-style: hidden;
490}
491table.tableblock.frame-none {
492 border-style: hidden;
493}
494
495th.tableblock.halign-left, td.tableblock.halign-left {
496 text-align: left;
497}
498th.tableblock.halign-center, td.tableblock.halign-center {
499 text-align: center;
500}
501th.tableblock.halign-right, td.tableblock.halign-right {
502 text-align: right;
503}
504
505th.tableblock.valign-top, td.tableblock.valign-top {
506 vertical-align: top;
507}
508th.tableblock.valign-middle, td.tableblock.valign-middle {
509 vertical-align: middle;
510}
511th.tableblock.valign-bottom, td.tableblock.valign-bottom {
512 vertical-align: bottom;
513}
514
515
516/*
517 * manpage specific
518 *
519 * */
520
521body.manpage h1 {
Junio C Hamano68cf15a2010-11-06 01:01:59522 padding-top: 0.5em;
523 padding-bottom: 0.5em;
524 border-top: 2px solid silver;
525 border-bottom: 2px solid silver;
526}
Junio C Hamano9629d4f2012-12-19 00:28:27527body.manpage h2 {
Junio C Hamano68cf15a2010-11-06 01:01:59528 border-style: none;
529}
Junio C Hamano9629d4f2012-12-19 00:28:27530body.manpage div.sectionbody {
531 margin-left: 3em;
Junio C Hamano68cf15a2010-11-06 01:01:59532}
533
534@media print {
Junio C Hamano9629d4f2012-12-19 00:28:27535 body.manpage div#toc { display: none; }
Junio C Hamano68cf15a2010-11-06 01:01:59536}
Junio C Hamanoc14e6ad2014-10-31 20:25:53537
538
Junio C Hamano1a4e8412005-12-27 08:17:23539</style>
Junio C Hamano7bd050f2011-09-22 06:32:22540<script type="text/javascript">
541/*<![CDATA[*/
Junio C Hamano7bd050f2011-09-22 06:32:22542var asciidoc = { // Namespace.
543
544/////////////////////////////////////////////////////////////////////
545// Table Of Contents generator
546/////////////////////////////////////////////////////////////////////
547
548/* Author: Mihai Bazon, September 2002
549 * http://students.infoiasi.ro/~mishoo
550 *
551 * Table Of Content generator
552 * Version: 0.4
553 *
554 * Feel free to use this script under the terms of the GNU General Public
555 * License, as long as you do not remove or alter this notice.
556 */
557
558 /* modified by Troy D. Hanson, September 2006. License: GPL */
559 /* modified by Stuart Rackham, 2006, 2009. License: GPL */
560
561// toclevels = 1..4.
562toc: function (toclevels) {
563
564 function getText(el) {
565 var text = "";
566 for (var i = el.firstChild; i != null; i = i.nextSibling) {
567 if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
568 text += i.data;
569 else if (i.firstChild != null)
570 text += getText(i);
571 }
572 return text;
573 }
574
575 function TocEntry(el, text, toclevel) {
576 this.element = el;
577 this.text = text;
578 this.toclevel = toclevel;
579 }
580
581 function tocEntries(el, toclevels) {
582 var result = new Array;
Junio C Hamanoc14e6ad2014-10-31 20:25:53583 var re = new RegExp('[hH]([1-'+(toclevels+1)+'])');
Junio C Hamano7bd050f2011-09-22 06:32:22584 // Function that scans the DOM tree for header elements (the DOM2
585 // nodeIterator API would be a better technique but not supported by all
586 // browsers).
587 var iterate = function (el) {
588 for (var i = el.firstChild; i != null; i = i.nextSibling) {
589 if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
590 var mo = re.exec(i.tagName);
591 if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
592 result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
593 }
594 iterate(i);
595 }
596 }
597 }
598 iterate(el);
599 return result;
600 }
601
602 var toc = document.getElementById("toc");
Junio C Hamano9629d4f2012-12-19 00:28:27603 if (!toc) {
604 return;
605 }
606
607 // Delete existing TOC entries in case we're reloading the TOC.
608 var tocEntriesToRemove = [];
609 var i;
610 for (i = 0; i < toc.childNodes.length; i++) {
611 var entry = toc.childNodes[i];
Junio C Hamanoc14e6ad2014-10-31 20:25:53612 if (entry.nodeName.toLowerCase() == 'div'
Junio C Hamano9629d4f2012-12-19 00:28:27613 && entry.getAttribute("class")
614 && entry.getAttribute("class").match(/^toclevel/))
615 tocEntriesToRemove.push(entry);
616 }
617 for (i = 0; i < tocEntriesToRemove.length; i++) {
618 toc.removeChild(tocEntriesToRemove[i]);
619 }
620
621 // Rebuild TOC entries.
Junio C Hamano7bd050f2011-09-22 06:32:22622 var entries = tocEntries(document.getElementById("content"), toclevels);
623 for (var i = 0; i < entries.length; ++i) {
624 var entry = entries[i];
625 if (entry.element.id == "")
626 entry.element.id = "_toc_" + i;
627 var a = document.createElement("a");
628 a.href = "#" + entry.element.id;
629 a.appendChild(document.createTextNode(entry.text));
630 var div = document.createElement("div");
631 div.appendChild(a);
632 div.className = "toclevel" + entry.toclevel;
633 toc.appendChild(div);
634 }
635 if (entries.length == 0)
636 toc.parentNode.removeChild(toc);
637},
638
639
640/////////////////////////////////////////////////////////////////////
641// Footnotes generator
642/////////////////////////////////////////////////////////////////////
643
644/* Based on footnote generation code from:
645 * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
646 */
647
648footnotes: function () {
Junio C Hamano9629d4f2012-12-19 00:28:27649 // Delete existing footnote entries in case we're reloading the footnodes.
650 var i;
Junio C Hamano7bd050f2011-09-22 06:32:22651 var noteholder = document.getElementById("footnotes");
Junio C Hamano9629d4f2012-12-19 00:28:27652 if (!noteholder) {
653 return;
654 }
655 var entriesToRemove = [];
656 for (i = 0; i < noteholder.childNodes.length; i++) {
657 var entry = noteholder.childNodes[i];
Junio C Hamanoc14e6ad2014-10-31 20:25:53658 if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote")
Junio C Hamano9629d4f2012-12-19 00:28:27659 entriesToRemove.push(entry);
660 }
661 for (i = 0; i < entriesToRemove.length; i++) {
662 noteholder.removeChild(entriesToRemove[i]);
663 }
664
665 // Rebuild footnote entries.
666 var cont = document.getElementById("content");
Junio C Hamano7bd050f2011-09-22 06:32:22667 var spans = cont.getElementsByTagName("span");
668 var refs = {};
669 var n = 0;
670 for (i=0; i<spans.length; i++) {
671 if (spans[i].className == "footnote") {
672 n++;
Junio C Hamano9629d4f2012-12-19 00:28:27673 var note = spans[i].getAttribute("data-note");
674 if (!note) {
675 // Use [\s\S] in place of . so multi-line matches work.
676 // Because JavaScript has no s (dotall) regex flag.
677 note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
678 spans[i].innerHTML =
679 "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
680 "' title='View footnote' class='footnote'>" + n + "</a>]";
681 spans[i].setAttribute("data-note", note);
682 }
Junio C Hamano7bd050f2011-09-22 06:32:22683 noteholder.innerHTML +=
684 "<div class='footnote' id='_footnote_" + n + "'>" +
685 "<a href='#_footnoteref_" + n + "' title='Return to text'>" +
686 n + "</a>. " + note + "</div>";
Junio C Hamano7bd050f2011-09-22 06:32:22687 var id =spans[i].getAttribute("id");
688 if (id != null) refs["#"+id] = n;
689 }
690 }
691 if (n == 0)
692 noteholder.parentNode.removeChild(noteholder);
693 else {
694 // Process footnoterefs.
695 for (i=0; i<spans.length; i++) {
696 if (spans[i].className == "footnoteref") {
697 var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
698 href = href.match(/#.*/)[0]; // Because IE return full URL.
699 n = refs[href];
700 spans[i].innerHTML =
701 "[<a href='#_footnote_" + n +
702 "' title='View footnote' class='footnote'>" + n + "</a>]";
703 }
704 }
705 }
Junio C Hamano9629d4f2012-12-19 00:28:27706},
707
708install: function(toclevels) {
709 var timerId;
710
711 function reinstall() {
712 asciidoc.footnotes();
713 if (toclevels) {
714 asciidoc.toc(toclevels);
715 }
716 }
717
718 function reinstallAndRemoveTimer() {
719 clearInterval(timerId);
720 reinstall();
721 }
722
723 timerId = setInterval(reinstall, 500);
724 if (document.addEventListener)
725 document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false);
726 else
727 window.onload = reinstallAndRemoveTimer;
Junio C Hamano7bd050f2011-09-22 06:32:22728}
729
730}
Junio C Hamano9629d4f2012-12-19 00:28:27731asciidoc.install();
Junio C Hamano7bd050f2011-09-22 06:32:22732/*]]>*/
733</script>
Junio C Hamano1a4e8412005-12-27 08:17:23734</head>
Junio C Hamano9629d4f2012-12-19 00:28:27735<body class="manpage">
Junio C Hamano1a4e8412005-12-27 08:17:23736<div id="header">
737<h1>
738git-diff-files(1) Manual Page
739</h1>
740<h2>NAME</h2>
741<div class="sectionbody">
742<p>git-diff-files -
743 Compares files in the working tree and the index
744</p>
745</div>
746</div>
Junio C Hamano7bd050f2011-09-22 06:32:22747<div id="content">
Junio C Hamano9629d4f2012-12-19 00:28:27748<div class="sect1">
Junio C Hamano68cf15a2010-11-06 01:01:59749<h2 id="_synopsis">SYNOPSIS</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23750<div class="sectionbody">
Junio C Hamano15567bc2011-07-23 00:51:59751<div class="verseblock">
Junio C Hamano9629d4f2012-12-19 00:28:27752<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>
753<div class="attribution">
Junio C Hamano15567bc2011-07-23 00:51:59754</div></div>
Junio C Hamano1a4e8412005-12-27 08:17:23755</div>
Junio C Hamano9629d4f2012-12-19 00:28:27756</div>
757<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:31758<h2 id="_description">DESCRIPTION</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23759<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:59760<div class="paragraph"><p>Compares the files in the working tree and the index. When paths
Junio C Hamano1a4e8412005-12-27 08:17:23761are specified, compares only those named paths. Otherwise all
762entries in the index are compared. The output format is the
Junio C Hamano1aa40d22010-01-21 17:46:43763same as for <em>git diff-index</em> and <em>git diff-tree</em>.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:23764</div>
Junio C Hamano9629d4f2012-12-19 00:28:27765</div>
766<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:31767<h2 id="_options">OPTIONS</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23768<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:59769<div class="dlist"><dl>
770<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:23771-p
772</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59773<dt class="hdlist1">
Junio C Hamanobbbb8652008-12-29 10:34:22774-u
775</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59776<dt class="hdlist1">
Junio C Hamanoe97d5772010-05-19 08:13:58777--patch
778</dt>
Junio C Hamano1a4e8412005-12-27 08:17:23779<dd>
780<p>
Junio C Hamanoff979792007-11-16 10:11:30781 Generate patch (see section on generating patches).
Junio C Hamano1a4e8412005-12-27 08:17:23782</p>
783</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59784<dt class="hdlist1">
Junio C Hamano58f587a2013-07-22 19:20:59785-s
786</dt>
787<dt class="hdlist1">
788--no-patch
789</dt>
790<dd>
791<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:53792 Suppress diff output. Useful for commands like <code>git show</code> that
793 show the patch by default, or to cancel the effect of <code>--patch</code>.
Junio C Hamano58f587a2013-07-22 19:20:59794</p>
795</dd>
796<dt class="hdlist1">
Junio C Hamano69361562007-07-26 02:14:34797-U&lt;n&gt;
798</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59799<dt class="hdlist1">
Junio C Hamano69361562007-07-26 02:14:34800--unified=&lt;n&gt;
801</dt>
802<dd>
803<p>
804 Generate diffs with &lt;n&gt; lines of context instead of
Junio C Hamano3b70d3c2009-11-21 17:37:37805 the usual three.
Junio C Hamanoc14e6ad2014-10-31 20:25:53806 Implies <code>-p</code>.
Junio C Hamano69361562007-07-26 02:14:34807</p>
808</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59809<dt class="hdlist1">
Junio C Hamano9ae1a062006-07-10 08:12:34810--raw
811</dt>
812<dd>
813<p>
Junio C Hamano85f1fde2015-06-01 20:37:32814 Generate the diff in raw format.
Junio C Hamano1dbca522015-05-22 20:48:55815 This is the default.
Junio C Hamano9ae1a062006-07-10 08:12:34816</p>
817</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59818<dt class="hdlist1">
Junio C Hamano54559c82006-04-13 07:45:12819--patch-with-raw
820</dt>
821<dd>
822<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:53823 Synonym for <code>-p --raw</code>.
Junio C Hamano54559c82006-04-13 07:45:12824</p>
825</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59826<dt class="hdlist1">
Junio C Hamanoad70bf02016-09-26 23:44:27827--indent-heuristic
828</dt>
Junio C Hamanoa65b6762017-11-06 04:45:42829<dd>
830<p>
831 Enable the heuristic that shift diff hunk boundaries to make patches
832 easier to read. This is the default.
833</p>
834</dd>
Junio C Hamanoad70bf02016-09-26 23:44:27835<dt class="hdlist1">
836--no-indent-heuristic
837</dt>
Junio C Hamano5f888332016-06-13 19:28:31838<dd>
839<p>
Junio C Hamanoa65b6762017-11-06 04:45:42840 Disable the indent heuristic.
Junio C Hamano5f888332016-06-13 19:28:31841</p>
842</dd>
843<dt class="hdlist1">
Junio C Hamano5a73f302011-10-14 05:58:34844--minimal
845</dt>
846<dd>
847<p>
848 Spend extra time to make sure the smallest possible
849 diff is produced.
850</p>
851</dd>
852<dt class="hdlist1">
Junio C Hamano20d47e32009-01-26 06:36:02853--patience
854</dt>
855<dd>
856<p>
857 Generate a diff using the "patience diff" algorithm.
858</p>
859</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59860<dt class="hdlist1">
Junio C Hamanoaea9e6b2012-03-07 00:17:11861--histogram
862</dt>
863<dd>
864<p>
865 Generate a diff using the "histogram diff" algorithm.
866</p>
867</dd>
868<dt class="hdlist1">
Junio C Hamano047135e2017-12-19 21:57:54869--anchored=&lt;text&gt;
870</dt>
871<dd>
872<p>
873 Generate a diff using the "anchored diff" algorithm.
874</p>
875<div class="paragraph"><p>This option may be specified more than once.</p></div>
876<div class="paragraph"><p>If a line exists in both the source and destination, exists only once,
877and starts with this text, this algorithm attempts to prevent it from
878appearing as a deletion or addition in the output. It uses the "patience
879diff" algorithm internally.</p></div>
880</dd>
881<dt class="hdlist1">
Junio C Hamano80ad00d2013-02-18 00:19:03882--diff-algorithm={patience|minimal|histogram|myers}
883</dt>
884<dd>
885<p>
886 Choose a diff algorithm. The variants are as follows:
887</p>
888<div class="openblock">
889<div class="content">
890<div class="dlist"><dl>
891<dt class="hdlist1">
Junio C Hamanoc14e6ad2014-10-31 20:25:53892<code>default</code>, <code>myers</code>
Junio C Hamano80ad00d2013-02-18 00:19:03893</dt>
894<dd>
895<p>
896 The basic greedy diff algorithm. Currently, this is the default.
897</p>
898</dd>
899<dt class="hdlist1">
Junio C Hamanoc14e6ad2014-10-31 20:25:53900<code>minimal</code>
Junio C Hamano80ad00d2013-02-18 00:19:03901</dt>
902<dd>
903<p>
904 Spend extra time to make sure the smallest possible diff is
905 produced.
906</p>
907</dd>
908<dt class="hdlist1">
Junio C Hamanoc14e6ad2014-10-31 20:25:53909<code>patience</code>
Junio C Hamano80ad00d2013-02-18 00:19:03910</dt>
911<dd>
912<p>
913 Use "patience diff" algorithm when generating patches.
914</p>
915</dd>
916<dt class="hdlist1">
Junio C Hamanoc14e6ad2014-10-31 20:25:53917<code>histogram</code>
Junio C Hamano80ad00d2013-02-18 00:19:03918</dt>
919<dd>
920<p>
921 This algorithm extends the patience algorithm to "support
922 low-occurrence common elements".
923</p>
924</dd>
925</dl></div>
926</div></div>
927<div class="paragraph"><p>For instance, if you configured diff.algorithm variable to a
928non-default value and want to use the default one, then you
Junio C Hamanoc14e6ad2014-10-31 20:25:53929have to use <code>--diff-algorithm=default</code> option.</p></div>
Junio C Hamano80ad00d2013-02-18 00:19:03930</dd>
931<dt class="hdlist1">
Junio C Hamano4c4b0122011-06-30 01:19:32932--stat[=&lt;width&gt;[,&lt;name-width&gt;[,&lt;count&gt;]]]
Junio C Hamanoba7c8d82006-04-15 06:17:42933</dt>
934<dd>
935<p>
Junio C Hamanoaea9e6b2012-03-07 00:17:11936 Generate a diffstat. By default, as much space as necessary
937 will be used for the filename part, and the rest for the graph
938 part. Maximum width defaults to terminal width, or 80 columns
Junio C Hamano7f2b3cb2012-06-22 22:42:39939 if not connected to a terminal, and can be overridden by
Junio C Hamanoc14e6ad2014-10-31 20:25:53940 <code>&lt;width&gt;</code>. The width of the filename part can be limited by
941 giving another width <code>&lt;name-width&gt;</code> after a comma. The width
Junio C Hamanoaea9e6b2012-03-07 00:17:11942 of the graph part can be limited by using
Junio C Hamanoc14e6ad2014-10-31 20:25:53943 <code>--stat-graph-width=&lt;width&gt;</code> (affects all commands generating
944 a stat graph) or by setting <code>diff.statGraphWidth=&lt;width&gt;</code>
945 (does not affect <code>git format-patch</code>).
946 By giving a third parameter <code>&lt;count&gt;</code>, you can limit the
947 output to the first <code>&lt;count&gt;</code> lines, followed by <code>...</code> if
Junio C Hamanoaea9e6b2012-03-07 00:17:11948 there are more.
Junio C Hamanoba7c8d82006-04-15 06:17:42949</p>
Junio C Hamanoc14e6ad2014-10-31 20:25:53950<div class="paragraph"><p>These parameters can also be set individually with <code>--stat-width=&lt;width&gt;</code>,
951<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:42952</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59953<dt class="hdlist1">
Junio C Hamano45badf02018-03-14 21:56:41954--compact-summary
955</dt>
956<dd>
957<p>
958 Output a condensed summary of extended header information such
959 as file creations or deletions ("new" or "gone", optionally "+l"
960 if it&#8217;s a symlink) and mode changes ("+x" or "-x" for adding
961 or removing executable bit respectively) in diffstat. The
962 information is put betwen the filename part and the graph
963 part. Implies <code>--stat</code>.
964</p>
965</dd>
966<dt class="hdlist1">
Junio C Hamanofbe00522006-10-19 05:58:48967--numstat
968</dt>
969<dd>
970<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:53971 Similar to <code>--stat</code>, but shows number of added and
Junio C Hamanofbe00522006-10-19 05:58:48972 deleted lines in decimal notation and pathname without
Junio C Hamanod793de52006-12-26 09:11:43973 abbreviation, to make it more machine friendly. For
Junio C Hamanoc14e6ad2014-10-31 20:25:53974 binary files, outputs two <code>-</code> instead of saying
975 <code>0 0</code>.
Junio C Hamanofbe00522006-10-19 05:58:48976</p>
977</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59978<dt class="hdlist1">
Junio C Hamano7d23f5e2006-12-16 07:44:04979--shortstat
980</dt>
981<dd>
982<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:53983 Output only the last line of the <code>--stat</code> format containing total
Junio C Hamano7d23f5e2006-12-16 07:44:04984 number of modified files, as well as number of added and deleted
985 lines.
986</p>
987</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59988<dt class="hdlist1">
Junio C Hamano1c222c52011-05-13 19:55:32989--dirstat[=&lt;param1,param2,&#8230;&gt;]
Junio C Hamano6a45be92008-04-22 08:19:03990</dt>
991<dd>
992<p>
Junio C Hamano1c222c52011-05-13 19:55:32993 Output the distribution of relative amount of changes for each
Junio C Hamanoc14e6ad2014-10-31 20:25:53994 sub-directory. The behavior of <code>--dirstat</code> can be customized by
Junio C Hamano1c222c52011-05-13 19:55:32995 passing it a comma separated list of parameters.
Junio C Hamanoc14e6ad2014-10-31 20:25:53996 The defaults are controlled by the <code>diff.dirstat</code> configuration
Junio C Hamanoa28a9202012-06-21 07:08:23997 variable (see <a href="git-config.html">git-config(1)</a>).
Junio C Hamano1c222c52011-05-13 19:55:32998 The following parameters are available:
Junio C Hamano6a45be92008-04-22 08:19:03999</p>
Junio C Hamano9629d4f2012-12-19 00:28:271000<div class="openblock">
1001<div class="content">
Junio C Hamano1c222c52011-05-13 19:55:321002<div class="dlist"><dl>
1003<dt class="hdlist1">
Junio C Hamanoc14e6ad2014-10-31 20:25:531004<code>changes</code>
Junio C Hamano1c222c52011-05-13 19:55:321005</dt>
1006<dd>
1007<p>
1008 Compute the dirstat numbers by counting the lines that have been
1009 removed from the source, or added to the destination. This ignores
1010 the amount of pure code movements within a file. In other words,
1011 rearranging lines in a file is not counted as much as other changes.
1012 This is the default behavior when no parameter is given.
1013</p>
Junio C Hamano6a45be92008-04-22 08:19:031014</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591015<dt class="hdlist1">
Junio C Hamanoc14e6ad2014-10-31 20:25:531016<code>lines</code>
Junio C Hamanoa476efa2008-10-10 15:31:421017</dt>
1018<dd>
1019<p>
Junio C Hamano1c222c52011-05-13 19:55:321020 Compute the dirstat numbers by doing the regular line-based diff
1021 analysis, and summing the removed/added line counts. (For binary
1022 files, count 64-byte chunks instead, since binary files have no
Junio C Hamanoc14e6ad2014-10-31 20:25:531023 natural concept of lines). This is a more expensive <code>--dirstat</code>
1024 behavior than the <code>changes</code> behavior, but it does count rearranged
Junio C Hamano1c222c52011-05-13 19:55:321025 lines within a file as much as other changes. The resulting output
Junio C Hamanoc14e6ad2014-10-31 20:25:531026 is consistent with what you get from the other <code>--*stat</code> options.
Junio C Hamanoa476efa2008-10-10 15:31:421027</p>
1028</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591029<dt class="hdlist1">
Junio C Hamanoc14e6ad2014-10-31 20:25:531030<code>files</code>
Junio C Hamano1c222c52011-05-13 19:55:321031</dt>
1032<dd>
1033<p>
1034 Compute the dirstat numbers by counting the number of files changed.
1035 Each changed file counts equally in the dirstat analysis. This is
Junio C Hamanoc14e6ad2014-10-31 20:25:531036 the computationally cheapest <code>--dirstat</code> behavior, since it does
Junio C Hamano1c222c52011-05-13 19:55:321037 not have to look at the file contents at all.
1038</p>
1039</dd>
1040<dt class="hdlist1">
Junio C Hamanoc14e6ad2014-10-31 20:25:531041<code>cumulative</code>
Junio C Hamano1c222c52011-05-13 19:55:321042</dt>
1043<dd>
1044<p>
1045 Count changes in a child directory for the parent directory as well.
Junio C Hamanoc14e6ad2014-10-31 20:25:531046 Note that when using <code>cumulative</code>, the sum of the percentages
Junio C Hamano1c222c52011-05-13 19:55:321047 reported may exceed 100%. The default (non-cumulative) behavior can
Junio C Hamanoc14e6ad2014-10-31 20:25:531048 be specified with the <code>noncumulative</code> parameter.
Junio C Hamano1c222c52011-05-13 19:55:321049</p>
1050</dd>
1051<dt class="hdlist1">
1052&lt;limit&gt;
1053</dt>
1054<dd>
1055<p>
1056 An integer parameter specifies a cut-off percent (3% by default).
1057 Directories contributing less than this percentage of the changes
1058 are not shown in the output.
1059</p>
1060</dd>
1061</dl></div>
Junio C Hamano9629d4f2012-12-19 00:28:271062</div></div>
Junio C Hamano1c222c52011-05-13 19:55:321063<div class="paragraph"><p>Example: The following will count changed files, while ignoring
1064directories with less than 10% of the total amount of changed files,
1065and accumulating child directory counts in the parent directories:
Junio C Hamanoc14e6ad2014-10-31 20:25:531066<code>--dirstat=files,10,cumulative</code>.</p></div>
Junio C Hamano1c222c52011-05-13 19:55:321067</dd>
1068<dt class="hdlist1">
Junio C Hamano6959c6c2006-05-17 10:34:111069--summary
1070</dt>
1071<dd>
1072<p>
1073 Output a condensed summary of extended header information
1074 such as creations, renames and mode changes.
1075</p>
1076</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591077<dt class="hdlist1">
Junio C Hamanod1308c92006-04-16 11:01:091078--patch-with-stat
1079</dt>
1080<dd>
1081<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:531082 Synonym for <code>-p --stat</code>.
Junio C Hamanod1308c92006-04-16 11:01:091083</p>
1084</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591085<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231086-z
1087</dt>
1088<dd>
1089<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:531090 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:341091 given, do not munge pathnames and use NULs as output field terminators.
Junio C Hamano1a4e8412005-12-27 08:17:231092</p>
Junio C Hamano0f6f3bf2017-03-13 07:01:531093<div class="paragraph"><p>Without this option, pathnames with "unusual" characters are quoted as
1094explained for the configuration variable <code>core.quotePath</code> (see
1095<a href="git-config.html">git-config(1)</a>).</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231096</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591097<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231098--name-only
1099</dt>
1100<dd>
1101<p>
1102 Show only names of changed files.
1103</p>
1104</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591105<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231106--name-status
1107</dt>
1108<dd>
1109<p>
Junio C Hamanoa9aee782008-04-23 16:09:201110 Show only names and status of changed files. See the description
Junio C Hamanoc14e6ad2014-10-31 20:25:531111 of the <code>--diff-filter</code> option on what the status letters mean.
Junio C Hamano1a4e8412005-12-27 08:17:231112</p>
1113</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591114<dt class="hdlist1">
Junio C Hamanoc21ab052009-10-31 04:03:551115--submodule[=&lt;format&gt;]
1116</dt>
1117<dd>
1118<p>
Junio C Hamanocd451662016-09-13 00:54:091119 Specify how differences in submodules are shown. When specifying
1120 <code>--submodule=short</code> the <em>short</em> format is used. This format just
1121 shows the names of the commits at the beginning and end of the range.
1122 When <code>--submodule</code> or <code>--submodule=log</code> is specified, the <em>log</em>
1123 format is used. This format lists the commits in the range like
1124 <a href="git-submodule.html">git-submodule(1)</a> <code>summary</code> does. When <code>--submodule=diff</code>
1125 is specified, the <em>diff</em> format is used. This format shows an
1126 inline diff of the changes in the submodule contents between the
1127 commit range. Defaults to <code>diff.submodule</code> or the <em>short</em> format
1128 if the config option is unset.
Junio C Hamanoc21ab052009-10-31 04:03:551129</p>
1130</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591131<dt class="hdlist1">
Junio C Hamano4aa0bcc2010-03-03 05:13:121132--color[=&lt;when&gt;]
Junio C Hamano9ae1a062006-07-10 08:12:341133</dt>
1134<dd>
1135<p>
1136 Show colored diff.
Junio C Hamanoc14e6ad2014-10-31 20:25:531137 <code>--color</code> (i.e. without <em>=&lt;when&gt;</em>) is the same as <code>--color=always</code>.
1138 <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:341139</p>
1140</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591141<dt class="hdlist1">
Junio C Hamano9ae1a062006-07-10 08:12:341142--no-color
1143</dt>
1144<dd>
1145<p>
Junio C Hamano5f2627d2011-05-06 20:23:481146 Turn off colored diff.
Junio C Hamanoc14e6ad2014-10-31 20:25:531147 It is the same as <code>--color=never</code>.
Junio C Hamano9ae1a062006-07-10 08:12:341148</p>
1149</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591150<dt class="hdlist1">
Junio C Hamanofb1fdf12017-08-27 06:14:591151--color-moved[=&lt;mode&gt;]
1152</dt>
1153<dd>
1154<p>
1155 Moved lines of code are colored differently.
1156 The &lt;mode&gt; defaults to <em>no</em> if the option is not given
1157 and to <em>zebra</em> if the option with no mode is given.
1158 The mode must be one of:
1159</p>
1160<div class="openblock">
1161<div class="content">
1162<div class="dlist"><dl>
1163<dt class="hdlist1">
1164no
1165</dt>
1166<dd>
1167<p>
1168 Moved lines are not highlighted.
1169</p>
1170</dd>
1171<dt class="hdlist1">
1172default
1173</dt>
1174<dd>
1175<p>
1176 Is a synonym for <code>zebra</code>. This may change to a more sensible mode
1177 in the future.
1178</p>
1179</dd>
1180<dt class="hdlist1">
1181plain
1182</dt>
1183<dd>
1184<p>
1185 Any line that is added in one location and was removed
1186 in another location will be colored with <em>color.diff.newMoved</em>.
1187 Similarly <em>color.diff.oldMoved</em> will be used for removed lines
1188 that are added somewhere else in the diff. This mode picks up any
1189 moved line, but it is not very useful in a review to determine
1190 if a block of code was moved without permutation.
1191</p>
1192</dd>
1193<dt class="hdlist1">
1194zebra
1195</dt>
1196<dd>
1197<p>
1198 Blocks of moved text of at least 20 alphanumeric characters
1199 are detected greedily. The detected blocks are
1200 painted using either the <em>color.diff.{old,new}Moved</em> color or
1201 <em>color.diff.{old,new}MovedAlternative</em>. The change between
1202 the two colors indicates that a new block was detected.
1203</p>
1204</dd>
1205<dt class="hdlist1">
1206dimmed_zebra
1207</dt>
1208<dd>
1209<p>
1210 Similar to <em>zebra</em>, but additional dimming of uninteresting parts
1211 of moved code is performed. The bordering lines of two adjacent
1212 blocks are considered interesting, the rest is uninteresting.
1213</p>
1214</dd>
1215</dl></div>
1216</div></div>
1217</dd>
1218<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531219--word-diff[=&lt;mode&gt;]
Junio C Hamano85e45fa2006-08-13 07:47:411220</dt>
1221<dd>
1222<p>
Junio C Hamanocc7636a2010-05-21 14:57:531223 Show a word diff, using the &lt;mode&gt; to delimit changed words.
1224 By default, words are delimited by whitespace; see
Junio C Hamanoc14e6ad2014-10-31 20:25:531225 <code>--word-diff-regex</code> below. The &lt;mode&gt; defaults to <em>plain</em>, and
Junio C Hamanocc7636a2010-05-21 14:57:531226 must be one of:
Junio C Hamano85e45fa2006-08-13 07:47:411227</p>
Junio C Hamano9629d4f2012-12-19 00:28:271228<div class="openblock">
1229<div class="content">
Junio C Hamano68cf15a2010-11-06 01:01:591230<div class="dlist"><dl>
1231<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531232color
1233</dt>
1234<dd>
1235<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:531236 Highlight changed words using only colors. Implies <code>--color</code>.
Junio C Hamanocc7636a2010-05-21 14:57:531237</p>
1238</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591239<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531240plain
1241</dt>
1242<dd>
1243<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:531244 Show words as <code>[-removed-]</code> and <code>{+added+}</code>. Makes no
Junio C Hamanocc7636a2010-05-21 14:57:531245 attempts to escape the delimiters if they appear in the input,
1246 so the output may be ambiguous.
1247</p>
1248</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591249<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531250porcelain
1251</dt>
1252<dd>
1253<p>
1254 Use a special line-based format intended for script
1255 consumption. Added/removed/unchanged runs are printed in the
Junio C Hamanoc14e6ad2014-10-31 20:25:531256 usual unified diff format, starting with a <code>+</code>/<code>-</code>/` `
Junio C Hamanocc7636a2010-05-21 14:57:531257 character at the beginning of the line and extending to the
1258 end of the line. Newlines in the input are represented by a
Junio C Hamanoc14e6ad2014-10-31 20:25:531259 tilde <code>~</code> on a line of its own.
Junio C Hamanocc7636a2010-05-21 14:57:531260</p>
1261</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591262<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531263none
1264</dt>
1265<dd>
1266<p>
1267 Disable word diff again.
1268</p>
1269</dd>
1270</dl></div>
Junio C Hamano9629d4f2012-12-19 00:28:271271</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591272<div class="paragraph"><p>Note that despite the name of the first mode, color is used to
Junio C Hamanocc7636a2010-05-21 14:57:531273highlight the changed parts in all modes if enabled.</p></div>
1274</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591275<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531276--word-diff-regex=&lt;regex&gt;
1277</dt>
1278<dd>
1279<p>
1280 Use &lt;regex&gt; to decide what a word is, instead of considering
1281 runs of non-whitespace to be a word. Also implies
Junio C Hamanoc14e6ad2014-10-31 20:25:531282 <code>--word-diff</code> unless it was already enabled.
Junio C Hamanocc7636a2010-05-21 14:57:531283</p>
Junio C Hamano68cf15a2010-11-06 01:01:591284<div class="paragraph"><p>Every non-overlapping match of the
Junio C Hamano20d47e32009-01-26 06:36:021285&lt;regex&gt; is considered a word. Anything between these matches is
1286considered whitespace and ignored(!) for the purposes of finding
Junio C Hamanoc14e6ad2014-10-31 20:25:531287differences. You may want to append <code>|[^[:space:]]</code> to your regular
Junio C Hamano20d47e32009-01-26 06:36:021288expression to make sure that it matches all non-whitespace characters.
1289A match that contains a newline is silently truncated(!) at the
1290newline.</p></div>
Junio C Hamano713eded2015-12-03 00:24:021291<div class="paragraph"><p>For example, <code>--word-diff-regex=.</code> will treat each character as a word
1292and, correspondingly, show differences character by character.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591293<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:241294<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:021295overrides any diff driver or configuration setting. Diff drivers
1296override configuration settings.</p></div>
Junio C Hamano85e45fa2006-08-13 07:47:411297</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591298<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531299--color-words[=&lt;regex&gt;]
1300</dt>
1301<dd>
1302<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:531303 Equivalent to <code>--word-diff=color</code> plus (if a regex was
1304 specified) <code>--word-diff-regex=&lt;regex&gt;</code>.
Junio C Hamanocc7636a2010-05-21 14:57:531305</p>
1306</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591307<dt class="hdlist1">
Junio C Hamano9ae1a062006-07-10 08:12:341308--no-renames
1309</dt>
1310<dd>
1311<p>
1312 Turn off rename detection, even when the configuration
1313 file gives the default to do so.
1314</p>
1315</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591316<dt class="hdlist1">
Junio C Hamanoa890c4f2007-01-28 10:29:211317--check
1318</dt>
1319<dd>
1320<p>
Junio C Hamano84ea1e42016-04-08 21:53:481321 Warn if changes introduce conflict markers or whitespace errors.
1322 What are considered whitespace errors is controlled by <code>core.whitespace</code>
Junio C Hamano6005bfa2011-06-23 00:51:221323 configuration. By default, trailing whitespaces (including
1324 lines that solely consist of whitespaces) and a space character
1325 that is immediately followed by a tab character inside the
1326 initial indent of the line are considered whitespace errors.
1327 Exits with non-zero status if problems are found. Not compatible
1328 with --exit-code.
Junio C Hamanoa890c4f2007-01-28 10:29:211329</p>
1330</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591331<dt class="hdlist1">
Junio C Hamano8c5d5942015-06-11 19:37:481332--ws-error-highlight=&lt;kind&gt;
1333</dt>
1334<dd>
1335<p>
Junio C Hamano4b2a6c12017-08-22 18:32:371336 Highlight whitespace errors in the <code>context</code>, <code>old</code> or <code>new</code>
1337 lines of the diff. Multiple values are separated by comma,
1338 <code>none</code> resets previous values, <code>default</code> reset the list to
1339 <code>new</code> and <code>all</code> is a shorthand for <code>old,new,context</code>. When
1340 this option is not given, and the configuration variable
1341 <code>diff.wsErrorHighlight</code> is not set, only whitespace errors in
1342 <code>new</code> lines are highlighted. The whitespace errors are colored
1343 whith <code>color.diff.whitespace</code>.
Junio C Hamano8c5d5942015-06-11 19:37:481344</p>
1345</dd>
1346<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231347--full-index
1348</dt>
1349<dd>
1350<p>
Junio C Hamano5cf43ca2008-08-20 09:14:141351 Instead of the first handful of characters, show the full
1352 pre- and post-image blob object names on the "index"
1353 line when generating patch format output.
Junio C Hamano1a4e8412005-12-27 08:17:231354</p>
1355</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591356<dt class="hdlist1">
Junio C Hamano9ae1a062006-07-10 08:12:341357--binary
1358</dt>
1359<dd>
1360<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:531361 In addition to <code>--full-index</code>, output a binary diff that
1362 can be applied with <code>git-apply</code>.
Junio C Hamano9ae1a062006-07-10 08:12:341363</p>
1364</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591365<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231366--abbrev[=&lt;n&gt;]
1367</dt>
1368<dd>
1369<p>
1370 Instead of showing the full 40-byte hexadecimal object
1371 name in diff-raw format output and diff-tree header
Junio C Hamano6efe3022009-01-13 16:47:561372 lines, show only a partial prefix. This is
Junio C Hamanoc14e6ad2014-10-31 20:25:531373 independent of the <code>--full-index</code> option above, which controls
Junio C Hamano1a4e8412005-12-27 08:17:231374 the diff-patch output format. Non default number of
Junio C Hamanoc14e6ad2014-10-31 20:25:531375 digits can be specified with <code>--abbrev=&lt;n&gt;</code>.
Junio C Hamano1a4e8412005-12-27 08:17:231376</p>
1377</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591378<dt class="hdlist1">
Junio C Hamanoe85e36f2010-08-10 05:30:141379-B[&lt;n&gt;][/&lt;m&gt;]
Junio C Hamano1a4e8412005-12-27 08:17:231380</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591381<dt class="hdlist1">
Junio C Hamano39c7a692010-10-27 06:08:541382--break-rewrites[=[&lt;n&gt;][/&lt;m&gt;]]
1383</dt>
Junio C Hamano1a4e8412005-12-27 08:17:231384<dd>
1385<p>
Junio C Hamanoe85e36f2010-08-10 05:30:141386 Break complete rewrite changes into pairs of delete and
1387 create. This serves two purposes:
Junio C Hamano1a4e8412005-12-27 08:17:231388</p>
Junio C Hamano68cf15a2010-11-06 01:01:591389<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:141390not as a series of deletion and insertion mixed together with a very
1391few lines that happen to match textually as the context, but as a
1392single deletion of everything old followed by a single insertion of
Junio C Hamanoc14e6ad2014-10-31 20:25:531393everything new, and the number <code>m</code> controls this aspect of the -B
1394option (defaults to 60%). <code>-B/70%</code> specifies that less than 30% of the
Junio C Hamano076ffcc2013-02-06 05:13:211395original should remain in the result for Git to consider it a total
Junio C Hamanoe85e36f2010-08-10 05:30:141396rewrite (i.e. otherwise the resulting patch will be a series of
1397deletion and insertion mixed together with context lines).</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591398<div class="paragraph"><p>When used with -M, a totally-rewritten file is also considered as the
Junio C Hamanoe85e36f2010-08-10 05:30:141399source of a rename (usually -M only considers a file that disappeared
Junio C Hamanoc14e6ad2014-10-31 20:25:531400as the source of a rename), and the number <code>n</code> controls this aspect of
1401the -B option (defaults to 50%). <code>-B20%</code> specifies that a change with
Junio C Hamano68cf15a2010-11-06 01:01:591402addition and deletion compared to 20% or more of the file&#8217;s size are
Junio C Hamanoe85e36f2010-08-10 05:30:141403eligible for being picked up as a possible source of a rename to
1404another file.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231405</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591406<dt class="hdlist1">
Junio C Hamanoe85e36f2010-08-10 05:30:141407-M[&lt;n&gt;]
Junio C Hamano1a4e8412005-12-27 08:17:231408</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591409<dt class="hdlist1">
Junio C Hamano0d75e872010-12-17 06:57:261410--find-renames[=&lt;n&gt;]
Junio C Hamano39c7a692010-10-27 06:08:541411</dt>
Junio C Hamano1a4e8412005-12-27 08:17:231412<dd>
1413<p>
1414 Detect renames.
Junio C Hamanoc14e6ad2014-10-31 20:25:531415 If <code>n</code> is specified, it is a threshold on the similarity
Junio C Hamanoe85e36f2010-08-10 05:30:141416 index (i.e. amount of addition/deletions compared to the
Junio C Hamanoc14e6ad2014-10-31 20:25:531417 file&#8217;s size). For example, <code>-M90%</code> means Git should consider a
Junio C Hamanoe85e36f2010-08-10 05:30:141418 delete/add pair to be a rename if more than 90% of the file
Junio C Hamanoc14e6ad2014-10-31 20:25:531419 hasn&#8217;t changed. Without a <code>%</code> sign, the number is to be read as
1420 a fraction, with a decimal point before it. I.e., <code>-M5</code> becomes
1421 0.5, and is thus the same as <code>-M50%</code>. Similarly, <code>-M05</code> is
1422 the same as <code>-M5%</code>. To limit detection to exact renames, use
1423 <code>-M100%</code>. The default similarity index is 50%.
Junio C Hamano1a4e8412005-12-27 08:17:231424</p>
1425</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591426<dt class="hdlist1">
Junio C Hamanoe85e36f2010-08-10 05:30:141427-C[&lt;n&gt;]
Junio C Hamano1a4e8412005-12-27 08:17:231428</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591429<dt class="hdlist1">
Junio C Hamano0d75e872010-12-17 06:57:261430--find-copies[=&lt;n&gt;]
Junio C Hamano39c7a692010-10-27 06:08:541431</dt>
Junio C Hamano1a4e8412005-12-27 08:17:231432<dd>
1433<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:531434 Detect copies as well as renames. See also <code>--find-copies-harder</code>.
1435 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:231436</p>
1437</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591438<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231439--find-copies-harder
1440</dt>
1441<dd>
1442<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:531443 For performance reasons, by default, <code>-C</code> option finds copies only
Junio C Hamano1a4e8412005-12-27 08:17:231444 if the original file of the copy was modified in the same
1445 changeset. This flag makes the command
1446 inspect unmodified files as candidates for the source of
1447 copy. This is a very expensive operation for large
Junio C Hamano16f98872007-06-12 16:09:141448 projects, so use it with caution. Giving more than one
Junio C Hamanoc14e6ad2014-10-31 20:25:531449 <code>-C</code> option has the same effect.
Junio C Hamano1a4e8412005-12-27 08:17:231450</p>
1451</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591452<dt class="hdlist1">
Junio C Hamanob02377c2011-04-28 22:26:021453-D
1454</dt>
1455<dt class="hdlist1">
1456--irreversible-delete
1457</dt>
1458<dd>
1459<p>
1460 Omit the preimage for deletes, i.e. print only the header but not
Junio C Hamanoc14e6ad2014-10-31 20:25:531461 the diff between the preimage and <code>/dev/null</code>. The resulting patch
1462 is not meant to be applied with <code>patch</code> or <code>git apply</code>; this is
Junio C Hamanob02377c2011-04-28 22:26:021463 solely for people who want to just concentrate on reviewing the
Junio C Hamanod16fd1b2017-08-04 16:41:511464 text after the change. In addition, the output obviously lacks
Junio C Hamanob02377c2011-04-28 22:26:021465 enough information to apply such a patch in reverse, even manually,
1466 hence the name of the option.
1467</p>
Junio C Hamanoc14e6ad2014-10-31 20:25:531468<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:021469of a delete/create pair.</p></div>
1470</dd>
1471<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231472-l&lt;num&gt;
1473</dt>
1474<dd>
1475<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:531476 The <code>-M</code> and <code>-C</code> options require O(n^2) processing time where n
Junio C Hamano1a4e8412005-12-27 08:17:231477 is the number of potential rename/copy targets. This
1478 option prevents rename/copy detection from running if
1479 the number of rename/copy targets exceeds the specified
1480 number.
1481</p>
1482</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591483<dt class="hdlist1">
Junio C Hamano982eb112010-11-18 00:53:091484--diff-filter=[(A|C|D|M|R|T|U|X|B)&#8230;[*]]
1485</dt>
1486<dd>
1487<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:531488 Select only files that are Added (<code>A</code>), Copied (<code>C</code>),
1489 Deleted (<code>D</code>), Modified (<code>M</code>), Renamed (<code>R</code>), have their
1490 type (i.e. regular file, symlink, submodule, &#8230;) changed (<code>T</code>),
1491 are Unmerged (<code>U</code>), are
1492 Unknown (<code>X</code>), or have had their pairing Broken (<code>B</code>).
Junio C Hamano982eb112010-11-18 00:53:091493 Any combination of the filter characters (including none) can be used.
Junio C Hamanoc14e6ad2014-10-31 20:25:531494 When <code>*</code> (All-or-none) is added to the combination, all
Junio C Hamano982eb112010-11-18 00:53:091495 paths are selected if there is any file that matches
1496 other criteria in the comparison; if there is no file
1497 that matches other criteria, nothing is selected.
1498</p>
Junio C Hamanoeed15af2016-07-25 22:49:421499<div class="paragraph"><p>Also, these upper-case letters can be downcased to exclude. E.g.
1500<code>--diff-filter=ad</code> excludes added and deleted paths.</p></div>
Junio C Hamano3a34f152018-01-09 23:09:381501<div class="paragraph"><p>Note that not all diffs can feature all types. For instance, diffs
1502from the index to the working tree can never have Added entries
1503(because the set of paths included in the diff is limited by what is in
1504the index). Similarly, copied and renamed entries cannot appear if
1505detection for those types is disabled.</p></div>
Junio C Hamano982eb112010-11-18 00:53:091506</dd>
1507<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231508-S&lt;string&gt;
1509</dt>
1510<dd>
1511<p>
Junio C Hamanof1f5a7b2013-06-11 22:23:521512 Look for differences that change the number of occurrences of
1513 the specified string (i.e. addition/deletion) in a file.
1514 Intended for the scripter&#8217;s use.
Junio C Hamano1a4e8412005-12-27 08:17:231515</p>
Junio C Hamanof1f5a7b2013-06-11 22:23:521516<div class="paragraph"><p>It is useful when you&#8217;re looking for an exact block of code (like a
1517struct), and want to know the history of that block since it first
1518came into being: use the feature iteratively to feed the interesting
Junio C Hamanoc14e6ad2014-10-31 20:25:531519block in the preimage back into <code>-S</code>, and keep going until you get the
Junio C Hamanof1f5a7b2013-06-11 22:23:521520very first version of the block.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231521</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591522<dt class="hdlist1">
Junio C Hamano3b4609d2010-09-30 00:04:341523-G&lt;regex&gt;
1524</dt>
1525<dd>
1526<p>
Junio C Hamanof1f5a7b2013-06-11 22:23:521527 Look for differences whose patch text contains added/removed
1528 lines that match &lt;regex&gt;.
Junio C Hamano3b4609d2010-09-30 00:04:341529</p>
Junio C Hamanoc14e6ad2014-10-31 20:25:531530<div class="paragraph"><p>To illustrate the difference between <code>-S&lt;regex&gt; --pickaxe-regex</code> and
1531<code>-G&lt;regex&gt;</code>, consider a commit with the following diff in the same
Junio C Hamanof1f5a7b2013-06-11 22:23:521532file:</p></div>
1533<div class="listingblock">
1534<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531535<pre><code>+ return !regexec(regexp, two-&gt;ptr, 1, &amp;regmatch, 0);
Junio C Hamanof1f5a7b2013-06-11 22:23:521536...
Junio C Hamanoc14e6ad2014-10-31 20:25:531537- hit = !regexec(regexp, mf2.ptr, 1, &amp;regmatch, 0);</code></pre>
Junio C Hamanof1f5a7b2013-06-11 22:23:521538</div></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:531539<div class="paragraph"><p>While <code>git log -G"regexec\(regexp"</code> will show this commit, <code>git log
1540-S"regexec\(regexp" --pickaxe-regex</code> will not (because the number of
Junio C Hamanof1f5a7b2013-06-11 22:23:521541occurrences of that string did not change).</p></div>
1542<div class="paragraph"><p>See the <em>pickaxe</em> entry in <a href="gitdiffcore.html">gitdiffcore(7)</a> for more
1543information.</p></div>
Junio C Hamano3b4609d2010-09-30 00:04:341544</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591545<dt class="hdlist1">
Junio C Hamano7b9cce92018-01-23 22:34:271546--find-object=&lt;object-id&gt;
1547</dt>
1548<dd>
1549<p>
1550 Look for differences that change the number of occurrences of
1551 the specified object. Similar to <code>-S</code>, just the argument is different
1552 in that it doesn&#8217;t search for a specific string but for a specific
1553 object id.
1554</p>
1555<div class="paragraph"><p>The object can be a blob or a submodule commit. It implies the <code>-t</code> option in
1556<code>git-log</code> to also find trees.</p></div>
1557</dd>
1558<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231559--pickaxe-all
1560</dt>
1561<dd>
1562<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:531563 When <code>-S</code> or <code>-G</code> finds a change, show all the changes in that
Junio C Hamano1a4e8412005-12-27 08:17:231564 changeset, not just the files that contain the change
1565 in &lt;string&gt;.
1566</p>
1567</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591568<dt class="hdlist1">
Junio C Hamanobfe9e752006-04-05 21:43:281569--pickaxe-regex
1570</dt>
1571<dd>
1572<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:531573 Treat the &lt;string&gt; given to <code>-S</code> as an extended POSIX regular
Junio C Hamanof1f5a7b2013-06-11 22:23:521574 expression to match.
Junio C Hamanobfe9e752006-04-05 21:43:281575</p>
1576</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591577<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231578-O&lt;orderfile&gt;
1579</dt>
1580<dd>
1581<p>
Junio C Hamanobcd98f42017-01-24 00:12:161582 Control the order in which files appear in the output.
Junio C Hamano322c6242015-03-23 21:32:461583 This overrides the <code>diff.orderFile</code> configuration variable
1584 (see <a href="git-config.html">git-config(1)</a>). To cancel <code>diff.orderFile</code>,
Junio C Hamanoc14e6ad2014-10-31 20:25:531585 use <code>-O/dev/null</code>.
Junio C Hamano1a4e8412005-12-27 08:17:231586</p>
Junio C Hamanobcd98f42017-01-24 00:12:161587<div class="paragraph"><p>The output order is determined by the order of glob patterns in
1588&lt;orderfile&gt;.
1589All files with pathnames that match the first pattern are output
1590first, all files with pathnames that match the second pattern (but not
1591the first) are output next, and so on.
1592All files with pathnames that do not match any pattern are output
1593last, as if there was an implicit match-all pattern at the end of the
1594file.
1595If multiple pathnames have the same rank (they match the same pattern
1596but no earlier patterns), their output order relative to each other is
1597the normal order.</p></div>
1598<div class="paragraph"><p>&lt;orderfile&gt; is parsed as follows:</p></div>
1599<div class="openblock">
1600<div class="content">
1601<div class="ulist"><ul>
1602<li>
1603<p>
1604Blank lines are ignored, so they can be used as separators for
1605 readability.
1606</p>
1607</li>
1608<li>
1609<p>
1610Lines starting with a hash ("<code>#</code>") are ignored, so they can be used
1611 for comments. Add a backslash ("<code>\</code>") to the beginning of the
1612 pattern if it starts with a hash.
1613</p>
1614</li>
1615<li>
1616<p>
1617Each other line contains a single pattern.
1618</p>
1619</li>
1620</ul></div>
1621</div></div>
1622<div class="paragraph"><p>Patterns have the same syntax and semantics as patterns used for
Junio C Hamano96153bf2018-04-25 08:25:341623fnmatch(3) without the FNM_PATHNAME flag, except a pathname also
Junio C Hamanobcd98f42017-01-24 00:12:161624matches a pattern if removing any number of the final pathname
1625components matches the pattern. For example, the pattern "<code>foo*bar</code>"
1626matches "<code>fooasdfbar</code>" and "<code>foo/bar/baz/asdf</code>" but not "<code>foobarx</code>".</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231627</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591628<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231629-R
1630</dt>
1631<dd>
1632<p>
1633 Swap two inputs; that is, show differences from index or
1634 on-disk file to tree contents.
1635</p>
1636</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591637<dt class="hdlist1">
Junio C Hamano24bc09a2008-02-28 00:27:441638--relative[=&lt;path&gt;]
1639</dt>
1640<dd>
1641<p>
1642 When run from a subdirectory of the project, it can be
1643 told to exclude changes outside the directory and show
1644 pathnames relative to it with this option. When you are
1645 not in a subdirectory (e.g. in a bare repository), you
1646 can name which subdirectory to make the output relative
1647 to by giving a &lt;path&gt; as an argument.
1648</p>
1649</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591650<dt class="hdlist1">
Junio C Hamanobbbb8652008-12-29 10:34:221651-a
1652</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591653<dt class="hdlist1">
Junio C Hamanoc26f5482006-07-09 09:38:141654--text
1655</dt>
1656<dd>
1657<p>
1658 Treat all files as text.
1659</p>
1660</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591661<dt class="hdlist1">
Junio C Hamano4886c772017-11-27 03:33:281662--ignore-cr-at-eol
1663</dt>
1664<dd>
1665<p>
Junio C Hamano96153bf2018-04-25 08:25:341666 Ignore carriage-return at the end of line when doing a comparison.
Junio C Hamano4886c772017-11-27 03:33:281667</p>
1668</dd>
1669<dt class="hdlist1">
Junio C Hamanofd468962007-02-14 23:45:041670--ignore-space-at-eol
1671</dt>
1672<dd>
1673<p>
Junio C Hamano3a702342007-12-12 21:34:021674 Ignore changes in whitespace at EOL.
Junio C Hamanofd468962007-02-14 23:45:041675</p>
1676</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591677<dt class="hdlist1">
Junio C Hamanobbbb8652008-12-29 10:34:221678-b
1679</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591680<dt class="hdlist1">
Junio C Hamanod9c2d2f2006-12-06 08:59:071681--ignore-space-change
1682</dt>
1683<dd>
1684<p>
Junio C Hamano3a702342007-12-12 21:34:021685 Ignore changes in amount of whitespace. This ignores whitespace
1686 at line end, and considers all other sequences of one or
1687 more whitespace characters to be equivalent.
Junio C Hamanod9c2d2f2006-12-06 08:59:071688</p>
1689</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591690<dt class="hdlist1">
Junio C Hamanobbbb8652008-12-29 10:34:221691-w
Junio C Hamanod9c2d2f2006-12-06 08:59:071692</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591693<dt class="hdlist1">
Junio C Hamanod9c2d2f2006-12-06 08:59:071694--ignore-all-space
1695</dt>
1696<dd>
1697<p>
Junio C Hamano3a702342007-12-12 21:34:021698 Ignore whitespace when comparing lines. This ignores
1699 differences even if one line has whitespace where the other
Junio C Hamanod9c2d2f2006-12-06 08:59:071700 line has none.
1701</p>
1702</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591703<dt class="hdlist1">
Junio C Hamanoa1952302013-07-01 21:31:181704--ignore-blank-lines
1705</dt>
1706<dd>
1707<p>
1708 Ignore changes whose lines are all blank.
1709</p>
1710</dd>
1711<dt class="hdlist1">
Junio C Hamano1d40ee82009-01-07 10:14:161712--inter-hunk-context=&lt;lines&gt;
1713</dt>
1714<dd>
1715<p>
1716 Show the context between diff hunks, up to the specified number
1717 of lines, thereby fusing hunks that are close to each other.
Junio C Hamanobcd98f42017-01-24 00:12:161718 Defaults to <code>diff.interHunkContext</code> or 0 if the config option
1719 is unset.
Junio C Hamano1d40ee82009-01-07 10:14:161720</p>
1721</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591722<dt class="hdlist1">
Junio C Hamano11821ed2011-10-19 18:42:091723-W
1724</dt>
1725<dt class="hdlist1">
1726--function-context
1727</dt>
1728<dd>
1729<p>
1730 Show whole surrounding functions of changes.
1731</p>
1732</dd>
1733<dt class="hdlist1">
Junio C Hamano48fd2f62007-03-19 02:02:301734--exit-code
1735</dt>
1736<dd>
1737<p>
1738 Make the program exit with codes similar to diff(1).
1739 That is, it exits with 1 if there were differences and
1740 0 means no differences.
1741</p>
1742</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591743<dt class="hdlist1">
Junio C Hamano35e57552007-03-25 07:54:351744--quiet
1745</dt>
1746<dd>
1747<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:531748 Disable all output of the program. Implies <code>--exit-code</code>.
Junio C Hamano35e57552007-03-25 07:54:351749</p>
1750</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591751<dt class="hdlist1">
Junio C Hamanobb0f4042007-07-04 06:41:401752--ext-diff
1753</dt>
1754<dd>
1755<p>
1756 Allow an external diff helper to be executed. If you set an
Junio C Hamanoa28a9202012-06-21 07:08:231757 external diff driver with <a href="gitattributes.html">gitattributes(5)</a>, you need
1758 to use this option with <a href="git-log.html">git-log(1)</a> and friends.
Junio C Hamanobb0f4042007-07-04 06:41:401759</p>
1760</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591761<dt class="hdlist1">
Junio C Hamanobb0f4042007-07-04 06:41:401762--no-ext-diff
1763</dt>
1764<dd>
1765<p>
1766 Disallow external diff drivers.
1767</p>
1768</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591769<dt class="hdlist1">
Junio C Hamanoc652aed2011-07-07 01:14:311770--textconv
1771</dt>
1772<dt class="hdlist1">
1773--no-textconv
1774</dt>
1775<dd>
1776<p>
1777 Allow (or disallow) external text conversion filters to be run
Junio C Hamanoa28a9202012-06-21 07:08:231778 when comparing binary files. See <a href="gitattributes.html">gitattributes(5)</a> for
Junio C Hamanoc652aed2011-07-07 01:14:311779 details. Because textconv filters are typically a one-way
1780 conversion, the resulting diff is suitable for human
1781 consumption, but cannot be applied. For this reason, textconv
Junio C Hamanoa28a9202012-06-21 07:08:231782 filters are enabled by default only for <a href="git-diff.html">git-diff(1)</a> and
1783 <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:311784 diff plumbing commands.
1785</p>
1786</dd>
1787<dt class="hdlist1">
Junio C Hamano7d449522010-07-01 00:08:511788--ignore-submodules[=&lt;when&gt;]
Junio C Hamanodfccbb02008-05-26 01:16:141789</dt>
1790<dd>
1791<p>
Junio C Hamano7d449522010-07-01 00:08:511792 Ignore changes to submodules in the diff generation. &lt;when&gt; can be
Junio C Hamanoc7102962013-05-29 23:57:171793 either "none", "untracked", "dirty" or "all", which is the default.
Junio C Hamano619596a2010-08-18 22:15:351794 Using "none" will consider the submodule modified when it either contains
1795 untracked or modified files or its HEAD differs from the commit recorded
1796 in the superproject and can be used to override any settings of the
Junio C Hamanoa28a9202012-06-21 07:08:231797 <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:511798 "untracked" is used submodules are not considered dirty when they only
1799 contain untracked content (but they are still scanned for modified
1800 content). Using "dirty" ignores all changes to the work tree of submodules,
1801 only changes to the commits stored in the superproject are shown (this was
1802 the behavior until 1.7.0). Using "all" hides all changes to submodules.
Junio C Hamanodfccbb02008-05-26 01:16:141803</p>
1804</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591805<dt class="hdlist1">
Junio C Hamanoe27cbd22007-12-21 17:57:331806--src-prefix=&lt;prefix&gt;
1807</dt>
1808<dd>
1809<p>
1810 Show the given source prefix instead of "a/".
1811</p>
1812</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591813<dt class="hdlist1">
Junio C Hamanoe27cbd22007-12-21 17:57:331814--dst-prefix=&lt;prefix&gt;
1815</dt>
1816<dd>
1817<p>
1818 Show the given destination prefix instead of "b/".
1819</p>
1820</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591821<dt class="hdlist1">
Junio C Hamanoe27cbd22007-12-21 17:57:331822--no-prefix
1823</dt>
1824<dd>
1825<p>
1826 Do not show any source or destination prefix.
1827</p>
1828</dd>
Junio C Hamanocd451662016-09-13 00:54:091829<dt class="hdlist1">
1830--line-prefix=&lt;prefix&gt;
1831</dt>
1832<dd>
1833<p>
1834 Prepend an additional prefix to every line of output.
1835</p>
1836</dd>
Junio C Hamanof7017f12016-10-27 23:31:341837<dt class="hdlist1">
1838--ita-invisible-in-index
1839</dt>
1840<dd>
1841<p>
1842 By default entries added by "git add -N" appear as an existing
1843 empty file in "git diff" and a new file in "git diff --cached".
1844 This option makes the entry appear as a new file in "git diff"
1845 and non-existent in "git diff --cached". This option could be
1846 reverted with <code>--ita-visible-in-index</code>. Both options are
1847 experimental and could be removed in future.
1848</p>
1849</dd>
Junio C Hamanoba4b9282008-07-06 05:20:311850</dl></div>
Junio C Hamano68cf15a2010-11-06 01:01:591851<div class="paragraph"><p>For more detailed explanation on these common options, see also
Junio C Hamanoa28a9202012-06-21 07:08:231852<a href="gitdiffcore.html">gitdiffcore(7)</a>.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591853<div class="dlist"><dl>
1854<dt class="hdlist1">
Junio C Hamanobd53dbf2009-01-18 18:26:371855-1 --base
1856</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591857<dt class="hdlist1">
Junio C Hamanobd53dbf2009-01-18 18:26:371858-2 --ours
1859</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591860<dt class="hdlist1">
Junio C Hamanobd53dbf2009-01-18 18:26:371861-3 --theirs
1862</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591863<dt class="hdlist1">
Junio C Hamanobd53dbf2009-01-18 18:26:371864-0
Junio C Hamano1a4e8412005-12-27 08:17:231865</dt>
1866<dd>
1867<p>
1868 Diff against the "base" version, "our branch" or "their
1869 branch" respectively. With these options, diffs for
1870 merged entries are not shown.
1871</p>
Junio C Hamano68cf15a2010-11-06 01:01:591872<div class="paragraph"><p>The default is to diff against our branch (-2) and the
Junio C Hamano1a4e8412005-12-27 08:17:231873cleanly resolved paths. The option -0 can be given to
Junio C Hamanoba4b9282008-07-06 05:20:311874omit diff output for unmerged entries and just show "Unmerged".</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231875</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591876<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471877-c
1878</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591879<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471880--cc
Junio C Hamanofb56a962006-01-28 10:38:191881</dt>
1882<dd>
1883<p>
1884 This compares stage 2 (our branch), stage 3 (their
1885 branch) and the working tree file and outputs a combined
1886 diff, similar to the way <em>diff-tree</em> shows a merge
1887 commit with these flags.
1888</p>
1889</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591890<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231891-q
1892</dt>
1893<dd>
1894<p>
Junio C Hamano51c2ab02006-07-09 20:38:541895 Remain silent even on nonexistent files
Junio C Hamano1a4e8412005-12-27 08:17:231896</p>
1897</dd>
Junio C Hamanoba4b9282008-07-06 05:20:311898</dl></div>
Junio C Hamano1a4e8412005-12-27 08:17:231899</div>
Junio C Hamano9629d4f2012-12-19 00:28:271900</div>
1901<div class="sect1">
Junio C Hamano543f8d62009-07-29 08:35:211902<h2 id="_raw_output_format">Raw output format</h2>
Junio C Hamano1a4e8412005-12-27 08:17:231903<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:591904<div class="paragraph"><p>The raw output format from "git-diff-index", "git-diff-tree",
Junio C Hamanoba4b9282008-07-06 05:20:311905"git-diff-files" and "git diff --raw" are very similar.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591906<div class="paragraph"><p>These commands all compare two sets of things; what is
Junio C Hamanoba4b9282008-07-06 05:20:311907compared differs:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591908<div class="dlist"><dl>
1909<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231910git-diff-index &lt;tree-ish&gt;
1911</dt>
1912<dd>
1913<p>
1914 compares the &lt;tree-ish&gt; and the files on the filesystem.
1915</p>
1916</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591917<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231918git-diff-index --cached &lt;tree-ish&gt;
1919</dt>
1920<dd>
1921<p>
1922 compares the &lt;tree-ish&gt; and the index.
1923</p>
1924</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591925<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231926git-diff-tree [-r] &lt;tree-ish-1&gt; &lt;tree-ish-2&gt; [&lt;pattern&gt;&#8230;]
1927</dt>
1928<dd>
1929<p>
1930 compares the trees named by the two arguments.
1931</p>
1932</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591933<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231934git-diff-files [&lt;pattern&gt;&#8230;]
1935</dt>
1936<dd>
1937<p>
1938 compares the index and the files on the filesystem.
1939</p>
1940</dd>
Junio C Hamanoba4b9282008-07-06 05:20:311941</dl></div>
Junio C Hamano68cf15a2010-11-06 01:01:591942<div class="paragraph"><p>The "git-diff-tree" command begins its output by printing the hash of
Junio C Hamano543f8d62009-07-29 08:35:211943what is being compared. After that, all the commands print one output
1944line per changed file.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591945<div class="paragraph"><p>An output line is formatted this way:</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231946<div class="listingblock">
1947<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531948<pre><code>in-place edit :100644 100644 bcd1234... 0123456... M file0
Junio C Hamano1a4e8412005-12-27 08:17:231949copy-edit :100644 100644 abcd123... 1234567... C68 file1 file2
1950rename-edit :100644 100644 abcd123... 1234567... R86 file1 file3
1951create :000000 100644 0000000... 1234567... A file4
1952delete :100644 000000 1234567... 0000000... D file5
Junio C Hamanoc14e6ad2014-10-31 20:25:531953unmerged :000000 000000 0000000... 0000000... U file6</code></pre>
Junio C Hamano1a4e8412005-12-27 08:17:231954</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591955<div class="paragraph"><p>That is, from the left to the right:</p></div>
1956<div class="olist arabic"><ol class="arabic">
Junio C Hamano1a4e8412005-12-27 08:17:231957<li>
1958<p>
1959a colon.
1960</p>
1961</li>
1962<li>
1963<p>
1964mode for "src"; 000000 if creation or unmerged.
1965</p>
1966</li>
1967<li>
1968<p>
1969a space.
1970</p>
1971</li>
1972<li>
1973<p>
1974mode for "dst"; 000000 if deletion or unmerged.
1975</p>
1976</li>
1977<li>
1978<p>
1979a space.
1980</p>
1981</li>
1982<li>
1983<p>
1984sha1 for "src"; 0{40} if creation or unmerged.
1985</p>
1986</li>
1987<li>
1988<p>
1989a space.
1990</p>
1991</li>
1992<li>
1993<p>
1994sha1 for "dst"; 0{40} if creation, unmerged or "look at work tree".
1995</p>
1996</li>
1997<li>
1998<p>
1999a space.
2000</p>
2001</li>
2002<li>
2003<p>
2004status, followed by optional "score" number.
2005</p>
2006</li>
2007<li>
2008<p>
Junio C Hamano92d80372016-07-13 22:00:052009a tab or a NUL when <code>-z</code> option is used.
Junio C Hamano1a4e8412005-12-27 08:17:232010</p>
2011</li>
2012<li>
2013<p>
2014path for "src"
2015</p>
2016</li>
2017<li>
2018<p>
Junio C Hamano92d80372016-07-13 22:00:052019a tab or a NUL when <code>-z</code> option is used; only exists for C or R.
Junio C Hamano1a4e8412005-12-27 08:17:232020</p>
2021</li>
2022<li>
2023<p>
2024path for "dst"; only exists for C or R.
2025</p>
2026</li>
2027<li>
2028<p>
Junio C Hamano92d80372016-07-13 22:00:052029an LF or a NUL when <code>-z</code> option is used, to terminate the record.
Junio C Hamano1a4e8412005-12-27 08:17:232030</p>
2031</li>
Junio C Hamanoba4b9282008-07-06 05:20:312032</ol></div>
Junio C Hamano68cf15a2010-11-06 01:01:592033<div class="paragraph"><p>Possible status letters are:</p></div>
2034<div class="ulist"><ul>
Junio C Hamanoaa17c7c2008-11-03 04:36:582035<li>
2036<p>
2037A: addition of a file
2038</p>
2039</li>
2040<li>
2041<p>
2042C: copy of a file into a new one
2043</p>
2044</li>
2045<li>
2046<p>
2047D: deletion of a file
2048</p>
2049</li>
2050<li>
2051<p>
2052M: modification of the contents or mode of a file
2053</p>
2054</li>
2055<li>
2056<p>
2057R: renaming of a file
2058</p>
2059</li>
2060<li>
2061<p>
2062T: change in the type of the file
2063</p>
2064</li>
2065<li>
2066<p>
2067U: file is unmerged (you must complete the merge before it can
2068be committed)
2069</p>
2070</li>
2071<li>
2072<p>
2073X: "unknown" change type (most probably a bug, please report it)
2074</p>
2075</li>
2076</ul></div>
Junio C Hamano68cf15a2010-11-06 01:01:592077<div class="paragraph"><p>Status letters C and R are always followed by a score (denoting the
Junio C Hamanoaa17c7c2008-11-03 04:36:582078percentage of similarity between the source and target of the move or
Junio C Hamano6bb32e62015-02-17 22:11:262079copy). Status letter M may be followed by a score (denoting the
2080percentage of dissimilarity) for file rewrites.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592081<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:312082and it is out of sync with the index.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592083<div class="paragraph"><p>Example:</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232084<div class="listingblock">
2085<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:532086<pre><code>:100644 100644 5be4a4...... 000000...... M file.c</code></pre>
Junio C Hamano1a4e8412005-12-27 08:17:232087</div></div>
Junio C Hamano0f6f3bf2017-03-13 07:01:532088<div class="paragraph"><p>Without the <code>-z</code> option, pathnames with "unusual" characters are
2089quoted as explained for the configuration variable <code>core.quotePath</code>
2090(see <a href="git-config.html">git-config(1)</a>). Using <code>-z</code> the filename is output
2091verbatim and the line is terminated by a NUL byte.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232092</div>
Junio C Hamano9629d4f2012-12-19 00:28:272093</div>
2094<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:312095<h2 id="_diff_format_for_merges">diff format for merges</h2>
Junio C Hamano67fad6d2007-05-06 08:53:122096<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:592097<div class="paragraph"><p>"git-diff-tree", "git-diff-files" and "git-diff --raw"
Junio C Hamano92d80372016-07-13 22:00:052098can take <code>-c</code> or <code>--cc</code> option
Junio C Hamano67fad6d2007-05-06 08:53:122099to generate diff output also for merge commits. The output differs
Junio C Hamanoba4b9282008-07-06 05:20:312100from the format described above in the following way:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592101<div class="olist arabic"><ol class="arabic">
Junio C Hamano67fad6d2007-05-06 08:53:122102<li>
2103<p>
2104there is a colon for each parent
2105</p>
2106</li>
2107<li>
2108<p>
2109there are more "src" modes and "src" sha1
2110</p>
2111</li>
2112<li>
2113<p>
2114status is concatenated status characters for each parent
2115</p>
2116</li>
2117<li>
2118<p>
2119no optional "score" number
2120</p>
2121</li>
2122<li>
2123<p>
2124single path, only for "dst"
2125</p>
2126</li>
Junio C Hamanoba4b9282008-07-06 05:20:312127</ol></div>
Junio C Hamano68cf15a2010-11-06 01:01:592128<div class="paragraph"><p>Example:</p></div>
Junio C Hamano67fad6d2007-05-06 08:53:122129<div class="listingblock">
2130<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:532131<pre><code>::100644 100644 100644 fabadb8... cc95eb0... 4866510... MM describe.c</code></pre>
Junio C Hamano67fad6d2007-05-06 08:53:122132</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592133<div class="paragraph"><p>Note that <em>combined diff</em> lists only files which were modified from
Junio C Hamanoba4b9282008-07-06 05:20:312134all parents.</p></div>
Junio C Hamano67fad6d2007-05-06 08:53:122135</div>
Junio C Hamano9629d4f2012-12-19 00:28:272136</div>
2137<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:312138<h2 id="_generating_patches_with_p">Generating patches with -p</h2>
Junio C Hamano1a4e8412005-12-27 08:17:232139<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:592140<div class="paragraph"><p>When "git-diff-index", "git-diff-tree", or "git-diff-files" are run
Junio C Hamano92d80372016-07-13 22:00:052141with a <code>-p</code> option, "git diff" without the <code>--raw</code> option, or
Junio C Hamano00b8b632007-12-07 09:50:492142"git log" with the "-p" option, they
Junio C Hamano7ae0ab22007-11-03 02:46:462143do not produce the output described above; instead they produce a
2144patch file. You can customize the creation of such patches via the
Junio C Hamano042f2142016-06-27 18:05:052145<code>GIT_EXTERNAL_DIFF</code> and the <code>GIT_DIFF_OPTS</code> environment variables.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592146<div class="paragraph"><p>What the -p option produces is slightly different from the traditional
Junio C Hamano7f9fa862010-10-19 23:51:142147diff format:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592148<div class="olist arabic"><ol class="arabic">
Junio C Hamano1a4e8412005-12-27 08:17:232149<li>
2150<p>
Junio C Hamano7f9fa862010-10-19 23:51:142151It is preceded with a "git diff" header that looks like this:
Junio C Hamano1a4e8412005-12-27 08:17:232152</p>
2153<div class="literalblock">
2154<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:532155<pre><code>diff --git a/file1 b/file2</code></pre>
Junio C Hamano1a4e8412005-12-27 08:17:232156</div></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:532157<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:232158involved. Especially, even for a creation or a deletion,
Junio C Hamanoc14e6ad2014-10-31 20:25:532159<code>/dev/null</code> is <em>not</em> used in place of the <code>a/</code> or <code>b/</code> filenames.</p></div>
2160<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:232161name of the source file of the rename/copy and the name of
Junio C Hamanoba4b9282008-07-06 05:20:312162the file that rename/copy produces, respectively.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232163</li>
2164<li>
2165<p>
2166It is followed by one or more extended header lines:
2167</p>
2168<div class="literalblock">
2169<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:532170<pre><code>old mode &lt;mode&gt;
Junio C Hamano1a4e8412005-12-27 08:17:232171new mode &lt;mode&gt;
2172deleted file mode &lt;mode&gt;
2173new file mode &lt;mode&gt;
2174copy from &lt;path&gt;
2175copy to &lt;path&gt;
2176rename from &lt;path&gt;
2177rename to &lt;path&gt;
2178similarity index &lt;number&gt;
2179dissimilarity index &lt;number&gt;
Junio C Hamanoc14e6ad2014-10-31 20:25:532180index &lt;hash&gt;..&lt;hash&gt; &lt;mode&gt;</code></pre>
Junio C Hamano1a4e8412005-12-27 08:17:232181</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592182<div class="paragraph"><p>File modes are printed as 6-digit octal numbers including the file type
Junio C Hamano7f9fa862010-10-19 23:51:142183and file permission bits.</p></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:532184<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:592185<div class="paragraph"><p>The similarity index is the percentage of unchanged lines, and
Junio C Hamano7f9fa862010-10-19 23:51:142186the dissimilarity index is the percentage of changed lines. It
2187is a rounded down integer, followed by a percent sign. The
2188similarity index value of 100% is thus reserved for two equal
2189files, while 100% dissimilarity means that no line from the old
2190file made it into the new one.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592191<div class="paragraph"><p>The index line includes the SHA-1 checksum before and after the change.
Junio C Hamano7f9fa862010-10-19 23:51:142192The &lt;mode&gt; is included if the file mode does not change; otherwise,
2193separate lines indicate the old and the new mode.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232194</li>
2195<li>
2196<p>
Junio C Hamano0f6f3bf2017-03-13 07:01:532197Pathnames with "unusual" characters are quoted as explained for
2198 the configuration variable <code>core.quotePath</code> (see
2199 <a href="git-config.html">git-config(1)</a>).
Junio C Hamano1a4e8412005-12-27 08:17:232200</p>
2201</li>
Junio C Hamano7f9fa862010-10-19 23:51:142202<li>
2203<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:532204All the <code>file1</code> files in the output refer to files before the
2205 commit, and all the <code>file2</code> files refer to files after the commit.
Junio C Hamano7f9fa862010-10-19 23:51:142206 It is incorrect to apply each change to each file sequentially. For
2207 example, this patch will swap a and b:
2208</p>
2209<div class="literalblock">
2210<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:532211<pre><code>diff --git a/a b/b
Junio C Hamano7f9fa862010-10-19 23:51:142212rename from a
2213rename to b
2214diff --git a/b b/a
2215rename from b
Junio C Hamanoc14e6ad2014-10-31 20:25:532216rename to a</code></pre>
Junio C Hamano7f9fa862010-10-19 23:51:142217</div></div>
2218</li>
Junio C Hamanoba4b9282008-07-06 05:20:312219</ol></div>
Junio C Hamano1a4e8412005-12-27 08:17:232220</div>
Junio C Hamano9629d4f2012-12-19 00:28:272221</div>
2222<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:312223<h2 id="_combined_diff_format">combined diff format</h2>
Junio C Hamanofb56a962006-01-28 10:38:192224<div class="sectionbody">
Junio C Hamano1dbca522015-05-22 20:48:552225<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:432226produce a <em>combined diff</em> when showing a merge. This is the default
Junio C Hamanoa28a9202012-06-21 07:08:232227format when showing merges with <a href="git-diff.html">git-diff(1)</a> or
Junio C Hamano1dbca522015-05-22 20:48:552228<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:432229of these commands to force generation of diffs with individual parents
2230of a merge.</p></div>
2231<div class="paragraph"><p>A <em>combined diff</em> format looks like this:</p></div>
Junio C Hamanofb56a962006-01-28 10:38:192232<div class="listingblock">
2233<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:532234<pre><code>diff --combined describe.c
Junio C Hamano29f14312006-10-26 08:47:292235index fabadb8,cc95eb0..4866510
2236--- a/describe.c
2237+++ b/describe.c
2238@@@ -98,20 -98,12 +98,20 @@@
2239 return (a_date &gt; b_date) ? -1 : (a_date == b_date) ? 0 : 1;
Junio C Hamanofb56a962006-01-28 10:38:192240 }
2241
2242- static void describe(char *arg)
2243 -static void describe(struct commit *cmit, int last_one)
2244++static void describe(char *arg, int last_one)
2245 {
Junio C Hamano29f14312006-10-26 08:47:292246 + unsigned char sha1[20];
2247 + struct commit *cmit;
2248 struct commit_list *list;
2249 static int initialized = 0;
2250 struct commit_name *n;
2251
2252 + if (get_sha1(arg, sha1) &lt; 0)
2253 + usage(describe_usage);
2254 + cmit = lookup_commit_reference(sha1);
2255 + if (!cmit)
2256 + usage(describe_usage);
2257 +
2258 if (!initialized) {
2259 initialized = 1;
Junio C Hamanoc14e6ad2014-10-31 20:25:532260 for_each_ref(get_name);</code></pre>
Junio C Hamanofb56a962006-01-28 10:38:192261</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592262<div class="olist arabic"><ol class="arabic">
Junio C Hamano29f14312006-10-26 08:47:292263<li>
2264<p>
2265It is preceded with a "git diff" header, that looks like
Junio C Hamano92d80372016-07-13 22:00:052266 this (when <code>-c</code> option is used):
Junio C Hamano29f14312006-10-26 08:47:292267</p>
2268<div class="literalblock">
2269<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:532270<pre><code>diff --combined file</code></pre>
Junio C Hamano29f14312006-10-26 08:47:292271</div></div>
Junio C Hamano92d80372016-07-13 22:00:052272<div class="paragraph"><p>or like this (when <code>--cc</code> option is used):</p></div>
Junio C Hamano29f14312006-10-26 08:47:292273<div class="literalblock">
2274<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:532275<pre><code>diff --cc file</code></pre>
Junio C Hamano29f14312006-10-26 08:47:292276</div></div>
2277</li>
2278<li>
2279<p>
2280It is followed by one or more extended header lines
2281 (this example shows a merge with two parents):
2282</p>
2283<div class="literalblock">
2284<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:532285<pre><code>index &lt;hash&gt;,&lt;hash&gt;..&lt;hash&gt;
Junio C Hamano29f14312006-10-26 08:47:292286mode &lt;mode&gt;,&lt;mode&gt;..&lt;mode&gt;
2287new file mode &lt;mode&gt;
Junio C Hamanoc14e6ad2014-10-31 20:25:532288deleted file mode &lt;mode&gt;,&lt;mode&gt;</code></pre>
Junio C Hamano29f14312006-10-26 08:47:292289</div></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:532290<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:042291the &lt;mode&gt; is different from the rest. Extended headers with
Junio C Hamano29f14312006-10-26 08:47:292292information about detected contents movement (renames and
2293copying detection) are designed to work with diff of two
Junio C Hamanoba4b9282008-07-06 05:20:312294&lt;tree-ish&gt; and are not used by combined diff format.</p></div>
Junio C Hamano29f14312006-10-26 08:47:292295</li>
2296<li>
2297<p>
2298It is followed by two-line from-file/to-file header
2299</p>
2300<div class="literalblock">
2301<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:532302<pre><code>--- a/file
2303+++ b/file</code></pre>
Junio C Hamano29f14312006-10-26 08:47:292304</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592305<div class="paragraph"><p>Similar to two-line header for traditional <em>unified</em> diff
Junio C Hamanoc14e6ad2014-10-31 20:25:532306format, <code>/dev/null</code> is used to signal created or deleted
Junio C Hamanoba4b9282008-07-06 05:20:312307files.</p></div>
Junio C Hamano29f14312006-10-26 08:47:292308</li>
2309<li>
2310<p>
2311Chunk header format is modified to prevent people from
Junio C Hamanoc14e6ad2014-10-31 20:25:532312 accidentally feeding it to <code>patch -p1</code>. Combined diff format
Junio C Hamano29f14312006-10-26 08:47:292313 was created for review of merge commit changes, and was not
2314 meant for apply. The change is similar to the change in the
2315 extended <em>index</em> header:
2316</p>
2317<div class="literalblock">
2318<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:532319<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:292320</div></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:532321<div class="paragraph"><p>There are (number of parents + 1) <code>@</code> characters in the chunk
Junio C Hamanoba4b9282008-07-06 05:20:312322header for combined diff format.</p></div>
Junio C Hamano29f14312006-10-26 08:47:292323</li>
Junio C Hamanoba4b9282008-07-06 05:20:312324</ol></div>
Junio C Hamano68cf15a2010-11-06 01:01:592325<div class="paragraph"><p>Unlike the traditional <em>unified</em> diff format, which shows two
Junio C Hamanoc14e6ad2014-10-31 20:25:532326files 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
2327added to B), or <code>" "</code> (space&#8201;&#8212;&#8201;unchanged) prefix, this format
Junio C Hamanofb56a962006-01-28 10:38:192328compares two or more files file1, file2,&#8230; with one file X, and
2329shows how X differs from each of fileN. One column for each of
Junio C Hamano68cf15a2010-11-06 01:01:592330fileN is prepended to the output line to note how X&#8217;s line is
Junio C Hamanoba4b9282008-07-06 05:20:312331different from it.</p></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:532332<div class="paragraph"><p>A <code>-</code> character in the column N means that the line appears in
2333fileN but it does not appear in the result. A <code>+</code> character
Junio C Hamano54bf1e22008-12-20 06:30:112334in the column N means that the line appears in the result,
Junio C Hamano29f14312006-10-26 08:47:292335and fileN does not have that line (in other words, the line was
Junio C Hamanoba4b9282008-07-06 05:20:312336added, from the point of view of that parent).</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592337<div class="paragraph"><p>In the above example output, the function signature was changed
Junio C Hamanoc14e6ad2014-10-31 20:25:532338from both files (hence two <code>-</code> removals from both file1 and
2339file2, plus <code>++</code> to mean one line that was added does not appear
Junio C Hamanod75148a2014-04-08 19:48:382340in either file1 or file2). Also eight other lines are the same
Junio C Hamanoc14e6ad2014-10-31 20:25:532341from file1 but do not appear in file2 (hence prefixed with <code>+</code>).</p></div>
2342<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:192343merge commit with the merge result (i.e. file1..fileN are the
Junio C Hamanoc14e6ad2014-10-31 20:25:532344parents). When shown by <code>git diff-files -c</code>, it compares the
Junio C Hamanofb56a962006-01-28 10:38:192345two unresolved merge parents with the working tree file
2346(i.e. file1 is stage 2 aka "our version", file2 is stage 3 aka
Junio C Hamanoba4b9282008-07-06 05:20:312347"their version").</p></div>
Junio C Hamanofb56a962006-01-28 10:38:192348</div>
Junio C Hamano9629d4f2012-12-19 00:28:272349</div>
2350<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:312351<h2 id="_other_diff_formats">other diff formats</h2>
Junio C Hamano3a702342007-12-12 21:34:022352<div class="sectionbody">
Junio C Hamanoc14e6ad2014-10-31 20:25:532353<div class="paragraph"><p>The <code>--summary</code> option describes newly added, deleted, renamed and
2354copied files. The <code>--stat</code> option adds diffstat(1) graph to the
Junio C Hamano3a702342007-12-12 21:34:022355output. These options can be combined with other options, such as
Junio C Hamanoc14e6ad2014-10-31 20:25:532356<code>-p</code>, and are meant for human consumption.</p></div>
2357<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:022358formats the pathnames compactly by combining common prefix and suffix of
Junio C Hamanoc14e6ad2014-10-31 20:25:532359the pathnames. For example, a change that moves <code>arch/i386/Makefile</code> to
2360<code>arch/x86/Makefile</code> while modifying 4 lines will be shown like this:</p></div>
Junio C Hamano3a702342007-12-12 21:34:022361<div class="listingblock">
2362<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:532363<pre><code>arch/{i386 =&gt; x86}/Makefile | 4 +--</code></pre>
Junio C Hamano3a702342007-12-12 21:34:022364</div></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:532365<div class="paragraph"><p>The <code>--numstat</code> option gives the diffstat(1) information but is designed
2366for easier machine consumption. An entry in <code>--numstat</code> output looks
Junio C Hamanoba4b9282008-07-06 05:20:312367like this:</p></div>
Junio C Hamano3a702342007-12-12 21:34:022368<div class="listingblock">
2369<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:532370<pre><code>1 2 README
23713 1 arch/{i386 =&gt; x86}/Makefile</code></pre>
Junio C Hamano3a702342007-12-12 21:34:022372</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592373<div class="paragraph"><p>That is, from left to right:</p></div>
2374<div class="olist arabic"><ol class="arabic">
Junio C Hamano3a702342007-12-12 21:34:022375<li>
2376<p>
2377the number of added lines;
2378</p>
2379</li>
2380<li>
2381<p>
2382a tab;
2383</p>
2384</li>
2385<li>
2386<p>
2387the number of deleted lines;
2388</p>
2389</li>
2390<li>
2391<p>
2392a tab;
2393</p>
2394</li>
2395<li>
2396<p>
2397pathname (possibly with rename/copy information);
2398</p>
2399</li>
2400<li>
2401<p>
2402a newline.
2403</p>
2404</li>
Junio C Hamanoba4b9282008-07-06 05:20:312405</ol></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:532406<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:022407<div class="listingblock">
2408<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:532409<pre><code>1 2 README NUL
24103 1 NUL arch/i386/Makefile NUL arch/x86/Makefile NUL</code></pre>
Junio C Hamano3a702342007-12-12 21:34:022411</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592412<div class="paragraph"><p>That is:</p></div>
2413<div class="olist arabic"><ol class="arabic">
Junio C Hamano3a702342007-12-12 21:34:022414<li>
2415<p>
2416the number of added lines;
2417</p>
2418</li>
2419<li>
2420<p>
2421a tab;
2422</p>
2423</li>
2424<li>
2425<p>
2426the number of deleted lines;
2427</p>
2428</li>
2429<li>
2430<p>
2431a tab;
2432</p>
2433</li>
2434<li>
2435<p>
2436a NUL (only exists if renamed/copied);
2437</p>
2438</li>
2439<li>
2440<p>
2441pathname in preimage;
2442</p>
2443</li>
2444<li>
2445<p>
2446a NUL (only exists if renamed/copied);
2447</p>
2448</li>
2449<li>
2450<p>
2451pathname in postimage (only exists if renamed/copied);
2452</p>
2453</li>
2454<li>
2455<p>
2456a NUL.
2457</p>
2458</li>
Junio C Hamanoba4b9282008-07-06 05:20:312459</ol></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:532460<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:022461scripts that read the output to tell if the current record being read is
2462a single-path record or a rename/copy record without reading ahead.
Junio C Hamanoc14e6ad2014-10-31 20:25:532463After reading added and deleted lines, reading up to <code>NUL</code> would yield
2464the pathname, but if that is <code>NUL</code>, the record will show two paths.</p></div>
Junio C Hamano3a702342007-12-12 21:34:022465</div>
Junio C Hamano9629d4f2012-12-19 00:28:272466</div>
2467<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:312468<h2 id="_git">GIT</h2>
Junio C Hamano1a4e8412005-12-27 08:17:232469<div class="sectionbody">
Junio C Hamanoa28a9202012-06-21 07:08:232470<div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232471</div>
Junio C Hamano7bd050f2011-09-22 06:32:222472</div>
Junio C Hamano9629d4f2012-12-19 00:28:272473</div>
Junio C Hamano7bd050f2011-09-22 06:32:222474<div id="footnotes"><hr /></div>
Junio C Hamano1a4e8412005-12-27 08:17:232475<div id="footer">
2476<div id="footer-text">
Junio C Hamano2ef0ba32018-01-26 23:13:532477Last updated
Junio C Hamano96153bf2018-04-25 08:25:342478 2018-01-27 08:11:04 JST
Junio C Hamano1a4e8412005-12-27 08:17:232479</div>
2480</div>
2481</body>
2482</html>