blob: 03b808bec23d7ae702cd59f3852dccf00b93505e [file] [log] [blame]
Junio C Hamano1a4e8412005-12-27 08:17:231<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
2 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
4<head>
Junio C Hamano9629d4f2012-12-19 00:28:275<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
Junio C Hamanoac12f0e2014-09-19 22:32:516<meta name="generator" content="AsciiDoc 8.6.9" />
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 Hamanoac12f0e2014-09-19 22:32:5190.monospaced, code, pre {
91 font-family: "Courier New", Courier, monospace;
92 font-size: inherit;
93 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:2394 padding: 0;
95 margin: 0;
96}
Junio C Hamanoac12f0e2014-09-19 22:32:5197pre {
98 white-space: pre-wrap;
99}
Junio C Hamano1a4e8412005-12-27 08:17:23100
Junio C Hamano9629d4f2012-12-19 00:28:27101#author {
Junio C Hamano1a4e8412005-12-27 08:17:23102 color: #527bbd;
Junio C Hamano1a4e8412005-12-27 08:17:23103 font-weight: bold;
Junio C Hamanoba4b9282008-07-06 05:20:31104 font-size: 1.1em;
Junio C Hamano1a4e8412005-12-27 08:17:23105}
Junio C Hamano9629d4f2012-12-19 00:28:27106#email {
Junio C Hamano1a4e8412005-12-27 08:17:23107}
Junio C Hamano9629d4f2012-12-19 00:28:27108#revnumber, #revdate, #revremark {
Junio C Hamano1a4e8412005-12-27 08:17:23109}
110
Junio C Hamano9629d4f2012-12-19 00:28:27111#footer {
Junio C Hamano1a4e8412005-12-27 08:17:23112 font-size: small;
113 border-top: 2px solid silver;
114 padding-top: 0.5em;
115 margin-top: 4.0em;
116}
Junio C Hamano9629d4f2012-12-19 00:28:27117#footer-text {
Junio C Hamano1a4e8412005-12-27 08:17:23118 float: left;
119 padding-bottom: 0.5em;
120}
Junio C Hamano9629d4f2012-12-19 00:28:27121#footer-badges {
Junio C Hamano1a4e8412005-12-27 08:17:23122 float: right;
123 padding-bottom: 0.5em;
124}
125
Junio C Hamano9629d4f2012-12-19 00:28:27126#preamble {
Junio C Hamano68cf15a2010-11-06 01:01:59127 margin-top: 1.5em;
128 margin-bottom: 1.5em;
129}
Junio C Hamano9629d4f2012-12-19 00:28:27130div.imageblock, div.exampleblock, div.verseblock,
Junio C Hamano1a4e8412005-12-27 08:17:23131div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
132div.admonitionblock {
Junio C Hamano7bd050f2011-09-22 06:32:22133 margin-top: 1.0em;
Junio C Hamano1a4e8412005-12-27 08:17:23134 margin-bottom: 1.5em;
135}
136div.admonitionblock {
Junio C Hamano7bd050f2011-09-22 06:32:22137 margin-top: 2.0em;
138 margin-bottom: 2.0em;
139 margin-right: 10%;
140 color: #606060;
Junio C Hamano1a4e8412005-12-27 08:17:23141}
142
143div.content { /* Block element content. */
144 padding: 0;
145}
146
147/* Block element titles. */
148div.title, caption.title {
Junio C Hamano68cf15a2010-11-06 01:01:59149 color: #527bbd;
Junio C Hamano1a4e8412005-12-27 08:17:23150 font-weight: bold;
151 text-align: left;
152 margin-top: 1.0em;
153 margin-bottom: 0.5em;
154}
155div.title + * {
156 margin-top: 0;
157}
158
159td div.title:first-child {
160 margin-top: 0.0em;
161}
162div.content div.title:first-child {
163 margin-top: 0.0em;
164}
165div.content + div.title {
166 margin-top: 0.0em;
167}
168
169div.sidebarblock > div.content {
170 background: #ffffee;
Junio C Hamano9629d4f2012-12-19 00:28:27171 border: 1px solid #dddddd;
172 border-left: 4px solid #f0f0f0;
Junio C Hamano1a4e8412005-12-27 08:17:23173 padding: 0.5em;
174}
175
176div.listingblock > div.content {
Junio C Hamano9629d4f2012-12-19 00:28:27177 border: 1px solid #dddddd;
178 border-left: 5px solid #f0f0f0;
179 background: #f8f8f8;
Junio C Hamano1a4e8412005-12-27 08:17:23180 padding: 0.5em;
181}
182
Junio C Hamano7bd050f2011-09-22 06:32:22183div.quoteblock, div.verseblock {
184 padding-left: 1.0em;
185 margin-left: 1.0em;
Junio C Hamano68cf15a2010-11-06 01:01:59186 margin-right: 10%;
Junio C Hamano9629d4f2012-12-19 00:28:27187 border-left: 5px solid #f0f0f0;
188 color: #888;
Junio C Hamano1a4e8412005-12-27 08:17:23189}
Junio C Hamano7bd050f2011-09-22 06:32:22190
Junio C Hamano68cf15a2010-11-06 01:01:59191div.quoteblock > div.attribution {
192 padding-top: 0.5em;
Junio C Hamano1a4e8412005-12-27 08:17:23193 text-align: right;
194}
Junio C Hamano68cf15a2010-11-06 01:01:59195
Junio C Hamano9629d4f2012-12-19 00:28:27196div.verseblock > pre.content {
197 font-family: inherit;
198 font-size: inherit;
Junio C Hamano68cf15a2010-11-06 01:01:59199}
200div.verseblock > div.attribution {
201 padding-top: 0.75em;
202 text-align: left;
203}
204/* DEPRECATED: Pre version 8.2.7 verse style literal block. */
Junio C Hamanoba4b9282008-07-06 05:20:31205div.verseblock + div.attribution {
206 text-align: left;
207}
Junio C Hamano1a4e8412005-12-27 08:17:23208
209div.admonitionblock .icon {
210 vertical-align: top;
211 font-size: 1.1em;
212 font-weight: bold;
213 text-decoration: underline;
214 color: #527bbd;
215 padding-right: 0.5em;
216}
217div.admonitionblock td.content {
218 padding-left: 0.5em;
Junio C Hamano7bd050f2011-09-22 06:32:22219 border-left: 3px solid #dddddd;
Junio C Hamano1a4e8412005-12-27 08:17:23220}
221
222div.exampleblock > div.content {
Junio C Hamano7bd050f2011-09-22 06:32:22223 border-left: 3px solid #dddddd;
224 padding-left: 0.5em;
Junio C Hamano1a4e8412005-12-27 08:17:23225}
226
Junio C Hamano1a4e8412005-12-27 08:17:23227div.imageblock div.content { padding-left: 0; }
Junio C Hamanoac12f0e2014-09-19 22:32:51228span.image img { border-style: none; vertical-align: text-bottom; }
Junio C Hamano68cf15a2010-11-06 01:01:59229a.image:visited { color: white; }
Junio C Hamano1a4e8412005-12-27 08:17:23230
231dl {
232 margin-top: 0.8em;
233 margin-bottom: 0.8em;
234}
235dt {
236 margin-top: 0.5em;
237 margin-bottom: 0;
Junio C Hamano68cf15a2010-11-06 01:01:59238 font-style: normal;
239 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:23240}
241dd > *:first-child {
Junio C Hamano68cf15a2010-11-06 01:01:59242 margin-top: 0.1em;
Junio C Hamano1a4e8412005-12-27 08:17:23243}
244
245ul, ol {
246 list-style-position: outside;
247}
Junio C Hamano68cf15a2010-11-06 01:01:59248ol.arabic {
249 list-style-type: decimal;
250}
251ol.loweralpha {
Junio C Hamano1a4e8412005-12-27 08:17:23252 list-style-type: lower-alpha;
253}
Junio C Hamano68cf15a2010-11-06 01:01:59254ol.upperalpha {
255 list-style-type: upper-alpha;
256}
257ol.lowerroman {
258 list-style-type: lower-roman;
259}
260ol.upperroman {
261 list-style-type: upper-roman;
262}
263
264div.compact ul, div.compact ol,
265div.compact p, div.compact p,
266div.compact div, div.compact div {
267 margin-top: 0.1em;
268 margin-bottom: 0.1em;
269}
Junio C Hamano1a4e8412005-12-27 08:17:23270
Junio C Hamano1a4e8412005-12-27 08:17:23271tfoot {
272 font-weight: bold;
273}
Junio C Hamano68cf15a2010-11-06 01:01:59274td > div.verse {
275 white-space: pre;
276}
Junio C Hamano68cf15a2010-11-06 01:01:59277
278div.hdlist {
Junio C Hamano1a4e8412005-12-27 08:17:23279 margin-top: 0.8em;
280 margin-bottom: 0.8em;
281}
Junio C Hamano68cf15a2010-11-06 01:01:59282div.hdlist tr {
283 padding-bottom: 15px;
Junio C Hamanoba4b9282008-07-06 05:20:31284}
Junio C Hamano68cf15a2010-11-06 01:01:59285dt.hdlist1.strong, td.hdlist1.strong {
286 font-weight: bold;
287}
288td.hdlist1 {
Junio C Hamano1a4e8412005-12-27 08:17:23289 vertical-align: top;
Junio C Hamano68cf15a2010-11-06 01:01:59290 font-style: normal;
Junio C Hamano1a4e8412005-12-27 08:17:23291 padding-right: 0.8em;
Junio C Hamano68cf15a2010-11-06 01:01:59292 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:23293}
Junio C Hamano68cf15a2010-11-06 01:01:59294td.hdlist2 {
Junio C Hamano1a4e8412005-12-27 08:17:23295 vertical-align: top;
296}
Junio C Hamano68cf15a2010-11-06 01:01:59297div.hdlist.compact tr {
298 margin: 0;
299 padding-bottom: 0;
300}
301
302.comment {
303 background: yellow;
304}
Junio C Hamano1a4e8412005-12-27 08:17:23305
Junio C Hamano7bd050f2011-09-22 06:32:22306.footnote, .footnoteref {
307 font-size: 0.8em;
308}
309
310span.footnote, span.footnoteref {
311 vertical-align: super;
312}
313
314#footnotes {
315 margin: 20px 0 20px 0;
316 padding: 7px 0 0 0;
317}
318
319#footnotes div.footnote {
320 margin: 0 0 5px 0;
321}
322
323#footnotes hr {
324 border: none;
325 border-top: 1px solid silver;
326 height: 1px;
327 text-align: left;
328 margin-left: 0;
329 width: 20%;
330 min-width: 100px;
331}
332
Junio C Hamano9629d4f2012-12-19 00:28:27333div.colist td {
334 padding-right: 0.5em;
335 padding-bottom: 0.3em;
336 vertical-align: top;
337}
338div.colist td img {
339 margin-top: 0.3em;
Junio C Hamano1a4e8412005-12-27 08:17:23340}
Junio C Hamanoba4b9282008-07-06 05:20:31341
Junio C Hamano9629d4f2012-12-19 00:28:27342@media print {
343 #footer-badges { display: none; }
344}
345
346#toc {
Junio C Hamano7bd050f2011-09-22 06:32:22347 margin-bottom: 2.5em;
348}
349
Junio C Hamano9629d4f2012-12-19 00:28:27350#toctitle {
Junio C Hamanoba4b9282008-07-06 05:20:31351 color: #527bbd;
Junio C Hamanoba4b9282008-07-06 05:20:31352 font-size: 1.1em;
353 font-weight: bold;
354 margin-top: 1.0em;
355 margin-bottom: 0.1em;
356}
357
Junio C Hamanoac12f0e2014-09-19 22:32:51358div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
Junio C Hamanoba4b9282008-07-06 05:20:31359 margin-top: 0;
360 margin-bottom: 0;
361}
362div.toclevel2 {
363 margin-left: 2em;
364 font-size: 0.9em;
365}
366div.toclevel3 {
367 margin-left: 4em;
368 font-size: 0.9em;
369}
370div.toclevel4 {
371 margin-left: 6em;
372 font-size: 0.9em;
373}
Junio C Hamano9629d4f2012-12-19 00:28:27374
375span.aqua { color: aqua; }
376span.black { color: black; }
377span.blue { color: blue; }
378span.fuchsia { color: fuchsia; }
379span.gray { color: gray; }
380span.green { color: green; }
381span.lime { color: lime; }
382span.maroon { color: maroon; }
383span.navy { color: navy; }
384span.olive { color: olive; }
385span.purple { color: purple; }
386span.red { color: red; }
387span.silver { color: silver; }
388span.teal { color: teal; }
389span.white { color: white; }
390span.yellow { color: yellow; }
391
392span.aqua-background { background: aqua; }
393span.black-background { background: black; }
394span.blue-background { background: blue; }
395span.fuchsia-background { background: fuchsia; }
396span.gray-background { background: gray; }
397span.green-background { background: green; }
398span.lime-background { background: lime; }
399span.maroon-background { background: maroon; }
400span.navy-background { background: navy; }
401span.olive-background { background: olive; }
402span.purple-background { background: purple; }
403span.red-background { background: red; }
404span.silver-background { background: silver; }
405span.teal-background { background: teal; }
406span.white-background { background: white; }
407span.yellow-background { background: yellow; }
408
409span.big { font-size: 2em; }
410span.small { font-size: 0.6em; }
411
412span.underline { text-decoration: underline; }
413span.overline { text-decoration: overline; }
414span.line-through { text-decoration: line-through; }
415
Junio C Hamanoac12f0e2014-09-19 22:32:51416div.unbreakable { page-break-inside: avoid; }
417
Junio C Hamano9629d4f2012-12-19 00:28:27418
419/*
420 * xhtml11 specific
421 *
422 * */
423
424div.tableblock {
425 margin-top: 1.0em;
426 margin-bottom: 1.5em;
427}
428div.tableblock > table {
429 border: 3px solid #527bbd;
430}
431thead, p.table.header {
432 font-weight: bold;
433 color: #527bbd;
434}
435p.table {
436 margin-top: 0;
437}
438/* Because the table frame attribute is overriden by CSS in most browsers. */
439div.tableblock > table[frame="void"] {
440 border-style: none;
441}
442div.tableblock > table[frame="hsides"] {
443 border-left-style: none;
444 border-right-style: none;
445}
446div.tableblock > table[frame="vsides"] {
447 border-top-style: none;
448 border-bottom-style: none;
449}
450
451
452/*
453 * html5 specific
454 *
455 * */
456
457table.tableblock {
458 margin-top: 1.0em;
459 margin-bottom: 1.5em;
460}
461thead, p.tableblock.header {
462 font-weight: bold;
463 color: #527bbd;
464}
465p.tableblock {
466 margin-top: 0;
467}
468table.tableblock {
469 border-width: 3px;
470 border-spacing: 0px;
471 border-style: solid;
472 border-color: #527bbd;
473 border-collapse: collapse;
474}
475th.tableblock, td.tableblock {
476 border-width: 1px;
477 padding: 4px;
478 border-style: solid;
479 border-color: #527bbd;
480}
481
482table.tableblock.frame-topbot {
483 border-left-style: hidden;
484 border-right-style: hidden;
485}
486table.tableblock.frame-sides {
487 border-top-style: hidden;
488 border-bottom-style: hidden;
489}
490table.tableblock.frame-none {
491 border-style: hidden;
492}
493
494th.tableblock.halign-left, td.tableblock.halign-left {
495 text-align: left;
496}
497th.tableblock.halign-center, td.tableblock.halign-center {
498 text-align: center;
499}
500th.tableblock.halign-right, td.tableblock.halign-right {
501 text-align: right;
502}
503
504th.tableblock.valign-top, td.tableblock.valign-top {
505 vertical-align: top;
506}
507th.tableblock.valign-middle, td.tableblock.valign-middle {
508 vertical-align: middle;
509}
510th.tableblock.valign-bottom, td.tableblock.valign-bottom {
511 vertical-align: bottom;
512}
513
514
515/*
516 * manpage specific
517 *
518 * */
519
520body.manpage h1 {
Junio C Hamano68cf15a2010-11-06 01:01:59521 padding-top: 0.5em;
522 padding-bottom: 0.5em;
523 border-top: 2px solid silver;
524 border-bottom: 2px solid silver;
525}
Junio C Hamano9629d4f2012-12-19 00:28:27526body.manpage h2 {
Junio C Hamano68cf15a2010-11-06 01:01:59527 border-style: none;
528}
Junio C Hamano9629d4f2012-12-19 00:28:27529body.manpage div.sectionbody {
530 margin-left: 3em;
Junio C Hamano68cf15a2010-11-06 01:01:59531}
532
533@media print {
Junio C Hamano9629d4f2012-12-19 00:28:27534 body.manpage div#toc { display: none; }
Junio C Hamano68cf15a2010-11-06 01:01:59535}
Junio C Hamanoac12f0e2014-09-19 22:32:51536
537
Junio C Hamano1a4e8412005-12-27 08:17:23538</style>
Junio C Hamano7bd050f2011-09-22 06:32:22539<script type="text/javascript">
540/*<![CDATA[*/
Junio C Hamano7bd050f2011-09-22 06:32:22541var asciidoc = { // Namespace.
542
543/////////////////////////////////////////////////////////////////////
544// Table Of Contents generator
545/////////////////////////////////////////////////////////////////////
546
547/* Author: Mihai Bazon, September 2002
548 * http://students.infoiasi.ro/~mishoo
549 *
550 * Table Of Content generator
551 * Version: 0.4
552 *
553 * Feel free to use this script under the terms of the GNU General Public
554 * License, as long as you do not remove or alter this notice.
555 */
556
557 /* modified by Troy D. Hanson, September 2006. License: GPL */
558 /* modified by Stuart Rackham, 2006, 2009. License: GPL */
559
560// toclevels = 1..4.
561toc: function (toclevels) {
562
563 function getText(el) {
564 var text = "";
565 for (var i = el.firstChild; i != null; i = i.nextSibling) {
566 if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
567 text += i.data;
568 else if (i.firstChild != null)
569 text += getText(i);
570 }
571 return text;
572 }
573
574 function TocEntry(el, text, toclevel) {
575 this.element = el;
576 this.text = text;
577 this.toclevel = toclevel;
578 }
579
580 function tocEntries(el, toclevels) {
581 var result = new Array;
Junio C Hamanoac12f0e2014-09-19 22:32:51582 var re = new RegExp('[hH]([1-'+(toclevels+1)+'])');
Junio C Hamano7bd050f2011-09-22 06:32:22583 // Function that scans the DOM tree for header elements (the DOM2
584 // nodeIterator API would be a better technique but not supported by all
585 // browsers).
586 var iterate = function (el) {
587 for (var i = el.firstChild; i != null; i = i.nextSibling) {
588 if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
589 var mo = re.exec(i.tagName);
590 if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
591 result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
592 }
593 iterate(i);
594 }
595 }
596 }
597 iterate(el);
598 return result;
599 }
600
601 var toc = document.getElementById("toc");
Junio C Hamano9629d4f2012-12-19 00:28:27602 if (!toc) {
603 return;
604 }
605
606 // Delete existing TOC entries in case we're reloading the TOC.
607 var tocEntriesToRemove = [];
608 var i;
609 for (i = 0; i < toc.childNodes.length; i++) {
610 var entry = toc.childNodes[i];
Junio C Hamanoac12f0e2014-09-19 22:32:51611 if (entry.nodeName.toLowerCase() == 'div'
Junio C Hamano9629d4f2012-12-19 00:28:27612 && entry.getAttribute("class")
613 && entry.getAttribute("class").match(/^toclevel/))
614 tocEntriesToRemove.push(entry);
615 }
616 for (i = 0; i < tocEntriesToRemove.length; i++) {
617 toc.removeChild(tocEntriesToRemove[i]);
618 }
619
620 // Rebuild TOC entries.
Junio C Hamano7bd050f2011-09-22 06:32:22621 var entries = tocEntries(document.getElementById("content"), toclevels);
622 for (var i = 0; i < entries.length; ++i) {
623 var entry = entries[i];
624 if (entry.element.id == "")
625 entry.element.id = "_toc_" + i;
626 var a = document.createElement("a");
627 a.href = "#" + entry.element.id;
628 a.appendChild(document.createTextNode(entry.text));
629 var div = document.createElement("div");
630 div.appendChild(a);
631 div.className = "toclevel" + entry.toclevel;
632 toc.appendChild(div);
633 }
634 if (entries.length == 0)
635 toc.parentNode.removeChild(toc);
636},
637
638
639/////////////////////////////////////////////////////////////////////
640// Footnotes generator
641/////////////////////////////////////////////////////////////////////
642
643/* Based on footnote generation code from:
644 * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
645 */
646
647footnotes: function () {
Junio C Hamano9629d4f2012-12-19 00:28:27648 // Delete existing footnote entries in case we're reloading the footnodes.
649 var i;
Junio C Hamano7bd050f2011-09-22 06:32:22650 var noteholder = document.getElementById("footnotes");
Junio C Hamano9629d4f2012-12-19 00:28:27651 if (!noteholder) {
652 return;
653 }
654 var entriesToRemove = [];
655 for (i = 0; i < noteholder.childNodes.length; i++) {
656 var entry = noteholder.childNodes[i];
Junio C Hamanoac12f0e2014-09-19 22:32:51657 if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote")
Junio C Hamano9629d4f2012-12-19 00:28:27658 entriesToRemove.push(entry);
659 }
660 for (i = 0; i < entriesToRemove.length; i++) {
661 noteholder.removeChild(entriesToRemove[i]);
662 }
663
664 // Rebuild footnote entries.
665 var cont = document.getElementById("content");
Junio C Hamano7bd050f2011-09-22 06:32:22666 var spans = cont.getElementsByTagName("span");
667 var refs = {};
668 var n = 0;
669 for (i=0; i<spans.length; i++) {
670 if (spans[i].className == "footnote") {
671 n++;
Junio C Hamano9629d4f2012-12-19 00:28:27672 var note = spans[i].getAttribute("data-note");
673 if (!note) {
674 // Use [\s\S] in place of . so multi-line matches work.
675 // Because JavaScript has no s (dotall) regex flag.
676 note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
677 spans[i].innerHTML =
678 "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
679 "' title='View footnote' class='footnote'>" + n + "</a>]";
680 spans[i].setAttribute("data-note", note);
681 }
Junio C Hamano7bd050f2011-09-22 06:32:22682 noteholder.innerHTML +=
683 "<div class='footnote' id='_footnote_" + n + "'>" +
684 "<a href='#_footnoteref_" + n + "' title='Return to text'>" +
685 n + "</a>. " + note + "</div>";
Junio C Hamano7bd050f2011-09-22 06:32:22686 var id =spans[i].getAttribute("id");
687 if (id != null) refs["#"+id] = n;
688 }
689 }
690 if (n == 0)
691 noteholder.parentNode.removeChild(noteholder);
692 else {
693 // Process footnoterefs.
694 for (i=0; i<spans.length; i++) {
695 if (spans[i].className == "footnoteref") {
696 var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
697 href = href.match(/#.*/)[0]; // Because IE return full URL.
698 n = refs[href];
699 spans[i].innerHTML =
700 "[<a href='#_footnote_" + n +
701 "' title='View footnote' class='footnote'>" + n + "</a>]";
702 }
703 }
704 }
Junio C Hamano9629d4f2012-12-19 00:28:27705},
706
707install: function(toclevels) {
708 var timerId;
709
710 function reinstall() {
711 asciidoc.footnotes();
712 if (toclevels) {
713 asciidoc.toc(toclevels);
714 }
715 }
716
717 function reinstallAndRemoveTimer() {
718 clearInterval(timerId);
719 reinstall();
720 }
721
722 timerId = setInterval(reinstall, 500);
723 if (document.addEventListener)
724 document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false);
725 else
726 window.onload = reinstallAndRemoveTimer;
Junio C Hamano7bd050f2011-09-22 06:32:22727}
728
729}
Junio C Hamano9629d4f2012-12-19 00:28:27730asciidoc.install();
Junio C Hamano7bd050f2011-09-22 06:32:22731/*]]>*/
732</script>
Junio C Hamano1a4e8412005-12-27 08:17:23733</head>
Junio C Hamano9629d4f2012-12-19 00:28:27734<body class="manpage">
Junio C Hamano1a4e8412005-12-27 08:17:23735<div id="header">
736<h1>
737git-diff-tree(1) Manual Page
738</h1>
739<h2>NAME</h2>
740<div class="sectionbody">
741<p>git-diff-tree -
742 Compares the content and mode of blobs found via two tree objects
743</p>
744</div>
745</div>
Junio C Hamano7bd050f2011-09-22 06:32:22746<div id="content">
Junio C Hamano9629d4f2012-12-19 00:28:27747<div class="sect1">
Junio C Hamano68cf15a2010-11-06 01:01:59748<h2 id="_synopsis">SYNOPSIS</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23749<div class="sectionbody">
Junio C Hamano235a91e2006-01-07 01:13:58750<div class="verseblock">
Junio C Hamano9629d4f2012-12-19 00:28:27751<pre class="content"><em>git diff-tree</em> [--stdin] [-m] [-s] [-v] [--no-commit-id] [--pretty]
Junio C Hamanofb56a962006-01-28 10:38:19752 [-t] [-r] [-c | --cc] [--root] [&lt;common diff options&gt;]
Junio C Hamano9629d4f2012-12-19 00:28:27753 &lt;tree-ish&gt; [&lt;tree-ish&gt;] [&lt;path&gt;&#8230;]</pre>
754<div class="attribution">
Junio C Hamano68cf15a2010-11-06 01:01:59755</div></div>
Junio C Hamano1a4e8412005-12-27 08:17:23756</div>
Junio C Hamano9629d4f2012-12-19 00:28:27757</div>
758<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:31759<h2 id="_description">DESCRIPTION</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23760<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:59761<div class="paragraph"><p>Compares the content and mode of the blobs found via two tree objects.</p></div>
762<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:31763(see --stdin below).</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:59764<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:23765</div>
Junio C Hamano9629d4f2012-12-19 00:28:27766</div>
767<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:31768<h2 id="_options">OPTIONS</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23769<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:59770<div class="dlist"><dl>
771<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:23772-p
773</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59774<dt class="hdlist1">
Junio C Hamanobbbb8652008-12-29 10:34:22775-u
776</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59777<dt class="hdlist1">
Junio C Hamanoe97d5772010-05-19 08:13:58778--patch
779</dt>
Junio C Hamano1a4e8412005-12-27 08:17:23780<dd>
781<p>
Junio C Hamanoff979792007-11-16 10:11:30782 Generate patch (see section on generating patches).
Junio C Hamano1a4e8412005-12-27 08:17:23783</p>
784</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59785<dt class="hdlist1">
Junio C Hamano58f587a2013-07-22 19:20:59786-s
787</dt>
788<dt class="hdlist1">
789--no-patch
790</dt>
791<dd>
792<p>
Junio C Hamanoac12f0e2014-09-19 22:32:51793 Suppress diff output. Useful for commands like <code>git show</code> that
794 show the patch by default, or to cancel the effect of <code>--patch</code>.
Junio C Hamano58f587a2013-07-22 19:20:59795</p>
796</dd>
797<dt class="hdlist1">
Junio C Hamano69361562007-07-26 02:14:34798-U&lt;n&gt;
799</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59800<dt class="hdlist1">
Junio C Hamano69361562007-07-26 02:14:34801--unified=&lt;n&gt;
802</dt>
803<dd>
804<p>
805 Generate diffs with &lt;n&gt; lines of context instead of
Junio C Hamano3b70d3c2009-11-21 17:37:37806 the usual three.
Junio C Hamanoac12f0e2014-09-19 22:32:51807 Implies <code>-p</code>.
Junio C Hamano69361562007-07-26 02:14:34808</p>
809</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59810<dt class="hdlist1">
Junio C Hamano9ae1a062006-07-10 08:12:34811--raw
812</dt>
813<dd>
814<p>
Junio C Hamano85f1fde2015-06-01 20:37:32815 Generate the diff in raw format.
Junio C Hamano1dbca522015-05-22 20:48:55816 This is the default.
Junio C Hamano9ae1a062006-07-10 08:12:34817</p>
818</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59819<dt class="hdlist1">
Junio C Hamano54559c82006-04-13 07:45:12820--patch-with-raw
821</dt>
822<dd>
823<p>
Junio C Hamanoac12f0e2014-09-19 22:32:51824 Synonym for <code>-p --raw</code>.
Junio C Hamano54559c82006-04-13 07:45:12825</p>
826</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59827<dt class="hdlist1">
Junio C Hamanoad70bf02016-09-26 23:44:27828--indent-heuristic
829</dt>
Junio C Hamanoa65b6762017-11-06 04:45:42830<dd>
831<p>
832 Enable the heuristic that shift diff hunk boundaries to make patches
833 easier to read. This is the default.
834</p>
835</dd>
Junio C Hamanoad70bf02016-09-26 23:44:27836<dt class="hdlist1">
837--no-indent-heuristic
838</dt>
Junio C Hamano5f888332016-06-13 19:28:31839<dd>
840<p>
Junio C Hamanoa65b6762017-11-06 04:45:42841 Disable the indent heuristic.
Junio C Hamano5f888332016-06-13 19:28:31842</p>
843</dd>
844<dt class="hdlist1">
Junio C Hamano5a73f302011-10-14 05:58:34845--minimal
846</dt>
847<dd>
848<p>
849 Spend extra time to make sure the smallest possible
850 diff is produced.
851</p>
852</dd>
853<dt class="hdlist1">
Junio C Hamano20d47e32009-01-26 06:36:02854--patience
855</dt>
856<dd>
857<p>
858 Generate a diff using the "patience diff" algorithm.
859</p>
860</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59861<dt class="hdlist1">
Junio C Hamanoaea9e6b2012-03-07 00:17:11862--histogram
863</dt>
864<dd>
865<p>
866 Generate a diff using the "histogram diff" algorithm.
867</p>
868</dd>
869<dt class="hdlist1">
Junio C Hamano047135e2017-12-19 21:57:54870--anchored=&lt;text&gt;
871</dt>
872<dd>
873<p>
874 Generate a diff using the "anchored diff" algorithm.
875</p>
876<div class="paragraph"><p>This option may be specified more than once.</p></div>
877<div class="paragraph"><p>If a line exists in both the source and destination, exists only once,
878and starts with this text, this algorithm attempts to prevent it from
879appearing as a deletion or addition in the output. It uses the "patience
880diff" algorithm internally.</p></div>
881</dd>
882<dt class="hdlist1">
Junio C Hamano80ad00d2013-02-18 00:19:03883--diff-algorithm={patience|minimal|histogram|myers}
884</dt>
885<dd>
886<p>
887 Choose a diff algorithm. The variants are as follows:
888</p>
889<div class="openblock">
890<div class="content">
891<div class="dlist"><dl>
892<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:51893<code>default</code>, <code>myers</code>
Junio C Hamano80ad00d2013-02-18 00:19:03894</dt>
895<dd>
896<p>
897 The basic greedy diff algorithm. Currently, this is the default.
898</p>
899</dd>
900<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:51901<code>minimal</code>
Junio C Hamano80ad00d2013-02-18 00:19:03902</dt>
903<dd>
904<p>
905 Spend extra time to make sure the smallest possible diff is
906 produced.
907</p>
908</dd>
909<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:51910<code>patience</code>
Junio C Hamano80ad00d2013-02-18 00:19:03911</dt>
912<dd>
913<p>
914 Use "patience diff" algorithm when generating patches.
915</p>
916</dd>
917<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:51918<code>histogram</code>
Junio C Hamano80ad00d2013-02-18 00:19:03919</dt>
920<dd>
921<p>
922 This algorithm extends the patience algorithm to "support
923 low-occurrence common elements".
924</p>
925</dd>
926</dl></div>
927</div></div>
928<div class="paragraph"><p>For instance, if you configured diff.algorithm variable to a
929non-default value and want to use the default one, then you
Junio C Hamanoac12f0e2014-09-19 22:32:51930have to use <code>--diff-algorithm=default</code> option.</p></div>
Junio C Hamano80ad00d2013-02-18 00:19:03931</dd>
932<dt class="hdlist1">
Junio C Hamano4c4b0122011-06-30 01:19:32933--stat[=&lt;width&gt;[,&lt;name-width&gt;[,&lt;count&gt;]]]
Junio C Hamanoba7c8d82006-04-15 06:17:42934</dt>
935<dd>
936<p>
Junio C Hamanoaea9e6b2012-03-07 00:17:11937 Generate a diffstat. By default, as much space as necessary
938 will be used for the filename part, and the rest for the graph
939 part. Maximum width defaults to terminal width, or 80 columns
Junio C Hamano7f2b3cb2012-06-22 22:42:39940 if not connected to a terminal, and can be overridden by
Junio C Hamanoac12f0e2014-09-19 22:32:51941 <code>&lt;width&gt;</code>. The width of the filename part can be limited by
942 giving another width <code>&lt;name-width&gt;</code> after a comma. The width
Junio C Hamanoaea9e6b2012-03-07 00:17:11943 of the graph part can be limited by using
Junio C Hamanoac12f0e2014-09-19 22:32:51944 <code>--stat-graph-width=&lt;width&gt;</code> (affects all commands generating
945 a stat graph) or by setting <code>diff.statGraphWidth=&lt;width&gt;</code>
946 (does not affect <code>git format-patch</code>).
947 By giving a third parameter <code>&lt;count&gt;</code>, you can limit the
948 output to the first <code>&lt;count&gt;</code> lines, followed by <code>...</code> if
Junio C Hamanoaea9e6b2012-03-07 00:17:11949 there are more.
Junio C Hamanoba7c8d82006-04-15 06:17:42950</p>
Junio C Hamanoac12f0e2014-09-19 22:32:51951<div class="paragraph"><p>These parameters can also be set individually with <code>--stat-width=&lt;width&gt;</code>,
952<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:42953</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59954<dt class="hdlist1">
Junio C Hamano45badf02018-03-14 21:56:41955--compact-summary
956</dt>
957<dd>
958<p>
959 Output a condensed summary of extended header information such
960 as file creations or deletions ("new" or "gone", optionally "+l"
961 if it&#8217;s a symlink) and mode changes ("+x" or "-x" for adding
962 or removing executable bit respectively) in diffstat. The
963 information is put betwen the filename part and the graph
964 part. Implies <code>--stat</code>.
965</p>
966</dd>
967<dt class="hdlist1">
Junio C Hamanofbe00522006-10-19 05:58:48968--numstat
969</dt>
970<dd>
971<p>
Junio C Hamanoac12f0e2014-09-19 22:32:51972 Similar to <code>--stat</code>, but shows number of added and
Junio C Hamanofbe00522006-10-19 05:58:48973 deleted lines in decimal notation and pathname without
Junio C Hamanod793de52006-12-26 09:11:43974 abbreviation, to make it more machine friendly. For
Junio C Hamanoac12f0e2014-09-19 22:32:51975 binary files, outputs two <code>-</code> instead of saying
976 <code>0 0</code>.
Junio C Hamanofbe00522006-10-19 05:58:48977</p>
978</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59979<dt class="hdlist1">
Junio C Hamano7d23f5e2006-12-16 07:44:04980--shortstat
981</dt>
982<dd>
983<p>
Junio C Hamanoac12f0e2014-09-19 22:32:51984 Output only the last line of the <code>--stat</code> format containing total
Junio C Hamano7d23f5e2006-12-16 07:44:04985 number of modified files, as well as number of added and deleted
986 lines.
987</p>
988</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59989<dt class="hdlist1">
Junio C Hamano1c222c52011-05-13 19:55:32990--dirstat[=&lt;param1,param2,&#8230;&gt;]
Junio C Hamano6a45be92008-04-22 08:19:03991</dt>
992<dd>
993<p>
Junio C Hamano1c222c52011-05-13 19:55:32994 Output the distribution of relative amount of changes for each
Junio C Hamanoac12f0e2014-09-19 22:32:51995 sub-directory. The behavior of <code>--dirstat</code> can be customized by
Junio C Hamano1c222c52011-05-13 19:55:32996 passing it a comma separated list of parameters.
Junio C Hamanoac12f0e2014-09-19 22:32:51997 The defaults are controlled by the <code>diff.dirstat</code> configuration
Junio C Hamanoa28a9202012-06-21 07:08:23998 variable (see <a href="git-config.html">git-config(1)</a>).
Junio C Hamano1c222c52011-05-13 19:55:32999 The following parameters are available:
Junio C Hamano6a45be92008-04-22 08:19:031000</p>
Junio C Hamano9629d4f2012-12-19 00:28:271001<div class="openblock">
1002<div class="content">
Junio C Hamano1c222c52011-05-13 19:55:321003<div class="dlist"><dl>
1004<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:511005<code>changes</code>
Junio C Hamano1c222c52011-05-13 19:55:321006</dt>
1007<dd>
1008<p>
1009 Compute the dirstat numbers by counting the lines that have been
1010 removed from the source, or added to the destination. This ignores
1011 the amount of pure code movements within a file. In other words,
1012 rearranging lines in a file is not counted as much as other changes.
1013 This is the default behavior when no parameter is given.
1014</p>
Junio C Hamano6a45be92008-04-22 08:19:031015</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591016<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:511017<code>lines</code>
Junio C Hamanoa476efa2008-10-10 15:31:421018</dt>
1019<dd>
1020<p>
Junio C Hamano1c222c52011-05-13 19:55:321021 Compute the dirstat numbers by doing the regular line-based diff
1022 analysis, and summing the removed/added line counts. (For binary
1023 files, count 64-byte chunks instead, since binary files have no
Junio C Hamanoac12f0e2014-09-19 22:32:511024 natural concept of lines). This is a more expensive <code>--dirstat</code>
1025 behavior than the <code>changes</code> behavior, but it does count rearranged
Junio C Hamano1c222c52011-05-13 19:55:321026 lines within a file as much as other changes. The resulting output
Junio C Hamanoac12f0e2014-09-19 22:32:511027 is consistent with what you get from the other <code>--*stat</code> options.
Junio C Hamanoa476efa2008-10-10 15:31:421028</p>
1029</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591030<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:511031<code>files</code>
Junio C Hamano1c222c52011-05-13 19:55:321032</dt>
1033<dd>
1034<p>
1035 Compute the dirstat numbers by counting the number of files changed.
1036 Each changed file counts equally in the dirstat analysis. This is
Junio C Hamanoac12f0e2014-09-19 22:32:511037 the computationally cheapest <code>--dirstat</code> behavior, since it does
Junio C Hamano1c222c52011-05-13 19:55:321038 not have to look at the file contents at all.
1039</p>
1040</dd>
1041<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:511042<code>cumulative</code>
Junio C Hamano1c222c52011-05-13 19:55:321043</dt>
1044<dd>
1045<p>
1046 Count changes in a child directory for the parent directory as well.
Junio C Hamanoac12f0e2014-09-19 22:32:511047 Note that when using <code>cumulative</code>, the sum of the percentages
Junio C Hamano1c222c52011-05-13 19:55:321048 reported may exceed 100%. The default (non-cumulative) behavior can
Junio C Hamanoac12f0e2014-09-19 22:32:511049 be specified with the <code>noncumulative</code> parameter.
Junio C Hamano1c222c52011-05-13 19:55:321050</p>
1051</dd>
1052<dt class="hdlist1">
1053&lt;limit&gt;
1054</dt>
1055<dd>
1056<p>
1057 An integer parameter specifies a cut-off percent (3% by default).
1058 Directories contributing less than this percentage of the changes
1059 are not shown in the output.
1060</p>
1061</dd>
1062</dl></div>
Junio C Hamano9629d4f2012-12-19 00:28:271063</div></div>
Junio C Hamano1c222c52011-05-13 19:55:321064<div class="paragraph"><p>Example: The following will count changed files, while ignoring
1065directories with less than 10% of the total amount of changed files,
1066and accumulating child directory counts in the parent directories:
Junio C Hamanoac12f0e2014-09-19 22:32:511067<code>--dirstat=files,10,cumulative</code>.</p></div>
Junio C Hamano1c222c52011-05-13 19:55:321068</dd>
1069<dt class="hdlist1">
Junio C Hamano6959c6c2006-05-17 10:34:111070--summary
1071</dt>
1072<dd>
1073<p>
1074 Output a condensed summary of extended header information
1075 such as creations, renames and mode changes.
1076</p>
1077</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591078<dt class="hdlist1">
Junio C Hamanod1308c92006-04-16 11:01:091079--patch-with-stat
1080</dt>
1081<dd>
1082<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511083 Synonym for <code>-p --stat</code>.
Junio C Hamanod1308c92006-04-16 11:01:091084</p>
1085</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591086<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231087-z
1088</dt>
1089<dd>
1090<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511091 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:341092 given, do not munge pathnames and use NULs as output field terminators.
Junio C Hamano1a4e8412005-12-27 08:17:231093</p>
Junio C Hamano0f6f3bf2017-03-13 07:01:531094<div class="paragraph"><p>Without this option, pathnames with "unusual" characters are quoted as
1095explained for the configuration variable <code>core.quotePath</code> (see
1096<a href="git-config.html">git-config(1)</a>).</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231097</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591098<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231099--name-only
1100</dt>
1101<dd>
1102<p>
1103 Show only names of changed files.
1104</p>
1105</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591106<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231107--name-status
1108</dt>
1109<dd>
1110<p>
Junio C Hamanoa9aee782008-04-23 16:09:201111 Show only names and status of changed files. See the description
Junio C Hamanoac12f0e2014-09-19 22:32:511112 of the <code>--diff-filter</code> option on what the status letters mean.
Junio C Hamano1a4e8412005-12-27 08:17:231113</p>
1114</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591115<dt class="hdlist1">
Junio C Hamanoc21ab052009-10-31 04:03:551116--submodule[=&lt;format&gt;]
1117</dt>
1118<dd>
1119<p>
Junio C Hamanocd451662016-09-13 00:54:091120 Specify how differences in submodules are shown. When specifying
1121 <code>--submodule=short</code> the <em>short</em> format is used. This format just
1122 shows the names of the commits at the beginning and end of the range.
1123 When <code>--submodule</code> or <code>--submodule=log</code> is specified, the <em>log</em>
1124 format is used. This format lists the commits in the range like
1125 <a href="git-submodule.html">git-submodule(1)</a> <code>summary</code> does. When <code>--submodule=diff</code>
1126 is specified, the <em>diff</em> format is used. This format shows an
1127 inline diff of the changes in the submodule contents between the
1128 commit range. Defaults to <code>diff.submodule</code> or the <em>short</em> format
1129 if the config option is unset.
Junio C Hamanoc21ab052009-10-31 04:03:551130</p>
1131</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591132<dt class="hdlist1">
Junio C Hamano4aa0bcc2010-03-03 05:13:121133--color[=&lt;when&gt;]
Junio C Hamano9ae1a062006-07-10 08:12:341134</dt>
1135<dd>
1136<p>
1137 Show colored diff.
Junio C Hamanoac12f0e2014-09-19 22:32:511138 <code>--color</code> (i.e. without <em>=&lt;when&gt;</em>) is the same as <code>--color=always</code>.
1139 <em>&lt;when&gt;</em> can be one of <code>always</code>, <code>never</code>, or <code>auto</code>.
Junio C Hamano9ae1a062006-07-10 08:12:341140</p>
1141</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591142<dt class="hdlist1">
Junio C Hamano9ae1a062006-07-10 08:12:341143--no-color
1144</dt>
1145<dd>
1146<p>
Junio C Hamano5f2627d2011-05-06 20:23:481147 Turn off colored diff.
Junio C Hamanoac12f0e2014-09-19 22:32:511148 It is the same as <code>--color=never</code>.
Junio C Hamano9ae1a062006-07-10 08:12:341149</p>
1150</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591151<dt class="hdlist1">
Junio C Hamanofb1fdf12017-08-27 06:14:591152--color-moved[=&lt;mode&gt;]
1153</dt>
1154<dd>
1155<p>
1156 Moved lines of code are colored differently.
1157 The &lt;mode&gt; defaults to <em>no</em> if the option is not given
1158 and to <em>zebra</em> if the option with no mode is given.
1159 The mode must be one of:
1160</p>
1161<div class="openblock">
1162<div class="content">
1163<div class="dlist"><dl>
1164<dt class="hdlist1">
1165no
1166</dt>
1167<dd>
1168<p>
1169 Moved lines are not highlighted.
1170</p>
1171</dd>
1172<dt class="hdlist1">
1173default
1174</dt>
1175<dd>
1176<p>
1177 Is a synonym for <code>zebra</code>. This may change to a more sensible mode
1178 in the future.
1179</p>
1180</dd>
1181<dt class="hdlist1">
1182plain
1183</dt>
1184<dd>
1185<p>
1186 Any line that is added in one location and was removed
1187 in another location will be colored with <em>color.diff.newMoved</em>.
1188 Similarly <em>color.diff.oldMoved</em> will be used for removed lines
1189 that are added somewhere else in the diff. This mode picks up any
1190 moved line, but it is not very useful in a review to determine
1191 if a block of code was moved without permutation.
1192</p>
1193</dd>
1194<dt class="hdlist1">
1195zebra
1196</dt>
1197<dd>
1198<p>
1199 Blocks of moved text of at least 20 alphanumeric characters
1200 are detected greedily. The detected blocks are
1201 painted using either the <em>color.diff.{old,new}Moved</em> color or
1202 <em>color.diff.{old,new}MovedAlternative</em>. The change between
1203 the two colors indicates that a new block was detected.
1204</p>
1205</dd>
1206<dt class="hdlist1">
1207dimmed_zebra
1208</dt>
1209<dd>
1210<p>
1211 Similar to <em>zebra</em>, but additional dimming of uninteresting parts
1212 of moved code is performed. The bordering lines of two adjacent
1213 blocks are considered interesting, the rest is uninteresting.
1214</p>
1215</dd>
1216</dl></div>
1217</div></div>
1218</dd>
1219<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531220--word-diff[=&lt;mode&gt;]
Junio C Hamano85e45fa2006-08-13 07:47:411221</dt>
1222<dd>
1223<p>
Junio C Hamanocc7636a2010-05-21 14:57:531224 Show a word diff, using the &lt;mode&gt; to delimit changed words.
1225 By default, words are delimited by whitespace; see
Junio C Hamanoac12f0e2014-09-19 22:32:511226 <code>--word-diff-regex</code> below. The &lt;mode&gt; defaults to <em>plain</em>, and
Junio C Hamanocc7636a2010-05-21 14:57:531227 must be one of:
Junio C Hamano85e45fa2006-08-13 07:47:411228</p>
Junio C Hamano9629d4f2012-12-19 00:28:271229<div class="openblock">
1230<div class="content">
Junio C Hamano68cf15a2010-11-06 01:01:591231<div class="dlist"><dl>
1232<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531233color
1234</dt>
1235<dd>
1236<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511237 Highlight changed words using only colors. Implies <code>--color</code>.
Junio C Hamanocc7636a2010-05-21 14:57:531238</p>
1239</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591240<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531241plain
1242</dt>
1243<dd>
1244<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511245 Show words as <code>[-removed-]</code> and <code>{+added+}</code>. Makes no
Junio C Hamanocc7636a2010-05-21 14:57:531246 attempts to escape the delimiters if they appear in the input,
1247 so the output may be ambiguous.
1248</p>
1249</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591250<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531251porcelain
1252</dt>
1253<dd>
1254<p>
1255 Use a special line-based format intended for script
1256 consumption. Added/removed/unchanged runs are printed in the
Junio C Hamanoac12f0e2014-09-19 22:32:511257 usual unified diff format, starting with a <code>+</code>/<code>-</code>/` `
Junio C Hamanocc7636a2010-05-21 14:57:531258 character at the beginning of the line and extending to the
1259 end of the line. Newlines in the input are represented by a
Junio C Hamanoac12f0e2014-09-19 22:32:511260 tilde <code>~</code> on a line of its own.
Junio C Hamanocc7636a2010-05-21 14:57:531261</p>
1262</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591263<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531264none
1265</dt>
1266<dd>
1267<p>
1268 Disable word diff again.
1269</p>
1270</dd>
1271</dl></div>
Junio C Hamano9629d4f2012-12-19 00:28:271272</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591273<div class="paragraph"><p>Note that despite the name of the first mode, color is used to
Junio C Hamanocc7636a2010-05-21 14:57:531274highlight the changed parts in all modes if enabled.</p></div>
1275</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591276<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531277--word-diff-regex=&lt;regex&gt;
1278</dt>
1279<dd>
1280<p>
1281 Use &lt;regex&gt; to decide what a word is, instead of considering
1282 runs of non-whitespace to be a word. Also implies
Junio C Hamanoac12f0e2014-09-19 22:32:511283 <code>--word-diff</code> unless it was already enabled.
Junio C Hamanocc7636a2010-05-21 14:57:531284</p>
Junio C Hamano68cf15a2010-11-06 01:01:591285<div class="paragraph"><p>Every non-overlapping match of the
Junio C Hamano20d47e32009-01-26 06:36:021286&lt;regex&gt; is considered a word. Anything between these matches is
1287considered whitespace and ignored(!) for the purposes of finding
Junio C Hamanoac12f0e2014-09-19 22:32:511288differences. You may want to append <code>|[^[:space:]]</code> to your regular
Junio C Hamano20d47e32009-01-26 06:36:021289expression to make sure that it matches all non-whitespace characters.
1290A match that contains a newline is silently truncated(!) at the
1291newline.</p></div>
Junio C Hamano713eded2015-12-03 00:24:021292<div class="paragraph"><p>For example, <code>--word-diff-regex=.</code> will treat each character as a word
1293and, correspondingly, show differences character by character.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591294<div class="paragraph"><p>The regex can also be set via a diff driver or configuration option, see
Junio C Hamano198b1f12016-05-17 22:27:241295<a href="gitattributes.html">gitattributes(5)</a> or <a href="git-config.html">git-config(1)</a>. Giving it explicitly
Junio C Hamano20d47e32009-01-26 06:36:021296overrides any diff driver or configuration setting. Diff drivers
1297override configuration settings.</p></div>
Junio C Hamano85e45fa2006-08-13 07:47:411298</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591299<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531300--color-words[=&lt;regex&gt;]
1301</dt>
1302<dd>
1303<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511304 Equivalent to <code>--word-diff=color</code> plus (if a regex was
1305 specified) <code>--word-diff-regex=&lt;regex&gt;</code>.
Junio C Hamanocc7636a2010-05-21 14:57:531306</p>
1307</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591308<dt class="hdlist1">
Junio C Hamano9ae1a062006-07-10 08:12:341309--no-renames
1310</dt>
1311<dd>
1312<p>
1313 Turn off rename detection, even when the configuration
1314 file gives the default to do so.
1315</p>
1316</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591317<dt class="hdlist1">
Junio C Hamanoa890c4f2007-01-28 10:29:211318--check
1319</dt>
1320<dd>
1321<p>
Junio C Hamano84ea1e42016-04-08 21:53:481322 Warn if changes introduce conflict markers or whitespace errors.
1323 What are considered whitespace errors is controlled by <code>core.whitespace</code>
Junio C Hamano6005bfa2011-06-23 00:51:221324 configuration. By default, trailing whitespaces (including
1325 lines that solely consist of whitespaces) and a space character
1326 that is immediately followed by a tab character inside the
1327 initial indent of the line are considered whitespace errors.
1328 Exits with non-zero status if problems are found. Not compatible
1329 with --exit-code.
Junio C Hamanoa890c4f2007-01-28 10:29:211330</p>
1331</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591332<dt class="hdlist1">
Junio C Hamano8c5d5942015-06-11 19:37:481333--ws-error-highlight=&lt;kind&gt;
1334</dt>
1335<dd>
1336<p>
Junio C Hamano4b2a6c12017-08-22 18:32:371337 Highlight whitespace errors in the <code>context</code>, <code>old</code> or <code>new</code>
1338 lines of the diff. Multiple values are separated by comma,
1339 <code>none</code> resets previous values, <code>default</code> reset the list to
1340 <code>new</code> and <code>all</code> is a shorthand for <code>old,new,context</code>. When
1341 this option is not given, and the configuration variable
1342 <code>diff.wsErrorHighlight</code> is not set, only whitespace errors in
1343 <code>new</code> lines are highlighted. The whitespace errors are colored
1344 whith <code>color.diff.whitespace</code>.
Junio C Hamano8c5d5942015-06-11 19:37:481345</p>
1346</dd>
1347<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231348--full-index
1349</dt>
1350<dd>
1351<p>
Junio C Hamano5cf43ca2008-08-20 09:14:141352 Instead of the first handful of characters, show the full
1353 pre- and post-image blob object names on the "index"
1354 line when generating patch format output.
Junio C Hamano1a4e8412005-12-27 08:17:231355</p>
1356</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591357<dt class="hdlist1">
Junio C Hamano9ae1a062006-07-10 08:12:341358--binary
1359</dt>
1360<dd>
1361<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511362 In addition to <code>--full-index</code>, output a binary diff that
1363 can be applied with <code>git-apply</code>.
Junio C Hamano9ae1a062006-07-10 08:12:341364</p>
1365</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591366<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231367--abbrev[=&lt;n&gt;]
1368</dt>
1369<dd>
1370<p>
1371 Instead of showing the full 40-byte hexadecimal object
1372 name in diff-raw format output and diff-tree header
Junio C Hamano6efe3022009-01-13 16:47:561373 lines, show only a partial prefix. This is
Junio C Hamanoac12f0e2014-09-19 22:32:511374 independent of the <code>--full-index</code> option above, which controls
Junio C Hamano1a4e8412005-12-27 08:17:231375 the diff-patch output format. Non default number of
Junio C Hamanoac12f0e2014-09-19 22:32:511376 digits can be specified with <code>--abbrev=&lt;n&gt;</code>.
Junio C Hamano1a4e8412005-12-27 08:17:231377</p>
1378</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591379<dt class="hdlist1">
Junio C Hamanoe85e36f2010-08-10 05:30:141380-B[&lt;n&gt;][/&lt;m&gt;]
Junio C Hamano1a4e8412005-12-27 08:17:231381</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591382<dt class="hdlist1">
Junio C Hamano39c7a692010-10-27 06:08:541383--break-rewrites[=[&lt;n&gt;][/&lt;m&gt;]]
1384</dt>
Junio C Hamano1a4e8412005-12-27 08:17:231385<dd>
1386<p>
Junio C Hamanoe85e36f2010-08-10 05:30:141387 Break complete rewrite changes into pairs of delete and
1388 create. This serves two purposes:
Junio C Hamano1a4e8412005-12-27 08:17:231389</p>
Junio C Hamano68cf15a2010-11-06 01:01:591390<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:141391not as a series of deletion and insertion mixed together with a very
1392few lines that happen to match textually as the context, but as a
1393single deletion of everything old followed by a single insertion of
Junio C Hamanoac12f0e2014-09-19 22:32:511394everything new, and the number <code>m</code> controls this aspect of the -B
1395option (defaults to 60%). <code>-B/70%</code> specifies that less than 30% of the
Junio C Hamano076ffcc2013-02-06 05:13:211396original should remain in the result for Git to consider it a total
Junio C Hamanoe85e36f2010-08-10 05:30:141397rewrite (i.e. otherwise the resulting patch will be a series of
1398deletion and insertion mixed together with context lines).</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591399<div class="paragraph"><p>When used with -M, a totally-rewritten file is also considered as the
Junio C Hamanoe85e36f2010-08-10 05:30:141400source of a rename (usually -M only considers a file that disappeared
Junio C Hamanoac12f0e2014-09-19 22:32:511401as the source of a rename), and the number <code>n</code> controls this aspect of
1402the -B option (defaults to 50%). <code>-B20%</code> specifies that a change with
Junio C Hamano68cf15a2010-11-06 01:01:591403addition and deletion compared to 20% or more of the file&#8217;s size are
Junio C Hamanoe85e36f2010-08-10 05:30:141404eligible for being picked up as a possible source of a rename to
1405another file.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231406</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591407<dt class="hdlist1">
Junio C Hamanoe85e36f2010-08-10 05:30:141408-M[&lt;n&gt;]
Junio C Hamano1a4e8412005-12-27 08:17:231409</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591410<dt class="hdlist1">
Junio C Hamano0d75e872010-12-17 06:57:261411--find-renames[=&lt;n&gt;]
Junio C Hamano39c7a692010-10-27 06:08:541412</dt>
Junio C Hamano1a4e8412005-12-27 08:17:231413<dd>
1414<p>
1415 Detect renames.
Junio C Hamanoac12f0e2014-09-19 22:32:511416 If <code>n</code> is specified, it is a threshold on the similarity
Junio C Hamanoe85e36f2010-08-10 05:30:141417 index (i.e. amount of addition/deletions compared to the
Junio C Hamanoac12f0e2014-09-19 22:32:511418 file&#8217;s size). For example, <code>-M90%</code> means Git should consider a
Junio C Hamanoe85e36f2010-08-10 05:30:141419 delete/add pair to be a rename if more than 90% of the file
Junio C Hamanoac12f0e2014-09-19 22:32:511420 hasn&#8217;t changed. Without a <code>%</code> sign, the number is to be read as
1421 a fraction, with a decimal point before it. I.e., <code>-M5</code> becomes
1422 0.5, and is thus the same as <code>-M50%</code>. Similarly, <code>-M05</code> is
1423 the same as <code>-M5%</code>. To limit detection to exact renames, use
1424 <code>-M100%</code>. The default similarity index is 50%.
Junio C Hamano1a4e8412005-12-27 08:17:231425</p>
1426</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591427<dt class="hdlist1">
Junio C Hamanoe85e36f2010-08-10 05:30:141428-C[&lt;n&gt;]
Junio C Hamano1a4e8412005-12-27 08:17:231429</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591430<dt class="hdlist1">
Junio C Hamano0d75e872010-12-17 06:57:261431--find-copies[=&lt;n&gt;]
Junio C Hamano39c7a692010-10-27 06:08:541432</dt>
Junio C Hamano1a4e8412005-12-27 08:17:231433<dd>
1434<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511435 Detect copies as well as renames. See also <code>--find-copies-harder</code>.
1436 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:231437</p>
1438</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591439<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231440--find-copies-harder
1441</dt>
1442<dd>
1443<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511444 For performance reasons, by default, <code>-C</code> option finds copies only
Junio C Hamano1a4e8412005-12-27 08:17:231445 if the original file of the copy was modified in the same
1446 changeset. This flag makes the command
1447 inspect unmodified files as candidates for the source of
1448 copy. This is a very expensive operation for large
Junio C Hamano16f98872007-06-12 16:09:141449 projects, so use it with caution. Giving more than one
Junio C Hamanoac12f0e2014-09-19 22:32:511450 <code>-C</code> option has the same effect.
Junio C Hamano1a4e8412005-12-27 08:17:231451</p>
1452</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591453<dt class="hdlist1">
Junio C Hamanob02377c2011-04-28 22:26:021454-D
1455</dt>
1456<dt class="hdlist1">
1457--irreversible-delete
1458</dt>
1459<dd>
1460<p>
1461 Omit the preimage for deletes, i.e. print only the header but not
Junio C Hamanoac12f0e2014-09-19 22:32:511462 the diff between the preimage and <code>/dev/null</code>. The resulting patch
1463 is not meant to be applied with <code>patch</code> or <code>git apply</code>; this is
Junio C Hamanob02377c2011-04-28 22:26:021464 solely for people who want to just concentrate on reviewing the
Junio C Hamanod16fd1b2017-08-04 16:41:511465 text after the change. In addition, the output obviously lacks
Junio C Hamanob02377c2011-04-28 22:26:021466 enough information to apply such a patch in reverse, even manually,
1467 hence the name of the option.
1468</p>
Junio C Hamanoac12f0e2014-09-19 22:32:511469<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:021470of a delete/create pair.</p></div>
1471</dd>
1472<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231473-l&lt;num&gt;
1474</dt>
1475<dd>
1476<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511477 The <code>-M</code> and <code>-C</code> options require O(n^2) processing time where n
Junio C Hamano1a4e8412005-12-27 08:17:231478 is the number of potential rename/copy targets. This
1479 option prevents rename/copy detection from running if
1480 the number of rename/copy targets exceeds the specified
1481 number.
1482</p>
1483</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591484<dt class="hdlist1">
Junio C Hamano982eb112010-11-18 00:53:091485--diff-filter=[(A|C|D|M|R|T|U|X|B)&#8230;[*]]
1486</dt>
1487<dd>
1488<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511489 Select only files that are Added (<code>A</code>), Copied (<code>C</code>),
1490 Deleted (<code>D</code>), Modified (<code>M</code>), Renamed (<code>R</code>), have their
1491 type (i.e. regular file, symlink, submodule, &#8230;) changed (<code>T</code>),
1492 are Unmerged (<code>U</code>), are
1493 Unknown (<code>X</code>), or have had their pairing Broken (<code>B</code>).
Junio C Hamano982eb112010-11-18 00:53:091494 Any combination of the filter characters (including none) can be used.
Junio C Hamanoac12f0e2014-09-19 22:32:511495 When <code>*</code> (All-or-none) is added to the combination, all
Junio C Hamano982eb112010-11-18 00:53:091496 paths are selected if there is any file that matches
1497 other criteria in the comparison; if there is no file
1498 that matches other criteria, nothing is selected.
1499</p>
Junio C Hamanoeed15af2016-07-25 22:49:421500<div class="paragraph"><p>Also, these upper-case letters can be downcased to exclude. E.g.
1501<code>--diff-filter=ad</code> excludes added and deleted paths.</p></div>
Junio C Hamano3a34f152018-01-09 23:09:381502<div class="paragraph"><p>Note that not all diffs can feature all types. For instance, diffs
1503from the index to the working tree can never have Added entries
1504(because the set of paths included in the diff is limited by what is in
1505the index). Similarly, copied and renamed entries cannot appear if
1506detection for those types is disabled.</p></div>
Junio C Hamano982eb112010-11-18 00:53:091507</dd>
1508<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231509-S&lt;string&gt;
1510</dt>
1511<dd>
1512<p>
Junio C Hamanof1f5a7b2013-06-11 22:23:521513 Look for differences that change the number of occurrences of
1514 the specified string (i.e. addition/deletion) in a file.
1515 Intended for the scripter&#8217;s use.
Junio C Hamano1a4e8412005-12-27 08:17:231516</p>
Junio C Hamanof1f5a7b2013-06-11 22:23:521517<div class="paragraph"><p>It is useful when you&#8217;re looking for an exact block of code (like a
1518struct), and want to know the history of that block since it first
1519came into being: use the feature iteratively to feed the interesting
Junio C Hamanoac12f0e2014-09-19 22:32:511520block in the preimage back into <code>-S</code>, and keep going until you get the
Junio C Hamanof1f5a7b2013-06-11 22:23:521521very first version of the block.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231522</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591523<dt class="hdlist1">
Junio C Hamano3b4609d2010-09-30 00:04:341524-G&lt;regex&gt;
1525</dt>
1526<dd>
1527<p>
Junio C Hamanof1f5a7b2013-06-11 22:23:521528 Look for differences whose patch text contains added/removed
1529 lines that match &lt;regex&gt;.
Junio C Hamano3b4609d2010-09-30 00:04:341530</p>
Junio C Hamanoac12f0e2014-09-19 22:32:511531<div class="paragraph"><p>To illustrate the difference between <code>-S&lt;regex&gt; --pickaxe-regex</code> and
1532<code>-G&lt;regex&gt;</code>, consider a commit with the following diff in the same
Junio C Hamanof1f5a7b2013-06-11 22:23:521533file:</p></div>
1534<div class="listingblock">
1535<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:511536<pre><code>+ return !regexec(regexp, two-&gt;ptr, 1, &amp;regmatch, 0);
Junio C Hamanof1f5a7b2013-06-11 22:23:521537...
Junio C Hamanoac12f0e2014-09-19 22:32:511538- hit = !regexec(regexp, mf2.ptr, 1, &amp;regmatch, 0);</code></pre>
Junio C Hamanof1f5a7b2013-06-11 22:23:521539</div></div>
Junio C Hamanoac12f0e2014-09-19 22:32:511540<div class="paragraph"><p>While <code>git log -G"regexec\(regexp"</code> will show this commit, <code>git log
1541-S"regexec\(regexp" --pickaxe-regex</code> will not (because the number of
Junio C Hamanof1f5a7b2013-06-11 22:23:521542occurrences of that string did not change).</p></div>
1543<div class="paragraph"><p>See the <em>pickaxe</em> entry in <a href="gitdiffcore.html">gitdiffcore(7)</a> for more
1544information.</p></div>
Junio C Hamano3b4609d2010-09-30 00:04:341545</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591546<dt class="hdlist1">
Junio C Hamano7b9cce92018-01-23 22:34:271547--find-object=&lt;object-id&gt;
1548</dt>
1549<dd>
1550<p>
1551 Look for differences that change the number of occurrences of
1552 the specified object. Similar to <code>-S</code>, just the argument is different
1553 in that it doesn&#8217;t search for a specific string but for a specific
1554 object id.
1555</p>
1556<div class="paragraph"><p>The object can be a blob or a submodule commit. It implies the <code>-t</code> option in
1557<code>git-log</code> to also find trees.</p></div>
1558</dd>
1559<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231560--pickaxe-all
1561</dt>
1562<dd>
1563<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511564 When <code>-S</code> or <code>-G</code> finds a change, show all the changes in that
Junio C Hamano1a4e8412005-12-27 08:17:231565 changeset, not just the files that contain the change
1566 in &lt;string&gt;.
1567</p>
1568</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591569<dt class="hdlist1">
Junio C Hamanobfe9e752006-04-05 21:43:281570--pickaxe-regex
1571</dt>
1572<dd>
1573<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511574 Treat the &lt;string&gt; given to <code>-S</code> as an extended POSIX regular
Junio C Hamanof1f5a7b2013-06-11 22:23:521575 expression to match.
Junio C Hamanobfe9e752006-04-05 21:43:281576</p>
1577</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591578<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231579-O&lt;orderfile&gt;
1580</dt>
1581<dd>
1582<p>
Junio C Hamanobcd98f42017-01-24 00:12:161583 Control the order in which files appear in the output.
Junio C Hamano322c6242015-03-23 21:32:461584 This overrides the <code>diff.orderFile</code> configuration variable
1585 (see <a href="git-config.html">git-config(1)</a>). To cancel <code>diff.orderFile</code>,
Junio C Hamanoac12f0e2014-09-19 22:32:511586 use <code>-O/dev/null</code>.
Junio C Hamano1a4e8412005-12-27 08:17:231587</p>
Junio C Hamanobcd98f42017-01-24 00:12:161588<div class="paragraph"><p>The output order is determined by the order of glob patterns in
1589&lt;orderfile&gt;.
1590All files with pathnames that match the first pattern are output
1591first, all files with pathnames that match the second pattern (but not
1592the first) are output next, and so on.
1593All files with pathnames that do not match any pattern are output
1594last, as if there was an implicit match-all pattern at the end of the
1595file.
1596If multiple pathnames have the same rank (they match the same pattern
1597but no earlier patterns), their output order relative to each other is
1598the normal order.</p></div>
1599<div class="paragraph"><p>&lt;orderfile&gt; is parsed as follows:</p></div>
1600<div class="openblock">
1601<div class="content">
1602<div class="ulist"><ul>
1603<li>
1604<p>
1605Blank lines are ignored, so they can be used as separators for
1606 readability.
1607</p>
1608</li>
1609<li>
1610<p>
1611Lines starting with a hash ("<code>#</code>") are ignored, so they can be used
1612 for comments. Add a backslash ("<code>\</code>") to the beginning of the
1613 pattern if it starts with a hash.
1614</p>
1615</li>
1616<li>
1617<p>
1618Each other line contains a single pattern.
1619</p>
1620</li>
1621</ul></div>
1622</div></div>
1623<div class="paragraph"><p>Patterns have the same syntax and semantics as patterns used for
1624fnmantch(3) without the FNM_PATHNAME flag, except a pathname also
1625matches a pattern if removing any number of the final pathname
1626components matches the pattern. For example, the pattern "<code>foo*bar</code>"
1627matches "<code>fooasdfbar</code>" and "<code>foo/bar/baz/asdf</code>" but not "<code>foobarx</code>".</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231628</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591629<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231630-R
1631</dt>
1632<dd>
1633<p>
1634 Swap two inputs; that is, show differences from index or
1635 on-disk file to tree contents.
1636</p>
1637</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591638<dt class="hdlist1">
Junio C Hamano24bc09a2008-02-28 00:27:441639--relative[=&lt;path&gt;]
1640</dt>
1641<dd>
1642<p>
1643 When run from a subdirectory of the project, it can be
1644 told to exclude changes outside the directory and show
1645 pathnames relative to it with this option. When you are
1646 not in a subdirectory (e.g. in a bare repository), you
1647 can name which subdirectory to make the output relative
1648 to by giving a &lt;path&gt; as an argument.
1649</p>
1650</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591651<dt class="hdlist1">
Junio C Hamanobbbb8652008-12-29 10:34:221652-a
1653</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591654<dt class="hdlist1">
Junio C Hamanoc26f5482006-07-09 09:38:141655--text
1656</dt>
1657<dd>
1658<p>
1659 Treat all files as text.
1660</p>
1661</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591662<dt class="hdlist1">
Junio C Hamano4886c772017-11-27 03:33:281663--ignore-cr-at-eol
1664</dt>
1665<dd>
1666<p>
1667 Ignore carrige-return at the end of line when doing a comparison.
1668</p>
1669</dd>
1670<dt class="hdlist1">
Junio C Hamanofd468962007-02-14 23:45:041671--ignore-space-at-eol
1672</dt>
1673<dd>
1674<p>
Junio C Hamano3a702342007-12-12 21:34:021675 Ignore changes in whitespace at EOL.
Junio C Hamanofd468962007-02-14 23:45:041676</p>
1677</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591678<dt class="hdlist1">
Junio C Hamanobbbb8652008-12-29 10:34:221679-b
1680</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591681<dt class="hdlist1">
Junio C Hamanod9c2d2f2006-12-06 08:59:071682--ignore-space-change
1683</dt>
1684<dd>
1685<p>
Junio C Hamano3a702342007-12-12 21:34:021686 Ignore changes in amount of whitespace. This ignores whitespace
1687 at line end, and considers all other sequences of one or
1688 more whitespace characters to be equivalent.
Junio C Hamanod9c2d2f2006-12-06 08:59:071689</p>
1690</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591691<dt class="hdlist1">
Junio C Hamanobbbb8652008-12-29 10:34:221692-w
Junio C Hamanod9c2d2f2006-12-06 08:59:071693</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591694<dt class="hdlist1">
Junio C Hamanod9c2d2f2006-12-06 08:59:071695--ignore-all-space
1696</dt>
1697<dd>
1698<p>
Junio C Hamano3a702342007-12-12 21:34:021699 Ignore whitespace when comparing lines. This ignores
1700 differences even if one line has whitespace where the other
Junio C Hamanod9c2d2f2006-12-06 08:59:071701 line has none.
1702</p>
1703</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591704<dt class="hdlist1">
Junio C Hamanoa1952302013-07-01 21:31:181705--ignore-blank-lines
1706</dt>
1707<dd>
1708<p>
1709 Ignore changes whose lines are all blank.
1710</p>
1711</dd>
1712<dt class="hdlist1">
Junio C Hamano1d40ee82009-01-07 10:14:161713--inter-hunk-context=&lt;lines&gt;
1714</dt>
1715<dd>
1716<p>
1717 Show the context between diff hunks, up to the specified number
1718 of lines, thereby fusing hunks that are close to each other.
Junio C Hamanobcd98f42017-01-24 00:12:161719 Defaults to <code>diff.interHunkContext</code> or 0 if the config option
1720 is unset.
Junio C Hamano1d40ee82009-01-07 10:14:161721</p>
1722</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591723<dt class="hdlist1">
Junio C Hamano11821ed2011-10-19 18:42:091724-W
1725</dt>
1726<dt class="hdlist1">
1727--function-context
1728</dt>
1729<dd>
1730<p>
1731 Show whole surrounding functions of changes.
1732</p>
1733</dd>
1734<dt class="hdlist1">
Junio C Hamano48fd2f62007-03-19 02:02:301735--exit-code
1736</dt>
1737<dd>
1738<p>
1739 Make the program exit with codes similar to diff(1).
1740 That is, it exits with 1 if there were differences and
1741 0 means no differences.
1742</p>
1743</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591744<dt class="hdlist1">
Junio C Hamano35e57552007-03-25 07:54:351745--quiet
1746</dt>
1747<dd>
1748<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511749 Disable all output of the program. Implies <code>--exit-code</code>.
Junio C Hamano35e57552007-03-25 07:54:351750</p>
1751</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591752<dt class="hdlist1">
Junio C Hamanobb0f4042007-07-04 06:41:401753--ext-diff
1754</dt>
1755<dd>
1756<p>
1757 Allow an external diff helper to be executed. If you set an
Junio C Hamanoa28a9202012-06-21 07:08:231758 external diff driver with <a href="gitattributes.html">gitattributes(5)</a>, you need
1759 to use this option with <a href="git-log.html">git-log(1)</a> and friends.
Junio C Hamanobb0f4042007-07-04 06:41:401760</p>
1761</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591762<dt class="hdlist1">
Junio C Hamanobb0f4042007-07-04 06:41:401763--no-ext-diff
1764</dt>
1765<dd>
1766<p>
1767 Disallow external diff drivers.
1768</p>
1769</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591770<dt class="hdlist1">
Junio C Hamanoc652aed2011-07-07 01:14:311771--textconv
1772</dt>
1773<dt class="hdlist1">
1774--no-textconv
1775</dt>
1776<dd>
1777<p>
1778 Allow (or disallow) external text conversion filters to be run
Junio C Hamanoa28a9202012-06-21 07:08:231779 when comparing binary files. See <a href="gitattributes.html">gitattributes(5)</a> for
Junio C Hamanoc652aed2011-07-07 01:14:311780 details. Because textconv filters are typically a one-way
1781 conversion, the resulting diff is suitable for human
1782 consumption, but cannot be applied. For this reason, textconv
Junio C Hamanoa28a9202012-06-21 07:08:231783 filters are enabled by default only for <a href="git-diff.html">git-diff(1)</a> and
1784 <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:311785 diff plumbing commands.
1786</p>
1787</dd>
1788<dt class="hdlist1">
Junio C Hamano7d449522010-07-01 00:08:511789--ignore-submodules[=&lt;when&gt;]
Junio C Hamanodfccbb02008-05-26 01:16:141790</dt>
1791<dd>
1792<p>
Junio C Hamano7d449522010-07-01 00:08:511793 Ignore changes to submodules in the diff generation. &lt;when&gt; can be
Junio C Hamanoc7102962013-05-29 23:57:171794 either "none", "untracked", "dirty" or "all", which is the default.
Junio C Hamano619596a2010-08-18 22:15:351795 Using "none" will consider the submodule modified when it either contains
1796 untracked or modified files or its HEAD differs from the commit recorded
1797 in the superproject and can be used to override any settings of the
Junio C Hamanoa28a9202012-06-21 07:08:231798 <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:511799 "untracked" is used submodules are not considered dirty when they only
1800 contain untracked content (but they are still scanned for modified
1801 content). Using "dirty" ignores all changes to the work tree of submodules,
1802 only changes to the commits stored in the superproject are shown (this was
1803 the behavior until 1.7.0). Using "all" hides all changes to submodules.
Junio C Hamanodfccbb02008-05-26 01:16:141804</p>
1805</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591806<dt class="hdlist1">
Junio C Hamanoe27cbd22007-12-21 17:57:331807--src-prefix=&lt;prefix&gt;
1808</dt>
1809<dd>
1810<p>
1811 Show the given source prefix instead of "a/".
1812</p>
1813</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591814<dt class="hdlist1">
Junio C Hamanoe27cbd22007-12-21 17:57:331815--dst-prefix=&lt;prefix&gt;
1816</dt>
1817<dd>
1818<p>
1819 Show the given destination prefix instead of "b/".
1820</p>
1821</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591822<dt class="hdlist1">
Junio C Hamanoe27cbd22007-12-21 17:57:331823--no-prefix
1824</dt>
1825<dd>
1826<p>
1827 Do not show any source or destination prefix.
1828</p>
1829</dd>
Junio C Hamanocd451662016-09-13 00:54:091830<dt class="hdlist1">
1831--line-prefix=&lt;prefix&gt;
1832</dt>
1833<dd>
1834<p>
1835 Prepend an additional prefix to every line of output.
1836</p>
1837</dd>
Junio C Hamanof7017f12016-10-27 23:31:341838<dt class="hdlist1">
1839--ita-invisible-in-index
1840</dt>
1841<dd>
1842<p>
1843 By default entries added by "git add -N" appear as an existing
1844 empty file in "git diff" and a new file in "git diff --cached".
1845 This option makes the entry appear as a new file in "git diff"
1846 and non-existent in "git diff --cached". This option could be
1847 reverted with <code>--ita-visible-in-index</code>. Both options are
1848 experimental and could be removed in future.
1849</p>
1850</dd>
Junio C Hamanoba4b9282008-07-06 05:20:311851</dl></div>
Junio C Hamano68cf15a2010-11-06 01:01:591852<div class="paragraph"><p>For more detailed explanation on these common options, see also
Junio C Hamanoa28a9202012-06-21 07:08:231853<a href="gitdiffcore.html">gitdiffcore(7)</a>.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591854<div class="dlist"><dl>
1855<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231856&lt;tree-ish&gt;
1857</dt>
1858<dd>
1859<p>
1860 The id of a tree object.
1861</p>
1862</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591863<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231864&lt;path&gt;&#8230;
1865</dt>
1866<dd>
1867<p>
1868 If provided, the results are limited to a subset of files
1869 matching one of these prefix strings.
Junio C Hamanoac12f0e2014-09-19 22:32:511870 i.e., file matches <code>/^&lt;pattern1&gt;|&lt;pattern2&gt;|.../</code>
Junio C Hamano1a4e8412005-12-27 08:17:231871 Note that this parameter does not provide any wildcard or regexp
1872 features.
1873</p>
1874</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591875<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231876-r
1877</dt>
1878<dd>
1879<p>
1880 recurse into sub-trees
1881</p>
1882</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591883<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231884-t
1885</dt>
1886<dd>
1887<p>
1888 show tree entry itself as well as subtrees. Implies -r.
1889</p>
1890</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591891<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231892--root
1893</dt>
1894<dd>
1895<p>
Junio C Hamano92d80372016-07-13 22:00:051896 When <code>--root</code> is specified the initial commit will be shown as a big
Junio C Hamano1a4e8412005-12-27 08:17:231897 creation event. This is equivalent to a diff against the NULL tree.
1898</p>
1899</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591900<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231901--stdin
1902</dt>
1903<dd>
1904<p>
Junio C Hamano92d80372016-07-13 22:00:051905 When <code>--stdin</code> is specified, the command does not take
Junio C Hamano1a4e8412005-12-27 08:17:231906 &lt;tree-ish&gt; arguments from the command line. Instead, it
Junio C Hamano3f2f6e52008-08-21 10:34:221907 reads lines containing either two &lt;tree&gt;, one &lt;commit&gt;, or a
1908 list of &lt;commit&gt; from its standard input. (Use a single space
1909 as separator.)
Junio C Hamano1a4e8412005-12-27 08:17:231910</p>
Junio C Hamano68cf15a2010-11-06 01:01:591911<div class="paragraph"><p>When two trees are given, it compares the first tree with the second.
Junio C Hamano3f2f6e52008-08-21 10:34:221912When a single commit is given, it compares the commit with its
1913parents. The remaining commits, when given, are used as if they are
Junio C Hamanob53db3c2008-08-07 00:17:521914parents of the first commit.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591915<div class="paragraph"><p>When comparing two trees, the ID of both trees (separated by a space
Junio C Hamano3f2f6e52008-08-21 10:34:221916and terminated by a newline) is printed before the difference. When
1917comparing commits, the ID of the first (or only) commit, followed by a
1918newline, is printed.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591919<div class="paragraph"><p>The following flags further affect the behavior when comparing
Junio C Hamano3f2f6e52008-08-21 10:34:221920commits (but not trees).</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231921</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591922<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231923-m
1924</dt>
1925<dd>
1926<p>
Junio C Hamano1aa40d22010-01-21 17:46:431927 By default, <em>git diff-tree --stdin</em> does not show
Junio C Hamano1a4e8412005-12-27 08:17:231928 differences for merge commits. With this flag, it shows
Junio C Hamanoa8adb1e2006-04-10 23:46:161929 differences to that commit from all of its parents. See
Junio C Hamano92d80372016-07-13 22:00:051930 also <code>-c</code>.
Junio C Hamano1a4e8412005-12-27 08:17:231931</p>
1932</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591933<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231934-s
1935</dt>
1936<dd>
1937<p>
Junio C Hamano1aa40d22010-01-21 17:46:431938 By default, <em>git diff-tree --stdin</em> shows differences,
Junio C Hamano92d80372016-07-13 22:00:051939 either in machine-readable form (without <code>-p</code>) or in patch
1940 form (with <code>-p</code>). This output can be suppressed. It is
1941 only useful with <code>-v</code> flag.
Junio C Hamano1a4e8412005-12-27 08:17:231942</p>
1943</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591944<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231945-v
1946</dt>
1947<dd>
1948<p>
Junio C Hamano1aa40d22010-01-21 17:46:431949 This flag causes <em>git diff-tree --stdin</em> to also show
Junio C Hamano1a4e8412005-12-27 08:17:231950 the commit message before the differences.
1951</p>
1952</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591953<dt class="hdlist1">
Junio C Hamanod2179ef2010-10-22 04:12:171954--pretty[=&lt;format&gt;]
Junio C Hamano1a4e8412005-12-27 08:17:231955</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591956<dt class="hdlist1">
Junio C Hamanod2179ef2010-10-22 04:12:171957--format=&lt;format&gt;
Junio C Hamano0a235222009-03-06 08:21:091958</dt>
Junio C Hamano1a4e8412005-12-27 08:17:231959<dd>
1960<p>
Junio C Hamanoa3770f92007-07-25 08:53:331961 Pretty-print the contents of the commit logs in a given format,
Junio C Hamano0430e3a2007-05-15 03:13:171962 where <em>&lt;format&gt;</em> can be one of <em>oneline</em>, <em>short</em>, <em>medium</em>,
Junio C Hamano6bb32e62015-02-17 22:11:261963 <em>full</em>, <em>fuller</em>, <em>email</em>, <em>raw</em>, <em>format:&lt;string&gt;</em>
1964 and <em>tformat:&lt;string&gt;</em>. When <em>&lt;format&gt;</em> is none of the above,
1965 and has <em>%placeholder</em> in it, it acts as if
1966 <em>--pretty=tformat:&lt;format&gt;</em> were given.
Junio C Hamano1a4e8412005-12-27 08:17:231967</p>
Junio C Hamano6bb32e62015-02-17 22:11:261968<div class="paragraph"><p>See the "PRETTY FORMATS" section for some additional details for each
1969format. When <em>=&lt;format&gt;</em> part is omitted, it defaults to <em>medium</em>.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591970<div class="paragraph"><p>Note: you can specify the default pretty format in the repository
Junio C Hamanoa28a9202012-06-21 07:08:231971configuration (see <a href="git-config.html">git-config(1)</a>).</p></div>
Junio C Hamano0430e3a2007-05-15 03:13:171972</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591973<dt class="hdlist1">
Junio C Hamanoee695f22007-06-21 00:35:361974--abbrev-commit
1975</dt>
1976<dd>
1977<p>
1978 Instead of showing the full 40-byte hexadecimal commit object
Junio C Hamano6efe3022009-01-13 16:47:561979 name, show only a partial prefix. Non default number of
Junio C Hamanoee695f22007-06-21 00:35:361980 digits can be specified with "--abbrev=&lt;n&gt;" (which also modifies
1981 diff output, if it is displayed).
1982</p>
Junio C Hamano68cf15a2010-11-06 01:01:591983<div class="paragraph"><p>This should make "--pretty=oneline" a whole lot more readable for
Junio C Hamanoba4b9282008-07-06 05:20:311984people using 80-column terminals.</p></div>
Junio C Hamanoee695f22007-06-21 00:35:361985</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591986<dt class="hdlist1">
Junio C Hamanof93530e2011-05-25 23:59:591987--no-abbrev-commit
1988</dt>
1989<dd>
1990<p>
1991 Show the full 40-byte hexadecimal commit object name. This negates
Junio C Hamanoac12f0e2014-09-19 22:32:511992 <code>--abbrev-commit</code> and those options which imply it such as
Junio C Hamano042f2142016-06-27 18:05:051993 "--oneline". It also overrides the <code>log.abbrevCommit</code> variable.
Junio C Hamanof93530e2011-05-25 23:59:591994</p>
1995</dd>
1996<dt class="hdlist1">
Junio C Hamano0a235222009-03-06 08:21:091997--oneline
1998</dt>
1999<dd>
2000<p>
2001 This is a shorthand for "--pretty=oneline --abbrev-commit"
2002 used together.
2003</p>
2004</dd>
Junio C Hamano68cf15a2010-11-06 01:01:592005<dt class="hdlist1">
Junio C Hamanoc5bb3b32013-08-05 22:43:362006--encoding=&lt;encoding&gt;
Junio C Hamano0430e3a2007-05-15 03:13:172007</dt>
2008<dd>
2009<p>
2010 The commit objects record the encoding used for the log message
2011 in their encoding header; this option can be used to tell the
2012 command to re-code the commit log message in the encoding
2013 preferred by the user. For non plumbing commands this
Junio C Hamano823eebb2015-07-10 22:29:342014 defaults to UTF-8. Note that if an object claims to be encoded
2015 in <code>X</code> and we are outputting in <code>X</code>, we will output the object
2016 verbatim; this means that invalid sequences in the original
2017 commit may be copied to the output.
Junio C Hamano0430e3a2007-05-15 03:13:172018</p>
2019</dd>
Junio C Hamano68cf15a2010-11-06 01:01:592020<dt class="hdlist1">
Junio C Hamano5996b672016-04-13 22:01:412021--expand-tabs=&lt;n&gt;
2022</dt>
2023<dt class="hdlist1">
2024--expand-tabs
2025</dt>
2026<dt class="hdlist1">
2027--no-expand-tabs
2028</dt>
2029<dd>
2030<p>
2031 Perform a tab expansion (replace each tab with enough spaces
2032 to fill to the next display column that is multiple of <em>&lt;n&gt;</em>)
2033 in the log message before showing it in the output.
2034 <code>--expand-tabs</code> is a short-hand for <code>--expand-tabs=8</code>, and
2035 <code>--no-expand-tabs</code> is a short-hand for <code>--expand-tabs=0</code>,
2036 which disables tab expansion.
2037</p>
2038<div class="paragraph"><p>By default, tabs are expanded in pretty formats that indent the log
2039message by 4 spaces (i.e. <em>medium</em>, which is the default, <em>full</em>,
2040and <em>fuller</em>).</p></div>
2041</dd>
2042<dt class="hdlist1">
Junio C Hamano4e6ba272016-01-20 23:23:192043--notes[=&lt;treeish&gt;]
Junio C Hamano57827fb2010-01-23 03:02:502044</dt>
2045<dd>
2046<p>
Junio C Hamanoa28a9202012-06-21 07:08:232047 Show the notes (see <a href="git-notes.html">git-notes(1)</a>) that annotate the
Junio C Hamano57827fb2010-01-23 03:02:502048 commit, when showing the commit log message. This is the default
Junio C Hamanoac12f0e2014-09-19 22:32:512049 for <code>git log</code>, <code>git show</code> and <code>git whatchanged</code> commands when
2050 there is no <code>--pretty</code>, <code>--format</code>, or <code>--oneline</code> option given
Junio C Hamano60033462011-05-03 00:48:432051 on the command line.
Junio C Hamano57827fb2010-01-23 03:02:502052</p>
Junio C Hamano60033462011-05-03 00:48:432053<div class="paragraph"><p>By default, the notes shown are from the notes refs listed in the
Junio C Hamano042f2142016-06-27 18:05:052054<code>core.notesRef</code> and <code>notes.displayRef</code> variables (or corresponding
Junio C Hamanoa28a9202012-06-21 07:08:232055environment overrides). See <a href="git-config.html">git-config(1)</a> for more details.</p></div>
Junio C Hamano4e6ba272016-01-20 23:23:192056<div class="paragraph"><p>With an optional <em>&lt;treeish&gt;</em> argument, use the treeish to find the notes
2057to display. The treeish can specify the full refname when it begins
Junio C Hamano1f7c4a52015-10-14 22:15:512058with <code>refs/notes/</code>; when it begins with <code>notes/</code>, <code>refs/</code> and otherwise
2059<code>refs/notes/</code> is prefixed to form a full name of the ref.</p></div>
Junio C Hamano60033462011-05-03 00:48:432060<div class="paragraph"><p>Multiple --notes options can be combined to control which notes are
2061being displayed. Examples: "--notes=foo" will show only notes from
2062"refs/notes/foo"; "--notes=foo --notes" will show both notes from
2063"refs/notes/foo" and from the default notes ref(s).</p></div>
Junio C Hamano31667362010-03-25 00:38:532064</dd>
Junio C Hamano68cf15a2010-11-06 01:01:592065<dt class="hdlist1">
Junio C Hamano60033462011-05-03 00:48:432066--no-notes
2067</dt>
2068<dd>
2069<p>
Junio C Hamanoac12f0e2014-09-19 22:32:512070 Do not show notes. This negates the above <code>--notes</code> option, by
Junio C Hamano60033462011-05-03 00:48:432071 resetting the list of notes refs from which notes are shown.
2072 Options are parsed in the order given on the command line, so e.g.
2073 "--notes --notes=foo --no-notes --notes=bar" will only show notes
2074 from "refs/notes/bar".
2075</p>
2076</dd>
2077<dt class="hdlist1">
Junio C Hamano4e6ba272016-01-20 23:23:192078--show-notes[=&lt;treeish&gt;]
Junio C Hamano60033462011-05-03 00:48:432079</dt>
2080<dt class="hdlist1">
Junio C Hamano31667362010-03-25 00:38:532081--[no-]standard-notes
2082</dt>
2083<dd>
2084<p>
Junio C Hamano60033462011-05-03 00:48:432085 These options are deprecated. Use the above --notes/--no-notes
2086 options instead.
Junio C Hamano31667362010-03-25 00:38:532087</p>
Junio C Hamano57827fb2010-01-23 03:02:502088</dd>
Junio C Hamano68cf15a2010-11-06 01:01:592089<dt class="hdlist1">
Junio C Hamano0acb1ae2012-09-24 21:28:132090--show-signature
2091</dt>
2092<dd>
2093<p>
2094 Check the validity of a signed commit object by passing the signature
Junio C Hamanoac12f0e2014-09-19 22:32:512095 to <code>gpg --verify</code> and show the output.
Junio C Hamano0acb1ae2012-09-24 21:28:132096</p>
2097</dd>
2098<dt class="hdlist1">
Junio C Hamano0430e3a2007-05-15 03:13:172099--no-commit-id
2100</dt>
2101<dd>
2102<p>
Junio C Hamano1aa40d22010-01-21 17:46:432103 <em>git diff-tree</em> outputs a line with the commit ID when
Junio C Hamano0430e3a2007-05-15 03:13:172104 applicable. This flag suppressed the commit ID output.
2105</p>
2106</dd>
Junio C Hamano68cf15a2010-11-06 01:01:592107<dt class="hdlist1">
Junio C Hamano0430e3a2007-05-15 03:13:172108-c
2109</dt>
2110<dd>
2111<p>
2112 This flag changes the way a merge commit is displayed
2113 (which means it is useful only when the command is given
Junio C Hamano92d80372016-07-13 22:00:052114 one &lt;tree-ish&gt;, or <code>--stdin</code>). It shows the differences
Junio C Hamano0430e3a2007-05-15 03:13:172115 from each of the parents to the merge result simultaneously
2116 instead of showing pairwise diff between a parent and the
Junio C Hamano92d80372016-07-13 22:00:052117 result one at a time (which is what the <code>-m</code> option does).
Junio C Hamano0430e3a2007-05-15 03:13:172118 Furthermore, it lists only files which were modified
2119 from all parents.
2120</p>
2121</dd>
Junio C Hamano68cf15a2010-11-06 01:01:592122<dt class="hdlist1">
Junio C Hamano0430e3a2007-05-15 03:13:172123--cc
2124</dt>
2125<dd>
2126<p>
2127 This flag changes the way a merge commit patch is displayed,
Junio C Hamano92d80372016-07-13 22:00:052128 in a similar way to the <code>-c</code> option. It implies the <code>-c</code>
2129 and <code>-p</code> options and further compresses the patch output
Junio C Hamanoccc2f762008-07-24 04:03:332130 by omitting uninteresting hunks whose the contents in the parents
2131 have only two variants and the merge result picks one of them
2132 without modification. When all hunks are uninteresting, the commit
2133 itself and the commit log message is not shown, just like in any other
2134 "empty diff" case.
Junio C Hamano0430e3a2007-05-15 03:13:172135</p>
2136</dd>
Junio C Hamano68cf15a2010-11-06 01:01:592137<dt class="hdlist1">
Junio C Hamano0430e3a2007-05-15 03:13:172138--always
2139</dt>
2140<dd>
2141<p>
2142 Show the commit itself and the commit log message even
2143 if the diff itself is empty.
2144</p>
2145</dd>
Junio C Hamanoba4b9282008-07-06 05:20:312146</dl></div>
Junio C Hamano0430e3a2007-05-15 03:13:172147</div>
Junio C Hamano9629d4f2012-12-19 00:28:272148</div>
2149<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:312150<h2 id="_pretty_formats">PRETTY FORMATS</h2>
Junio C Hamano0430e3a2007-05-15 03:13:172151<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:592152<div class="paragraph"><p>If the commit is a merge, and if the pretty-format
Junio C Hamano0430e3a2007-05-15 03:13:172153is not <em>oneline</em>, <em>email</em> or <em>raw</em>, an additional line is
2154inserted before the <em>Author:</em> line. This line begins with
2155"Merge: " and the sha1s of ancestral commits are printed,
2156separated by spaces. Note that the listed commits may not
2157necessarily be the list of the <strong>direct</strong> parent commits if you
2158have limited your view of history: for example, if you are
2159only interested in changes related to a certain directory or
Junio C Hamanoba4b9282008-07-06 05:20:312160file.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592161<div class="paragraph"><p>There are several built-in formats, and you can define
Junio C Hamanoa574a092010-06-13 19:57:102162additional formats by setting a pretty.&lt;name&gt;
2163config option to either another format name, or a
2164<em>format:</em> string, as described below (see
Junio C Hamanoa28a9202012-06-21 07:08:232165<a href="git-config.html">git-config(1)</a>). Here are the details of the
Junio C Hamanoa574a092010-06-13 19:57:102166built-in formats:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592167<div class="ulist"><ul>
Junio C Hamanoa340aaa2006-11-23 02:47:332168<li>
2169<p>
2170<em>oneline</em>
2171</p>
2172<div class="literalblock">
2173<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512174<pre><code>&lt;sha1&gt; &lt;title line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332175</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592176<div class="paragraph"><p>This is designed to be as compact as possible.</p></div>
Junio C Hamanoa340aaa2006-11-23 02:47:332177</li>
2178<li>
2179<p>
2180<em>short</em>
2181</p>
2182<div class="literalblock">
2183<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512184<pre><code>commit &lt;sha1&gt;
2185Author: &lt;author&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332186</div></div>
2187<div class="literalblock">
2188<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512189<pre><code>&lt;title line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332190</div></div>
2191</li>
2192<li>
2193<p>
2194<em>medium</em>
2195</p>
2196<div class="literalblock">
2197<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512198<pre><code>commit &lt;sha1&gt;
Junio C Hamanoa340aaa2006-11-23 02:47:332199Author: &lt;author&gt;
Junio C Hamanoac12f0e2014-09-19 22:32:512200Date: &lt;author date&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332201</div></div>
2202<div class="literalblock">
2203<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512204<pre><code>&lt;title line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332205</div></div>
2206<div class="literalblock">
2207<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512208<pre><code>&lt;full commit message&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332209</div></div>
2210</li>
2211<li>
2212<p>
2213<em>full</em>
2214</p>
2215<div class="literalblock">
2216<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512217<pre><code>commit &lt;sha1&gt;
Junio C Hamanoa340aaa2006-11-23 02:47:332218Author: &lt;author&gt;
Junio C Hamanoac12f0e2014-09-19 22:32:512219Commit: &lt;committer&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332220</div></div>
2221<div class="literalblock">
2222<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512223<pre><code>&lt;title line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332224</div></div>
2225<div class="literalblock">
2226<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512227<pre><code>&lt;full commit message&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332228</div></div>
2229</li>
2230<li>
2231<p>
2232<em>fuller</em>
2233</p>
2234<div class="literalblock">
2235<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512236<pre><code>commit &lt;sha1&gt;
Junio C Hamano6a3c8272008-12-19 21:38:182237Author: &lt;author&gt;
Junio C Hamanoba4b9282008-07-06 05:20:312238AuthorDate: &lt;author date&gt;
Junio C Hamano6a3c8272008-12-19 21:38:182239Commit: &lt;committer&gt;
Junio C Hamanoac12f0e2014-09-19 22:32:512240CommitDate: &lt;committer date&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332241</div></div>
2242<div class="literalblock">
2243<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512244<pre><code>&lt;title line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332245</div></div>
2246<div class="literalblock">
2247<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512248<pre><code>&lt;full commit message&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332249</div></div>
2250</li>
2251<li>
2252<p>
2253<em>email</em>
2254</p>
2255<div class="literalblock">
2256<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512257<pre><code>From &lt;sha1&gt; &lt;date&gt;
Junio C Hamanoa340aaa2006-11-23 02:47:332258From: &lt;author&gt;
Junio C Hamanoba4b9282008-07-06 05:20:312259Date: &lt;author date&gt;
Junio C Hamanoac12f0e2014-09-19 22:32:512260Subject: [PATCH] &lt;title line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332261</div></div>
2262<div class="literalblock">
2263<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512264<pre><code>&lt;full commit message&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332265</div></div>
2266</li>
2267<li>
2268<p>
2269<em>raw</em>
2270</p>
Junio C Hamano68cf15a2010-11-06 01:01:592271<div class="paragraph"><p>The <em>raw</em> format shows the entire commit exactly as
Junio C Hamanoe3f080d2013-04-22 02:27:132272stored in the commit object. Notably, the SHA-1s are
Junio C Hamanoa340aaa2006-11-23 02:47:332273displayed in full, regardless of whether --abbrev or
2274--no-abbrev are used, and <em>parents</em> information show the
Junio C Hamanod75148a2014-04-08 19:48:382275true parent commits, without taking grafts or history
Junio C Hamano85f1fde2015-06-01 20:37:322276simplification into account. Note that this format affects the way
2277commits are displayed, but not the way the diff is shown e.g. with
2278<code>git log --raw</code>. To get full object names in a raw diff format,
2279use <code>--no-abbrev</code>.</p></div>
Junio C Hamanoa340aaa2006-11-23 02:47:332280</li>
Junio C Hamanoa3fd83c2007-03-02 10:34:362281<li>
2282<p>
Junio C Hamanoe32ec8b2010-06-02 23:32:312283<em>format:&lt;string&gt;</em>
Junio C Hamanoa3fd83c2007-03-02 10:34:362284</p>
Junio C Hamano68cf15a2010-11-06 01:01:592285<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:362286you want to show. It works a little bit like printf format,
2287with the notable exception that you get a newline with <em>%n</em>
Junio C Hamanoba4b9282008-07-06 05:20:312288instead of <em>\n</em>.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592289<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:312290would show something like this:</p></div>
Junio C Hamano0430e3a2007-05-15 03:13:172291<div class="listingblock">
2292<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512293<pre><code>The author of fe6e0ee was Junio C Hamano, 23 hours ago
2294The 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:172295</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592296<div class="paragraph"><p>The placeholders are:</p></div>
2297<div class="ulist"><ul>
Junio C Hamanoa3fd83c2007-03-02 10:34:362298<li>
2299<p>
2300<em>%H</em>: commit hash
2301</p>
2302</li>
2303<li>
2304<p>
2305<em>%h</em>: abbreviated commit hash
2306</p>
2307</li>
2308<li>
2309<p>
2310<em>%T</em>: tree hash
2311</p>
2312</li>
2313<li>
2314<p>
2315<em>%t</em>: abbreviated tree hash
2316</p>
2317</li>
2318<li>
2319<p>
2320<em>%P</em>: parent hashes
2321</p>
2322</li>
2323<li>
2324<p>
2325<em>%p</em>: abbreviated parent hashes
2326</p>
2327</li>
2328<li>
2329<p>
2330<em>%an</em>: author name
2331</p>
2332</li>
2333<li>
2334<p>
Junio C Hamano04e768d2013-04-23 19:19:262335<em>%aN</em>: author name (respecting .mailmap, see <a href="git-shortlog.html">git-shortlog(1)</a>
2336 or <a href="git-blame.html">git-blame(1)</a>)
Junio C Hamanof5a93622008-07-16 03:23:572337</p>
2338</li>
2339<li>
2340<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:362341<em>%ae</em>: author email
2342</p>
2343</li>
2344<li>
2345<p>
Junio C Hamano04e768d2013-04-23 19:19:262346<em>%aE</em>: author email (respecting .mailmap, see
2347 <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:192348</p>
2349</li>
2350<li>
2351<p>
Junio C Hamanoa387df32008-08-29 08:56:582352<em>%ad</em>: author date (format respects --date= option)
Junio C Hamanoa3fd83c2007-03-02 10:34:362353</p>
2354</li>
2355<li>
2356<p>
2357<em>%aD</em>: author date, RFC2822 style
2358</p>
2359</li>
2360<li>
2361<p>
2362<em>%ar</em>: author date, relative
2363</p>
2364</li>
2365<li>
2366<p>
2367<em>%at</em>: author date, UNIX timestamp
2368</p>
2369</li>
2370<li>
2371<p>
Junio C Hamanoac12f0e2014-09-19 22:32:512372<em>%ai</em>: author date, ISO 8601-like format
2373</p>
2374</li>
2375<li>
2376<p>
2377<em>%aI</em>: author date, strict ISO 8601 format
Junio C Hamano02f130b2007-07-14 08:26:562378</p>
2379</li>
2380<li>
2381<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:362382<em>%cn</em>: committer name
2383</p>
2384</li>
2385<li>
2386<p>
Junio C Hamano04e768d2013-04-23 19:19:262387<em>%cN</em>: committer name (respecting .mailmap, see
2388 <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:572389</p>
2390</li>
2391<li>
2392<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:362393<em>%ce</em>: committer email
2394</p>
2395</li>
2396<li>
2397<p>
Junio C Hamano04e768d2013-04-23 19:19:262398<em>%cE</em>: committer email (respecting .mailmap, see
2399 <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:192400</p>
2401</li>
2402<li>
2403<p>
Junio C Hamano53fe0312014-09-09 21:16:172404<em>%cd</em>: committer date (format respects --date= option)
Junio C Hamanoa3fd83c2007-03-02 10:34:362405</p>
2406</li>
2407<li>
2408<p>
2409<em>%cD</em>: committer date, RFC2822 style
2410</p>
2411</li>
2412<li>
2413<p>
2414<em>%cr</em>: committer date, relative
2415</p>
2416</li>
2417<li>
2418<p>
2419<em>%ct</em>: committer date, UNIX timestamp
2420</p>
2421</li>
2422<li>
2423<p>
Junio C Hamanoac12f0e2014-09-19 22:32:512424<em>%ci</em>: committer date, ISO 8601-like format
2425</p>
2426</li>
2427<li>
2428<p>
2429<em>%cI</em>: committer date, strict ISO 8601 format
Junio C Hamano02f130b2007-07-14 08:26:562430</p>
2431</li>
2432<li>
2433<p>
Junio C Hamanoa28a9202012-06-21 07:08:232434<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:022435</p>
2436</li>
2437<li>
2438<p>
Junio C Hamano00b9f1a2014-09-29 23:11:282439<em>%D</em>: ref names without the " (", ")" wrapping.
2440</p>
2441</li>
2442<li>
2443<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:362444<em>%e</em>: encoding
2445</p>
2446</li>
2447<li>
2448<p>
2449<em>%s</em>: subject
2450</p>
2451</li>
2452<li>
2453<p>
Junio C Hamano5f9a6f02009-04-06 08:26:562454<em>%f</em>: sanitized subject line, suitable for a filename
2455</p>
2456</li>
2457<li>
2458<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:362459<em>%b</em>: body
2460</p>
2461</li>
2462<li>
2463<p>
Junio C Hamanocb39aea2010-05-09 07:24:482464<em>%B</em>: raw body (unwrapped subject and body)
2465</p>
2466</li>
2467<li>
2468<p>
Junio C Hamano3b70d3c2009-11-21 17:37:372469<em>%N</em>: commit notes
2470</p>
2471</li>
2472<li>
2473<p>
Junio C Hamano0acb1ae2012-09-24 21:28:132474<em>%GG</em>: raw verification message from GPG for a signed commit
2475</p>
2476</li>
2477<li>
2478<p>
Junio C Hamano4a401d52016-10-26 22:24:372479<em>%G?</em>: show "G" for a good (valid) signature,
2480 "B" for a bad signature,
2481 "U" for a good signature with unknown validity,
2482 "X" for a good signature that has expired,
2483 "Y" for a good signature made by an expired key,
2484 "R" for a good signature made by a revoked key,
2485 "E" if the signature cannot be checked (e.g. missing key)
2486 and "N" for no signature
Junio C Hamano0acb1ae2012-09-24 21:28:132487</p>
2488</li>
2489<li>
2490<p>
2491<em>%GS</em>: show the name of the signer for a signed commit
2492</p>
2493</li>
2494<li>
2495<p>
Junio C Hamano5e7f1312013-03-21 22:49:012496<em>%GK</em>: show the key used to sign a signed commit
2497</p>
2498</li>
2499<li>
2500<p>
Junio C Hamanoe548d1b2016-08-08 22:26:492501<em>%gD</em>: reflog selector, e.g., <code>refs/stash@{1}</code> or
2502 <code>refs/stash@{2 minutes ago</code>}; the format follows the rules described
2503 for the <code>-g</code> option. The portion before the <code>@</code> is the refname as
2504 given on the command line (so <code>git log -g refs/heads/master</code> would
2505 yield <code>refs/heads/master@{0}</code>).
Junio C Hamanoc21ab052009-10-31 04:03:552506</p>
2507</li>
2508<li>
2509<p>
Junio C Hamanoe548d1b2016-08-08 22:26:492510<em>%gd</em>: shortened reflog selector; same as <code>%gD</code>, but the refname
2511 portion is shortened for human readability (so <code>refs/heads/master</code>
2512 becomes just <code>master</code>).
Junio C Hamanoc21ab052009-10-31 04:03:552513</p>
2514</li>
2515<li>
2516<p>
Junio C Hamano962f3a32011-12-22 20:21:442517<em>%gn</em>: reflog identity name
2518</p>
2519</li>
2520<li>
2521<p>
Junio C Hamano04e768d2013-04-23 19:19:262522<em>%gN</em>: reflog identity name (respecting .mailmap, see
2523 <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:442524</p>
2525</li>
2526<li>
2527<p>
2528<em>%ge</em>: reflog identity email
2529</p>
2530</li>
2531<li>
2532<p>
Junio C Hamano04e768d2013-04-23 19:19:262533<em>%gE</em>: reflog identity email (respecting .mailmap, see
2534 <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:442535</p>
2536</li>
2537<li>
2538<p>
Junio C Hamanoc21ab052009-10-31 04:03:552539<em>%gs</em>: reflog subject
2540</p>
2541</li>
2542<li>
2543<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:362544<em>%Cred</em>: switch color to red
2545</p>
2546</li>
2547<li>
2548<p>
2549<em>%Cgreen</em>: switch color to green
2550</p>
2551</li>
2552<li>
2553<p>
2554<em>%Cblue</em>: switch color to blue
2555</p>
2556</li>
2557<li>
2558<p>
2559<em>%Creset</em>: reset color
2560</p>
2561</li>
2562<li>
2563<p>
Junio C Hamanoc0859f72016-10-17 22:22:572564<em>%C(&#8230;)</em>: color specification, as described under Values in the
Junio C Hamano4b2a6c12017-08-22 18:32:372565 "CONFIGURATION FILE" section of <a href="git-config.html">git-config(1)</a>.
2566 By default, colors are shown only when enabled for log output (by
2567 <code>color.diff</code>, <code>color.ui</code>, or <code>--color</code>, and respecting the <code>auto</code>
2568 settings of the former if we are going to a terminal). <code>%C(auto,...)</code>
2569 is accepted as a historical synonym for the default (e.g.,
2570 <code>%C(auto,red)</code>). Specifying <code>%C(always,...) will show the colors
2571 even when color is not otherwise enabled (though consider
2572 just using `--color=always</code> to enable color for the whole output,
2573 including this format and anything else git might color). <code>auto</code>
2574 alone (i.e. <code>%C(auto)</code>) will turn on auto coloring on the next
2575 placeholders until the color is switched again.
Junio C Hamanocc0cb312009-01-22 03:38:502576</p>
2577</li>
2578<li>
2579<p>
Junio C Hamanocd451662016-09-13 00:54:092580<em>%m</em>: left (<code>&lt;</code>), right (<code>&gt;</code>) or boundary (<code>-</code>) mark
Junio C Hamanod9e0e5d2007-04-14 16:22:042581</p>
2582</li>
2583<li>
2584<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:362585<em>%n</em>: newline
2586</p>
Junio C Hamano0430e3a2007-05-15 03:13:172587</li>
Junio C Hamanob78d2592008-04-09 09:39:082588<li>
2589<p>
Junio C Hamanoa9701f02010-01-21 00:42:162590<em>%%</em>: a raw <em>%</em>
2591</p>
2592</li>
2593<li>
2594<p>
Junio C Hamanob78d2592008-04-09 09:39:082595<em>%x00</em>: print a byte from a hex code
2596</p>
2597</li>
Junio C Hamanobf984de2009-11-23 06:11:192598<li>
2599<p>
2600<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:232601 <a href="git-shortlog.html">git-shortlog(1)</a>.
Junio C Hamanobf984de2009-11-23 06:11:192602</p>
2603</li>
Junio C Hamano04e768d2013-04-23 19:19:262604<li>
2605<p>
2606<em>%&lt;(&lt;N&gt;[,trunc|ltrunc|mtrunc])</em>: make the next placeholder take at
2607 least N columns, padding spaces on the right if necessary.
2608 Optionally truncate at the beginning (ltrunc), the middle (mtrunc)
2609 or the end (trunc) if the output is longer than N columns.
2610 Note that truncating only works correctly with N &gt;= 2.
2611</p>
2612</li>
2613<li>
2614<p>
2615<em>%&lt;|(&lt;N&gt;)</em>: make the next placeholder take at least until Nth
2616 columns, padding spaces on the right if necessary
2617</p>
2618</li>
2619<li>
2620<p>
2621<em>%&gt;(&lt;N&gt;)</em>, <em>%&gt;|(&lt;N&gt;)</em>: similar to <em>%&lt;(&lt;N&gt;)</em>, <em>%&lt;|(&lt;N&gt;)</em>
2622 respectively, but padding spaces on the left
2623</p>
2624</li>
2625<li>
2626<p>
2627<em>%&gt;&gt;(&lt;N&gt;)</em>, <em>%&gt;&gt;|(&lt;N&gt;)</em>: similar to <em>%&gt;(&lt;N&gt;)</em>, <em>%&gt;|(&lt;N&gt;)</em>
2628 respectively, except that if the next placeholder takes more spaces
2629 than given and there are spaces on its left, use those spaces
2630</p>
2631</li>
2632<li>
2633<p>
Junio C Hamanoa25ccc42018-03-08 21:36:142634<em>%&gt;&lt;(&lt;N&gt;)</em>, <em>%&gt;&lt;|(&lt;N&gt;)</em>: similar to <em>%&lt;(&lt;N&gt;)</em>, <em>%&lt;|(&lt;N&gt;)</em>
Junio C Hamano04e768d2013-04-23 19:19:262635 respectively, but padding both sides (i.e. the text is centered)
Junio C Hamano222ed822017-06-02 06:24:062636</p>
2637</li>
2638<li>
2639<p>
Junio C Hamano0f1291d2017-12-27 19:58:352640%(trailers[:options]): display the trailers of the body as interpreted
2641 by <a href="git-interpret-trailers.html">git-interpret-trailers(1)</a>. The <code>trailers</code> string may be
2642 followed by a colon and zero or more comma-separated options. If the
2643 <code>only</code> option is given, omit non-trailer lines from the trailer block.
2644 If the <code>unfold</code> option is given, behave as if interpret-trailer&#8217;s
2645 <code>--unfold</code> option was given. E.g., <code>%(trailers:only,unfold)</code> to do
2646 both.
Junio C Hamano04e768d2013-04-23 19:19:262647</p>
2648</li>
Junio C Hamanoba4b9282008-07-06 05:20:312649</ul></div>
Junio C Hamanoa3fd83c2007-03-02 10:34:362650</li>
Junio C Hamanoc21ab052009-10-31 04:03:552651</ul></div>
2652<div class="admonitionblock">
2653<table><tr>
2654<td class="icon">
2655<div class="title">Note</div>
2656</td>
2657<td class="content">Some placeholders may depend on other options given to the
Junio C Hamanoac12f0e2014-09-19 22:32:512658revision traversal engine. For example, the <code>%g*</code> reflog options will
Junio C Hamanoc21ab052009-10-31 04:03:552659insert an empty string unless we are traversing reflog entries (e.g., by
Junio C Hamano00b9f1a2014-09-29 23:11:282660<code>git log -g</code>). The <code>%d</code> and <code>%D</code> placeholders will use the "short"
2661decoration format if <code>--decorate</code> was not already provided on the command
2662line.</td>
Junio C Hamanoc21ab052009-10-31 04:03:552663</tr></table>
2664</div>
Junio C Hamanoac12f0e2014-09-19 22:32:512665<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:592666is inserted immediately before the expansion if and only if the
2667placeholder expands to a non-empty string.</p></div>
Junio C Hamano535c65c2017-06-24 22:51:582668<div class="paragraph"><p>If you add a <code>-</code> (minus sign) after <em>%</em> of a placeholder, all consecutive
2669line-feeds immediately preceding the expansion are deleted if and only if the
Junio C Hamano2bd8a742009-12-01 21:16:592670placeholder expands to an empty string.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592671<div class="paragraph"><p>If you add a ` ` (space) after <em>%</em> of a placeholder, a space
Junio C Hamano89a57342010-06-22 23:22:552672is inserted immediately before the expansion if and only if the
2673placeholder expands to a non-empty string.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592674<div class="ulist"><ul>
Junio C Hamano6fb124c2008-06-13 10:04:012675<li>
2676<p>
2677<em>tformat:</em>
2678</p>
Junio C Hamano68cf15a2010-11-06 01:01:592679<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:012680provides "terminator" semantics instead of "separator" semantics. In
2681other words, each commit has the message terminator character (usually a
2682newline) appended, rather than a separator placed between entries.
2683This means that the final entry of a single-line format will be properly
2684terminated with a new line, just as the "oneline" format does.
Junio C Hamanoba4b9282008-07-06 05:20:312685For example:</p></div>
Junio C Hamano6fb124c2008-06-13 10:04:012686<div class="listingblock">
2687<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512688<pre><code>$ git log -2 --pretty=format:%h 4da45bef \
Junio C Hamano6fb124c2008-06-13 10:04:012689 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
26904da45be
26917134973 -- NO NEWLINE
2692
2693$ git log -2 --pretty=tformat:%h 4da45bef \
2694 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
26954da45be
Junio C Hamanoac12f0e2014-09-19 22:32:5126967134973</code></pre>
Junio C Hamano6fb124c2008-06-13 10:04:012697</div></div>
Junio C Hamanoac12f0e2014-09-19 22:32:512698<div class="paragraph"><p>In addition, any unrecognized string that has a <code>%</code> in it is interpreted
2699as if it has <code>tformat:</code> in front of it. For example, these two are
Junio C Hamano0a235222009-03-06 08:21:092700equivalent:</p></div>
2701<div class="listingblock">
2702<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512703<pre><code>$ git log -2 --pretty=tformat:%h 4da45bef
2704$ git log -2 --pretty=%h 4da45bef</code></pre>
Junio C Hamano0a235222009-03-06 08:21:092705</div></div>
Junio C Hamano6fb124c2008-06-13 10:04:012706</li>
Junio C Hamanoba4b9282008-07-06 05:20:312707</ul></div>
Junio C Hamano1a4e8412005-12-27 08:17:232708</div>
Junio C Hamano9629d4f2012-12-19 00:28:272709</div>
2710<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:312711<h2 id="_limiting_output">Limiting Output</h2>
Junio C Hamano1a4e8412005-12-27 08:17:232712<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:592713<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:312714example some architecture-specific files, you might do:</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232715<div class="literalblock">
2716<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512717<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:232718</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592719<div class="paragraph"><p>and it will only show you what changed in those two directories.</p></div>
Junio C Hamanoac12f0e2014-09-19 22:32:512720<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:232721<div class="literalblock">
2722<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512723<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:232724</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592725<div class="paragraph"><p>and it will ignore all differences to other files.</p></div>
2726<div class="paragraph"><p>The pattern is always the prefix, and is matched exactly. There are no
Junio C Hamano1a4e8412005-12-27 08:17:232727wildcards. Even stricter, it has to match a complete path component.
Junio C Hamanoac12f0e2014-09-19 22:32:512728I.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:312729so it can be used to name subdirectories.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592730<div class="paragraph"><p>An example of normal usage is:</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232731<div class="literalblock">
2732<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512733<pre><code>torvalds@ppc970:~/git&gt; git diff-tree --abbrev 5319e4
2734:100664 100664 ac348b... a01513... git-fsck-objects.c</code></pre>
Junio C Hamano1a4e8412005-12-27 08:17:232735</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592736<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:312737this one:</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232738<div class="listingblock">
2739<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512740<pre><code>commit 3c6f7ca19ad4043e9e72fa94106f352897e651a8
Junio C Hamano1a4e8412005-12-27 08:17:232741tree 5319e4d609cdd282069cc4dce33c1db559539b03
2742parent b4e628ea30d5ab3606119d2ea5caeab141d38df7
2743author Linus Torvalds &lt;torvalds@ppc970.osdl.org&gt; Sat Apr 9 12:02:30 2005
2744committer Linus Torvalds &lt;torvalds@ppc970.osdl.org&gt; Sat Apr 9 12:02:30 2005
2745
2746Make "git-fsck-objects" print out all the root commits it finds.
2747
2748Once I do the reference tracking, I'll also make it print out all the
Junio C Hamanoac12f0e2014-09-19 22:32:512749HEAD commits it finds, which is even more interesting.</code></pre>
Junio C Hamano1a4e8412005-12-27 08:17:232750</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592751<div class="paragraph"><p>in case you care).</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232752</div>
Junio C Hamano9629d4f2012-12-19 00:28:272753</div>
2754<div class="sect1">
Junio C Hamano543f8d62009-07-29 08:35:212755<h2 id="_raw_output_format">Raw output format</h2>
Junio C Hamano1a4e8412005-12-27 08:17:232756<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:592757<div class="paragraph"><p>The raw output format from "git-diff-index", "git-diff-tree",
Junio C Hamanoba4b9282008-07-06 05:20:312758"git-diff-files" and "git diff --raw" are very similar.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592759<div class="paragraph"><p>These commands all compare two sets of things; what is
Junio C Hamanoba4b9282008-07-06 05:20:312760compared differs:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592761<div class="dlist"><dl>
2762<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:232763git-diff-index &lt;tree-ish&gt;
2764</dt>
2765<dd>
2766<p>
2767 compares the &lt;tree-ish&gt; and the files on the filesystem.
2768</p>
2769</dd>
Junio C Hamano68cf15a2010-11-06 01:01:592770<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:232771git-diff-index --cached &lt;tree-ish&gt;
2772</dt>
2773<dd>
2774<p>
2775 compares the &lt;tree-ish&gt; and the index.
2776</p>
2777</dd>
Junio C Hamano68cf15a2010-11-06 01:01:592778<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:232779git-diff-tree [-r] &lt;tree-ish-1&gt; &lt;tree-ish-2&gt; [&lt;pattern&gt;&#8230;]
2780</dt>
2781<dd>
2782<p>
2783 compares the trees named by the two arguments.
2784</p>
2785</dd>
Junio C Hamano68cf15a2010-11-06 01:01:592786<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:232787git-diff-files [&lt;pattern&gt;&#8230;]
2788</dt>
2789<dd>
2790<p>
2791 compares the index and the files on the filesystem.
2792</p>
2793</dd>
Junio C Hamanoba4b9282008-07-06 05:20:312794</dl></div>
Junio C Hamano68cf15a2010-11-06 01:01:592795<div class="paragraph"><p>The "git-diff-tree" command begins its output by printing the hash of
Junio C Hamano543f8d62009-07-29 08:35:212796what is being compared. After that, all the commands print one output
2797line per changed file.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592798<div class="paragraph"><p>An output line is formatted this way:</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232799<div class="listingblock">
2800<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512801<pre><code>in-place edit :100644 100644 bcd1234... 0123456... M file0
Junio C Hamano1a4e8412005-12-27 08:17:232802copy-edit :100644 100644 abcd123... 1234567... C68 file1 file2
2803rename-edit :100644 100644 abcd123... 1234567... R86 file1 file3
2804create :000000 100644 0000000... 1234567... A file4
2805delete :100644 000000 1234567... 0000000... D file5
Junio C Hamanoac12f0e2014-09-19 22:32:512806unmerged :000000 000000 0000000... 0000000... U file6</code></pre>
Junio C Hamano1a4e8412005-12-27 08:17:232807</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592808<div class="paragraph"><p>That is, from the left to the right:</p></div>
2809<div class="olist arabic"><ol class="arabic">
Junio C Hamano1a4e8412005-12-27 08:17:232810<li>
2811<p>
2812a colon.
2813</p>
2814</li>
2815<li>
2816<p>
2817mode for "src"; 000000 if creation or unmerged.
2818</p>
2819</li>
2820<li>
2821<p>
2822a space.
2823</p>
2824</li>
2825<li>
2826<p>
2827mode for "dst"; 000000 if deletion or unmerged.
2828</p>
2829</li>
2830<li>
2831<p>
2832a space.
2833</p>
2834</li>
2835<li>
2836<p>
2837sha1 for "src"; 0{40} if creation or unmerged.
2838</p>
2839</li>
2840<li>
2841<p>
2842a space.
2843</p>
2844</li>
2845<li>
2846<p>
2847sha1 for "dst"; 0{40} if creation, unmerged or "look at work tree".
2848</p>
2849</li>
2850<li>
2851<p>
2852a space.
2853</p>
2854</li>
2855<li>
2856<p>
2857status, followed by optional "score" number.
2858</p>
2859</li>
2860<li>
2861<p>
Junio C Hamano92d80372016-07-13 22:00:052862a tab or a NUL when <code>-z</code> option is used.
Junio C Hamano1a4e8412005-12-27 08:17:232863</p>
2864</li>
2865<li>
2866<p>
2867path for "src"
2868</p>
2869</li>
2870<li>
2871<p>
Junio C Hamano92d80372016-07-13 22:00:052872a tab or a NUL when <code>-z</code> option is used; only exists for C or R.
Junio C Hamano1a4e8412005-12-27 08:17:232873</p>
2874</li>
2875<li>
2876<p>
2877path for "dst"; only exists for C or R.
2878</p>
2879</li>
2880<li>
2881<p>
Junio C Hamano92d80372016-07-13 22:00:052882an LF or a NUL when <code>-z</code> option is used, to terminate the record.
Junio C Hamano1a4e8412005-12-27 08:17:232883</p>
2884</li>
Junio C Hamanoba4b9282008-07-06 05:20:312885</ol></div>
Junio C Hamano68cf15a2010-11-06 01:01:592886<div class="paragraph"><p>Possible status letters are:</p></div>
2887<div class="ulist"><ul>
Junio C Hamanoaa17c7c2008-11-03 04:36:582888<li>
2889<p>
2890A: addition of a file
2891</p>
2892</li>
2893<li>
2894<p>
2895C: copy of a file into a new one
2896</p>
2897</li>
2898<li>
2899<p>
2900D: deletion of a file
2901</p>
2902</li>
2903<li>
2904<p>
2905M: modification of the contents or mode of a file
2906</p>
2907</li>
2908<li>
2909<p>
2910R: renaming of a file
2911</p>
2912</li>
2913<li>
2914<p>
2915T: change in the type of the file
2916</p>
2917</li>
2918<li>
2919<p>
2920U: file is unmerged (you must complete the merge before it can
2921be committed)
2922</p>
2923</li>
2924<li>
2925<p>
2926X: "unknown" change type (most probably a bug, please report it)
2927</p>
2928</li>
2929</ul></div>
Junio C Hamano68cf15a2010-11-06 01:01:592930<div class="paragraph"><p>Status letters C and R are always followed by a score (denoting the
Junio C Hamanoaa17c7c2008-11-03 04:36:582931percentage of similarity between the source and target of the move or
Junio C Hamano6bb32e62015-02-17 22:11:262932copy). Status letter M may be followed by a score (denoting the
2933percentage of dissimilarity) for file rewrites.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592934<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:312935and it is out of sync with the index.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592936<div class="paragraph"><p>Example:</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232937<div class="listingblock">
2938<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512939<pre><code>:100644 100644 5be4a4...... 000000...... M file.c</code></pre>
Junio C Hamano1a4e8412005-12-27 08:17:232940</div></div>
Junio C Hamano0f6f3bf2017-03-13 07:01:532941<div class="paragraph"><p>Without the <code>-z</code> option, pathnames with "unusual" characters are
2942quoted as explained for the configuration variable <code>core.quotePath</code>
2943(see <a href="git-config.html">git-config(1)</a>). Using <code>-z</code> the filename is output
2944verbatim and the line is terminated by a NUL byte.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232945</div>
Junio C Hamano9629d4f2012-12-19 00:28:272946</div>
2947<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:312948<h2 id="_diff_format_for_merges">diff format for merges</h2>
Junio C Hamano67fad6d2007-05-06 08:53:122949<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:592950<div class="paragraph"><p>"git-diff-tree", "git-diff-files" and "git-diff --raw"
Junio C Hamano92d80372016-07-13 22:00:052951can take <code>-c</code> or <code>--cc</code> option
Junio C Hamano67fad6d2007-05-06 08:53:122952to generate diff output also for merge commits. The output differs
Junio C Hamanoba4b9282008-07-06 05:20:312953from the format described above in the following way:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592954<div class="olist arabic"><ol class="arabic">
Junio C Hamano67fad6d2007-05-06 08:53:122955<li>
2956<p>
2957there is a colon for each parent
2958</p>
2959</li>
2960<li>
2961<p>
2962there are more "src" modes and "src" sha1
2963</p>
2964</li>
2965<li>
2966<p>
2967status is concatenated status characters for each parent
2968</p>
2969</li>
2970<li>
2971<p>
2972no optional "score" number
2973</p>
2974</li>
2975<li>
2976<p>
2977single path, only for "dst"
2978</p>
2979</li>
Junio C Hamanoba4b9282008-07-06 05:20:312980</ol></div>
Junio C Hamano68cf15a2010-11-06 01:01:592981<div class="paragraph"><p>Example:</p></div>
Junio C Hamano67fad6d2007-05-06 08:53:122982<div class="listingblock">
2983<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512984<pre><code>::100644 100644 100644 fabadb8... cc95eb0... 4866510... MM describe.c</code></pre>
Junio C Hamano67fad6d2007-05-06 08:53:122985</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592986<div class="paragraph"><p>Note that <em>combined diff</em> lists only files which were modified from
Junio C Hamanoba4b9282008-07-06 05:20:312987all parents.</p></div>
Junio C Hamano67fad6d2007-05-06 08:53:122988</div>
Junio C Hamano9629d4f2012-12-19 00:28:272989</div>
2990<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:312991<h2 id="_generating_patches_with_p">Generating patches with -p</h2>
Junio C Hamano1a4e8412005-12-27 08:17:232992<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:592993<div class="paragraph"><p>When "git-diff-index", "git-diff-tree", or "git-diff-files" are run
Junio C Hamano92d80372016-07-13 22:00:052994with a <code>-p</code> option, "git diff" without the <code>--raw</code> option, or
Junio C Hamano00b8b632007-12-07 09:50:492995"git log" with the "-p" option, they
Junio C Hamano7ae0ab22007-11-03 02:46:462996do not produce the output described above; instead they produce a
2997patch file. You can customize the creation of such patches via the
Junio C Hamano042f2142016-06-27 18:05:052998<code>GIT_EXTERNAL_DIFF</code> and the <code>GIT_DIFF_OPTS</code> environment variables.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592999<div class="paragraph"><p>What the -p option produces is slightly different from the traditional
Junio C Hamano7f9fa862010-10-19 23:51:143000diff format:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:593001<div class="olist arabic"><ol class="arabic">
Junio C Hamano1a4e8412005-12-27 08:17:233002<li>
3003<p>
Junio C Hamano7f9fa862010-10-19 23:51:143004It is preceded with a "git diff" header that looks like this:
Junio C Hamano1a4e8412005-12-27 08:17:233005</p>
3006<div class="literalblock">
3007<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:513008<pre><code>diff --git a/file1 b/file2</code></pre>
Junio C Hamano1a4e8412005-12-27 08:17:233009</div></div>
Junio C Hamanoac12f0e2014-09-19 22:32:513010<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:233011involved. Especially, even for a creation or a deletion,
Junio C Hamanoac12f0e2014-09-19 22:32:513012<code>/dev/null</code> is <em>not</em> used in place of the <code>a/</code> or <code>b/</code> filenames.</p></div>
3013<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:233014name of the source file of the rename/copy and the name of
Junio C Hamanoba4b9282008-07-06 05:20:313015the file that rename/copy produces, respectively.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:233016</li>
3017<li>
3018<p>
3019It is followed by one or more extended header lines:
3020</p>
3021<div class="literalblock">
3022<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:513023<pre><code>old mode &lt;mode&gt;
Junio C Hamano1a4e8412005-12-27 08:17:233024new mode &lt;mode&gt;
3025deleted file mode &lt;mode&gt;
3026new file mode &lt;mode&gt;
3027copy from &lt;path&gt;
3028copy to &lt;path&gt;
3029rename from &lt;path&gt;
3030rename to &lt;path&gt;
3031similarity index &lt;number&gt;
3032dissimilarity index &lt;number&gt;
Junio C Hamanoac12f0e2014-09-19 22:32:513033index &lt;hash&gt;..&lt;hash&gt; &lt;mode&gt;</code></pre>
Junio C Hamano1a4e8412005-12-27 08:17:233034</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:593035<div class="paragraph"><p>File modes are printed as 6-digit octal numbers including the file type
Junio C Hamano7f9fa862010-10-19 23:51:143036and file permission bits.</p></div>
Junio C Hamanoac12f0e2014-09-19 22:32:513037<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:593038<div class="paragraph"><p>The similarity index is the percentage of unchanged lines, and
Junio C Hamano7f9fa862010-10-19 23:51:143039the dissimilarity index is the percentage of changed lines. It
3040is a rounded down integer, followed by a percent sign. The
3041similarity index value of 100% is thus reserved for two equal
3042files, while 100% dissimilarity means that no line from the old
3043file made it into the new one.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:593044<div class="paragraph"><p>The index line includes the SHA-1 checksum before and after the change.
Junio C Hamano7f9fa862010-10-19 23:51:143045The &lt;mode&gt; is included if the file mode does not change; otherwise,
3046separate lines indicate the old and the new mode.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:233047</li>
3048<li>
3049<p>
Junio C Hamano0f6f3bf2017-03-13 07:01:533050Pathnames with "unusual" characters are quoted as explained for
3051 the configuration variable <code>core.quotePath</code> (see
3052 <a href="git-config.html">git-config(1)</a>).
Junio C Hamano1a4e8412005-12-27 08:17:233053</p>
3054</li>
Junio C Hamano7f9fa862010-10-19 23:51:143055<li>
3056<p>
Junio C Hamanoac12f0e2014-09-19 22:32:513057All the <code>file1</code> files in the output refer to files before the
3058 commit, and all the <code>file2</code> files refer to files after the commit.
Junio C Hamano7f9fa862010-10-19 23:51:143059 It is incorrect to apply each change to each file sequentially. For
3060 example, this patch will swap a and b:
3061</p>
3062<div class="literalblock">
3063<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:513064<pre><code>diff --git a/a b/b
Junio C Hamano7f9fa862010-10-19 23:51:143065rename from a
3066rename to b
3067diff --git a/b b/a
3068rename from b
Junio C Hamanoac12f0e2014-09-19 22:32:513069rename to a</code></pre>
Junio C Hamano7f9fa862010-10-19 23:51:143070</div></div>
3071</li>
Junio C Hamanoba4b9282008-07-06 05:20:313072</ol></div>
Junio C Hamano1a4e8412005-12-27 08:17:233073</div>
Junio C Hamano9629d4f2012-12-19 00:28:273074</div>
3075<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:313076<h2 id="_combined_diff_format">combined diff format</h2>
Junio C Hamanofb56a962006-01-28 10:38:193077<div class="sectionbody">
Junio C Hamano1dbca522015-05-22 20:48:553078<div class="paragraph"><p>Any diff-generating command can take the <code>-c</code> or <code>--cc</code> option to
Junio C Hamanoc5be4cc2011-03-09 07:20:433079produce a <em>combined diff</em> when showing a merge. This is the default
Junio C Hamanoa28a9202012-06-21 07:08:233080format when showing merges with <a href="git-diff.html">git-diff(1)</a> or
Junio C Hamano1dbca522015-05-22 20:48:553081<a href="git-show.html">git-show(1)</a>. Note also that you can give the <code>-m</code> option to any
Junio C Hamanoc5be4cc2011-03-09 07:20:433082of these commands to force generation of diffs with individual parents
3083of a merge.</p></div>
3084<div class="paragraph"><p>A <em>combined diff</em> format looks like this:</p></div>
Junio C Hamanofb56a962006-01-28 10:38:193085<div class="listingblock">
3086<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:513087<pre><code>diff --combined describe.c
Junio C Hamano29f14312006-10-26 08:47:293088index fabadb8,cc95eb0..4866510
3089--- a/describe.c
3090+++ b/describe.c
3091@@@ -98,20 -98,12 +98,20 @@@
3092 return (a_date &gt; b_date) ? -1 : (a_date == b_date) ? 0 : 1;
Junio C Hamanofb56a962006-01-28 10:38:193093 }
3094
3095- static void describe(char *arg)
3096 -static void describe(struct commit *cmit, int last_one)
3097++static void describe(char *arg, int last_one)
3098 {
Junio C Hamano29f14312006-10-26 08:47:293099 + unsigned char sha1[20];
3100 + struct commit *cmit;
3101 struct commit_list *list;
3102 static int initialized = 0;
3103 struct commit_name *n;
3104
3105 + if (get_sha1(arg, sha1) &lt; 0)
3106 + usage(describe_usage);
3107 + cmit = lookup_commit_reference(sha1);
3108 + if (!cmit)
3109 + usage(describe_usage);
3110 +
3111 if (!initialized) {
3112 initialized = 1;
Junio C Hamanoac12f0e2014-09-19 22:32:513113 for_each_ref(get_name);</code></pre>
Junio C Hamanofb56a962006-01-28 10:38:193114</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:593115<div class="olist arabic"><ol class="arabic">
Junio C Hamano29f14312006-10-26 08:47:293116<li>
3117<p>
3118It is preceded with a "git diff" header, that looks like
Junio C Hamano92d80372016-07-13 22:00:053119 this (when <code>-c</code> option is used):
Junio C Hamano29f14312006-10-26 08:47:293120</p>
3121<div class="literalblock">
3122<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:513123<pre><code>diff --combined file</code></pre>
Junio C Hamano29f14312006-10-26 08:47:293124</div></div>
Junio C Hamano92d80372016-07-13 22:00:053125<div class="paragraph"><p>or like this (when <code>--cc</code> option is used):</p></div>
Junio C Hamano29f14312006-10-26 08:47:293126<div class="literalblock">
3127<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:513128<pre><code>diff --cc file</code></pre>
Junio C Hamano29f14312006-10-26 08:47:293129</div></div>
3130</li>
3131<li>
3132<p>
3133It is followed by one or more extended header lines
3134 (this example shows a merge with two parents):
3135</p>
3136<div class="literalblock">
3137<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:513138<pre><code>index &lt;hash&gt;,&lt;hash&gt;..&lt;hash&gt;
Junio C Hamano29f14312006-10-26 08:47:293139mode &lt;mode&gt;,&lt;mode&gt;..&lt;mode&gt;
3140new file mode &lt;mode&gt;
Junio C Hamanoac12f0e2014-09-19 22:32:513141deleted file mode &lt;mode&gt;,&lt;mode&gt;</code></pre>
Junio C Hamano29f14312006-10-26 08:47:293142</div></div>
Junio C Hamanoac12f0e2014-09-19 22:32:513143<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:043144the &lt;mode&gt; is different from the rest. Extended headers with
Junio C Hamano29f14312006-10-26 08:47:293145information about detected contents movement (renames and
3146copying detection) are designed to work with diff of two
Junio C Hamanoba4b9282008-07-06 05:20:313147&lt;tree-ish&gt; and are not used by combined diff format.</p></div>
Junio C Hamano29f14312006-10-26 08:47:293148</li>
3149<li>
3150<p>
3151It is followed by two-line from-file/to-file header
3152</p>
3153<div class="literalblock">
3154<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:513155<pre><code>--- a/file
3156+++ b/file</code></pre>
Junio C Hamano29f14312006-10-26 08:47:293157</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:593158<div class="paragraph"><p>Similar to two-line header for traditional <em>unified</em> diff
Junio C Hamanoac12f0e2014-09-19 22:32:513159format, <code>/dev/null</code> is used to signal created or deleted
Junio C Hamanoba4b9282008-07-06 05:20:313160files.</p></div>
Junio C Hamano29f14312006-10-26 08:47:293161</li>
3162<li>
3163<p>
3164Chunk header format is modified to prevent people from
Junio C Hamanoac12f0e2014-09-19 22:32:513165 accidentally feeding it to <code>patch -p1</code>. Combined diff format
Junio C Hamano29f14312006-10-26 08:47:293166 was created for review of merge commit changes, and was not
3167 meant for apply. The change is similar to the change in the
3168 extended <em>index</em> header:
3169</p>
3170<div class="literalblock">
3171<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:513172<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:293173</div></div>
Junio C Hamanoac12f0e2014-09-19 22:32:513174<div class="paragraph"><p>There are (number of parents + 1) <code>@</code> characters in the chunk
Junio C Hamanoba4b9282008-07-06 05:20:313175header for combined diff format.</p></div>
Junio C Hamano29f14312006-10-26 08:47:293176</li>
Junio C Hamanoba4b9282008-07-06 05:20:313177</ol></div>
Junio C Hamano68cf15a2010-11-06 01:01:593178<div class="paragraph"><p>Unlike the traditional <em>unified</em> diff format, which shows two
Junio C Hamanoac12f0e2014-09-19 22:32:513179files 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
3180added to B), or <code>" "</code> (space&#8201;&#8212;&#8201;unchanged) prefix, this format
Junio C Hamanofb56a962006-01-28 10:38:193181compares two or more files file1, file2,&#8230; with one file X, and
3182shows how X differs from each of fileN. One column for each of
Junio C Hamano68cf15a2010-11-06 01:01:593183fileN is prepended to the output line to note how X&#8217;s line is
Junio C Hamanoba4b9282008-07-06 05:20:313184different from it.</p></div>
Junio C Hamanoac12f0e2014-09-19 22:32:513185<div class="paragraph"><p>A <code>-</code> character in the column N means that the line appears in
3186fileN but it does not appear in the result. A <code>+</code> character
Junio C Hamano54bf1e22008-12-20 06:30:113187in the column N means that the line appears in the result,
Junio C Hamano29f14312006-10-26 08:47:293188and fileN does not have that line (in other words, the line was
Junio C Hamanoba4b9282008-07-06 05:20:313189added, from the point of view of that parent).</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:593190<div class="paragraph"><p>In the above example output, the function signature was changed
Junio C Hamanoac12f0e2014-09-19 22:32:513191from both files (hence two <code>-</code> removals from both file1 and
3192file2, plus <code>++</code> to mean one line that was added does not appear
Junio C Hamanod75148a2014-04-08 19:48:383193in either file1 or file2). Also eight other lines are the same
Junio C Hamanoac12f0e2014-09-19 22:32:513194from file1 but do not appear in file2 (hence prefixed with <code>+</code>).</p></div>
3195<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:193196merge commit with the merge result (i.e. file1..fileN are the
Junio C Hamanoac12f0e2014-09-19 22:32:513197parents). When shown by <code>git diff-files -c</code>, it compares the
Junio C Hamanofb56a962006-01-28 10:38:193198two unresolved merge parents with the working tree file
3199(i.e. file1 is stage 2 aka "our version", file2 is stage 3 aka
Junio C Hamanoba4b9282008-07-06 05:20:313200"their version").</p></div>
Junio C Hamanofb56a962006-01-28 10:38:193201</div>
Junio C Hamano9629d4f2012-12-19 00:28:273202</div>
3203<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:313204<h2 id="_other_diff_formats">other diff formats</h2>
Junio C Hamano3a702342007-12-12 21:34:023205<div class="sectionbody">
Junio C Hamanoac12f0e2014-09-19 22:32:513206<div class="paragraph"><p>The <code>--summary</code> option describes newly added, deleted, renamed and
3207copied files. The <code>--stat</code> option adds diffstat(1) graph to the
Junio C Hamano3a702342007-12-12 21:34:023208output. These options can be combined with other options, such as
Junio C Hamanoac12f0e2014-09-19 22:32:513209<code>-p</code>, and are meant for human consumption.</p></div>
3210<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:023211formats the pathnames compactly by combining common prefix and suffix of
Junio C Hamanoac12f0e2014-09-19 22:32:513212the pathnames. For example, a change that moves <code>arch/i386/Makefile</code> to
3213<code>arch/x86/Makefile</code> while modifying 4 lines will be shown like this:</p></div>
Junio C Hamano3a702342007-12-12 21:34:023214<div class="listingblock">
3215<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:513216<pre><code>arch/{i386 =&gt; x86}/Makefile | 4 +--</code></pre>
Junio C Hamano3a702342007-12-12 21:34:023217</div></div>
Junio C Hamanoac12f0e2014-09-19 22:32:513218<div class="paragraph"><p>The <code>--numstat</code> option gives the diffstat(1) information but is designed
3219for easier machine consumption. An entry in <code>--numstat</code> output looks
Junio C Hamanoba4b9282008-07-06 05:20:313220like this:</p></div>
Junio C Hamano3a702342007-12-12 21:34:023221<div class="listingblock">
3222<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:513223<pre><code>1 2 README
32243 1 arch/{i386 =&gt; x86}/Makefile</code></pre>
Junio C Hamano3a702342007-12-12 21:34:023225</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:593226<div class="paragraph"><p>That is, from left to right:</p></div>
3227<div class="olist arabic"><ol class="arabic">
Junio C Hamano3a702342007-12-12 21:34:023228<li>
3229<p>
3230the number of added lines;
3231</p>
3232</li>
3233<li>
3234<p>
3235a tab;
3236</p>
3237</li>
3238<li>
3239<p>
3240the number of deleted lines;
3241</p>
3242</li>
3243<li>
3244<p>
3245a tab;
3246</p>
3247</li>
3248<li>
3249<p>
3250pathname (possibly with rename/copy information);
3251</p>
3252</li>
3253<li>
3254<p>
3255a newline.
3256</p>
3257</li>
Junio C Hamanoba4b9282008-07-06 05:20:313258</ol></div>
Junio C Hamanoac12f0e2014-09-19 22:32:513259<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:023260<div class="listingblock">
3261<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:513262<pre><code>1 2 README NUL
32633 1 NUL arch/i386/Makefile NUL arch/x86/Makefile NUL</code></pre>
Junio C Hamano3a702342007-12-12 21:34:023264</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:593265<div class="paragraph"><p>That is:</p></div>
3266<div class="olist arabic"><ol class="arabic">
Junio C Hamano3a702342007-12-12 21:34:023267<li>
3268<p>
3269the number of added lines;
3270</p>
3271</li>
3272<li>
3273<p>
3274a tab;
3275</p>
3276</li>
3277<li>
3278<p>
3279the number of deleted lines;
3280</p>
3281</li>
3282<li>
3283<p>
3284a tab;
3285</p>
3286</li>
3287<li>
3288<p>
3289a NUL (only exists if renamed/copied);
3290</p>
3291</li>
3292<li>
3293<p>
3294pathname in preimage;
3295</p>
3296</li>
3297<li>
3298<p>
3299a NUL (only exists if renamed/copied);
3300</p>
3301</li>
3302<li>
3303<p>
3304pathname in postimage (only exists if renamed/copied);
3305</p>
3306</li>
3307<li>
3308<p>
3309a NUL.
3310</p>
3311</li>
Junio C Hamanoba4b9282008-07-06 05:20:313312</ol></div>
Junio C Hamanoac12f0e2014-09-19 22:32:513313<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:023314scripts that read the output to tell if the current record being read is
3315a single-path record or a rename/copy record without reading ahead.
Junio C Hamanoac12f0e2014-09-19 22:32:513316After reading added and deleted lines, reading up to <code>NUL</code> would yield
3317the pathname, but if that is <code>NUL</code>, the record will show two paths.</p></div>
Junio C Hamano3a702342007-12-12 21:34:023318</div>
Junio C Hamano9629d4f2012-12-19 00:28:273319</div>
3320<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:313321<h2 id="_git">GIT</h2>
Junio C Hamano1a4e8412005-12-27 08:17:233322<div class="sectionbody">
Junio C Hamanoa28a9202012-06-21 07:08:233323<div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:233324</div>
Junio C Hamano7bd050f2011-09-22 06:32:223325</div>
Junio C Hamano9629d4f2012-12-19 00:28:273326</div>
Junio C Hamano7bd050f2011-09-22 06:32:223327<div id="footnotes"><hr /></div>
Junio C Hamano1a4e8412005-12-27 08:17:233328<div id="footer">
3329<div id="footer-text">
Junio C Hamano2ef0ba32018-01-26 23:13:533330Last updated
3331 2018-01-26 15:11:04 PST
Junio C Hamano1a4e8412005-12-27 08:17:233332</div>
3333</div>
3334</body>
3335</html>