blob: c0fa4668aa5db6ea7c7bf00c5c44978fca8e65e6 [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" />
Junio C Hamanoac12f0e2014-09-19 22:32:516<meta name="generator" content="AsciiDoc 8.6.9" />
Junio C Hamano68cf15a2010-11-06 01:01:597<title>git-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 Hamanoac12f0e2014-09-19 22:32:5190.monospaced, code, pre {
91 font-family: "Courier New", Courier, monospace;
92 font-size: inherit;
93 color: navy;
Junio C Hamanod9d71c02006-02-08 00:52:3394 padding: 0;
95 margin: 0;
96}
Junio C Hamanoac12f0e2014-09-19 22:32:5197pre {
98 white-space: pre-wrap;
99}
Junio C Hamanod9d71c02006-02-08 00:52:33100
Junio C Hamano9d971152012-12-19 00:43:11101#author {
Junio C Hamanod9d71c02006-02-08 00:52:33102 color: #527bbd;
Junio C Hamanod9d71c02006-02-08 00:52:33103 font-weight: bold;
Junio C Hamanoba4b9282008-07-06 05:20:31104 font-size: 1.1em;
Junio C Hamanod9d71c02006-02-08 00:52:33105}
Junio C Hamano9d971152012-12-19 00:43:11106#email {
Junio C Hamanod9d71c02006-02-08 00:52:33107}
Junio C Hamano9d971152012-12-19 00:43:11108#revnumber, #revdate, #revremark {
Junio C Hamanod9d71c02006-02-08 00:52:33109}
110
Junio C Hamano9d971152012-12-19 00:43:11111#footer {
Junio C Hamanod9d71c02006-02-08 00:52:33112 font-size: small;
113 border-top: 2px solid silver;
114 padding-top: 0.5em;
115 margin-top: 4.0em;
116}
Junio C Hamano9d971152012-12-19 00:43:11117#footer-text {
Junio C Hamanod9d71c02006-02-08 00:52:33118 float: left;
119 padding-bottom: 0.5em;
120}
Junio C Hamano9d971152012-12-19 00:43:11121#footer-badges {
Junio C Hamanod9d71c02006-02-08 00:52:33122 float: right;
123 padding-bottom: 0.5em;
124}
125
Junio C Hamano9d971152012-12-19 00:43:11126#preamble {
Junio C Hamano68cf15a2010-11-06 01:01:59127 margin-top: 1.5em;
128 margin-bottom: 1.5em;
129}
Junio C Hamano9d971152012-12-19 00:43:11130div.imageblock, div.exampleblock, div.verseblock,
Junio C Hamanod9d71c02006-02-08 00:52:33131div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
132div.admonitionblock {
Junio C Hamano7bd050f2011-09-22 06:32:22133 margin-top: 1.0em;
Junio C Hamanod9d71c02006-02-08 00:52:33134 margin-bottom: 1.5em;
135}
136div.admonitionblock {
Junio C Hamano7bd050f2011-09-22 06:32:22137 margin-top: 2.0em;
138 margin-bottom: 2.0em;
139 margin-right: 10%;
140 color: #606060;
Junio C Hamanod9d71c02006-02-08 00:52:33141}
142
143div.content { /* Block element content. */
144 padding: 0;
145}
146
147/* Block element titles. */
148div.title, caption.title {
Junio C Hamano68cf15a2010-11-06 01:01:59149 color: #527bbd;
Junio C Hamanod9d71c02006-02-08 00:52:33150 font-weight: bold;
151 text-align: left;
152 margin-top: 1.0em;
153 margin-bottom: 0.5em;
154}
155div.title + * {
156 margin-top: 0;
157}
158
159td div.title:first-child {
160 margin-top: 0.0em;
161}
162div.content div.title:first-child {
163 margin-top: 0.0em;
164}
165div.content + div.title {
166 margin-top: 0.0em;
167}
168
169div.sidebarblock > div.content {
170 background: #ffffee;
Junio C Hamano9d971152012-12-19 00:43:11171 border: 1px solid #dddddd;
172 border-left: 4px solid #f0f0f0;
Junio C Hamanod9d71c02006-02-08 00:52:33173 padding: 0.5em;
174}
175
176div.listingblock > div.content {
Junio C Hamano9d971152012-12-19 00:43:11177 border: 1px solid #dddddd;
178 border-left: 5px solid #f0f0f0;
179 background: #f8f8f8;
Junio C Hamanod9d71c02006-02-08 00:52:33180 padding: 0.5em;
181}
182
Junio C Hamano7bd050f2011-09-22 06:32:22183div.quoteblock, div.verseblock {
184 padding-left: 1.0em;
185 margin-left: 1.0em;
Junio C Hamano68cf15a2010-11-06 01:01:59186 margin-right: 10%;
Junio C Hamano9d971152012-12-19 00:43:11187 border-left: 5px solid #f0f0f0;
188 color: #888;
Junio C Hamanod9d71c02006-02-08 00:52:33189}
Junio C Hamano7bd050f2011-09-22 06:32:22190
Junio C Hamano68cf15a2010-11-06 01:01:59191div.quoteblock > div.attribution {
192 padding-top: 0.5em;
Junio C Hamanod9d71c02006-02-08 00:52:33193 text-align: right;
194}
Junio C Hamano68cf15a2010-11-06 01:01:59195
Junio C Hamano9d971152012-12-19 00:43:11196div.verseblock > pre.content {
197 font-family: inherit;
198 font-size: inherit;
Junio C Hamano68cf15a2010-11-06 01:01:59199}
200div.verseblock > div.attribution {
201 padding-top: 0.75em;
202 text-align: left;
203}
204/* DEPRECATED: Pre version 8.2.7 verse style literal block. */
Junio C Hamanoba4b9282008-07-06 05:20:31205div.verseblock + div.attribution {
206 text-align: left;
207}
Junio C Hamanod9d71c02006-02-08 00:52:33208
209div.admonitionblock .icon {
210 vertical-align: top;
211 font-size: 1.1em;
212 font-weight: bold;
213 text-decoration: underline;
214 color: #527bbd;
215 padding-right: 0.5em;
216}
217div.admonitionblock td.content {
218 padding-left: 0.5em;
Junio C Hamano7bd050f2011-09-22 06:32:22219 border-left: 3px solid #dddddd;
Junio C Hamanod9d71c02006-02-08 00:52:33220}
221
222div.exampleblock > div.content {
Junio C Hamano7bd050f2011-09-22 06:32:22223 border-left: 3px solid #dddddd;
224 padding-left: 0.5em;
Junio C Hamanod9d71c02006-02-08 00:52:33225}
226
Junio C Hamanod9d71c02006-02-08 00:52:33227div.imageblock div.content { padding-left: 0; }
Junio C Hamanoac12f0e2014-09-19 22:32:51228span.image img { border-style: none; vertical-align: text-bottom; }
Junio C Hamano68cf15a2010-11-06 01:01:59229a.image:visited { color: white; }
Junio C Hamanod9d71c02006-02-08 00:52:33230
231dl {
232 margin-top: 0.8em;
233 margin-bottom: 0.8em;
234}
235dt {
236 margin-top: 0.5em;
237 margin-bottom: 0;
Junio C Hamano68cf15a2010-11-06 01:01:59238 font-style: normal;
239 color: navy;
Junio C Hamanod9d71c02006-02-08 00:52:33240}
241dd > *:first-child {
Junio C Hamano68cf15a2010-11-06 01:01:59242 margin-top: 0.1em;
Junio C Hamanod9d71c02006-02-08 00:52:33243}
244
245ul, ol {
246 list-style-position: outside;
247}
Junio C Hamano68cf15a2010-11-06 01:01:59248ol.arabic {
249 list-style-type: decimal;
250}
251ol.loweralpha {
Junio C Hamanod9d71c02006-02-08 00:52:33252 list-style-type: lower-alpha;
253}
Junio C Hamano68cf15a2010-11-06 01:01:59254ol.upperalpha {
255 list-style-type: upper-alpha;
256}
257ol.lowerroman {
258 list-style-type: lower-roman;
259}
260ol.upperroman {
261 list-style-type: upper-roman;
262}
263
264div.compact ul, div.compact ol,
265div.compact p, div.compact p,
266div.compact div, div.compact div {
267 margin-top: 0.1em;
268 margin-bottom: 0.1em;
269}
Junio C Hamanod9d71c02006-02-08 00:52:33270
Junio C Hamanod9d71c02006-02-08 00:52:33271tfoot {
272 font-weight: bold;
273}
Junio C Hamano68cf15a2010-11-06 01:01:59274td > div.verse {
275 white-space: pre;
276}
Junio C Hamano68cf15a2010-11-06 01:01:59277
278div.hdlist {
Junio C Hamanod9d71c02006-02-08 00:52:33279 margin-top: 0.8em;
280 margin-bottom: 0.8em;
281}
Junio C Hamano68cf15a2010-11-06 01:01:59282div.hdlist tr {
283 padding-bottom: 15px;
Junio C Hamanoba4b9282008-07-06 05:20:31284}
Junio C Hamano68cf15a2010-11-06 01:01:59285dt.hdlist1.strong, td.hdlist1.strong {
286 font-weight: bold;
287}
288td.hdlist1 {
Junio C Hamanod9d71c02006-02-08 00:52:33289 vertical-align: top;
Junio C Hamano68cf15a2010-11-06 01:01:59290 font-style: normal;
Junio C Hamanod9d71c02006-02-08 00:52:33291 padding-right: 0.8em;
Junio C Hamano68cf15a2010-11-06 01:01:59292 color: navy;
Junio C Hamanod9d71c02006-02-08 00:52:33293}
Junio C Hamano68cf15a2010-11-06 01:01:59294td.hdlist2 {
Junio C Hamanod9d71c02006-02-08 00:52:33295 vertical-align: top;
296}
Junio C Hamano68cf15a2010-11-06 01:01:59297div.hdlist.compact tr {
298 margin: 0;
299 padding-bottom: 0;
300}
301
302.comment {
303 background: yellow;
304}
Junio C Hamanod9d71c02006-02-08 00:52:33305
Junio C Hamano7bd050f2011-09-22 06:32:22306.footnote, .footnoteref {
307 font-size: 0.8em;
308}
309
310span.footnote, span.footnoteref {
311 vertical-align: super;
312}
313
314#footnotes {
315 margin: 20px 0 20px 0;
316 padding: 7px 0 0 0;
317}
318
319#footnotes div.footnote {
320 margin: 0 0 5px 0;
321}
322
323#footnotes hr {
324 border: none;
325 border-top: 1px solid silver;
326 height: 1px;
327 text-align: left;
328 margin-left: 0;
329 width: 20%;
330 min-width: 100px;
331}
332
Junio C Hamano9d971152012-12-19 00:43:11333div.colist td {
334 padding-right: 0.5em;
335 padding-bottom: 0.3em;
336 vertical-align: top;
337}
338div.colist td img {
339 margin-top: 0.3em;
Junio C Hamanod9d71c02006-02-08 00:52:33340}
Junio C Hamanoba4b9282008-07-06 05:20:31341
Junio C Hamano9d971152012-12-19 00:43:11342@media print {
343 #footer-badges { display: none; }
344}
345
346#toc {
Junio C Hamano7bd050f2011-09-22 06:32:22347 margin-bottom: 2.5em;
348}
349
Junio C Hamano9d971152012-12-19 00:43:11350#toctitle {
Junio C Hamanoba4b9282008-07-06 05:20:31351 color: #527bbd;
Junio C Hamanoba4b9282008-07-06 05:20:31352 font-size: 1.1em;
353 font-weight: bold;
354 margin-top: 1.0em;
355 margin-bottom: 0.1em;
356}
357
Junio C Hamanoac12f0e2014-09-19 22:32:51358div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
Junio C Hamanoba4b9282008-07-06 05:20:31359 margin-top: 0;
360 margin-bottom: 0;
361}
362div.toclevel2 {
363 margin-left: 2em;
364 font-size: 0.9em;
365}
366div.toclevel3 {
367 margin-left: 4em;
368 font-size: 0.9em;
369}
370div.toclevel4 {
371 margin-left: 6em;
372 font-size: 0.9em;
373}
Junio C Hamano9d971152012-12-19 00:43:11374
375span.aqua { color: aqua; }
376span.black { color: black; }
377span.blue { color: blue; }
378span.fuchsia { color: fuchsia; }
379span.gray { color: gray; }
380span.green { color: green; }
381span.lime { color: lime; }
382span.maroon { color: maroon; }
383span.navy { color: navy; }
384span.olive { color: olive; }
385span.purple { color: purple; }
386span.red { color: red; }
387span.silver { color: silver; }
388span.teal { color: teal; }
389span.white { color: white; }
390span.yellow { color: yellow; }
391
392span.aqua-background { background: aqua; }
393span.black-background { background: black; }
394span.blue-background { background: blue; }
395span.fuchsia-background { background: fuchsia; }
396span.gray-background { background: gray; }
397span.green-background { background: green; }
398span.lime-background { background: lime; }
399span.maroon-background { background: maroon; }
400span.navy-background { background: navy; }
401span.olive-background { background: olive; }
402span.purple-background { background: purple; }
403span.red-background { background: red; }
404span.silver-background { background: silver; }
405span.teal-background { background: teal; }
406span.white-background { background: white; }
407span.yellow-background { background: yellow; }
408
409span.big { font-size: 2em; }
410span.small { font-size: 0.6em; }
411
412span.underline { text-decoration: underline; }
413span.overline { text-decoration: overline; }
414span.line-through { text-decoration: line-through; }
415
Junio C Hamanoac12f0e2014-09-19 22:32:51416div.unbreakable { page-break-inside: avoid; }
417
Junio C Hamano9d971152012-12-19 00:43:11418
419/*
420 * xhtml11 specific
421 *
422 * */
423
424div.tableblock {
425 margin-top: 1.0em;
426 margin-bottom: 1.5em;
427}
428div.tableblock > table {
429 border: 3px solid #527bbd;
430}
431thead, p.table.header {
432 font-weight: bold;
433 color: #527bbd;
434}
435p.table {
436 margin-top: 0;
437}
438/* Because the table frame attribute is overriden by CSS in most browsers. */
439div.tableblock > table[frame="void"] {
440 border-style: none;
441}
442div.tableblock > table[frame="hsides"] {
443 border-left-style: none;
444 border-right-style: none;
445}
446div.tableblock > table[frame="vsides"] {
447 border-top-style: none;
448 border-bottom-style: none;
449}
450
451
452/*
453 * html5 specific
454 *
455 * */
456
457table.tableblock {
458 margin-top: 1.0em;
459 margin-bottom: 1.5em;
460}
461thead, p.tableblock.header {
462 font-weight: bold;
463 color: #527bbd;
464}
465p.tableblock {
466 margin-top: 0;
467}
468table.tableblock {
469 border-width: 3px;
470 border-spacing: 0px;
471 border-style: solid;
472 border-color: #527bbd;
473 border-collapse: collapse;
474}
475th.tableblock, td.tableblock {
476 border-width: 1px;
477 padding: 4px;
478 border-style: solid;
479 border-color: #527bbd;
480}
481
482table.tableblock.frame-topbot {
483 border-left-style: hidden;
484 border-right-style: hidden;
485}
486table.tableblock.frame-sides {
487 border-top-style: hidden;
488 border-bottom-style: hidden;
489}
490table.tableblock.frame-none {
491 border-style: hidden;
492}
493
494th.tableblock.halign-left, td.tableblock.halign-left {
495 text-align: left;
496}
497th.tableblock.halign-center, td.tableblock.halign-center {
498 text-align: center;
499}
500th.tableblock.halign-right, td.tableblock.halign-right {
501 text-align: right;
502}
503
504th.tableblock.valign-top, td.tableblock.valign-top {
505 vertical-align: top;
506}
507th.tableblock.valign-middle, td.tableblock.valign-middle {
508 vertical-align: middle;
509}
510th.tableblock.valign-bottom, td.tableblock.valign-bottom {
511 vertical-align: bottom;
512}
513
514
515/*
516 * manpage specific
517 *
518 * */
519
520body.manpage h1 {
Junio C Hamano68cf15a2010-11-06 01:01:59521 padding-top: 0.5em;
522 padding-bottom: 0.5em;
523 border-top: 2px solid silver;
524 border-bottom: 2px solid silver;
525}
Junio C Hamano9d971152012-12-19 00:43:11526body.manpage h2 {
Junio C Hamano68cf15a2010-11-06 01:01:59527 border-style: none;
528}
Junio C Hamano9d971152012-12-19 00:43:11529body.manpage div.sectionbody {
530 margin-left: 3em;
Junio C Hamano68cf15a2010-11-06 01:01:59531}
532
533@media print {
Junio C Hamano9d971152012-12-19 00:43:11534 body.manpage div#toc { display: none; }
Junio C Hamano68cf15a2010-11-06 01:01:59535}
Junio C Hamanoac12f0e2014-09-19 22:32:51536
537
Junio C Hamanod9d71c02006-02-08 00:52:33538</style>
Junio C Hamano7bd050f2011-09-22 06:32:22539<script type="text/javascript">
540/*<![CDATA[*/
Junio C Hamano7bd050f2011-09-22 06:32:22541var asciidoc = { // Namespace.
542
543/////////////////////////////////////////////////////////////////////
544// Table Of Contents generator
545/////////////////////////////////////////////////////////////////////
546
547/* Author: Mihai Bazon, September 2002
548 * http://students.infoiasi.ro/~mishoo
549 *
550 * Table Of Content generator
551 * Version: 0.4
552 *
553 * Feel free to use this script under the terms of the GNU General Public
554 * License, as long as you do not remove or alter this notice.
555 */
556
557 /* modified by Troy D. Hanson, September 2006. License: GPL */
558 /* modified by Stuart Rackham, 2006, 2009. License: GPL */
559
560// toclevels = 1..4.
561toc: function (toclevels) {
562
563 function getText(el) {
564 var text = "";
565 for (var i = el.firstChild; i != null; i = i.nextSibling) {
566 if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
567 text += i.data;
568 else if (i.firstChild != null)
569 text += getText(i);
570 }
571 return text;
572 }
573
574 function TocEntry(el, text, toclevel) {
575 this.element = el;
576 this.text = text;
577 this.toclevel = toclevel;
578 }
579
580 function tocEntries(el, toclevels) {
581 var result = new Array;
Junio C Hamanoac12f0e2014-09-19 22:32:51582 var re = new RegExp('[hH]([1-'+(toclevels+1)+'])');
Junio C Hamano7bd050f2011-09-22 06:32:22583 // Function that scans the DOM tree for header elements (the DOM2
584 // nodeIterator API would be a better technique but not supported by all
585 // browsers).
586 var iterate = function (el) {
587 for (var i = el.firstChild; i != null; i = i.nextSibling) {
588 if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
589 var mo = re.exec(i.tagName);
590 if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
591 result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
592 }
593 iterate(i);
594 }
595 }
596 }
597 iterate(el);
598 return result;
599 }
600
601 var toc = document.getElementById("toc");
Junio C Hamano9d971152012-12-19 00:43:11602 if (!toc) {
603 return;
604 }
605
606 // Delete existing TOC entries in case we're reloading the TOC.
607 var tocEntriesToRemove = [];
608 var i;
609 for (i = 0; i < toc.childNodes.length; i++) {
610 var entry = toc.childNodes[i];
Junio C Hamanoac12f0e2014-09-19 22:32:51611 if (entry.nodeName.toLowerCase() == 'div'
Junio C Hamano9d971152012-12-19 00:43:11612 && entry.getAttribute("class")
613 && entry.getAttribute("class").match(/^toclevel/))
614 tocEntriesToRemove.push(entry);
615 }
616 for (i = 0; i < tocEntriesToRemove.length; i++) {
617 toc.removeChild(tocEntriesToRemove[i]);
618 }
619
620 // Rebuild TOC entries.
Junio C Hamano7bd050f2011-09-22 06:32:22621 var entries = tocEntries(document.getElementById("content"), toclevels);
622 for (var i = 0; i < entries.length; ++i) {
623 var entry = entries[i];
624 if (entry.element.id == "")
625 entry.element.id = "_toc_" + i;
626 var a = document.createElement("a");
627 a.href = "#" + entry.element.id;
628 a.appendChild(document.createTextNode(entry.text));
629 var div = document.createElement("div");
630 div.appendChild(a);
631 div.className = "toclevel" + entry.toclevel;
632 toc.appendChild(div);
633 }
634 if (entries.length == 0)
635 toc.parentNode.removeChild(toc);
636},
637
638
639/////////////////////////////////////////////////////////////////////
640// Footnotes generator
641/////////////////////////////////////////////////////////////////////
642
643/* Based on footnote generation code from:
644 * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
645 */
646
647footnotes: function () {
Junio C Hamano9d971152012-12-19 00:43:11648 // Delete existing footnote entries in case we're reloading the footnodes.
649 var i;
Junio C Hamano7bd050f2011-09-22 06:32:22650 var noteholder = document.getElementById("footnotes");
Junio C Hamano9d971152012-12-19 00:43:11651 if (!noteholder) {
652 return;
653 }
654 var entriesToRemove = [];
655 for (i = 0; i < noteholder.childNodes.length; i++) {
656 var entry = noteholder.childNodes[i];
Junio C Hamanoac12f0e2014-09-19 22:32:51657 if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote")
Junio C Hamano9d971152012-12-19 00:43:11658 entriesToRemove.push(entry);
659 }
660 for (i = 0; i < entriesToRemove.length; i++) {
661 noteholder.removeChild(entriesToRemove[i]);
662 }
663
664 // Rebuild footnote entries.
665 var cont = document.getElementById("content");
Junio C Hamano7bd050f2011-09-22 06:32:22666 var spans = cont.getElementsByTagName("span");
667 var refs = {};
668 var n = 0;
669 for (i=0; i<spans.length; i++) {
670 if (spans[i].className == "footnote") {
671 n++;
Junio C Hamano9d971152012-12-19 00:43:11672 var note = spans[i].getAttribute("data-note");
673 if (!note) {
674 // Use [\s\S] in place of . so multi-line matches work.
675 // Because JavaScript has no s (dotall) regex flag.
676 note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
677 spans[i].innerHTML =
678 "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
679 "' title='View footnote' class='footnote'>" + n + "</a>]";
680 spans[i].setAttribute("data-note", note);
681 }
Junio C Hamano7bd050f2011-09-22 06:32:22682 noteholder.innerHTML +=
683 "<div class='footnote' id='_footnote_" + n + "'>" +
684 "<a href='#_footnoteref_" + n + "' title='Return to text'>" +
685 n + "</a>. " + note + "</div>";
Junio C Hamano7bd050f2011-09-22 06:32:22686 var id =spans[i].getAttribute("id");
687 if (id != null) refs["#"+id] = n;
688 }
689 }
690 if (n == 0)
691 noteholder.parentNode.removeChild(noteholder);
692 else {
693 // Process footnoterefs.
694 for (i=0; i<spans.length; i++) {
695 if (spans[i].className == "footnoteref") {
696 var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
697 href = href.match(/#.*/)[0]; // Because IE return full URL.
698 n = refs[href];
699 spans[i].innerHTML =
700 "[<a href='#_footnote_" + n +
701 "' title='View footnote' class='footnote'>" + n + "</a>]";
702 }
703 }
704 }
Junio C Hamano9d971152012-12-19 00:43:11705},
706
707install: function(toclevels) {
708 var timerId;
709
710 function reinstall() {
711 asciidoc.footnotes();
712 if (toclevels) {
713 asciidoc.toc(toclevels);
714 }
715 }
716
717 function reinstallAndRemoveTimer() {
718 clearInterval(timerId);
719 reinstall();
720 }
721
722 timerId = setInterval(reinstall, 500);
723 if (document.addEventListener)
724 document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false);
725 else
726 window.onload = reinstallAndRemoveTimer;
Junio C Hamano7bd050f2011-09-22 06:32:22727}
728
729}
Junio C Hamano9d971152012-12-19 00:43:11730asciidoc.install();
Junio C Hamano7bd050f2011-09-22 06:32:22731/*]]>*/
732</script>
Junio C Hamanod9d71c02006-02-08 00:52:33733</head>
Junio C Hamano9d971152012-12-19 00:43:11734<body class="manpage">
Junio C Hamanod9d71c02006-02-08 00:52:33735<div id="header">
736<h1>
737git-show(1) Manual Page
738</h1>
739<h2>NAME</h2>
740<div class="sectionbody">
741<p>git-show -
Junio C Hamano7d23f5e2006-12-16 07:44:04742 Show various types of objects
Junio C Hamanod9d71c02006-02-08 00:52:33743</p>
744</div>
745</div>
Junio C Hamano7bd050f2011-09-22 06:32:22746<div id="content">
Junio C Hamano9d971152012-12-19 00:43:11747<div class="sect1">
Junio C Hamano68cf15a2010-11-06 01:01:59748<h2 id="_synopsis">SYNOPSIS</h2>
Junio C Hamanod9d71c02006-02-08 00:52:33749<div class="sectionbody">
Junio C Hamano15567bc2011-07-23 00:51:59750<div class="verseblock">
Junio C Hamano9d971152012-12-19 00:43:11751<pre class="content"><em>git show</em> [options] &lt;object&gt;&#8230;</pre>
752<div class="attribution">
Junio C Hamano15567bc2011-07-23 00:51:59753</div></div>
Junio C Hamanod9d71c02006-02-08 00:52:33754</div>
Junio C Hamano9d971152012-12-19 00:43:11755</div>
756<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:31757<h2 id="_description">DESCRIPTION</h2>
Junio C Hamanod9d71c02006-02-08 00:52:33758<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:59759<div class="paragraph"><p>Shows one or more objects (blobs, trees, tags and commits).</p></div>
760<div class="paragraph"><p>For commits it shows the log message and textual diff. It also
Junio C Hamano7d23f5e2006-12-16 07:44:04761presents the merge commit in a special format as produced by
Junio C Hamano1aa40d22010-01-21 17:46:43762<em>git diff-tree --cc</em>.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:59763<div class="paragraph"><p>For tags, it shows the tag message and the referenced objects.</p></div>
764<div class="paragraph"><p>For trees, it shows the names (equivalent to <em>git ls-tree</em>
Junio C Hamanoba4b9282008-07-06 05:20:31765with --name-only).</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:59766<div class="paragraph"><p>For plain blobs, it shows the plain contents.</p></div>
767<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:31768control how the changes the commit introduces are shown.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:59769<div class="paragraph"><p>This manual page describes only the most frequently used options.</p></div>
Junio C Hamanod9d71c02006-02-08 00:52:33770</div>
Junio C Hamano9d971152012-12-19 00:43:11771</div>
772<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:31773<h2 id="_options">OPTIONS</h2>
Junio C Hamanod9d71c02006-02-08 00:52:33774<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:59775<div class="dlist"><dl>
776<dt class="hdlist1">
Junio C Hamano9e395072008-07-31 22:11:21777&lt;object&gt;&#8230;
Junio C Hamanod9d71c02006-02-08 00:52:33778</dt>
779<dd>
780<p>
Junio C Hamano9e395072008-07-31 22:11:21781 The names of objects to show.
Junio C Hamano2d47c622007-01-18 06:24:10782 For a more complete list of ways to spell object names, see
Junio C Hamanoa28a9202012-06-21 07:08:23783 "SPECIFYING REVISIONS" section in <a href="gitrevisions.html">gitrevisions(7)</a>.
Junio C Hamanod9d71c02006-02-08 00:52:33784</p>
785</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59786<dt class="hdlist1">
Junio C Hamanod2179ef2010-10-22 04:12:17787--pretty[=&lt;format&gt;]
Junio C Hamanod9d71c02006-02-08 00:52:33788</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59789<dt class="hdlist1">
Junio C Hamanod2179ef2010-10-22 04:12:17790--format=&lt;format&gt;
Junio C Hamano0a235222009-03-06 08:21:09791</dt>
Junio C Hamanod9d71c02006-02-08 00:52:33792<dd>
793<p>
Junio C Hamanoa3770f92007-07-25 08:53:33794 Pretty-print the contents of the commit logs in a given format,
Junio C Hamano0430e3a2007-05-15 03:13:17795 where <em>&lt;format&gt;</em> can be one of <em>oneline</em>, <em>short</em>, <em>medium</em>,
Junio C Hamano6bb32e62015-02-17 22:11:26796 <em>full</em>, <em>fuller</em>, <em>email</em>, <em>raw</em>, <em>format:&lt;string&gt;</em>
797 and <em>tformat:&lt;string&gt;</em>. When <em>&lt;format&gt;</em> is none of the above,
798 and has <em>%placeholder</em> in it, it acts as if
799 <em>--pretty=tformat:&lt;format&gt;</em> were given.
Junio C Hamanod9d71c02006-02-08 00:52:33800</p>
Junio C Hamano6bb32e62015-02-17 22:11:26801<div class="paragraph"><p>See the "PRETTY FORMATS" section for some additional details for each
802format. When <em>=&lt;format&gt;</em> part is omitted, it defaults to <em>medium</em>.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:59803<div class="paragraph"><p>Note: you can specify the default pretty format in the repository
Junio C Hamanoa28a9202012-06-21 07:08:23804configuration (see <a href="git-config.html">git-config(1)</a>).</p></div>
Junio C Hamano0430e3a2007-05-15 03:13:17805</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59806<dt class="hdlist1">
Junio C Hamanoee695f22007-06-21 00:35:36807--abbrev-commit
808</dt>
809<dd>
810<p>
811 Instead of showing the full 40-byte hexadecimal commit object
Junio C Hamano6efe3022009-01-13 16:47:56812 name, show only a partial prefix. Non default number of
Junio C Hamanoee695f22007-06-21 00:35:36813 digits can be specified with "--abbrev=&lt;n&gt;" (which also modifies
814 diff output, if it is displayed).
815</p>
Junio C Hamano68cf15a2010-11-06 01:01:59816<div class="paragraph"><p>This should make "--pretty=oneline" a whole lot more readable for
Junio C Hamanoba4b9282008-07-06 05:20:31817people using 80-column terminals.</p></div>
Junio C Hamanoee695f22007-06-21 00:35:36818</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59819<dt class="hdlist1">
Junio C Hamanof93530e2011-05-25 23:59:59820--no-abbrev-commit
821</dt>
822<dd>
823<p>
824 Show the full 40-byte hexadecimal commit object name. This negates
Junio C Hamanoac12f0e2014-09-19 22:32:51825 <code>--abbrev-commit</code> and those options which imply it such as
Junio C Hamanof93530e2011-05-25 23:59:59826 "--oneline". It also overrides the <em>log.abbrevCommit</em> variable.
827</p>
828</dd>
829<dt class="hdlist1">
Junio C Hamano0a235222009-03-06 08:21:09830--oneline
831</dt>
832<dd>
833<p>
834 This is a shorthand for "--pretty=oneline --abbrev-commit"
835 used together.
836</p>
837</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59838<dt class="hdlist1">
Junio C Hamanoc5bb3b32013-08-05 22:43:36839--encoding=&lt;encoding&gt;
Junio C Hamano0430e3a2007-05-15 03:13:17840</dt>
841<dd>
842<p>
843 The commit objects record the encoding used for the log message
844 in their encoding header; this option can be used to tell the
845 command to re-code the commit log message in the encoding
846 preferred by the user. For non plumbing commands this
Junio C Hamano823eebb2015-07-10 22:29:34847 defaults to UTF-8. Note that if an object claims to be encoded
848 in <code>X</code> and we are outputting in <code>X</code>, we will output the object
849 verbatim; this means that invalid sequences in the original
850 commit may be copied to the output.
Junio C Hamano0430e3a2007-05-15 03:13:17851</p>
852</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59853<dt class="hdlist1">
Junio C Hamano4e6ba272016-01-20 23:23:19854--notes[=&lt;treeish&gt;]
Junio C Hamano57827fb2010-01-23 03:02:50855</dt>
856<dd>
857<p>
Junio C Hamanoa28a9202012-06-21 07:08:23858 Show the notes (see <a href="git-notes.html">git-notes(1)</a>) that annotate the
Junio C Hamano57827fb2010-01-23 03:02:50859 commit, when showing the commit log message. This is the default
Junio C Hamanoac12f0e2014-09-19 22:32:51860 for <code>git log</code>, <code>git show</code> and <code>git whatchanged</code> commands when
861 there is no <code>--pretty</code>, <code>--format</code>, or <code>--oneline</code> option given
Junio C Hamano60033462011-05-03 00:48:43862 on the command line.
Junio C Hamano57827fb2010-01-23 03:02:50863</p>
Junio C Hamano60033462011-05-03 00:48:43864<div class="paragraph"><p>By default, the notes shown are from the notes refs listed in the
865<em>core.notesRef</em> and <em>notes.displayRef</em> variables (or corresponding
Junio C Hamanoa28a9202012-06-21 07:08:23866environment overrides). See <a href="git-config.html">git-config(1)</a> for more details.</p></div>
Junio C Hamano4e6ba272016-01-20 23:23:19867<div class="paragraph"><p>With an optional <em>&lt;treeish&gt;</em> argument, use the treeish to find the notes
868to display. The treeish can specify the full refname when it begins
Junio C Hamano1f7c4a52015-10-14 22:15:51869with <code>refs/notes/</code>; when it begins with <code>notes/</code>, <code>refs/</code> and otherwise
870<code>refs/notes/</code> is prefixed to form a full name of the ref.</p></div>
Junio C Hamano60033462011-05-03 00:48:43871<div class="paragraph"><p>Multiple --notes options can be combined to control which notes are
872being displayed. Examples: "--notes=foo" will show only notes from
873"refs/notes/foo"; "--notes=foo --notes" will show both notes from
874"refs/notes/foo" and from the default notes ref(s).</p></div>
Junio C Hamano31667362010-03-25 00:38:53875</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59876<dt class="hdlist1">
Junio C Hamano60033462011-05-03 00:48:43877--no-notes
878</dt>
879<dd>
880<p>
Junio C Hamanoac12f0e2014-09-19 22:32:51881 Do not show notes. This negates the above <code>--notes</code> option, by
Junio C Hamano60033462011-05-03 00:48:43882 resetting the list of notes refs from which notes are shown.
883 Options are parsed in the order given on the command line, so e.g.
884 "--notes --notes=foo --no-notes --notes=bar" will only show notes
885 from "refs/notes/bar".
886</p>
887</dd>
888<dt class="hdlist1">
Junio C Hamano4e6ba272016-01-20 23:23:19889--show-notes[=&lt;treeish&gt;]
Junio C Hamano60033462011-05-03 00:48:43890</dt>
891<dt class="hdlist1">
Junio C Hamano31667362010-03-25 00:38:53892--[no-]standard-notes
893</dt>
894<dd>
895<p>
Junio C Hamano60033462011-05-03 00:48:43896 These options are deprecated. Use the above --notes/--no-notes
897 options instead.
Junio C Hamano31667362010-03-25 00:38:53898</p>
Junio C Hamano57827fb2010-01-23 03:02:50899</dd>
Junio C Hamano0acb1ae2012-09-24 21:28:13900<dt class="hdlist1">
901--show-signature
902</dt>
903<dd>
904<p>
905 Check the validity of a signed commit object by passing the signature
Junio C Hamanoac12f0e2014-09-19 22:32:51906 to <code>gpg --verify</code> and show the output.
Junio C Hamano0acb1ae2012-09-24 21:28:13907</p>
908</dd>
Junio C Hamanoba4b9282008-07-06 05:20:31909</dl></div>
Junio C Hamano0430e3a2007-05-15 03:13:17910</div>
Junio C Hamano9d971152012-12-19 00:43:11911</div>
912<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:31913<h2 id="_pretty_formats">PRETTY FORMATS</h2>
Junio C Hamano0430e3a2007-05-15 03:13:17914<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:59915<div class="paragraph"><p>If the commit is a merge, and if the pretty-format
Junio C Hamano0430e3a2007-05-15 03:13:17916is not <em>oneline</em>, <em>email</em> or <em>raw</em>, an additional line is
917inserted before the <em>Author:</em> line. This line begins with
918"Merge: " and the sha1s of ancestral commits are printed,
919separated by spaces. Note that the listed commits may not
920necessarily be the list of the <strong>direct</strong> parent commits if you
921have limited your view of history: for example, if you are
922only interested in changes related to a certain directory or
Junio C Hamanoba4b9282008-07-06 05:20:31923file.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:59924<div class="paragraph"><p>There are several built-in formats, and you can define
Junio C Hamanoa574a092010-06-13 19:57:10925additional formats by setting a pretty.&lt;name&gt;
926config option to either another format name, or a
927<em>format:</em> string, as described below (see
Junio C Hamanoa28a9202012-06-21 07:08:23928<a href="git-config.html">git-config(1)</a>). Here are the details of the
Junio C Hamanoa574a092010-06-13 19:57:10929built-in formats:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:59930<div class="ulist"><ul>
Junio C Hamanoa340aaa2006-11-23 02:47:33931<li>
932<p>
933<em>oneline</em>
934</p>
935<div class="literalblock">
936<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:51937<pre><code>&lt;sha1&gt; &lt;title line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:33938</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:59939<div class="paragraph"><p>This is designed to be as compact as possible.</p></div>
Junio C Hamanoa340aaa2006-11-23 02:47:33940</li>
941<li>
942<p>
943<em>short</em>
944</p>
945<div class="literalblock">
946<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:51947<pre><code>commit &lt;sha1&gt;
948Author: &lt;author&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:33949</div></div>
950<div class="literalblock">
951<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:51952<pre><code>&lt;title line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:33953</div></div>
954</li>
955<li>
956<p>
957<em>medium</em>
958</p>
959<div class="literalblock">
960<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:51961<pre><code>commit &lt;sha1&gt;
Junio C Hamanoa340aaa2006-11-23 02:47:33962Author: &lt;author&gt;
Junio C Hamanoac12f0e2014-09-19 22:32:51963Date: &lt;author date&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:33964</div></div>
965<div class="literalblock">
966<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:51967<pre><code>&lt;title line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:33968</div></div>
969<div class="literalblock">
970<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:51971<pre><code>&lt;full commit message&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:33972</div></div>
973</li>
974<li>
975<p>
976<em>full</em>
977</p>
978<div class="literalblock">
979<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:51980<pre><code>commit &lt;sha1&gt;
Junio C Hamanoa340aaa2006-11-23 02:47:33981Author: &lt;author&gt;
Junio C Hamanoac12f0e2014-09-19 22:32:51982Commit: &lt;committer&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:33983</div></div>
984<div class="literalblock">
985<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:51986<pre><code>&lt;title line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:33987</div></div>
988<div class="literalblock">
989<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:51990<pre><code>&lt;full commit message&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:33991</div></div>
992</li>
993<li>
994<p>
995<em>fuller</em>
996</p>
997<div class="literalblock">
998<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:51999<pre><code>commit &lt;sha1&gt;
Junio C Hamano6a3c8272008-12-19 21:38:181000Author: &lt;author&gt;
Junio C Hamanoba4b9282008-07-06 05:20:311001AuthorDate: &lt;author date&gt;
Junio C Hamano6a3c8272008-12-19 21:38:181002Commit: &lt;committer&gt;
Junio C Hamanoac12f0e2014-09-19 22:32:511003CommitDate: &lt;committer date&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:331004</div></div>
1005<div class="literalblock">
1006<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:511007<pre><code>&lt;title line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:331008</div></div>
1009<div class="literalblock">
1010<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:511011<pre><code>&lt;full commit message&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:331012</div></div>
1013</li>
1014<li>
1015<p>
1016<em>email</em>
1017</p>
1018<div class="literalblock">
1019<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:511020<pre><code>From &lt;sha1&gt; &lt;date&gt;
Junio C Hamanoa340aaa2006-11-23 02:47:331021From: &lt;author&gt;
Junio C Hamanoba4b9282008-07-06 05:20:311022Date: &lt;author date&gt;
Junio C Hamanoac12f0e2014-09-19 22:32:511023Subject: [PATCH] &lt;title line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:331024</div></div>
1025<div class="literalblock">
1026<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:511027<pre><code>&lt;full commit message&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:331028</div></div>
1029</li>
1030<li>
1031<p>
1032<em>raw</em>
1033</p>
Junio C Hamano68cf15a2010-11-06 01:01:591034<div class="paragraph"><p>The <em>raw</em> format shows the entire commit exactly as
Junio C Hamanoe3f080d2013-04-22 02:27:131035stored in the commit object. Notably, the SHA-1s are
Junio C Hamanoa340aaa2006-11-23 02:47:331036displayed in full, regardless of whether --abbrev or
1037--no-abbrev are used, and <em>parents</em> information show the
Junio C Hamanod75148a2014-04-08 19:48:381038true parent commits, without taking grafts or history
Junio C Hamano85f1fde2015-06-01 20:37:321039simplification into account. Note that this format affects the way
1040commits are displayed, but not the way the diff is shown e.g. with
1041<code>git log --raw</code>. To get full object names in a raw diff format,
1042use <code>--no-abbrev</code>.</p></div>
Junio C Hamanoa340aaa2006-11-23 02:47:331043</li>
Junio C Hamanoa3fd83c2007-03-02 10:34:361044<li>
1045<p>
Junio C Hamanoe32ec8b2010-06-02 23:32:311046<em>format:&lt;string&gt;</em>
Junio C Hamanoa3fd83c2007-03-02 10:34:361047</p>
Junio C Hamano68cf15a2010-11-06 01:01:591048<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:361049you want to show. It works a little bit like printf format,
1050with the notable exception that you get a newline with <em>%n</em>
Junio C Hamanoba4b9282008-07-06 05:20:311051instead of <em>\n</em>.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591052<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:311053would show something like this:</p></div>
Junio C Hamano0430e3a2007-05-15 03:13:171054<div class="listingblock">
1055<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:511056<pre><code>The author of fe6e0ee was Junio C Hamano, 23 hours ago
1057The 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:171058</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591059<div class="paragraph"><p>The placeholders are:</p></div>
1060<div class="ulist"><ul>
Junio C Hamanoa3fd83c2007-03-02 10:34:361061<li>
1062<p>
1063<em>%H</em>: commit hash
1064</p>
1065</li>
1066<li>
1067<p>
1068<em>%h</em>: abbreviated commit hash
1069</p>
1070</li>
1071<li>
1072<p>
1073<em>%T</em>: tree hash
1074</p>
1075</li>
1076<li>
1077<p>
1078<em>%t</em>: abbreviated tree hash
1079</p>
1080</li>
1081<li>
1082<p>
1083<em>%P</em>: parent hashes
1084</p>
1085</li>
1086<li>
1087<p>
1088<em>%p</em>: abbreviated parent hashes
1089</p>
1090</li>
1091<li>
1092<p>
1093<em>%an</em>: author name
1094</p>
1095</li>
1096<li>
1097<p>
Junio C Hamano04e768d2013-04-23 19:19:261098<em>%aN</em>: author name (respecting .mailmap, see <a href="git-shortlog.html">git-shortlog(1)</a>
1099 or <a href="git-blame.html">git-blame(1)</a>)
Junio C Hamanof5a93622008-07-16 03:23:571100</p>
1101</li>
1102<li>
1103<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:361104<em>%ae</em>: author email
1105</p>
1106</li>
1107<li>
1108<p>
Junio C Hamano04e768d2013-04-23 19:19:261109<em>%aE</em>: author email (respecting .mailmap, see
1110 <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:191111</p>
1112</li>
1113<li>
1114<p>
Junio C Hamanoa387df32008-08-29 08:56:581115<em>%ad</em>: author date (format respects --date= option)
Junio C Hamanoa3fd83c2007-03-02 10:34:361116</p>
1117</li>
1118<li>
1119<p>
1120<em>%aD</em>: author date, RFC2822 style
1121</p>
1122</li>
1123<li>
1124<p>
1125<em>%ar</em>: author date, relative
1126</p>
1127</li>
1128<li>
1129<p>
1130<em>%at</em>: author date, UNIX timestamp
1131</p>
1132</li>
1133<li>
1134<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511135<em>%ai</em>: author date, ISO 8601-like format
1136</p>
1137</li>
1138<li>
1139<p>
1140<em>%aI</em>: author date, strict ISO 8601 format
Junio C Hamano02f130b2007-07-14 08:26:561141</p>
1142</li>
1143<li>
1144<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:361145<em>%cn</em>: committer name
1146</p>
1147</li>
1148<li>
1149<p>
Junio C Hamano04e768d2013-04-23 19:19:261150<em>%cN</em>: committer name (respecting .mailmap, see
1151 <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:571152</p>
1153</li>
1154<li>
1155<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:361156<em>%ce</em>: committer email
1157</p>
1158</li>
1159<li>
1160<p>
Junio C Hamano04e768d2013-04-23 19:19:261161<em>%cE</em>: committer email (respecting .mailmap, see
1162 <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:191163</p>
1164</li>
1165<li>
1166<p>
Junio C Hamano53fe0312014-09-09 21:16:171167<em>%cd</em>: committer date (format respects --date= option)
Junio C Hamanoa3fd83c2007-03-02 10:34:361168</p>
1169</li>
1170<li>
1171<p>
1172<em>%cD</em>: committer date, RFC2822 style
1173</p>
1174</li>
1175<li>
1176<p>
1177<em>%cr</em>: committer date, relative
1178</p>
1179</li>
1180<li>
1181<p>
1182<em>%ct</em>: committer date, UNIX timestamp
1183</p>
1184</li>
1185<li>
1186<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511187<em>%ci</em>: committer date, ISO 8601-like format
1188</p>
1189</li>
1190<li>
1191<p>
1192<em>%cI</em>: committer date, strict ISO 8601 format
Junio C Hamano02f130b2007-07-14 08:26:561193</p>
1194</li>
1195<li>
1196<p>
Junio C Hamanoa28a9202012-06-21 07:08:231197<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:021198</p>
1199</li>
1200<li>
1201<p>
Junio C Hamano00b9f1a2014-09-29 23:11:281202<em>%D</em>: ref names without the " (", ")" wrapping.
1203</p>
1204</li>
1205<li>
1206<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:361207<em>%e</em>: encoding
1208</p>
1209</li>
1210<li>
1211<p>
1212<em>%s</em>: subject
1213</p>
1214</li>
1215<li>
1216<p>
Junio C Hamano5f9a6f02009-04-06 08:26:561217<em>%f</em>: sanitized subject line, suitable for a filename
1218</p>
1219</li>
1220<li>
1221<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:361222<em>%b</em>: body
1223</p>
1224</li>
1225<li>
1226<p>
Junio C Hamanocb39aea2010-05-09 07:24:481227<em>%B</em>: raw body (unwrapped subject and body)
1228</p>
1229</li>
1230<li>
1231<p>
Junio C Hamano3b70d3c2009-11-21 17:37:371232<em>%N</em>: commit notes
1233</p>
1234</li>
1235<li>
1236<p>
Junio C Hamano0acb1ae2012-09-24 21:28:131237<em>%GG</em>: raw verification message from GPG for a signed commit
1238</p>
1239</li>
1240<li>
1241<p>
Junio C Hamanoedf80bd2013-04-05 22:14:361242<em>%G?</em>: show "G" for a Good signature, "B" for a Bad signature, "U" for a good,
1243 untrusted signature and "N" for no signature
Junio C Hamano0acb1ae2012-09-24 21:28:131244</p>
1245</li>
1246<li>
1247<p>
1248<em>%GS</em>: show the name of the signer for a signed commit
1249</p>
1250</li>
1251<li>
1252<p>
Junio C Hamano5e7f1312013-03-21 22:49:011253<em>%GK</em>: show the key used to sign a signed commit
1254</p>
1255</li>
1256<li>
1257<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511258<em>%gD</em>: reflog selector, e.g., <code>refs/stash@{1}</code>
Junio C Hamanoc21ab052009-10-31 04:03:551259</p>
1260</li>
1261<li>
1262<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511263<em>%gd</em>: shortened reflog selector, e.g., <code>stash@{1}</code>
Junio C Hamanoc21ab052009-10-31 04:03:551264</p>
1265</li>
1266<li>
1267<p>
Junio C Hamano962f3a32011-12-22 20:21:441268<em>%gn</em>: reflog identity name
1269</p>
1270</li>
1271<li>
1272<p>
Junio C Hamano04e768d2013-04-23 19:19:261273<em>%gN</em>: reflog identity name (respecting .mailmap, see
1274 <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:441275</p>
1276</li>
1277<li>
1278<p>
1279<em>%ge</em>: reflog identity email
1280</p>
1281</li>
1282<li>
1283<p>
Junio C Hamano04e768d2013-04-23 19:19:261284<em>%gE</em>: reflog identity email (respecting .mailmap, see
1285 <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:441286</p>
1287</li>
1288<li>
1289<p>
Junio C Hamanoc21ab052009-10-31 04:03:551290<em>%gs</em>: reflog subject
1291</p>
1292</li>
1293<li>
1294<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:361295<em>%Cred</em>: switch color to red
1296</p>
1297</li>
1298<li>
1299<p>
1300<em>%Cgreen</em>: switch color to green
1301</p>
1302</li>
1303<li>
1304<p>
1305<em>%Cblue</em>: switch color to blue
1306</p>
1307</li>
1308<li>
1309<p>
1310<em>%Creset</em>: reset color
1311</p>
1312</li>
1313<li>
1314<p>
Junio C Hamanoabad6da2013-01-06 09:06:321315<em>%C(&#8230;)</em>: color specification, as described in color.branch.* config option;
Junio C Hamanoac12f0e2014-09-19 22:32:511316 adding <code>auto,</code> at the beginning will emit color only when colors are
1317 enabled for log output (by <code>color.diff</code>, <code>color.ui</code>, or <code>--color</code>, and
1318 respecting the <code>auto</code> settings of the former if we are going to a
1319 terminal). <code>auto</code> alone (i.e. <code>%C(auto)</code>) will turn on auto coloring
Junio C Hamano04e768d2013-04-23 19:19:261320 on the next placeholders until the color is switched again.
Junio C Hamanocc0cb312009-01-22 03:38:501321</p>
1322</li>
1323<li>
1324<p>
Junio C Hamanod9e0e5d2007-04-14 16:22:041325<em>%m</em>: left, right or boundary mark
1326</p>
1327</li>
1328<li>
1329<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:361330<em>%n</em>: newline
1331</p>
Junio C Hamano0430e3a2007-05-15 03:13:171332</li>
Junio C Hamanob78d2592008-04-09 09:39:081333<li>
1334<p>
Junio C Hamanoa9701f02010-01-21 00:42:161335<em>%%</em>: a raw <em>%</em>
1336</p>
1337</li>
1338<li>
1339<p>
Junio C Hamanob78d2592008-04-09 09:39:081340<em>%x00</em>: print a byte from a hex code
1341</p>
1342</li>
Junio C Hamanobf984de2009-11-23 06:11:191343<li>
1344<p>
1345<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:231346 <a href="git-shortlog.html">git-shortlog(1)</a>.
Junio C Hamanobf984de2009-11-23 06:11:191347</p>
1348</li>
Junio C Hamano04e768d2013-04-23 19:19:261349<li>
1350<p>
1351<em>%&lt;(&lt;N&gt;[,trunc|ltrunc|mtrunc])</em>: make the next placeholder take at
1352 least N columns, padding spaces on the right if necessary.
1353 Optionally truncate at the beginning (ltrunc), the middle (mtrunc)
1354 or the end (trunc) if the output is longer than N columns.
1355 Note that truncating only works correctly with N &gt;= 2.
1356</p>
1357</li>
1358<li>
1359<p>
1360<em>%&lt;|(&lt;N&gt;)</em>: make the next placeholder take at least until Nth
1361 columns, padding spaces on the right if necessary
1362</p>
1363</li>
1364<li>
1365<p>
1366<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>
1367 respectively, but padding spaces on the left
1368</p>
1369</li>
1370<li>
1371<p>
1372<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>
1373 respectively, except that if the next placeholder takes more spaces
1374 than given and there are spaces on its left, use those spaces
1375</p>
1376</li>
1377<li>
1378<p>
1379<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>
1380 respectively, but padding both sides (i.e. the text is centered)
1381</p>
1382</li>
Junio C Hamanoba4b9282008-07-06 05:20:311383</ul></div>
Junio C Hamanoa3fd83c2007-03-02 10:34:361384</li>
Junio C Hamanoc21ab052009-10-31 04:03:551385</ul></div>
1386<div class="admonitionblock">
1387<table><tr>
1388<td class="icon">
1389<div class="title">Note</div>
1390</td>
1391<td class="content">Some placeholders may depend on other options given to the
Junio C Hamanoac12f0e2014-09-19 22:32:511392revision traversal engine. For example, the <code>%g*</code> reflog options will
Junio C Hamanoc21ab052009-10-31 04:03:551393insert an empty string unless we are traversing reflog entries (e.g., by
Junio C Hamano00b9f1a2014-09-29 23:11:281394<code>git log -g</code>). The <code>%d</code> and <code>%D</code> placeholders will use the "short"
1395decoration format if <code>--decorate</code> was not already provided on the command
1396line.</td>
Junio C Hamanoc21ab052009-10-31 04:03:551397</tr></table>
1398</div>
Junio C Hamanoac12f0e2014-09-19 22:32:511399<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:591400is inserted immediately before the expansion if and only if the
1401placeholder expands to a non-empty string.</p></div>
Junio C Hamanoac12f0e2014-09-19 22:32:511402<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:591403immediately precede the expansion are deleted if and only if the
1404placeholder expands to an empty string.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591405<div class="paragraph"><p>If you add a ` ` (space) after <em>%</em> of a placeholder, a space
Junio C Hamano89a57342010-06-22 23:22:551406is inserted immediately before the expansion if and only if the
1407placeholder expands to a non-empty string.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591408<div class="ulist"><ul>
Junio C Hamano6fb124c2008-06-13 10:04:011409<li>
1410<p>
1411<em>tformat:</em>
1412</p>
Junio C Hamano68cf15a2010-11-06 01:01:591413<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:011414provides "terminator" semantics instead of "separator" semantics. In
1415other words, each commit has the message terminator character (usually a
1416newline) appended, rather than a separator placed between entries.
1417This means that the final entry of a single-line format will be properly
1418terminated with a new line, just as the "oneline" format does.
Junio C Hamanoba4b9282008-07-06 05:20:311419For example:</p></div>
Junio C Hamano6fb124c2008-06-13 10:04:011420<div class="listingblock">
1421<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:511422<pre><code>$ git log -2 --pretty=format:%h 4da45bef \
Junio C Hamano6fb124c2008-06-13 10:04:011423 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
14244da45be
14257134973 -- NO NEWLINE
1426
1427$ git log -2 --pretty=tformat:%h 4da45bef \
1428 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
14294da45be
Junio C Hamanoac12f0e2014-09-19 22:32:5114307134973</code></pre>
Junio C Hamano6fb124c2008-06-13 10:04:011431</div></div>
Junio C Hamanoac12f0e2014-09-19 22:32:511432<div class="paragraph"><p>In addition, any unrecognized string that has a <code>%</code> in it is interpreted
1433as if it has <code>tformat:</code> in front of it. For example, these two are
Junio C Hamano0a235222009-03-06 08:21:091434equivalent:</p></div>
1435<div class="listingblock">
1436<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:511437<pre><code>$ git log -2 --pretty=tformat:%h 4da45bef
1438$ git log -2 --pretty=%h 4da45bef</code></pre>
Junio C Hamano0a235222009-03-06 08:21:091439</div></div>
Junio C Hamano6fb124c2008-06-13 10:04:011440</li>
Junio C Hamanoba4b9282008-07-06 05:20:311441</ul></div>
Junio C Hamanod9d71c02006-02-08 00:52:331442</div>
Junio C Hamano9d971152012-12-19 00:43:111443</div>
1444<div class="sect1">
Junio C Hamano58f587a2013-07-22 19:20:591445<h2 id="_common_diff_options">COMMON DIFF OPTIONS</h2>
1446<div class="sectionbody">
1447<div class="dlist"><dl>
1448<dt class="hdlist1">
1449-p
1450</dt>
1451<dt class="hdlist1">
1452-u
1453</dt>
1454<dt class="hdlist1">
1455--patch
1456</dt>
1457<dd>
1458<p>
1459 Generate patch (see section on generating patches).
Junio C Hamano58f587a2013-07-22 19:20:591460</p>
1461</dd>
1462<dt class="hdlist1">
1463-s
1464</dt>
1465<dt class="hdlist1">
1466--no-patch
1467</dt>
1468<dd>
1469<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511470 Suppress diff output. Useful for commands like <code>git show</code> that
1471 show the patch by default, or to cancel the effect of <code>--patch</code>.
Junio C Hamano58f587a2013-07-22 19:20:591472</p>
1473</dd>
1474<dt class="hdlist1">
1475-U&lt;n&gt;
1476</dt>
1477<dt class="hdlist1">
1478--unified=&lt;n&gt;
1479</dt>
1480<dd>
1481<p>
1482 Generate diffs with &lt;n&gt; lines of context instead of
1483 the usual three.
Junio C Hamanoac12f0e2014-09-19 22:32:511484 Implies <code>-p</code>.
Junio C Hamano58f587a2013-07-22 19:20:591485</p>
1486</dd>
1487<dt class="hdlist1">
1488--raw
1489</dt>
1490<dd>
1491<p>
Junio C Hamano85f1fde2015-06-01 20:37:321492 For each commit, show a summary of changes using the raw diff
1493 format. See the "RAW OUTPUT FORMAT" section of
1494 <a href="git-diff.html">git-diff(1)</a>. This is different from showing the log
1495 itself in raw format, which you can achieve with
1496 <code>--format=raw</code>.
Junio C Hamano58f587a2013-07-22 19:20:591497</p>
1498</dd>
1499<dt class="hdlist1">
1500--patch-with-raw
1501</dt>
1502<dd>
1503<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511504 Synonym for <code>-p --raw</code>.
Junio C Hamano58f587a2013-07-22 19:20:591505</p>
1506</dd>
1507<dt class="hdlist1">
1508--minimal
1509</dt>
1510<dd>
1511<p>
1512 Spend extra time to make sure the smallest possible
1513 diff is produced.
1514</p>
1515</dd>
1516<dt class="hdlist1">
1517--patience
1518</dt>
1519<dd>
1520<p>
1521 Generate a diff using the "patience diff" algorithm.
1522</p>
1523</dd>
1524<dt class="hdlist1">
1525--histogram
1526</dt>
1527<dd>
1528<p>
1529 Generate a diff using the "histogram diff" algorithm.
1530</p>
1531</dd>
1532<dt class="hdlist1">
1533--diff-algorithm={patience|minimal|histogram|myers}
1534</dt>
1535<dd>
1536<p>
1537 Choose a diff algorithm. The variants are as follows:
1538</p>
1539<div class="openblock">
1540<div class="content">
1541<div class="dlist"><dl>
1542<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:511543<code>default</code>, <code>myers</code>
Junio C Hamano58f587a2013-07-22 19:20:591544</dt>
1545<dd>
1546<p>
1547 The basic greedy diff algorithm. Currently, this is the default.
1548</p>
1549</dd>
1550<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:511551<code>minimal</code>
Junio C Hamano58f587a2013-07-22 19:20:591552</dt>
1553<dd>
1554<p>
1555 Spend extra time to make sure the smallest possible diff is
1556 produced.
1557</p>
1558</dd>
1559<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:511560<code>patience</code>
Junio C Hamano58f587a2013-07-22 19:20:591561</dt>
1562<dd>
1563<p>
1564 Use "patience diff" algorithm when generating patches.
1565</p>
1566</dd>
1567<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:511568<code>histogram</code>
Junio C Hamano58f587a2013-07-22 19:20:591569</dt>
1570<dd>
1571<p>
1572 This algorithm extends the patience algorithm to "support
1573 low-occurrence common elements".
1574</p>
1575</dd>
1576</dl></div>
1577</div></div>
1578<div class="paragraph"><p>For instance, if you configured diff.algorithm variable to a
1579non-default value and want to use the default one, then you
Junio C Hamanoac12f0e2014-09-19 22:32:511580have to use <code>--diff-algorithm=default</code> option.</p></div>
Junio C Hamano58f587a2013-07-22 19:20:591581</dd>
1582<dt class="hdlist1">
1583--stat[=&lt;width&gt;[,&lt;name-width&gt;[,&lt;count&gt;]]]
1584</dt>
1585<dd>
1586<p>
1587 Generate a diffstat. By default, as much space as necessary
1588 will be used for the filename part, and the rest for the graph
1589 part. Maximum width defaults to terminal width, or 80 columns
1590 if not connected to a terminal, and can be overridden by
Junio C Hamanoac12f0e2014-09-19 22:32:511591 <code>&lt;width&gt;</code>. The width of the filename part can be limited by
1592 giving another width <code>&lt;name-width&gt;</code> after a comma. The width
Junio C Hamano58f587a2013-07-22 19:20:591593 of the graph part can be limited by using
Junio C Hamanoac12f0e2014-09-19 22:32:511594 <code>--stat-graph-width=&lt;width&gt;</code> (affects all commands generating
1595 a stat graph) or by setting <code>diff.statGraphWidth=&lt;width&gt;</code>
1596 (does not affect <code>git format-patch</code>).
1597 By giving a third parameter <code>&lt;count&gt;</code>, you can limit the
1598 output to the first <code>&lt;count&gt;</code> lines, followed by <code>...</code> if
Junio C Hamano58f587a2013-07-22 19:20:591599 there are more.
1600</p>
Junio C Hamanoac12f0e2014-09-19 22:32:511601<div class="paragraph"><p>These parameters can also be set individually with <code>--stat-width=&lt;width&gt;</code>,
1602<code>--stat-name-width=&lt;name-width&gt;</code> and <code>--stat-count=&lt;count&gt;</code>.</p></div>
Junio C Hamano58f587a2013-07-22 19:20:591603</dd>
1604<dt class="hdlist1">
1605--numstat
1606</dt>
1607<dd>
1608<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511609 Similar to <code>--stat</code>, but shows number of added and
Junio C Hamano58f587a2013-07-22 19:20:591610 deleted lines in decimal notation and pathname without
1611 abbreviation, to make it more machine friendly. For
Junio C Hamanoac12f0e2014-09-19 22:32:511612 binary files, outputs two <code>-</code> instead of saying
1613 <code>0 0</code>.
Junio C Hamano58f587a2013-07-22 19:20:591614</p>
1615</dd>
1616<dt class="hdlist1">
1617--shortstat
1618</dt>
1619<dd>
1620<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511621 Output only the last line of the <code>--stat</code> format containing total
Junio C Hamano58f587a2013-07-22 19:20:591622 number of modified files, as well as number of added and deleted
1623 lines.
1624</p>
1625</dd>
1626<dt class="hdlist1">
1627--dirstat[=&lt;param1,param2,&#8230;&gt;]
1628</dt>
1629<dd>
1630<p>
1631 Output the distribution of relative amount of changes for each
Junio C Hamanoac12f0e2014-09-19 22:32:511632 sub-directory. The behavior of <code>--dirstat</code> can be customized by
Junio C Hamano58f587a2013-07-22 19:20:591633 passing it a comma separated list of parameters.
Junio C Hamanoac12f0e2014-09-19 22:32:511634 The defaults are controlled by the <code>diff.dirstat</code> configuration
Junio C Hamano58f587a2013-07-22 19:20:591635 variable (see <a href="git-config.html">git-config(1)</a>).
1636 The following parameters are available:
1637</p>
1638<div class="openblock">
1639<div class="content">
1640<div class="dlist"><dl>
1641<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:511642<code>changes</code>
Junio C Hamano58f587a2013-07-22 19:20:591643</dt>
1644<dd>
1645<p>
1646 Compute the dirstat numbers by counting the lines that have been
1647 removed from the source, or added to the destination. This ignores
1648 the amount of pure code movements within a file. In other words,
1649 rearranging lines in a file is not counted as much as other changes.
1650 This is the default behavior when no parameter is given.
1651</p>
1652</dd>
1653<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:511654<code>lines</code>
Junio C Hamano58f587a2013-07-22 19:20:591655</dt>
1656<dd>
1657<p>
1658 Compute the dirstat numbers by doing the regular line-based diff
1659 analysis, and summing the removed/added line counts. (For binary
1660 files, count 64-byte chunks instead, since binary files have no
Junio C Hamanoac12f0e2014-09-19 22:32:511661 natural concept of lines). This is a more expensive <code>--dirstat</code>
1662 behavior than the <code>changes</code> behavior, but it does count rearranged
Junio C Hamano58f587a2013-07-22 19:20:591663 lines within a file as much as other changes. The resulting output
Junio C Hamanoac12f0e2014-09-19 22:32:511664 is consistent with what you get from the other <code>--*stat</code> options.
Junio C Hamano58f587a2013-07-22 19:20:591665</p>
1666</dd>
1667<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:511668<code>files</code>
Junio C Hamano58f587a2013-07-22 19:20:591669</dt>
1670<dd>
1671<p>
1672 Compute the dirstat numbers by counting the number of files changed.
1673 Each changed file counts equally in the dirstat analysis. This is
Junio C Hamanoac12f0e2014-09-19 22:32:511674 the computationally cheapest <code>--dirstat</code> behavior, since it does
Junio C Hamano58f587a2013-07-22 19:20:591675 not have to look at the file contents at all.
1676</p>
1677</dd>
1678<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:511679<code>cumulative</code>
Junio C Hamano58f587a2013-07-22 19:20:591680</dt>
1681<dd>
1682<p>
1683 Count changes in a child directory for the parent directory as well.
Junio C Hamanoac12f0e2014-09-19 22:32:511684 Note that when using <code>cumulative</code>, the sum of the percentages
Junio C Hamano58f587a2013-07-22 19:20:591685 reported may exceed 100%. The default (non-cumulative) behavior can
Junio C Hamanoac12f0e2014-09-19 22:32:511686 be specified with the <code>noncumulative</code> parameter.
Junio C Hamano58f587a2013-07-22 19:20:591687</p>
1688</dd>
1689<dt class="hdlist1">
1690&lt;limit&gt;
1691</dt>
1692<dd>
1693<p>
1694 An integer parameter specifies a cut-off percent (3% by default).
1695 Directories contributing less than this percentage of the changes
1696 are not shown in the output.
1697</p>
1698</dd>
1699</dl></div>
1700</div></div>
1701<div class="paragraph"><p>Example: The following will count changed files, while ignoring
1702directories with less than 10% of the total amount of changed files,
1703and accumulating child directory counts in the parent directories:
Junio C Hamanoac12f0e2014-09-19 22:32:511704<code>--dirstat=files,10,cumulative</code>.</p></div>
Junio C Hamano58f587a2013-07-22 19:20:591705</dd>
1706<dt class="hdlist1">
1707--summary
1708</dt>
1709<dd>
1710<p>
1711 Output a condensed summary of extended header information
1712 such as creations, renames and mode changes.
1713</p>
1714</dd>
1715<dt class="hdlist1">
1716--patch-with-stat
1717</dt>
1718<dd>
1719<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511720 Synonym for <code>-p --stat</code>.
Junio C Hamano58f587a2013-07-22 19:20:591721</p>
1722</dd>
1723<dt class="hdlist1">
1724-z
1725</dt>
1726<dd>
1727<p>
1728 Separate the commits with NULs instead of with new newlines.
1729</p>
Junio C Hamanoac12f0e2014-09-19 22:32:511730<div class="paragraph"><p>Also, when <code>--raw</code> or <code>--numstat</code> has been given, do not munge
Junio C Hamano58f587a2013-07-22 19:20:591731pathnames and use NULs as output field terminators.</p></div>
1732<div class="paragraph"><p>Without this option, each pathname output will have TAB, LF, double quotes,
Junio C Hamanoac12f0e2014-09-19 22:32:511733and backslash characters replaced with <code>\t</code>, <code>\n</code>, <code>\"</code>, and <code>\\</code>,
Junio C Hamano58f587a2013-07-22 19:20:591734respectively, and the pathname will be enclosed in double quotes if
1735any of those replacements occurred.</p></div>
1736</dd>
1737<dt class="hdlist1">
1738--name-only
1739</dt>
1740<dd>
1741<p>
1742 Show only names of changed files.
1743</p>
1744</dd>
1745<dt class="hdlist1">
1746--name-status
1747</dt>
1748<dd>
1749<p>
1750 Show only names and status of changed files. See the description
Junio C Hamanoac12f0e2014-09-19 22:32:511751 of the <code>--diff-filter</code> option on what the status letters mean.
Junio C Hamano58f587a2013-07-22 19:20:591752</p>
1753</dd>
1754<dt class="hdlist1">
1755--submodule[=&lt;format&gt;]
1756</dt>
1757<dd>
1758<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511759 Specify how differences in submodules are shown. When <code>--submodule</code>
1760 or <code>--submodule=log</code> is given, the <em>log</em> format is used. This format lists
1761 the commits in the range like <a href="git-submodule.html">git-submodule(1)</a> <code>summary</code> does.
1762 Omitting the <code>--submodule</code> option or specifying <code>--submodule=short</code>,
Junio C Hamano58f587a2013-07-22 19:20:591763 uses the <em>short</em> format. This format just shows the names of the commits
1764 at the beginning and end of the range. Can be tweaked via the
Junio C Hamanoac12f0e2014-09-19 22:32:511765 <code>diff.submodule</code> configuration variable.
Junio C Hamano58f587a2013-07-22 19:20:591766</p>
1767</dd>
1768<dt class="hdlist1">
1769--color[=&lt;when&gt;]
1770</dt>
1771<dd>
1772<p>
1773 Show colored diff.
Junio C Hamanoac12f0e2014-09-19 22:32:511774 <code>--color</code> (i.e. without <em>=&lt;when&gt;</em>) is the same as <code>--color=always</code>.
1775 <em>&lt;when&gt;</em> can be one of <code>always</code>, <code>never</code>, or <code>auto</code>.
Junio C Hamano58f587a2013-07-22 19:20:591776</p>
1777</dd>
1778<dt class="hdlist1">
1779--no-color
1780</dt>
1781<dd>
1782<p>
1783 Turn off colored diff.
Junio C Hamanoac12f0e2014-09-19 22:32:511784 It is the same as <code>--color=never</code>.
Junio C Hamano58f587a2013-07-22 19:20:591785</p>
1786</dd>
1787<dt class="hdlist1">
1788--word-diff[=&lt;mode&gt;]
1789</dt>
1790<dd>
1791<p>
1792 Show a word diff, using the &lt;mode&gt; to delimit changed words.
1793 By default, words are delimited by whitespace; see
Junio C Hamanoac12f0e2014-09-19 22:32:511794 <code>--word-diff-regex</code> below. The &lt;mode&gt; defaults to <em>plain</em>, and
Junio C Hamano58f587a2013-07-22 19:20:591795 must be one of:
1796</p>
1797<div class="openblock">
1798<div class="content">
1799<div class="dlist"><dl>
1800<dt class="hdlist1">
1801color
1802</dt>
1803<dd>
1804<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511805 Highlight changed words using only colors. Implies <code>--color</code>.
Junio C Hamano58f587a2013-07-22 19:20:591806</p>
1807</dd>
1808<dt class="hdlist1">
1809plain
1810</dt>
1811<dd>
1812<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511813 Show words as <code>[-removed-]</code> and <code>{+added+}</code>. Makes no
Junio C Hamano58f587a2013-07-22 19:20:591814 attempts to escape the delimiters if they appear in the input,
1815 so the output may be ambiguous.
1816</p>
1817</dd>
1818<dt class="hdlist1">
1819porcelain
1820</dt>
1821<dd>
1822<p>
1823 Use a special line-based format intended for script
1824 consumption. Added/removed/unchanged runs are printed in the
Junio C Hamanoac12f0e2014-09-19 22:32:511825 usual unified diff format, starting with a <code>+</code>/<code>-</code>/` `
Junio C Hamano58f587a2013-07-22 19:20:591826 character at the beginning of the line and extending to the
1827 end of the line. Newlines in the input are represented by a
Junio C Hamanoac12f0e2014-09-19 22:32:511828 tilde <code>~</code> on a line of its own.
Junio C Hamano58f587a2013-07-22 19:20:591829</p>
1830</dd>
1831<dt class="hdlist1">
1832none
1833</dt>
1834<dd>
1835<p>
1836 Disable word diff again.
1837</p>
1838</dd>
1839</dl></div>
1840</div></div>
1841<div class="paragraph"><p>Note that despite the name of the first mode, color is used to
1842highlight the changed parts in all modes if enabled.</p></div>
1843</dd>
1844<dt class="hdlist1">
1845--word-diff-regex=&lt;regex&gt;
1846</dt>
1847<dd>
1848<p>
1849 Use &lt;regex&gt; to decide what a word is, instead of considering
1850 runs of non-whitespace to be a word. Also implies
Junio C Hamanoac12f0e2014-09-19 22:32:511851 <code>--word-diff</code> unless it was already enabled.
Junio C Hamano58f587a2013-07-22 19:20:591852</p>
1853<div class="paragraph"><p>Every non-overlapping match of the
1854&lt;regex&gt; is considered a word. Anything between these matches is
1855considered whitespace and ignored(!) for the purposes of finding
Junio C Hamanoac12f0e2014-09-19 22:32:511856differences. You may want to append <code>|[^[:space:]]</code> to your regular
Junio C Hamano58f587a2013-07-22 19:20:591857expression to make sure that it matches all non-whitespace characters.
1858A match that contains a newline is silently truncated(!) at the
1859newline.</p></div>
Junio C Hamano713eded2015-12-03 00:24:021860<div class="paragraph"><p>For example, <code>--word-diff-regex=.</code> will treat each character as a word
1861and, correspondingly, show differences character by character.</p></div>
Junio C Hamano58f587a2013-07-22 19:20:591862<div class="paragraph"><p>The regex can also be set via a diff driver or configuration option, see
1863<a href="gitattributes.html">gitattributes(1)</a> or <a href="git-config.html">git-config(1)</a>. Giving it explicitly
1864overrides any diff driver or configuration setting. Diff drivers
1865override configuration settings.</p></div>
1866</dd>
1867<dt class="hdlist1">
1868--color-words[=&lt;regex&gt;]
1869</dt>
1870<dd>
1871<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511872 Equivalent to <code>--word-diff=color</code> plus (if a regex was
1873 specified) <code>--word-diff-regex=&lt;regex&gt;</code>.
Junio C Hamano58f587a2013-07-22 19:20:591874</p>
1875</dd>
1876<dt class="hdlist1">
1877--no-renames
1878</dt>
1879<dd>
1880<p>
1881 Turn off rename detection, even when the configuration
1882 file gives the default to do so.
1883</p>
1884</dd>
1885<dt class="hdlist1">
1886--check
1887</dt>
1888<dd>
1889<p>
1890 Warn if changes introduce whitespace errors. What are
Junio C Hamanoac12f0e2014-09-19 22:32:511891 considered whitespace errors is controlled by <code>core.whitespace</code>
Junio C Hamano58f587a2013-07-22 19:20:591892 configuration. By default, trailing whitespaces (including
1893 lines that solely consist of whitespaces) and a space character
1894 that is immediately followed by a tab character inside the
1895 initial indent of the line are considered whitespace errors.
1896 Exits with non-zero status if problems are found. Not compatible
1897 with --exit-code.
1898</p>
1899</dd>
1900<dt class="hdlist1">
Junio C Hamano8c5d5942015-06-11 19:37:481901--ws-error-highlight=&lt;kind&gt;
1902</dt>
1903<dd>
1904<p>
1905 Highlight whitespace errors on lines specified by &lt;kind&gt;
1906 in the color specified by <code>color.diff.whitespace</code>. &lt;kind&gt;
1907 is a comma separated list of <code>old</code>, <code>new</code>, <code>context</code>. When
1908 this option is not given, only whitespace errors in <code>new</code>
1909 lines are highlighted. E.g. <code>--ws-error-highlight=new,old</code>
1910 highlights whitespace errors on both deleted and added lines.
1911 <code>all</code> can be used as a short-hand for <code>old,new,context</code>.
1912</p>
1913</dd>
1914<dt class="hdlist1">
Junio C Hamano58f587a2013-07-22 19:20:591915--full-index
1916</dt>
1917<dd>
1918<p>
1919 Instead of the first handful of characters, show the full
1920 pre- and post-image blob object names on the "index"
1921 line when generating patch format output.
1922</p>
1923</dd>
1924<dt class="hdlist1">
1925--binary
1926</dt>
1927<dd>
1928<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511929 In addition to <code>--full-index</code>, output a binary diff that
1930 can be applied with <code>git-apply</code>.
Junio C Hamano58f587a2013-07-22 19:20:591931</p>
1932</dd>
1933<dt class="hdlist1">
1934--abbrev[=&lt;n&gt;]
1935</dt>
1936<dd>
1937<p>
1938 Instead of showing the full 40-byte hexadecimal object
1939 name in diff-raw format output and diff-tree header
1940 lines, show only a partial prefix. This is
Junio C Hamanoac12f0e2014-09-19 22:32:511941 independent of the <code>--full-index</code> option above, which controls
Junio C Hamano58f587a2013-07-22 19:20:591942 the diff-patch output format. Non default number of
Junio C Hamanoac12f0e2014-09-19 22:32:511943 digits can be specified with <code>--abbrev=&lt;n&gt;</code>.
Junio C Hamano58f587a2013-07-22 19:20:591944</p>
1945</dd>
1946<dt class="hdlist1">
1947-B[&lt;n&gt;][/&lt;m&gt;]
1948</dt>
1949<dt class="hdlist1">
1950--break-rewrites[=[&lt;n&gt;][/&lt;m&gt;]]
1951</dt>
1952<dd>
1953<p>
1954 Break complete rewrite changes into pairs of delete and
1955 create. This serves two purposes:
1956</p>
1957<div class="paragraph"><p>It affects the way a change that amounts to a total rewrite of a file
1958not as a series of deletion and insertion mixed together with a very
1959few lines that happen to match textually as the context, but as a
1960single deletion of everything old followed by a single insertion of
Junio C Hamanoac12f0e2014-09-19 22:32:511961everything new, and the number <code>m</code> controls this aspect of the -B
1962option (defaults to 60%). <code>-B/70%</code> specifies that less than 30% of the
Junio C Hamano58f587a2013-07-22 19:20:591963original should remain in the result for Git to consider it a total
1964rewrite (i.e. otherwise the resulting patch will be a series of
1965deletion and insertion mixed together with context lines).</p></div>
1966<div class="paragraph"><p>When used with -M, a totally-rewritten file is also considered as the
1967source of a rename (usually -M only considers a file that disappeared
Junio C Hamanoac12f0e2014-09-19 22:32:511968as the source of a rename), and the number <code>n</code> controls this aspect of
1969the -B option (defaults to 50%). <code>-B20%</code> specifies that a change with
Junio C Hamano58f587a2013-07-22 19:20:591970addition and deletion compared to 20% or more of the file&#8217;s size are
1971eligible for being picked up as a possible source of a rename to
1972another file.</p></div>
1973</dd>
1974<dt class="hdlist1">
1975-M[&lt;n&gt;]
1976</dt>
1977<dt class="hdlist1">
1978--find-renames[=&lt;n&gt;]
1979</dt>
1980<dd>
1981<p>
1982 If generating diffs, detect and report renames for each commit.
1983 For following files across renames while traversing history, see
Junio C Hamanoac12f0e2014-09-19 22:32:511984 <code>--follow</code>.
1985 If <code>n</code> is specified, it is a threshold on the similarity
Junio C Hamano58f587a2013-07-22 19:20:591986 index (i.e. amount of addition/deletions compared to the
Junio C Hamanoac12f0e2014-09-19 22:32:511987 file&#8217;s size). For example, <code>-M90%</code> means Git should consider a
Junio C Hamano58f587a2013-07-22 19:20:591988 delete/add pair to be a rename if more than 90% of the file
Junio C Hamanoac12f0e2014-09-19 22:32:511989 hasn&#8217;t changed. Without a <code>%</code> sign, the number is to be read as
1990 a fraction, with a decimal point before it. I.e., <code>-M5</code> becomes
1991 0.5, and is thus the same as <code>-M50%</code>. Similarly, <code>-M05</code> is
1992 the same as <code>-M5%</code>. To limit detection to exact renames, use
1993 <code>-M100%</code>. The default similarity index is 50%.
Junio C Hamano58f587a2013-07-22 19:20:591994</p>
1995</dd>
1996<dt class="hdlist1">
1997-C[&lt;n&gt;]
1998</dt>
1999<dt class="hdlist1">
2000--find-copies[=&lt;n&gt;]
2001</dt>
2002<dd>
2003<p>
Junio C Hamanoac12f0e2014-09-19 22:32:512004 Detect copies as well as renames. See also <code>--find-copies-harder</code>.
2005 If <code>n</code> is specified, it has the same meaning as for <code>-M&lt;n&gt;</code>.
Junio C Hamano58f587a2013-07-22 19:20:592006</p>
2007</dd>
2008<dt class="hdlist1">
2009--find-copies-harder
2010</dt>
2011<dd>
2012<p>
Junio C Hamanoac12f0e2014-09-19 22:32:512013 For performance reasons, by default, <code>-C</code> option finds copies only
Junio C Hamano58f587a2013-07-22 19:20:592014 if the original file of the copy was modified in the same
2015 changeset. This flag makes the command
2016 inspect unmodified files as candidates for the source of
2017 copy. This is a very expensive operation for large
2018 projects, so use it with caution. Giving more than one
Junio C Hamanoac12f0e2014-09-19 22:32:512019 <code>-C</code> option has the same effect.
Junio C Hamano58f587a2013-07-22 19:20:592020</p>
2021</dd>
2022<dt class="hdlist1">
2023-D
2024</dt>
2025<dt class="hdlist1">
2026--irreversible-delete
2027</dt>
2028<dd>
2029<p>
2030 Omit the preimage for deletes, i.e. print only the header but not
Junio C Hamanoac12f0e2014-09-19 22:32:512031 the diff between the preimage and <code>/dev/null</code>. The resulting patch
2032 is not meant to be applied with <code>patch</code> or <code>git apply</code>; this is
Junio C Hamano58f587a2013-07-22 19:20:592033 solely for people who want to just concentrate on reviewing the
2034 text after the change. In addition, the output obviously lack
2035 enough information to apply such a patch in reverse, even manually,
2036 hence the name of the option.
2037</p>
Junio C Hamanoac12f0e2014-09-19 22:32:512038<div class="paragraph"><p>When used together with <code>-B</code>, omit also the preimage in the deletion part
Junio C Hamano58f587a2013-07-22 19:20:592039of a delete/create pair.</p></div>
2040</dd>
2041<dt class="hdlist1">
2042-l&lt;num&gt;
2043</dt>
2044<dd>
2045<p>
Junio C Hamanoac12f0e2014-09-19 22:32:512046 The <code>-M</code> and <code>-C</code> options require O(n^2) processing time where n
Junio C Hamano58f587a2013-07-22 19:20:592047 is the number of potential rename/copy targets. This
2048 option prevents rename/copy detection from running if
2049 the number of rename/copy targets exceeds the specified
2050 number.
2051</p>
2052</dd>
2053<dt class="hdlist1">
2054--diff-filter=[(A|C|D|M|R|T|U|X|B)&#8230;[*]]
2055</dt>
2056<dd>
2057<p>
Junio C Hamanoac12f0e2014-09-19 22:32:512058 Select only files that are Added (<code>A</code>), Copied (<code>C</code>),
2059 Deleted (<code>D</code>), Modified (<code>M</code>), Renamed (<code>R</code>), have their
2060 type (i.e. regular file, symlink, submodule, &#8230;) changed (<code>T</code>),
2061 are Unmerged (<code>U</code>), are
2062 Unknown (<code>X</code>), or have had their pairing Broken (<code>B</code>).
Junio C Hamano58f587a2013-07-22 19:20:592063 Any combination of the filter characters (including none) can be used.
Junio C Hamanoac12f0e2014-09-19 22:32:512064 When <code>*</code> (All-or-none) is added to the combination, all
Junio C Hamano58f587a2013-07-22 19:20:592065 paths are selected if there is any file that matches
2066 other criteria in the comparison; if there is no file
2067 that matches other criteria, nothing is selected.
2068</p>
2069</dd>
2070<dt class="hdlist1">
2071-S&lt;string&gt;
2072</dt>
2073<dd>
2074<p>
2075 Look for differences that change the number of occurrences of
2076 the specified string (i.e. addition/deletion) in a file.
2077 Intended for the scripter&#8217;s use.
2078</p>
2079<div class="paragraph"><p>It is useful when you&#8217;re looking for an exact block of code (like a
2080struct), and want to know the history of that block since it first
2081came into being: use the feature iteratively to feed the interesting
Junio C Hamanoac12f0e2014-09-19 22:32:512082block in the preimage back into <code>-S</code>, and keep going until you get the
Junio C Hamano58f587a2013-07-22 19:20:592083very first version of the block.</p></div>
2084</dd>
2085<dt class="hdlist1">
2086-G&lt;regex&gt;
2087</dt>
2088<dd>
2089<p>
2090 Look for differences whose patch text contains added/removed
2091 lines that match &lt;regex&gt;.
2092</p>
Junio C Hamanoac12f0e2014-09-19 22:32:512093<div class="paragraph"><p>To illustrate the difference between <code>-S&lt;regex&gt; --pickaxe-regex</code> and
2094<code>-G&lt;regex&gt;</code>, consider a commit with the following diff in the same
Junio C Hamano58f587a2013-07-22 19:20:592095file:</p></div>
2096<div class="listingblock">
2097<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512098<pre><code>+ return !regexec(regexp, two-&gt;ptr, 1, &amp;regmatch, 0);
Junio C Hamano58f587a2013-07-22 19:20:592099...
Junio C Hamanoac12f0e2014-09-19 22:32:512100- hit = !regexec(regexp, mf2.ptr, 1, &amp;regmatch, 0);</code></pre>
Junio C Hamano58f587a2013-07-22 19:20:592101</div></div>
Junio C Hamanoac12f0e2014-09-19 22:32:512102<div class="paragraph"><p>While <code>git log -G"regexec\(regexp"</code> will show this commit, <code>git log
2103-S"regexec\(regexp" --pickaxe-regex</code> will not (because the number of
Junio C Hamano58f587a2013-07-22 19:20:592104occurrences of that string did not change).</p></div>
2105<div class="paragraph"><p>See the <em>pickaxe</em> entry in <a href="gitdiffcore.html">gitdiffcore(7)</a> for more
2106information.</p></div>
2107</dd>
2108<dt class="hdlist1">
2109--pickaxe-all
2110</dt>
2111<dd>
2112<p>
Junio C Hamanoac12f0e2014-09-19 22:32:512113 When <code>-S</code> or <code>-G</code> finds a change, show all the changes in that
Junio C Hamano58f587a2013-07-22 19:20:592114 changeset, not just the files that contain the change
2115 in &lt;string&gt;.
2116</p>
2117</dd>
2118<dt class="hdlist1">
2119--pickaxe-regex
2120</dt>
2121<dd>
2122<p>
Junio C Hamanoac12f0e2014-09-19 22:32:512123 Treat the &lt;string&gt; given to <code>-S</code> as an extended POSIX regular
Junio C Hamano58f587a2013-07-22 19:20:592124 expression to match.
2125</p>
2126</dd>
2127<dt class="hdlist1">
2128-O&lt;orderfile&gt;
2129</dt>
2130<dd>
2131<p>
2132 Output the patch in the order specified in the
2133 &lt;orderfile&gt;, which has one shell glob pattern per line.
Junio C Hamano322c6242015-03-23 21:32:462134 This overrides the <code>diff.orderFile</code> configuration variable
2135 (see <a href="git-config.html">git-config(1)</a>). To cancel <code>diff.orderFile</code>,
Junio C Hamanoac12f0e2014-09-19 22:32:512136 use <code>-O/dev/null</code>.
Junio C Hamano58f587a2013-07-22 19:20:592137</p>
2138</dd>
2139<dt class="hdlist1">
2140-R
2141</dt>
2142<dd>
2143<p>
2144 Swap two inputs; that is, show differences from index or
2145 on-disk file to tree contents.
2146</p>
2147</dd>
2148<dt class="hdlist1">
2149--relative[=&lt;path&gt;]
2150</dt>
2151<dd>
2152<p>
2153 When run from a subdirectory of the project, it can be
2154 told to exclude changes outside the directory and show
2155 pathnames relative to it with this option. When you are
2156 not in a subdirectory (e.g. in a bare repository), you
2157 can name which subdirectory to make the output relative
2158 to by giving a &lt;path&gt; as an argument.
2159</p>
2160</dd>
2161<dt class="hdlist1">
2162-a
2163</dt>
2164<dt class="hdlist1">
2165--text
2166</dt>
2167<dd>
2168<p>
2169 Treat all files as text.
2170</p>
2171</dd>
2172<dt class="hdlist1">
2173--ignore-space-at-eol
2174</dt>
2175<dd>
2176<p>
2177 Ignore changes in whitespace at EOL.
2178</p>
2179</dd>
2180<dt class="hdlist1">
2181-b
2182</dt>
2183<dt class="hdlist1">
2184--ignore-space-change
2185</dt>
2186<dd>
2187<p>
2188 Ignore changes in amount of whitespace. This ignores whitespace
2189 at line end, and considers all other sequences of one or
2190 more whitespace characters to be equivalent.
2191</p>
2192</dd>
2193<dt class="hdlist1">
2194-w
2195</dt>
2196<dt class="hdlist1">
2197--ignore-all-space
2198</dt>
2199<dd>
2200<p>
2201 Ignore whitespace when comparing lines. This ignores
2202 differences even if one line has whitespace where the other
2203 line has none.
2204</p>
2205</dd>
2206<dt class="hdlist1">
2207--ignore-blank-lines
2208</dt>
2209<dd>
2210<p>
2211 Ignore changes whose lines are all blank.
2212</p>
2213</dd>
2214<dt class="hdlist1">
2215--inter-hunk-context=&lt;lines&gt;
2216</dt>
2217<dd>
2218<p>
2219 Show the context between diff hunks, up to the specified number
2220 of lines, thereby fusing hunks that are close to each other.
2221</p>
2222</dd>
2223<dt class="hdlist1">
2224-W
2225</dt>
2226<dt class="hdlist1">
2227--function-context
2228</dt>
2229<dd>
2230<p>
2231 Show whole surrounding functions of changes.
2232</p>
2233</dd>
2234<dt class="hdlist1">
2235--ext-diff
2236</dt>
2237<dd>
2238<p>
2239 Allow an external diff helper to be executed. If you set an
2240 external diff driver with <a href="gitattributes.html">gitattributes(5)</a>, you need
2241 to use this option with <a href="git-log.html">git-log(1)</a> and friends.
2242</p>
2243</dd>
2244<dt class="hdlist1">
2245--no-ext-diff
2246</dt>
2247<dd>
2248<p>
2249 Disallow external diff drivers.
2250</p>
2251</dd>
2252<dt class="hdlist1">
2253--textconv
2254</dt>
2255<dt class="hdlist1">
2256--no-textconv
2257</dt>
2258<dd>
2259<p>
2260 Allow (or disallow) external text conversion filters to be run
2261 when comparing binary files. See <a href="gitattributes.html">gitattributes(5)</a> for
2262 details. Because textconv filters are typically a one-way
2263 conversion, the resulting diff is suitable for human
2264 consumption, but cannot be applied. For this reason, textconv
2265 filters are enabled by default only for <a href="git-diff.html">git-diff(1)</a> and
2266 <a href="git-log.html">git-log(1)</a>, but not for <a href="git-format-patch.html">git-format-patch(1)</a> or
2267 diff plumbing commands.
2268</p>
2269</dd>
2270<dt class="hdlist1">
2271--ignore-submodules[=&lt;when&gt;]
2272</dt>
2273<dd>
2274<p>
2275 Ignore changes to submodules in the diff generation. &lt;when&gt; can be
2276 either "none", "untracked", "dirty" or "all", which is the default.
2277 Using "none" will consider the submodule modified when it either contains
2278 untracked or modified files or its HEAD differs from the commit recorded
2279 in the superproject and can be used to override any settings of the
2280 <em>ignore</em> option in <a href="git-config.html">git-config(1)</a> or <a href="gitmodules.html">gitmodules(5)</a>. When
2281 "untracked" is used submodules are not considered dirty when they only
2282 contain untracked content (but they are still scanned for modified
2283 content). Using "dirty" ignores all changes to the work tree of submodules,
2284 only changes to the commits stored in the superproject are shown (this was
2285 the behavior until 1.7.0). Using "all" hides all changes to submodules.
2286</p>
2287</dd>
2288<dt class="hdlist1">
2289--src-prefix=&lt;prefix&gt;
2290</dt>
2291<dd>
2292<p>
2293 Show the given source prefix instead of "a/".
2294</p>
2295</dd>
2296<dt class="hdlist1">
2297--dst-prefix=&lt;prefix&gt;
2298</dt>
2299<dd>
2300<p>
2301 Show the given destination prefix instead of "b/".
2302</p>
2303</dd>
2304<dt class="hdlist1">
2305--no-prefix
2306</dt>
2307<dd>
2308<p>
2309 Do not show any source or destination prefix.
2310</p>
2311</dd>
2312</dl></div>
2313<div class="paragraph"><p>For more detailed explanation on these common options, see also
2314<a href="gitdiffcore.html">gitdiffcore(7)</a>.</p></div>
2315</div>
2316</div>
2317<div class="sect1">
2318<h2 id="_generating_patches_with_p">Generating patches with -p</h2>
2319<div class="sectionbody">
2320<div class="paragraph"><p>When "git-diff-index", "git-diff-tree", or "git-diff-files" are run
2321with a <em>-p</em> option, "git diff" without the <em>--raw</em> option, or
2322"git log" with the "-p" option, they
2323do not produce the output described above; instead they produce a
2324patch file. You can customize the creation of such patches via the
2325GIT_EXTERNAL_DIFF and the GIT_DIFF_OPTS environment variables.</p></div>
2326<div class="paragraph"><p>What the -p option produces is slightly different from the traditional
2327diff format:</p></div>
2328<div class="olist arabic"><ol class="arabic">
2329<li>
2330<p>
2331It is preceded with a "git diff" header that looks like this:
2332</p>
2333<div class="literalblock">
2334<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512335<pre><code>diff --git a/file1 b/file2</code></pre>
Junio C Hamano58f587a2013-07-22 19:20:592336</div></div>
Junio C Hamanoac12f0e2014-09-19 22:32:512337<div class="paragraph"><p>The <code>a/</code> and <code>b/</code> filenames are the same unless rename/copy is
Junio C Hamano58f587a2013-07-22 19:20:592338involved. Especially, even for a creation or a deletion,
Junio C Hamanoac12f0e2014-09-19 22:32:512339<code>/dev/null</code> is <em>not</em> used in place of the <code>a/</code> or <code>b/</code> filenames.</p></div>
2340<div class="paragraph"><p>When rename/copy is involved, <code>file1</code> and <code>file2</code> show the
Junio C Hamano58f587a2013-07-22 19:20:592341name of the source file of the rename/copy and the name of
2342the file that rename/copy produces, respectively.</p></div>
2343</li>
2344<li>
2345<p>
2346It is followed by one or more extended header lines:
2347</p>
2348<div class="literalblock">
2349<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512350<pre><code>old mode &lt;mode&gt;
Junio C Hamano58f587a2013-07-22 19:20:592351new mode &lt;mode&gt;
2352deleted file mode &lt;mode&gt;
2353new file mode &lt;mode&gt;
2354copy from &lt;path&gt;
2355copy to &lt;path&gt;
2356rename from &lt;path&gt;
2357rename to &lt;path&gt;
2358similarity index &lt;number&gt;
2359dissimilarity index &lt;number&gt;
Junio C Hamanoac12f0e2014-09-19 22:32:512360index &lt;hash&gt;..&lt;hash&gt; &lt;mode&gt;</code></pre>
Junio C Hamano58f587a2013-07-22 19:20:592361</div></div>
2362<div class="paragraph"><p>File modes are printed as 6-digit octal numbers including the file type
2363and file permission bits.</p></div>
Junio C Hamanoac12f0e2014-09-19 22:32:512364<div class="paragraph"><p>Path names in extended headers do not include the <code>a/</code> and <code>b/</code> prefixes.</p></div>
Junio C Hamano58f587a2013-07-22 19:20:592365<div class="paragraph"><p>The similarity index is the percentage of unchanged lines, and
2366the dissimilarity index is the percentage of changed lines. It
2367is a rounded down integer, followed by a percent sign. The
2368similarity index value of 100% is thus reserved for two equal
2369files, while 100% dissimilarity means that no line from the old
2370file made it into the new one.</p></div>
2371<div class="paragraph"><p>The index line includes the SHA-1 checksum before and after the change.
2372The &lt;mode&gt; is included if the file mode does not change; otherwise,
2373separate lines indicate the old and the new mode.</p></div>
2374</li>
2375<li>
2376<p>
2377TAB, LF, double quote and backslash characters in pathnames
Junio C Hamanoac12f0e2014-09-19 22:32:512378 are represented as <code>\t</code>, <code>\n</code>, <code>\"</code> and <code>\\</code>, respectively.
Junio C Hamano58f587a2013-07-22 19:20:592379 If there is need for such substitution then the whole
2380 pathname is put in double quotes.
2381</p>
2382</li>
2383<li>
2384<p>
Junio C Hamanoac12f0e2014-09-19 22:32:512385All the <code>file1</code> files in the output refer to files before the
2386 commit, and all the <code>file2</code> files refer to files after the commit.
Junio C Hamano58f587a2013-07-22 19:20:592387 It is incorrect to apply each change to each file sequentially. For
2388 example, this patch will swap a and b:
2389</p>
2390<div class="literalblock">
2391<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512392<pre><code>diff --git a/a b/b
Junio C Hamano58f587a2013-07-22 19:20:592393rename from a
2394rename to b
2395diff --git a/b b/a
2396rename from b
Junio C Hamanoac12f0e2014-09-19 22:32:512397rename to a</code></pre>
Junio C Hamano58f587a2013-07-22 19:20:592398</div></div>
2399</li>
2400</ol></div>
2401</div>
2402</div>
2403<div class="sect1">
2404<h2 id="_combined_diff_format">combined diff format</h2>
2405<div class="sectionbody">
Junio C Hamano1dbca522015-05-22 20:48:552406<div class="paragraph"><p>Any diff-generating command can take the <code>-c</code> or <code>--cc</code> option to
Junio C Hamano58f587a2013-07-22 19:20:592407produce a <em>combined diff</em> when showing a merge. This is the default
2408format when showing merges with <a href="git-diff.html">git-diff(1)</a> or
Junio C Hamano1dbca522015-05-22 20:48:552409<a href="git-show.html">git-show(1)</a>. Note also that you can give the <code>-m</code> option to any
Junio C Hamano58f587a2013-07-22 19:20:592410of these commands to force generation of diffs with individual parents
2411of a merge.</p></div>
2412<div class="paragraph"><p>A <em>combined diff</em> format looks like this:</p></div>
2413<div class="listingblock">
2414<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512415<pre><code>diff --combined describe.c
Junio C Hamano58f587a2013-07-22 19:20:592416index fabadb8,cc95eb0..4866510
2417--- a/describe.c
2418+++ b/describe.c
2419@@@ -98,20 -98,12 +98,20 @@@
2420 return (a_date &gt; b_date) ? -1 : (a_date == b_date) ? 0 : 1;
2421 }
2422
2423- static void describe(char *arg)
2424 -static void describe(struct commit *cmit, int last_one)
2425++static void describe(char *arg, int last_one)
2426 {
2427 + unsigned char sha1[20];
2428 + struct commit *cmit;
2429 struct commit_list *list;
2430 static int initialized = 0;
2431 struct commit_name *n;
2432
2433 + if (get_sha1(arg, sha1) &lt; 0)
2434 + usage(describe_usage);
2435 + cmit = lookup_commit_reference(sha1);
2436 + if (!cmit)
2437 + usage(describe_usage);
2438 +
2439 if (!initialized) {
2440 initialized = 1;
Junio C Hamanoac12f0e2014-09-19 22:32:512441 for_each_ref(get_name);</code></pre>
Junio C Hamano58f587a2013-07-22 19:20:592442</div></div>
2443<div class="olist arabic"><ol class="arabic">
2444<li>
2445<p>
2446It is preceded with a "git diff" header, that looks like
2447 this (when <em>-c</em> option is used):
2448</p>
2449<div class="literalblock">
2450<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512451<pre><code>diff --combined file</code></pre>
Junio C Hamano58f587a2013-07-22 19:20:592452</div></div>
2453<div class="paragraph"><p>or like this (when <em>--cc</em> option is used):</p></div>
2454<div class="literalblock">
2455<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512456<pre><code>diff --cc file</code></pre>
Junio C Hamano58f587a2013-07-22 19:20:592457</div></div>
2458</li>
2459<li>
2460<p>
2461It is followed by one or more extended header lines
2462 (this example shows a merge with two parents):
2463</p>
2464<div class="literalblock">
2465<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512466<pre><code>index &lt;hash&gt;,&lt;hash&gt;..&lt;hash&gt;
Junio C Hamano58f587a2013-07-22 19:20:592467mode &lt;mode&gt;,&lt;mode&gt;..&lt;mode&gt;
2468new file mode &lt;mode&gt;
Junio C Hamanoac12f0e2014-09-19 22:32:512469deleted file mode &lt;mode&gt;,&lt;mode&gt;</code></pre>
Junio C Hamano58f587a2013-07-22 19:20:592470</div></div>
Junio C Hamanoac12f0e2014-09-19 22:32:512471<div class="paragraph"><p>The <code>mode &lt;mode&gt;,&lt;mode&gt;..&lt;mode&gt;</code> line appears only if at least one of
Junio C Hamano58f587a2013-07-22 19:20:592472the &lt;mode&gt; is different from the rest. Extended headers with
2473information about detected contents movement (renames and
2474copying detection) are designed to work with diff of two
2475&lt;tree-ish&gt; and are not used by combined diff format.</p></div>
2476</li>
2477<li>
2478<p>
2479It is followed by two-line from-file/to-file header
2480</p>
2481<div class="literalblock">
2482<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512483<pre><code>--- a/file
2484+++ b/file</code></pre>
Junio C Hamano58f587a2013-07-22 19:20:592485</div></div>
2486<div class="paragraph"><p>Similar to two-line header for traditional <em>unified</em> diff
Junio C Hamanoac12f0e2014-09-19 22:32:512487format, <code>/dev/null</code> is used to signal created or deleted
Junio C Hamano58f587a2013-07-22 19:20:592488files.</p></div>
2489</li>
2490<li>
2491<p>
2492Chunk header format is modified to prevent people from
Junio C Hamanoac12f0e2014-09-19 22:32:512493 accidentally feeding it to <code>patch -p1</code>. Combined diff format
Junio C Hamano58f587a2013-07-22 19:20:592494 was created for review of merge commit changes, and was not
2495 meant for apply. The change is similar to the change in the
2496 extended <em>index</em> header:
2497</p>
2498<div class="literalblock">
2499<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512500<pre><code>@@@ &lt;from-file-range&gt; &lt;from-file-range&gt; &lt;to-file-range&gt; @@@</code></pre>
Junio C Hamano58f587a2013-07-22 19:20:592501</div></div>
Junio C Hamanoac12f0e2014-09-19 22:32:512502<div class="paragraph"><p>There are (number of parents + 1) <code>@</code> characters in the chunk
Junio C Hamano58f587a2013-07-22 19:20:592503header for combined diff format.</p></div>
2504</li>
2505</ol></div>
2506<div class="paragraph"><p>Unlike the traditional <em>unified</em> diff format, which shows two
Junio C Hamanoac12f0e2014-09-19 22:32:512507files 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
2508added to B), or <code>" "</code> (space&#8201;&#8212;&#8201;unchanged) prefix, this format
Junio C Hamano58f587a2013-07-22 19:20:592509compares two or more files file1, file2,&#8230; with one file X, and
2510shows how X differs from each of fileN. One column for each of
2511fileN is prepended to the output line to note how X&#8217;s line is
2512different from it.</p></div>
Junio C Hamanoac12f0e2014-09-19 22:32:512513<div class="paragraph"><p>A <code>-</code> character in the column N means that the line appears in
2514fileN but it does not appear in the result. A <code>+</code> character
Junio C Hamano58f587a2013-07-22 19:20:592515in the column N means that the line appears in the result,
2516and fileN does not have that line (in other words, the line was
2517added, from the point of view of that parent).</p></div>
2518<div class="paragraph"><p>In the above example output, the function signature was changed
Junio C Hamanoac12f0e2014-09-19 22:32:512519from both files (hence two <code>-</code> removals from both file1 and
2520file2, plus <code>++</code> to mean one line that was added does not appear
Junio C Hamanod75148a2014-04-08 19:48:382521in either file1 or file2). Also eight other lines are the same
Junio C Hamanoac12f0e2014-09-19 22:32:512522from file1 but do not appear in file2 (hence prefixed with <code>+</code>).</p></div>
2523<div class="paragraph"><p>When shown by <code>git diff-tree -c</code>, it compares the parents of a
Junio C Hamano58f587a2013-07-22 19:20:592524merge commit with the merge result (i.e. file1..fileN are the
Junio C Hamanoac12f0e2014-09-19 22:32:512525parents). When shown by <code>git diff-files -c</code>, it compares the
Junio C Hamano58f587a2013-07-22 19:20:592526two unresolved merge parents with the working tree file
2527(i.e. file1 is stage 2 aka "our version", file2 is stage 3 aka
2528"their version").</p></div>
2529</div>
2530</div>
2531<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:312532<h2 id="_examples">EXAMPLES</h2>
Junio C Hamano7d23f5e2006-12-16 07:44:042533<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:592534<div class="dlist"><dl>
2535<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:512536<code>git show v1.0.0</code>
Junio C Hamano7d23f5e2006-12-16 07:44:042537</dt>
2538<dd>
2539<p>
Junio C Hamanoac12f0e2014-09-19 22:32:512540 Shows the tag <code>v1.0.0</code>, along with the object the tags
Junio C Hamano775a0f42006-12-31 01:19:142541 points at.
Junio C Hamano7d23f5e2006-12-16 07:44:042542</p>
2543</dd>
Junio C Hamano68cf15a2010-11-06 01:01:592544<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:512545<code>git show v1.0.0^{tree}</code>
Junio C Hamano7d23f5e2006-12-16 07:44:042546</dt>
2547<dd>
2548<p>
Junio C Hamanoac12f0e2014-09-19 22:32:512549 Shows the tree pointed to by the tag <code>v1.0.0</code>.
Junio C Hamano7d23f5e2006-12-16 07:44:042550</p>
2551</dd>
Junio C Hamano68cf15a2010-11-06 01:01:592552<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:512553<code>git show -s --format=%s v1.0.0^{commit}</code>
Junio C Hamanoc3fda572010-11-09 19:41:302554</dt>
2555<dd>
2556<p>
2557 Shows the subject of the commit pointed to by the
Junio C Hamanoac12f0e2014-09-19 22:32:512558 tag <code>v1.0.0</code>.
Junio C Hamanoc3fda572010-11-09 19:41:302559</p>
2560</dd>
2561<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:512562<code>git show next~10:Documentation/README</code>
Junio C Hamanodb911ee2007-02-28 08:13:522563</dt>
2564<dd>
2565<p>
Junio C Hamanoac12f0e2014-09-19 22:32:512566 Shows the contents of the file <code>Documentation/README</code> as
Junio C Hamano7d23f5e2006-12-16 07:44:042567 they were current in the 10th last commit of the branch
Junio C Hamanoac12f0e2014-09-19 22:32:512568 <code>next</code>.
Junio C Hamanodb911ee2007-02-28 08:13:522569</p>
2570</dd>
Junio C Hamano68cf15a2010-11-06 01:01:592571<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:512572<code>git show master:Makefile master:t/Makefile</code>
Junio C Hamanodb911ee2007-02-28 08:13:522573</dt>
2574<dd>
2575<p>
Junio C Hamano7d23f5e2006-12-16 07:44:042576 Concatenates the contents of said Makefiles in the head
Junio C Hamanoac12f0e2014-09-19 22:32:512577 of the branch <code>master</code>.
Junio C Hamanodb911ee2007-02-28 08:13:522578</p>
2579</dd>
Junio C Hamanoba4b9282008-07-06 05:20:312580</dl></div>
Junio C Hamano7d23f5e2006-12-16 07:44:042581</div>
Junio C Hamano9d971152012-12-19 00:43:112582</div>
2583<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:312584<h2 id="_discussion">Discussion</h2>
Junio C Hamano775a0f42006-12-31 01:19:142585<div class="sectionbody">
Junio C Hamanod7ed4042015-08-03 19:43:002586<div class="paragraph"><p>Git is to some extent character encoding agnostic.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592587<div class="ulist"><ul>
Junio C Hamano775a0f42006-12-31 01:19:142588<li>
2589<p>
Junio C Hamano54bf1e22008-12-20 06:30:112590The contents of the blob objects are uninterpreted sequences
Junio C Hamano775a0f42006-12-31 01:19:142591 of bytes. There is no encoding translation at the core
2592 level.
2593</p>
2594</li>
2595<li>
2596<p>
Junio C Hamanod7ed4042015-08-03 19:43:002597Path names are encoded in UTF-8 normalization form C. This
2598 applies to tree objects, the index file, ref names, as well as
2599 path names in command line arguments, environment variables
2600 and config files (<code>.git/config</code> (see <a href="git-config.html">git-config(1)</a>),
2601 <a href="gitignore.html">gitignore(5)</a>, <a href="gitattributes.html">gitattributes(5)</a> and
2602 <a href="gitmodules.html">gitmodules(5)</a>).
2603</p>
2604<div class="paragraph"><p>Note that Git at the core level treats path names simply as
2605sequences of non-NUL bytes, there are no path name encoding
2606conversions (except on Mac and Windows). Therefore, using
2607non-ASCII path names will mostly work even on platforms and file
2608systems that use legacy extended ASCII encodings. However,
2609repositories created on such systems will not work properly on
2610UTF-8-based systems (e.g. Linux, Mac, Windows) and vice versa.
2611Additionally, many Git-based tools simply assume path names to
2612be UTF-8 and will fail to display other encodings correctly.</p></div>
2613</li>
2614<li>
2615<p>
2616Commit log messages are typically encoded in UTF-8, but other
2617 extended ASCII encodings are also supported. This includes
2618 ISO-8859-x, CP125x and many others, but <em>not</em> UTF-16/32,
2619 EBCDIC and CJK multi-byte encodings (GBK, Shift-JIS, Big5,
2620 EUC-x, CP9xx etc.).
Junio C Hamano775a0f42006-12-31 01:19:142621</p>
2622</li>
Junio C Hamanoba4b9282008-07-06 05:20:312623</ul></div>
Junio C Hamano68cf15a2010-11-06 01:01:592624<div class="paragraph"><p>Although we encourage that the commit log messages are encoded
Junio C Hamano076ffcc2013-02-06 05:13:212625in UTF-8, both the core and Git Porcelain are designed not to
Junio C Hamano775a0f42006-12-31 01:19:142626force UTF-8 on projects. If all participants of a particular
Junio C Hamano076ffcc2013-02-06 05:13:212627project find it more convenient to use legacy encodings, Git
Junio C Hamano775a0f42006-12-31 01:19:142628does not forbid it. However, there are a few things to keep in
Junio C Hamanoba4b9282008-07-06 05:20:312629mind.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592630<div class="olist arabic"><ol class="arabic">
Junio C Hamano775a0f42006-12-31 01:19:142631<li>
2632<p>
Junio C Hamano1aa40d22010-01-21 17:46:432633<em>git commit</em> and <em>git commit-tree</em> issues
Junio C Hamano14b76482008-01-05 10:32:262634 a warning if the commit log message given to it does not look
Junio C Hamano775a0f42006-12-31 01:19:142635 like a valid UTF-8 string, unless you explicitly say your
2636 project uses a legacy encoding. The way to say this is to
Junio C Hamanoac12f0e2014-09-19 22:32:512637 have i18n.commitencoding in <code>.git/config</code> file, like this:
Junio C Hamano775a0f42006-12-31 01:19:142638</p>
2639<div class="listingblock">
2640<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512641<pre><code>[i18n]
2642 commitencoding = ISO-8859-1</code></pre>
Junio C Hamano775a0f42006-12-31 01:19:142643</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592644<div class="paragraph"><p>Commit objects created with the above setting record the value
Junio C Hamanoac12f0e2014-09-19 22:32:512645of <code>i18n.commitencoding</code> in its <code>encoding</code> header. This is to
Junio C Hamano775a0f42006-12-31 01:19:142646help other people who look at them later. Lack of this header
Junio C Hamanoba4b9282008-07-06 05:20:312647implies that the commit log message is encoded in UTF-8.</p></div>
Junio C Hamano775a0f42006-12-31 01:19:142648</li>
2649<li>
2650<p>
Junio C Hamano1aa40d22010-01-21 17:46:432651<em>git log</em>, <em>git show</em>, <em>git blame</em> and friends look at the
Junio C Hamanoac12f0e2014-09-19 22:32:512652 <code>encoding</code> header of a commit object, and try to re-code the
Junio C Hamanoaa17c7c2008-11-03 04:36:582653 log message into UTF-8 unless otherwise specified. You can
Junio C Hamano775a0f42006-12-31 01:19:142654 specify the desired output encoding with
Junio C Hamanoac12f0e2014-09-19 22:32:512655 <code>i18n.logoutputencoding</code> in <code>.git/config</code> file, like this:
Junio C Hamano775a0f42006-12-31 01:19:142656</p>
2657<div class="listingblock">
2658<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512659<pre><code>[i18n]
2660 logoutputencoding = ISO-8859-1</code></pre>
Junio C Hamano775a0f42006-12-31 01:19:142661</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592662<div class="paragraph"><p>If you do not have this configuration variable, the value of
Junio C Hamanoac12f0e2014-09-19 22:32:512663<code>i18n.commitencoding</code> is used instead.</p></div>
Junio C Hamano775a0f42006-12-31 01:19:142664</li>
Junio C Hamanoba4b9282008-07-06 05:20:312665</ol></div>
Junio C Hamano68cf15a2010-11-06 01:01:592666<div class="paragraph"><p>Note that we deliberately chose not to re-code the commit log
Junio C Hamano775a0f42006-12-31 01:19:142667message when a commit is made to force UTF-8 at the commit
2668object level, because re-coding to UTF-8 is not necessarily a
Junio C Hamanoba4b9282008-07-06 05:20:312669reversible operation.</p></div>
Junio C Hamano775a0f42006-12-31 01:19:142670</div>
Junio C Hamano9d971152012-12-19 00:43:112671</div>
2672<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:312673<h2 id="_git">GIT</h2>
Junio C Hamanod9d71c02006-02-08 00:52:332674<div class="sectionbody">
Junio C Hamanoa28a9202012-06-21 07:08:232675<div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
Junio C Hamanod9d71c02006-02-08 00:52:332676</div>
Junio C Hamano7bd050f2011-09-22 06:32:222677</div>
Junio C Hamano9d971152012-12-19 00:43:112678</div>
Junio C Hamano7bd050f2011-09-22 06:32:222679<div id="footnotes"><hr /></div>
Junio C Hamanod9d71c02006-02-08 00:52:332680<div id="footer">
2681<div id="footer-text">
Junio C Hamano1dbca522015-05-22 20:48:552682Last updated 2015-05-22 13:47:07 PDT
Junio C Hamanod9d71c02006-02-08 00:52:332683</div>
2684</div>
2685</body>
2686</html>