blob: f6461d24c6f018c432904de288603ad4ef2e00fd [file] [log] [blame]
Junio C Hamano1a4e8412005-12-27 08:17:231<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
2 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
4<head>
Junio C Hamano9629d4f2012-12-19 00:28:275<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
6<meta name="generator" content="AsciiDoc 8.6.8" />
Junio C Hamano68cf15a2010-11-06 01:01:597<title>git-diff-tree(1)</title>
Junio C Hamano1a4e8412005-12-27 08:17:238<style type="text/css">
Junio C Hamano9629d4f2012-12-19 00:28:279/* Shared CSS for AsciiDoc xhtml11 and html5 backends */
10
11/* Default font. */
12body {
13 font-family: Georgia,serif;
14}
15
16/* Title font. */
17h1, h2, h3, h4, h5, h6,
18div.title, caption.title,
19thead, p.table.header,
20#toctitle,
21#author, #revnumber, #revdate, #revremark,
22#footer {
23 font-family: Arial,Helvetica,sans-serif;
Junio C Hamano1a4e8412005-12-27 08:17:2324}
25
26body {
27 margin: 1em 5% 1em 5%;
28}
29
Junio C Hamanoba4b9282008-07-06 05:20:3130a {
31 color: blue;
32 text-decoration: underline;
33}
34a:visited {
35 color: fuchsia;
36}
Junio C Hamano1a4e8412005-12-27 08:17:2337
38em {
39 font-style: italic;
Junio C Hamano68cf15a2010-11-06 01:01:5940 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:2341}
42
43strong {
44 font-weight: bold;
Junio C Hamano68cf15a2010-11-06 01:01:5945 color: #083194;
Junio C Hamano1a4e8412005-12-27 08:17:2346}
47
Junio C Hamano1a4e8412005-12-27 08:17:2348h1, h2, h3, h4, h5, h6 {
49 color: #527bbd;
Junio C Hamano1a4e8412005-12-27 08:17:2350 margin-top: 1.2em;
51 margin-bottom: 0.5em;
52 line-height: 1.3;
53}
54
Junio C Hamanoba4b9282008-07-06 05:20:3155h1, h2, h3 {
Junio C Hamano1a4e8412005-12-27 08:17:2356 border-bottom: 2px solid silver;
57}
58h2 {
Junio C Hamano1a4e8412005-12-27 08:17:2359 padding-top: 0.5em;
60}
Junio C Hamanoba4b9282008-07-06 05:20:3161h3 {
62 float: left;
63}
64h3 + * {
65 clear: left;
66}
Junio C Hamano9629d4f2012-12-19 00:28:2767h5 {
68 font-size: 1.0em;
69}
Junio C Hamano1a4e8412005-12-27 08:17:2370
71div.sectionbody {
Junio C Hamano1a4e8412005-12-27 08:17:2372 margin-left: 0;
73}
74
75hr {
76 border: 1px solid silver;
77}
78
79p {
80 margin-top: 0.5em;
81 margin-bottom: 0.5em;
82}
83
Junio C Hamano68cf15a2010-11-06 01:01:5984ul, ol, li > p {
85 margin-top: 0;
86}
Junio C Hamano9629d4f2012-12-19 00:28:2787ul > li { color: #aaa; }
88ul > li > * { color: black; }
Junio C Hamano68cf15a2010-11-06 01:01:5989
Junio C Hamano9629d4f2012-12-19 00:28:2790.monospaced, code, pre {
91 font-family: "Courier New", Courier, monospace;
92 font-size: inherit;
93 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:2394 padding: 0;
95 margin: 0;
96}
97
Junio C Hamano9629d4f2012-12-19 00:28:2798
99#author {
Junio C Hamano1a4e8412005-12-27 08:17:23100 color: #527bbd;
Junio C Hamano1a4e8412005-12-27 08:17:23101 font-weight: bold;
Junio C Hamanoba4b9282008-07-06 05:20:31102 font-size: 1.1em;
Junio C Hamano1a4e8412005-12-27 08:17:23103}
Junio C Hamano9629d4f2012-12-19 00:28:27104#email {
Junio C Hamano1a4e8412005-12-27 08:17:23105}
Junio C Hamano9629d4f2012-12-19 00:28:27106#revnumber, #revdate, #revremark {
Junio C Hamano1a4e8412005-12-27 08:17:23107}
108
Junio C Hamano9629d4f2012-12-19 00:28:27109#footer {
Junio C Hamano1a4e8412005-12-27 08:17:23110 font-size: small;
111 border-top: 2px solid silver;
112 padding-top: 0.5em;
113 margin-top: 4.0em;
114}
Junio C Hamano9629d4f2012-12-19 00:28:27115#footer-text {
Junio C Hamano1a4e8412005-12-27 08:17:23116 float: left;
117 padding-bottom: 0.5em;
118}
Junio C Hamano9629d4f2012-12-19 00:28:27119#footer-badges {
Junio C Hamano1a4e8412005-12-27 08:17:23120 float: right;
121 padding-bottom: 0.5em;
122}
123
Junio C Hamano9629d4f2012-12-19 00:28:27124#preamble {
Junio C Hamano68cf15a2010-11-06 01:01:59125 margin-top: 1.5em;
126 margin-bottom: 1.5em;
127}
Junio C Hamano9629d4f2012-12-19 00:28:27128div.imageblock, div.exampleblock, div.verseblock,
Junio C Hamano1a4e8412005-12-27 08:17:23129div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
130div.admonitionblock {
Junio C Hamano7bd050f2011-09-22 06:32:22131 margin-top: 1.0em;
Junio C Hamano1a4e8412005-12-27 08:17:23132 margin-bottom: 1.5em;
133}
134div.admonitionblock {
Junio C Hamano7bd050f2011-09-22 06:32:22135 margin-top: 2.0em;
136 margin-bottom: 2.0em;
137 margin-right: 10%;
138 color: #606060;
Junio C Hamano1a4e8412005-12-27 08:17:23139}
140
141div.content { /* Block element content. */
142 padding: 0;
143}
144
145/* Block element titles. */
146div.title, caption.title {
Junio C Hamano68cf15a2010-11-06 01:01:59147 color: #527bbd;
Junio C Hamano1a4e8412005-12-27 08:17:23148 font-weight: bold;
149 text-align: left;
150 margin-top: 1.0em;
151 margin-bottom: 0.5em;
152}
153div.title + * {
154 margin-top: 0;
155}
156
157td div.title:first-child {
158 margin-top: 0.0em;
159}
160div.content div.title:first-child {
161 margin-top: 0.0em;
162}
163div.content + div.title {
164 margin-top: 0.0em;
165}
166
167div.sidebarblock > div.content {
168 background: #ffffee;
Junio C Hamano9629d4f2012-12-19 00:28:27169 border: 1px solid #dddddd;
170 border-left: 4px solid #f0f0f0;
Junio C Hamano1a4e8412005-12-27 08:17:23171 padding: 0.5em;
172}
173
174div.listingblock > div.content {
Junio C Hamano9629d4f2012-12-19 00:28:27175 border: 1px solid #dddddd;
176 border-left: 5px solid #f0f0f0;
177 background: #f8f8f8;
Junio C Hamano1a4e8412005-12-27 08:17:23178 padding: 0.5em;
179}
180
Junio C Hamano7bd050f2011-09-22 06:32:22181div.quoteblock, div.verseblock {
182 padding-left: 1.0em;
183 margin-left: 1.0em;
Junio C Hamano68cf15a2010-11-06 01:01:59184 margin-right: 10%;
Junio C Hamano9629d4f2012-12-19 00:28:27185 border-left: 5px solid #f0f0f0;
186 color: #888;
Junio C Hamano1a4e8412005-12-27 08:17:23187}
Junio C Hamano7bd050f2011-09-22 06:32:22188
Junio C Hamano68cf15a2010-11-06 01:01:59189div.quoteblock > div.attribution {
190 padding-top: 0.5em;
Junio C Hamano1a4e8412005-12-27 08:17:23191 text-align: right;
192}
Junio C Hamano68cf15a2010-11-06 01:01:59193
Junio C Hamano9629d4f2012-12-19 00:28:27194div.verseblock > pre.content {
195 font-family: inherit;
196 font-size: inherit;
Junio C Hamano68cf15a2010-11-06 01:01:59197}
198div.verseblock > div.attribution {
199 padding-top: 0.75em;
200 text-align: left;
201}
202/* DEPRECATED: Pre version 8.2.7 verse style literal block. */
Junio C Hamanoba4b9282008-07-06 05:20:31203div.verseblock + div.attribution {
204 text-align: left;
205}
Junio C Hamano1a4e8412005-12-27 08:17:23206
207div.admonitionblock .icon {
208 vertical-align: top;
209 font-size: 1.1em;
210 font-weight: bold;
211 text-decoration: underline;
212 color: #527bbd;
213 padding-right: 0.5em;
214}
215div.admonitionblock td.content {
216 padding-left: 0.5em;
Junio C Hamano7bd050f2011-09-22 06:32:22217 border-left: 3px solid #dddddd;
Junio C Hamano1a4e8412005-12-27 08:17:23218}
219
220div.exampleblock > div.content {
Junio C Hamano7bd050f2011-09-22 06:32:22221 border-left: 3px solid #dddddd;
222 padding-left: 0.5em;
Junio C Hamano1a4e8412005-12-27 08:17:23223}
224
Junio C Hamano1a4e8412005-12-27 08:17:23225div.imageblock div.content { padding-left: 0; }
Junio C Hamano1a4e8412005-12-27 08:17:23226span.image img { border-style: none; }
Junio C Hamano68cf15a2010-11-06 01:01:59227a.image:visited { color: white; }
Junio C Hamano1a4e8412005-12-27 08:17:23228
229dl {
230 margin-top: 0.8em;
231 margin-bottom: 0.8em;
232}
233dt {
234 margin-top: 0.5em;
235 margin-bottom: 0;
Junio C Hamano68cf15a2010-11-06 01:01:59236 font-style: normal;
237 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:23238}
239dd > *:first-child {
Junio C Hamano68cf15a2010-11-06 01:01:59240 margin-top: 0.1em;
Junio C Hamano1a4e8412005-12-27 08:17:23241}
242
243ul, ol {
244 list-style-position: outside;
245}
Junio C Hamano68cf15a2010-11-06 01:01:59246ol.arabic {
247 list-style-type: decimal;
248}
249ol.loweralpha {
Junio C Hamano1a4e8412005-12-27 08:17:23250 list-style-type: lower-alpha;
251}
Junio C Hamano68cf15a2010-11-06 01:01:59252ol.upperalpha {
253 list-style-type: upper-alpha;
254}
255ol.lowerroman {
256 list-style-type: lower-roman;
257}
258ol.upperroman {
259 list-style-type: upper-roman;
260}
261
262div.compact ul, div.compact ol,
263div.compact p, div.compact p,
264div.compact div, div.compact div {
265 margin-top: 0.1em;
266 margin-bottom: 0.1em;
267}
Junio C Hamano1a4e8412005-12-27 08:17:23268
Junio C Hamano1a4e8412005-12-27 08:17:23269tfoot {
270 font-weight: bold;
271}
Junio C Hamano68cf15a2010-11-06 01:01:59272td > div.verse {
273 white-space: pre;
274}
Junio C Hamano68cf15a2010-11-06 01:01:59275
276div.hdlist {
Junio C Hamano1a4e8412005-12-27 08:17:23277 margin-top: 0.8em;
278 margin-bottom: 0.8em;
279}
Junio C Hamano68cf15a2010-11-06 01:01:59280div.hdlist tr {
281 padding-bottom: 15px;
Junio C Hamanoba4b9282008-07-06 05:20:31282}
Junio C Hamano68cf15a2010-11-06 01:01:59283dt.hdlist1.strong, td.hdlist1.strong {
284 font-weight: bold;
285}
286td.hdlist1 {
Junio C Hamano1a4e8412005-12-27 08:17:23287 vertical-align: top;
Junio C Hamano68cf15a2010-11-06 01:01:59288 font-style: normal;
Junio C Hamano1a4e8412005-12-27 08:17:23289 padding-right: 0.8em;
Junio C Hamano68cf15a2010-11-06 01:01:59290 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:23291}
Junio C Hamano68cf15a2010-11-06 01:01:59292td.hdlist2 {
Junio C Hamano1a4e8412005-12-27 08:17:23293 vertical-align: top;
294}
Junio C Hamano68cf15a2010-11-06 01:01:59295div.hdlist.compact tr {
296 margin: 0;
297 padding-bottom: 0;
298}
299
300.comment {
301 background: yellow;
302}
Junio C Hamano1a4e8412005-12-27 08:17:23303
Junio C Hamano7bd050f2011-09-22 06:32:22304.footnote, .footnoteref {
305 font-size: 0.8em;
306}
307
308span.footnote, span.footnoteref {
309 vertical-align: super;
310}
311
312#footnotes {
313 margin: 20px 0 20px 0;
314 padding: 7px 0 0 0;
315}
316
317#footnotes div.footnote {
318 margin: 0 0 5px 0;
319}
320
321#footnotes hr {
322 border: none;
323 border-top: 1px solid silver;
324 height: 1px;
325 text-align: left;
326 margin-left: 0;
327 width: 20%;
328 min-width: 100px;
329}
330
Junio C Hamano9629d4f2012-12-19 00:28:27331div.colist td {
332 padding-right: 0.5em;
333 padding-bottom: 0.3em;
334 vertical-align: top;
335}
336div.colist td img {
337 margin-top: 0.3em;
Junio C Hamano1a4e8412005-12-27 08:17:23338}
Junio C Hamanoba4b9282008-07-06 05:20:31339
Junio C Hamano9629d4f2012-12-19 00:28:27340@media print {
341 #footer-badges { display: none; }
342}
343
344#toc {
Junio C Hamano7bd050f2011-09-22 06:32:22345 margin-bottom: 2.5em;
346}
347
Junio C Hamano9629d4f2012-12-19 00:28:27348#toctitle {
Junio C Hamanoba4b9282008-07-06 05:20:31349 color: #527bbd;
Junio C Hamanoba4b9282008-07-06 05:20:31350 font-size: 1.1em;
351 font-weight: bold;
352 margin-top: 1.0em;
353 margin-bottom: 0.1em;
354}
355
Junio C Hamano9629d4f2012-12-19 00:28:27356div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
Junio C Hamanoba4b9282008-07-06 05:20:31357 margin-top: 0;
358 margin-bottom: 0;
359}
360div.toclevel2 {
361 margin-left: 2em;
362 font-size: 0.9em;
363}
364div.toclevel3 {
365 margin-left: 4em;
366 font-size: 0.9em;
367}
368div.toclevel4 {
369 margin-left: 6em;
370 font-size: 0.9em;
371}
Junio C Hamano9629d4f2012-12-19 00:28:27372
373span.aqua { color: aqua; }
374span.black { color: black; }
375span.blue { color: blue; }
376span.fuchsia { color: fuchsia; }
377span.gray { color: gray; }
378span.green { color: green; }
379span.lime { color: lime; }
380span.maroon { color: maroon; }
381span.navy { color: navy; }
382span.olive { color: olive; }
383span.purple { color: purple; }
384span.red { color: red; }
385span.silver { color: silver; }
386span.teal { color: teal; }
387span.white { color: white; }
388span.yellow { color: yellow; }
389
390span.aqua-background { background: aqua; }
391span.black-background { background: black; }
392span.blue-background { background: blue; }
393span.fuchsia-background { background: fuchsia; }
394span.gray-background { background: gray; }
395span.green-background { background: green; }
396span.lime-background { background: lime; }
397span.maroon-background { background: maroon; }
398span.navy-background { background: navy; }
399span.olive-background { background: olive; }
400span.purple-background { background: purple; }
401span.red-background { background: red; }
402span.silver-background { background: silver; }
403span.teal-background { background: teal; }
404span.white-background { background: white; }
405span.yellow-background { background: yellow; }
406
407span.big { font-size: 2em; }
408span.small { font-size: 0.6em; }
409
410span.underline { text-decoration: underline; }
411span.overline { text-decoration: overline; }
412span.line-through { text-decoration: line-through; }
413
414div.unbreakable { page-break-inside: avoid; }
415
416
417/*
418 * xhtml11 specific
419 *
420 * */
421
422div.tableblock {
423 margin-top: 1.0em;
424 margin-bottom: 1.5em;
425}
426div.tableblock > table {
427 border: 3px solid #527bbd;
428}
429thead, p.table.header {
430 font-weight: bold;
431 color: #527bbd;
432}
433p.table {
434 margin-top: 0;
435}
436/* Because the table frame attribute is overriden by CSS in most browsers. */
437div.tableblock > table[frame="void"] {
438 border-style: none;
439}
440div.tableblock > table[frame="hsides"] {
441 border-left-style: none;
442 border-right-style: none;
443}
444div.tableblock > table[frame="vsides"] {
445 border-top-style: none;
446 border-bottom-style: none;
447}
448
449
450/*
451 * html5 specific
452 *
453 * */
454
455table.tableblock {
456 margin-top: 1.0em;
457 margin-bottom: 1.5em;
458}
459thead, p.tableblock.header {
460 font-weight: bold;
461 color: #527bbd;
462}
463p.tableblock {
464 margin-top: 0;
465}
466table.tableblock {
467 border-width: 3px;
468 border-spacing: 0px;
469 border-style: solid;
470 border-color: #527bbd;
471 border-collapse: collapse;
472}
473th.tableblock, td.tableblock {
474 border-width: 1px;
475 padding: 4px;
476 border-style: solid;
477 border-color: #527bbd;
478}
479
480table.tableblock.frame-topbot {
481 border-left-style: hidden;
482 border-right-style: hidden;
483}
484table.tableblock.frame-sides {
485 border-top-style: hidden;
486 border-bottom-style: hidden;
487}
488table.tableblock.frame-none {
489 border-style: hidden;
490}
491
492th.tableblock.halign-left, td.tableblock.halign-left {
493 text-align: left;
494}
495th.tableblock.halign-center, td.tableblock.halign-center {
496 text-align: center;
497}
498th.tableblock.halign-right, td.tableblock.halign-right {
499 text-align: right;
500}
501
502th.tableblock.valign-top, td.tableblock.valign-top {
503 vertical-align: top;
504}
505th.tableblock.valign-middle, td.tableblock.valign-middle {
506 vertical-align: middle;
507}
508th.tableblock.valign-bottom, td.tableblock.valign-bottom {
509 vertical-align: bottom;
510}
511
512
513/*
514 * manpage specific
515 *
516 * */
517
518body.manpage h1 {
Junio C Hamano68cf15a2010-11-06 01:01:59519 padding-top: 0.5em;
520 padding-bottom: 0.5em;
521 border-top: 2px solid silver;
522 border-bottom: 2px solid silver;
523}
Junio C Hamano9629d4f2012-12-19 00:28:27524body.manpage h2 {
Junio C Hamano68cf15a2010-11-06 01:01:59525 border-style: none;
526}
Junio C Hamano9629d4f2012-12-19 00:28:27527body.manpage div.sectionbody {
528 margin-left: 3em;
Junio C Hamano68cf15a2010-11-06 01:01:59529}
530
531@media print {
Junio C Hamano9629d4f2012-12-19 00:28:27532 body.manpage div#toc { display: none; }
Junio C Hamano68cf15a2010-11-06 01:01:59533}
534
Junio C Hamano1a4e8412005-12-27 08:17:23535
Junio C Hamano1a4e8412005-12-27 08:17:23536</style>
Junio C Hamano7bd050f2011-09-22 06:32:22537<script type="text/javascript">
538/*<![CDATA[*/
Junio C Hamano7bd050f2011-09-22 06:32:22539var asciidoc = { // Namespace.
540
541/////////////////////////////////////////////////////////////////////
542// Table Of Contents generator
543/////////////////////////////////////////////////////////////////////
544
545/* Author: Mihai Bazon, September 2002
546 * http://students.infoiasi.ro/~mishoo
547 *
548 * Table Of Content generator
549 * Version: 0.4
550 *
551 * Feel free to use this script under the terms of the GNU General Public
552 * License, as long as you do not remove or alter this notice.
553 */
554
555 /* modified by Troy D. Hanson, September 2006. License: GPL */
556 /* modified by Stuart Rackham, 2006, 2009. License: GPL */
557
558// toclevels = 1..4.
559toc: function (toclevels) {
560
561 function getText(el) {
562 var text = "";
563 for (var i = el.firstChild; i != null; i = i.nextSibling) {
564 if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
565 text += i.data;
566 else if (i.firstChild != null)
567 text += getText(i);
568 }
569 return text;
570 }
571
572 function TocEntry(el, text, toclevel) {
573 this.element = el;
574 this.text = text;
575 this.toclevel = toclevel;
576 }
577
578 function tocEntries(el, toclevels) {
579 var result = new Array;
Junio C Hamano9629d4f2012-12-19 00:28:27580 var re = new RegExp('[hH]([1-'+(toclevels+1)+'])');
Junio C Hamano7bd050f2011-09-22 06:32:22581 // Function that scans the DOM tree for header elements (the DOM2
582 // nodeIterator API would be a better technique but not supported by all
583 // browsers).
584 var iterate = function (el) {
585 for (var i = el.firstChild; i != null; i = i.nextSibling) {
586 if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
587 var mo = re.exec(i.tagName);
588 if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
589 result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
590 }
591 iterate(i);
592 }
593 }
594 }
595 iterate(el);
596 return result;
597 }
598
599 var toc = document.getElementById("toc");
Junio C Hamano9629d4f2012-12-19 00:28:27600 if (!toc) {
601 return;
602 }
603
604 // Delete existing TOC entries in case we're reloading the TOC.
605 var tocEntriesToRemove = [];
606 var i;
607 for (i = 0; i < toc.childNodes.length; i++) {
608 var entry = toc.childNodes[i];
609 if (entry.nodeName.toLowerCase() == 'div'
610 && entry.getAttribute("class")
611 && entry.getAttribute("class").match(/^toclevel/))
612 tocEntriesToRemove.push(entry);
613 }
614 for (i = 0; i < tocEntriesToRemove.length; i++) {
615 toc.removeChild(tocEntriesToRemove[i]);
616 }
617
618 // Rebuild TOC entries.
Junio C Hamano7bd050f2011-09-22 06:32:22619 var entries = tocEntries(document.getElementById("content"), toclevels);
620 for (var i = 0; i < entries.length; ++i) {
621 var entry = entries[i];
622 if (entry.element.id == "")
623 entry.element.id = "_toc_" + i;
624 var a = document.createElement("a");
625 a.href = "#" + entry.element.id;
626 a.appendChild(document.createTextNode(entry.text));
627 var div = document.createElement("div");
628 div.appendChild(a);
629 div.className = "toclevel" + entry.toclevel;
630 toc.appendChild(div);
631 }
632 if (entries.length == 0)
633 toc.parentNode.removeChild(toc);
634},
635
636
637/////////////////////////////////////////////////////////////////////
638// Footnotes generator
639/////////////////////////////////////////////////////////////////////
640
641/* Based on footnote generation code from:
642 * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
643 */
644
645footnotes: function () {
Junio C Hamano9629d4f2012-12-19 00:28:27646 // Delete existing footnote entries in case we're reloading the footnodes.
647 var i;
Junio C Hamano7bd050f2011-09-22 06:32:22648 var noteholder = document.getElementById("footnotes");
Junio C Hamano9629d4f2012-12-19 00:28:27649 if (!noteholder) {
650 return;
651 }
652 var entriesToRemove = [];
653 for (i = 0; i < noteholder.childNodes.length; i++) {
654 var entry = noteholder.childNodes[i];
655 if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote")
656 entriesToRemove.push(entry);
657 }
658 for (i = 0; i < entriesToRemove.length; i++) {
659 noteholder.removeChild(entriesToRemove[i]);
660 }
661
662 // Rebuild footnote entries.
663 var cont = document.getElementById("content");
Junio C Hamano7bd050f2011-09-22 06:32:22664 var spans = cont.getElementsByTagName("span");
665 var refs = {};
666 var n = 0;
667 for (i=0; i<spans.length; i++) {
668 if (spans[i].className == "footnote") {
669 n++;
Junio C Hamano9629d4f2012-12-19 00:28:27670 var note = spans[i].getAttribute("data-note");
671 if (!note) {
672 // Use [\s\S] in place of . so multi-line matches work.
673 // Because JavaScript has no s (dotall) regex flag.
674 note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
675 spans[i].innerHTML =
676 "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
677 "' title='View footnote' class='footnote'>" + n + "</a>]";
678 spans[i].setAttribute("data-note", note);
679 }
Junio C Hamano7bd050f2011-09-22 06:32:22680 noteholder.innerHTML +=
681 "<div class='footnote' id='_footnote_" + n + "'>" +
682 "<a href='#_footnoteref_" + n + "' title='Return to text'>" +
683 n + "</a>. " + note + "</div>";
Junio C Hamano7bd050f2011-09-22 06:32:22684 var id =spans[i].getAttribute("id");
685 if (id != null) refs["#"+id] = n;
686 }
687 }
688 if (n == 0)
689 noteholder.parentNode.removeChild(noteholder);
690 else {
691 // Process footnoterefs.
692 for (i=0; i<spans.length; i++) {
693 if (spans[i].className == "footnoteref") {
694 var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
695 href = href.match(/#.*/)[0]; // Because IE return full URL.
696 n = refs[href];
697 spans[i].innerHTML =
698 "[<a href='#_footnote_" + n +
699 "' title='View footnote' class='footnote'>" + n + "</a>]";
700 }
701 }
702 }
Junio C Hamano9629d4f2012-12-19 00:28:27703},
704
705install: function(toclevels) {
706 var timerId;
707
708 function reinstall() {
709 asciidoc.footnotes();
710 if (toclevels) {
711 asciidoc.toc(toclevels);
712 }
713 }
714
715 function reinstallAndRemoveTimer() {
716 clearInterval(timerId);
717 reinstall();
718 }
719
720 timerId = setInterval(reinstall, 500);
721 if (document.addEventListener)
722 document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false);
723 else
724 window.onload = reinstallAndRemoveTimer;
Junio C Hamano7bd050f2011-09-22 06:32:22725}
726
727}
Junio C Hamano9629d4f2012-12-19 00:28:27728asciidoc.install();
Junio C Hamano7bd050f2011-09-22 06:32:22729/*]]>*/
730</script>
Junio C Hamano1a4e8412005-12-27 08:17:23731</head>
Junio C Hamano9629d4f2012-12-19 00:28:27732<body class="manpage">
Junio C Hamano1a4e8412005-12-27 08:17:23733<div id="header">
734<h1>
735git-diff-tree(1) Manual Page
736</h1>
737<h2>NAME</h2>
738<div class="sectionbody">
739<p>git-diff-tree -
740 Compares the content and mode of blobs found via two tree objects
741</p>
742</div>
743</div>
Junio C Hamano7bd050f2011-09-22 06:32:22744<div id="content">
Junio C Hamano9629d4f2012-12-19 00:28:27745<div class="sect1">
Junio C Hamano68cf15a2010-11-06 01:01:59746<h2 id="_synopsis">SYNOPSIS</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23747<div class="sectionbody">
Junio C Hamano235a91e2006-01-07 01:13:58748<div class="verseblock">
Junio C Hamano9629d4f2012-12-19 00:28:27749<pre class="content"><em>git diff-tree</em> [--stdin] [-m] [-s] [-v] [--no-commit-id] [--pretty]
Junio C Hamanofb56a962006-01-28 10:38:19750 [-t] [-r] [-c | --cc] [--root] [&lt;common diff options&gt;]
Junio C Hamano9629d4f2012-12-19 00:28:27751 &lt;tree-ish&gt; [&lt;tree-ish&gt;] [&lt;path&gt;&#8230;]</pre>
752<div class="attribution">
Junio C Hamano68cf15a2010-11-06 01:01:59753</div></div>
Junio C Hamano1a4e8412005-12-27 08:17:23754</div>
Junio C Hamano9629d4f2012-12-19 00:28:27755</div>
756<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:31757<h2 id="_description">DESCRIPTION</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23758<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:59759<div class="paragraph"><p>Compares the content and mode of the blobs found via two tree objects.</p></div>
760<div class="paragraph"><p>If there is only one &lt;tree-ish&gt; given, the commit is compared with its parents
Junio C Hamanoba4b9282008-07-06 05:20:31761(see --stdin below).</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:59762<div class="paragraph"><p>Note that <em>git diff-tree</em> can use the tree encapsulated in a commit object.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:23763</div>
Junio C Hamano9629d4f2012-12-19 00:28:27764</div>
765<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:31766<h2 id="_options">OPTIONS</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23767<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:59768<div class="dlist"><dl>
769<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:23770-p
771</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59772<dt class="hdlist1">
Junio C Hamanobbbb8652008-12-29 10:34:22773-u
774</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59775<dt class="hdlist1">
Junio C Hamanoe97d5772010-05-19 08:13:58776--patch
777</dt>
Junio C Hamano1a4e8412005-12-27 08:17:23778<dd>
779<p>
Junio C Hamanoff979792007-11-16 10:11:30780 Generate patch (see section on generating patches).
781
Junio C Hamano1a4e8412005-12-27 08:17:23782</p>
783</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59784<dt class="hdlist1">
Junio C Hamano69361562007-07-26 02:14:34785-U&lt;n&gt;
786</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59787<dt class="hdlist1">
Junio C Hamano69361562007-07-26 02:14:34788--unified=&lt;n&gt;
789</dt>
790<dd>
791<p>
792 Generate diffs with &lt;n&gt; lines of context instead of
Junio C Hamano3b70d3c2009-11-21 17:37:37793 the usual three.
Junio C Hamano9629d4f2012-12-19 00:28:27794 Implies <code>-p</code>.
Junio C Hamano69361562007-07-26 02:14:34795</p>
796</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59797<dt class="hdlist1">
Junio C Hamano9ae1a062006-07-10 08:12:34798--raw
799</dt>
800<dd>
801<p>
802 Generate the raw format.
Junio C Hamanoff979792007-11-16 10:11:30803 This is the default.
Junio C Hamano9ae1a062006-07-10 08:12:34804</p>
805</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59806<dt class="hdlist1">
Junio C Hamano54559c82006-04-13 07:45:12807--patch-with-raw
808</dt>
809<dd>
810<p>
Junio C Hamano9629d4f2012-12-19 00:28:27811 Synonym for <code>-p --raw</code>.
Junio C Hamano54559c82006-04-13 07:45:12812</p>
813</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59814<dt class="hdlist1">
Junio C Hamano5a73f302011-10-14 05:58:34815--minimal
816</dt>
817<dd>
818<p>
819 Spend extra time to make sure the smallest possible
820 diff is produced.
821</p>
822</dd>
823<dt class="hdlist1">
Junio C Hamano20d47e32009-01-26 06:36:02824--patience
825</dt>
826<dd>
827<p>
828 Generate a diff using the "patience diff" algorithm.
829</p>
830</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59831<dt class="hdlist1">
Junio C Hamanoaea9e6b2012-03-07 00:17:11832--histogram
833</dt>
834<dd>
835<p>
836 Generate a diff using the "histogram diff" algorithm.
837</p>
838</dd>
839<dt class="hdlist1">
Junio C Hamano4c4b0122011-06-30 01:19:32840--stat[=&lt;width&gt;[,&lt;name-width&gt;[,&lt;count&gt;]]]
Junio C Hamanoba7c8d82006-04-15 06:17:42841</dt>
842<dd>
843<p>
Junio C Hamanoaea9e6b2012-03-07 00:17:11844 Generate a diffstat. By default, as much space as necessary
845 will be used for the filename part, and the rest for the graph
846 part. Maximum width defaults to terminal width, or 80 columns
Junio C Hamano7f2b3cb2012-06-22 22:42:39847 if not connected to a terminal, and can be overridden by
Junio C Hamano9629d4f2012-12-19 00:28:27848 <code>&lt;width&gt;</code>. The width of the filename part can be limited by
849 giving another width <code>&lt;name-width&gt;</code> after a comma. The width
Junio C Hamanoaea9e6b2012-03-07 00:17:11850 of the graph part can be limited by using
Junio C Hamano9629d4f2012-12-19 00:28:27851 <code>--stat-graph-width=&lt;width&gt;</code> (affects all commands generating
852 a stat graph) or by setting <code>diff.statGraphWidth=&lt;width&gt;</code>
853 (does not affect <code>git format-patch</code>).
854 By giving a third parameter <code>&lt;count&gt;</code>, you can limit the
855 output to the first <code>&lt;count&gt;</code> lines, followed by <code>...</code> if
Junio C Hamanoaea9e6b2012-03-07 00:17:11856 there are more.
Junio C Hamanoba7c8d82006-04-15 06:17:42857</p>
Junio C Hamano9629d4f2012-12-19 00:28:27858<div class="paragraph"><p>These parameters can also be set individually with <code>--stat-width=&lt;width&gt;</code>,
859<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:42860</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59861<dt class="hdlist1">
Junio C Hamanofbe00522006-10-19 05:58:48862--numstat
863</dt>
864<dd>
865<p>
Junio C Hamano9629d4f2012-12-19 00:28:27866 Similar to <code>--stat</code>, but shows number of added and
Junio C Hamanofbe00522006-10-19 05:58:48867 deleted lines in decimal notation and pathname without
Junio C Hamanod793de52006-12-26 09:11:43868 abbreviation, to make it more machine friendly. For
Junio C Hamano9629d4f2012-12-19 00:28:27869 binary files, outputs two <code>-</code> instead of saying
870 <code>0 0</code>.
Junio C Hamanofbe00522006-10-19 05:58:48871</p>
872</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59873<dt class="hdlist1">
Junio C Hamano7d23f5e2006-12-16 07:44:04874--shortstat
875</dt>
876<dd>
877<p>
Junio C Hamano9629d4f2012-12-19 00:28:27878 Output only the last line of the <code>--stat</code> format containing total
Junio C Hamano7d23f5e2006-12-16 07:44:04879 number of modified files, as well as number of added and deleted
880 lines.
881</p>
882</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59883<dt class="hdlist1">
Junio C Hamano1c222c52011-05-13 19:55:32884--dirstat[=&lt;param1,param2,&#8230;&gt;]
Junio C Hamano6a45be92008-04-22 08:19:03885</dt>
886<dd>
887<p>
Junio C Hamano1c222c52011-05-13 19:55:32888 Output the distribution of relative amount of changes for each
Junio C Hamano9629d4f2012-12-19 00:28:27889 sub-directory. The behavior of <code>--dirstat</code> can be customized by
Junio C Hamano1c222c52011-05-13 19:55:32890 passing it a comma separated list of parameters.
Junio C Hamano9629d4f2012-12-19 00:28:27891 The defaults are controlled by the <code>diff.dirstat</code> configuration
Junio C Hamanoa28a9202012-06-21 07:08:23892 variable (see <a href="git-config.html">git-config(1)</a>).
Junio C Hamano1c222c52011-05-13 19:55:32893 The following parameters are available:
Junio C Hamano6a45be92008-04-22 08:19:03894</p>
Junio C Hamano9629d4f2012-12-19 00:28:27895<div class="openblock">
896<div class="content">
Junio C Hamano1c222c52011-05-13 19:55:32897<div class="dlist"><dl>
898<dt class="hdlist1">
Junio C Hamano9629d4f2012-12-19 00:28:27899<code>changes</code>
Junio C Hamano1c222c52011-05-13 19:55:32900</dt>
901<dd>
902<p>
903 Compute the dirstat numbers by counting the lines that have been
904 removed from the source, or added to the destination. This ignores
905 the amount of pure code movements within a file. In other words,
906 rearranging lines in a file is not counted as much as other changes.
907 This is the default behavior when no parameter is given.
908</p>
Junio C Hamano6a45be92008-04-22 08:19:03909</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59910<dt class="hdlist1">
Junio C Hamano9629d4f2012-12-19 00:28:27911<code>lines</code>
Junio C Hamanoa476efa2008-10-10 15:31:42912</dt>
913<dd>
914<p>
Junio C Hamano1c222c52011-05-13 19:55:32915 Compute the dirstat numbers by doing the regular line-based diff
916 analysis, and summing the removed/added line counts. (For binary
917 files, count 64-byte chunks instead, since binary files have no
Junio C Hamano9629d4f2012-12-19 00:28:27918 natural concept of lines). This is a more expensive <code>--dirstat</code>
919 behavior than the <code>changes</code> behavior, but it does count rearranged
Junio C Hamano1c222c52011-05-13 19:55:32920 lines within a file as much as other changes. The resulting output
Junio C Hamano9629d4f2012-12-19 00:28:27921 is consistent with what you get from the other <code>--*stat</code> options.
Junio C Hamanoa476efa2008-10-10 15:31:42922</p>
923</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59924<dt class="hdlist1">
Junio C Hamano9629d4f2012-12-19 00:28:27925<code>files</code>
Junio C Hamano1c222c52011-05-13 19:55:32926</dt>
927<dd>
928<p>
929 Compute the dirstat numbers by counting the number of files changed.
930 Each changed file counts equally in the dirstat analysis. This is
Junio C Hamano9629d4f2012-12-19 00:28:27931 the computationally cheapest <code>--dirstat</code> behavior, since it does
Junio C Hamano1c222c52011-05-13 19:55:32932 not have to look at the file contents at all.
933</p>
934</dd>
935<dt class="hdlist1">
Junio C Hamano9629d4f2012-12-19 00:28:27936<code>cumulative</code>
Junio C Hamano1c222c52011-05-13 19:55:32937</dt>
938<dd>
939<p>
940 Count changes in a child directory for the parent directory as well.
Junio C Hamano9629d4f2012-12-19 00:28:27941 Note that when using <code>cumulative</code>, the sum of the percentages
Junio C Hamano1c222c52011-05-13 19:55:32942 reported may exceed 100%. The default (non-cumulative) behavior can
Junio C Hamano9629d4f2012-12-19 00:28:27943 be specified with the <code>noncumulative</code> parameter.
Junio C Hamano1c222c52011-05-13 19:55:32944</p>
945</dd>
946<dt class="hdlist1">
947&lt;limit&gt;
948</dt>
949<dd>
950<p>
951 An integer parameter specifies a cut-off percent (3% by default).
952 Directories contributing less than this percentage of the changes
953 are not shown in the output.
954</p>
955</dd>
956</dl></div>
Junio C Hamano9629d4f2012-12-19 00:28:27957</div></div>
Junio C Hamano1c222c52011-05-13 19:55:32958<div class="paragraph"><p>Example: The following will count changed files, while ignoring
959directories with less than 10% of the total amount of changed files,
960and accumulating child directory counts in the parent directories:
Junio C Hamano9629d4f2012-12-19 00:28:27961<code>--dirstat=files,10,cumulative</code>.</p></div>
Junio C Hamano1c222c52011-05-13 19:55:32962</dd>
963<dt class="hdlist1">
Junio C Hamano6959c6c2006-05-17 10:34:11964--summary
965</dt>
966<dd>
967<p>
968 Output a condensed summary of extended header information
969 such as creations, renames and mode changes.
970</p>
971</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59972<dt class="hdlist1">
Junio C Hamanod1308c92006-04-16 11:01:09973--patch-with-stat
974</dt>
975<dd>
976<p>
Junio C Hamano9629d4f2012-12-19 00:28:27977 Synonym for <code>-p --stat</code>.
Junio C Hamanod1308c92006-04-16 11:01:09978</p>
979</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59980<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:23981-z
982</dt>
983<dd>
984<p>
Junio C Hamano9629d4f2012-12-19 00:28:27985 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:34986 given, do not munge pathnames and use NULs as output field terminators.
Junio C Hamano1a4e8412005-12-27 08:17:23987</p>
Junio C Hamano68cf15a2010-11-06 01:01:59988<div class="paragraph"><p>Without this option, each pathname output will have TAB, LF, double quotes,
Junio C Hamano9629d4f2012-12-19 00:28:27989and backslash characters replaced with <code>\t</code>, <code>\n</code>, <code>\"</code>, and <code>\\</code>,
Junio C Hamano5706e0b2009-11-24 10:54:16990respectively, and the pathname will be enclosed in double quotes if
991any of those replacements occurred.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:23992</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59993<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:23994--name-only
995</dt>
996<dd>
997<p>
998 Show only names of changed files.
999</p>
1000</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591001<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231002--name-status
1003</dt>
1004<dd>
1005<p>
Junio C Hamanoa9aee782008-04-23 16:09:201006 Show only names and status of changed files. See the description
Junio C Hamano9629d4f2012-12-19 00:28:271007 of the <code>--diff-filter</code> option on what the status letters mean.
Junio C Hamano1a4e8412005-12-27 08:17:231008</p>
1009</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591010<dt class="hdlist1">
Junio C Hamanoc21ab052009-10-31 04:03:551011--submodule[=&lt;format&gt;]
1012</dt>
1013<dd>
1014<p>
Junio C Hamano9629d4f2012-12-19 00:28:271015 Specify how differences in submodules are shown. When <code>--submodule</code>
1016 or <code>--submodule=log</code> is given, the <em>log</em> format is used. This format lists
1017 the commits in the range like <a href="git-submodule.html">git-submodule(1)</a> <code>summary</code> does.
1018 Omitting the <code>--submodule</code> option or specifying <code>--submodule=short</code>,
Junio C Hamanoe768cc12012-03-16 05:43:051019 uses the <em>short</em> format. This format just shows the names of the commits
Junio C Hamanob4e58b12012-11-26 03:13:061020 at the beginning and end of the range. Can be tweaked via the
Junio C Hamano9629d4f2012-12-19 00:28:271021 <code>diff.submodule</code> configuration variable.
Junio C Hamanoc21ab052009-10-31 04:03:551022</p>
1023</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591024<dt class="hdlist1">
Junio C Hamano4aa0bcc2010-03-03 05:13:121025--color[=&lt;when&gt;]
Junio C Hamano9ae1a062006-07-10 08:12:341026</dt>
1027<dd>
1028<p>
1029 Show colored diff.
Junio C Hamano9629d4f2012-12-19 00:28:271030 The value must be <code>always</code> (the default for <code>&lt;when&gt;</code>), <code>never</code>, or <code>auto</code>.
1031 The default value is <code>never</code>.
Junio C Hamano9ae1a062006-07-10 08:12:341032</p>
1033</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591034<dt class="hdlist1">
Junio C Hamano9ae1a062006-07-10 08:12:341035--no-color
1036</dt>
1037<dd>
1038<p>
Junio C Hamano5f2627d2011-05-06 20:23:481039 Turn off colored diff.
Junio C Hamano9629d4f2012-12-19 00:28:271040 It is the same as <code>--color=never</code>.
Junio C Hamano9ae1a062006-07-10 08:12:341041</p>
1042</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591043<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531044--word-diff[=&lt;mode&gt;]
Junio C Hamano85e45fa2006-08-13 07:47:411045</dt>
1046<dd>
1047<p>
Junio C Hamanocc7636a2010-05-21 14:57:531048 Show a word diff, using the &lt;mode&gt; to delimit changed words.
1049 By default, words are delimited by whitespace; see
Junio C Hamano9629d4f2012-12-19 00:28:271050 <code>--word-diff-regex</code> below. The &lt;mode&gt; defaults to <em>plain</em>, and
Junio C Hamanocc7636a2010-05-21 14:57:531051 must be one of:
Junio C Hamano85e45fa2006-08-13 07:47:411052</p>
Junio C Hamano9629d4f2012-12-19 00:28:271053<div class="openblock">
1054<div class="content">
Junio C Hamano68cf15a2010-11-06 01:01:591055<div class="dlist"><dl>
1056<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531057color
1058</dt>
1059<dd>
1060<p>
Junio C Hamano9629d4f2012-12-19 00:28:271061 Highlight changed words using only colors. Implies <code>--color</code>.
Junio C Hamanocc7636a2010-05-21 14:57:531062</p>
1063</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591064<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531065plain
1066</dt>
1067<dd>
1068<p>
Junio C Hamano9629d4f2012-12-19 00:28:271069 Show words as <code>[-removed-]</code> and <code>{+added+}</code>. Makes no
Junio C Hamanocc7636a2010-05-21 14:57:531070 attempts to escape the delimiters if they appear in the input,
1071 so the output may be ambiguous.
1072</p>
1073</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591074<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531075porcelain
1076</dt>
1077<dd>
1078<p>
1079 Use a special line-based format intended for script
1080 consumption. Added/removed/unchanged runs are printed in the
Junio C Hamano9629d4f2012-12-19 00:28:271081 usual unified diff format, starting with a <code>+</code>/<code>-</code>/` `
Junio C Hamanocc7636a2010-05-21 14:57:531082 character at the beginning of the line and extending to the
1083 end of the line. Newlines in the input are represented by a
Junio C Hamano9629d4f2012-12-19 00:28:271084 tilde <code>~</code> on a line of its own.
Junio C Hamanocc7636a2010-05-21 14:57:531085</p>
1086</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591087<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531088none
1089</dt>
1090<dd>
1091<p>
1092 Disable word diff again.
1093</p>
1094</dd>
1095</dl></div>
Junio C Hamano9629d4f2012-12-19 00:28:271096</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591097<div class="paragraph"><p>Note that despite the name of the first mode, color is used to
Junio C Hamanocc7636a2010-05-21 14:57:531098highlight the changed parts in all modes if enabled.</p></div>
1099</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591100<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531101--word-diff-regex=&lt;regex&gt;
1102</dt>
1103<dd>
1104<p>
1105 Use &lt;regex&gt; to decide what a word is, instead of considering
1106 runs of non-whitespace to be a word. Also implies
Junio C Hamano9629d4f2012-12-19 00:28:271107 <code>--word-diff</code> unless it was already enabled.
Junio C Hamanocc7636a2010-05-21 14:57:531108</p>
Junio C Hamano68cf15a2010-11-06 01:01:591109<div class="paragraph"><p>Every non-overlapping match of the
Junio C Hamano20d47e32009-01-26 06:36:021110&lt;regex&gt; is considered a word. Anything between these matches is
1111considered whitespace and ignored(!) for the purposes of finding
Junio C Hamano9629d4f2012-12-19 00:28:271112differences. You may want to append <code>|[^[:space:]]</code> to your regular
Junio C Hamano20d47e32009-01-26 06:36:021113expression to make sure that it matches all non-whitespace characters.
1114A match that contains a newline is silently truncated(!) at the
1115newline.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591116<div class="paragraph"><p>The regex can also be set via a diff driver or configuration option, see
Junio C Hamanoa28a9202012-06-21 07:08:231117<a href="gitattributes.html">gitattributes(1)</a> or <a href="git-config.html">git-config(1)</a>. Giving it explicitly
Junio C Hamano20d47e32009-01-26 06:36:021118overrides any diff driver or configuration setting. Diff drivers
1119override configuration settings.</p></div>
Junio C Hamano85e45fa2006-08-13 07:47:411120</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591121<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531122--color-words[=&lt;regex&gt;]
1123</dt>
1124<dd>
1125<p>
Junio C Hamano9629d4f2012-12-19 00:28:271126 Equivalent to <code>--word-diff=color</code> plus (if a regex was
1127 specified) <code>--word-diff-regex=&lt;regex&gt;</code>.
Junio C Hamanocc7636a2010-05-21 14:57:531128</p>
1129</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591130<dt class="hdlist1">
Junio C Hamano9ae1a062006-07-10 08:12:341131--no-renames
1132</dt>
1133<dd>
1134<p>
1135 Turn off rename detection, even when the configuration
1136 file gives the default to do so.
1137</p>
1138</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591139<dt class="hdlist1">
Junio C Hamanoa890c4f2007-01-28 10:29:211140--check
1141</dt>
1142<dd>
1143<p>
Junio C Hamano6005bfa2011-06-23 00:51:221144 Warn if changes introduce whitespace errors. What are
Junio C Hamano9629d4f2012-12-19 00:28:271145 considered whitespace errors is controlled by <code>core.whitespace</code>
Junio C Hamano6005bfa2011-06-23 00:51:221146 configuration. By default, trailing whitespaces (including
1147 lines that solely consist of whitespaces) and a space character
1148 that is immediately followed by a tab character inside the
1149 initial indent of the line are considered whitespace errors.
1150 Exits with non-zero status if problems are found. Not compatible
1151 with --exit-code.
Junio C Hamanoa890c4f2007-01-28 10:29:211152</p>
1153</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591154<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231155--full-index
1156</dt>
1157<dd>
1158<p>
Junio C Hamano5cf43ca2008-08-20 09:14:141159 Instead of the first handful of characters, show the full
1160 pre- and post-image blob object names on the "index"
1161 line when generating patch format output.
Junio C Hamano1a4e8412005-12-27 08:17:231162</p>
1163</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591164<dt class="hdlist1">
Junio C Hamano9ae1a062006-07-10 08:12:341165--binary
1166</dt>
1167<dd>
1168<p>
Junio C Hamano9629d4f2012-12-19 00:28:271169 In addition to <code>--full-index</code>, output a binary diff that
1170 can be applied with <code>git-apply</code>.
Junio C Hamano9ae1a062006-07-10 08:12:341171</p>
1172</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591173<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231174--abbrev[=&lt;n&gt;]
1175</dt>
1176<dd>
1177<p>
1178 Instead of showing the full 40-byte hexadecimal object
1179 name in diff-raw format output and diff-tree header
Junio C Hamano6efe3022009-01-13 16:47:561180 lines, show only a partial prefix. This is
Junio C Hamano9629d4f2012-12-19 00:28:271181 independent of the <code>--full-index</code> option above, which controls
Junio C Hamano1a4e8412005-12-27 08:17:231182 the diff-patch output format. Non default number of
Junio C Hamano9629d4f2012-12-19 00:28:271183 digits can be specified with <code>--abbrev=&lt;n&gt;</code>.
Junio C Hamano1a4e8412005-12-27 08:17:231184</p>
1185</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591186<dt class="hdlist1">
Junio C Hamanoe85e36f2010-08-10 05:30:141187-B[&lt;n&gt;][/&lt;m&gt;]
Junio C Hamano1a4e8412005-12-27 08:17:231188</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591189<dt class="hdlist1">
Junio C Hamano39c7a692010-10-27 06:08:541190--break-rewrites[=[&lt;n&gt;][/&lt;m&gt;]]
1191</dt>
Junio C Hamano1a4e8412005-12-27 08:17:231192<dd>
1193<p>
Junio C Hamanoe85e36f2010-08-10 05:30:141194 Break complete rewrite changes into pairs of delete and
1195 create. This serves two purposes:
Junio C Hamano1a4e8412005-12-27 08:17:231196</p>
Junio C Hamano68cf15a2010-11-06 01:01:591197<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:141198not as a series of deletion and insertion mixed together with a very
1199few lines that happen to match textually as the context, but as a
1200single deletion of everything old followed by a single insertion of
Junio C Hamano9629d4f2012-12-19 00:28:271201everything new, and the number <code>m</code> controls this aspect of the -B
1202option (defaults to 60%). <code>-B/70%</code> specifies that less than 30% of the
Junio C Hamanoe85e36f2010-08-10 05:30:141203original should remain in the result for git to consider it a total
1204rewrite (i.e. otherwise the resulting patch will be a series of
1205deletion and insertion mixed together with context lines).</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591206<div class="paragraph"><p>When used with -M, a totally-rewritten file is also considered as the
Junio C Hamanoe85e36f2010-08-10 05:30:141207source of a rename (usually -M only considers a file that disappeared
Junio C Hamano9629d4f2012-12-19 00:28:271208as the source of a rename), and the number <code>n</code> controls this aspect of
1209the -B option (defaults to 50%). <code>-B20%</code> specifies that a change with
Junio C Hamano68cf15a2010-11-06 01:01:591210addition and deletion compared to 20% or more of the file&#8217;s size are
Junio C Hamanoe85e36f2010-08-10 05:30:141211eligible for being picked up as a possible source of a rename to
1212another file.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231213</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591214<dt class="hdlist1">
Junio C Hamanoe85e36f2010-08-10 05:30:141215-M[&lt;n&gt;]
Junio C Hamano1a4e8412005-12-27 08:17:231216</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591217<dt class="hdlist1">
Junio C Hamano0d75e872010-12-17 06:57:261218--find-renames[=&lt;n&gt;]
Junio C Hamano39c7a692010-10-27 06:08:541219</dt>
Junio C Hamano1a4e8412005-12-27 08:17:231220<dd>
1221<p>
1222 Detect renames.
Junio C Hamano9629d4f2012-12-19 00:28:271223 If <code>n</code> is specified, it is a threshold on the similarity
Junio C Hamanoe85e36f2010-08-10 05:30:141224 index (i.e. amount of addition/deletions compared to the
Junio C Hamano9629d4f2012-12-19 00:28:271225 file&#8217;s size). For example, <code>-M90%</code> means git should consider a
Junio C Hamanoe85e36f2010-08-10 05:30:141226 delete/add pair to be a rename if more than 90% of the file
Junio C Hamano9629d4f2012-12-19 00:28:271227 hasn&#8217;t changed. Without a <code>%</code> sign, the number is to be read as
1228 a fraction, with a decimal point before it. I.e., <code>-M5</code> becomes
1229 0.5, and is thus the same as <code>-M50%</code>. Similarly, <code>-M05</code> is
1230 the same as <code>-M5%</code>. To limit detection to exact renames, use
1231 <code>-M100%</code>.
Junio C Hamano1a4e8412005-12-27 08:17:231232</p>
1233</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591234<dt class="hdlist1">
Junio C Hamanoe85e36f2010-08-10 05:30:141235-C[&lt;n&gt;]
Junio C Hamano1a4e8412005-12-27 08:17:231236</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591237<dt class="hdlist1">
Junio C Hamano0d75e872010-12-17 06:57:261238--find-copies[=&lt;n&gt;]
Junio C Hamano39c7a692010-10-27 06:08:541239</dt>
Junio C Hamano1a4e8412005-12-27 08:17:231240<dd>
1241<p>
Junio C Hamano9629d4f2012-12-19 00:28:271242 Detect copies as well as renames. See also <code>--find-copies-harder</code>.
1243 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:231244</p>
1245</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591246<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231247--find-copies-harder
1248</dt>
1249<dd>
1250<p>
Junio C Hamano9629d4f2012-12-19 00:28:271251 For performance reasons, by default, <code>-C</code> option finds copies only
Junio C Hamano1a4e8412005-12-27 08:17:231252 if the original file of the copy was modified in the same
1253 changeset. This flag makes the command
1254 inspect unmodified files as candidates for the source of
1255 copy. This is a very expensive operation for large
Junio C Hamano16f98872007-06-12 16:09:141256 projects, so use it with caution. Giving more than one
Junio C Hamano9629d4f2012-12-19 00:28:271257 <code>-C</code> option has the same effect.
Junio C Hamano1a4e8412005-12-27 08:17:231258</p>
1259</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591260<dt class="hdlist1">
Junio C Hamanob02377c2011-04-28 22:26:021261-D
1262</dt>
1263<dt class="hdlist1">
1264--irreversible-delete
1265</dt>
1266<dd>
1267<p>
1268 Omit the preimage for deletes, i.e. print only the header but not
Junio C Hamano9629d4f2012-12-19 00:28:271269 the diff between the preimage and <code>/dev/null</code>. The resulting patch
1270 is not meant to be applied with <code>patch</code> nor <code>git apply</code>; this is
Junio C Hamanob02377c2011-04-28 22:26:021271 solely for people who want to just concentrate on reviewing the
1272 text after the change. In addition, the output obviously lack
1273 enough information to apply such a patch in reverse, even manually,
1274 hence the name of the option.
1275</p>
Junio C Hamano9629d4f2012-12-19 00:28:271276<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:021277of a delete/create pair.</p></div>
1278</dd>
1279<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231280-l&lt;num&gt;
1281</dt>
1282<dd>
1283<p>
Junio C Hamano9629d4f2012-12-19 00:28:271284 The <code>-M</code> and <code>-C</code> options require O(n^2) processing time where n
Junio C Hamano1a4e8412005-12-27 08:17:231285 is the number of potential rename/copy targets. This
1286 option prevents rename/copy detection from running if
1287 the number of rename/copy targets exceeds the specified
1288 number.
1289</p>
1290</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591291<dt class="hdlist1">
Junio C Hamano982eb112010-11-18 00:53:091292--diff-filter=[(A|C|D|M|R|T|U|X|B)&#8230;[*]]
1293</dt>
1294<dd>
1295<p>
Junio C Hamano9629d4f2012-12-19 00:28:271296 Select only files that are Added (<code>A</code>), Copied (<code>C</code>),
1297 Deleted (<code>D</code>), Modified (<code>M</code>), Renamed (<code>R</code>), have their
1298 type (i.e. regular file, symlink, submodule, &#8230;) changed (<code>T</code>),
1299 are Unmerged (<code>U</code>), are
1300 Unknown (<code>X</code>), or have had their pairing Broken (<code>B</code>).
Junio C Hamano982eb112010-11-18 00:53:091301 Any combination of the filter characters (including none) can be used.
Junio C Hamano9629d4f2012-12-19 00:28:271302 When <code>*</code> (All-or-none) is added to the combination, all
Junio C Hamano982eb112010-11-18 00:53:091303 paths are selected if there is any file that matches
1304 other criteria in the comparison; if there is no file
1305 that matches other criteria, nothing is selected.
1306</p>
1307</dd>
1308<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231309-S&lt;string&gt;
1310</dt>
1311<dd>
1312<p>
Junio C Hamano5217a272009-03-21 00:39:331313 Look for differences that introduce or remove an instance of
1314 &lt;string&gt;. Note that this is different than the string simply
1315 appearing in diff output; see the <em>pickaxe</em> entry in
Junio C Hamanoa28a9202012-06-21 07:08:231316 <a href="gitdiffcore.html">gitdiffcore(7)</a> for more details.
Junio C Hamano1a4e8412005-12-27 08:17:231317</p>
1318</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591319<dt class="hdlist1">
Junio C Hamano3b4609d2010-09-30 00:04:341320-G&lt;regex&gt;
1321</dt>
1322<dd>
1323<p>
1324 Look for differences whose added or removed line matches
1325 the given &lt;regex&gt;.
1326</p>
1327</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591328<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231329--pickaxe-all
1330</dt>
1331<dd>
1332<p>
Junio C Hamano9629d4f2012-12-19 00:28:271333 When <code>-S</code> or <code>-G</code> finds a change, show all the changes in that
Junio C Hamano1a4e8412005-12-27 08:17:231334 changeset, not just the files that contain the change
1335 in &lt;string&gt;.
1336</p>
1337</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591338<dt class="hdlist1">
Junio C Hamanobfe9e752006-04-05 21:43:281339--pickaxe-regex
1340</dt>
1341<dd>
1342<p>
1343 Make the &lt;string&gt; not a plain string but an extended POSIX
1344 regex to match.
1345</p>
1346</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591347<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231348-O&lt;orderfile&gt;
1349</dt>
1350<dd>
1351<p>
1352 Output the patch in the order specified in the
1353 &lt;orderfile&gt;, which has one shell glob pattern per line.
1354</p>
1355</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591356<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231357-R
1358</dt>
1359<dd>
1360<p>
1361 Swap two inputs; that is, show differences from index or
1362 on-disk file to tree contents.
1363</p>
1364</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591365<dt class="hdlist1">
Junio C Hamano24bc09a2008-02-28 00:27:441366--relative[=&lt;path&gt;]
1367</dt>
1368<dd>
1369<p>
1370 When run from a subdirectory of the project, it can be
1371 told to exclude changes outside the directory and show
1372 pathnames relative to it with this option. When you are
1373 not in a subdirectory (e.g. in a bare repository), you
1374 can name which subdirectory to make the output relative
1375 to by giving a &lt;path&gt; as an argument.
1376</p>
1377</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591378<dt class="hdlist1">
Junio C Hamanobbbb8652008-12-29 10:34:221379-a
1380</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591381<dt class="hdlist1">
Junio C Hamanoc26f5482006-07-09 09:38:141382--text
1383</dt>
1384<dd>
1385<p>
1386 Treat all files as text.
1387</p>
1388</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591389<dt class="hdlist1">
Junio C Hamanofd468962007-02-14 23:45:041390--ignore-space-at-eol
1391</dt>
1392<dd>
1393<p>
Junio C Hamano3a702342007-12-12 21:34:021394 Ignore changes in whitespace at EOL.
Junio C Hamanofd468962007-02-14 23:45:041395</p>
1396</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591397<dt class="hdlist1">
Junio C Hamanobbbb8652008-12-29 10:34:221398-b
1399</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591400<dt class="hdlist1">
Junio C Hamanod9c2d2f2006-12-06 08:59:071401--ignore-space-change
1402</dt>
1403<dd>
1404<p>
Junio C Hamano3a702342007-12-12 21:34:021405 Ignore changes in amount of whitespace. This ignores whitespace
1406 at line end, and considers all other sequences of one or
1407 more whitespace characters to be equivalent.
Junio C Hamanod9c2d2f2006-12-06 08:59:071408</p>
1409</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591410<dt class="hdlist1">
Junio C Hamanobbbb8652008-12-29 10:34:221411-w
Junio C Hamanod9c2d2f2006-12-06 08:59:071412</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591413<dt class="hdlist1">
Junio C Hamanod9c2d2f2006-12-06 08:59:071414--ignore-all-space
1415</dt>
1416<dd>
1417<p>
Junio C Hamano3a702342007-12-12 21:34:021418 Ignore whitespace when comparing lines. This ignores
1419 differences even if one line has whitespace where the other
Junio C Hamanod9c2d2f2006-12-06 08:59:071420 line has none.
1421</p>
1422</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591423<dt class="hdlist1">
Junio C Hamano1d40ee82009-01-07 10:14:161424--inter-hunk-context=&lt;lines&gt;
1425</dt>
1426<dd>
1427<p>
1428 Show the context between diff hunks, up to the specified number
1429 of lines, thereby fusing hunks that are close to each other.
1430</p>
1431</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591432<dt class="hdlist1">
Junio C Hamano11821ed2011-10-19 18:42:091433-W
1434</dt>
1435<dt class="hdlist1">
1436--function-context
1437</dt>
1438<dd>
1439<p>
1440 Show whole surrounding functions of changes.
1441</p>
1442</dd>
1443<dt class="hdlist1">
Junio C Hamano48fd2f62007-03-19 02:02:301444--exit-code
1445</dt>
1446<dd>
1447<p>
1448 Make the program exit with codes similar to diff(1).
1449 That is, it exits with 1 if there were differences and
1450 0 means no differences.
1451</p>
1452</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591453<dt class="hdlist1">
Junio C Hamano35e57552007-03-25 07:54:351454--quiet
1455</dt>
1456<dd>
1457<p>
Junio C Hamano9629d4f2012-12-19 00:28:271458 Disable all output of the program. Implies <code>--exit-code</code>.
Junio C Hamano35e57552007-03-25 07:54:351459</p>
1460</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591461<dt class="hdlist1">
Junio C Hamanobb0f4042007-07-04 06:41:401462--ext-diff
1463</dt>
1464<dd>
1465<p>
1466 Allow an external diff helper to be executed. If you set an
Junio C Hamanoa28a9202012-06-21 07:08:231467 external diff driver with <a href="gitattributes.html">gitattributes(5)</a>, you need
1468 to use this option with <a href="git-log.html">git-log(1)</a> and friends.
Junio C Hamanobb0f4042007-07-04 06:41:401469</p>
1470</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591471<dt class="hdlist1">
Junio C Hamanobb0f4042007-07-04 06:41:401472--no-ext-diff
1473</dt>
1474<dd>
1475<p>
1476 Disallow external diff drivers.
1477</p>
1478</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591479<dt class="hdlist1">
Junio C Hamanoc652aed2011-07-07 01:14:311480--textconv
1481</dt>
1482<dt class="hdlist1">
1483--no-textconv
1484</dt>
1485<dd>
1486<p>
1487 Allow (or disallow) external text conversion filters to be run
Junio C Hamanoa28a9202012-06-21 07:08:231488 when comparing binary files. See <a href="gitattributes.html">gitattributes(5)</a> for
Junio C Hamanoc652aed2011-07-07 01:14:311489 details. Because textconv filters are typically a one-way
1490 conversion, the resulting diff is suitable for human
1491 consumption, but cannot be applied. For this reason, textconv
Junio C Hamanoa28a9202012-06-21 07:08:231492 filters are enabled by default only for <a href="git-diff.html">git-diff(1)</a> and
1493 <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:311494 diff plumbing commands.
1495</p>
1496</dd>
1497<dt class="hdlist1">
Junio C Hamano7d449522010-07-01 00:08:511498--ignore-submodules[=&lt;when&gt;]
Junio C Hamanodfccbb02008-05-26 01:16:141499</dt>
1500<dd>
1501<p>
Junio C Hamano7d449522010-07-01 00:08:511502 Ignore changes to submodules in the diff generation. &lt;when&gt; can be
Junio C Hamano619596a2010-08-18 22:15:351503 either "none", "untracked", "dirty" or "all", which is the default
1504 Using "none" will consider the submodule modified when it either contains
1505 untracked or modified files or its HEAD differs from the commit recorded
1506 in the superproject and can be used to override any settings of the
Junio C Hamanoa28a9202012-06-21 07:08:231507 <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:511508 "untracked" is used submodules are not considered dirty when they only
1509 contain untracked content (but they are still scanned for modified
1510 content). Using "dirty" ignores all changes to the work tree of submodules,
1511 only changes to the commits stored in the superproject are shown (this was
1512 the behavior until 1.7.0). Using "all" hides all changes to submodules.
Junio C Hamanodfccbb02008-05-26 01:16:141513</p>
1514</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591515<dt class="hdlist1">
Junio C Hamanoe27cbd22007-12-21 17:57:331516--src-prefix=&lt;prefix&gt;
1517</dt>
1518<dd>
1519<p>
1520 Show the given source prefix instead of "a/".
1521</p>
1522</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591523<dt class="hdlist1">
Junio C Hamanoe27cbd22007-12-21 17:57:331524--dst-prefix=&lt;prefix&gt;
1525</dt>
1526<dd>
1527<p>
1528 Show the given destination prefix instead of "b/".
1529</p>
1530</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591531<dt class="hdlist1">
Junio C Hamanoe27cbd22007-12-21 17:57:331532--no-prefix
1533</dt>
1534<dd>
1535<p>
1536 Do not show any source or destination prefix.
1537</p>
1538</dd>
Junio C Hamanoba4b9282008-07-06 05:20:311539</dl></div>
Junio C Hamano68cf15a2010-11-06 01:01:591540<div class="paragraph"><p>For more detailed explanation on these common options, see also
Junio C Hamanoa28a9202012-06-21 07:08:231541<a href="gitdiffcore.html">gitdiffcore(7)</a>.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591542<div class="dlist"><dl>
1543<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231544&lt;tree-ish&gt;
1545</dt>
1546<dd>
1547<p>
1548 The id of a tree object.
1549</p>
1550</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591551<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231552&lt;path&gt;&#8230;
1553</dt>
1554<dd>
1555<p>
1556 If provided, the results are limited to a subset of files
1557 matching one of these prefix strings.
Junio C Hamano9629d4f2012-12-19 00:28:271558 i.e., file matches <code>/^&lt;pattern1&gt;|&lt;pattern2&gt;|.../</code>
Junio C Hamano1a4e8412005-12-27 08:17:231559 Note that this parameter does not provide any wildcard or regexp
1560 features.
1561</p>
1562</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591563<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231564-r
1565</dt>
1566<dd>
1567<p>
1568 recurse into sub-trees
1569</p>
1570</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591571<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231572-t
1573</dt>
1574<dd>
1575<p>
1576 show tree entry itself as well as subtrees. Implies -r.
1577</p>
1578</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591579<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231580--root
1581</dt>
1582<dd>
1583<p>
Junio C Hamano54bf1e22008-12-20 06:30:111584 When <em>--root</em> is specified the initial commit will be shown as a big
Junio C Hamano1a4e8412005-12-27 08:17:231585 creation event. This is equivalent to a diff against the NULL tree.
1586</p>
1587</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591588<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231589--stdin
1590</dt>
1591<dd>
1592<p>
1593 When <em>--stdin</em> is specified, the command does not take
1594 &lt;tree-ish&gt; arguments from the command line. Instead, it
Junio C Hamano3f2f6e52008-08-21 10:34:221595 reads lines containing either two &lt;tree&gt;, one &lt;commit&gt;, or a
1596 list of &lt;commit&gt; from its standard input. (Use a single space
1597 as separator.)
Junio C Hamano1a4e8412005-12-27 08:17:231598</p>
Junio C Hamano68cf15a2010-11-06 01:01:591599<div class="paragraph"><p>When two trees are given, it compares the first tree with the second.
Junio C Hamano3f2f6e52008-08-21 10:34:221600When a single commit is given, it compares the commit with its
1601parents. The remaining commits, when given, are used as if they are
Junio C Hamanob53db3c2008-08-07 00:17:521602parents of the first commit.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591603<div class="paragraph"><p>When comparing two trees, the ID of both trees (separated by a space
Junio C Hamano3f2f6e52008-08-21 10:34:221604and terminated by a newline) is printed before the difference. When
1605comparing commits, the ID of the first (or only) commit, followed by a
1606newline, is printed.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591607<div class="paragraph"><p>The following flags further affect the behavior when comparing
Junio C Hamano3f2f6e52008-08-21 10:34:221608commits (but not trees).</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231609</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591610<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231611-m
1612</dt>
1613<dd>
1614<p>
Junio C Hamano1aa40d22010-01-21 17:46:431615 By default, <em>git diff-tree --stdin</em> does not show
Junio C Hamano1a4e8412005-12-27 08:17:231616 differences for merge commits. With this flag, it shows
Junio C Hamanoa8adb1e2006-04-10 23:46:161617 differences to that commit from all of its parents. See
1618 also <em>-c</em>.
Junio C Hamano1a4e8412005-12-27 08:17:231619</p>
1620</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591621<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231622-s
1623</dt>
1624<dd>
1625<p>
Junio C Hamano1aa40d22010-01-21 17:46:431626 By default, <em>git diff-tree --stdin</em> shows differences,
Junio C Hamano1a4e8412005-12-27 08:17:231627 either in machine-readable form (without <em>-p</em>) or in patch
Junio C Hamano235a91e2006-01-07 01:13:581628 form (with <em>-p</em>). This output can be suppressed. It is
Junio C Hamano1a4e8412005-12-27 08:17:231629 only useful with <em>-v</em> flag.
1630</p>
1631</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591632<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231633-v
1634</dt>
1635<dd>
1636<p>
Junio C Hamano1aa40d22010-01-21 17:46:431637 This flag causes <em>git diff-tree --stdin</em> to also show
Junio C Hamano1a4e8412005-12-27 08:17:231638 the commit message before the differences.
1639</p>
1640</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591641<dt class="hdlist1">
Junio C Hamanod2179ef2010-10-22 04:12:171642--pretty[=&lt;format&gt;]
Junio C Hamano1a4e8412005-12-27 08:17:231643</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591644<dt class="hdlist1">
Junio C Hamanod2179ef2010-10-22 04:12:171645--format=&lt;format&gt;
Junio C Hamano0a235222009-03-06 08:21:091646</dt>
Junio C Hamano1a4e8412005-12-27 08:17:231647<dd>
1648<p>
Junio C Hamanoa3770f92007-07-25 08:53:331649 Pretty-print the contents of the commit logs in a given format,
Junio C Hamano0430e3a2007-05-15 03:13:171650 where <em>&lt;format&gt;</em> can be one of <em>oneline</em>, <em>short</em>, <em>medium</em>,
Junio C Hamanoe32ec8b2010-06-02 23:32:311651 <em>full</em>, <em>fuller</em>, <em>email</em>, <em>raw</em> and <em>format:&lt;string&gt;</em>. See
1652 the "PRETTY FORMATS" section for some additional details for each
1653 format. When omitted, the format defaults to <em>medium</em>.
Junio C Hamano1a4e8412005-12-27 08:17:231654</p>
Junio C Hamano68cf15a2010-11-06 01:01:591655<div class="paragraph"><p>Note: you can specify the default pretty format in the repository
Junio C Hamanoa28a9202012-06-21 07:08:231656configuration (see <a href="git-config.html">git-config(1)</a>).</p></div>
Junio C Hamano0430e3a2007-05-15 03:13:171657</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591658<dt class="hdlist1">
Junio C Hamanoee695f22007-06-21 00:35:361659--abbrev-commit
1660</dt>
1661<dd>
1662<p>
1663 Instead of showing the full 40-byte hexadecimal commit object
Junio C Hamano6efe3022009-01-13 16:47:561664 name, show only a partial prefix. Non default number of
Junio C Hamanoee695f22007-06-21 00:35:361665 digits can be specified with "--abbrev=&lt;n&gt;" (which also modifies
1666 diff output, if it is displayed).
1667</p>
Junio C Hamano68cf15a2010-11-06 01:01:591668<div class="paragraph"><p>This should make "--pretty=oneline" a whole lot more readable for
Junio C Hamanoba4b9282008-07-06 05:20:311669people using 80-column terminals.</p></div>
Junio C Hamanoee695f22007-06-21 00:35:361670</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591671<dt class="hdlist1">
Junio C Hamanof93530e2011-05-25 23:59:591672--no-abbrev-commit
1673</dt>
1674<dd>
1675<p>
1676 Show the full 40-byte hexadecimal commit object name. This negates
Junio C Hamano9629d4f2012-12-19 00:28:271677 <code>--abbrev-commit</code> and those options which imply it such as
Junio C Hamanof93530e2011-05-25 23:59:591678 "--oneline". It also overrides the <em>log.abbrevCommit</em> variable.
1679</p>
1680</dd>
1681<dt class="hdlist1">
Junio C Hamano0a235222009-03-06 08:21:091682--oneline
1683</dt>
1684<dd>
1685<p>
1686 This is a shorthand for "--pretty=oneline --abbrev-commit"
1687 used together.
1688</p>
1689</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591690<dt class="hdlist1">
Junio C Hamano0430e3a2007-05-15 03:13:171691--encoding[=&lt;encoding&gt;]
1692</dt>
1693<dd>
1694<p>
1695 The commit objects record the encoding used for the log message
1696 in their encoding header; this option can be used to tell the
1697 command to re-code the commit log message in the encoding
1698 preferred by the user. For non plumbing commands this
1699 defaults to UTF-8.
1700</p>
1701</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591702<dt class="hdlist1">
Junio C Hamano60033462011-05-03 00:48:431703--notes[=&lt;ref&gt;]
Junio C Hamano57827fb2010-01-23 03:02:501704</dt>
1705<dd>
1706<p>
Junio C Hamanoa28a9202012-06-21 07:08:231707 Show the notes (see <a href="git-notes.html">git-notes(1)</a>) that annotate the
Junio C Hamano57827fb2010-01-23 03:02:501708 commit, when showing the commit log message. This is the default
Junio C Hamano9629d4f2012-12-19 00:28:271709 for <code>git log</code>, <code>git show</code> and <code>git whatchanged</code> commands when
1710 there is no <code>--pretty</code>, <code>--format</code> nor <code>--oneline</code> option given
Junio C Hamano60033462011-05-03 00:48:431711 on the command line.
Junio C Hamano57827fb2010-01-23 03:02:501712</p>
Junio C Hamano60033462011-05-03 00:48:431713<div class="paragraph"><p>By default, the notes shown are from the notes refs listed in the
1714<em>core.notesRef</em> and <em>notes.displayRef</em> variables (or corresponding
Junio C Hamanoa28a9202012-06-21 07:08:231715environment overrides). See <a href="git-config.html">git-config(1)</a> for more details.</p></div>
Junio C Hamano60033462011-05-03 00:48:431716<div class="paragraph"><p>With an optional <em>&lt;ref&gt;</em> argument, show this notes ref instead of the
Junio C Hamano9629d4f2012-12-19 00:28:271717default notes ref(s). The ref is taken to be in <code>refs/notes/</code> if it
Junio C Hamano60033462011-05-03 00:48:431718is not qualified.</p></div>
1719<div class="paragraph"><p>Multiple --notes options can be combined to control which notes are
1720being displayed. Examples: "--notes=foo" will show only notes from
1721"refs/notes/foo"; "--notes=foo --notes" will show both notes from
1722"refs/notes/foo" and from the default notes ref(s).</p></div>
Junio C Hamano31667362010-03-25 00:38:531723</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591724<dt class="hdlist1">
Junio C Hamano60033462011-05-03 00:48:431725--no-notes
1726</dt>
1727<dd>
1728<p>
Junio C Hamano9629d4f2012-12-19 00:28:271729 Do not show notes. This negates the above <code>--notes</code> option, by
Junio C Hamano60033462011-05-03 00:48:431730 resetting the list of notes refs from which notes are shown.
1731 Options are parsed in the order given on the command line, so e.g.
1732 "--notes --notes=foo --no-notes --notes=bar" will only show notes
1733 from "refs/notes/bar".
1734</p>
1735</dd>
1736<dt class="hdlist1">
1737--show-notes[=&lt;ref&gt;]
1738</dt>
1739<dt class="hdlist1">
Junio C Hamano31667362010-03-25 00:38:531740--[no-]standard-notes
1741</dt>
1742<dd>
1743<p>
Junio C Hamano60033462011-05-03 00:48:431744 These options are deprecated. Use the above --notes/--no-notes
1745 options instead.
Junio C Hamano31667362010-03-25 00:38:531746</p>
Junio C Hamano57827fb2010-01-23 03:02:501747</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591748<dt class="hdlist1">
Junio C Hamano0acb1ae2012-09-24 21:28:131749--show-signature
1750</dt>
1751<dd>
1752<p>
1753 Check the validity of a signed commit object by passing the signature
Junio C Hamano9629d4f2012-12-19 00:28:271754 to <code>gpg --verify</code> and show the output.
Junio C Hamano0acb1ae2012-09-24 21:28:131755</p>
1756</dd>
1757<dt class="hdlist1">
Junio C Hamano0430e3a2007-05-15 03:13:171758--no-commit-id
1759</dt>
1760<dd>
1761<p>
Junio C Hamano1aa40d22010-01-21 17:46:431762 <em>git diff-tree</em> outputs a line with the commit ID when
Junio C Hamano0430e3a2007-05-15 03:13:171763 applicable. This flag suppressed the commit ID output.
1764</p>
1765</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591766<dt class="hdlist1">
Junio C Hamano0430e3a2007-05-15 03:13:171767-c
1768</dt>
1769<dd>
1770<p>
1771 This flag changes the way a merge commit is displayed
1772 (which means it is useful only when the command is given
1773 one &lt;tree-ish&gt;, or <em>--stdin</em>). It shows the differences
1774 from each of the parents to the merge result simultaneously
1775 instead of showing pairwise diff between a parent and the
1776 result one at a time (which is what the <em>-m</em> option does).
1777 Furthermore, it lists only files which were modified
1778 from all parents.
1779</p>
1780</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591781<dt class="hdlist1">
Junio C Hamano0430e3a2007-05-15 03:13:171782--cc
1783</dt>
1784<dd>
1785<p>
1786 This flag changes the way a merge commit patch is displayed,
1787 in a similar way to the <em>-c</em> option. It implies the <em>-c</em>
1788 and <em>-p</em> options and further compresses the patch output
Junio C Hamanoccc2f762008-07-24 04:03:331789 by omitting uninteresting hunks whose the contents in the parents
1790 have only two variants and the merge result picks one of them
1791 without modification. When all hunks are uninteresting, the commit
1792 itself and the commit log message is not shown, just like in any other
1793 "empty diff" case.
Junio C Hamano0430e3a2007-05-15 03:13:171794</p>
1795</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591796<dt class="hdlist1">
Junio C Hamano0430e3a2007-05-15 03:13:171797--always
1798</dt>
1799<dd>
1800<p>
1801 Show the commit itself and the commit log message even
1802 if the diff itself is empty.
1803</p>
1804</dd>
Junio C Hamanoba4b9282008-07-06 05:20:311805</dl></div>
Junio C Hamano0430e3a2007-05-15 03:13:171806</div>
Junio C Hamano9629d4f2012-12-19 00:28:271807</div>
1808<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:311809<h2 id="_pretty_formats">PRETTY FORMATS</h2>
Junio C Hamano0430e3a2007-05-15 03:13:171810<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:591811<div class="paragraph"><p>If the commit is a merge, and if the pretty-format
Junio C Hamano0430e3a2007-05-15 03:13:171812is not <em>oneline</em>, <em>email</em> or <em>raw</em>, an additional line is
1813inserted before the <em>Author:</em> line. This line begins with
1814"Merge: " and the sha1s of ancestral commits are printed,
1815separated by spaces. Note that the listed commits may not
1816necessarily be the list of the <strong>direct</strong> parent commits if you
1817have limited your view of history: for example, if you are
1818only interested in changes related to a certain directory or
Junio C Hamanoba4b9282008-07-06 05:20:311819file.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591820<div class="paragraph"><p>There are several built-in formats, and you can define
Junio C Hamanoa574a092010-06-13 19:57:101821additional formats by setting a pretty.&lt;name&gt;
1822config option to either another format name, or a
1823<em>format:</em> string, as described below (see
Junio C Hamanoa28a9202012-06-21 07:08:231824<a href="git-config.html">git-config(1)</a>). Here are the details of the
Junio C Hamanoa574a092010-06-13 19:57:101825built-in formats:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591826<div class="ulist"><ul>
Junio C Hamanoa340aaa2006-11-23 02:47:331827<li>
1828<p>
1829<em>oneline</em>
1830</p>
1831<div class="literalblock">
1832<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:271833<pre><code>&lt;sha1&gt; &lt;title line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:331834</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591835<div class="paragraph"><p>This is designed to be as compact as possible.</p></div>
Junio C Hamanoa340aaa2006-11-23 02:47:331836</li>
1837<li>
1838<p>
1839<em>short</em>
1840</p>
1841<div class="literalblock">
1842<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:271843<pre><code>commit &lt;sha1&gt;
1844Author: &lt;author&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:331845</div></div>
1846<div class="literalblock">
1847<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:271848<pre><code>&lt;title line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:331849</div></div>
1850</li>
1851<li>
1852<p>
1853<em>medium</em>
1854</p>
1855<div class="literalblock">
1856<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:271857<pre><code>commit &lt;sha1&gt;
Junio C Hamanoa340aaa2006-11-23 02:47:331858Author: &lt;author&gt;
Junio C Hamano9629d4f2012-12-19 00:28:271859Date: &lt;author date&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:331860</div></div>
1861<div class="literalblock">
1862<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:271863<pre><code>&lt;title line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:331864</div></div>
1865<div class="literalblock">
1866<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:271867<pre><code>&lt;full commit message&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:331868</div></div>
1869</li>
1870<li>
1871<p>
1872<em>full</em>
1873</p>
1874<div class="literalblock">
1875<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:271876<pre><code>commit &lt;sha1&gt;
Junio C Hamanoa340aaa2006-11-23 02:47:331877Author: &lt;author&gt;
Junio C Hamano9629d4f2012-12-19 00:28:271878Commit: &lt;committer&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:331879</div></div>
1880<div class="literalblock">
1881<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:271882<pre><code>&lt;title line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:331883</div></div>
1884<div class="literalblock">
1885<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:271886<pre><code>&lt;full commit message&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:331887</div></div>
1888</li>
1889<li>
1890<p>
1891<em>fuller</em>
1892</p>
1893<div class="literalblock">
1894<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:271895<pre><code>commit &lt;sha1&gt;
Junio C Hamano6a3c8272008-12-19 21:38:181896Author: &lt;author&gt;
Junio C Hamanoba4b9282008-07-06 05:20:311897AuthorDate: &lt;author date&gt;
Junio C Hamano6a3c8272008-12-19 21:38:181898Commit: &lt;committer&gt;
Junio C Hamano9629d4f2012-12-19 00:28:271899CommitDate: &lt;committer date&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:331900</div></div>
1901<div class="literalblock">
1902<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:271903<pre><code>&lt;title line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:331904</div></div>
1905<div class="literalblock">
1906<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:271907<pre><code>&lt;full commit message&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:331908</div></div>
1909</li>
1910<li>
1911<p>
1912<em>email</em>
1913</p>
1914<div class="literalblock">
1915<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:271916<pre><code>From &lt;sha1&gt; &lt;date&gt;
Junio C Hamanoa340aaa2006-11-23 02:47:331917From: &lt;author&gt;
Junio C Hamanoba4b9282008-07-06 05:20:311918Date: &lt;author date&gt;
Junio C Hamano9629d4f2012-12-19 00:28:271919Subject: [PATCH] &lt;title line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:331920</div></div>
1921<div class="literalblock">
1922<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:271923<pre><code>&lt;full commit message&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:331924</div></div>
1925</li>
1926<li>
1927<p>
1928<em>raw</em>
1929</p>
Junio C Hamano68cf15a2010-11-06 01:01:591930<div class="paragraph"><p>The <em>raw</em> format shows the entire commit exactly as
Junio C Hamanoa340aaa2006-11-23 02:47:331931stored in the commit object. Notably, the SHA1s are
1932displayed in full, regardless of whether --abbrev or
1933--no-abbrev are used, and <em>parents</em> information show the
1934true parent commits, without taking grafts nor history
Junio C Hamanoba4b9282008-07-06 05:20:311935simplification into account.</p></div>
Junio C Hamanoa340aaa2006-11-23 02:47:331936</li>
Junio C Hamanoa3fd83c2007-03-02 10:34:361937<li>
1938<p>
Junio C Hamanoe32ec8b2010-06-02 23:32:311939<em>format:&lt;string&gt;</em>
Junio C Hamanoa3fd83c2007-03-02 10:34:361940</p>
Junio C Hamano68cf15a2010-11-06 01:01:591941<div class="paragraph"><p>The <em>format:&lt;string&gt;</em> format allows you to specify which information
Junio C Hamanoa3fd83c2007-03-02 10:34:361942you want to show. It works a little bit like printf format,
1943with the notable exception that you get a newline with <em>%n</em>
Junio C Hamanoba4b9282008-07-06 05:20:311944instead of <em>\n</em>.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591945<div class="paragraph"><p>E.g, <em>format:"The author of %h was %an, %ar%nThe title was &gt;&gt;%s&lt;&lt;%n"</em>
Junio C Hamanoba4b9282008-07-06 05:20:311946would show something like this:</p></div>
Junio C Hamano0430e3a2007-05-15 03:13:171947<div class="listingblock">
1948<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:271949<pre><code>The author of fe6e0ee was Junio C Hamano, 23 hours ago
1950The title was &gt;&gt;t4119: test autocomputing -p&lt;n&gt; for traditional diff input.&lt;&lt;</code></pre>
Junio C Hamano0430e3a2007-05-15 03:13:171951</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591952<div class="paragraph"><p>The placeholders are:</p></div>
1953<div class="ulist"><ul>
Junio C Hamanoa3fd83c2007-03-02 10:34:361954<li>
1955<p>
1956<em>%H</em>: commit hash
1957</p>
1958</li>
1959<li>
1960<p>
1961<em>%h</em>: abbreviated commit hash
1962</p>
1963</li>
1964<li>
1965<p>
1966<em>%T</em>: tree hash
1967</p>
1968</li>
1969<li>
1970<p>
1971<em>%t</em>: abbreviated tree hash
1972</p>
1973</li>
1974<li>
1975<p>
1976<em>%P</em>: parent hashes
1977</p>
1978</li>
1979<li>
1980<p>
1981<em>%p</em>: abbreviated parent hashes
1982</p>
1983</li>
1984<li>
1985<p>
1986<em>%an</em>: author name
1987</p>
1988</li>
1989<li>
1990<p>
Junio C Hamanoa28a9202012-06-21 07:08:231991<em>%aN</em>: author name (respecting .mailmap, see <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)
Junio C Hamanof5a93622008-07-16 03:23:571992</p>
1993</li>
1994<li>
1995<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:361996<em>%ae</em>: author email
1997</p>
1998</li>
1999<li>
2000<p>
Junio C Hamanoa28a9202012-06-21 07:08:232001<em>%aE</em>: author email (respecting .mailmap, see <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)
Junio C Hamano8bc410e2009-02-15 10:38:192002</p>
2003</li>
2004<li>
2005<p>
Junio C Hamanoa387df32008-08-29 08:56:582006<em>%ad</em>: author date (format respects --date= option)
Junio C Hamanoa3fd83c2007-03-02 10:34:362007</p>
2008</li>
2009<li>
2010<p>
2011<em>%aD</em>: author date, RFC2822 style
2012</p>
2013</li>
2014<li>
2015<p>
2016<em>%ar</em>: author date, relative
2017</p>
2018</li>
2019<li>
2020<p>
2021<em>%at</em>: author date, UNIX timestamp
2022</p>
2023</li>
2024<li>
2025<p>
Junio C Hamano02f130b2007-07-14 08:26:562026<em>%ai</em>: author date, ISO 8601 format
2027</p>
2028</li>
2029<li>
2030<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:362031<em>%cn</em>: committer name
2032</p>
2033</li>
2034<li>
2035<p>
Junio C Hamanoa28a9202012-06-21 07:08:232036<em>%cN</em>: committer name (respecting .mailmap, see <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)
Junio C Hamanof5a93622008-07-16 03:23:572037</p>
2038</li>
2039<li>
2040<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:362041<em>%ce</em>: committer email
2042</p>
2043</li>
2044<li>
2045<p>
Junio C Hamanoa28a9202012-06-21 07:08:232046<em>%cE</em>: committer email (respecting .mailmap, see <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)
Junio C Hamano8bc410e2009-02-15 10:38:192047</p>
2048</li>
2049<li>
2050<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:362051<em>%cd</em>: committer date
2052</p>
2053</li>
2054<li>
2055<p>
2056<em>%cD</em>: committer date, RFC2822 style
2057</p>
2058</li>
2059<li>
2060<p>
2061<em>%cr</em>: committer date, relative
2062</p>
2063</li>
2064<li>
2065<p>
2066<em>%ct</em>: committer date, UNIX timestamp
2067</p>
2068</li>
2069<li>
2070<p>
Junio C Hamano02f130b2007-07-14 08:26:562071<em>%ci</em>: committer date, ISO 8601 format
2072</p>
2073</li>
2074<li>
2075<p>
Junio C Hamanoa28a9202012-06-21 07:08:232076<em>%d</em>: ref names, like the --decorate option of <a href="git-log.html">git-log(1)</a>
Junio C Hamano5e4d8de2008-09-19 06:27:022077</p>
2078</li>
2079<li>
2080<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:362081<em>%e</em>: encoding
2082</p>
2083</li>
2084<li>
2085<p>
2086<em>%s</em>: subject
2087</p>
2088</li>
2089<li>
2090<p>
Junio C Hamano5f9a6f02009-04-06 08:26:562091<em>%f</em>: sanitized subject line, suitable for a filename
2092</p>
2093</li>
2094<li>
2095<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:362096<em>%b</em>: body
2097</p>
2098</li>
2099<li>
2100<p>
Junio C Hamanocb39aea2010-05-09 07:24:482101<em>%B</em>: raw body (unwrapped subject and body)
2102</p>
2103</li>
2104<li>
2105<p>
Junio C Hamano3b70d3c2009-11-21 17:37:372106<em>%N</em>: commit notes
2107</p>
2108</li>
2109<li>
2110<p>
Junio C Hamano0acb1ae2012-09-24 21:28:132111<em>%GG</em>: raw verification message from GPG for a signed commit
2112</p>
2113</li>
2114<li>
2115<p>
2116<em>%G?</em>: show either "G" for Good or "B" for Bad for a signed commit
2117</p>
2118</li>
2119<li>
2120<p>
2121<em>%GS</em>: show the name of the signer for a signed commit
2122</p>
2123</li>
2124<li>
2125<p>
Junio C Hamano9629d4f2012-12-19 00:28:272126<em>%gD</em>: reflog selector, e.g., <code>refs/stash@{1}</code>
Junio C Hamanoc21ab052009-10-31 04:03:552127</p>
2128</li>
2129<li>
2130<p>
Junio C Hamano9629d4f2012-12-19 00:28:272131<em>%gd</em>: shortened reflog selector, e.g., <code>stash@{1}</code>
Junio C Hamanoc21ab052009-10-31 04:03:552132</p>
2133</li>
2134<li>
2135<p>
Junio C Hamano962f3a32011-12-22 20:21:442136<em>%gn</em>: reflog identity name
2137</p>
2138</li>
2139<li>
2140<p>
Junio C Hamanoa28a9202012-06-21 07:08:232141<em>%gN</em>: reflog identity name (respecting .mailmap, see <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)
Junio C Hamano962f3a32011-12-22 20:21:442142</p>
2143</li>
2144<li>
2145<p>
2146<em>%ge</em>: reflog identity email
2147</p>
2148</li>
2149<li>
2150<p>
Junio C Hamanoa28a9202012-06-21 07:08:232151<em>%gE</em>: reflog identity email (respecting .mailmap, see <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)
Junio C Hamano962f3a32011-12-22 20:21:442152</p>
2153</li>
2154<li>
2155<p>
Junio C Hamanoc21ab052009-10-31 04:03:552156<em>%gs</em>: reflog subject
2157</p>
2158</li>
2159<li>
2160<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:362161<em>%Cred</em>: switch color to red
2162</p>
2163</li>
2164<li>
2165<p>
2166<em>%Cgreen</em>: switch color to green
2167</p>
2168</li>
2169<li>
2170<p>
2171<em>%Cblue</em>: switch color to blue
2172</p>
2173</li>
2174<li>
2175<p>
2176<em>%Creset</em>: reset color
2177</p>
2178</li>
2179<li>
2180<p>
Junio C Hamanoabad6da2013-01-06 09:06:322181<em>%C(&#8230;)</em>: color specification, as described in color.branch.* config option;
2182 adding <code>auto,</code> at the beginning will emit color only when colors are
2183 enabled for log output (by <code>color.diff</code>, <code>color.ui</code>, or <code>--color</code>, and
2184 respecting the <code>auto</code> settings of the former if we are going to a
2185 terminal)
Junio C Hamanocc0cb312009-01-22 03:38:502186</p>
2187</li>
2188<li>
2189<p>
Junio C Hamanod9e0e5d2007-04-14 16:22:042190<em>%m</em>: left, right or boundary mark
2191</p>
2192</li>
2193<li>
2194<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:362195<em>%n</em>: newline
2196</p>
Junio C Hamano0430e3a2007-05-15 03:13:172197</li>
Junio C Hamanob78d2592008-04-09 09:39:082198<li>
2199<p>
Junio C Hamanoa9701f02010-01-21 00:42:162200<em>%%</em>: a raw <em>%</em>
2201</p>
2202</li>
2203<li>
2204<p>
Junio C Hamanob78d2592008-04-09 09:39:082205<em>%x00</em>: print a byte from a hex code
2206</p>
2207</li>
Junio C Hamanobf984de2009-11-23 06:11:192208<li>
2209<p>
2210<em>%w([&lt;w&gt;[,&lt;i1&gt;[,&lt;i2&gt;]]])</em>: switch line wrapping, like the -w option of
Junio C Hamanoa28a9202012-06-21 07:08:232211 <a href="git-shortlog.html">git-shortlog(1)</a>.
Junio C Hamanobf984de2009-11-23 06:11:192212</p>
2213</li>
Junio C Hamanoba4b9282008-07-06 05:20:312214</ul></div>
Junio C Hamanoa3fd83c2007-03-02 10:34:362215</li>
Junio C Hamanoc21ab052009-10-31 04:03:552216</ul></div>
2217<div class="admonitionblock">
2218<table><tr>
2219<td class="icon">
2220<div class="title">Note</div>
2221</td>
2222<td class="content">Some placeholders may depend on other options given to the
Junio C Hamano9629d4f2012-12-19 00:28:272223revision traversal engine. For example, the <code>%g*</code> reflog options will
Junio C Hamanoc21ab052009-10-31 04:03:552224insert an empty string unless we are traversing reflog entries (e.g., by
Junio C Hamano9629d4f2012-12-19 00:28:272225<code>git log -g</code>). The <code>%d</code> placeholder will use the "short" decoration
2226format if <code>--decorate</code> was not already provided on the command line.</td>
Junio C Hamanoc21ab052009-10-31 04:03:552227</tr></table>
2228</div>
Junio C Hamano9629d4f2012-12-19 00:28:272229<div class="paragraph"><p>If you add a <code>+</code> (plus sign) after <em>%</em> of a placeholder, a line-feed
Junio C Hamano2bd8a742009-12-01 21:16:592230is inserted immediately before the expansion if and only if the
2231placeholder expands to a non-empty string.</p></div>
Junio C Hamano9629d4f2012-12-19 00:28:272232<div class="paragraph"><p>If you add a <code>-</code> (minus sign) after <em>%</em> of a placeholder, line-feeds that
Junio C Hamano2bd8a742009-12-01 21:16:592233immediately precede the expansion are deleted if and only if the
2234placeholder expands to an empty string.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592235<div class="paragraph"><p>If you add a ` ` (space) after <em>%</em> of a placeholder, a space
Junio C Hamano89a57342010-06-22 23:22:552236is inserted immediately before the expansion if and only if the
2237placeholder expands to a non-empty string.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592238<div class="ulist"><ul>
Junio C Hamano6fb124c2008-06-13 10:04:012239<li>
2240<p>
2241<em>tformat:</em>
2242</p>
Junio C Hamano68cf15a2010-11-06 01:01:592243<div class="paragraph"><p>The <em>tformat:</em> format works exactly like <em>format:</em>, except that it
Junio C Hamano6fb124c2008-06-13 10:04:012244provides "terminator" semantics instead of "separator" semantics. In
2245other words, each commit has the message terminator character (usually a
2246newline) appended, rather than a separator placed between entries.
2247This means that the final entry of a single-line format will be properly
2248terminated with a new line, just as the "oneline" format does.
Junio C Hamanoba4b9282008-07-06 05:20:312249For example:</p></div>
Junio C Hamano6fb124c2008-06-13 10:04:012250<div class="listingblock">
2251<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272252<pre><code>$ git log -2 --pretty=format:%h 4da45bef \
Junio C Hamano6fb124c2008-06-13 10:04:012253 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
22544da45be
22557134973 -- NO NEWLINE
2256
2257$ git log -2 --pretty=tformat:%h 4da45bef \
2258 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
22594da45be
Junio C Hamano9629d4f2012-12-19 00:28:2722607134973</code></pre>
Junio C Hamano6fb124c2008-06-13 10:04:012261</div></div>
Junio C Hamano9629d4f2012-12-19 00:28:272262<div class="paragraph"><p>In addition, any unrecognized string that has a <code>%</code> in it is interpreted
2263as if it has <code>tformat:</code> in front of it. For example, these two are
Junio C Hamano0a235222009-03-06 08:21:092264equivalent:</p></div>
2265<div class="listingblock">
2266<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272267<pre><code>$ git log -2 --pretty=tformat:%h 4da45bef
2268$ git log -2 --pretty=%h 4da45bef</code></pre>
Junio C Hamano0a235222009-03-06 08:21:092269</div></div>
Junio C Hamano6fb124c2008-06-13 10:04:012270</li>
Junio C Hamanoba4b9282008-07-06 05:20:312271</ul></div>
Junio C Hamano1a4e8412005-12-27 08:17:232272</div>
Junio C Hamano9629d4f2012-12-19 00:28:272273</div>
2274<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:312275<h2 id="_limiting_output">Limiting Output</h2>
Junio C Hamano1a4e8412005-12-27 08:17:232276<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:592277<div class="paragraph"><p>If you&#8217;re only interested in differences in a subset of files, for
Junio C Hamanoba4b9282008-07-06 05:20:312278example some architecture-specific files, you might do:</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232279<div class="literalblock">
2280<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272281<pre><code>git diff-tree -r &lt;tree-ish&gt; &lt;tree-ish&gt; arch/ia64 include/asm-ia64</code></pre>
Junio C Hamano1a4e8412005-12-27 08:17:232282</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592283<div class="paragraph"><p>and it will only show you what changed in those two directories.</p></div>
Junio C Hamano9629d4f2012-12-19 00:28:272284<div class="paragraph"><p>Or if you are searching for what changed in just <code>kernel/sched.c</code>, just do</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232285<div class="literalblock">
2286<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272287<pre><code>git diff-tree -r &lt;tree-ish&gt; &lt;tree-ish&gt; kernel/sched.c</code></pre>
Junio C Hamano1a4e8412005-12-27 08:17:232288</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592289<div class="paragraph"><p>and it will ignore all differences to other files.</p></div>
2290<div class="paragraph"><p>The pattern is always the prefix, and is matched exactly. There are no
Junio C Hamano1a4e8412005-12-27 08:17:232291wildcards. Even stricter, it has to match a complete path component.
Junio C Hamano9629d4f2012-12-19 00:28:272292I.e. "foo" does not pick up <code>foobar.h</code>. "foo" does match <code>foo/bar.h</code>
Junio C Hamanoba4b9282008-07-06 05:20:312293so it can be used to name subdirectories.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592294<div class="paragraph"><p>An example of normal usage is:</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232295<div class="literalblock">
2296<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272297<pre><code>torvalds@ppc970:~/git&gt; git diff-tree --abbrev 5319e4
2298:100664 100664 ac348b... a01513... git-fsck-objects.c</code></pre>
Junio C Hamano1a4e8412005-12-27 08:17:232299</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592300<div class="paragraph"><p>which tells you that the last commit changed just one file (it&#8217;s from
Junio C Hamanoba4b9282008-07-06 05:20:312301this one:</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232302<div class="listingblock">
2303<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272304<pre><code>commit 3c6f7ca19ad4043e9e72fa94106f352897e651a8
Junio C Hamano1a4e8412005-12-27 08:17:232305tree 5319e4d609cdd282069cc4dce33c1db559539b03
2306parent b4e628ea30d5ab3606119d2ea5caeab141d38df7
2307author Linus Torvalds &lt;torvalds@ppc970.osdl.org&gt; Sat Apr 9 12:02:30 2005
2308committer Linus Torvalds &lt;torvalds@ppc970.osdl.org&gt; Sat Apr 9 12:02:30 2005
2309
2310Make "git-fsck-objects" print out all the root commits it finds.
2311
2312Once I do the reference tracking, I'll also make it print out all the
Junio C Hamano9629d4f2012-12-19 00:28:272313HEAD commits it finds, which is even more interesting.</code></pre>
Junio C Hamano1a4e8412005-12-27 08:17:232314</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592315<div class="paragraph"><p>in case you care).</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232316</div>
Junio C Hamano9629d4f2012-12-19 00:28:272317</div>
2318<div class="sect1">
Junio C Hamano543f8d62009-07-29 08:35:212319<h2 id="_raw_output_format">Raw output format</h2>
Junio C Hamano1a4e8412005-12-27 08:17:232320<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:592321<div class="paragraph"><p>The raw output format from "git-diff-index", "git-diff-tree",
Junio C Hamanoba4b9282008-07-06 05:20:312322"git-diff-files" and "git diff --raw" are very similar.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592323<div class="paragraph"><p>These commands all compare two sets of things; what is
Junio C Hamanoba4b9282008-07-06 05:20:312324compared differs:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592325<div class="dlist"><dl>
2326<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:232327git-diff-index &lt;tree-ish&gt;
2328</dt>
2329<dd>
2330<p>
2331 compares the &lt;tree-ish&gt; and the files on the filesystem.
2332</p>
2333</dd>
Junio C Hamano68cf15a2010-11-06 01:01:592334<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:232335git-diff-index --cached &lt;tree-ish&gt;
2336</dt>
2337<dd>
2338<p>
2339 compares the &lt;tree-ish&gt; and the index.
2340</p>
2341</dd>
Junio C Hamano68cf15a2010-11-06 01:01:592342<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:232343git-diff-tree [-r] &lt;tree-ish-1&gt; &lt;tree-ish-2&gt; [&lt;pattern&gt;&#8230;]
2344</dt>
2345<dd>
2346<p>
2347 compares the trees named by the two arguments.
2348</p>
2349</dd>
Junio C Hamano68cf15a2010-11-06 01:01:592350<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:232351git-diff-files [&lt;pattern&gt;&#8230;]
2352</dt>
2353<dd>
2354<p>
2355 compares the index and the files on the filesystem.
2356</p>
2357</dd>
Junio C Hamanoba4b9282008-07-06 05:20:312358</dl></div>
Junio C Hamano68cf15a2010-11-06 01:01:592359<div class="paragraph"><p>The "git-diff-tree" command begins its output by printing the hash of
Junio C Hamano543f8d62009-07-29 08:35:212360what is being compared. After that, all the commands print one output
2361line per changed file.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592362<div class="paragraph"><p>An output line is formatted this way:</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232363<div class="listingblock">
2364<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272365<pre><code>in-place edit :100644 100644 bcd1234... 0123456... M file0
Junio C Hamano1a4e8412005-12-27 08:17:232366copy-edit :100644 100644 abcd123... 1234567... C68 file1 file2
2367rename-edit :100644 100644 abcd123... 1234567... R86 file1 file3
2368create :000000 100644 0000000... 1234567... A file4
2369delete :100644 000000 1234567... 0000000... D file5
Junio C Hamano9629d4f2012-12-19 00:28:272370unmerged :000000 000000 0000000... 0000000... U file6</code></pre>
Junio C Hamano1a4e8412005-12-27 08:17:232371</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592372<div class="paragraph"><p>That is, from the left to the right:</p></div>
2373<div class="olist arabic"><ol class="arabic">
Junio C Hamano1a4e8412005-12-27 08:17:232374<li>
2375<p>
2376a colon.
2377</p>
2378</li>
2379<li>
2380<p>
2381mode for "src"; 000000 if creation or unmerged.
2382</p>
2383</li>
2384<li>
2385<p>
2386a space.
2387</p>
2388</li>
2389<li>
2390<p>
2391mode for "dst"; 000000 if deletion or unmerged.
2392</p>
2393</li>
2394<li>
2395<p>
2396a space.
2397</p>
2398</li>
2399<li>
2400<p>
2401sha1 for "src"; 0{40} if creation or unmerged.
2402</p>
2403</li>
2404<li>
2405<p>
2406a space.
2407</p>
2408</li>
2409<li>
2410<p>
2411sha1 for "dst"; 0{40} if creation, unmerged or "look at work tree".
2412</p>
2413</li>
2414<li>
2415<p>
2416a space.
2417</p>
2418</li>
2419<li>
2420<p>
2421status, followed by optional "score" number.
2422</p>
2423</li>
2424<li>
2425<p>
2426a tab or a NUL when <em>-z</em> option is used.
2427</p>
2428</li>
2429<li>
2430<p>
2431path for "src"
2432</p>
2433</li>
2434<li>
2435<p>
2436a tab or a NUL when <em>-z</em> option is used; only exists for C or R.
2437</p>
2438</li>
2439<li>
2440<p>
2441path for "dst"; only exists for C or R.
2442</p>
2443</li>
2444<li>
2445<p>
2446an LF or a NUL when <em>-z</em> option is used, to terminate the record.
2447</p>
2448</li>
Junio C Hamanoba4b9282008-07-06 05:20:312449</ol></div>
Junio C Hamano68cf15a2010-11-06 01:01:592450<div class="paragraph"><p>Possible status letters are:</p></div>
2451<div class="ulist"><ul>
Junio C Hamanoaa17c7c2008-11-03 04:36:582452<li>
2453<p>
2454A: addition of a file
2455</p>
2456</li>
2457<li>
2458<p>
2459C: copy of a file into a new one
2460</p>
2461</li>
2462<li>
2463<p>
2464D: deletion of a file
2465</p>
2466</li>
2467<li>
2468<p>
2469M: modification of the contents or mode of a file
2470</p>
2471</li>
2472<li>
2473<p>
2474R: renaming of a file
2475</p>
2476</li>
2477<li>
2478<p>
2479T: change in the type of the file
2480</p>
2481</li>
2482<li>
2483<p>
2484U: file is unmerged (you must complete the merge before it can
2485be committed)
2486</p>
2487</li>
2488<li>
2489<p>
2490X: "unknown" change type (most probably a bug, please report it)
2491</p>
2492</li>
2493</ul></div>
Junio C Hamano68cf15a2010-11-06 01:01:592494<div class="paragraph"><p>Status letters C and R are always followed by a score (denoting the
Junio C Hamanoaa17c7c2008-11-03 04:36:582495percentage of similarity between the source and target of the move or
2496copy), and are the only ones to be so.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592497<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:312498and it is out of sync with the index.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592499<div class="paragraph"><p>Example:</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232500<div class="listingblock">
2501<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272502<pre><code>:100644 100644 5be4a4...... 000000...... M file.c</code></pre>
Junio C Hamano1a4e8412005-12-27 08:17:232503</div></div>
Junio C Hamano9629d4f2012-12-19 00:28:272504<div class="paragraph"><p>When <code>-z</code> option is not used, TAB, LF, and backslash characters
2505in pathnames are represented as <code>\t</code>, <code>\n</code>, and <code>\\</code>,
Junio C Hamanoba4b9282008-07-06 05:20:312506respectively.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232507</div>
Junio C Hamano9629d4f2012-12-19 00:28:272508</div>
2509<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:312510<h2 id="_diff_format_for_merges">diff format for merges</h2>
Junio C Hamano67fad6d2007-05-06 08:53:122511<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:592512<div class="paragraph"><p>"git-diff-tree", "git-diff-files" and "git-diff --raw"
Junio C Hamano7ae0ab22007-11-03 02:46:462513can take <em>-c</em> or <em>--cc</em> option
Junio C Hamano67fad6d2007-05-06 08:53:122514to generate diff output also for merge commits. The output differs
Junio C Hamanoba4b9282008-07-06 05:20:312515from the format described above in the following way:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592516<div class="olist arabic"><ol class="arabic">
Junio C Hamano67fad6d2007-05-06 08:53:122517<li>
2518<p>
2519there is a colon for each parent
2520</p>
2521</li>
2522<li>
2523<p>
2524there are more "src" modes and "src" sha1
2525</p>
2526</li>
2527<li>
2528<p>
2529status is concatenated status characters for each parent
2530</p>
2531</li>
2532<li>
2533<p>
2534no optional "score" number
2535</p>
2536</li>
2537<li>
2538<p>
2539single path, only for "dst"
2540</p>
2541</li>
Junio C Hamanoba4b9282008-07-06 05:20:312542</ol></div>
Junio C Hamano68cf15a2010-11-06 01:01:592543<div class="paragraph"><p>Example:</p></div>
Junio C Hamano67fad6d2007-05-06 08:53:122544<div class="listingblock">
2545<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272546<pre><code>::100644 100644 100644 fabadb8... cc95eb0... 4866510... MM describe.c</code></pre>
Junio C Hamano67fad6d2007-05-06 08:53:122547</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592548<div class="paragraph"><p>Note that <em>combined diff</em> lists only files which were modified from
Junio C Hamanoba4b9282008-07-06 05:20:312549all parents.</p></div>
Junio C Hamano67fad6d2007-05-06 08:53:122550</div>
Junio C Hamano9629d4f2012-12-19 00:28:272551</div>
2552<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:312553<h2 id="_generating_patches_with_p">Generating patches with -p</h2>
Junio C Hamano1a4e8412005-12-27 08:17:232554<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:592555<div class="paragraph"><p>When "git-diff-index", "git-diff-tree", or "git-diff-files" are run
Junio C Hamano00b8b632007-12-07 09:50:492556with a <em>-p</em> option, "git diff" without the <em>--raw</em> option, or
2557"git log" with the "-p" option, they
Junio C Hamano7ae0ab22007-11-03 02:46:462558do not produce the output described above; instead they produce a
2559patch file. You can customize the creation of such patches via the
Junio C Hamanoba4b9282008-07-06 05:20:312560GIT_EXTERNAL_DIFF and the GIT_DIFF_OPTS environment variables.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592561<div class="paragraph"><p>What the -p option produces is slightly different from the traditional
Junio C Hamano7f9fa862010-10-19 23:51:142562diff format:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592563<div class="olist arabic"><ol class="arabic">
Junio C Hamano1a4e8412005-12-27 08:17:232564<li>
2565<p>
Junio C Hamano7f9fa862010-10-19 23:51:142566It is preceded with a "git diff" header that looks like this:
Junio C Hamano1a4e8412005-12-27 08:17:232567</p>
2568<div class="literalblock">
2569<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272570<pre><code>diff --git a/file1 b/file2</code></pre>
Junio C Hamano1a4e8412005-12-27 08:17:232571</div></div>
Junio C Hamano9629d4f2012-12-19 00:28:272572<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:232573involved. Especially, even for a creation or a deletion,
Junio C Hamano9629d4f2012-12-19 00:28:272574<code>/dev/null</code> is <em>not</em> used in place of the <code>a/</code> or <code>b/</code> filenames.</p></div>
2575<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:232576name of the source file of the rename/copy and the name of
Junio C Hamanoba4b9282008-07-06 05:20:312577the file that rename/copy produces, respectively.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232578</li>
2579<li>
2580<p>
2581It is followed by one or more extended header lines:
2582</p>
2583<div class="literalblock">
2584<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272585<pre><code>old mode &lt;mode&gt;
Junio C Hamano1a4e8412005-12-27 08:17:232586new mode &lt;mode&gt;
2587deleted file mode &lt;mode&gt;
2588new file mode &lt;mode&gt;
2589copy from &lt;path&gt;
2590copy to &lt;path&gt;
2591rename from &lt;path&gt;
2592rename to &lt;path&gt;
2593similarity index &lt;number&gt;
2594dissimilarity index &lt;number&gt;
Junio C Hamano9629d4f2012-12-19 00:28:272595index &lt;hash&gt;..&lt;hash&gt; &lt;mode&gt;</code></pre>
Junio C Hamano1a4e8412005-12-27 08:17:232596</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592597<div class="paragraph"><p>File modes are printed as 6-digit octal numbers including the file type
Junio C Hamano7f9fa862010-10-19 23:51:142598and file permission bits.</p></div>
Junio C Hamano9629d4f2012-12-19 00:28:272599<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:592600<div class="paragraph"><p>The similarity index is the percentage of unchanged lines, and
Junio C Hamano7f9fa862010-10-19 23:51:142601the dissimilarity index is the percentage of changed lines. It
2602is a rounded down integer, followed by a percent sign. The
2603similarity index value of 100% is thus reserved for two equal
2604files, while 100% dissimilarity means that no line from the old
2605file made it into the new one.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592606<div class="paragraph"><p>The index line includes the SHA-1 checksum before and after the change.
Junio C Hamano7f9fa862010-10-19 23:51:142607The &lt;mode&gt; is included if the file mode does not change; otherwise,
2608separate lines indicate the old and the new mode.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232609</li>
2610<li>
2611<p>
Junio C Hamanoa053d542006-10-27 09:29:132612TAB, LF, double quote and backslash characters in pathnames
Junio C Hamano9629d4f2012-12-19 00:28:272613 are represented as <code>\t</code>, <code>\n</code>, <code>\"</code> and <code>\\</code>, respectively.
Junio C Hamanoa053d542006-10-27 09:29:132614 If there is need for such substitution then the whole
2615 pathname is put in double quotes.
Junio C Hamano1a4e8412005-12-27 08:17:232616</p>
2617</li>
Junio C Hamano7f9fa862010-10-19 23:51:142618<li>
2619<p>
Junio C Hamano9629d4f2012-12-19 00:28:272620All the <code>file1</code> files in the output refer to files before the
2621 commit, and all the <code>file2</code> files refer to files after the commit.
Junio C Hamano7f9fa862010-10-19 23:51:142622 It is incorrect to apply each change to each file sequentially. For
2623 example, this patch will swap a and b:
2624</p>
2625<div class="literalblock">
2626<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272627<pre><code>diff --git a/a b/b
Junio C Hamano7f9fa862010-10-19 23:51:142628rename from a
2629rename to b
2630diff --git a/b b/a
2631rename from b
Junio C Hamano9629d4f2012-12-19 00:28:272632rename to a</code></pre>
Junio C Hamano7f9fa862010-10-19 23:51:142633</div></div>
2634</li>
Junio C Hamanoba4b9282008-07-06 05:20:312635</ol></div>
Junio C Hamano1a4e8412005-12-27 08:17:232636</div>
Junio C Hamano9629d4f2012-12-19 00:28:272637</div>
2638<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:312639<h2 id="_combined_diff_format">combined diff format</h2>
Junio C Hamanofb56a962006-01-28 10:38:192640<div class="sectionbody">
Junio C Hamano9629d4f2012-12-19 00:28:272641<div class="paragraph"><p>Any diff-generating command can take the &#8216;-c` or <code>--cc</code> option to
Junio C Hamanoc5be4cc2011-03-09 07:20:432642produce a <em>combined diff</em> when showing a merge. This is the default
Junio C Hamanoa28a9202012-06-21 07:08:232643format when showing merges with <a href="git-diff.html">git-diff(1)</a> or
2644<a href="git-show.html">git-show(1)</a>. Note also that you can give the `-m&#8217; option to any
Junio C Hamanoc5be4cc2011-03-09 07:20:432645of these commands to force generation of diffs with individual parents
2646of a merge.</p></div>
2647<div class="paragraph"><p>A <em>combined diff</em> format looks like this:</p></div>
Junio C Hamanofb56a962006-01-28 10:38:192648<div class="listingblock">
2649<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272650<pre><code>diff --combined describe.c
Junio C Hamano29f14312006-10-26 08:47:292651index fabadb8,cc95eb0..4866510
2652--- a/describe.c
2653+++ b/describe.c
2654@@@ -98,20 -98,12 +98,20 @@@
2655 return (a_date &gt; b_date) ? -1 : (a_date == b_date) ? 0 : 1;
Junio C Hamanofb56a962006-01-28 10:38:192656 }
2657
2658- static void describe(char *arg)
2659 -static void describe(struct commit *cmit, int last_one)
2660++static void describe(char *arg, int last_one)
2661 {
Junio C Hamano29f14312006-10-26 08:47:292662 + unsigned char sha1[20];
2663 + struct commit *cmit;
2664 struct commit_list *list;
2665 static int initialized = 0;
2666 struct commit_name *n;
2667
2668 + if (get_sha1(arg, sha1) &lt; 0)
2669 + usage(describe_usage);
2670 + cmit = lookup_commit_reference(sha1);
2671 + if (!cmit)
2672 + usage(describe_usage);
2673 +
2674 if (!initialized) {
2675 initialized = 1;
Junio C Hamano9629d4f2012-12-19 00:28:272676 for_each_ref(get_name);</code></pre>
Junio C Hamanofb56a962006-01-28 10:38:192677</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592678<div class="olist arabic"><ol class="arabic">
Junio C Hamano29f14312006-10-26 08:47:292679<li>
2680<p>
2681It is preceded with a "git diff" header, that looks like
2682 this (when <em>-c</em> option is used):
2683</p>
2684<div class="literalblock">
2685<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272686<pre><code>diff --combined file</code></pre>
Junio C Hamano29f14312006-10-26 08:47:292687</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592688<div class="paragraph"><p>or like this (when <em>--cc</em> option is used):</p></div>
Junio C Hamano29f14312006-10-26 08:47:292689<div class="literalblock">
2690<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272691<pre><code>diff --cc file</code></pre>
Junio C Hamano29f14312006-10-26 08:47:292692</div></div>
2693</li>
2694<li>
2695<p>
2696It is followed by one or more extended header lines
2697 (this example shows a merge with two parents):
2698</p>
2699<div class="literalblock">
2700<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272701<pre><code>index &lt;hash&gt;,&lt;hash&gt;..&lt;hash&gt;
Junio C Hamano29f14312006-10-26 08:47:292702mode &lt;mode&gt;,&lt;mode&gt;..&lt;mode&gt;
2703new file mode &lt;mode&gt;
Junio C Hamano9629d4f2012-12-19 00:28:272704deleted file mode &lt;mode&gt;,&lt;mode&gt;</code></pre>
Junio C Hamano29f14312006-10-26 08:47:292705</div></div>
Junio C Hamano9629d4f2012-12-19 00:28:272706<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:042707the &lt;mode&gt; is different from the rest. Extended headers with
Junio C Hamano29f14312006-10-26 08:47:292708information about detected contents movement (renames and
2709copying detection) are designed to work with diff of two
Junio C Hamanoba4b9282008-07-06 05:20:312710&lt;tree-ish&gt; and are not used by combined diff format.</p></div>
Junio C Hamano29f14312006-10-26 08:47:292711</li>
2712<li>
2713<p>
2714It is followed by two-line from-file/to-file header
2715</p>
2716<div class="literalblock">
2717<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272718<pre><code>--- a/file
2719+++ b/file</code></pre>
Junio C Hamano29f14312006-10-26 08:47:292720</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592721<div class="paragraph"><p>Similar to two-line header for traditional <em>unified</em> diff
Junio C Hamano9629d4f2012-12-19 00:28:272722format, <code>/dev/null</code> is used to signal created or deleted
Junio C Hamanoba4b9282008-07-06 05:20:312723files.</p></div>
Junio C Hamano29f14312006-10-26 08:47:292724</li>
2725<li>
2726<p>
2727Chunk header format is modified to prevent people from
Junio C Hamano9629d4f2012-12-19 00:28:272728 accidentally feeding it to <code>patch -p1</code>. Combined diff format
Junio C Hamano29f14312006-10-26 08:47:292729 was created for review of merge commit changes, and was not
2730 meant for apply. The change is similar to the change in the
2731 extended <em>index</em> header:
2732</p>
2733<div class="literalblock">
2734<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272735<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:292736</div></div>
Junio C Hamano9629d4f2012-12-19 00:28:272737<div class="paragraph"><p>There are (number of parents + 1) <code>@</code> characters in the chunk
Junio C Hamanoba4b9282008-07-06 05:20:312738header for combined diff format.</p></div>
Junio C Hamano29f14312006-10-26 08:47:292739</li>
Junio C Hamanoba4b9282008-07-06 05:20:312740</ol></div>
Junio C Hamano68cf15a2010-11-06 01:01:592741<div class="paragraph"><p>Unlike the traditional <em>unified</em> diff format, which shows two
Junio C Hamano9629d4f2012-12-19 00:28:272742files 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
2743added to B), or <code>" "</code> (space&#8201;&#8212;&#8201;unchanged) prefix, this format
Junio C Hamanofb56a962006-01-28 10:38:192744compares two or more files file1, file2,&#8230; with one file X, and
2745shows how X differs from each of fileN. One column for each of
Junio C Hamano68cf15a2010-11-06 01:01:592746fileN is prepended to the output line to note how X&#8217;s line is
Junio C Hamanoba4b9282008-07-06 05:20:312747different from it.</p></div>
Junio C Hamano9629d4f2012-12-19 00:28:272748<div class="paragraph"><p>A <code>-</code> character in the column N means that the line appears in
2749fileN but it does not appear in the result. A <code>+</code> character
Junio C Hamano54bf1e22008-12-20 06:30:112750in the column N means that the line appears in the result,
Junio C Hamano29f14312006-10-26 08:47:292751and fileN does not have that line (in other words, the line was
Junio C Hamanoba4b9282008-07-06 05:20:312752added, from the point of view of that parent).</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592753<div class="paragraph"><p>In the above example output, the function signature was changed
Junio C Hamano9629d4f2012-12-19 00:28:272754from both files (hence two <code>-</code> removals from both file1 and
2755file2, plus <code>++</code> to mean one line that was added does not appear
Junio C Hamano54bf1e22008-12-20 06:30:112756in either file1 nor file2). Also eight other lines are the same
Junio C Hamano9629d4f2012-12-19 00:28:272757from file1 but do not appear in file2 (hence prefixed with <code>+</code>).</p></div>
2758<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:192759merge commit with the merge result (i.e. file1..fileN are the
Junio C Hamano9629d4f2012-12-19 00:28:272760parents). When shown by <code>git diff-files -c</code>, it compares the
Junio C Hamanofb56a962006-01-28 10:38:192761two unresolved merge parents with the working tree file
2762(i.e. file1 is stage 2 aka "our version", file2 is stage 3 aka
Junio C Hamanoba4b9282008-07-06 05:20:312763"their version").</p></div>
Junio C Hamanofb56a962006-01-28 10:38:192764</div>
Junio C Hamano9629d4f2012-12-19 00:28:272765</div>
2766<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:312767<h2 id="_other_diff_formats">other diff formats</h2>
Junio C Hamano3a702342007-12-12 21:34:022768<div class="sectionbody">
Junio C Hamano9629d4f2012-12-19 00:28:272769<div class="paragraph"><p>The <code>--summary</code> option describes newly added, deleted, renamed and
2770copied files. The <code>--stat</code> option adds diffstat(1) graph to the
Junio C Hamano3a702342007-12-12 21:34:022771output. These options can be combined with other options, such as
Junio C Hamano9629d4f2012-12-19 00:28:272772<code>-p</code>, and are meant for human consumption.</p></div>
2773<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:022774formats the pathnames compactly by combining common prefix and suffix of
Junio C Hamano9629d4f2012-12-19 00:28:272775the pathnames. For example, a change that moves <code>arch/i386/Makefile</code> to
2776<code>arch/x86/Makefile</code> while modifying 4 lines will be shown like this:</p></div>
Junio C Hamano3a702342007-12-12 21:34:022777<div class="listingblock">
2778<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272779<pre><code>arch/{i386 =&gt; x86}/Makefile | 4 +--</code></pre>
Junio C Hamano3a702342007-12-12 21:34:022780</div></div>
Junio C Hamano9629d4f2012-12-19 00:28:272781<div class="paragraph"><p>The <code>--numstat</code> option gives the diffstat(1) information but is designed
2782for easier machine consumption. An entry in <code>--numstat</code> output looks
Junio C Hamanoba4b9282008-07-06 05:20:312783like this:</p></div>
Junio C Hamano3a702342007-12-12 21:34:022784<div class="listingblock">
2785<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272786<pre><code>1 2 README
27873 1 arch/{i386 =&gt; x86}/Makefile</code></pre>
Junio C Hamano3a702342007-12-12 21:34:022788</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592789<div class="paragraph"><p>That is, from left to right:</p></div>
2790<div class="olist arabic"><ol class="arabic">
Junio C Hamano3a702342007-12-12 21:34:022791<li>
2792<p>
2793the number of added lines;
2794</p>
2795</li>
2796<li>
2797<p>
2798a tab;
2799</p>
2800</li>
2801<li>
2802<p>
2803the number of deleted lines;
2804</p>
2805</li>
2806<li>
2807<p>
2808a tab;
2809</p>
2810</li>
2811<li>
2812<p>
2813pathname (possibly with rename/copy information);
2814</p>
2815</li>
2816<li>
2817<p>
2818a newline.
2819</p>
2820</li>
Junio C Hamanoba4b9282008-07-06 05:20:312821</ol></div>
Junio C Hamano9629d4f2012-12-19 00:28:272822<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:022823<div class="listingblock">
2824<div class="content">
Junio C Hamano9629d4f2012-12-19 00:28:272825<pre><code>1 2 README NUL
28263 1 NUL arch/i386/Makefile NUL arch/x86/Makefile NUL</code></pre>
Junio C Hamano3a702342007-12-12 21:34:022827</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592828<div class="paragraph"><p>That is:</p></div>
2829<div class="olist arabic"><ol class="arabic">
Junio C Hamano3a702342007-12-12 21:34:022830<li>
2831<p>
2832the number of added lines;
2833</p>
2834</li>
2835<li>
2836<p>
2837a tab;
2838</p>
2839</li>
2840<li>
2841<p>
2842the number of deleted lines;
2843</p>
2844</li>
2845<li>
2846<p>
2847a tab;
2848</p>
2849</li>
2850<li>
2851<p>
2852a NUL (only exists if renamed/copied);
2853</p>
2854</li>
2855<li>
2856<p>
2857pathname in preimage;
2858</p>
2859</li>
2860<li>
2861<p>
2862a NUL (only exists if renamed/copied);
2863</p>
2864</li>
2865<li>
2866<p>
2867pathname in postimage (only exists if renamed/copied);
2868</p>
2869</li>
2870<li>
2871<p>
2872a NUL.
2873</p>
2874</li>
Junio C Hamanoba4b9282008-07-06 05:20:312875</ol></div>
Junio C Hamano9629d4f2012-12-19 00:28:272876<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:022877scripts that read the output to tell if the current record being read is
2878a single-path record or a rename/copy record without reading ahead.
Junio C Hamano9629d4f2012-12-19 00:28:272879After reading added and deleted lines, reading up to <code>NUL</code> would yield
2880the pathname, but if that is <code>NUL</code>, the record will show two paths.</p></div>
Junio C Hamano3a702342007-12-12 21:34:022881</div>
Junio C Hamano9629d4f2012-12-19 00:28:272882</div>
2883<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:312884<h2 id="_git">GIT</h2>
Junio C Hamano1a4e8412005-12-27 08:17:232885<div class="sectionbody">
Junio C Hamanoa28a9202012-06-21 07:08:232886<div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232887</div>
Junio C Hamano7bd050f2011-09-22 06:32:222888</div>
Junio C Hamano9629d4f2012-12-19 00:28:272889</div>
Junio C Hamano7bd050f2011-09-22 06:32:222890<div id="footnotes"><hr /></div>
Junio C Hamano1a4e8412005-12-27 08:17:232891<div id="footer">
2892<div id="footer-text">
Junio C Hamano9629d4f2012-12-19 00:28:272893Last updated 2011-11-15 13:45:02 PST
Junio C Hamano1a4e8412005-12-27 08:17:232894</div>
2895</div>
2896</body>
2897</html>