blob: a1103603fd0f983ffa217da8b7d266084a3d860a [file] [log] [blame]
Junio C Hamanod9d71c02006-02-08 00:52:331<!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 Hamano9d971152012-12-19 00:43:115<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
6<meta name="generator" content="AsciiDoc 8.6.8" />
Junio C Hamano68cf15a2010-11-06 01:01:597<title>git-show(1)</title>
Junio C Hamanod9d71c02006-02-08 00:52:338<style type="text/css">
Junio C Hamano9d971152012-12-19 00:43:119/* 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 Hamanod9d71c02006-02-08 00:52:3324}
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 Hamanod9d71c02006-02-08 00:52:3337
38em {
39 font-style: italic;
Junio C Hamano68cf15a2010-11-06 01:01:5940 color: navy;
Junio C Hamanod9d71c02006-02-08 00:52:3341}
42
43strong {
44 font-weight: bold;
Junio C Hamano68cf15a2010-11-06 01:01:5945 color: #083194;
Junio C Hamanod9d71c02006-02-08 00:52:3346}
47
Junio C Hamanod9d71c02006-02-08 00:52:3348h1, h2, h3, h4, h5, h6 {
49 color: #527bbd;
Junio C Hamanod9d71c02006-02-08 00:52:3350 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 Hamanod9d71c02006-02-08 00:52:3356 border-bottom: 2px solid silver;
57}
58h2 {
Junio C Hamanod9d71c02006-02-08 00:52:3359 padding-top: 0.5em;
60}
Junio C Hamanoba4b9282008-07-06 05:20:3161h3 {
62 float: left;
63}
64h3 + * {
65 clear: left;
66}
Junio C Hamano9d971152012-12-19 00:43:1167h5 {
68 font-size: 1.0em;
69}
Junio C Hamanod9d71c02006-02-08 00:52:3370
71div.sectionbody {
Junio C Hamanod9d71c02006-02-08 00:52:3372 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 Hamano9d971152012-12-19 00:43:1187ul > li { color: #aaa; }
88ul > li > * { color: black; }
Junio C Hamano68cf15a2010-11-06 01:01:5989
Junio C Hamano9d971152012-12-19 00:43:1190.monospaced, code, pre {
91 font-family: "Courier New", Courier, monospace;
92 font-size: inherit;
93 color: navy;
Junio C Hamanod9d71c02006-02-08 00:52:3394 padding: 0;
95 margin: 0;
96}
97
Junio C Hamano9d971152012-12-19 00:43:1198
99#author {
Junio C Hamanod9d71c02006-02-08 00:52:33100 color: #527bbd;
Junio C Hamanod9d71c02006-02-08 00:52:33101 font-weight: bold;
Junio C Hamanoba4b9282008-07-06 05:20:31102 font-size: 1.1em;
Junio C Hamanod9d71c02006-02-08 00:52:33103}
Junio C Hamano9d971152012-12-19 00:43:11104#email {
Junio C Hamanod9d71c02006-02-08 00:52:33105}
Junio C Hamano9d971152012-12-19 00:43:11106#revnumber, #revdate, #revremark {
Junio C Hamanod9d71c02006-02-08 00:52:33107}
108
Junio C Hamano9d971152012-12-19 00:43:11109#footer {
Junio C Hamanod9d71c02006-02-08 00:52:33110 font-size: small;
111 border-top: 2px solid silver;
112 padding-top: 0.5em;
113 margin-top: 4.0em;
114}
Junio C Hamano9d971152012-12-19 00:43:11115#footer-text {
Junio C Hamanod9d71c02006-02-08 00:52:33116 float: left;
117 padding-bottom: 0.5em;
118}
Junio C Hamano9d971152012-12-19 00:43:11119#footer-badges {
Junio C Hamanod9d71c02006-02-08 00:52:33120 float: right;
121 padding-bottom: 0.5em;
122}
123
Junio C Hamano9d971152012-12-19 00:43:11124#preamble {
Junio C Hamano68cf15a2010-11-06 01:01:59125 margin-top: 1.5em;
126 margin-bottom: 1.5em;
127}
Junio C Hamano9d971152012-12-19 00:43:11128div.imageblock, div.exampleblock, div.verseblock,
Junio C Hamanod9d71c02006-02-08 00:52:33129div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
130div.admonitionblock {
Junio C Hamano7bd050f2011-09-22 06:32:22131 margin-top: 1.0em;
Junio C Hamanod9d71c02006-02-08 00:52:33132 margin-bottom: 1.5em;
133}
134div.admonitionblock {
Junio C Hamano7bd050f2011-09-22 06:32:22135 margin-top: 2.0em;
136 margin-bottom: 2.0em;
137 margin-right: 10%;
138 color: #606060;
Junio C Hamanod9d71c02006-02-08 00:52:33139}
140
141div.content { /* Block element content. */
142 padding: 0;
143}
144
145/* Block element titles. */
146div.title, caption.title {
Junio C Hamano68cf15a2010-11-06 01:01:59147 color: #527bbd;
Junio C Hamanod9d71c02006-02-08 00:52:33148 font-weight: bold;
149 text-align: left;
150 margin-top: 1.0em;
151 margin-bottom: 0.5em;
152}
153div.title + * {
154 margin-top: 0;
155}
156
157td div.title:first-child {
158 margin-top: 0.0em;
159}
160div.content div.title:first-child {
161 margin-top: 0.0em;
162}
163div.content + div.title {
164 margin-top: 0.0em;
165}
166
167div.sidebarblock > div.content {
168 background: #ffffee;
Junio C Hamano9d971152012-12-19 00:43:11169 border: 1px solid #dddddd;
170 border-left: 4px solid #f0f0f0;
Junio C Hamanod9d71c02006-02-08 00:52:33171 padding: 0.5em;
172}
173
174div.listingblock > div.content {
Junio C Hamano9d971152012-12-19 00:43:11175 border: 1px solid #dddddd;
176 border-left: 5px solid #f0f0f0;
177 background: #f8f8f8;
Junio C Hamanod9d71c02006-02-08 00:52:33178 padding: 0.5em;
179}
180
Junio C Hamano7bd050f2011-09-22 06:32:22181div.quoteblock, div.verseblock {
182 padding-left: 1.0em;
183 margin-left: 1.0em;
Junio C Hamano68cf15a2010-11-06 01:01:59184 margin-right: 10%;
Junio C Hamano9d971152012-12-19 00:43:11185 border-left: 5px solid #f0f0f0;
186 color: #888;
Junio C Hamanod9d71c02006-02-08 00:52:33187}
Junio C Hamano7bd050f2011-09-22 06:32:22188
Junio C Hamano68cf15a2010-11-06 01:01:59189div.quoteblock > div.attribution {
190 padding-top: 0.5em;
Junio C Hamanod9d71c02006-02-08 00:52:33191 text-align: right;
192}
Junio C Hamano68cf15a2010-11-06 01:01:59193
Junio C Hamano9d971152012-12-19 00:43:11194div.verseblock > pre.content {
195 font-family: inherit;
196 font-size: inherit;
Junio C Hamano68cf15a2010-11-06 01:01:59197}
198div.verseblock > div.attribution {
199 padding-top: 0.75em;
200 text-align: left;
201}
202/* DEPRECATED: Pre version 8.2.7 verse style literal block. */
Junio C Hamanoba4b9282008-07-06 05:20:31203div.verseblock + div.attribution {
204 text-align: left;
205}
Junio C Hamanod9d71c02006-02-08 00:52:33206
207div.admonitionblock .icon {
208 vertical-align: top;
209 font-size: 1.1em;
210 font-weight: bold;
211 text-decoration: underline;
212 color: #527bbd;
213 padding-right: 0.5em;
214}
215div.admonitionblock td.content {
216 padding-left: 0.5em;
Junio C Hamano7bd050f2011-09-22 06:32:22217 border-left: 3px solid #dddddd;
Junio C Hamanod9d71c02006-02-08 00:52:33218}
219
220div.exampleblock > div.content {
Junio C Hamano7bd050f2011-09-22 06:32:22221 border-left: 3px solid #dddddd;
222 padding-left: 0.5em;
Junio C Hamanod9d71c02006-02-08 00:52:33223}
224
Junio C Hamanod9d71c02006-02-08 00:52:33225div.imageblock div.content { padding-left: 0; }
Junio C Hamanod9d71c02006-02-08 00:52:33226span.image img { border-style: none; }
Junio C Hamano68cf15a2010-11-06 01:01:59227a.image:visited { color: white; }
Junio C Hamanod9d71c02006-02-08 00:52:33228
229dl {
230 margin-top: 0.8em;
231 margin-bottom: 0.8em;
232}
233dt {
234 margin-top: 0.5em;
235 margin-bottom: 0;
Junio C Hamano68cf15a2010-11-06 01:01:59236 font-style: normal;
237 color: navy;
Junio C Hamanod9d71c02006-02-08 00:52:33238}
239dd > *:first-child {
Junio C Hamano68cf15a2010-11-06 01:01:59240 margin-top: 0.1em;
Junio C Hamanod9d71c02006-02-08 00:52:33241}
242
243ul, ol {
244 list-style-position: outside;
245}
Junio C Hamano68cf15a2010-11-06 01:01:59246ol.arabic {
247 list-style-type: decimal;
248}
249ol.loweralpha {
Junio C Hamanod9d71c02006-02-08 00:52:33250 list-style-type: lower-alpha;
251}
Junio C Hamano68cf15a2010-11-06 01:01:59252ol.upperalpha {
253 list-style-type: upper-alpha;
254}
255ol.lowerroman {
256 list-style-type: lower-roman;
257}
258ol.upperroman {
259 list-style-type: upper-roman;
260}
261
262div.compact ul, div.compact ol,
263div.compact p, div.compact p,
264div.compact div, div.compact div {
265 margin-top: 0.1em;
266 margin-bottom: 0.1em;
267}
Junio C Hamanod9d71c02006-02-08 00:52:33268
Junio C Hamanod9d71c02006-02-08 00:52:33269tfoot {
270 font-weight: bold;
271}
Junio C Hamano68cf15a2010-11-06 01:01:59272td > div.verse {
273 white-space: pre;
274}
Junio C Hamano68cf15a2010-11-06 01:01:59275
276div.hdlist {
Junio C Hamanod9d71c02006-02-08 00:52:33277 margin-top: 0.8em;
278 margin-bottom: 0.8em;
279}
Junio C Hamano68cf15a2010-11-06 01:01:59280div.hdlist tr {
281 padding-bottom: 15px;
Junio C Hamanoba4b9282008-07-06 05:20:31282}
Junio C Hamano68cf15a2010-11-06 01:01:59283dt.hdlist1.strong, td.hdlist1.strong {
284 font-weight: bold;
285}
286td.hdlist1 {
Junio C Hamanod9d71c02006-02-08 00:52:33287 vertical-align: top;
Junio C Hamano68cf15a2010-11-06 01:01:59288 font-style: normal;
Junio C Hamanod9d71c02006-02-08 00:52:33289 padding-right: 0.8em;
Junio C Hamano68cf15a2010-11-06 01:01:59290 color: navy;
Junio C Hamanod9d71c02006-02-08 00:52:33291}
Junio C Hamano68cf15a2010-11-06 01:01:59292td.hdlist2 {
Junio C Hamanod9d71c02006-02-08 00:52:33293 vertical-align: top;
294}
Junio C Hamano68cf15a2010-11-06 01:01:59295div.hdlist.compact tr {
296 margin: 0;
297 padding-bottom: 0;
298}
299
300.comment {
301 background: yellow;
302}
Junio C Hamanod9d71c02006-02-08 00:52:33303
Junio C Hamano7bd050f2011-09-22 06:32:22304.footnote, .footnoteref {
305 font-size: 0.8em;
306}
307
308span.footnote, span.footnoteref {
309 vertical-align: super;
310}
311
312#footnotes {
313 margin: 20px 0 20px 0;
314 padding: 7px 0 0 0;
315}
316
317#footnotes div.footnote {
318 margin: 0 0 5px 0;
319}
320
321#footnotes hr {
322 border: none;
323 border-top: 1px solid silver;
324 height: 1px;
325 text-align: left;
326 margin-left: 0;
327 width: 20%;
328 min-width: 100px;
329}
330
Junio C Hamano9d971152012-12-19 00:43:11331div.colist td {
332 padding-right: 0.5em;
333 padding-bottom: 0.3em;
334 vertical-align: top;
335}
336div.colist td img {
337 margin-top: 0.3em;
Junio C Hamanod9d71c02006-02-08 00:52:33338}
Junio C Hamanoba4b9282008-07-06 05:20:31339
Junio C Hamano9d971152012-12-19 00:43:11340@media print {
341 #footer-badges { display: none; }
342}
343
344#toc {
Junio C Hamano7bd050f2011-09-22 06:32:22345 margin-bottom: 2.5em;
346}
347
Junio C Hamano9d971152012-12-19 00:43:11348#toctitle {
Junio C Hamanoba4b9282008-07-06 05:20:31349 color: #527bbd;
Junio C Hamanoba4b9282008-07-06 05:20:31350 font-size: 1.1em;
351 font-weight: bold;
352 margin-top: 1.0em;
353 margin-bottom: 0.1em;
354}
355
Junio C Hamano9d971152012-12-19 00:43:11356div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
Junio C Hamanoba4b9282008-07-06 05:20:31357 margin-top: 0;
358 margin-bottom: 0;
359}
360div.toclevel2 {
361 margin-left: 2em;
362 font-size: 0.9em;
363}
364div.toclevel3 {
365 margin-left: 4em;
366 font-size: 0.9em;
367}
368div.toclevel4 {
369 margin-left: 6em;
370 font-size: 0.9em;
371}
Junio C Hamano9d971152012-12-19 00:43:11372
373span.aqua { color: aqua; }
374span.black { color: black; }
375span.blue { color: blue; }
376span.fuchsia { color: fuchsia; }
377span.gray { color: gray; }
378span.green { color: green; }
379span.lime { color: lime; }
380span.maroon { color: maroon; }
381span.navy { color: navy; }
382span.olive { color: olive; }
383span.purple { color: purple; }
384span.red { color: red; }
385span.silver { color: silver; }
386span.teal { color: teal; }
387span.white { color: white; }
388span.yellow { color: yellow; }
389
390span.aqua-background { background: aqua; }
391span.black-background { background: black; }
392span.blue-background { background: blue; }
393span.fuchsia-background { background: fuchsia; }
394span.gray-background { background: gray; }
395span.green-background { background: green; }
396span.lime-background { background: lime; }
397span.maroon-background { background: maroon; }
398span.navy-background { background: navy; }
399span.olive-background { background: olive; }
400span.purple-background { background: purple; }
401span.red-background { background: red; }
402span.silver-background { background: silver; }
403span.teal-background { background: teal; }
404span.white-background { background: white; }
405span.yellow-background { background: yellow; }
406
407span.big { font-size: 2em; }
408span.small { font-size: 0.6em; }
409
410span.underline { text-decoration: underline; }
411span.overline { text-decoration: overline; }
412span.line-through { text-decoration: line-through; }
413
414div.unbreakable { page-break-inside: avoid; }
415
416
417/*
418 * xhtml11 specific
419 *
420 * */
421
422div.tableblock {
423 margin-top: 1.0em;
424 margin-bottom: 1.5em;
425}
426div.tableblock > table {
427 border: 3px solid #527bbd;
428}
429thead, p.table.header {
430 font-weight: bold;
431 color: #527bbd;
432}
433p.table {
434 margin-top: 0;
435}
436/* Because the table frame attribute is overriden by CSS in most browsers. */
437div.tableblock > table[frame="void"] {
438 border-style: none;
439}
440div.tableblock > table[frame="hsides"] {
441 border-left-style: none;
442 border-right-style: none;
443}
444div.tableblock > table[frame="vsides"] {
445 border-top-style: none;
446 border-bottom-style: none;
447}
448
449
450/*
451 * html5 specific
452 *
453 * */
454
455table.tableblock {
456 margin-top: 1.0em;
457 margin-bottom: 1.5em;
458}
459thead, p.tableblock.header {
460 font-weight: bold;
461 color: #527bbd;
462}
463p.tableblock {
464 margin-top: 0;
465}
466table.tableblock {
467 border-width: 3px;
468 border-spacing: 0px;
469 border-style: solid;
470 border-color: #527bbd;
471 border-collapse: collapse;
472}
473th.tableblock, td.tableblock {
474 border-width: 1px;
475 padding: 4px;
476 border-style: solid;
477 border-color: #527bbd;
478}
479
480table.tableblock.frame-topbot {
481 border-left-style: hidden;
482 border-right-style: hidden;
483}
484table.tableblock.frame-sides {
485 border-top-style: hidden;
486 border-bottom-style: hidden;
487}
488table.tableblock.frame-none {
489 border-style: hidden;
490}
491
492th.tableblock.halign-left, td.tableblock.halign-left {
493 text-align: left;
494}
495th.tableblock.halign-center, td.tableblock.halign-center {
496 text-align: center;
497}
498th.tableblock.halign-right, td.tableblock.halign-right {
499 text-align: right;
500}
501
502th.tableblock.valign-top, td.tableblock.valign-top {
503 vertical-align: top;
504}
505th.tableblock.valign-middle, td.tableblock.valign-middle {
506 vertical-align: middle;
507}
508th.tableblock.valign-bottom, td.tableblock.valign-bottom {
509 vertical-align: bottom;
510}
511
512
513/*
514 * manpage specific
515 *
516 * */
517
518body.manpage h1 {
Junio C Hamano68cf15a2010-11-06 01:01:59519 padding-top: 0.5em;
520 padding-bottom: 0.5em;
521 border-top: 2px solid silver;
522 border-bottom: 2px solid silver;
523}
Junio C Hamano9d971152012-12-19 00:43:11524body.manpage h2 {
Junio C Hamano68cf15a2010-11-06 01:01:59525 border-style: none;
526}
Junio C Hamano9d971152012-12-19 00:43:11527body.manpage div.sectionbody {
528 margin-left: 3em;
Junio C Hamano68cf15a2010-11-06 01:01:59529}
530
531@media print {
Junio C Hamano9d971152012-12-19 00:43:11532 body.manpage div#toc { display: none; }
Junio C Hamano68cf15a2010-11-06 01:01:59533}
534
Junio C Hamanod9d71c02006-02-08 00:52:33535
Junio C Hamanod9d71c02006-02-08 00:52:33536</style>
Junio C Hamano7bd050f2011-09-22 06:32:22537<script type="text/javascript">
538/*<![CDATA[*/
Junio C Hamano7bd050f2011-09-22 06:32:22539var asciidoc = { // Namespace.
540
541/////////////////////////////////////////////////////////////////////
542// Table Of Contents generator
543/////////////////////////////////////////////////////////////////////
544
545/* Author: Mihai Bazon, September 2002
546 * http://students.infoiasi.ro/~mishoo
547 *
548 * Table Of Content generator
549 * Version: 0.4
550 *
551 * Feel free to use this script under the terms of the GNU General Public
552 * License, as long as you do not remove or alter this notice.
553 */
554
555 /* modified by Troy D. Hanson, September 2006. License: GPL */
556 /* modified by Stuart Rackham, 2006, 2009. License: GPL */
557
558// toclevels = 1..4.
559toc: function (toclevels) {
560
561 function getText(el) {
562 var text = "";
563 for (var i = el.firstChild; i != null; i = i.nextSibling) {
564 if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
565 text += i.data;
566 else if (i.firstChild != null)
567 text += getText(i);
568 }
569 return text;
570 }
571
572 function TocEntry(el, text, toclevel) {
573 this.element = el;
574 this.text = text;
575 this.toclevel = toclevel;
576 }
577
578 function tocEntries(el, toclevels) {
579 var result = new Array;
Junio C Hamano9d971152012-12-19 00:43:11580 var re = new RegExp('[hH]([1-'+(toclevels+1)+'])');
Junio C Hamano7bd050f2011-09-22 06:32:22581 // Function that scans the DOM tree for header elements (the DOM2
582 // nodeIterator API would be a better technique but not supported by all
583 // browsers).
584 var iterate = function (el) {
585 for (var i = el.firstChild; i != null; i = i.nextSibling) {
586 if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
587 var mo = re.exec(i.tagName);
588 if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
589 result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
590 }
591 iterate(i);
592 }
593 }
594 }
595 iterate(el);
596 return result;
597 }
598
599 var toc = document.getElementById("toc");
Junio C Hamano9d971152012-12-19 00:43:11600 if (!toc) {
601 return;
602 }
603
604 // Delete existing TOC entries in case we're reloading the TOC.
605 var tocEntriesToRemove = [];
606 var i;
607 for (i = 0; i < toc.childNodes.length; i++) {
608 var entry = toc.childNodes[i];
609 if (entry.nodeName.toLowerCase() == 'div'
610 && entry.getAttribute("class")
611 && entry.getAttribute("class").match(/^toclevel/))
612 tocEntriesToRemove.push(entry);
613 }
614 for (i = 0; i < tocEntriesToRemove.length; i++) {
615 toc.removeChild(tocEntriesToRemove[i]);
616 }
617
618 // Rebuild TOC entries.
Junio C Hamano7bd050f2011-09-22 06:32:22619 var entries = tocEntries(document.getElementById("content"), toclevels);
620 for (var i = 0; i < entries.length; ++i) {
621 var entry = entries[i];
622 if (entry.element.id == "")
623 entry.element.id = "_toc_" + i;
624 var a = document.createElement("a");
625 a.href = "#" + entry.element.id;
626 a.appendChild(document.createTextNode(entry.text));
627 var div = document.createElement("div");
628 div.appendChild(a);
629 div.className = "toclevel" + entry.toclevel;
630 toc.appendChild(div);
631 }
632 if (entries.length == 0)
633 toc.parentNode.removeChild(toc);
634},
635
636
637/////////////////////////////////////////////////////////////////////
638// Footnotes generator
639/////////////////////////////////////////////////////////////////////
640
641/* Based on footnote generation code from:
642 * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
643 */
644
645footnotes: function () {
Junio C Hamano9d971152012-12-19 00:43:11646 // Delete existing footnote entries in case we're reloading the footnodes.
647 var i;
Junio C Hamano7bd050f2011-09-22 06:32:22648 var noteholder = document.getElementById("footnotes");
Junio C Hamano9d971152012-12-19 00:43:11649 if (!noteholder) {
650 return;
651 }
652 var entriesToRemove = [];
653 for (i = 0; i < noteholder.childNodes.length; i++) {
654 var entry = noteholder.childNodes[i];
655 if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote")
656 entriesToRemove.push(entry);
657 }
658 for (i = 0; i < entriesToRemove.length; i++) {
659 noteholder.removeChild(entriesToRemove[i]);
660 }
661
662 // Rebuild footnote entries.
663 var cont = document.getElementById("content");
Junio C Hamano7bd050f2011-09-22 06:32:22664 var spans = cont.getElementsByTagName("span");
665 var refs = {};
666 var n = 0;
667 for (i=0; i<spans.length; i++) {
668 if (spans[i].className == "footnote") {
669 n++;
Junio C Hamano9d971152012-12-19 00:43:11670 var note = spans[i].getAttribute("data-note");
671 if (!note) {
672 // Use [\s\S] in place of . so multi-line matches work.
673 // Because JavaScript has no s (dotall) regex flag.
674 note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
675 spans[i].innerHTML =
676 "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
677 "' title='View footnote' class='footnote'>" + n + "</a>]";
678 spans[i].setAttribute("data-note", note);
679 }
Junio C Hamano7bd050f2011-09-22 06:32:22680 noteholder.innerHTML +=
681 "<div class='footnote' id='_footnote_" + n + "'>" +
682 "<a href='#_footnoteref_" + n + "' title='Return to text'>" +
683 n + "</a>. " + note + "</div>";
Junio C Hamano7bd050f2011-09-22 06:32:22684 var id =spans[i].getAttribute("id");
685 if (id != null) refs["#"+id] = n;
686 }
687 }
688 if (n == 0)
689 noteholder.parentNode.removeChild(noteholder);
690 else {
691 // Process footnoterefs.
692 for (i=0; i<spans.length; i++) {
693 if (spans[i].className == "footnoteref") {
694 var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
695 href = href.match(/#.*/)[0]; // Because IE return full URL.
696 n = refs[href];
697 spans[i].innerHTML =
698 "[<a href='#_footnote_" + n +
699 "' title='View footnote' class='footnote'>" + n + "</a>]";
700 }
701 }
702 }
Junio C Hamano9d971152012-12-19 00:43:11703},
704
705install: function(toclevels) {
706 var timerId;
707
708 function reinstall() {
709 asciidoc.footnotes();
710 if (toclevels) {
711 asciidoc.toc(toclevels);
712 }
713 }
714
715 function reinstallAndRemoveTimer() {
716 clearInterval(timerId);
717 reinstall();
718 }
719
720 timerId = setInterval(reinstall, 500);
721 if (document.addEventListener)
722 document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false);
723 else
724 window.onload = reinstallAndRemoveTimer;
Junio C Hamano7bd050f2011-09-22 06:32:22725}
726
727}
Junio C Hamano9d971152012-12-19 00:43:11728asciidoc.install();
Junio C Hamano7bd050f2011-09-22 06:32:22729/*]]>*/
730</script>
Junio C Hamanod9d71c02006-02-08 00:52:33731</head>
Junio C Hamano9d971152012-12-19 00:43:11732<body class="manpage">
Junio C Hamanod9d71c02006-02-08 00:52:33733<div id="header">
734<h1>
735git-show(1) Manual Page
736</h1>
737<h2>NAME</h2>
738<div class="sectionbody">
739<p>git-show -
Junio C Hamano7d23f5e2006-12-16 07:44:04740 Show various types of objects
Junio C Hamanod9d71c02006-02-08 00:52:33741</p>
742</div>
743</div>
Junio C Hamano7bd050f2011-09-22 06:32:22744<div id="content">
Junio C Hamano9d971152012-12-19 00:43:11745<div class="sect1">
Junio C Hamano68cf15a2010-11-06 01:01:59746<h2 id="_synopsis">SYNOPSIS</h2>
Junio C Hamanod9d71c02006-02-08 00:52:33747<div class="sectionbody">
Junio C Hamano15567bc2011-07-23 00:51:59748<div class="verseblock">
Junio C Hamano9d971152012-12-19 00:43:11749<pre class="content"><em>git show</em> [options] &lt;object&gt;&#8230;</pre>
750<div class="attribution">
Junio C Hamano15567bc2011-07-23 00:51:59751</div></div>
Junio C Hamanod9d71c02006-02-08 00:52:33752</div>
Junio C Hamano9d971152012-12-19 00:43:11753</div>
754<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:31755<h2 id="_description">DESCRIPTION</h2>
Junio C Hamanod9d71c02006-02-08 00:52:33756<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:59757<div class="paragraph"><p>Shows one or more objects (blobs, trees, tags and commits).</p></div>
758<div class="paragraph"><p>For commits it shows the log message and textual diff. It also
Junio C Hamano7d23f5e2006-12-16 07:44:04759presents the merge commit in a special format as produced by
Junio C Hamano1aa40d22010-01-21 17:46:43760<em>git diff-tree --cc</em>.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:59761<div class="paragraph"><p>For tags, it shows the tag message and the referenced objects.</p></div>
762<div class="paragraph"><p>For trees, it shows the names (equivalent to <em>git ls-tree</em>
Junio C Hamanoba4b9282008-07-06 05:20:31763with --name-only).</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:59764<div class="paragraph"><p>For plain blobs, it shows the plain contents.</p></div>
765<div class="paragraph"><p>The command takes options applicable to the <em>git diff-tree</em> command to
Junio C Hamanoba4b9282008-07-06 05:20:31766control how the changes the commit introduces are shown.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:59767<div class="paragraph"><p>This manual page describes only the most frequently used options.</p></div>
Junio C Hamanod9d71c02006-02-08 00:52:33768</div>
Junio C Hamano9d971152012-12-19 00:43:11769</div>
770<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:31771<h2 id="_options">OPTIONS</h2>
Junio C Hamanod9d71c02006-02-08 00:52:33772<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:59773<div class="dlist"><dl>
774<dt class="hdlist1">
Junio C Hamano9e395072008-07-31 22:11:21775&lt;object&gt;&#8230;
Junio C Hamanod9d71c02006-02-08 00:52:33776</dt>
777<dd>
778<p>
Junio C Hamano9e395072008-07-31 22:11:21779 The names of objects to show.
Junio C Hamano2d47c622007-01-18 06:24:10780 For a more complete list of ways to spell object names, see
Junio C Hamanoa28a9202012-06-21 07:08:23781 "SPECIFYING REVISIONS" section in <a href="gitrevisions.html">gitrevisions(7)</a>.
Junio C Hamanod9d71c02006-02-08 00:52:33782</p>
783</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59784<dt class="hdlist1">
Junio C Hamanod2179ef2010-10-22 04:12:17785--pretty[=&lt;format&gt;]
Junio C Hamanod9d71c02006-02-08 00:52:33786</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59787<dt class="hdlist1">
Junio C Hamanod2179ef2010-10-22 04:12:17788--format=&lt;format&gt;
Junio C Hamano0a235222009-03-06 08:21:09789</dt>
Junio C Hamanod9d71c02006-02-08 00:52:33790<dd>
791<p>
Junio C Hamanoa3770f92007-07-25 08:53:33792 Pretty-print the contents of the commit logs in a given format,
Junio C Hamano0430e3a2007-05-15 03:13:17793 where <em>&lt;format&gt;</em> can be one of <em>oneline</em>, <em>short</em>, <em>medium</em>,
Junio C Hamanoe32ec8b2010-06-02 23:32:31794 <em>full</em>, <em>fuller</em>, <em>email</em>, <em>raw</em> and <em>format:&lt;string&gt;</em>. See
795 the "PRETTY FORMATS" section for some additional details for each
796 format. When omitted, the format defaults to <em>medium</em>.
Junio C Hamanod9d71c02006-02-08 00:52:33797</p>
Junio C Hamano68cf15a2010-11-06 01:01:59798<div class="paragraph"><p>Note: you can specify the default pretty format in the repository
Junio C Hamanoa28a9202012-06-21 07:08:23799configuration (see <a href="git-config.html">git-config(1)</a>).</p></div>
Junio C Hamano0430e3a2007-05-15 03:13:17800</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59801<dt class="hdlist1">
Junio C Hamanoee695f22007-06-21 00:35:36802--abbrev-commit
803</dt>
804<dd>
805<p>
806 Instead of showing the full 40-byte hexadecimal commit object
Junio C Hamano6efe3022009-01-13 16:47:56807 name, show only a partial prefix. Non default number of
Junio C Hamanoee695f22007-06-21 00:35:36808 digits can be specified with "--abbrev=&lt;n&gt;" (which also modifies
809 diff output, if it is displayed).
810</p>
Junio C Hamano68cf15a2010-11-06 01:01:59811<div class="paragraph"><p>This should make "--pretty=oneline" a whole lot more readable for
Junio C Hamanoba4b9282008-07-06 05:20:31812people using 80-column terminals.</p></div>
Junio C Hamanoee695f22007-06-21 00:35:36813</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59814<dt class="hdlist1">
Junio C Hamanof93530e2011-05-25 23:59:59815--no-abbrev-commit
816</dt>
817<dd>
818<p>
819 Show the full 40-byte hexadecimal commit object name. This negates
Junio C Hamano9d971152012-12-19 00:43:11820 <code>--abbrev-commit</code> and those options which imply it such as
Junio C Hamanof93530e2011-05-25 23:59:59821 "--oneline". It also overrides the <em>log.abbrevCommit</em> variable.
822</p>
823</dd>
824<dt class="hdlist1">
Junio C Hamano0a235222009-03-06 08:21:09825--oneline
826</dt>
827<dd>
828<p>
829 This is a shorthand for "--pretty=oneline --abbrev-commit"
830 used together.
831</p>
832</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59833<dt class="hdlist1">
Junio C Hamanoc5bb3b32013-08-05 22:43:36834--encoding=&lt;encoding&gt;
Junio C Hamano0430e3a2007-05-15 03:13:17835</dt>
836<dd>
837<p>
838 The commit objects record the encoding used for the log message
839 in their encoding header; this option can be used to tell the
840 command to re-code the commit log message in the encoding
841 preferred by the user. For non plumbing commands this
842 defaults to UTF-8.
843</p>
844</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59845<dt class="hdlist1">
Junio C Hamano60033462011-05-03 00:48:43846--notes[=&lt;ref&gt;]
Junio C Hamano57827fb2010-01-23 03:02:50847</dt>
848<dd>
849<p>
Junio C Hamanoa28a9202012-06-21 07:08:23850 Show the notes (see <a href="git-notes.html">git-notes(1)</a>) that annotate the
Junio C Hamano57827fb2010-01-23 03:02:50851 commit, when showing the commit log message. This is the default
Junio C Hamano9d971152012-12-19 00:43:11852 for <code>git log</code>, <code>git show</code> and <code>git whatchanged</code> commands when
853 there is no <code>--pretty</code>, <code>--format</code> nor <code>--oneline</code> option given
Junio C Hamano60033462011-05-03 00:48:43854 on the command line.
Junio C Hamano57827fb2010-01-23 03:02:50855</p>
Junio C Hamano60033462011-05-03 00:48:43856<div class="paragraph"><p>By default, the notes shown are from the notes refs listed in the
857<em>core.notesRef</em> and <em>notes.displayRef</em> variables (or corresponding
Junio C Hamanoa28a9202012-06-21 07:08:23858environment overrides). See <a href="git-config.html">git-config(1)</a> for more details.</p></div>
Junio C Hamano60033462011-05-03 00:48:43859<div class="paragraph"><p>With an optional <em>&lt;ref&gt;</em> argument, show this notes ref instead of the
Junio C Hamano9d971152012-12-19 00:43:11860default notes ref(s). The ref is taken to be in <code>refs/notes/</code> if it
Junio C Hamano60033462011-05-03 00:48:43861is not qualified.</p></div>
862<div class="paragraph"><p>Multiple --notes options can be combined to control which notes are
863being displayed. Examples: "--notes=foo" will show only notes from
864"refs/notes/foo"; "--notes=foo --notes" will show both notes from
865"refs/notes/foo" and from the default notes ref(s).</p></div>
Junio C Hamano31667362010-03-25 00:38:53866</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59867<dt class="hdlist1">
Junio C Hamano60033462011-05-03 00:48:43868--no-notes
869</dt>
870<dd>
871<p>
Junio C Hamano9d971152012-12-19 00:43:11872 Do not show notes. This negates the above <code>--notes</code> option, by
Junio C Hamano60033462011-05-03 00:48:43873 resetting the list of notes refs from which notes are shown.
874 Options are parsed in the order given on the command line, so e.g.
875 "--notes --notes=foo --no-notes --notes=bar" will only show notes
876 from "refs/notes/bar".
877</p>
878</dd>
879<dt class="hdlist1">
880--show-notes[=&lt;ref&gt;]
881</dt>
882<dt class="hdlist1">
Junio C Hamano31667362010-03-25 00:38:53883--[no-]standard-notes
884</dt>
885<dd>
886<p>
Junio C Hamano60033462011-05-03 00:48:43887 These options are deprecated. Use the above --notes/--no-notes
888 options instead.
Junio C Hamano31667362010-03-25 00:38:53889</p>
Junio C Hamano57827fb2010-01-23 03:02:50890</dd>
Junio C Hamano0acb1ae2012-09-24 21:28:13891<dt class="hdlist1">
892--show-signature
893</dt>
894<dd>
895<p>
896 Check the validity of a signed commit object by passing the signature
Junio C Hamano9d971152012-12-19 00:43:11897 to <code>gpg --verify</code> and show the output.
Junio C Hamano0acb1ae2012-09-24 21:28:13898</p>
899</dd>
Junio C Hamanoba4b9282008-07-06 05:20:31900</dl></div>
Junio C Hamano0430e3a2007-05-15 03:13:17901</div>
Junio C Hamano9d971152012-12-19 00:43:11902</div>
903<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:31904<h2 id="_pretty_formats">PRETTY FORMATS</h2>
Junio C Hamano0430e3a2007-05-15 03:13:17905<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:59906<div class="paragraph"><p>If the commit is a merge, and if the pretty-format
Junio C Hamano0430e3a2007-05-15 03:13:17907is not <em>oneline</em>, <em>email</em> or <em>raw</em>, an additional line is
908inserted before the <em>Author:</em> line. This line begins with
909"Merge: " and the sha1s of ancestral commits are printed,
910separated by spaces. Note that the listed commits may not
911necessarily be the list of the <strong>direct</strong> parent commits if you
912have limited your view of history: for example, if you are
913only interested in changes related to a certain directory or
Junio C Hamanoba4b9282008-07-06 05:20:31914file.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:59915<div class="paragraph"><p>There are several built-in formats, and you can define
Junio C Hamanoa574a092010-06-13 19:57:10916additional formats by setting a pretty.&lt;name&gt;
917config option to either another format name, or a
918<em>format:</em> string, as described below (see
Junio C Hamanoa28a9202012-06-21 07:08:23919<a href="git-config.html">git-config(1)</a>). Here are the details of the
Junio C Hamanoa574a092010-06-13 19:57:10920built-in formats:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:59921<div class="ulist"><ul>
Junio C Hamanoa340aaa2006-11-23 02:47:33922<li>
923<p>
924<em>oneline</em>
925</p>
926<div class="literalblock">
927<div class="content">
Junio C Hamano9d971152012-12-19 00:43:11928<pre><code>&lt;sha1&gt; &lt;title line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:33929</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:59930<div class="paragraph"><p>This is designed to be as compact as possible.</p></div>
Junio C Hamanoa340aaa2006-11-23 02:47:33931</li>
932<li>
933<p>
934<em>short</em>
935</p>
936<div class="literalblock">
937<div class="content">
Junio C Hamano9d971152012-12-19 00:43:11938<pre><code>commit &lt;sha1&gt;
939Author: &lt;author&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:33940</div></div>
941<div class="literalblock">
942<div class="content">
Junio C Hamano9d971152012-12-19 00:43:11943<pre><code>&lt;title line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:33944</div></div>
945</li>
946<li>
947<p>
948<em>medium</em>
949</p>
950<div class="literalblock">
951<div class="content">
Junio C Hamano9d971152012-12-19 00:43:11952<pre><code>commit &lt;sha1&gt;
Junio C Hamanoa340aaa2006-11-23 02:47:33953Author: &lt;author&gt;
Junio C Hamano9d971152012-12-19 00:43:11954Date: &lt;author date&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:33955</div></div>
956<div class="literalblock">
957<div class="content">
Junio C Hamano9d971152012-12-19 00:43:11958<pre><code>&lt;title line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:33959</div></div>
960<div class="literalblock">
961<div class="content">
Junio C Hamano9d971152012-12-19 00:43:11962<pre><code>&lt;full commit message&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:33963</div></div>
964</li>
965<li>
966<p>
967<em>full</em>
968</p>
969<div class="literalblock">
970<div class="content">
Junio C Hamano9d971152012-12-19 00:43:11971<pre><code>commit &lt;sha1&gt;
Junio C Hamanoa340aaa2006-11-23 02:47:33972Author: &lt;author&gt;
Junio C Hamano9d971152012-12-19 00:43:11973Commit: &lt;committer&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:33974</div></div>
975<div class="literalblock">
976<div class="content">
Junio C Hamano9d971152012-12-19 00:43:11977<pre><code>&lt;title line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:33978</div></div>
979<div class="literalblock">
980<div class="content">
Junio C Hamano9d971152012-12-19 00:43:11981<pre><code>&lt;full commit message&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:33982</div></div>
983</li>
984<li>
985<p>
986<em>fuller</em>
987</p>
988<div class="literalblock">
989<div class="content">
Junio C Hamano9d971152012-12-19 00:43:11990<pre><code>commit &lt;sha1&gt;
Junio C Hamano6a3c8272008-12-19 21:38:18991Author: &lt;author&gt;
Junio C Hamanoba4b9282008-07-06 05:20:31992AuthorDate: &lt;author date&gt;
Junio C Hamano6a3c8272008-12-19 21:38:18993Commit: &lt;committer&gt;
Junio C Hamano9d971152012-12-19 00:43:11994CommitDate: &lt;committer date&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:33995</div></div>
996<div class="literalblock">
997<div class="content">
Junio C Hamano9d971152012-12-19 00:43:11998<pre><code>&lt;title line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:33999</div></div>
1000<div class="literalblock">
1001<div class="content">
Junio C Hamano9d971152012-12-19 00:43:111002<pre><code>&lt;full commit message&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:331003</div></div>
1004</li>
1005<li>
1006<p>
1007<em>email</em>
1008</p>
1009<div class="literalblock">
1010<div class="content">
Junio C Hamano9d971152012-12-19 00:43:111011<pre><code>From &lt;sha1&gt; &lt;date&gt;
Junio C Hamanoa340aaa2006-11-23 02:47:331012From: &lt;author&gt;
Junio C Hamanoba4b9282008-07-06 05:20:311013Date: &lt;author date&gt;
Junio C Hamano9d971152012-12-19 00:43:111014Subject: [PATCH] &lt;title line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:331015</div></div>
1016<div class="literalblock">
1017<div class="content">
Junio C Hamano9d971152012-12-19 00:43:111018<pre><code>&lt;full commit message&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:331019</div></div>
1020</li>
1021<li>
1022<p>
1023<em>raw</em>
1024</p>
Junio C Hamano68cf15a2010-11-06 01:01:591025<div class="paragraph"><p>The <em>raw</em> format shows the entire commit exactly as
Junio C Hamanoe3f080d2013-04-22 02:27:131026stored in the commit object. Notably, the SHA-1s are
Junio C Hamanoa340aaa2006-11-23 02:47:331027displayed in full, regardless of whether --abbrev or
1028--no-abbrev are used, and <em>parents</em> information show the
1029true parent commits, without taking grafts nor history
Junio C Hamanoba4b9282008-07-06 05:20:311030simplification into account.</p></div>
Junio C Hamanoa340aaa2006-11-23 02:47:331031</li>
Junio C Hamanoa3fd83c2007-03-02 10:34:361032<li>
1033<p>
Junio C Hamanoe32ec8b2010-06-02 23:32:311034<em>format:&lt;string&gt;</em>
Junio C Hamanoa3fd83c2007-03-02 10:34:361035</p>
Junio C Hamano68cf15a2010-11-06 01:01:591036<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:361037you want to show. It works a little bit like printf format,
1038with the notable exception that you get a newline with <em>%n</em>
Junio C Hamanoba4b9282008-07-06 05:20:311039instead of <em>\n</em>.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591040<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:311041would show something like this:</p></div>
Junio C Hamano0430e3a2007-05-15 03:13:171042<div class="listingblock">
1043<div class="content">
Junio C Hamano9d971152012-12-19 00:43:111044<pre><code>The author of fe6e0ee was Junio C Hamano, 23 hours ago
1045The 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:171046</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591047<div class="paragraph"><p>The placeholders are:</p></div>
1048<div class="ulist"><ul>
Junio C Hamanoa3fd83c2007-03-02 10:34:361049<li>
1050<p>
1051<em>%H</em>: commit hash
1052</p>
1053</li>
1054<li>
1055<p>
1056<em>%h</em>: abbreviated commit hash
1057</p>
1058</li>
1059<li>
1060<p>
1061<em>%T</em>: tree hash
1062</p>
1063</li>
1064<li>
1065<p>
1066<em>%t</em>: abbreviated tree hash
1067</p>
1068</li>
1069<li>
1070<p>
1071<em>%P</em>: parent hashes
1072</p>
1073</li>
1074<li>
1075<p>
1076<em>%p</em>: abbreviated parent hashes
1077</p>
1078</li>
1079<li>
1080<p>
1081<em>%an</em>: author name
1082</p>
1083</li>
1084<li>
1085<p>
Junio C Hamano04e768d2013-04-23 19:19:261086<em>%aN</em>: author name (respecting .mailmap, see <a href="git-shortlog.html">git-shortlog(1)</a>
1087 or <a href="git-blame.html">git-blame(1)</a>)
Junio C Hamanof5a93622008-07-16 03:23:571088</p>
1089</li>
1090<li>
1091<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:361092<em>%ae</em>: author email
1093</p>
1094</li>
1095<li>
1096<p>
Junio C Hamano04e768d2013-04-23 19:19:261097<em>%aE</em>: author email (respecting .mailmap, see
1098 <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:191099</p>
1100</li>
1101<li>
1102<p>
Junio C Hamanoa387df32008-08-29 08:56:581103<em>%ad</em>: author date (format respects --date= option)
Junio C Hamanoa3fd83c2007-03-02 10:34:361104</p>
1105</li>
1106<li>
1107<p>
1108<em>%aD</em>: author date, RFC2822 style
1109</p>
1110</li>
1111<li>
1112<p>
1113<em>%ar</em>: author date, relative
1114</p>
1115</li>
1116<li>
1117<p>
1118<em>%at</em>: author date, UNIX timestamp
1119</p>
1120</li>
1121<li>
1122<p>
Junio C Hamano02f130b2007-07-14 08:26:561123<em>%ai</em>: author date, ISO 8601 format
1124</p>
1125</li>
1126<li>
1127<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:361128<em>%cn</em>: committer name
1129</p>
1130</li>
1131<li>
1132<p>
Junio C Hamano04e768d2013-04-23 19:19:261133<em>%cN</em>: committer name (respecting .mailmap, see
1134 <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:571135</p>
1136</li>
1137<li>
1138<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:361139<em>%ce</em>: committer email
1140</p>
1141</li>
1142<li>
1143<p>
Junio C Hamano04e768d2013-04-23 19:19:261144<em>%cE</em>: committer email (respecting .mailmap, see
1145 <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:191146</p>
1147</li>
1148<li>
1149<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:361150<em>%cd</em>: committer date
1151</p>
1152</li>
1153<li>
1154<p>
1155<em>%cD</em>: committer date, RFC2822 style
1156</p>
1157</li>
1158<li>
1159<p>
1160<em>%cr</em>: committer date, relative
1161</p>
1162</li>
1163<li>
1164<p>
1165<em>%ct</em>: committer date, UNIX timestamp
1166</p>
1167</li>
1168<li>
1169<p>
Junio C Hamano02f130b2007-07-14 08:26:561170<em>%ci</em>: committer date, ISO 8601 format
1171</p>
1172</li>
1173<li>
1174<p>
Junio C Hamanoa28a9202012-06-21 07:08:231175<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:021176</p>
1177</li>
1178<li>
1179<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:361180<em>%e</em>: encoding
1181</p>
1182</li>
1183<li>
1184<p>
1185<em>%s</em>: subject
1186</p>
1187</li>
1188<li>
1189<p>
Junio C Hamano5f9a6f02009-04-06 08:26:561190<em>%f</em>: sanitized subject line, suitable for a filename
1191</p>
1192</li>
1193<li>
1194<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:361195<em>%b</em>: body
1196</p>
1197</li>
1198<li>
1199<p>
Junio C Hamanocb39aea2010-05-09 07:24:481200<em>%B</em>: raw body (unwrapped subject and body)
1201</p>
1202</li>
1203<li>
1204<p>
Junio C Hamano3b70d3c2009-11-21 17:37:371205<em>%N</em>: commit notes
1206</p>
1207</li>
1208<li>
1209<p>
Junio C Hamano0acb1ae2012-09-24 21:28:131210<em>%GG</em>: raw verification message from GPG for a signed commit
1211</p>
1212</li>
1213<li>
1214<p>
Junio C Hamanoedf80bd2013-04-05 22:14:361215<em>%G?</em>: show "G" for a Good signature, "B" for a Bad signature, "U" for a good,
1216 untrusted signature and "N" for no signature
Junio C Hamano0acb1ae2012-09-24 21:28:131217</p>
1218</li>
1219<li>
1220<p>
1221<em>%GS</em>: show the name of the signer for a signed commit
1222</p>
1223</li>
1224<li>
1225<p>
Junio C Hamano5e7f1312013-03-21 22:49:011226<em>%GK</em>: show the key used to sign a signed commit
1227</p>
1228</li>
1229<li>
1230<p>
Junio C Hamano9d971152012-12-19 00:43:111231<em>%gD</em>: reflog selector, e.g., <code>refs/stash@{1}</code>
Junio C Hamanoc21ab052009-10-31 04:03:551232</p>
1233</li>
1234<li>
1235<p>
Junio C Hamano9d971152012-12-19 00:43:111236<em>%gd</em>: shortened reflog selector, e.g., <code>stash@{1}</code>
Junio C Hamanoc21ab052009-10-31 04:03:551237</p>
1238</li>
1239<li>
1240<p>
Junio C Hamano962f3a32011-12-22 20:21:441241<em>%gn</em>: reflog identity name
1242</p>
1243</li>
1244<li>
1245<p>
Junio C Hamano04e768d2013-04-23 19:19:261246<em>%gN</em>: reflog identity name (respecting .mailmap, see
1247 <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:441248</p>
1249</li>
1250<li>
1251<p>
1252<em>%ge</em>: reflog identity email
1253</p>
1254</li>
1255<li>
1256<p>
Junio C Hamano04e768d2013-04-23 19:19:261257<em>%gE</em>: reflog identity email (respecting .mailmap, see
1258 <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:441259</p>
1260</li>
1261<li>
1262<p>
Junio C Hamanoc21ab052009-10-31 04:03:551263<em>%gs</em>: reflog subject
1264</p>
1265</li>
1266<li>
1267<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:361268<em>%Cred</em>: switch color to red
1269</p>
1270</li>
1271<li>
1272<p>
1273<em>%Cgreen</em>: switch color to green
1274</p>
1275</li>
1276<li>
1277<p>
1278<em>%Cblue</em>: switch color to blue
1279</p>
1280</li>
1281<li>
1282<p>
1283<em>%Creset</em>: reset color
1284</p>
1285</li>
1286<li>
1287<p>
Junio C Hamanoabad6da2013-01-06 09:06:321288<em>%C(&#8230;)</em>: color specification, as described in color.branch.* config option;
1289 adding <code>auto,</code> at the beginning will emit color only when colors are
1290 enabled for log output (by <code>color.diff</code>, <code>color.ui</code>, or <code>--color</code>, and
1291 respecting the <code>auto</code> settings of the former if we are going to a
Junio C Hamano04e768d2013-04-23 19:19:261292 terminal). <code>auto</code> alone (i.e. <code>%C(auto)</code>) will turn on auto coloring
1293 on the next placeholders until the color is switched again.
Junio C Hamanocc0cb312009-01-22 03:38:501294</p>
1295</li>
1296<li>
1297<p>
Junio C Hamanod9e0e5d2007-04-14 16:22:041298<em>%m</em>: left, right or boundary mark
1299</p>
1300</li>
1301<li>
1302<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:361303<em>%n</em>: newline
1304</p>
Junio C Hamano0430e3a2007-05-15 03:13:171305</li>
Junio C Hamanob78d2592008-04-09 09:39:081306<li>
1307<p>
Junio C Hamanoa9701f02010-01-21 00:42:161308<em>%%</em>: a raw <em>%</em>
1309</p>
1310</li>
1311<li>
1312<p>
Junio C Hamanob78d2592008-04-09 09:39:081313<em>%x00</em>: print a byte from a hex code
1314</p>
1315</li>
Junio C Hamanobf984de2009-11-23 06:11:191316<li>
1317<p>
1318<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:231319 <a href="git-shortlog.html">git-shortlog(1)</a>.
Junio C Hamanobf984de2009-11-23 06:11:191320</p>
1321</li>
Junio C Hamano04e768d2013-04-23 19:19:261322<li>
1323<p>
1324<em>%&lt;(&lt;N&gt;[,trunc|ltrunc|mtrunc])</em>: make the next placeholder take at
1325 least N columns, padding spaces on the right if necessary.
1326 Optionally truncate at the beginning (ltrunc), the middle (mtrunc)
1327 or the end (trunc) if the output is longer than N columns.
1328 Note that truncating only works correctly with N &gt;= 2.
1329</p>
1330</li>
1331<li>
1332<p>
1333<em>%&lt;|(&lt;N&gt;)</em>: make the next placeholder take at least until Nth
1334 columns, padding spaces on the right if necessary
1335</p>
1336</li>
1337<li>
1338<p>
1339<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>
1340 respectively, but padding spaces on the left
1341</p>
1342</li>
1343<li>
1344<p>
1345<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>
1346 respectively, except that if the next placeholder takes more spaces
1347 than given and there are spaces on its left, use those spaces
1348</p>
1349</li>
1350<li>
1351<p>
1352<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>
1353 respectively, but padding both sides (i.e. the text is centered)
1354</p>
1355</li>
Junio C Hamanoba4b9282008-07-06 05:20:311356</ul></div>
Junio C Hamanoa3fd83c2007-03-02 10:34:361357</li>
Junio C Hamanoc21ab052009-10-31 04:03:551358</ul></div>
1359<div class="admonitionblock">
1360<table><tr>
1361<td class="icon">
1362<div class="title">Note</div>
1363</td>
1364<td class="content">Some placeholders may depend on other options given to the
Junio C Hamano9d971152012-12-19 00:43:111365revision traversal engine. For example, the <code>%g*</code> reflog options will
Junio C Hamanoc21ab052009-10-31 04:03:551366insert an empty string unless we are traversing reflog entries (e.g., by
Junio C Hamano9d971152012-12-19 00:43:111367<code>git log -g</code>). The <code>%d</code> placeholder will use the "short" decoration
1368format if <code>--decorate</code> was not already provided on the command line.</td>
Junio C Hamanoc21ab052009-10-31 04:03:551369</tr></table>
1370</div>
Junio C Hamano9d971152012-12-19 00:43:111371<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:591372is inserted immediately before the expansion if and only if the
1373placeholder expands to a non-empty string.</p></div>
Junio C Hamano9d971152012-12-19 00:43:111374<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:591375immediately precede the expansion are deleted if and only if the
1376placeholder expands to an empty string.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591377<div class="paragraph"><p>If you add a ` ` (space) after <em>%</em> of a placeholder, a space
Junio C Hamano89a57342010-06-22 23:22:551378is inserted immediately before the expansion if and only if the
1379placeholder expands to a non-empty string.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591380<div class="ulist"><ul>
Junio C Hamano6fb124c2008-06-13 10:04:011381<li>
1382<p>
1383<em>tformat:</em>
1384</p>
Junio C Hamano68cf15a2010-11-06 01:01:591385<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:011386provides "terminator" semantics instead of "separator" semantics. In
1387other words, each commit has the message terminator character (usually a
1388newline) appended, rather than a separator placed between entries.
1389This means that the final entry of a single-line format will be properly
1390terminated with a new line, just as the "oneline" format does.
Junio C Hamanoba4b9282008-07-06 05:20:311391For example:</p></div>
Junio C Hamano6fb124c2008-06-13 10:04:011392<div class="listingblock">
1393<div class="content">
Junio C Hamano9d971152012-12-19 00:43:111394<pre><code>$ git log -2 --pretty=format:%h 4da45bef \
Junio C Hamano6fb124c2008-06-13 10:04:011395 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
13964da45be
13977134973 -- NO NEWLINE
1398
1399$ git log -2 --pretty=tformat:%h 4da45bef \
1400 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
14014da45be
Junio C Hamano9d971152012-12-19 00:43:1114027134973</code></pre>
Junio C Hamano6fb124c2008-06-13 10:04:011403</div></div>
Junio C Hamano9d971152012-12-19 00:43:111404<div class="paragraph"><p>In addition, any unrecognized string that has a <code>%</code> in it is interpreted
1405as if it has <code>tformat:</code> in front of it. For example, these two are
Junio C Hamano0a235222009-03-06 08:21:091406equivalent:</p></div>
1407<div class="listingblock">
1408<div class="content">
Junio C Hamano9d971152012-12-19 00:43:111409<pre><code>$ git log -2 --pretty=tformat:%h 4da45bef
1410$ git log -2 --pretty=%h 4da45bef</code></pre>
Junio C Hamano0a235222009-03-06 08:21:091411</div></div>
Junio C Hamano6fb124c2008-06-13 10:04:011412</li>
Junio C Hamanoba4b9282008-07-06 05:20:311413</ul></div>
Junio C Hamanod9d71c02006-02-08 00:52:331414</div>
Junio C Hamano9d971152012-12-19 00:43:111415</div>
1416<div class="sect1">
Junio C Hamano58f587a2013-07-22 19:20:591417<h2 id="_common_diff_options">COMMON DIFF OPTIONS</h2>
1418<div class="sectionbody">
1419<div class="dlist"><dl>
1420<dt class="hdlist1">
1421-p
1422</dt>
1423<dt class="hdlist1">
1424-u
1425</dt>
1426<dt class="hdlist1">
1427--patch
1428</dt>
1429<dd>
1430<p>
1431 Generate patch (see section on generating patches).
1432
1433</p>
1434</dd>
1435<dt class="hdlist1">
1436-s
1437</dt>
1438<dt class="hdlist1">
1439--no-patch
1440</dt>
1441<dd>
1442<p>
1443 Suppress diff output. Useful for commands like <code>git show</code> that
1444 show the patch by default, or to cancel the effect of <code>--patch</code>.
1445</p>
1446</dd>
1447<dt class="hdlist1">
1448-U&lt;n&gt;
1449</dt>
1450<dt class="hdlist1">
1451--unified=&lt;n&gt;
1452</dt>
1453<dd>
1454<p>
1455 Generate diffs with &lt;n&gt; lines of context instead of
1456 the usual three.
1457 Implies <code>-p</code>.
1458</p>
1459</dd>
1460<dt class="hdlist1">
1461--raw
1462</dt>
1463<dd>
1464<p>
1465 Generate the raw format.
1466
1467</p>
1468</dd>
1469<dt class="hdlist1">
1470--patch-with-raw
1471</dt>
1472<dd>
1473<p>
1474 Synonym for <code>-p --raw</code>.
1475</p>
1476</dd>
1477<dt class="hdlist1">
1478--minimal
1479</dt>
1480<dd>
1481<p>
1482 Spend extra time to make sure the smallest possible
1483 diff is produced.
1484</p>
1485</dd>
1486<dt class="hdlist1">
1487--patience
1488</dt>
1489<dd>
1490<p>
1491 Generate a diff using the "patience diff" algorithm.
1492</p>
1493</dd>
1494<dt class="hdlist1">
1495--histogram
1496</dt>
1497<dd>
1498<p>
1499 Generate a diff using the "histogram diff" algorithm.
1500</p>
1501</dd>
1502<dt class="hdlist1">
1503--diff-algorithm={patience|minimal|histogram|myers}
1504</dt>
1505<dd>
1506<p>
1507 Choose a diff algorithm. The variants are as follows:
1508</p>
1509<div class="openblock">
1510<div class="content">
1511<div class="dlist"><dl>
1512<dt class="hdlist1">
1513<code>default</code>, <code>myers</code>
1514</dt>
1515<dd>
1516<p>
1517 The basic greedy diff algorithm. Currently, this is the default.
1518</p>
1519</dd>
1520<dt class="hdlist1">
1521<code>minimal</code>
1522</dt>
1523<dd>
1524<p>
1525 Spend extra time to make sure the smallest possible diff is
1526 produced.
1527</p>
1528</dd>
1529<dt class="hdlist1">
1530<code>patience</code>
1531</dt>
1532<dd>
1533<p>
1534 Use "patience diff" algorithm when generating patches.
1535</p>
1536</dd>
1537<dt class="hdlist1">
1538<code>histogram</code>
1539</dt>
1540<dd>
1541<p>
1542 This algorithm extends the patience algorithm to "support
1543 low-occurrence common elements".
1544</p>
1545</dd>
1546</dl></div>
1547</div></div>
1548<div class="paragraph"><p>For instance, if you configured diff.algorithm variable to a
1549non-default value and want to use the default one, then you
1550have to use <code>--diff-algorithm=default</code> option.</p></div>
1551</dd>
1552<dt class="hdlist1">
1553--stat[=&lt;width&gt;[,&lt;name-width&gt;[,&lt;count&gt;]]]
1554</dt>
1555<dd>
1556<p>
1557 Generate a diffstat. By default, as much space as necessary
1558 will be used for the filename part, and the rest for the graph
1559 part. Maximum width defaults to terminal width, or 80 columns
1560 if not connected to a terminal, and can be overridden by
1561 <code>&lt;width&gt;</code>. The width of the filename part can be limited by
1562 giving another width <code>&lt;name-width&gt;</code> after a comma. The width
1563 of the graph part can be limited by using
1564 <code>--stat-graph-width=&lt;width&gt;</code> (affects all commands generating
1565 a stat graph) or by setting <code>diff.statGraphWidth=&lt;width&gt;</code>
1566 (does not affect <code>git format-patch</code>).
1567 By giving a third parameter <code>&lt;count&gt;</code>, you can limit the
1568 output to the first <code>&lt;count&gt;</code> lines, followed by <code>...</code> if
1569 there are more.
1570</p>
1571<div class="paragraph"><p>These parameters can also be set individually with <code>--stat-width=&lt;width&gt;</code>,
1572<code>--stat-name-width=&lt;name-width&gt;</code> and <code>--stat-count=&lt;count&gt;</code>.</p></div>
1573</dd>
1574<dt class="hdlist1">
1575--numstat
1576</dt>
1577<dd>
1578<p>
1579 Similar to <code>--stat</code>, but shows number of added and
1580 deleted lines in decimal notation and pathname without
1581 abbreviation, to make it more machine friendly. For
1582 binary files, outputs two <code>-</code> instead of saying
1583 <code>0 0</code>.
1584</p>
1585</dd>
1586<dt class="hdlist1">
1587--shortstat
1588</dt>
1589<dd>
1590<p>
1591 Output only the last line of the <code>--stat</code> format containing total
1592 number of modified files, as well as number of added and deleted
1593 lines.
1594</p>
1595</dd>
1596<dt class="hdlist1">
1597--dirstat[=&lt;param1,param2,&#8230;&gt;]
1598</dt>
1599<dd>
1600<p>
1601 Output the distribution of relative amount of changes for each
1602 sub-directory. The behavior of <code>--dirstat</code> can be customized by
1603 passing it a comma separated list of parameters.
1604 The defaults are controlled by the <code>diff.dirstat</code> configuration
1605 variable (see <a href="git-config.html">git-config(1)</a>).
1606 The following parameters are available:
1607</p>
1608<div class="openblock">
1609<div class="content">
1610<div class="dlist"><dl>
1611<dt class="hdlist1">
1612<code>changes</code>
1613</dt>
1614<dd>
1615<p>
1616 Compute the dirstat numbers by counting the lines that have been
1617 removed from the source, or added to the destination. This ignores
1618 the amount of pure code movements within a file. In other words,
1619 rearranging lines in a file is not counted as much as other changes.
1620 This is the default behavior when no parameter is given.
1621</p>
1622</dd>
1623<dt class="hdlist1">
1624<code>lines</code>
1625</dt>
1626<dd>
1627<p>
1628 Compute the dirstat numbers by doing the regular line-based diff
1629 analysis, and summing the removed/added line counts. (For binary
1630 files, count 64-byte chunks instead, since binary files have no
1631 natural concept of lines). This is a more expensive <code>--dirstat</code>
1632 behavior than the <code>changes</code> behavior, but it does count rearranged
1633 lines within a file as much as other changes. The resulting output
1634 is consistent with what you get from the other <code>--*stat</code> options.
1635</p>
1636</dd>
1637<dt class="hdlist1">
1638<code>files</code>
1639</dt>
1640<dd>
1641<p>
1642 Compute the dirstat numbers by counting the number of files changed.
1643 Each changed file counts equally in the dirstat analysis. This is
1644 the computationally cheapest <code>--dirstat</code> behavior, since it does
1645 not have to look at the file contents at all.
1646</p>
1647</dd>
1648<dt class="hdlist1">
1649<code>cumulative</code>
1650</dt>
1651<dd>
1652<p>
1653 Count changes in a child directory for the parent directory as well.
1654 Note that when using <code>cumulative</code>, the sum of the percentages
1655 reported may exceed 100%. The default (non-cumulative) behavior can
1656 be specified with the <code>noncumulative</code> parameter.
1657</p>
1658</dd>
1659<dt class="hdlist1">
1660&lt;limit&gt;
1661</dt>
1662<dd>
1663<p>
1664 An integer parameter specifies a cut-off percent (3% by default).
1665 Directories contributing less than this percentage of the changes
1666 are not shown in the output.
1667</p>
1668</dd>
1669</dl></div>
1670</div></div>
1671<div class="paragraph"><p>Example: The following will count changed files, while ignoring
1672directories with less than 10% of the total amount of changed files,
1673and accumulating child directory counts in the parent directories:
1674<code>--dirstat=files,10,cumulative</code>.</p></div>
1675</dd>
1676<dt class="hdlist1">
1677--summary
1678</dt>
1679<dd>
1680<p>
1681 Output a condensed summary of extended header information
1682 such as creations, renames and mode changes.
1683</p>
1684</dd>
1685<dt class="hdlist1">
1686--patch-with-stat
1687</dt>
1688<dd>
1689<p>
1690 Synonym for <code>-p --stat</code>.
1691</p>
1692</dd>
1693<dt class="hdlist1">
1694-z
1695</dt>
1696<dd>
1697<p>
1698 Separate the commits with NULs instead of with new newlines.
1699</p>
1700<div class="paragraph"><p>Also, when <code>--raw</code> or <code>--numstat</code> has been given, do not munge
1701pathnames and use NULs as output field terminators.</p></div>
1702<div class="paragraph"><p>Without this option, each pathname output will have TAB, LF, double quotes,
1703and backslash characters replaced with <code>\t</code>, <code>\n</code>, <code>\"</code>, and <code>\\</code>,
1704respectively, and the pathname will be enclosed in double quotes if
1705any of those replacements occurred.</p></div>
1706</dd>
1707<dt class="hdlist1">
1708--name-only
1709</dt>
1710<dd>
1711<p>
1712 Show only names of changed files.
1713</p>
1714</dd>
1715<dt class="hdlist1">
1716--name-status
1717</dt>
1718<dd>
1719<p>
1720 Show only names and status of changed files. See the description
1721 of the <code>--diff-filter</code> option on what the status letters mean.
1722</p>
1723</dd>
1724<dt class="hdlist1">
1725--submodule[=&lt;format&gt;]
1726</dt>
1727<dd>
1728<p>
1729 Specify how differences in submodules are shown. When <code>--submodule</code>
1730 or <code>--submodule=log</code> is given, the <em>log</em> format is used. This format lists
1731 the commits in the range like <a href="git-submodule.html">git-submodule(1)</a> <code>summary</code> does.
1732 Omitting the <code>--submodule</code> option or specifying <code>--submodule=short</code>,
1733 uses the <em>short</em> format. This format just shows the names of the commits
1734 at the beginning and end of the range. Can be tweaked via the
1735 <code>diff.submodule</code> configuration variable.
1736</p>
1737</dd>
1738<dt class="hdlist1">
1739--color[=&lt;when&gt;]
1740</dt>
1741<dd>
1742<p>
1743 Show colored diff.
1744 <code>--color</code> (i.e. without <em>=&lt;when&gt;</em>) is the same as <code>--color=always</code>.
1745 <em>&lt;when&gt;</em> can be one of <code>always</code>, <code>never</code>, or <code>auto</code>.
1746</p>
1747</dd>
1748<dt class="hdlist1">
1749--no-color
1750</dt>
1751<dd>
1752<p>
1753 Turn off colored diff.
1754 It is the same as <code>--color=never</code>.
1755</p>
1756</dd>
1757<dt class="hdlist1">
1758--word-diff[=&lt;mode&gt;]
1759</dt>
1760<dd>
1761<p>
1762 Show a word diff, using the &lt;mode&gt; to delimit changed words.
1763 By default, words are delimited by whitespace; see
1764 <code>--word-diff-regex</code> below. The &lt;mode&gt; defaults to <em>plain</em>, and
1765 must be one of:
1766</p>
1767<div class="openblock">
1768<div class="content">
1769<div class="dlist"><dl>
1770<dt class="hdlist1">
1771color
1772</dt>
1773<dd>
1774<p>
1775 Highlight changed words using only colors. Implies <code>--color</code>.
1776</p>
1777</dd>
1778<dt class="hdlist1">
1779plain
1780</dt>
1781<dd>
1782<p>
1783 Show words as <code>[-removed-]</code> and <code>{+added+}</code>. Makes no
1784 attempts to escape the delimiters if they appear in the input,
1785 so the output may be ambiguous.
1786</p>
1787</dd>
1788<dt class="hdlist1">
1789porcelain
1790</dt>
1791<dd>
1792<p>
1793 Use a special line-based format intended for script
1794 consumption. Added/removed/unchanged runs are printed in the
1795 usual unified diff format, starting with a <code>+</code>/<code>-</code>/` `
1796 character at the beginning of the line and extending to the
1797 end of the line. Newlines in the input are represented by a
1798 tilde <code>~</code> on a line of its own.
1799</p>
1800</dd>
1801<dt class="hdlist1">
1802none
1803</dt>
1804<dd>
1805<p>
1806 Disable word diff again.
1807</p>
1808</dd>
1809</dl></div>
1810</div></div>
1811<div class="paragraph"><p>Note that despite the name of the first mode, color is used to
1812highlight the changed parts in all modes if enabled.</p></div>
1813</dd>
1814<dt class="hdlist1">
1815--word-diff-regex=&lt;regex&gt;
1816</dt>
1817<dd>
1818<p>
1819 Use &lt;regex&gt; to decide what a word is, instead of considering
1820 runs of non-whitespace to be a word. Also implies
1821 <code>--word-diff</code> unless it was already enabled.
1822</p>
1823<div class="paragraph"><p>Every non-overlapping match of the
1824&lt;regex&gt; is considered a word. Anything between these matches is
1825considered whitespace and ignored(!) for the purposes of finding
1826differences. You may want to append <code>|[^[:space:]]</code> to your regular
1827expression to make sure that it matches all non-whitespace characters.
1828A match that contains a newline is silently truncated(!) at the
1829newline.</p></div>
1830<div class="paragraph"><p>The regex can also be set via a diff driver or configuration option, see
1831<a href="gitattributes.html">gitattributes(1)</a> or <a href="git-config.html">git-config(1)</a>. Giving it explicitly
1832overrides any diff driver or configuration setting. Diff drivers
1833override configuration settings.</p></div>
1834</dd>
1835<dt class="hdlist1">
1836--color-words[=&lt;regex&gt;]
1837</dt>
1838<dd>
1839<p>
1840 Equivalent to <code>--word-diff=color</code> plus (if a regex was
1841 specified) <code>--word-diff-regex=&lt;regex&gt;</code>.
1842</p>
1843</dd>
1844<dt class="hdlist1">
1845--no-renames
1846</dt>
1847<dd>
1848<p>
1849 Turn off rename detection, even when the configuration
1850 file gives the default to do so.
1851</p>
1852</dd>
1853<dt class="hdlist1">
1854--check
1855</dt>
1856<dd>
1857<p>
1858 Warn if changes introduce whitespace errors. What are
1859 considered whitespace errors is controlled by <code>core.whitespace</code>
1860 configuration. By default, trailing whitespaces (including
1861 lines that solely consist of whitespaces) and a space character
1862 that is immediately followed by a tab character inside the
1863 initial indent of the line are considered whitespace errors.
1864 Exits with non-zero status if problems are found. Not compatible
1865 with --exit-code.
1866</p>
1867</dd>
1868<dt class="hdlist1">
1869--full-index
1870</dt>
1871<dd>
1872<p>
1873 Instead of the first handful of characters, show the full
1874 pre- and post-image blob object names on the "index"
1875 line when generating patch format output.
1876</p>
1877</dd>
1878<dt class="hdlist1">
1879--binary
1880</dt>
1881<dd>
1882<p>
1883 In addition to <code>--full-index</code>, output a binary diff that
1884 can be applied with <code>git-apply</code>.
1885</p>
1886</dd>
1887<dt class="hdlist1">
1888--abbrev[=&lt;n&gt;]
1889</dt>
1890<dd>
1891<p>
1892 Instead of showing the full 40-byte hexadecimal object
1893 name in diff-raw format output and diff-tree header
1894 lines, show only a partial prefix. This is
1895 independent of the <code>--full-index</code> option above, which controls
1896 the diff-patch output format. Non default number of
1897 digits can be specified with <code>--abbrev=&lt;n&gt;</code>.
1898</p>
1899</dd>
1900<dt class="hdlist1">
1901-B[&lt;n&gt;][/&lt;m&gt;]
1902</dt>
1903<dt class="hdlist1">
1904--break-rewrites[=[&lt;n&gt;][/&lt;m&gt;]]
1905</dt>
1906<dd>
1907<p>
1908 Break complete rewrite changes into pairs of delete and
1909 create. This serves two purposes:
1910</p>
1911<div class="paragraph"><p>It affects the way a change that amounts to a total rewrite of a file
1912not as a series of deletion and insertion mixed together with a very
1913few lines that happen to match textually as the context, but as a
1914single deletion of everything old followed by a single insertion of
1915everything new, and the number <code>m</code> controls this aspect of the -B
1916option (defaults to 60%). <code>-B/70%</code> specifies that less than 30% of the
1917original should remain in the result for Git to consider it a total
1918rewrite (i.e. otherwise the resulting patch will be a series of
1919deletion and insertion mixed together with context lines).</p></div>
1920<div class="paragraph"><p>When used with -M, a totally-rewritten file is also considered as the
1921source of a rename (usually -M only considers a file that disappeared
1922as the source of a rename), and the number <code>n</code> controls this aspect of
1923the -B option (defaults to 50%). <code>-B20%</code> specifies that a change with
1924addition and deletion compared to 20% or more of the file&#8217;s size are
1925eligible for being picked up as a possible source of a rename to
1926another file.</p></div>
1927</dd>
1928<dt class="hdlist1">
1929-M[&lt;n&gt;]
1930</dt>
1931<dt class="hdlist1">
1932--find-renames[=&lt;n&gt;]
1933</dt>
1934<dd>
1935<p>
1936 If generating diffs, detect and report renames for each commit.
1937 For following files across renames while traversing history, see
1938 <code>--follow</code>.
1939 If <code>n</code> is specified, it is a threshold on the similarity
1940 index (i.e. amount of addition/deletions compared to the
1941 file&#8217;s size). For example, <code>-M90%</code> means Git should consider a
1942 delete/add pair to be a rename if more than 90% of the file
1943 hasn&#8217;t changed. Without a <code>%</code> sign, the number is to be read as
1944 a fraction, with a decimal point before it. I.e., <code>-M5</code> becomes
1945 0.5, and is thus the same as <code>-M50%</code>. Similarly, <code>-M05</code> is
1946 the same as <code>-M5%</code>. To limit detection to exact renames, use
1947 <code>-M100%</code>. The default similarity index is 50%.
1948</p>
1949</dd>
1950<dt class="hdlist1">
1951-C[&lt;n&gt;]
1952</dt>
1953<dt class="hdlist1">
1954--find-copies[=&lt;n&gt;]
1955</dt>
1956<dd>
1957<p>
1958 Detect copies as well as renames. See also <code>--find-copies-harder</code>.
1959 If <code>n</code> is specified, it has the same meaning as for <code>-M&lt;n&gt;</code>.
1960</p>
1961</dd>
1962<dt class="hdlist1">
1963--find-copies-harder
1964</dt>
1965<dd>
1966<p>
1967 For performance reasons, by default, <code>-C</code> option finds copies only
1968 if the original file of the copy was modified in the same
1969 changeset. This flag makes the command
1970 inspect unmodified files as candidates for the source of
1971 copy. This is a very expensive operation for large
1972 projects, so use it with caution. Giving more than one
1973 <code>-C</code> option has the same effect.
1974</p>
1975</dd>
1976<dt class="hdlist1">
1977-D
1978</dt>
1979<dt class="hdlist1">
1980--irreversible-delete
1981</dt>
1982<dd>
1983<p>
1984 Omit the preimage for deletes, i.e. print only the header but not
1985 the diff between the preimage and <code>/dev/null</code>. The resulting patch
1986 is not meant to be applied with <code>patch</code> nor <code>git apply</code>; this is
1987 solely for people who want to just concentrate on reviewing the
1988 text after the change. In addition, the output obviously lack
1989 enough information to apply such a patch in reverse, even manually,
1990 hence the name of the option.
1991</p>
1992<div class="paragraph"><p>When used together with <code>-B</code>, omit also the preimage in the deletion part
1993of a delete/create pair.</p></div>
1994</dd>
1995<dt class="hdlist1">
1996-l&lt;num&gt;
1997</dt>
1998<dd>
1999<p>
2000 The <code>-M</code> and <code>-C</code> options require O(n^2) processing time where n
2001 is the number of potential rename/copy targets. This
2002 option prevents rename/copy detection from running if
2003 the number of rename/copy targets exceeds the specified
2004 number.
2005</p>
2006</dd>
2007<dt class="hdlist1">
2008--diff-filter=[(A|C|D|M|R|T|U|X|B)&#8230;[*]]
2009</dt>
2010<dd>
2011<p>
2012 Select only files that are Added (<code>A</code>), Copied (<code>C</code>),
2013 Deleted (<code>D</code>), Modified (<code>M</code>), Renamed (<code>R</code>), have their
2014 type (i.e. regular file, symlink, submodule, &#8230;) changed (<code>T</code>),
2015 are Unmerged (<code>U</code>), are
2016 Unknown (<code>X</code>), or have had their pairing Broken (<code>B</code>).
2017 Any combination of the filter characters (including none) can be used.
2018 When <code>*</code> (All-or-none) is added to the combination, all
2019 paths are selected if there is any file that matches
2020 other criteria in the comparison; if there is no file
2021 that matches other criteria, nothing is selected.
2022</p>
2023</dd>
2024<dt class="hdlist1">
2025-S&lt;string&gt;
2026</dt>
2027<dd>
2028<p>
2029 Look for differences that change the number of occurrences of
2030 the specified string (i.e. addition/deletion) in a file.
2031 Intended for the scripter&#8217;s use.
2032</p>
2033<div class="paragraph"><p>It is useful when you&#8217;re looking for an exact block of code (like a
2034struct), and want to know the history of that block since it first
2035came into being: use the feature iteratively to feed the interesting
2036block in the preimage back into <code>-S</code>, and keep going until you get the
2037very first version of the block.</p></div>
2038</dd>
2039<dt class="hdlist1">
2040-G&lt;regex&gt;
2041</dt>
2042<dd>
2043<p>
2044 Look for differences whose patch text contains added/removed
2045 lines that match &lt;regex&gt;.
2046</p>
2047<div class="paragraph"><p>To illustrate the difference between <code>-S&lt;regex&gt; --pickaxe-regex</code> and
2048<code>-G&lt;regex&gt;</code>, consider a commit with the following diff in the same
2049file:</p></div>
2050<div class="listingblock">
2051<div class="content">
2052<pre><code>+ return !regexec(regexp, two-&gt;ptr, 1, &amp;regmatch, 0);
2053...
2054- hit = !regexec(regexp, mf2.ptr, 1, &amp;regmatch, 0);</code></pre>
2055</div></div>
2056<div class="paragraph"><p>While <code>git log -G"regexec\(regexp"</code> will show this commit, <code>git log
2057-S"regexec\(regexp" --pickaxe-regex</code> will not (because the number of
2058occurrences of that string did not change).</p></div>
2059<div class="paragraph"><p>See the <em>pickaxe</em> entry in <a href="gitdiffcore.html">gitdiffcore(7)</a> for more
2060information.</p></div>
2061</dd>
2062<dt class="hdlist1">
2063--pickaxe-all
2064</dt>
2065<dd>
2066<p>
2067 When <code>-S</code> or <code>-G</code> finds a change, show all the changes in that
2068 changeset, not just the files that contain the change
2069 in &lt;string&gt;.
2070</p>
2071</dd>
2072<dt class="hdlist1">
2073--pickaxe-regex
2074</dt>
2075<dd>
2076<p>
2077 Treat the &lt;string&gt; given to <code>-S</code> as an extended POSIX regular
2078 expression to match.
2079</p>
2080</dd>
2081<dt class="hdlist1">
2082-O&lt;orderfile&gt;
2083</dt>
2084<dd>
2085<p>
2086 Output the patch in the order specified in the
2087 &lt;orderfile&gt;, which has one shell glob pattern per line.
2088</p>
2089</dd>
2090<dt class="hdlist1">
2091-R
2092</dt>
2093<dd>
2094<p>
2095 Swap two inputs; that is, show differences from index or
2096 on-disk file to tree contents.
2097</p>
2098</dd>
2099<dt class="hdlist1">
2100--relative[=&lt;path&gt;]
2101</dt>
2102<dd>
2103<p>
2104 When run from a subdirectory of the project, it can be
2105 told to exclude changes outside the directory and show
2106 pathnames relative to it with this option. When you are
2107 not in a subdirectory (e.g. in a bare repository), you
2108 can name which subdirectory to make the output relative
2109 to by giving a &lt;path&gt; as an argument.
2110</p>
2111</dd>
2112<dt class="hdlist1">
2113-a
2114</dt>
2115<dt class="hdlist1">
2116--text
2117</dt>
2118<dd>
2119<p>
2120 Treat all files as text.
2121</p>
2122</dd>
2123<dt class="hdlist1">
2124--ignore-space-at-eol
2125</dt>
2126<dd>
2127<p>
2128 Ignore changes in whitespace at EOL.
2129</p>
2130</dd>
2131<dt class="hdlist1">
2132-b
2133</dt>
2134<dt class="hdlist1">
2135--ignore-space-change
2136</dt>
2137<dd>
2138<p>
2139 Ignore changes in amount of whitespace. This ignores whitespace
2140 at line end, and considers all other sequences of one or
2141 more whitespace characters to be equivalent.
2142</p>
2143</dd>
2144<dt class="hdlist1">
2145-w
2146</dt>
2147<dt class="hdlist1">
2148--ignore-all-space
2149</dt>
2150<dd>
2151<p>
2152 Ignore whitespace when comparing lines. This ignores
2153 differences even if one line has whitespace where the other
2154 line has none.
2155</p>
2156</dd>
2157<dt class="hdlist1">
2158--ignore-blank-lines
2159</dt>
2160<dd>
2161<p>
2162 Ignore changes whose lines are all blank.
2163</p>
2164</dd>
2165<dt class="hdlist1">
2166--inter-hunk-context=&lt;lines&gt;
2167</dt>
2168<dd>
2169<p>
2170 Show the context between diff hunks, up to the specified number
2171 of lines, thereby fusing hunks that are close to each other.
2172</p>
2173</dd>
2174<dt class="hdlist1">
2175-W
2176</dt>
2177<dt class="hdlist1">
2178--function-context
2179</dt>
2180<dd>
2181<p>
2182 Show whole surrounding functions of changes.
2183</p>
2184</dd>
2185<dt class="hdlist1">
2186--ext-diff
2187</dt>
2188<dd>
2189<p>
2190 Allow an external diff helper to be executed. If you set an
2191 external diff driver with <a href="gitattributes.html">gitattributes(5)</a>, you need
2192 to use this option with <a href="git-log.html">git-log(1)</a> and friends.
2193</p>
2194</dd>
2195<dt class="hdlist1">
2196--no-ext-diff
2197</dt>
2198<dd>
2199<p>
2200 Disallow external diff drivers.
2201</p>
2202</dd>
2203<dt class="hdlist1">
2204--textconv
2205</dt>
2206<dt class="hdlist1">
2207--no-textconv
2208</dt>
2209<dd>
2210<p>
2211 Allow (or disallow) external text conversion filters to be run
2212 when comparing binary files. See <a href="gitattributes.html">gitattributes(5)</a> for
2213 details. Because textconv filters are typically a one-way
2214 conversion, the resulting diff is suitable for human
2215 consumption, but cannot be applied. For this reason, textconv
2216 filters are enabled by default only for <a href="git-diff.html">git-diff(1)</a> and
2217 <a href="git-log.html">git-log(1)</a>, but not for <a href="git-format-patch.html">git-format-patch(1)</a> or
2218 diff plumbing commands.
2219</p>
2220</dd>
2221<dt class="hdlist1">
2222--ignore-submodules[=&lt;when&gt;]
2223</dt>
2224<dd>
2225<p>
2226 Ignore changes to submodules in the diff generation. &lt;when&gt; can be
2227 either "none", "untracked", "dirty" or "all", which is the default.
2228 Using "none" will consider the submodule modified when it either contains
2229 untracked or modified files or its HEAD differs from the commit recorded
2230 in the superproject and can be used to override any settings of the
2231 <em>ignore</em> option in <a href="git-config.html">git-config(1)</a> or <a href="gitmodules.html">gitmodules(5)</a>. When
2232 "untracked" is used submodules are not considered dirty when they only
2233 contain untracked content (but they are still scanned for modified
2234 content). Using "dirty" ignores all changes to the work tree of submodules,
2235 only changes to the commits stored in the superproject are shown (this was
2236 the behavior until 1.7.0). Using "all" hides all changes to submodules.
2237</p>
2238</dd>
2239<dt class="hdlist1">
2240--src-prefix=&lt;prefix&gt;
2241</dt>
2242<dd>
2243<p>
2244 Show the given source prefix instead of "a/".
2245</p>
2246</dd>
2247<dt class="hdlist1">
2248--dst-prefix=&lt;prefix&gt;
2249</dt>
2250<dd>
2251<p>
2252 Show the given destination prefix instead of "b/".
2253</p>
2254</dd>
2255<dt class="hdlist1">
2256--no-prefix
2257</dt>
2258<dd>
2259<p>
2260 Do not show any source or destination prefix.
2261</p>
2262</dd>
2263</dl></div>
2264<div class="paragraph"><p>For more detailed explanation on these common options, see also
2265<a href="gitdiffcore.html">gitdiffcore(7)</a>.</p></div>
2266</div>
2267</div>
2268<div class="sect1">
2269<h2 id="_generating_patches_with_p">Generating patches with -p</h2>
2270<div class="sectionbody">
2271<div class="paragraph"><p>When "git-diff-index", "git-diff-tree", or "git-diff-files" are run
2272with a <em>-p</em> option, "git diff" without the <em>--raw</em> option, or
2273"git log" with the "-p" option, they
2274do not produce the output described above; instead they produce a
2275patch file. You can customize the creation of such patches via the
2276GIT_EXTERNAL_DIFF and the GIT_DIFF_OPTS environment variables.</p></div>
2277<div class="paragraph"><p>What the -p option produces is slightly different from the traditional
2278diff format:</p></div>
2279<div class="olist arabic"><ol class="arabic">
2280<li>
2281<p>
2282It is preceded with a "git diff" header that looks like this:
2283</p>
2284<div class="literalblock">
2285<div class="content">
2286<pre><code>diff --git a/file1 b/file2</code></pre>
2287</div></div>
2288<div class="paragraph"><p>The <code>a/</code> and <code>b/</code> filenames are the same unless rename/copy is
2289involved. Especially, even for a creation or a deletion,
2290<code>/dev/null</code> is <em>not</em> used in place of the <code>a/</code> or <code>b/</code> filenames.</p></div>
2291<div class="paragraph"><p>When rename/copy is involved, <code>file1</code> and <code>file2</code> show the
2292name of the source file of the rename/copy and the name of
2293the file that rename/copy produces, respectively.</p></div>
2294</li>
2295<li>
2296<p>
2297It is followed by one or more extended header lines:
2298</p>
2299<div class="literalblock">
2300<div class="content">
2301<pre><code>old mode &lt;mode&gt;
2302new mode &lt;mode&gt;
2303deleted file mode &lt;mode&gt;
2304new file mode &lt;mode&gt;
2305copy from &lt;path&gt;
2306copy to &lt;path&gt;
2307rename from &lt;path&gt;
2308rename to &lt;path&gt;
2309similarity index &lt;number&gt;
2310dissimilarity index &lt;number&gt;
2311index &lt;hash&gt;..&lt;hash&gt; &lt;mode&gt;</code></pre>
2312</div></div>
2313<div class="paragraph"><p>File modes are printed as 6-digit octal numbers including the file type
2314and file permission bits.</p></div>
2315<div class="paragraph"><p>Path names in extended headers do not include the <code>a/</code> and <code>b/</code> prefixes.</p></div>
2316<div class="paragraph"><p>The similarity index is the percentage of unchanged lines, and
2317the dissimilarity index is the percentage of changed lines. It
2318is a rounded down integer, followed by a percent sign. The
2319similarity index value of 100% is thus reserved for two equal
2320files, while 100% dissimilarity means that no line from the old
2321file made it into the new one.</p></div>
2322<div class="paragraph"><p>The index line includes the SHA-1 checksum before and after the change.
2323The &lt;mode&gt; is included if the file mode does not change; otherwise,
2324separate lines indicate the old and the new mode.</p></div>
2325</li>
2326<li>
2327<p>
2328TAB, LF, double quote and backslash characters in pathnames
2329 are represented as <code>\t</code>, <code>\n</code>, <code>\"</code> and <code>\\</code>, respectively.
2330 If there is need for such substitution then the whole
2331 pathname is put in double quotes.
2332</p>
2333</li>
2334<li>
2335<p>
2336All the <code>file1</code> files in the output refer to files before the
2337 commit, and all the <code>file2</code> files refer to files after the commit.
2338 It is incorrect to apply each change to each file sequentially. For
2339 example, this patch will swap a and b:
2340</p>
2341<div class="literalblock">
2342<div class="content">
2343<pre><code>diff --git a/a b/b
2344rename from a
2345rename to b
2346diff --git a/b b/a
2347rename from b
2348rename to a</code></pre>
2349</div></div>
2350</li>
2351</ol></div>
2352</div>
2353</div>
2354<div class="sect1">
2355<h2 id="_combined_diff_format">combined diff format</h2>
2356<div class="sectionbody">
2357<div class="paragraph"><p>Any diff-generating command can take the &#8216;-c` or <code>--cc</code> option to
2358produce a <em>combined diff</em> when showing a merge. This is the default
2359format when showing merges with <a href="git-diff.html">git-diff(1)</a> or
2360<a href="git-show.html">git-show(1)</a>. Note also that you can give the `-m&#8217; option to any
2361of these commands to force generation of diffs with individual parents
2362of a merge.</p></div>
2363<div class="paragraph"><p>A <em>combined diff</em> format looks like this:</p></div>
2364<div class="listingblock">
2365<div class="content">
2366<pre><code>diff --combined describe.c
2367index fabadb8,cc95eb0..4866510
2368--- a/describe.c
2369+++ b/describe.c
2370@@@ -98,20 -98,12 +98,20 @@@
2371 return (a_date &gt; b_date) ? -1 : (a_date == b_date) ? 0 : 1;
2372 }
2373
2374- static void describe(char *arg)
2375 -static void describe(struct commit *cmit, int last_one)
2376++static void describe(char *arg, int last_one)
2377 {
2378 + unsigned char sha1[20];
2379 + struct commit *cmit;
2380 struct commit_list *list;
2381 static int initialized = 0;
2382 struct commit_name *n;
2383
2384 + if (get_sha1(arg, sha1) &lt; 0)
2385 + usage(describe_usage);
2386 + cmit = lookup_commit_reference(sha1);
2387 + if (!cmit)
2388 + usage(describe_usage);
2389 +
2390 if (!initialized) {
2391 initialized = 1;
2392 for_each_ref(get_name);</code></pre>
2393</div></div>
2394<div class="olist arabic"><ol class="arabic">
2395<li>
2396<p>
2397It is preceded with a "git diff" header, that looks like
2398 this (when <em>-c</em> option is used):
2399</p>
2400<div class="literalblock">
2401<div class="content">
2402<pre><code>diff --combined file</code></pre>
2403</div></div>
2404<div class="paragraph"><p>or like this (when <em>--cc</em> option is used):</p></div>
2405<div class="literalblock">
2406<div class="content">
2407<pre><code>diff --cc file</code></pre>
2408</div></div>
2409</li>
2410<li>
2411<p>
2412It is followed by one or more extended header lines
2413 (this example shows a merge with two parents):
2414</p>
2415<div class="literalblock">
2416<div class="content">
2417<pre><code>index &lt;hash&gt;,&lt;hash&gt;..&lt;hash&gt;
2418mode &lt;mode&gt;,&lt;mode&gt;..&lt;mode&gt;
2419new file mode &lt;mode&gt;
2420deleted file mode &lt;mode&gt;,&lt;mode&gt;</code></pre>
2421</div></div>
2422<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
2423the &lt;mode&gt; is different from the rest. Extended headers with
2424information about detected contents movement (renames and
2425copying detection) are designed to work with diff of two
2426&lt;tree-ish&gt; and are not used by combined diff format.</p></div>
2427</li>
2428<li>
2429<p>
2430It is followed by two-line from-file/to-file header
2431</p>
2432<div class="literalblock">
2433<div class="content">
2434<pre><code>--- a/file
2435+++ b/file</code></pre>
2436</div></div>
2437<div class="paragraph"><p>Similar to two-line header for traditional <em>unified</em> diff
2438format, <code>/dev/null</code> is used to signal created or deleted
2439files.</p></div>
2440</li>
2441<li>
2442<p>
2443Chunk header format is modified to prevent people from
2444 accidentally feeding it to <code>patch -p1</code>. Combined diff format
2445 was created for review of merge commit changes, and was not
2446 meant for apply. The change is similar to the change in the
2447 extended <em>index</em> header:
2448</p>
2449<div class="literalblock">
2450<div class="content">
2451<pre><code>@@@ &lt;from-file-range&gt; &lt;from-file-range&gt; &lt;to-file-range&gt; @@@</code></pre>
2452</div></div>
2453<div class="paragraph"><p>There are (number of parents + 1) <code>@</code> characters in the chunk
2454header for combined diff format.</p></div>
2455</li>
2456</ol></div>
2457<div class="paragraph"><p>Unlike the traditional <em>unified</em> diff format, which shows two
2458files 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
2459added to B), or <code>" "</code> (space&#8201;&#8212;&#8201;unchanged) prefix, this format
2460compares two or more files file1, file2,&#8230; with one file X, and
2461shows how X differs from each of fileN. One column for each of
2462fileN is prepended to the output line to note how X&#8217;s line is
2463different from it.</p></div>
2464<div class="paragraph"><p>A <code>-</code> character in the column N means that the line appears in
2465fileN but it does not appear in the result. A <code>+</code> character
2466in the column N means that the line appears in the result,
2467and fileN does not have that line (in other words, the line was
2468added, from the point of view of that parent).</p></div>
2469<div class="paragraph"><p>In the above example output, the function signature was changed
2470from both files (hence two <code>-</code> removals from both file1 and
2471file2, plus <code>++</code> to mean one line that was added does not appear
2472in either file1 nor file2). Also eight other lines are the same
2473from file1 but do not appear in file2 (hence prefixed with <code>+</code>).</p></div>
2474<div class="paragraph"><p>When shown by <code>git diff-tree -c</code>, it compares the parents of a
2475merge commit with the merge result (i.e. file1..fileN are the
2476parents). When shown by <code>git diff-files -c</code>, it compares the
2477two unresolved merge parents with the working tree file
2478(i.e. file1 is stage 2 aka "our version", file2 is stage 3 aka
2479"their version").</p></div>
2480</div>
2481</div>
2482<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:312483<h2 id="_examples">EXAMPLES</h2>
Junio C Hamano7d23f5e2006-12-16 07:44:042484<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:592485<div class="dlist"><dl>
2486<dt class="hdlist1">
Junio C Hamano9d971152012-12-19 00:43:112487<code>git show v1.0.0</code>
Junio C Hamano7d23f5e2006-12-16 07:44:042488</dt>
2489<dd>
2490<p>
Junio C Hamano9d971152012-12-19 00:43:112491 Shows the tag <code>v1.0.0</code>, along with the object the tags
Junio C Hamano775a0f42006-12-31 01:19:142492 points at.
Junio C Hamano7d23f5e2006-12-16 07:44:042493</p>
2494</dd>
Junio C Hamano68cf15a2010-11-06 01:01:592495<dt class="hdlist1">
Junio C Hamano9d971152012-12-19 00:43:112496<code>git show v1.0.0^{tree}</code>
Junio C Hamano7d23f5e2006-12-16 07:44:042497</dt>
2498<dd>
2499<p>
Junio C Hamano9d971152012-12-19 00:43:112500 Shows the tree pointed to by the tag <code>v1.0.0</code>.
Junio C Hamano7d23f5e2006-12-16 07:44:042501</p>
2502</dd>
Junio C Hamano68cf15a2010-11-06 01:01:592503<dt class="hdlist1">
Junio C Hamano9d971152012-12-19 00:43:112504<code>git show -s --format=%s v1.0.0^{commit}</code>
Junio C Hamanoc3fda572010-11-09 19:41:302505</dt>
2506<dd>
2507<p>
2508 Shows the subject of the commit pointed to by the
Junio C Hamano9d971152012-12-19 00:43:112509 tag <code>v1.0.0</code>.
Junio C Hamanoc3fda572010-11-09 19:41:302510</p>
2511</dd>
2512<dt class="hdlist1">
Junio C Hamano9d971152012-12-19 00:43:112513<code>git show next~10:Documentation/README</code>
Junio C Hamanodb911ee2007-02-28 08:13:522514</dt>
2515<dd>
2516<p>
Junio C Hamano9d971152012-12-19 00:43:112517 Shows the contents of the file <code>Documentation/README</code> as
Junio C Hamano7d23f5e2006-12-16 07:44:042518 they were current in the 10th last commit of the branch
Junio C Hamano9d971152012-12-19 00:43:112519 <code>next</code>.
Junio C Hamanodb911ee2007-02-28 08:13:522520</p>
2521</dd>
Junio C Hamano68cf15a2010-11-06 01:01:592522<dt class="hdlist1">
Junio C Hamano9d971152012-12-19 00:43:112523<code>git show master:Makefile master:t/Makefile</code>
Junio C Hamanodb911ee2007-02-28 08:13:522524</dt>
2525<dd>
2526<p>
Junio C Hamano7d23f5e2006-12-16 07:44:042527 Concatenates the contents of said Makefiles in the head
Junio C Hamano9d971152012-12-19 00:43:112528 of the branch <code>master</code>.
Junio C Hamanodb911ee2007-02-28 08:13:522529</p>
2530</dd>
Junio C Hamanoba4b9282008-07-06 05:20:312531</dl></div>
Junio C Hamano7d23f5e2006-12-16 07:44:042532</div>
Junio C Hamano9d971152012-12-19 00:43:112533</div>
2534<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:312535<h2 id="_discussion">Discussion</h2>
Junio C Hamano775a0f42006-12-31 01:19:142536<div class="sectionbody">
Junio C Hamano076ffcc2013-02-06 05:13:212537<div class="paragraph"><p>At the core level, Git is character encoding agnostic.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592538<div class="ulist"><ul>
Junio C Hamano775a0f42006-12-31 01:19:142539<li>
2540<p>
2541The pathnames recorded in the index and in the tree objects
2542 are treated as uninterpreted sequences of non-NUL bytes.
2543 What readdir(2) returns are what are recorded and compared
Junio C Hamano076ffcc2013-02-06 05:13:212544 with the data Git keeps track of, which in turn are expected
Junio C Hamano775a0f42006-12-31 01:19:142545 to be what lstat(2) and creat(2) accepts. There is no such
2546 thing as pathname encoding translation.
2547</p>
2548</li>
2549<li>
2550<p>
Junio C Hamano54bf1e22008-12-20 06:30:112551The contents of the blob objects are uninterpreted sequences
Junio C Hamano775a0f42006-12-31 01:19:142552 of bytes. There is no encoding translation at the core
2553 level.
2554</p>
2555</li>
2556<li>
2557<p>
Junio C Hamano54bf1e22008-12-20 06:30:112558The commit log messages are uninterpreted sequences of non-NUL
Junio C Hamano775a0f42006-12-31 01:19:142559 bytes.
2560</p>
2561</li>
Junio C Hamanoba4b9282008-07-06 05:20:312562</ul></div>
Junio C Hamano68cf15a2010-11-06 01:01:592563<div class="paragraph"><p>Although we encourage that the commit log messages are encoded
Junio C Hamano076ffcc2013-02-06 05:13:212564in UTF-8, both the core and Git Porcelain are designed not to
Junio C Hamano775a0f42006-12-31 01:19:142565force UTF-8 on projects. If all participants of a particular
Junio C Hamano076ffcc2013-02-06 05:13:212566project find it more convenient to use legacy encodings, Git
Junio C Hamano775a0f42006-12-31 01:19:142567does not forbid it. However, there are a few things to keep in
Junio C Hamanoba4b9282008-07-06 05:20:312568mind.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592569<div class="olist arabic"><ol class="arabic">
Junio C Hamano775a0f42006-12-31 01:19:142570<li>
2571<p>
Junio C Hamano1aa40d22010-01-21 17:46:432572<em>git commit</em> and <em>git commit-tree</em> issues
Junio C Hamano14b76482008-01-05 10:32:262573 a warning if the commit log message given to it does not look
Junio C Hamano775a0f42006-12-31 01:19:142574 like a valid UTF-8 string, unless you explicitly say your
2575 project uses a legacy encoding. The way to say this is to
Junio C Hamano9d971152012-12-19 00:43:112576 have i18n.commitencoding in <code>.git/config</code> file, like this:
Junio C Hamano775a0f42006-12-31 01:19:142577</p>
2578<div class="listingblock">
2579<div class="content">
Junio C Hamano9d971152012-12-19 00:43:112580<pre><code>[i18n]
2581 commitencoding = ISO-8859-1</code></pre>
Junio C Hamano775a0f42006-12-31 01:19:142582</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592583<div class="paragraph"><p>Commit objects created with the above setting record the value
Junio C Hamano9d971152012-12-19 00:43:112584of <code>i18n.commitencoding</code> in its <code>encoding</code> header. This is to
Junio C Hamano775a0f42006-12-31 01:19:142585help other people who look at them later. Lack of this header
Junio C Hamanoba4b9282008-07-06 05:20:312586implies that the commit log message is encoded in UTF-8.</p></div>
Junio C Hamano775a0f42006-12-31 01:19:142587</li>
2588<li>
2589<p>
Junio C Hamano1aa40d22010-01-21 17:46:432590<em>git log</em>, <em>git show</em>, <em>git blame</em> and friends look at the
Junio C Hamano9d971152012-12-19 00:43:112591 <code>encoding</code> header of a commit object, and try to re-code the
Junio C Hamanoaa17c7c2008-11-03 04:36:582592 log message into UTF-8 unless otherwise specified. You can
Junio C Hamano775a0f42006-12-31 01:19:142593 specify the desired output encoding with
Junio C Hamano9d971152012-12-19 00:43:112594 <code>i18n.logoutputencoding</code> in <code>.git/config</code> file, like this:
Junio C Hamano775a0f42006-12-31 01:19:142595</p>
2596<div class="listingblock">
2597<div class="content">
Junio C Hamano9d971152012-12-19 00:43:112598<pre><code>[i18n]
2599 logoutputencoding = ISO-8859-1</code></pre>
Junio C Hamano775a0f42006-12-31 01:19:142600</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592601<div class="paragraph"><p>If you do not have this configuration variable, the value of
Junio C Hamano9d971152012-12-19 00:43:112602<code>i18n.commitencoding</code> is used instead.</p></div>
Junio C Hamano775a0f42006-12-31 01:19:142603</li>
Junio C Hamanoba4b9282008-07-06 05:20:312604</ol></div>
Junio C Hamano68cf15a2010-11-06 01:01:592605<div class="paragraph"><p>Note that we deliberately chose not to re-code the commit log
Junio C Hamano775a0f42006-12-31 01:19:142606message when a commit is made to force UTF-8 at the commit
2607object level, because re-coding to UTF-8 is not necessarily a
Junio C Hamanoba4b9282008-07-06 05:20:312608reversible operation.</p></div>
Junio C Hamano775a0f42006-12-31 01:19:142609</div>
Junio C Hamano9d971152012-12-19 00:43:112610</div>
2611<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:312612<h2 id="_git">GIT</h2>
Junio C Hamanod9d71c02006-02-08 00:52:332613<div class="sectionbody">
Junio C Hamanoa28a9202012-06-21 07:08:232614<div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
Junio C Hamanod9d71c02006-02-08 00:52:332615</div>
Junio C Hamano7bd050f2011-09-22 06:32:222616</div>
Junio C Hamano9d971152012-12-19 00:43:112617</div>
Junio C Hamano7bd050f2011-09-22 06:32:222618<div id="footnotes"><hr /></div>
Junio C Hamanod9d71c02006-02-08 00:52:332619<div id="footer">
2620<div id="footer-text">
Junio C Hamano683a8612013-08-23 20:50:092621Last updated 2013-08-20 08:40:27 PDT
Junio C Hamanod9d71c02006-02-08 00:52:332622</div>
2623</div>
2624</body>
2625</html>