blob: 15c0b8795bcdd5e2c29f229180628ebcd875084a [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>
815 Generate the 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 Hamano5a73f302011-10-14 05:58:34828--minimal
829</dt>
830<dd>
831<p>
832 Spend extra time to make sure the smallest possible
833 diff is produced.
834</p>
835</dd>
836<dt class="hdlist1">
Junio C Hamano20d47e32009-01-26 06:36:02837--patience
838</dt>
839<dd>
840<p>
841 Generate a diff using the "patience diff" algorithm.
842</p>
843</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59844<dt class="hdlist1">
Junio C Hamanoaea9e6b2012-03-07 00:17:11845--histogram
846</dt>
847<dd>
848<p>
849 Generate a diff using the "histogram diff" algorithm.
850</p>
851</dd>
852<dt class="hdlist1">
Junio C Hamano80ad00d2013-02-18 00:19:03853--diff-algorithm={patience|minimal|histogram|myers}
854</dt>
855<dd>
856<p>
857 Choose a diff algorithm. The variants are as follows:
858</p>
859<div class="openblock">
860<div class="content">
861<div class="dlist"><dl>
862<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:51863<code>default</code>, <code>myers</code>
Junio C Hamano80ad00d2013-02-18 00:19:03864</dt>
865<dd>
866<p>
867 The basic greedy diff algorithm. Currently, this is the default.
868</p>
869</dd>
870<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:51871<code>minimal</code>
Junio C Hamano80ad00d2013-02-18 00:19:03872</dt>
873<dd>
874<p>
875 Spend extra time to make sure the smallest possible diff is
876 produced.
877</p>
878</dd>
879<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:51880<code>patience</code>
Junio C Hamano80ad00d2013-02-18 00:19:03881</dt>
882<dd>
883<p>
884 Use "patience diff" algorithm when generating patches.
885</p>
886</dd>
887<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:51888<code>histogram</code>
Junio C Hamano80ad00d2013-02-18 00:19:03889</dt>
890<dd>
891<p>
892 This algorithm extends the patience algorithm to "support
893 low-occurrence common elements".
894</p>
895</dd>
896</dl></div>
897</div></div>
898<div class="paragraph"><p>For instance, if you configured diff.algorithm variable to a
899non-default value and want to use the default one, then you
Junio C Hamanoac12f0e2014-09-19 22:32:51900have to use <code>--diff-algorithm=default</code> option.</p></div>
Junio C Hamano80ad00d2013-02-18 00:19:03901</dd>
902<dt class="hdlist1">
Junio C Hamano4c4b0122011-06-30 01:19:32903--stat[=&lt;width&gt;[,&lt;name-width&gt;[,&lt;count&gt;]]]
Junio C Hamanoba7c8d82006-04-15 06:17:42904</dt>
905<dd>
906<p>
Junio C Hamanoaea9e6b2012-03-07 00:17:11907 Generate a diffstat. By default, as much space as necessary
908 will be used for the filename part, and the rest for the graph
909 part. Maximum width defaults to terminal width, or 80 columns
Junio C Hamano7f2b3cb2012-06-22 22:42:39910 if not connected to a terminal, and can be overridden by
Junio C Hamanoac12f0e2014-09-19 22:32:51911 <code>&lt;width&gt;</code>. The width of the filename part can be limited by
912 giving another width <code>&lt;name-width&gt;</code> after a comma. The width
Junio C Hamanoaea9e6b2012-03-07 00:17:11913 of the graph part can be limited by using
Junio C Hamanoac12f0e2014-09-19 22:32:51914 <code>--stat-graph-width=&lt;width&gt;</code> (affects all commands generating
915 a stat graph) or by setting <code>diff.statGraphWidth=&lt;width&gt;</code>
916 (does not affect <code>git format-patch</code>).
917 By giving a third parameter <code>&lt;count&gt;</code>, you can limit the
918 output to the first <code>&lt;count&gt;</code> lines, followed by <code>...</code> if
Junio C Hamanoaea9e6b2012-03-07 00:17:11919 there are more.
Junio C Hamanoba7c8d82006-04-15 06:17:42920</p>
Junio C Hamanoac12f0e2014-09-19 22:32:51921<div class="paragraph"><p>These parameters can also be set individually with <code>--stat-width=&lt;width&gt;</code>,
922<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:42923</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59924<dt class="hdlist1">
Junio C Hamanofbe00522006-10-19 05:58:48925--numstat
926</dt>
927<dd>
928<p>
Junio C Hamanoac12f0e2014-09-19 22:32:51929 Similar to <code>--stat</code>, but shows number of added and
Junio C Hamanofbe00522006-10-19 05:58:48930 deleted lines in decimal notation and pathname without
Junio C Hamanod793de52006-12-26 09:11:43931 abbreviation, to make it more machine friendly. For
Junio C Hamanoac12f0e2014-09-19 22:32:51932 binary files, outputs two <code>-</code> instead of saying
933 <code>0 0</code>.
Junio C Hamanofbe00522006-10-19 05:58:48934</p>
935</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59936<dt class="hdlist1">
Junio C Hamano7d23f5e2006-12-16 07:44:04937--shortstat
938</dt>
939<dd>
940<p>
Junio C Hamanoac12f0e2014-09-19 22:32:51941 Output only the last line of the <code>--stat</code> format containing total
Junio C Hamano7d23f5e2006-12-16 07:44:04942 number of modified files, as well as number of added and deleted
943 lines.
944</p>
945</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59946<dt class="hdlist1">
Junio C Hamano1c222c52011-05-13 19:55:32947--dirstat[=&lt;param1,param2,&#8230;&gt;]
Junio C Hamano6a45be92008-04-22 08:19:03948</dt>
949<dd>
950<p>
Junio C Hamano1c222c52011-05-13 19:55:32951 Output the distribution of relative amount of changes for each
Junio C Hamanoac12f0e2014-09-19 22:32:51952 sub-directory. The behavior of <code>--dirstat</code> can be customized by
Junio C Hamano1c222c52011-05-13 19:55:32953 passing it a comma separated list of parameters.
Junio C Hamanoac12f0e2014-09-19 22:32:51954 The defaults are controlled by the <code>diff.dirstat</code> configuration
Junio C Hamanoa28a9202012-06-21 07:08:23955 variable (see <a href="git-config.html">git-config(1)</a>).
Junio C Hamano1c222c52011-05-13 19:55:32956 The following parameters are available:
Junio C Hamano6a45be92008-04-22 08:19:03957</p>
Junio C Hamano9629d4f2012-12-19 00:28:27958<div class="openblock">
959<div class="content">
Junio C Hamano1c222c52011-05-13 19:55:32960<div class="dlist"><dl>
961<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:51962<code>changes</code>
Junio C Hamano1c222c52011-05-13 19:55:32963</dt>
964<dd>
965<p>
966 Compute the dirstat numbers by counting the lines that have been
967 removed from the source, or added to the destination. This ignores
968 the amount of pure code movements within a file. In other words,
969 rearranging lines in a file is not counted as much as other changes.
970 This is the default behavior when no parameter is given.
971</p>
Junio C Hamano6a45be92008-04-22 08:19:03972</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59973<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:51974<code>lines</code>
Junio C Hamanoa476efa2008-10-10 15:31:42975</dt>
976<dd>
977<p>
Junio C Hamano1c222c52011-05-13 19:55:32978 Compute the dirstat numbers by doing the regular line-based diff
979 analysis, and summing the removed/added line counts. (For binary
980 files, count 64-byte chunks instead, since binary files have no
Junio C Hamanoac12f0e2014-09-19 22:32:51981 natural concept of lines). This is a more expensive <code>--dirstat</code>
982 behavior than the <code>changes</code> behavior, but it does count rearranged
Junio C Hamano1c222c52011-05-13 19:55:32983 lines within a file as much as other changes. The resulting output
Junio C Hamanoac12f0e2014-09-19 22:32:51984 is consistent with what you get from the other <code>--*stat</code> options.
Junio C Hamanoa476efa2008-10-10 15:31:42985</p>
986</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59987<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:51988<code>files</code>
Junio C Hamano1c222c52011-05-13 19:55:32989</dt>
990<dd>
991<p>
992 Compute the dirstat numbers by counting the number of files changed.
993 Each changed file counts equally in the dirstat analysis. This is
Junio C Hamanoac12f0e2014-09-19 22:32:51994 the computationally cheapest <code>--dirstat</code> behavior, since it does
Junio C Hamano1c222c52011-05-13 19:55:32995 not have to look at the file contents at all.
996</p>
997</dd>
998<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:51999<code>cumulative</code>
Junio C Hamano1c222c52011-05-13 19:55:321000</dt>
1001<dd>
1002<p>
1003 Count changes in a child directory for the parent directory as well.
Junio C Hamanoac12f0e2014-09-19 22:32:511004 Note that when using <code>cumulative</code>, the sum of the percentages
Junio C Hamano1c222c52011-05-13 19:55:321005 reported may exceed 100%. The default (non-cumulative) behavior can
Junio C Hamanoac12f0e2014-09-19 22:32:511006 be specified with the <code>noncumulative</code> parameter.
Junio C Hamano1c222c52011-05-13 19:55:321007</p>
1008</dd>
1009<dt class="hdlist1">
1010&lt;limit&gt;
1011</dt>
1012<dd>
1013<p>
1014 An integer parameter specifies a cut-off percent (3% by default).
1015 Directories contributing less than this percentage of the changes
1016 are not shown in the output.
1017</p>
1018</dd>
1019</dl></div>
Junio C Hamano9629d4f2012-12-19 00:28:271020</div></div>
Junio C Hamano1c222c52011-05-13 19:55:321021<div class="paragraph"><p>Example: The following will count changed files, while ignoring
1022directories with less than 10% of the total amount of changed files,
1023and accumulating child directory counts in the parent directories:
Junio C Hamanoac12f0e2014-09-19 22:32:511024<code>--dirstat=files,10,cumulative</code>.</p></div>
Junio C Hamano1c222c52011-05-13 19:55:321025</dd>
1026<dt class="hdlist1">
Junio C Hamano6959c6c2006-05-17 10:34:111027--summary
1028</dt>
1029<dd>
1030<p>
1031 Output a condensed summary of extended header information
1032 such as creations, renames and mode changes.
1033</p>
1034</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591035<dt class="hdlist1">
Junio C Hamanod1308c92006-04-16 11:01:091036--patch-with-stat
1037</dt>
1038<dd>
1039<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511040 Synonym for <code>-p --stat</code>.
Junio C Hamanod1308c92006-04-16 11:01:091041</p>
1042</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591043<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231044-z
1045</dt>
1046<dd>
1047<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511048 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:341049 given, do not munge pathnames and use NULs as output field terminators.
Junio C Hamano1a4e8412005-12-27 08:17:231050</p>
Junio C Hamano68cf15a2010-11-06 01:01:591051<div class="paragraph"><p>Without this option, each pathname output will have TAB, LF, double quotes,
Junio C Hamanoac12f0e2014-09-19 22:32:511052and backslash characters replaced with <code>\t</code>, <code>\n</code>, <code>\"</code>, and <code>\\</code>,
Junio C Hamano5706e0b2009-11-24 10:54:161053respectively, and the pathname will be enclosed in double quotes if
1054any of those replacements occurred.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231055</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591056<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231057--name-only
1058</dt>
1059<dd>
1060<p>
1061 Show only names of changed files.
1062</p>
1063</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591064<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231065--name-status
1066</dt>
1067<dd>
1068<p>
Junio C Hamanoa9aee782008-04-23 16:09:201069 Show only names and status of changed files. See the description
Junio C Hamanoac12f0e2014-09-19 22:32:511070 of the <code>--diff-filter</code> option on what the status letters mean.
Junio C Hamano1a4e8412005-12-27 08:17:231071</p>
1072</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591073<dt class="hdlist1">
Junio C Hamanoc21ab052009-10-31 04:03:551074--submodule[=&lt;format&gt;]
1075</dt>
1076<dd>
1077<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511078 Specify how differences in submodules are shown. When <code>--submodule</code>
1079 or <code>--submodule=log</code> is given, the <em>log</em> format is used. This format lists
1080 the commits in the range like <a href="git-submodule.html">git-submodule(1)</a> <code>summary</code> does.
1081 Omitting the <code>--submodule</code> option or specifying <code>--submodule=short</code>,
Junio C Hamanoe768cc12012-03-16 05:43:051082 uses the <em>short</em> format. This format just shows the names of the commits
Junio C Hamanob4e58b12012-11-26 03:13:061083 at the beginning and end of the range. Can be tweaked via the
Junio C Hamanoac12f0e2014-09-19 22:32:511084 <code>diff.submodule</code> configuration variable.
Junio C Hamanoc21ab052009-10-31 04:03:551085</p>
1086</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591087<dt class="hdlist1">
Junio C Hamano4aa0bcc2010-03-03 05:13:121088--color[=&lt;when&gt;]
Junio C Hamano9ae1a062006-07-10 08:12:341089</dt>
1090<dd>
1091<p>
1092 Show colored diff.
Junio C Hamanoac12f0e2014-09-19 22:32:511093 <code>--color</code> (i.e. without <em>=&lt;when&gt;</em>) is the same as <code>--color=always</code>.
1094 <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:341095</p>
1096</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591097<dt class="hdlist1">
Junio C Hamano9ae1a062006-07-10 08:12:341098--no-color
1099</dt>
1100<dd>
1101<p>
Junio C Hamano5f2627d2011-05-06 20:23:481102 Turn off colored diff.
Junio C Hamanoac12f0e2014-09-19 22:32:511103 It is the same as <code>--color=never</code>.
Junio C Hamano9ae1a062006-07-10 08:12:341104</p>
1105</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591106<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531107--word-diff[=&lt;mode&gt;]
Junio C Hamano85e45fa2006-08-13 07:47:411108</dt>
1109<dd>
1110<p>
Junio C Hamanocc7636a2010-05-21 14:57:531111 Show a word diff, using the &lt;mode&gt; to delimit changed words.
1112 By default, words are delimited by whitespace; see
Junio C Hamanoac12f0e2014-09-19 22:32:511113 <code>--word-diff-regex</code> below. The &lt;mode&gt; defaults to <em>plain</em>, and
Junio C Hamanocc7636a2010-05-21 14:57:531114 must be one of:
Junio C Hamano85e45fa2006-08-13 07:47:411115</p>
Junio C Hamano9629d4f2012-12-19 00:28:271116<div class="openblock">
1117<div class="content">
Junio C Hamano68cf15a2010-11-06 01:01:591118<div class="dlist"><dl>
1119<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531120color
1121</dt>
1122<dd>
1123<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511124 Highlight changed words using only colors. Implies <code>--color</code>.
Junio C Hamanocc7636a2010-05-21 14:57:531125</p>
1126</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591127<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531128plain
1129</dt>
1130<dd>
1131<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511132 Show words as <code>[-removed-]</code> and <code>{+added+}</code>. Makes no
Junio C Hamanocc7636a2010-05-21 14:57:531133 attempts to escape the delimiters if they appear in the input,
1134 so the output may be ambiguous.
1135</p>
1136</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591137<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531138porcelain
1139</dt>
1140<dd>
1141<p>
1142 Use a special line-based format intended for script
1143 consumption. Added/removed/unchanged runs are printed in the
Junio C Hamanoac12f0e2014-09-19 22:32:511144 usual unified diff format, starting with a <code>+</code>/<code>-</code>/` `
Junio C Hamanocc7636a2010-05-21 14:57:531145 character at the beginning of the line and extending to the
1146 end of the line. Newlines in the input are represented by a
Junio C Hamanoac12f0e2014-09-19 22:32:511147 tilde <code>~</code> on a line of its own.
Junio C Hamanocc7636a2010-05-21 14:57:531148</p>
1149</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591150<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531151none
1152</dt>
1153<dd>
1154<p>
1155 Disable word diff again.
1156</p>
1157</dd>
1158</dl></div>
Junio C Hamano9629d4f2012-12-19 00:28:271159</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591160<div class="paragraph"><p>Note that despite the name of the first mode, color is used to
Junio C Hamanocc7636a2010-05-21 14:57:531161highlight the changed parts in all modes if enabled.</p></div>
1162</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591163<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531164--word-diff-regex=&lt;regex&gt;
1165</dt>
1166<dd>
1167<p>
1168 Use &lt;regex&gt; to decide what a word is, instead of considering
1169 runs of non-whitespace to be a word. Also implies
Junio C Hamanoac12f0e2014-09-19 22:32:511170 <code>--word-diff</code> unless it was already enabled.
Junio C Hamanocc7636a2010-05-21 14:57:531171</p>
Junio C Hamano68cf15a2010-11-06 01:01:591172<div class="paragraph"><p>Every non-overlapping match of the
Junio C Hamano20d47e32009-01-26 06:36:021173&lt;regex&gt; is considered a word. Anything between these matches is
1174considered whitespace and ignored(!) for the purposes of finding
Junio C Hamanoac12f0e2014-09-19 22:32:511175differences. You may want to append <code>|[^[:space:]]</code> to your regular
Junio C Hamano20d47e32009-01-26 06:36:021176expression to make sure that it matches all non-whitespace characters.
1177A match that contains a newline is silently truncated(!) at the
1178newline.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591179<div class="paragraph"><p>The regex can also be set via a diff driver or configuration option, see
Junio C Hamanoa28a9202012-06-21 07:08:231180<a href="gitattributes.html">gitattributes(1)</a> or <a href="git-config.html">git-config(1)</a>. Giving it explicitly
Junio C Hamano20d47e32009-01-26 06:36:021181overrides any diff driver or configuration setting. Diff drivers
1182override configuration settings.</p></div>
Junio C Hamano85e45fa2006-08-13 07:47:411183</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591184<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531185--color-words[=&lt;regex&gt;]
1186</dt>
1187<dd>
1188<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511189 Equivalent to <code>--word-diff=color</code> plus (if a regex was
1190 specified) <code>--word-diff-regex=&lt;regex&gt;</code>.
Junio C Hamanocc7636a2010-05-21 14:57:531191</p>
1192</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591193<dt class="hdlist1">
Junio C Hamano9ae1a062006-07-10 08:12:341194--no-renames
1195</dt>
1196<dd>
1197<p>
1198 Turn off rename detection, even when the configuration
1199 file gives the default to do so.
1200</p>
1201</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591202<dt class="hdlist1">
Junio C Hamanoa890c4f2007-01-28 10:29:211203--check
1204</dt>
1205<dd>
1206<p>
Junio C Hamano6005bfa2011-06-23 00:51:221207 Warn if changes introduce whitespace errors. What are
Junio C Hamanoac12f0e2014-09-19 22:32:511208 considered whitespace errors is controlled by <code>core.whitespace</code>
Junio C Hamano6005bfa2011-06-23 00:51:221209 configuration. By default, trailing whitespaces (including
1210 lines that solely consist of whitespaces) and a space character
1211 that is immediately followed by a tab character inside the
1212 initial indent of the line are considered whitespace errors.
1213 Exits with non-zero status if problems are found. Not compatible
1214 with --exit-code.
Junio C Hamanoa890c4f2007-01-28 10:29:211215</p>
1216</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591217<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231218--full-index
1219</dt>
1220<dd>
1221<p>
Junio C Hamano5cf43ca2008-08-20 09:14:141222 Instead of the first handful of characters, show the full
1223 pre- and post-image blob object names on the "index"
1224 line when generating patch format output.
Junio C Hamano1a4e8412005-12-27 08:17:231225</p>
1226</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591227<dt class="hdlist1">
Junio C Hamano9ae1a062006-07-10 08:12:341228--binary
1229</dt>
1230<dd>
1231<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511232 In addition to <code>--full-index</code>, output a binary diff that
1233 can be applied with <code>git-apply</code>.
Junio C Hamano9ae1a062006-07-10 08:12:341234</p>
1235</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591236<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231237--abbrev[=&lt;n&gt;]
1238</dt>
1239<dd>
1240<p>
1241 Instead of showing the full 40-byte hexadecimal object
1242 name in diff-raw format output and diff-tree header
Junio C Hamano6efe3022009-01-13 16:47:561243 lines, show only a partial prefix. This is
Junio C Hamanoac12f0e2014-09-19 22:32:511244 independent of the <code>--full-index</code> option above, which controls
Junio C Hamano1a4e8412005-12-27 08:17:231245 the diff-patch output format. Non default number of
Junio C Hamanoac12f0e2014-09-19 22:32:511246 digits can be specified with <code>--abbrev=&lt;n&gt;</code>.
Junio C Hamano1a4e8412005-12-27 08:17:231247</p>
1248</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591249<dt class="hdlist1">
Junio C Hamanoe85e36f2010-08-10 05:30:141250-B[&lt;n&gt;][/&lt;m&gt;]
Junio C Hamano1a4e8412005-12-27 08:17:231251</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591252<dt class="hdlist1">
Junio C Hamano39c7a692010-10-27 06:08:541253--break-rewrites[=[&lt;n&gt;][/&lt;m&gt;]]
1254</dt>
Junio C Hamano1a4e8412005-12-27 08:17:231255<dd>
1256<p>
Junio C Hamanoe85e36f2010-08-10 05:30:141257 Break complete rewrite changes into pairs of delete and
1258 create. This serves two purposes:
Junio C Hamano1a4e8412005-12-27 08:17:231259</p>
Junio C Hamano68cf15a2010-11-06 01:01:591260<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:141261not as a series of deletion and insertion mixed together with a very
1262few lines that happen to match textually as the context, but as a
1263single deletion of everything old followed by a single insertion of
Junio C Hamanoac12f0e2014-09-19 22:32:511264everything new, and the number <code>m</code> controls this aspect of the -B
1265option (defaults to 60%). <code>-B/70%</code> specifies that less than 30% of the
Junio C Hamano076ffcc2013-02-06 05:13:211266original should remain in the result for Git to consider it a total
Junio C Hamanoe85e36f2010-08-10 05:30:141267rewrite (i.e. otherwise the resulting patch will be a series of
1268deletion and insertion mixed together with context lines).</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591269<div class="paragraph"><p>When used with -M, a totally-rewritten file is also considered as the
Junio C Hamanoe85e36f2010-08-10 05:30:141270source of a rename (usually -M only considers a file that disappeared
Junio C Hamanoac12f0e2014-09-19 22:32:511271as the source of a rename), and the number <code>n</code> controls this aspect of
1272the -B option (defaults to 50%). <code>-B20%</code> specifies that a change with
Junio C Hamano68cf15a2010-11-06 01:01:591273addition and deletion compared to 20% or more of the file&#8217;s size are
Junio C Hamanoe85e36f2010-08-10 05:30:141274eligible for being picked up as a possible source of a rename to
1275another file.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231276</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591277<dt class="hdlist1">
Junio C Hamanoe85e36f2010-08-10 05:30:141278-M[&lt;n&gt;]
Junio C Hamano1a4e8412005-12-27 08:17:231279</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591280<dt class="hdlist1">
Junio C Hamano0d75e872010-12-17 06:57:261281--find-renames[=&lt;n&gt;]
Junio C Hamano39c7a692010-10-27 06:08:541282</dt>
Junio C Hamano1a4e8412005-12-27 08:17:231283<dd>
1284<p>
1285 Detect renames.
Junio C Hamanoac12f0e2014-09-19 22:32:511286 If <code>n</code> is specified, it is a threshold on the similarity
Junio C Hamanoe85e36f2010-08-10 05:30:141287 index (i.e. amount of addition/deletions compared to the
Junio C Hamanoac12f0e2014-09-19 22:32:511288 file&#8217;s size). For example, <code>-M90%</code> means Git should consider a
Junio C Hamanoe85e36f2010-08-10 05:30:141289 delete/add pair to be a rename if more than 90% of the file
Junio C Hamanoac12f0e2014-09-19 22:32:511290 hasn&#8217;t changed. Without a <code>%</code> sign, the number is to be read as
1291 a fraction, with a decimal point before it. I.e., <code>-M5</code> becomes
1292 0.5, and is thus the same as <code>-M50%</code>. Similarly, <code>-M05</code> is
1293 the same as <code>-M5%</code>. To limit detection to exact renames, use
1294 <code>-M100%</code>. The default similarity index is 50%.
Junio C Hamano1a4e8412005-12-27 08:17:231295</p>
1296</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591297<dt class="hdlist1">
Junio C Hamanoe85e36f2010-08-10 05:30:141298-C[&lt;n&gt;]
Junio C Hamano1a4e8412005-12-27 08:17:231299</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591300<dt class="hdlist1">
Junio C Hamano0d75e872010-12-17 06:57:261301--find-copies[=&lt;n&gt;]
Junio C Hamano39c7a692010-10-27 06:08:541302</dt>
Junio C Hamano1a4e8412005-12-27 08:17:231303<dd>
1304<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511305 Detect copies as well as renames. See also <code>--find-copies-harder</code>.
1306 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:231307</p>
1308</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591309<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231310--find-copies-harder
1311</dt>
1312<dd>
1313<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511314 For performance reasons, by default, <code>-C</code> option finds copies only
Junio C Hamano1a4e8412005-12-27 08:17:231315 if the original file of the copy was modified in the same
1316 changeset. This flag makes the command
1317 inspect unmodified files as candidates for the source of
1318 copy. This is a very expensive operation for large
Junio C Hamano16f98872007-06-12 16:09:141319 projects, so use it with caution. Giving more than one
Junio C Hamanoac12f0e2014-09-19 22:32:511320 <code>-C</code> option has the same effect.
Junio C Hamano1a4e8412005-12-27 08:17:231321</p>
1322</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591323<dt class="hdlist1">
Junio C Hamanob02377c2011-04-28 22:26:021324-D
1325</dt>
1326<dt class="hdlist1">
1327--irreversible-delete
1328</dt>
1329<dd>
1330<p>
1331 Omit the preimage for deletes, i.e. print only the header but not
Junio C Hamanoac12f0e2014-09-19 22:32:511332 the diff between the preimage and <code>/dev/null</code>. The resulting patch
1333 is not meant to be applied with <code>patch</code> or <code>git apply</code>; this is
Junio C Hamanob02377c2011-04-28 22:26:021334 solely for people who want to just concentrate on reviewing the
1335 text after the change. In addition, the output obviously lack
1336 enough information to apply such a patch in reverse, even manually,
1337 hence the name of the option.
1338</p>
Junio C Hamanoac12f0e2014-09-19 22:32:511339<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:021340of a delete/create pair.</p></div>
1341</dd>
1342<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231343-l&lt;num&gt;
1344</dt>
1345<dd>
1346<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511347 The <code>-M</code> and <code>-C</code> options require O(n^2) processing time where n
Junio C Hamano1a4e8412005-12-27 08:17:231348 is the number of potential rename/copy targets. This
1349 option prevents rename/copy detection from running if
1350 the number of rename/copy targets exceeds the specified
1351 number.
1352</p>
1353</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591354<dt class="hdlist1">
Junio C Hamano982eb112010-11-18 00:53:091355--diff-filter=[(A|C|D|M|R|T|U|X|B)&#8230;[*]]
1356</dt>
1357<dd>
1358<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511359 Select only files that are Added (<code>A</code>), Copied (<code>C</code>),
1360 Deleted (<code>D</code>), Modified (<code>M</code>), Renamed (<code>R</code>), have their
1361 type (i.e. regular file, symlink, submodule, &#8230;) changed (<code>T</code>),
1362 are Unmerged (<code>U</code>), are
1363 Unknown (<code>X</code>), or have had their pairing Broken (<code>B</code>).
Junio C Hamano982eb112010-11-18 00:53:091364 Any combination of the filter characters (including none) can be used.
Junio C Hamanoac12f0e2014-09-19 22:32:511365 When <code>*</code> (All-or-none) is added to the combination, all
Junio C Hamano982eb112010-11-18 00:53:091366 paths are selected if there is any file that matches
1367 other criteria in the comparison; if there is no file
1368 that matches other criteria, nothing is selected.
1369</p>
1370</dd>
1371<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231372-S&lt;string&gt;
1373</dt>
1374<dd>
1375<p>
Junio C Hamanof1f5a7b2013-06-11 22:23:521376 Look for differences that change the number of occurrences of
1377 the specified string (i.e. addition/deletion) in a file.
1378 Intended for the scripter&#8217;s use.
Junio C Hamano1a4e8412005-12-27 08:17:231379</p>
Junio C Hamanof1f5a7b2013-06-11 22:23:521380<div class="paragraph"><p>It is useful when you&#8217;re looking for an exact block of code (like a
1381struct), and want to know the history of that block since it first
1382came into being: use the feature iteratively to feed the interesting
Junio C Hamanoac12f0e2014-09-19 22:32:511383block in the preimage back into <code>-S</code>, and keep going until you get the
Junio C Hamanof1f5a7b2013-06-11 22:23:521384very first version of the block.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231385</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591386<dt class="hdlist1">
Junio C Hamano3b4609d2010-09-30 00:04:341387-G&lt;regex&gt;
1388</dt>
1389<dd>
1390<p>
Junio C Hamanof1f5a7b2013-06-11 22:23:521391 Look for differences whose patch text contains added/removed
1392 lines that match &lt;regex&gt;.
Junio C Hamano3b4609d2010-09-30 00:04:341393</p>
Junio C Hamanoac12f0e2014-09-19 22:32:511394<div class="paragraph"><p>To illustrate the difference between <code>-S&lt;regex&gt; --pickaxe-regex</code> and
1395<code>-G&lt;regex&gt;</code>, consider a commit with the following diff in the same
Junio C Hamanof1f5a7b2013-06-11 22:23:521396file:</p></div>
1397<div class="listingblock">
1398<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:511399<pre><code>+ return !regexec(regexp, two-&gt;ptr, 1, &amp;regmatch, 0);
Junio C Hamanof1f5a7b2013-06-11 22:23:521400...
Junio C Hamanoac12f0e2014-09-19 22:32:511401- hit = !regexec(regexp, mf2.ptr, 1, &amp;regmatch, 0);</code></pre>
Junio C Hamanof1f5a7b2013-06-11 22:23:521402</div></div>
Junio C Hamanoac12f0e2014-09-19 22:32:511403<div class="paragraph"><p>While <code>git log -G"regexec\(regexp"</code> will show this commit, <code>git log
1404-S"regexec\(regexp" --pickaxe-regex</code> will not (because the number of
Junio C Hamanof1f5a7b2013-06-11 22:23:521405occurrences of that string did not change).</p></div>
1406<div class="paragraph"><p>See the <em>pickaxe</em> entry in <a href="gitdiffcore.html">gitdiffcore(7)</a> for more
1407information.</p></div>
Junio C Hamano3b4609d2010-09-30 00:04:341408</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591409<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231410--pickaxe-all
1411</dt>
1412<dd>
1413<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511414 When <code>-S</code> or <code>-G</code> finds a change, show all the changes in that
Junio C Hamano1a4e8412005-12-27 08:17:231415 changeset, not just the files that contain the change
1416 in &lt;string&gt;.
1417</p>
1418</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591419<dt class="hdlist1">
Junio C Hamanobfe9e752006-04-05 21:43:281420--pickaxe-regex
1421</dt>
1422<dd>
1423<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511424 Treat the &lt;string&gt; given to <code>-S</code> as an extended POSIX regular
Junio C Hamanof1f5a7b2013-06-11 22:23:521425 expression to match.
Junio C Hamanobfe9e752006-04-05 21:43:281426</p>
1427</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591428<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231429-O&lt;orderfile&gt;
1430</dt>
1431<dd>
1432<p>
1433 Output the patch in the order specified in the
1434 &lt;orderfile&gt;, which has one shell glob pattern per line.
Junio C Hamano322c6242015-03-23 21:32:461435 This overrides the <code>diff.orderFile</code> configuration variable
1436 (see <a href="git-config.html">git-config(1)</a>). To cancel <code>diff.orderFile</code>,
Junio C Hamanoac12f0e2014-09-19 22:32:511437 use <code>-O/dev/null</code>.
Junio C Hamano1a4e8412005-12-27 08:17:231438</p>
1439</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591440<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231441-R
1442</dt>
1443<dd>
1444<p>
1445 Swap two inputs; that is, show differences from index or
1446 on-disk file to tree contents.
1447</p>
1448</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591449<dt class="hdlist1">
Junio C Hamano24bc09a2008-02-28 00:27:441450--relative[=&lt;path&gt;]
1451</dt>
1452<dd>
1453<p>
1454 When run from a subdirectory of the project, it can be
1455 told to exclude changes outside the directory and show
1456 pathnames relative to it with this option. When you are
1457 not in a subdirectory (e.g. in a bare repository), you
1458 can name which subdirectory to make the output relative
1459 to by giving a &lt;path&gt; as an argument.
1460</p>
1461</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591462<dt class="hdlist1">
Junio C Hamanobbbb8652008-12-29 10:34:221463-a
1464</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591465<dt class="hdlist1">
Junio C Hamanoc26f5482006-07-09 09:38:141466--text
1467</dt>
1468<dd>
1469<p>
1470 Treat all files as text.
1471</p>
1472</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591473<dt class="hdlist1">
Junio C Hamanofd468962007-02-14 23:45:041474--ignore-space-at-eol
1475</dt>
1476<dd>
1477<p>
Junio C Hamano3a702342007-12-12 21:34:021478 Ignore changes in whitespace at EOL.
Junio C Hamanofd468962007-02-14 23:45:041479</p>
1480</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591481<dt class="hdlist1">
Junio C Hamanobbbb8652008-12-29 10:34:221482-b
1483</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591484<dt class="hdlist1">
Junio C Hamanod9c2d2f2006-12-06 08:59:071485--ignore-space-change
1486</dt>
1487<dd>
1488<p>
Junio C Hamano3a702342007-12-12 21:34:021489 Ignore changes in amount of whitespace. This ignores whitespace
1490 at line end, and considers all other sequences of one or
1491 more whitespace characters to be equivalent.
Junio C Hamanod9c2d2f2006-12-06 08:59:071492</p>
1493</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591494<dt class="hdlist1">
Junio C Hamanobbbb8652008-12-29 10:34:221495-w
Junio C Hamanod9c2d2f2006-12-06 08:59:071496</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591497<dt class="hdlist1">
Junio C Hamanod9c2d2f2006-12-06 08:59:071498--ignore-all-space
1499</dt>
1500<dd>
1501<p>
Junio C Hamano3a702342007-12-12 21:34:021502 Ignore whitespace when comparing lines. This ignores
1503 differences even if one line has whitespace where the other
Junio C Hamanod9c2d2f2006-12-06 08:59:071504 line has none.
1505</p>
1506</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591507<dt class="hdlist1">
Junio C Hamanoa1952302013-07-01 21:31:181508--ignore-blank-lines
1509</dt>
1510<dd>
1511<p>
1512 Ignore changes whose lines are all blank.
1513</p>
1514</dd>
1515<dt class="hdlist1">
Junio C Hamano1d40ee82009-01-07 10:14:161516--inter-hunk-context=&lt;lines&gt;
1517</dt>
1518<dd>
1519<p>
1520 Show the context between diff hunks, up to the specified number
1521 of lines, thereby fusing hunks that are close to each other.
1522</p>
1523</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591524<dt class="hdlist1">
Junio C Hamano11821ed2011-10-19 18:42:091525-W
1526</dt>
1527<dt class="hdlist1">
1528--function-context
1529</dt>
1530<dd>
1531<p>
1532 Show whole surrounding functions of changes.
1533</p>
1534</dd>
1535<dt class="hdlist1">
Junio C Hamano48fd2f62007-03-19 02:02:301536--exit-code
1537</dt>
1538<dd>
1539<p>
1540 Make the program exit with codes similar to diff(1).
1541 That is, it exits with 1 if there were differences and
1542 0 means no differences.
1543</p>
1544</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591545<dt class="hdlist1">
Junio C Hamano35e57552007-03-25 07:54:351546--quiet
1547</dt>
1548<dd>
1549<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511550 Disable all output of the program. Implies <code>--exit-code</code>.
Junio C Hamano35e57552007-03-25 07:54:351551</p>
1552</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591553<dt class="hdlist1">
Junio C Hamanobb0f4042007-07-04 06:41:401554--ext-diff
1555</dt>
1556<dd>
1557<p>
1558 Allow an external diff helper to be executed. If you set an
Junio C Hamanoa28a9202012-06-21 07:08:231559 external diff driver with <a href="gitattributes.html">gitattributes(5)</a>, you need
1560 to use this option with <a href="git-log.html">git-log(1)</a> and friends.
Junio C Hamanobb0f4042007-07-04 06:41:401561</p>
1562</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591563<dt class="hdlist1">
Junio C Hamanobb0f4042007-07-04 06:41:401564--no-ext-diff
1565</dt>
1566<dd>
1567<p>
1568 Disallow external diff drivers.
1569</p>
1570</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591571<dt class="hdlist1">
Junio C Hamanoc652aed2011-07-07 01:14:311572--textconv
1573</dt>
1574<dt class="hdlist1">
1575--no-textconv
1576</dt>
1577<dd>
1578<p>
1579 Allow (or disallow) external text conversion filters to be run
Junio C Hamanoa28a9202012-06-21 07:08:231580 when comparing binary files. See <a href="gitattributes.html">gitattributes(5)</a> for
Junio C Hamanoc652aed2011-07-07 01:14:311581 details. Because textconv filters are typically a one-way
1582 conversion, the resulting diff is suitable for human
1583 consumption, but cannot be applied. For this reason, textconv
Junio C Hamanoa28a9202012-06-21 07:08:231584 filters are enabled by default only for <a href="git-diff.html">git-diff(1)</a> and
1585 <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:311586 diff plumbing commands.
1587</p>
1588</dd>
1589<dt class="hdlist1">
Junio C Hamano7d449522010-07-01 00:08:511590--ignore-submodules[=&lt;when&gt;]
Junio C Hamanodfccbb02008-05-26 01:16:141591</dt>
1592<dd>
1593<p>
Junio C Hamano7d449522010-07-01 00:08:511594 Ignore changes to submodules in the diff generation. &lt;when&gt; can be
Junio C Hamanoc7102962013-05-29 23:57:171595 either "none", "untracked", "dirty" or "all", which is the default.
Junio C Hamano619596a2010-08-18 22:15:351596 Using "none" will consider the submodule modified when it either contains
1597 untracked or modified files or its HEAD differs from the commit recorded
1598 in the superproject and can be used to override any settings of the
Junio C Hamanoa28a9202012-06-21 07:08:231599 <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:511600 "untracked" is used submodules are not considered dirty when they only
1601 contain untracked content (but they are still scanned for modified
1602 content). Using "dirty" ignores all changes to the work tree of submodules,
1603 only changes to the commits stored in the superproject are shown (this was
1604 the behavior until 1.7.0). Using "all" hides all changes to submodules.
Junio C Hamanodfccbb02008-05-26 01:16:141605</p>
1606</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591607<dt class="hdlist1">
Junio C Hamanoe27cbd22007-12-21 17:57:331608--src-prefix=&lt;prefix&gt;
1609</dt>
1610<dd>
1611<p>
1612 Show the given source prefix instead of "a/".
1613</p>
1614</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591615<dt class="hdlist1">
Junio C Hamanoe27cbd22007-12-21 17:57:331616--dst-prefix=&lt;prefix&gt;
1617</dt>
1618<dd>
1619<p>
1620 Show the given destination prefix instead of "b/".
1621</p>
1622</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591623<dt class="hdlist1">
Junio C Hamanoe27cbd22007-12-21 17:57:331624--no-prefix
1625</dt>
1626<dd>
1627<p>
1628 Do not show any source or destination prefix.
1629</p>
1630</dd>
Junio C Hamanoba4b9282008-07-06 05:20:311631</dl></div>
Junio C Hamano68cf15a2010-11-06 01:01:591632<div class="paragraph"><p>For more detailed explanation on these common options, see also
Junio C Hamanoa28a9202012-06-21 07:08:231633<a href="gitdiffcore.html">gitdiffcore(7)</a>.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591634<div class="dlist"><dl>
1635<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231636&lt;tree-ish&gt;
1637</dt>
1638<dd>
1639<p>
1640 The id of a tree object.
1641</p>
1642</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591643<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231644&lt;path&gt;&#8230;
1645</dt>
1646<dd>
1647<p>
1648 If provided, the results are limited to a subset of files
1649 matching one of these prefix strings.
Junio C Hamanoac12f0e2014-09-19 22:32:511650 i.e., file matches <code>/^&lt;pattern1&gt;|&lt;pattern2&gt;|.../</code>
Junio C Hamano1a4e8412005-12-27 08:17:231651 Note that this parameter does not provide any wildcard or regexp
1652 features.
1653</p>
1654</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591655<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231656-r
1657</dt>
1658<dd>
1659<p>
1660 recurse into sub-trees
1661</p>
1662</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591663<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231664-t
1665</dt>
1666<dd>
1667<p>
1668 show tree entry itself as well as subtrees. Implies -r.
1669</p>
1670</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591671<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231672--root
1673</dt>
1674<dd>
1675<p>
Junio C Hamano54bf1e22008-12-20 06:30:111676 When <em>--root</em> is specified the initial commit will be shown as a big
Junio C Hamano1a4e8412005-12-27 08:17:231677 creation event. This is equivalent to a diff against the NULL tree.
1678</p>
1679</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591680<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231681--stdin
1682</dt>
1683<dd>
1684<p>
1685 When <em>--stdin</em> is specified, the command does not take
1686 &lt;tree-ish&gt; arguments from the command line. Instead, it
Junio C Hamano3f2f6e52008-08-21 10:34:221687 reads lines containing either two &lt;tree&gt;, one &lt;commit&gt;, or a
1688 list of &lt;commit&gt; from its standard input. (Use a single space
1689 as separator.)
Junio C Hamano1a4e8412005-12-27 08:17:231690</p>
Junio C Hamano68cf15a2010-11-06 01:01:591691<div class="paragraph"><p>When two trees are given, it compares the first tree with the second.
Junio C Hamano3f2f6e52008-08-21 10:34:221692When a single commit is given, it compares the commit with its
1693parents. The remaining commits, when given, are used as if they are
Junio C Hamanob53db3c2008-08-07 00:17:521694parents of the first commit.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591695<div class="paragraph"><p>When comparing two trees, the ID of both trees (separated by a space
Junio C Hamano3f2f6e52008-08-21 10:34:221696and terminated by a newline) is printed before the difference. When
1697comparing commits, the ID of the first (or only) commit, followed by a
1698newline, is printed.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591699<div class="paragraph"><p>The following flags further affect the behavior when comparing
Junio C Hamano3f2f6e52008-08-21 10:34:221700commits (but not trees).</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231701</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591702<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231703-m
1704</dt>
1705<dd>
1706<p>
Junio C Hamano1aa40d22010-01-21 17:46:431707 By default, <em>git diff-tree --stdin</em> does not show
Junio C Hamano1a4e8412005-12-27 08:17:231708 differences for merge commits. With this flag, it shows
Junio C Hamanoa8adb1e2006-04-10 23:46:161709 differences to that commit from all of its parents. See
1710 also <em>-c</em>.
Junio C Hamano1a4e8412005-12-27 08:17:231711</p>
1712</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591713<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231714-s
1715</dt>
1716<dd>
1717<p>
Junio C Hamano1aa40d22010-01-21 17:46:431718 By default, <em>git diff-tree --stdin</em> shows differences,
Junio C Hamano1a4e8412005-12-27 08:17:231719 either in machine-readable form (without <em>-p</em>) or in patch
Junio C Hamano235a91e2006-01-07 01:13:581720 form (with <em>-p</em>). This output can be suppressed. It is
Junio C Hamano1a4e8412005-12-27 08:17:231721 only useful with <em>-v</em> flag.
1722</p>
1723</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591724<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231725-v
1726</dt>
1727<dd>
1728<p>
Junio C Hamano1aa40d22010-01-21 17:46:431729 This flag causes <em>git diff-tree --stdin</em> to also show
Junio C Hamano1a4e8412005-12-27 08:17:231730 the commit message before the differences.
1731</p>
1732</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591733<dt class="hdlist1">
Junio C Hamanod2179ef2010-10-22 04:12:171734--pretty[=&lt;format&gt;]
Junio C Hamano1a4e8412005-12-27 08:17:231735</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591736<dt class="hdlist1">
Junio C Hamanod2179ef2010-10-22 04:12:171737--format=&lt;format&gt;
Junio C Hamano0a235222009-03-06 08:21:091738</dt>
Junio C Hamano1a4e8412005-12-27 08:17:231739<dd>
1740<p>
Junio C Hamanoa3770f92007-07-25 08:53:331741 Pretty-print the contents of the commit logs in a given format,
Junio C Hamano0430e3a2007-05-15 03:13:171742 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:261743 <em>full</em>, <em>fuller</em>, <em>email</em>, <em>raw</em>, <em>format:&lt;string&gt;</em>
1744 and <em>tformat:&lt;string&gt;</em>. When <em>&lt;format&gt;</em> is none of the above,
1745 and has <em>%placeholder</em> in it, it acts as if
1746 <em>--pretty=tformat:&lt;format&gt;</em> were given.
Junio C Hamano1a4e8412005-12-27 08:17:231747</p>
Junio C Hamano6bb32e62015-02-17 22:11:261748<div class="paragraph"><p>See the "PRETTY FORMATS" section for some additional details for each
1749format. When <em>=&lt;format&gt;</em> part is omitted, it defaults to <em>medium</em>.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591750<div class="paragraph"><p>Note: you can specify the default pretty format in the repository
Junio C Hamanoa28a9202012-06-21 07:08:231751configuration (see <a href="git-config.html">git-config(1)</a>).</p></div>
Junio C Hamano0430e3a2007-05-15 03:13:171752</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591753<dt class="hdlist1">
Junio C Hamanoee695f22007-06-21 00:35:361754--abbrev-commit
1755</dt>
1756<dd>
1757<p>
1758 Instead of showing the full 40-byte hexadecimal commit object
Junio C Hamano6efe3022009-01-13 16:47:561759 name, show only a partial prefix. Non default number of
Junio C Hamanoee695f22007-06-21 00:35:361760 digits can be specified with "--abbrev=&lt;n&gt;" (which also modifies
1761 diff output, if it is displayed).
1762</p>
Junio C Hamano68cf15a2010-11-06 01:01:591763<div class="paragraph"><p>This should make "--pretty=oneline" a whole lot more readable for
Junio C Hamanoba4b9282008-07-06 05:20:311764people using 80-column terminals.</p></div>
Junio C Hamanoee695f22007-06-21 00:35:361765</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591766<dt class="hdlist1">
Junio C Hamanof93530e2011-05-25 23:59:591767--no-abbrev-commit
1768</dt>
1769<dd>
1770<p>
1771 Show the full 40-byte hexadecimal commit object name. This negates
Junio C Hamanoac12f0e2014-09-19 22:32:511772 <code>--abbrev-commit</code> and those options which imply it such as
Junio C Hamanof93530e2011-05-25 23:59:591773 "--oneline". It also overrides the <em>log.abbrevCommit</em> variable.
1774</p>
1775</dd>
1776<dt class="hdlist1">
Junio C Hamano0a235222009-03-06 08:21:091777--oneline
1778</dt>
1779<dd>
1780<p>
1781 This is a shorthand for "--pretty=oneline --abbrev-commit"
1782 used together.
1783</p>
1784</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591785<dt class="hdlist1">
Junio C Hamanoc5bb3b32013-08-05 22:43:361786--encoding=&lt;encoding&gt;
Junio C Hamano0430e3a2007-05-15 03:13:171787</dt>
1788<dd>
1789<p>
1790 The commit objects record the encoding used for the log message
1791 in their encoding header; this option can be used to tell the
1792 command to re-code the commit log message in the encoding
1793 preferred by the user. For non plumbing commands this
1794 defaults to UTF-8.
1795</p>
1796</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591797<dt class="hdlist1">
Junio C Hamano60033462011-05-03 00:48:431798--notes[=&lt;ref&gt;]
Junio C Hamano57827fb2010-01-23 03:02:501799</dt>
1800<dd>
1801<p>
Junio C Hamanoa28a9202012-06-21 07:08:231802 Show the notes (see <a href="git-notes.html">git-notes(1)</a>) that annotate the
Junio C Hamano57827fb2010-01-23 03:02:501803 commit, when showing the commit log message. This is the default
Junio C Hamanoac12f0e2014-09-19 22:32:511804 for <code>git log</code>, <code>git show</code> and <code>git whatchanged</code> commands when
1805 there is no <code>--pretty</code>, <code>--format</code>, or <code>--oneline</code> option given
Junio C Hamano60033462011-05-03 00:48:431806 on the command line.
Junio C Hamano57827fb2010-01-23 03:02:501807</p>
Junio C Hamano60033462011-05-03 00:48:431808<div class="paragraph"><p>By default, the notes shown are from the notes refs listed in the
1809<em>core.notesRef</em> and <em>notes.displayRef</em> variables (or corresponding
Junio C Hamanoa28a9202012-06-21 07:08:231810environment overrides). See <a href="git-config.html">git-config(1)</a> for more details.</p></div>
Junio C Hamano60033462011-05-03 00:48:431811<div class="paragraph"><p>With an optional <em>&lt;ref&gt;</em> argument, show this notes ref instead of the
Junio C Hamanoac12f0e2014-09-19 22:32:511812default notes ref(s). The ref is taken to be in <code>refs/notes/</code> if it
Junio C Hamano60033462011-05-03 00:48:431813is not qualified.</p></div>
1814<div class="paragraph"><p>Multiple --notes options can be combined to control which notes are
1815being displayed. Examples: "--notes=foo" will show only notes from
1816"refs/notes/foo"; "--notes=foo --notes" will show both notes from
1817"refs/notes/foo" and from the default notes ref(s).</p></div>
Junio C Hamano31667362010-03-25 00:38:531818</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591819<dt class="hdlist1">
Junio C Hamano60033462011-05-03 00:48:431820--no-notes
1821</dt>
1822<dd>
1823<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511824 Do not show notes. This negates the above <code>--notes</code> option, by
Junio C Hamano60033462011-05-03 00:48:431825 resetting the list of notes refs from which notes are shown.
1826 Options are parsed in the order given on the command line, so e.g.
1827 "--notes --notes=foo --no-notes --notes=bar" will only show notes
1828 from "refs/notes/bar".
1829</p>
1830</dd>
1831<dt class="hdlist1">
1832--show-notes[=&lt;ref&gt;]
1833</dt>
1834<dt class="hdlist1">
Junio C Hamano31667362010-03-25 00:38:531835--[no-]standard-notes
1836</dt>
1837<dd>
1838<p>
Junio C Hamano60033462011-05-03 00:48:431839 These options are deprecated. Use the above --notes/--no-notes
1840 options instead.
Junio C Hamano31667362010-03-25 00:38:531841</p>
Junio C Hamano57827fb2010-01-23 03:02:501842</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591843<dt class="hdlist1">
Junio C Hamano0acb1ae2012-09-24 21:28:131844--show-signature
1845</dt>
1846<dd>
1847<p>
1848 Check the validity of a signed commit object by passing the signature
Junio C Hamanoac12f0e2014-09-19 22:32:511849 to <code>gpg --verify</code> and show the output.
Junio C Hamano0acb1ae2012-09-24 21:28:131850</p>
1851</dd>
1852<dt class="hdlist1">
Junio C Hamano0430e3a2007-05-15 03:13:171853--no-commit-id
1854</dt>
1855<dd>
1856<p>
Junio C Hamano1aa40d22010-01-21 17:46:431857 <em>git diff-tree</em> outputs a line with the commit ID when
Junio C Hamano0430e3a2007-05-15 03:13:171858 applicable. This flag suppressed the commit ID output.
1859</p>
1860</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591861<dt class="hdlist1">
Junio C Hamano0430e3a2007-05-15 03:13:171862-c
1863</dt>
1864<dd>
1865<p>
1866 This flag changes the way a merge commit is displayed
1867 (which means it is useful only when the command is given
1868 one &lt;tree-ish&gt;, or <em>--stdin</em>). It shows the differences
1869 from each of the parents to the merge result simultaneously
1870 instead of showing pairwise diff between a parent and the
1871 result one at a time (which is what the <em>-m</em> option does).
1872 Furthermore, it lists only files which were modified
1873 from all parents.
1874</p>
1875</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591876<dt class="hdlist1">
Junio C Hamano0430e3a2007-05-15 03:13:171877--cc
1878</dt>
1879<dd>
1880<p>
1881 This flag changes the way a merge commit patch is displayed,
1882 in a similar way to the <em>-c</em> option. It implies the <em>-c</em>
1883 and <em>-p</em> options and further compresses the patch output
Junio C Hamanoccc2f762008-07-24 04:03:331884 by omitting uninteresting hunks whose the contents in the parents
1885 have only two variants and the merge result picks one of them
1886 without modification. When all hunks are uninteresting, the commit
1887 itself and the commit log message is not shown, just like in any other
1888 "empty diff" case.
Junio C Hamano0430e3a2007-05-15 03:13:171889</p>
1890</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591891<dt class="hdlist1">
Junio C Hamano0430e3a2007-05-15 03:13:171892--always
1893</dt>
1894<dd>
1895<p>
1896 Show the commit itself and the commit log message even
1897 if the diff itself is empty.
1898</p>
1899</dd>
Junio C Hamanoba4b9282008-07-06 05:20:311900</dl></div>
Junio C Hamano0430e3a2007-05-15 03:13:171901</div>
Junio C Hamano9629d4f2012-12-19 00:28:271902</div>
1903<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:311904<h2 id="_pretty_formats">PRETTY FORMATS</h2>
Junio C Hamano0430e3a2007-05-15 03:13:171905<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:591906<div class="paragraph"><p>If the commit is a merge, and if the pretty-format
Junio C Hamano0430e3a2007-05-15 03:13:171907is not <em>oneline</em>, <em>email</em> or <em>raw</em>, an additional line is
1908inserted before the <em>Author:</em> line. This line begins with
1909"Merge: " and the sha1s of ancestral commits are printed,
1910separated by spaces. Note that the listed commits may not
1911necessarily be the list of the <strong>direct</strong> parent commits if you
1912have limited your view of history: for example, if you are
1913only interested in changes related to a certain directory or
Junio C Hamanoba4b9282008-07-06 05:20:311914file.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591915<div class="paragraph"><p>There are several built-in formats, and you can define
Junio C Hamanoa574a092010-06-13 19:57:101916additional formats by setting a pretty.&lt;name&gt;
1917config option to either another format name, or a
1918<em>format:</em> string, as described below (see
Junio C Hamanoa28a9202012-06-21 07:08:231919<a href="git-config.html">git-config(1)</a>). Here are the details of the
Junio C Hamanoa574a092010-06-13 19:57:101920built-in formats:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591921<div class="ulist"><ul>
Junio C Hamanoa340aaa2006-11-23 02:47:331922<li>
1923<p>
1924<em>oneline</em>
1925</p>
1926<div class="literalblock">
1927<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:511928<pre><code>&lt;sha1&gt; &lt;title line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:331929</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591930<div class="paragraph"><p>This is designed to be as compact as possible.</p></div>
Junio C Hamanoa340aaa2006-11-23 02:47:331931</li>
1932<li>
1933<p>
1934<em>short</em>
1935</p>
1936<div class="literalblock">
1937<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:511938<pre><code>commit &lt;sha1&gt;
1939Author: &lt;author&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:331940</div></div>
1941<div class="literalblock">
1942<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:511943<pre><code>&lt;title line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:331944</div></div>
1945</li>
1946<li>
1947<p>
1948<em>medium</em>
1949</p>
1950<div class="literalblock">
1951<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:511952<pre><code>commit &lt;sha1&gt;
Junio C Hamanoa340aaa2006-11-23 02:47:331953Author: &lt;author&gt;
Junio C Hamanoac12f0e2014-09-19 22:32:511954Date: &lt;author date&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:331955</div></div>
1956<div class="literalblock">
1957<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:511958<pre><code>&lt;title line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:331959</div></div>
1960<div class="literalblock">
1961<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:511962<pre><code>&lt;full commit message&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:331963</div></div>
1964</li>
1965<li>
1966<p>
1967<em>full</em>
1968</p>
1969<div class="literalblock">
1970<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:511971<pre><code>commit &lt;sha1&gt;
Junio C Hamanoa340aaa2006-11-23 02:47:331972Author: &lt;author&gt;
Junio C Hamanoac12f0e2014-09-19 22:32:511973Commit: &lt;committer&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:331974</div></div>
1975<div class="literalblock">
1976<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:511977<pre><code>&lt;title line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:331978</div></div>
1979<div class="literalblock">
1980<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:511981<pre><code>&lt;full commit message&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:331982</div></div>
1983</li>
1984<li>
1985<p>
1986<em>fuller</em>
1987</p>
1988<div class="literalblock">
1989<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:511990<pre><code>commit &lt;sha1&gt;
Junio C Hamano6a3c8272008-12-19 21:38:181991Author: &lt;author&gt;
Junio C Hamanoba4b9282008-07-06 05:20:311992AuthorDate: &lt;author date&gt;
Junio C Hamano6a3c8272008-12-19 21:38:181993Commit: &lt;committer&gt;
Junio C Hamanoac12f0e2014-09-19 22:32:511994CommitDate: &lt;committer date&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:331995</div></div>
1996<div class="literalblock">
1997<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:511998<pre><code>&lt;title line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:331999</div></div>
2000<div class="literalblock">
2001<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512002<pre><code>&lt;full commit message&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332003</div></div>
2004</li>
2005<li>
2006<p>
2007<em>email</em>
2008</p>
2009<div class="literalblock">
2010<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512011<pre><code>From &lt;sha1&gt; &lt;date&gt;
Junio C Hamanoa340aaa2006-11-23 02:47:332012From: &lt;author&gt;
Junio C Hamanoba4b9282008-07-06 05:20:312013Date: &lt;author date&gt;
Junio C Hamanoac12f0e2014-09-19 22:32:512014Subject: [PATCH] &lt;title line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332015</div></div>
2016<div class="literalblock">
2017<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512018<pre><code>&lt;full commit message&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332019</div></div>
2020</li>
2021<li>
2022<p>
2023<em>raw</em>
2024</p>
Junio C Hamano68cf15a2010-11-06 01:01:592025<div class="paragraph"><p>The <em>raw</em> format shows the entire commit exactly as
Junio C Hamanoe3f080d2013-04-22 02:27:132026stored in the commit object. Notably, the SHA-1s are
Junio C Hamanoa340aaa2006-11-23 02:47:332027displayed in full, regardless of whether --abbrev or
2028--no-abbrev are used, and <em>parents</em> information show the
Junio C Hamanod75148a2014-04-08 19:48:382029true parent commits, without taking grafts or history
Junio C Hamanoba4b9282008-07-06 05:20:312030simplification into account.</p></div>
Junio C Hamanoa340aaa2006-11-23 02:47:332031</li>
Junio C Hamanoa3fd83c2007-03-02 10:34:362032<li>
2033<p>
Junio C Hamanoe32ec8b2010-06-02 23:32:312034<em>format:&lt;string&gt;</em>
Junio C Hamanoa3fd83c2007-03-02 10:34:362035</p>
Junio C Hamano68cf15a2010-11-06 01:01:592036<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:362037you want to show. It works a little bit like printf format,
2038with the notable exception that you get a newline with <em>%n</em>
Junio C Hamanoba4b9282008-07-06 05:20:312039instead of <em>\n</em>.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592040<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:312041would show something like this:</p></div>
Junio C Hamano0430e3a2007-05-15 03:13:172042<div class="listingblock">
2043<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512044<pre><code>The author of fe6e0ee was Junio C Hamano, 23 hours ago
2045The 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:172046</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592047<div class="paragraph"><p>The placeholders are:</p></div>
2048<div class="ulist"><ul>
Junio C Hamanoa3fd83c2007-03-02 10:34:362049<li>
2050<p>
2051<em>%H</em>: commit hash
2052</p>
2053</li>
2054<li>
2055<p>
2056<em>%h</em>: abbreviated commit hash
2057</p>
2058</li>
2059<li>
2060<p>
2061<em>%T</em>: tree hash
2062</p>
2063</li>
2064<li>
2065<p>
2066<em>%t</em>: abbreviated tree hash
2067</p>
2068</li>
2069<li>
2070<p>
2071<em>%P</em>: parent hashes
2072</p>
2073</li>
2074<li>
2075<p>
2076<em>%p</em>: abbreviated parent hashes
2077</p>
2078</li>
2079<li>
2080<p>
2081<em>%an</em>: author name
2082</p>
2083</li>
2084<li>
2085<p>
Junio C Hamano04e768d2013-04-23 19:19:262086<em>%aN</em>: author name (respecting .mailmap, see <a href="git-shortlog.html">git-shortlog(1)</a>
2087 or <a href="git-blame.html">git-blame(1)</a>)
Junio C Hamanof5a93622008-07-16 03:23:572088</p>
2089</li>
2090<li>
2091<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:362092<em>%ae</em>: author email
2093</p>
2094</li>
2095<li>
2096<p>
Junio C Hamano04e768d2013-04-23 19:19:262097<em>%aE</em>: author email (respecting .mailmap, see
2098 <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:192099</p>
2100</li>
2101<li>
2102<p>
Junio C Hamanoa387df32008-08-29 08:56:582103<em>%ad</em>: author date (format respects --date= option)
Junio C Hamanoa3fd83c2007-03-02 10:34:362104</p>
2105</li>
2106<li>
2107<p>
2108<em>%aD</em>: author date, RFC2822 style
2109</p>
2110</li>
2111<li>
2112<p>
2113<em>%ar</em>: author date, relative
2114</p>
2115</li>
2116<li>
2117<p>
2118<em>%at</em>: author date, UNIX timestamp
2119</p>
2120</li>
2121<li>
2122<p>
Junio C Hamanoac12f0e2014-09-19 22:32:512123<em>%ai</em>: author date, ISO 8601-like format
2124</p>
2125</li>
2126<li>
2127<p>
2128<em>%aI</em>: author date, strict ISO 8601 format
Junio C Hamano02f130b2007-07-14 08:26:562129</p>
2130</li>
2131<li>
2132<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:362133<em>%cn</em>: committer name
2134</p>
2135</li>
2136<li>
2137<p>
Junio C Hamano04e768d2013-04-23 19:19:262138<em>%cN</em>: committer name (respecting .mailmap, see
2139 <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:572140</p>
2141</li>
2142<li>
2143<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:362144<em>%ce</em>: committer email
2145</p>
2146</li>
2147<li>
2148<p>
Junio C Hamano04e768d2013-04-23 19:19:262149<em>%cE</em>: committer email (respecting .mailmap, see
2150 <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:192151</p>
2152</li>
2153<li>
2154<p>
Junio C Hamano53fe0312014-09-09 21:16:172155<em>%cd</em>: committer date (format respects --date= option)
Junio C Hamanoa3fd83c2007-03-02 10:34:362156</p>
2157</li>
2158<li>
2159<p>
2160<em>%cD</em>: committer date, RFC2822 style
2161</p>
2162</li>
2163<li>
2164<p>
2165<em>%cr</em>: committer date, relative
2166</p>
2167</li>
2168<li>
2169<p>
2170<em>%ct</em>: committer date, UNIX timestamp
2171</p>
2172</li>
2173<li>
2174<p>
Junio C Hamanoac12f0e2014-09-19 22:32:512175<em>%ci</em>: committer date, ISO 8601-like format
2176</p>
2177</li>
2178<li>
2179<p>
2180<em>%cI</em>: committer date, strict ISO 8601 format
Junio C Hamano02f130b2007-07-14 08:26:562181</p>
2182</li>
2183<li>
2184<p>
Junio C Hamanoa28a9202012-06-21 07:08:232185<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:022186</p>
2187</li>
2188<li>
2189<p>
Junio C Hamano00b9f1a2014-09-29 23:11:282190<em>%D</em>: ref names without the " (", ")" wrapping.
2191</p>
2192</li>
2193<li>
2194<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:362195<em>%e</em>: encoding
2196</p>
2197</li>
2198<li>
2199<p>
2200<em>%s</em>: subject
2201</p>
2202</li>
2203<li>
2204<p>
Junio C Hamano5f9a6f02009-04-06 08:26:562205<em>%f</em>: sanitized subject line, suitable for a filename
2206</p>
2207</li>
2208<li>
2209<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:362210<em>%b</em>: body
2211</p>
2212</li>
2213<li>
2214<p>
Junio C Hamanocb39aea2010-05-09 07:24:482215<em>%B</em>: raw body (unwrapped subject and body)
2216</p>
2217</li>
2218<li>
2219<p>
Junio C Hamano3b70d3c2009-11-21 17:37:372220<em>%N</em>: commit notes
2221</p>
2222</li>
2223<li>
2224<p>
Junio C Hamano0acb1ae2012-09-24 21:28:132225<em>%GG</em>: raw verification message from GPG for a signed commit
2226</p>
2227</li>
2228<li>
2229<p>
Junio C Hamanoedf80bd2013-04-05 22:14:362230<em>%G?</em>: show "G" for a Good signature, "B" for a Bad signature, "U" for a good,
2231 untrusted signature and "N" for no signature
Junio C Hamano0acb1ae2012-09-24 21:28:132232</p>
2233</li>
2234<li>
2235<p>
2236<em>%GS</em>: show the name of the signer for a signed commit
2237</p>
2238</li>
2239<li>
2240<p>
Junio C Hamano5e7f1312013-03-21 22:49:012241<em>%GK</em>: show the key used to sign a signed commit
2242</p>
2243</li>
2244<li>
2245<p>
Junio C Hamanoac12f0e2014-09-19 22:32:512246<em>%gD</em>: reflog selector, e.g., <code>refs/stash@{1}</code>
Junio C Hamanoc21ab052009-10-31 04:03:552247</p>
2248</li>
2249<li>
2250<p>
Junio C Hamanoac12f0e2014-09-19 22:32:512251<em>%gd</em>: shortened reflog selector, e.g., <code>stash@{1}</code>
Junio C Hamanoc21ab052009-10-31 04:03:552252</p>
2253</li>
2254<li>
2255<p>
Junio C Hamano962f3a32011-12-22 20:21:442256<em>%gn</em>: reflog identity name
2257</p>
2258</li>
2259<li>
2260<p>
Junio C Hamano04e768d2013-04-23 19:19:262261<em>%gN</em>: reflog identity name (respecting .mailmap, see
2262 <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:442263</p>
2264</li>
2265<li>
2266<p>
2267<em>%ge</em>: reflog identity email
2268</p>
2269</li>
2270<li>
2271<p>
Junio C Hamano04e768d2013-04-23 19:19:262272<em>%gE</em>: reflog identity email (respecting .mailmap, see
2273 <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:442274</p>
2275</li>
2276<li>
2277<p>
Junio C Hamanoc21ab052009-10-31 04:03:552278<em>%gs</em>: reflog subject
2279</p>
2280</li>
2281<li>
2282<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:362283<em>%Cred</em>: switch color to red
2284</p>
2285</li>
2286<li>
2287<p>
2288<em>%Cgreen</em>: switch color to green
2289</p>
2290</li>
2291<li>
2292<p>
2293<em>%Cblue</em>: switch color to blue
2294</p>
2295</li>
2296<li>
2297<p>
2298<em>%Creset</em>: reset color
2299</p>
2300</li>
2301<li>
2302<p>
Junio C Hamanoabad6da2013-01-06 09:06:322303<em>%C(&#8230;)</em>: color specification, as described in color.branch.* config option;
Junio C Hamanoac12f0e2014-09-19 22:32:512304 adding <code>auto,</code> at the beginning will emit color only when colors are
2305 enabled for log output (by <code>color.diff</code>, <code>color.ui</code>, or <code>--color</code>, and
2306 respecting the <code>auto</code> settings of the former if we are going to a
2307 terminal). <code>auto</code> alone (i.e. <code>%C(auto)</code>) will turn on auto coloring
Junio C Hamano04e768d2013-04-23 19:19:262308 on the next placeholders until the color is switched again.
Junio C Hamanocc0cb312009-01-22 03:38:502309</p>
2310</li>
2311<li>
2312<p>
Junio C Hamanod9e0e5d2007-04-14 16:22:042313<em>%m</em>: left, right or boundary mark
2314</p>
2315</li>
2316<li>
2317<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:362318<em>%n</em>: newline
2319</p>
Junio C Hamano0430e3a2007-05-15 03:13:172320</li>
Junio C Hamanob78d2592008-04-09 09:39:082321<li>
2322<p>
Junio C Hamanoa9701f02010-01-21 00:42:162323<em>%%</em>: a raw <em>%</em>
2324</p>
2325</li>
2326<li>
2327<p>
Junio C Hamanob78d2592008-04-09 09:39:082328<em>%x00</em>: print a byte from a hex code
2329</p>
2330</li>
Junio C Hamanobf984de2009-11-23 06:11:192331<li>
2332<p>
2333<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:232334 <a href="git-shortlog.html">git-shortlog(1)</a>.
Junio C Hamanobf984de2009-11-23 06:11:192335</p>
2336</li>
Junio C Hamano04e768d2013-04-23 19:19:262337<li>
2338<p>
2339<em>%&lt;(&lt;N&gt;[,trunc|ltrunc|mtrunc])</em>: make the next placeholder take at
2340 least N columns, padding spaces on the right if necessary.
2341 Optionally truncate at the beginning (ltrunc), the middle (mtrunc)
2342 or the end (trunc) if the output is longer than N columns.
2343 Note that truncating only works correctly with N &gt;= 2.
2344</p>
2345</li>
2346<li>
2347<p>
2348<em>%&lt;|(&lt;N&gt;)</em>: make the next placeholder take at least until Nth
2349 columns, padding spaces on the right if necessary
2350</p>
2351</li>
2352<li>
2353<p>
2354<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>
2355 respectively, but padding spaces on the left
2356</p>
2357</li>
2358<li>
2359<p>
2360<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>
2361 respectively, except that if the next placeholder takes more spaces
2362 than given and there are spaces on its left, use those spaces
2363</p>
2364</li>
2365<li>
2366<p>
2367<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>
2368 respectively, but padding both sides (i.e. the text is centered)
2369</p>
2370</li>
Junio C Hamanoba4b9282008-07-06 05:20:312371</ul></div>
Junio C Hamanoa3fd83c2007-03-02 10:34:362372</li>
Junio C Hamanoc21ab052009-10-31 04:03:552373</ul></div>
2374<div class="admonitionblock">
2375<table><tr>
2376<td class="icon">
2377<div class="title">Note</div>
2378</td>
2379<td class="content">Some placeholders may depend on other options given to the
Junio C Hamanoac12f0e2014-09-19 22:32:512380revision traversal engine. For example, the <code>%g*</code> reflog options will
Junio C Hamanoc21ab052009-10-31 04:03:552381insert an empty string unless we are traversing reflog entries (e.g., by
Junio C Hamano00b9f1a2014-09-29 23:11:282382<code>git log -g</code>). The <code>%d</code> and <code>%D</code> placeholders will use the "short"
2383decoration format if <code>--decorate</code> was not already provided on the command
2384line.</td>
Junio C Hamanoc21ab052009-10-31 04:03:552385</tr></table>
2386</div>
Junio C Hamanoac12f0e2014-09-19 22:32:512387<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:592388is inserted immediately before the expansion if and only if the
2389placeholder expands to a non-empty string.</p></div>
Junio C Hamanoac12f0e2014-09-19 22:32:512390<div class="paragraph"><p>If you add a <code>-</code> (minus sign) after <em>%</em> of a placeholder, line-feeds that
Junio C Hamano2bd8a742009-12-01 21:16:592391immediately precede the expansion are deleted if and only if the
2392placeholder expands to an empty string.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592393<div class="paragraph"><p>If you add a ` ` (space) after <em>%</em> of a placeholder, a space
Junio C Hamano89a57342010-06-22 23:22:552394is inserted immediately before the expansion if and only if the
2395placeholder expands to a non-empty string.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592396<div class="ulist"><ul>
Junio C Hamano6fb124c2008-06-13 10:04:012397<li>
2398<p>
2399<em>tformat:</em>
2400</p>
Junio C Hamano68cf15a2010-11-06 01:01:592401<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:012402provides "terminator" semantics instead of "separator" semantics. In
2403other words, each commit has the message terminator character (usually a
2404newline) appended, rather than a separator placed between entries.
2405This means that the final entry of a single-line format will be properly
2406terminated with a new line, just as the "oneline" format does.
Junio C Hamanoba4b9282008-07-06 05:20:312407For example:</p></div>
Junio C Hamano6fb124c2008-06-13 10:04:012408<div class="listingblock">
2409<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512410<pre><code>$ git log -2 --pretty=format:%h 4da45bef \
Junio C Hamano6fb124c2008-06-13 10:04:012411 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
24124da45be
24137134973 -- NO NEWLINE
2414
2415$ git log -2 --pretty=tformat:%h 4da45bef \
2416 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
24174da45be
Junio C Hamanoac12f0e2014-09-19 22:32:5124187134973</code></pre>
Junio C Hamano6fb124c2008-06-13 10:04:012419</div></div>
Junio C Hamanoac12f0e2014-09-19 22:32:512420<div class="paragraph"><p>In addition, any unrecognized string that has a <code>%</code> in it is interpreted
2421as if it has <code>tformat:</code> in front of it. For example, these two are
Junio C Hamano0a235222009-03-06 08:21:092422equivalent:</p></div>
2423<div class="listingblock">
2424<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512425<pre><code>$ git log -2 --pretty=tformat:%h 4da45bef
2426$ git log -2 --pretty=%h 4da45bef</code></pre>
Junio C Hamano0a235222009-03-06 08:21:092427</div></div>
Junio C Hamano6fb124c2008-06-13 10:04:012428</li>
Junio C Hamanoba4b9282008-07-06 05:20:312429</ul></div>
Junio C Hamano1a4e8412005-12-27 08:17:232430</div>
Junio C Hamano9629d4f2012-12-19 00:28:272431</div>
2432<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:312433<h2 id="_limiting_output">Limiting Output</h2>
Junio C Hamano1a4e8412005-12-27 08:17:232434<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:592435<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:312436example some architecture-specific files, you might do:</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232437<div class="literalblock">
2438<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512439<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:232440</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592441<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:512442<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:232443<div class="literalblock">
2444<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512445<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:232446</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592447<div class="paragraph"><p>and it will ignore all differences to other files.</p></div>
2448<div class="paragraph"><p>The pattern is always the prefix, and is matched exactly. There are no
Junio C Hamano1a4e8412005-12-27 08:17:232449wildcards. Even stricter, it has to match a complete path component.
Junio C Hamanoac12f0e2014-09-19 22:32:512450I.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:312451so it can be used to name subdirectories.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592452<div class="paragraph"><p>An example of normal usage is:</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232453<div class="literalblock">
2454<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512455<pre><code>torvalds@ppc970:~/git&gt; git diff-tree --abbrev 5319e4
2456:100664 100664 ac348b... a01513... git-fsck-objects.c</code></pre>
Junio C Hamano1a4e8412005-12-27 08:17:232457</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592458<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:312459this one:</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232460<div class="listingblock">
2461<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512462<pre><code>commit 3c6f7ca19ad4043e9e72fa94106f352897e651a8
Junio C Hamano1a4e8412005-12-27 08:17:232463tree 5319e4d609cdd282069cc4dce33c1db559539b03
2464parent b4e628ea30d5ab3606119d2ea5caeab141d38df7
2465author Linus Torvalds &lt;torvalds@ppc970.osdl.org&gt; Sat Apr 9 12:02:30 2005
2466committer Linus Torvalds &lt;torvalds@ppc970.osdl.org&gt; Sat Apr 9 12:02:30 2005
2467
2468Make "git-fsck-objects" print out all the root commits it finds.
2469
2470Once I do the reference tracking, I'll also make it print out all the
Junio C Hamanoac12f0e2014-09-19 22:32:512471HEAD commits it finds, which is even more interesting.</code></pre>
Junio C Hamano1a4e8412005-12-27 08:17:232472</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592473<div class="paragraph"><p>in case you care).</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232474</div>
Junio C Hamano9629d4f2012-12-19 00:28:272475</div>
2476<div class="sect1">
Junio C Hamano543f8d62009-07-29 08:35:212477<h2 id="_raw_output_format">Raw output format</h2>
Junio C Hamano1a4e8412005-12-27 08:17:232478<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:592479<div class="paragraph"><p>The raw output format from "git-diff-index", "git-diff-tree",
Junio C Hamanoba4b9282008-07-06 05:20:312480"git-diff-files" and "git diff --raw" are very similar.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592481<div class="paragraph"><p>These commands all compare two sets of things; what is
Junio C Hamanoba4b9282008-07-06 05:20:312482compared differs:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592483<div class="dlist"><dl>
2484<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:232485git-diff-index &lt;tree-ish&gt;
2486</dt>
2487<dd>
2488<p>
2489 compares the &lt;tree-ish&gt; and the files on the filesystem.
2490</p>
2491</dd>
Junio C Hamano68cf15a2010-11-06 01:01:592492<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:232493git-diff-index --cached &lt;tree-ish&gt;
2494</dt>
2495<dd>
2496<p>
2497 compares the &lt;tree-ish&gt; and the index.
2498</p>
2499</dd>
Junio C Hamano68cf15a2010-11-06 01:01:592500<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:232501git-diff-tree [-r] &lt;tree-ish-1&gt; &lt;tree-ish-2&gt; [&lt;pattern&gt;&#8230;]
2502</dt>
2503<dd>
2504<p>
2505 compares the trees named by the two arguments.
2506</p>
2507</dd>
Junio C Hamano68cf15a2010-11-06 01:01:592508<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:232509git-diff-files [&lt;pattern&gt;&#8230;]
2510</dt>
2511<dd>
2512<p>
2513 compares the index and the files on the filesystem.
2514</p>
2515</dd>
Junio C Hamanoba4b9282008-07-06 05:20:312516</dl></div>
Junio C Hamano68cf15a2010-11-06 01:01:592517<div class="paragraph"><p>The "git-diff-tree" command begins its output by printing the hash of
Junio C Hamano543f8d62009-07-29 08:35:212518what is being compared. After that, all the commands print one output
2519line per changed file.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592520<div class="paragraph"><p>An output line is formatted this way:</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232521<div class="listingblock">
2522<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512523<pre><code>in-place edit :100644 100644 bcd1234... 0123456... M file0
Junio C Hamano1a4e8412005-12-27 08:17:232524copy-edit :100644 100644 abcd123... 1234567... C68 file1 file2
2525rename-edit :100644 100644 abcd123... 1234567... R86 file1 file3
2526create :000000 100644 0000000... 1234567... A file4
2527delete :100644 000000 1234567... 0000000... D file5
Junio C Hamanoac12f0e2014-09-19 22:32:512528unmerged :000000 000000 0000000... 0000000... U file6</code></pre>
Junio C Hamano1a4e8412005-12-27 08:17:232529</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592530<div class="paragraph"><p>That is, from the left to the right:</p></div>
2531<div class="olist arabic"><ol class="arabic">
Junio C Hamano1a4e8412005-12-27 08:17:232532<li>
2533<p>
2534a colon.
2535</p>
2536</li>
2537<li>
2538<p>
2539mode for "src"; 000000 if creation or unmerged.
2540</p>
2541</li>
2542<li>
2543<p>
2544a space.
2545</p>
2546</li>
2547<li>
2548<p>
2549mode for "dst"; 000000 if deletion or unmerged.
2550</p>
2551</li>
2552<li>
2553<p>
2554a space.
2555</p>
2556</li>
2557<li>
2558<p>
2559sha1 for "src"; 0{40} if creation or unmerged.
2560</p>
2561</li>
2562<li>
2563<p>
2564a space.
2565</p>
2566</li>
2567<li>
2568<p>
2569sha1 for "dst"; 0{40} if creation, unmerged or "look at work tree".
2570</p>
2571</li>
2572<li>
2573<p>
2574a space.
2575</p>
2576</li>
2577<li>
2578<p>
2579status, followed by optional "score" number.
2580</p>
2581</li>
2582<li>
2583<p>
2584a tab or a NUL when <em>-z</em> option is used.
2585</p>
2586</li>
2587<li>
2588<p>
2589path for "src"
2590</p>
2591</li>
2592<li>
2593<p>
2594a tab or a NUL when <em>-z</em> option is used; only exists for C or R.
2595</p>
2596</li>
2597<li>
2598<p>
2599path for "dst"; only exists for C or R.
2600</p>
2601</li>
2602<li>
2603<p>
2604an LF or a NUL when <em>-z</em> option is used, to terminate the record.
2605</p>
2606</li>
Junio C Hamanoba4b9282008-07-06 05:20:312607</ol></div>
Junio C Hamano68cf15a2010-11-06 01:01:592608<div class="paragraph"><p>Possible status letters are:</p></div>
2609<div class="ulist"><ul>
Junio C Hamanoaa17c7c2008-11-03 04:36:582610<li>
2611<p>
2612A: addition of a file
2613</p>
2614</li>
2615<li>
2616<p>
2617C: copy of a file into a new one
2618</p>
2619</li>
2620<li>
2621<p>
2622D: deletion of a file
2623</p>
2624</li>
2625<li>
2626<p>
2627M: modification of the contents or mode of a file
2628</p>
2629</li>
2630<li>
2631<p>
2632R: renaming of a file
2633</p>
2634</li>
2635<li>
2636<p>
2637T: change in the type of the file
2638</p>
2639</li>
2640<li>
2641<p>
2642U: file is unmerged (you must complete the merge before it can
2643be committed)
2644</p>
2645</li>
2646<li>
2647<p>
2648X: "unknown" change type (most probably a bug, please report it)
2649</p>
2650</li>
2651</ul></div>
Junio C Hamano68cf15a2010-11-06 01:01:592652<div class="paragraph"><p>Status letters C and R are always followed by a score (denoting the
Junio C Hamanoaa17c7c2008-11-03 04:36:582653percentage of similarity between the source and target of the move or
Junio C Hamano6bb32e62015-02-17 22:11:262654copy). Status letter M may be followed by a score (denoting the
2655percentage of dissimilarity) for file rewrites.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592656<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:312657and it is out of sync with the index.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592658<div class="paragraph"><p>Example:</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232659<div class="listingblock">
2660<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512661<pre><code>:100644 100644 5be4a4...... 000000...... M file.c</code></pre>
Junio C Hamano1a4e8412005-12-27 08:17:232662</div></div>
Junio C Hamanoac12f0e2014-09-19 22:32:512663<div class="paragraph"><p>When <code>-z</code> option is not used, TAB, LF, and backslash characters
2664in pathnames are represented as <code>\t</code>, <code>\n</code>, and <code>\\</code>,
Junio C Hamanoba4b9282008-07-06 05:20:312665respectively.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232666</div>
Junio C Hamano9629d4f2012-12-19 00:28:272667</div>
2668<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:312669<h2 id="_diff_format_for_merges">diff format for merges</h2>
Junio C Hamano67fad6d2007-05-06 08:53:122670<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:592671<div class="paragraph"><p>"git-diff-tree", "git-diff-files" and "git-diff --raw"
Junio C Hamano7ae0ab22007-11-03 02:46:462672can take <em>-c</em> or <em>--cc</em> option
Junio C Hamano67fad6d2007-05-06 08:53:122673to generate diff output also for merge commits. The output differs
Junio C Hamanoba4b9282008-07-06 05:20:312674from the format described above in the following way:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592675<div class="olist arabic"><ol class="arabic">
Junio C Hamano67fad6d2007-05-06 08:53:122676<li>
2677<p>
2678there is a colon for each parent
2679</p>
2680</li>
2681<li>
2682<p>
2683there are more "src" modes and "src" sha1
2684</p>
2685</li>
2686<li>
2687<p>
2688status is concatenated status characters for each parent
2689</p>
2690</li>
2691<li>
2692<p>
2693no optional "score" number
2694</p>
2695</li>
2696<li>
2697<p>
2698single path, only for "dst"
2699</p>
2700</li>
Junio C Hamanoba4b9282008-07-06 05:20:312701</ol></div>
Junio C Hamano68cf15a2010-11-06 01:01:592702<div class="paragraph"><p>Example:</p></div>
Junio C Hamano67fad6d2007-05-06 08:53:122703<div class="listingblock">
2704<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512705<pre><code>::100644 100644 100644 fabadb8... cc95eb0... 4866510... MM describe.c</code></pre>
Junio C Hamano67fad6d2007-05-06 08:53:122706</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592707<div class="paragraph"><p>Note that <em>combined diff</em> lists only files which were modified from
Junio C Hamanoba4b9282008-07-06 05:20:312708all parents.</p></div>
Junio C Hamano67fad6d2007-05-06 08:53:122709</div>
Junio C Hamano9629d4f2012-12-19 00:28:272710</div>
2711<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:312712<h2 id="_generating_patches_with_p">Generating patches with -p</h2>
Junio C Hamano1a4e8412005-12-27 08:17:232713<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:592714<div class="paragraph"><p>When "git-diff-index", "git-diff-tree", or "git-diff-files" are run
Junio C Hamano00b8b632007-12-07 09:50:492715with a <em>-p</em> option, "git diff" without the <em>--raw</em> option, or
2716"git log" with the "-p" option, they
Junio C Hamano7ae0ab22007-11-03 02:46:462717do not produce the output described above; instead they produce a
2718patch file. You can customize the creation of such patches via the
Junio C Hamanoba4b9282008-07-06 05:20:312719GIT_EXTERNAL_DIFF and the GIT_DIFF_OPTS environment variables.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592720<div class="paragraph"><p>What the -p option produces is slightly different from the traditional
Junio C Hamano7f9fa862010-10-19 23:51:142721diff format:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592722<div class="olist arabic"><ol class="arabic">
Junio C Hamano1a4e8412005-12-27 08:17:232723<li>
2724<p>
Junio C Hamano7f9fa862010-10-19 23:51:142725It is preceded with a "git diff" header that looks like this:
Junio C Hamano1a4e8412005-12-27 08:17:232726</p>
2727<div class="literalblock">
2728<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512729<pre><code>diff --git a/file1 b/file2</code></pre>
Junio C Hamano1a4e8412005-12-27 08:17:232730</div></div>
Junio C Hamanoac12f0e2014-09-19 22:32:512731<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:232732involved. Especially, even for a creation or a deletion,
Junio C Hamanoac12f0e2014-09-19 22:32:512733<code>/dev/null</code> is <em>not</em> used in place of the <code>a/</code> or <code>b/</code> filenames.</p></div>
2734<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:232735name of the source file of the rename/copy and the name of
Junio C Hamanoba4b9282008-07-06 05:20:312736the file that rename/copy produces, respectively.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232737</li>
2738<li>
2739<p>
2740It is followed by one or more extended header lines:
2741</p>
2742<div class="literalblock">
2743<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512744<pre><code>old mode &lt;mode&gt;
Junio C Hamano1a4e8412005-12-27 08:17:232745new mode &lt;mode&gt;
2746deleted file mode &lt;mode&gt;
2747new file mode &lt;mode&gt;
2748copy from &lt;path&gt;
2749copy to &lt;path&gt;
2750rename from &lt;path&gt;
2751rename to &lt;path&gt;
2752similarity index &lt;number&gt;
2753dissimilarity index &lt;number&gt;
Junio C Hamanoac12f0e2014-09-19 22:32:512754index &lt;hash&gt;..&lt;hash&gt; &lt;mode&gt;</code></pre>
Junio C Hamano1a4e8412005-12-27 08:17:232755</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592756<div class="paragraph"><p>File modes are printed as 6-digit octal numbers including the file type
Junio C Hamano7f9fa862010-10-19 23:51:142757and file permission bits.</p></div>
Junio C Hamanoac12f0e2014-09-19 22:32:512758<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:592759<div class="paragraph"><p>The similarity index is the percentage of unchanged lines, and
Junio C Hamano7f9fa862010-10-19 23:51:142760the dissimilarity index is the percentage of changed lines. It
2761is a rounded down integer, followed by a percent sign. The
2762similarity index value of 100% is thus reserved for two equal
2763files, while 100% dissimilarity means that no line from the old
2764file made it into the new one.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592765<div class="paragraph"><p>The index line includes the SHA-1 checksum before and after the change.
Junio C Hamano7f9fa862010-10-19 23:51:142766The &lt;mode&gt; is included if the file mode does not change; otherwise,
2767separate lines indicate the old and the new mode.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232768</li>
2769<li>
2770<p>
Junio C Hamanoa053d542006-10-27 09:29:132771TAB, LF, double quote and backslash characters in pathnames
Junio C Hamanoac12f0e2014-09-19 22:32:512772 are represented as <code>\t</code>, <code>\n</code>, <code>\"</code> and <code>\\</code>, respectively.
Junio C Hamanoa053d542006-10-27 09:29:132773 If there is need for such substitution then the whole
2774 pathname is put in double quotes.
Junio C Hamano1a4e8412005-12-27 08:17:232775</p>
2776</li>
Junio C Hamano7f9fa862010-10-19 23:51:142777<li>
2778<p>
Junio C Hamanoac12f0e2014-09-19 22:32:512779All the <code>file1</code> files in the output refer to files before the
2780 commit, and all the <code>file2</code> files refer to files after the commit.
Junio C Hamano7f9fa862010-10-19 23:51:142781 It is incorrect to apply each change to each file sequentially. For
2782 example, this patch will swap a and b:
2783</p>
2784<div class="literalblock">
2785<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512786<pre><code>diff --git a/a b/b
Junio C Hamano7f9fa862010-10-19 23:51:142787rename from a
2788rename to b
2789diff --git a/b b/a
2790rename from b
Junio C Hamanoac12f0e2014-09-19 22:32:512791rename to a</code></pre>
Junio C Hamano7f9fa862010-10-19 23:51:142792</div></div>
2793</li>
Junio C Hamanoba4b9282008-07-06 05:20:312794</ol></div>
Junio C Hamano1a4e8412005-12-27 08:17:232795</div>
Junio C Hamano9629d4f2012-12-19 00:28:272796</div>
2797<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:312798<h2 id="_combined_diff_format">combined diff format</h2>
Junio C Hamanofb56a962006-01-28 10:38:192799<div class="sectionbody">
Junio C Hamano1dbca522015-05-22 20:48:552800<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:432801produce a <em>combined diff</em> when showing a merge. This is the default
Junio C Hamanoa28a9202012-06-21 07:08:232802format when showing merges with <a href="git-diff.html">git-diff(1)</a> or
Junio C Hamano1dbca522015-05-22 20:48:552803<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:432804of these commands to force generation of diffs with individual parents
2805of a merge.</p></div>
2806<div class="paragraph"><p>A <em>combined diff</em> format looks like this:</p></div>
Junio C Hamanofb56a962006-01-28 10:38:192807<div class="listingblock">
2808<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512809<pre><code>diff --combined describe.c
Junio C Hamano29f14312006-10-26 08:47:292810index fabadb8,cc95eb0..4866510
2811--- a/describe.c
2812+++ b/describe.c
2813@@@ -98,20 -98,12 +98,20 @@@
2814 return (a_date &gt; b_date) ? -1 : (a_date == b_date) ? 0 : 1;
Junio C Hamanofb56a962006-01-28 10:38:192815 }
2816
2817- static void describe(char *arg)
2818 -static void describe(struct commit *cmit, int last_one)
2819++static void describe(char *arg, int last_one)
2820 {
Junio C Hamano29f14312006-10-26 08:47:292821 + unsigned char sha1[20];
2822 + struct commit *cmit;
2823 struct commit_list *list;
2824 static int initialized = 0;
2825 struct commit_name *n;
2826
2827 + if (get_sha1(arg, sha1) &lt; 0)
2828 + usage(describe_usage);
2829 + cmit = lookup_commit_reference(sha1);
2830 + if (!cmit)
2831 + usage(describe_usage);
2832 +
2833 if (!initialized) {
2834 initialized = 1;
Junio C Hamanoac12f0e2014-09-19 22:32:512835 for_each_ref(get_name);</code></pre>
Junio C Hamanofb56a962006-01-28 10:38:192836</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592837<div class="olist arabic"><ol class="arabic">
Junio C Hamano29f14312006-10-26 08:47:292838<li>
2839<p>
2840It is preceded with a "git diff" header, that looks like
2841 this (when <em>-c</em> option is used):
2842</p>
2843<div class="literalblock">
2844<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512845<pre><code>diff --combined file</code></pre>
Junio C Hamano29f14312006-10-26 08:47:292846</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592847<div class="paragraph"><p>or like this (when <em>--cc</em> option is used):</p></div>
Junio C Hamano29f14312006-10-26 08:47:292848<div class="literalblock">
2849<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512850<pre><code>diff --cc file</code></pre>
Junio C Hamano29f14312006-10-26 08:47:292851</div></div>
2852</li>
2853<li>
2854<p>
2855It is followed by one or more extended header lines
2856 (this example shows a merge with two parents):
2857</p>
2858<div class="literalblock">
2859<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512860<pre><code>index &lt;hash&gt;,&lt;hash&gt;..&lt;hash&gt;
Junio C Hamano29f14312006-10-26 08:47:292861mode &lt;mode&gt;,&lt;mode&gt;..&lt;mode&gt;
2862new file mode &lt;mode&gt;
Junio C Hamanoac12f0e2014-09-19 22:32:512863deleted file mode &lt;mode&gt;,&lt;mode&gt;</code></pre>
Junio C Hamano29f14312006-10-26 08:47:292864</div></div>
Junio C Hamanoac12f0e2014-09-19 22:32:512865<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:042866the &lt;mode&gt; is different from the rest. Extended headers with
Junio C Hamano29f14312006-10-26 08:47:292867information about detected contents movement (renames and
2868copying detection) are designed to work with diff of two
Junio C Hamanoba4b9282008-07-06 05:20:312869&lt;tree-ish&gt; and are not used by combined diff format.</p></div>
Junio C Hamano29f14312006-10-26 08:47:292870</li>
2871<li>
2872<p>
2873It is followed by two-line from-file/to-file header
2874</p>
2875<div class="literalblock">
2876<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512877<pre><code>--- a/file
2878+++ b/file</code></pre>
Junio C Hamano29f14312006-10-26 08:47:292879</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592880<div class="paragraph"><p>Similar to two-line header for traditional <em>unified</em> diff
Junio C Hamanoac12f0e2014-09-19 22:32:512881format, <code>/dev/null</code> is used to signal created or deleted
Junio C Hamanoba4b9282008-07-06 05:20:312882files.</p></div>
Junio C Hamano29f14312006-10-26 08:47:292883</li>
2884<li>
2885<p>
2886Chunk header format is modified to prevent people from
Junio C Hamanoac12f0e2014-09-19 22:32:512887 accidentally feeding it to <code>patch -p1</code>. Combined diff format
Junio C Hamano29f14312006-10-26 08:47:292888 was created for review of merge commit changes, and was not
2889 meant for apply. The change is similar to the change in the
2890 extended <em>index</em> header:
2891</p>
2892<div class="literalblock">
2893<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512894<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:292895</div></div>
Junio C Hamanoac12f0e2014-09-19 22:32:512896<div class="paragraph"><p>There are (number of parents + 1) <code>@</code> characters in the chunk
Junio C Hamanoba4b9282008-07-06 05:20:312897header for combined diff format.</p></div>
Junio C Hamano29f14312006-10-26 08:47:292898</li>
Junio C Hamanoba4b9282008-07-06 05:20:312899</ol></div>
Junio C Hamano68cf15a2010-11-06 01:01:592900<div class="paragraph"><p>Unlike the traditional <em>unified</em> diff format, which shows two
Junio C Hamanoac12f0e2014-09-19 22:32:512901files 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
2902added to B), or <code>" "</code> (space&#8201;&#8212;&#8201;unchanged) prefix, this format
Junio C Hamanofb56a962006-01-28 10:38:192903compares two or more files file1, file2,&#8230; with one file X, and
2904shows how X differs from each of fileN. One column for each of
Junio C Hamano68cf15a2010-11-06 01:01:592905fileN is prepended to the output line to note how X&#8217;s line is
Junio C Hamanoba4b9282008-07-06 05:20:312906different from it.</p></div>
Junio C Hamanoac12f0e2014-09-19 22:32:512907<div class="paragraph"><p>A <code>-</code> character in the column N means that the line appears in
2908fileN but it does not appear in the result. A <code>+</code> character
Junio C Hamano54bf1e22008-12-20 06:30:112909in the column N means that the line appears in the result,
Junio C Hamano29f14312006-10-26 08:47:292910and fileN does not have that line (in other words, the line was
Junio C Hamanoba4b9282008-07-06 05:20:312911added, from the point of view of that parent).</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592912<div class="paragraph"><p>In the above example output, the function signature was changed
Junio C Hamanoac12f0e2014-09-19 22:32:512913from both files (hence two <code>-</code> removals from both file1 and
2914file2, plus <code>++</code> to mean one line that was added does not appear
Junio C Hamanod75148a2014-04-08 19:48:382915in either file1 or file2). Also eight other lines are the same
Junio C Hamanoac12f0e2014-09-19 22:32:512916from file1 but do not appear in file2 (hence prefixed with <code>+</code>).</p></div>
2917<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:192918merge commit with the merge result (i.e. file1..fileN are the
Junio C Hamanoac12f0e2014-09-19 22:32:512919parents). When shown by <code>git diff-files -c</code>, it compares the
Junio C Hamanofb56a962006-01-28 10:38:192920two unresolved merge parents with the working tree file
2921(i.e. file1 is stage 2 aka "our version", file2 is stage 3 aka
Junio C Hamanoba4b9282008-07-06 05:20:312922"their version").</p></div>
Junio C Hamanofb56a962006-01-28 10:38:192923</div>
Junio C Hamano9629d4f2012-12-19 00:28:272924</div>
2925<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:312926<h2 id="_other_diff_formats">other diff formats</h2>
Junio C Hamano3a702342007-12-12 21:34:022927<div class="sectionbody">
Junio C Hamanoac12f0e2014-09-19 22:32:512928<div class="paragraph"><p>The <code>--summary</code> option describes newly added, deleted, renamed and
2929copied files. The <code>--stat</code> option adds diffstat(1) graph to the
Junio C Hamano3a702342007-12-12 21:34:022930output. These options can be combined with other options, such as
Junio C Hamanoac12f0e2014-09-19 22:32:512931<code>-p</code>, and are meant for human consumption.</p></div>
2932<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:022933formats the pathnames compactly by combining common prefix and suffix of
Junio C Hamanoac12f0e2014-09-19 22:32:512934the pathnames. For example, a change that moves <code>arch/i386/Makefile</code> to
2935<code>arch/x86/Makefile</code> while modifying 4 lines will be shown like this:</p></div>
Junio C Hamano3a702342007-12-12 21:34:022936<div class="listingblock">
2937<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512938<pre><code>arch/{i386 =&gt; x86}/Makefile | 4 +--</code></pre>
Junio C Hamano3a702342007-12-12 21:34:022939</div></div>
Junio C Hamanoac12f0e2014-09-19 22:32:512940<div class="paragraph"><p>The <code>--numstat</code> option gives the diffstat(1) information but is designed
2941for easier machine consumption. An entry in <code>--numstat</code> output looks
Junio C Hamanoba4b9282008-07-06 05:20:312942like this:</p></div>
Junio C Hamano3a702342007-12-12 21:34:022943<div class="listingblock">
2944<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512945<pre><code>1 2 README
29463 1 arch/{i386 =&gt; x86}/Makefile</code></pre>
Junio C Hamano3a702342007-12-12 21:34:022947</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592948<div class="paragraph"><p>That is, from left to right:</p></div>
2949<div class="olist arabic"><ol class="arabic">
Junio C Hamano3a702342007-12-12 21:34:022950<li>
2951<p>
2952the number of added lines;
2953</p>
2954</li>
2955<li>
2956<p>
2957a tab;
2958</p>
2959</li>
2960<li>
2961<p>
2962the number of deleted lines;
2963</p>
2964</li>
2965<li>
2966<p>
2967a tab;
2968</p>
2969</li>
2970<li>
2971<p>
2972pathname (possibly with rename/copy information);
2973</p>
2974</li>
2975<li>
2976<p>
2977a newline.
2978</p>
2979</li>
Junio C Hamanoba4b9282008-07-06 05:20:312980</ol></div>
Junio C Hamanoac12f0e2014-09-19 22:32:512981<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:022982<div class="listingblock">
2983<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512984<pre><code>1 2 README NUL
29853 1 NUL arch/i386/Makefile NUL arch/x86/Makefile NUL</code></pre>
Junio C Hamano3a702342007-12-12 21:34:022986</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592987<div class="paragraph"><p>That is:</p></div>
2988<div class="olist arabic"><ol class="arabic">
Junio C Hamano3a702342007-12-12 21:34:022989<li>
2990<p>
2991the number of added lines;
2992</p>
2993</li>
2994<li>
2995<p>
2996a tab;
2997</p>
2998</li>
2999<li>
3000<p>
3001the number of deleted lines;
3002</p>
3003</li>
3004<li>
3005<p>
3006a tab;
3007</p>
3008</li>
3009<li>
3010<p>
3011a NUL (only exists if renamed/copied);
3012</p>
3013</li>
3014<li>
3015<p>
3016pathname in preimage;
3017</p>
3018</li>
3019<li>
3020<p>
3021a NUL (only exists if renamed/copied);
3022</p>
3023</li>
3024<li>
3025<p>
3026pathname in postimage (only exists if renamed/copied);
3027</p>
3028</li>
3029<li>
3030<p>
3031a NUL.
3032</p>
3033</li>
Junio C Hamanoba4b9282008-07-06 05:20:313034</ol></div>
Junio C Hamanoac12f0e2014-09-19 22:32:513035<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:023036scripts that read the output to tell if the current record being read is
3037a single-path record or a rename/copy record without reading ahead.
Junio C Hamanoac12f0e2014-09-19 22:32:513038After reading added and deleted lines, reading up to <code>NUL</code> would yield
3039the pathname, but if that is <code>NUL</code>, the record will show two paths.</p></div>
Junio C Hamano3a702342007-12-12 21:34:023040</div>
Junio C Hamano9629d4f2012-12-19 00:28:273041</div>
3042<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:313043<h2 id="_git">GIT</h2>
Junio C Hamano1a4e8412005-12-27 08:17:233044<div class="sectionbody">
Junio C Hamanoa28a9202012-06-21 07:08:233045<div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:233046</div>
Junio C Hamano7bd050f2011-09-22 06:32:223047</div>
Junio C Hamano9629d4f2012-12-19 00:28:273048</div>
Junio C Hamano7bd050f2011-09-22 06:32:223049<div id="footnotes"><hr /></div>
Junio C Hamano1a4e8412005-12-27 08:17:233050<div id="footer">
3051<div id="footer-text">
Junio C Hamano683a8612013-08-23 20:50:093052Last updated 2013-08-20 08:40:27 PDT
Junio C Hamano1a4e8412005-12-27 08:17:233053</div>
3054</div>
3055</body>
3056</html>