blob: 79bdeedb9cec81a1c5bd188e35a0bbd6d9560ed2 [file] [log] [blame]
Junio C Hamano96153bf2018-04-25 08:25:341<?xml version="1.0" encoding="UTF-8"?>
Junio C Hamano1a4e8412005-12-27 08:17:232<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
3 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
4<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
5<head>
Junio C Hamano9629d4f2012-12-19 00:28:276<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
Junio C Hamano98c882d2020-08-13 22:06:577<meta name="generator" content="AsciiDoc 9.0.0rc2" />
Junio C Hamano68cf15a2010-11-06 01:01:598<title>git-diff-tree(1)</title>
Junio C Hamano1a4e8412005-12-27 08:17:239<style type="text/css">
Junio C Hamano9629d4f2012-12-19 00:28:2710/* Shared CSS for AsciiDoc xhtml11 and html5 backends */
11
12/* Default font. */
13body {
14 font-family: Georgia,serif;
15}
16
17/* Title font. */
18h1, h2, h3, h4, h5, h6,
19div.title, caption.title,
20thead, p.table.header,
21#toctitle,
22#author, #revnumber, #revdate, #revremark,
23#footer {
24 font-family: Arial,Helvetica,sans-serif;
Junio C Hamano1a4e8412005-12-27 08:17:2325}
26
27body {
28 margin: 1em 5% 1em 5%;
29}
30
Junio C Hamanoba4b9282008-07-06 05:20:3131a {
32 color: blue;
33 text-decoration: underline;
34}
35a:visited {
36 color: fuchsia;
37}
Junio C Hamano1a4e8412005-12-27 08:17:2338
39em {
40 font-style: italic;
Junio C Hamano68cf15a2010-11-06 01:01:5941 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:2342}
43
44strong {
45 font-weight: bold;
Junio C Hamano68cf15a2010-11-06 01:01:5946 color: #083194;
Junio C Hamano1a4e8412005-12-27 08:17:2347}
48
Junio C Hamano1a4e8412005-12-27 08:17:2349h1, h2, h3, h4, h5, h6 {
50 color: #527bbd;
Junio C Hamano1a4e8412005-12-27 08:17:2351 margin-top: 1.2em;
52 margin-bottom: 0.5em;
53 line-height: 1.3;
54}
55
Junio C Hamanoba4b9282008-07-06 05:20:3156h1, h2, h3 {
Junio C Hamano1a4e8412005-12-27 08:17:2357 border-bottom: 2px solid silver;
58}
59h2 {
Junio C Hamano1a4e8412005-12-27 08:17:2360 padding-top: 0.5em;
61}
Junio C Hamanoba4b9282008-07-06 05:20:3162h3 {
63 float: left;
64}
65h3 + * {
66 clear: left;
67}
Junio C Hamano9629d4f2012-12-19 00:28:2768h5 {
69 font-size: 1.0em;
70}
Junio C Hamano1a4e8412005-12-27 08:17:2371
72div.sectionbody {
Junio C Hamano1a4e8412005-12-27 08:17:2373 margin-left: 0;
74}
75
76hr {
77 border: 1px solid silver;
78}
79
80p {
81 margin-top: 0.5em;
82 margin-bottom: 0.5em;
83}
84
Junio C Hamano68cf15a2010-11-06 01:01:5985ul, ol, li > p {
86 margin-top: 0;
87}
Junio C Hamano9629d4f2012-12-19 00:28:2788ul > li { color: #aaa; }
89ul > li > * { color: black; }
Junio C Hamano68cf15a2010-11-06 01:01:5990
Junio C Hamanoac12f0e2014-09-19 22:32:5191.monospaced, code, pre {
92 font-family: "Courier New", Courier, monospace;
93 font-size: inherit;
94 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:2395 padding: 0;
96 margin: 0;
97}
Junio C Hamanoac12f0e2014-09-19 22:32:5198pre {
99 white-space: pre-wrap;
100}
Junio C Hamano1a4e8412005-12-27 08:17:23101
Junio C Hamano9629d4f2012-12-19 00:28:27102#author {
Junio C Hamano1a4e8412005-12-27 08:17:23103 color: #527bbd;
Junio C Hamano1a4e8412005-12-27 08:17:23104 font-weight: bold;
Junio C Hamanoba4b9282008-07-06 05:20:31105 font-size: 1.1em;
Junio C Hamano1a4e8412005-12-27 08:17:23106}
Junio C Hamano9629d4f2012-12-19 00:28:27107#email {
Junio C Hamano1a4e8412005-12-27 08:17:23108}
Junio C Hamano9629d4f2012-12-19 00:28:27109#revnumber, #revdate, #revremark {
Junio C Hamano1a4e8412005-12-27 08:17:23110}
111
Junio C Hamano9629d4f2012-12-19 00:28:27112#footer {
Junio C Hamano1a4e8412005-12-27 08:17:23113 font-size: small;
114 border-top: 2px solid silver;
115 padding-top: 0.5em;
116 margin-top: 4.0em;
117}
Junio C Hamano9629d4f2012-12-19 00:28:27118#footer-text {
Junio C Hamano1a4e8412005-12-27 08:17:23119 float: left;
120 padding-bottom: 0.5em;
121}
Junio C Hamano9629d4f2012-12-19 00:28:27122#footer-badges {
Junio C Hamano1a4e8412005-12-27 08:17:23123 float: right;
124 padding-bottom: 0.5em;
125}
126
Junio C Hamano9629d4f2012-12-19 00:28:27127#preamble {
Junio C Hamano68cf15a2010-11-06 01:01:59128 margin-top: 1.5em;
129 margin-bottom: 1.5em;
130}
Junio C Hamano9629d4f2012-12-19 00:28:27131div.imageblock, div.exampleblock, div.verseblock,
Junio C Hamano1a4e8412005-12-27 08:17:23132div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
133div.admonitionblock {
Junio C Hamano7bd050f2011-09-22 06:32:22134 margin-top: 1.0em;
Junio C Hamano1a4e8412005-12-27 08:17:23135 margin-bottom: 1.5em;
136}
137div.admonitionblock {
Junio C Hamano7bd050f2011-09-22 06:32:22138 margin-top: 2.0em;
139 margin-bottom: 2.0em;
140 margin-right: 10%;
141 color: #606060;
Junio C Hamano1a4e8412005-12-27 08:17:23142}
143
144div.content { /* Block element content. */
145 padding: 0;
146}
147
148/* Block element titles. */
149div.title, caption.title {
Junio C Hamano68cf15a2010-11-06 01:01:59150 color: #527bbd;
Junio C Hamano1a4e8412005-12-27 08:17:23151 font-weight: bold;
152 text-align: left;
153 margin-top: 1.0em;
154 margin-bottom: 0.5em;
155}
156div.title + * {
157 margin-top: 0;
158}
159
160td div.title:first-child {
161 margin-top: 0.0em;
162}
163div.content div.title:first-child {
164 margin-top: 0.0em;
165}
166div.content + div.title {
167 margin-top: 0.0em;
168}
169
170div.sidebarblock > div.content {
171 background: #ffffee;
Junio C Hamano9629d4f2012-12-19 00:28:27172 border: 1px solid #dddddd;
173 border-left: 4px solid #f0f0f0;
Junio C Hamano1a4e8412005-12-27 08:17:23174 padding: 0.5em;
175}
176
177div.listingblock > div.content {
Junio C Hamano9629d4f2012-12-19 00:28:27178 border: 1px solid #dddddd;
179 border-left: 5px solid #f0f0f0;
180 background: #f8f8f8;
Junio C Hamano1a4e8412005-12-27 08:17:23181 padding: 0.5em;
182}
183
Junio C Hamano7bd050f2011-09-22 06:32:22184div.quoteblock, div.verseblock {
185 padding-left: 1.0em;
186 margin-left: 1.0em;
Junio C Hamano68cf15a2010-11-06 01:01:59187 margin-right: 10%;
Junio C Hamano9629d4f2012-12-19 00:28:27188 border-left: 5px solid #f0f0f0;
189 color: #888;
Junio C Hamano1a4e8412005-12-27 08:17:23190}
Junio C Hamano7bd050f2011-09-22 06:32:22191
Junio C Hamano68cf15a2010-11-06 01:01:59192div.quoteblock > div.attribution {
193 padding-top: 0.5em;
Junio C Hamano1a4e8412005-12-27 08:17:23194 text-align: right;
195}
Junio C Hamano68cf15a2010-11-06 01:01:59196
Junio C Hamano9629d4f2012-12-19 00:28:27197div.verseblock > pre.content {
198 font-family: inherit;
199 font-size: inherit;
Junio C Hamano68cf15a2010-11-06 01:01:59200}
201div.verseblock > div.attribution {
202 padding-top: 0.75em;
203 text-align: left;
204}
205/* DEPRECATED: Pre version 8.2.7 verse style literal block. */
Junio C Hamanoba4b9282008-07-06 05:20:31206div.verseblock + div.attribution {
207 text-align: left;
208}
Junio C Hamano1a4e8412005-12-27 08:17:23209
210div.admonitionblock .icon {
211 vertical-align: top;
212 font-size: 1.1em;
213 font-weight: bold;
214 text-decoration: underline;
215 color: #527bbd;
216 padding-right: 0.5em;
217}
218div.admonitionblock td.content {
219 padding-left: 0.5em;
Junio C Hamano7bd050f2011-09-22 06:32:22220 border-left: 3px solid #dddddd;
Junio C Hamano1a4e8412005-12-27 08:17:23221}
222
223div.exampleblock > div.content {
Junio C Hamano7bd050f2011-09-22 06:32:22224 border-left: 3px solid #dddddd;
225 padding-left: 0.5em;
Junio C Hamano1a4e8412005-12-27 08:17:23226}
227
Junio C Hamano1a4e8412005-12-27 08:17:23228div.imageblock div.content { padding-left: 0; }
Junio C Hamanoac12f0e2014-09-19 22:32:51229span.image img { border-style: none; vertical-align: text-bottom; }
Junio C Hamano68cf15a2010-11-06 01:01:59230a.image:visited { color: white; }
Junio C Hamano1a4e8412005-12-27 08:17:23231
232dl {
233 margin-top: 0.8em;
234 margin-bottom: 0.8em;
235}
236dt {
237 margin-top: 0.5em;
238 margin-bottom: 0;
Junio C Hamano68cf15a2010-11-06 01:01:59239 font-style: normal;
240 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:23241}
242dd > *:first-child {
Junio C Hamano68cf15a2010-11-06 01:01:59243 margin-top: 0.1em;
Junio C Hamano1a4e8412005-12-27 08:17:23244}
245
246ul, ol {
247 list-style-position: outside;
248}
Junio C Hamano68cf15a2010-11-06 01:01:59249ol.arabic {
250 list-style-type: decimal;
251}
252ol.loweralpha {
Junio C Hamano1a4e8412005-12-27 08:17:23253 list-style-type: lower-alpha;
254}
Junio C Hamano68cf15a2010-11-06 01:01:59255ol.upperalpha {
256 list-style-type: upper-alpha;
257}
258ol.lowerroman {
259 list-style-type: lower-roman;
260}
261ol.upperroman {
262 list-style-type: upper-roman;
263}
264
265div.compact ul, div.compact ol,
266div.compact p, div.compact p,
267div.compact div, div.compact div {
268 margin-top: 0.1em;
269 margin-bottom: 0.1em;
270}
Junio C Hamano1a4e8412005-12-27 08:17:23271
Junio C Hamano1a4e8412005-12-27 08:17:23272tfoot {
273 font-weight: bold;
274}
Junio C Hamano68cf15a2010-11-06 01:01:59275td > div.verse {
276 white-space: pre;
277}
Junio C Hamano68cf15a2010-11-06 01:01:59278
279div.hdlist {
Junio C Hamano1a4e8412005-12-27 08:17:23280 margin-top: 0.8em;
281 margin-bottom: 0.8em;
282}
Junio C Hamano68cf15a2010-11-06 01:01:59283div.hdlist tr {
284 padding-bottom: 15px;
Junio C Hamanoba4b9282008-07-06 05:20:31285}
Junio C Hamano68cf15a2010-11-06 01:01:59286dt.hdlist1.strong, td.hdlist1.strong {
287 font-weight: bold;
288}
289td.hdlist1 {
Junio C Hamano1a4e8412005-12-27 08:17:23290 vertical-align: top;
Junio C Hamano68cf15a2010-11-06 01:01:59291 font-style: normal;
Junio C Hamano1a4e8412005-12-27 08:17:23292 padding-right: 0.8em;
Junio C Hamano68cf15a2010-11-06 01:01:59293 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:23294}
Junio C Hamano68cf15a2010-11-06 01:01:59295td.hdlist2 {
Junio C Hamano1a4e8412005-12-27 08:17:23296 vertical-align: top;
297}
Junio C Hamano68cf15a2010-11-06 01:01:59298div.hdlist.compact tr {
299 margin: 0;
300 padding-bottom: 0;
301}
302
303.comment {
304 background: yellow;
305}
Junio C Hamano1a4e8412005-12-27 08:17:23306
Junio C Hamano7bd050f2011-09-22 06:32:22307.footnote, .footnoteref {
308 font-size: 0.8em;
309}
310
311span.footnote, span.footnoteref {
312 vertical-align: super;
313}
314
315#footnotes {
316 margin: 20px 0 20px 0;
317 padding: 7px 0 0 0;
318}
319
320#footnotes div.footnote {
321 margin: 0 0 5px 0;
322}
323
324#footnotes hr {
325 border: none;
326 border-top: 1px solid silver;
327 height: 1px;
328 text-align: left;
329 margin-left: 0;
330 width: 20%;
331 min-width: 100px;
332}
333
Junio C Hamano9629d4f2012-12-19 00:28:27334div.colist td {
335 padding-right: 0.5em;
336 padding-bottom: 0.3em;
337 vertical-align: top;
338}
339div.colist td img {
340 margin-top: 0.3em;
Junio C Hamano1a4e8412005-12-27 08:17:23341}
Junio C Hamanoba4b9282008-07-06 05:20:31342
Junio C Hamano9629d4f2012-12-19 00:28:27343@media print {
344 #footer-badges { display: none; }
345}
346
347#toc {
Junio C Hamano7bd050f2011-09-22 06:32:22348 margin-bottom: 2.5em;
349}
350
Junio C Hamano9629d4f2012-12-19 00:28:27351#toctitle {
Junio C Hamanoba4b9282008-07-06 05:20:31352 color: #527bbd;
Junio C Hamanoba4b9282008-07-06 05:20:31353 font-size: 1.1em;
354 font-weight: bold;
355 margin-top: 1.0em;
356 margin-bottom: 0.1em;
357}
358
Junio C Hamanoac12f0e2014-09-19 22:32:51359div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
Junio C Hamanoba4b9282008-07-06 05:20:31360 margin-top: 0;
361 margin-bottom: 0;
362}
363div.toclevel2 {
364 margin-left: 2em;
365 font-size: 0.9em;
366}
367div.toclevel3 {
368 margin-left: 4em;
369 font-size: 0.9em;
370}
371div.toclevel4 {
372 margin-left: 6em;
373 font-size: 0.9em;
374}
Junio C Hamano9629d4f2012-12-19 00:28:27375
376span.aqua { color: aqua; }
377span.black { color: black; }
378span.blue { color: blue; }
379span.fuchsia { color: fuchsia; }
380span.gray { color: gray; }
381span.green { color: green; }
382span.lime { color: lime; }
383span.maroon { color: maroon; }
384span.navy { color: navy; }
385span.olive { color: olive; }
386span.purple { color: purple; }
387span.red { color: red; }
388span.silver { color: silver; }
389span.teal { color: teal; }
390span.white { color: white; }
391span.yellow { color: yellow; }
392
393span.aqua-background { background: aqua; }
394span.black-background { background: black; }
395span.blue-background { background: blue; }
396span.fuchsia-background { background: fuchsia; }
397span.gray-background { background: gray; }
398span.green-background { background: green; }
399span.lime-background { background: lime; }
400span.maroon-background { background: maroon; }
401span.navy-background { background: navy; }
402span.olive-background { background: olive; }
403span.purple-background { background: purple; }
404span.red-background { background: red; }
405span.silver-background { background: silver; }
406span.teal-background { background: teal; }
407span.white-background { background: white; }
408span.yellow-background { background: yellow; }
409
410span.big { font-size: 2em; }
411span.small { font-size: 0.6em; }
412
413span.underline { text-decoration: underline; }
414span.overline { text-decoration: overline; }
415span.line-through { text-decoration: line-through; }
416
Junio C Hamanoac12f0e2014-09-19 22:32:51417div.unbreakable { page-break-inside: avoid; }
418
Junio C Hamano9629d4f2012-12-19 00:28:27419
420/*
421 * xhtml11 specific
422 *
423 * */
424
425div.tableblock {
426 margin-top: 1.0em;
427 margin-bottom: 1.5em;
428}
429div.tableblock > table {
430 border: 3px solid #527bbd;
431}
432thead, p.table.header {
433 font-weight: bold;
434 color: #527bbd;
435}
436p.table {
437 margin-top: 0;
438}
Junio C Hamano725b0da2020-01-22 22:02:40439/* Because the table frame attribute is overridden by CSS in most browsers. */
Junio C Hamano9629d4f2012-12-19 00:28:27440div.tableblock > table[frame="void"] {
441 border-style: none;
442}
443div.tableblock > table[frame="hsides"] {
444 border-left-style: none;
445 border-right-style: none;
446}
447div.tableblock > table[frame="vsides"] {
448 border-top-style: none;
449 border-bottom-style: none;
450}
451
452
453/*
454 * html5 specific
455 *
456 * */
457
458table.tableblock {
459 margin-top: 1.0em;
460 margin-bottom: 1.5em;
461}
462thead, p.tableblock.header {
463 font-weight: bold;
464 color: #527bbd;
465}
466p.tableblock {
467 margin-top: 0;
468}
469table.tableblock {
470 border-width: 3px;
471 border-spacing: 0px;
472 border-style: solid;
473 border-color: #527bbd;
474 border-collapse: collapse;
475}
476th.tableblock, td.tableblock {
477 border-width: 1px;
478 padding: 4px;
479 border-style: solid;
480 border-color: #527bbd;
481}
482
483table.tableblock.frame-topbot {
484 border-left-style: hidden;
485 border-right-style: hidden;
486}
487table.tableblock.frame-sides {
488 border-top-style: hidden;
489 border-bottom-style: hidden;
490}
491table.tableblock.frame-none {
492 border-style: hidden;
493}
494
495th.tableblock.halign-left, td.tableblock.halign-left {
496 text-align: left;
497}
498th.tableblock.halign-center, td.tableblock.halign-center {
499 text-align: center;
500}
501th.tableblock.halign-right, td.tableblock.halign-right {
502 text-align: right;
503}
504
505th.tableblock.valign-top, td.tableblock.valign-top {
506 vertical-align: top;
507}
508th.tableblock.valign-middle, td.tableblock.valign-middle {
509 vertical-align: middle;
510}
511th.tableblock.valign-bottom, td.tableblock.valign-bottom {
512 vertical-align: bottom;
513}
514
515
516/*
517 * manpage specific
518 *
519 * */
520
521body.manpage h1 {
Junio C Hamano68cf15a2010-11-06 01:01:59522 padding-top: 0.5em;
523 padding-bottom: 0.5em;
524 border-top: 2px solid silver;
525 border-bottom: 2px solid silver;
526}
Junio C Hamano9629d4f2012-12-19 00:28:27527body.manpage h2 {
Junio C Hamano68cf15a2010-11-06 01:01:59528 border-style: none;
529}
Junio C Hamano9629d4f2012-12-19 00:28:27530body.manpage div.sectionbody {
531 margin-left: 3em;
Junio C Hamano68cf15a2010-11-06 01:01:59532}
533
534@media print {
Junio C Hamano9629d4f2012-12-19 00:28:27535 body.manpage div#toc { display: none; }
Junio C Hamano68cf15a2010-11-06 01:01:59536}
Junio C Hamanoac12f0e2014-09-19 22:32:51537
538
Junio C Hamano1a4e8412005-12-27 08:17:23539</style>
Junio C Hamano7bd050f2011-09-22 06:32:22540<script type="text/javascript">
541/*<![CDATA[*/
Junio C Hamano7bd050f2011-09-22 06:32:22542var asciidoc = { // Namespace.
543
544/////////////////////////////////////////////////////////////////////
545// Table Of Contents generator
546/////////////////////////////////////////////////////////////////////
547
548/* Author: Mihai Bazon, September 2002
549 * http://students.infoiasi.ro/~mishoo
550 *
551 * Table Of Content generator
552 * Version: 0.4
553 *
554 * Feel free to use this script under the terms of the GNU General Public
555 * License, as long as you do not remove or alter this notice.
556 */
557
558 /* modified by Troy D. Hanson, September 2006. License: GPL */
559 /* modified by Stuart Rackham, 2006, 2009. License: GPL */
560
561// toclevels = 1..4.
562toc: function (toclevels) {
563
564 function getText(el) {
565 var text = "";
566 for (var i = el.firstChild; i != null; i = i.nextSibling) {
567 if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
568 text += i.data;
569 else if (i.firstChild != null)
570 text += getText(i);
571 }
572 return text;
573 }
574
575 function TocEntry(el, text, toclevel) {
576 this.element = el;
577 this.text = text;
578 this.toclevel = toclevel;
579 }
580
581 function tocEntries(el, toclevels) {
582 var result = new Array;
Junio C Hamanoac12f0e2014-09-19 22:32:51583 var re = new RegExp('[hH]([1-'+(toclevels+1)+'])');
Junio C Hamano7bd050f2011-09-22 06:32:22584 // Function that scans the DOM tree for header elements (the DOM2
585 // nodeIterator API would be a better technique but not supported by all
586 // browsers).
587 var iterate = function (el) {
588 for (var i = el.firstChild; i != null; i = i.nextSibling) {
589 if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
590 var mo = re.exec(i.tagName);
591 if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
592 result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
593 }
594 iterate(i);
595 }
596 }
597 }
598 iterate(el);
599 return result;
600 }
601
602 var toc = document.getElementById("toc");
Junio C Hamano9629d4f2012-12-19 00:28:27603 if (!toc) {
604 return;
605 }
606
607 // Delete existing TOC entries in case we're reloading the TOC.
608 var tocEntriesToRemove = [];
609 var i;
610 for (i = 0; i < toc.childNodes.length; i++) {
611 var entry = toc.childNodes[i];
Junio C Hamanoac12f0e2014-09-19 22:32:51612 if (entry.nodeName.toLowerCase() == 'div'
Junio C Hamano9629d4f2012-12-19 00:28:27613 && entry.getAttribute("class")
614 && entry.getAttribute("class").match(/^toclevel/))
615 tocEntriesToRemove.push(entry);
616 }
617 for (i = 0; i < tocEntriesToRemove.length; i++) {
618 toc.removeChild(tocEntriesToRemove[i]);
619 }
620
621 // Rebuild TOC entries.
Junio C Hamano7bd050f2011-09-22 06:32:22622 var entries = tocEntries(document.getElementById("content"), toclevels);
623 for (var i = 0; i < entries.length; ++i) {
624 var entry = entries[i];
625 if (entry.element.id == "")
626 entry.element.id = "_toc_" + i;
627 var a = document.createElement("a");
628 a.href = "#" + entry.element.id;
629 a.appendChild(document.createTextNode(entry.text));
630 var div = document.createElement("div");
631 div.appendChild(a);
632 div.className = "toclevel" + entry.toclevel;
633 toc.appendChild(div);
634 }
635 if (entries.length == 0)
636 toc.parentNode.removeChild(toc);
637},
638
639
640/////////////////////////////////////////////////////////////////////
641// Footnotes generator
642/////////////////////////////////////////////////////////////////////
643
644/* Based on footnote generation code from:
645 * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
646 */
647
648footnotes: function () {
Junio C Hamano9629d4f2012-12-19 00:28:27649 // Delete existing footnote entries in case we're reloading the footnodes.
650 var i;
Junio C Hamano7bd050f2011-09-22 06:32:22651 var noteholder = document.getElementById("footnotes");
Junio C Hamano9629d4f2012-12-19 00:28:27652 if (!noteholder) {
653 return;
654 }
655 var entriesToRemove = [];
656 for (i = 0; i < noteholder.childNodes.length; i++) {
657 var entry = noteholder.childNodes[i];
Junio C Hamanoac12f0e2014-09-19 22:32:51658 if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote")
Junio C Hamano9629d4f2012-12-19 00:28:27659 entriesToRemove.push(entry);
660 }
661 for (i = 0; i < entriesToRemove.length; i++) {
662 noteholder.removeChild(entriesToRemove[i]);
663 }
664
665 // Rebuild footnote entries.
666 var cont = document.getElementById("content");
Junio C Hamano7bd050f2011-09-22 06:32:22667 var spans = cont.getElementsByTagName("span");
668 var refs = {};
669 var n = 0;
670 for (i=0; i<spans.length; i++) {
671 if (spans[i].className == "footnote") {
672 n++;
Junio C Hamano9629d4f2012-12-19 00:28:27673 var note = spans[i].getAttribute("data-note");
674 if (!note) {
675 // Use [\s\S] in place of . so multi-line matches work.
676 // Because JavaScript has no s (dotall) regex flag.
677 note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
678 spans[i].innerHTML =
679 "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
680 "' title='View footnote' class='footnote'>" + n + "</a>]";
681 spans[i].setAttribute("data-note", note);
682 }
Junio C Hamano7bd050f2011-09-22 06:32:22683 noteholder.innerHTML +=
684 "<div class='footnote' id='_footnote_" + n + "'>" +
685 "<a href='#_footnoteref_" + n + "' title='Return to text'>" +
686 n + "</a>. " + note + "</div>";
Junio C Hamano7bd050f2011-09-22 06:32:22687 var id =spans[i].getAttribute("id");
688 if (id != null) refs["#"+id] = n;
689 }
690 }
691 if (n == 0)
692 noteholder.parentNode.removeChild(noteholder);
693 else {
694 // Process footnoterefs.
695 for (i=0; i<spans.length; i++) {
696 if (spans[i].className == "footnoteref") {
697 var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
698 href = href.match(/#.*/)[0]; // Because IE return full URL.
699 n = refs[href];
700 spans[i].innerHTML =
701 "[<a href='#_footnote_" + n +
702 "' title='View footnote' class='footnote'>" + n + "</a>]";
703 }
704 }
705 }
Junio C Hamano9629d4f2012-12-19 00:28:27706},
707
708install: function(toclevels) {
709 var timerId;
710
711 function reinstall() {
712 asciidoc.footnotes();
713 if (toclevels) {
714 asciidoc.toc(toclevels);
715 }
716 }
717
718 function reinstallAndRemoveTimer() {
719 clearInterval(timerId);
720 reinstall();
721 }
722
723 timerId = setInterval(reinstall, 500);
724 if (document.addEventListener)
725 document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false);
726 else
727 window.onload = reinstallAndRemoveTimer;
Junio C Hamano7bd050f2011-09-22 06:32:22728}
729
730}
Junio C Hamano9629d4f2012-12-19 00:28:27731asciidoc.install();
Junio C Hamano7bd050f2011-09-22 06:32:22732/*]]>*/
733</script>
Junio C Hamano1a4e8412005-12-27 08:17:23734</head>
Junio C Hamano9629d4f2012-12-19 00:28:27735<body class="manpage">
Junio C Hamano1a4e8412005-12-27 08:17:23736<div id="header">
737<h1>
738git-diff-tree(1) Manual Page
739</h1>
740<h2>NAME</h2>
741<div class="sectionbody">
742<p>git-diff-tree -
743 Compares the content and mode of blobs found via two tree objects
744</p>
745</div>
746</div>
Junio C Hamano7bd050f2011-09-22 06:32:22747<div id="content">
Junio C Hamano9629d4f2012-12-19 00:28:27748<div class="sect1">
Junio C Hamano68cf15a2010-11-06 01:01:59749<h2 id="_synopsis">SYNOPSIS</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23750<div class="sectionbody">
Junio C Hamano235a91e2006-01-07 01:13:58751<div class="verseblock">
Junio C Hamano9629d4f2012-12-19 00:28:27752<pre class="content"><em>git diff-tree</em> [--stdin] [-m] [-s] [-v] [--no-commit-id] [--pretty]
Junio C Hamanodf3d3cd2020-11-02 22:05:05753 [-t] [-r] [-c | --cc] [--combined-all-paths] [--root] [--merge-base]
Junio C Hamano11f15372019-03-07 03:17:00754 [&lt;common diff options&gt;] &lt;tree-ish&gt; [&lt;tree-ish&gt;] [&lt;path&gt;&#8230;]</pre>
Junio C Hamano9629d4f2012-12-19 00:28:27755<div class="attribution">
Junio C Hamano68cf15a2010-11-06 01:01:59756</div></div>
Junio C Hamano1a4e8412005-12-27 08:17:23757</div>
Junio C Hamano9629d4f2012-12-19 00:28:27758</div>
759<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:31760<h2 id="_description">DESCRIPTION</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23761<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:59762<div class="paragraph"><p>Compares the content and mode of the blobs found via two tree objects.</p></div>
763<div class="paragraph"><p>If there is only one &lt;tree-ish&gt; given, the commit is compared with its parents
Junio C Hamanoba4b9282008-07-06 05:20:31764(see --stdin below).</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:59765<div class="paragraph"><p>Note that <em>git diff-tree</em> can use the tree encapsulated in a commit object.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:23766</div>
Junio C Hamano9629d4f2012-12-19 00:28:27767</div>
768<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:31769<h2 id="_options">OPTIONS</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23770<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:59771<div class="dlist"><dl>
772<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:23773-p
774</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59775<dt class="hdlist1">
Junio C Hamanobbbb8652008-12-29 10:34:22776-u
777</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59778<dt class="hdlist1">
Junio C Hamanoe97d5772010-05-19 08:13:58779--patch
780</dt>
Junio C Hamano1a4e8412005-12-27 08:17:23781<dd>
782<p>
Junio C Hamanoff979792007-11-16 10:11:30783 Generate patch (see section on generating patches).
Junio C Hamano1a4e8412005-12-27 08:17:23784</p>
785</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59786<dt class="hdlist1">
Junio C Hamano58f587a2013-07-22 19:20:59787-s
788</dt>
789<dt class="hdlist1">
790--no-patch
791</dt>
792<dd>
793<p>
Junio C Hamanoac12f0e2014-09-19 22:32:51794 Suppress diff output. Useful for commands like <code>git show</code> that
795 show the patch by default, or to cancel the effect of <code>--patch</code>.
Junio C Hamano58f587a2013-07-22 19:20:59796</p>
797</dd>
798<dt class="hdlist1">
Junio C Hamano69361562007-07-26 02:14:34799-U&lt;n&gt;
800</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59801<dt class="hdlist1">
Junio C Hamano69361562007-07-26 02:14:34802--unified=&lt;n&gt;
803</dt>
804<dd>
805<p>
806 Generate diffs with &lt;n&gt; lines of context instead of
Junio C Hamanoee43d182020-11-11 22:10:41807 the usual three.
808 Implies <code>--patch</code>.
Junio C Hamano69361562007-07-26 02:14:34809</p>
810</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59811<dt class="hdlist1">
Junio C Hamano11f15372019-03-07 03:17:00812--output=&lt;file&gt;
813</dt>
814<dd>
815<p>
816 Output to a specific file instead of stdout.
817</p>
818</dd>
819<dt class="hdlist1">
820--output-indicator-new=&lt;char&gt;
821</dt>
822<dt class="hdlist1">
823--output-indicator-old=&lt;char&gt;
824</dt>
825<dt class="hdlist1">
826--output-indicator-context=&lt;char&gt;
827</dt>
828<dd>
829<p>
830 Specify the character used to indicate new, old or context
831 lines in the generated patch. Normally they are <em>+</em>, <em>-</em> and
832 ' ' respectively.
833</p>
834</dd>
835<dt class="hdlist1">
Junio C Hamano9ae1a062006-07-10 08:12:34836--raw
837</dt>
838<dd>
839<p>
Junio C Hamano85f1fde2015-06-01 20:37:32840 Generate the diff in raw format.
Junio C Hamano1dbca522015-05-22 20:48:55841 This is the default.
Junio C Hamano9ae1a062006-07-10 08:12:34842</p>
843</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59844<dt class="hdlist1">
Junio C Hamano54559c82006-04-13 07:45:12845--patch-with-raw
846</dt>
847<dd>
848<p>
Junio C Hamanoac12f0e2014-09-19 22:32:51849 Synonym for <code>-p --raw</code>.
Junio C Hamano54559c82006-04-13 07:45:12850</p>
851</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59852<dt class="hdlist1">
Junio C Hamanoad70bf02016-09-26 23:44:27853--indent-heuristic
854</dt>
Junio C Hamanoa65b6762017-11-06 04:45:42855<dd>
856<p>
Junio C Hamano14e66832018-06-18 18:32:19857 Enable the heuristic that shifts diff hunk boundaries to make patches
Junio C Hamanoa65b6762017-11-06 04:45:42858 easier to read. This is the default.
859</p>
860</dd>
Junio C Hamanoad70bf02016-09-26 23:44:27861<dt class="hdlist1">
862--no-indent-heuristic
863</dt>
Junio C Hamano5f888332016-06-13 19:28:31864<dd>
865<p>
Junio C Hamanoa65b6762017-11-06 04:45:42866 Disable the indent heuristic.
Junio C Hamano5f888332016-06-13 19:28:31867</p>
868</dd>
869<dt class="hdlist1">
Junio C Hamano5a73f302011-10-14 05:58:34870--minimal
871</dt>
872<dd>
873<p>
874 Spend extra time to make sure the smallest possible
875 diff is produced.
876</p>
877</dd>
878<dt class="hdlist1">
Junio C Hamano20d47e32009-01-26 06:36:02879--patience
880</dt>
881<dd>
882<p>
883 Generate a diff using the "patience diff" algorithm.
884</p>
885</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59886<dt class="hdlist1">
Junio C Hamanoaea9e6b2012-03-07 00:17:11887--histogram
888</dt>
889<dd>
890<p>
891 Generate a diff using the "histogram diff" algorithm.
892</p>
893</dd>
894<dt class="hdlist1">
Junio C Hamano047135e2017-12-19 21:57:54895--anchored=&lt;text&gt;
896</dt>
897<dd>
898<p>
899 Generate a diff using the "anchored diff" algorithm.
900</p>
901<div class="paragraph"><p>This option may be specified more than once.</p></div>
902<div class="paragraph"><p>If a line exists in both the source and destination, exists only once,
903and starts with this text, this algorithm attempts to prevent it from
904appearing as a deletion or addition in the output. It uses the "patience
905diff" algorithm internally.</p></div>
906</dd>
907<dt class="hdlist1">
Junio C Hamano80ad00d2013-02-18 00:19:03908--diff-algorithm={patience|minimal|histogram|myers}
909</dt>
910<dd>
911<p>
912 Choose a diff algorithm. The variants are as follows:
913</p>
914<div class="openblock">
915<div class="content">
916<div class="dlist"><dl>
917<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:51918<code>default</code>, <code>myers</code>
Junio C Hamano80ad00d2013-02-18 00:19:03919</dt>
920<dd>
921<p>
922 The basic greedy diff algorithm. Currently, this is the default.
923</p>
924</dd>
925<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:51926<code>minimal</code>
Junio C Hamano80ad00d2013-02-18 00:19:03927</dt>
928<dd>
929<p>
930 Spend extra time to make sure the smallest possible diff is
931 produced.
932</p>
933</dd>
934<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:51935<code>patience</code>
Junio C Hamano80ad00d2013-02-18 00:19:03936</dt>
937<dd>
938<p>
939 Use "patience diff" algorithm when generating patches.
940</p>
941</dd>
942<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:51943<code>histogram</code>
Junio C Hamano80ad00d2013-02-18 00:19:03944</dt>
945<dd>
946<p>
947 This algorithm extends the patience algorithm to "support
948 low-occurrence common elements".
949</p>
950</dd>
951</dl></div>
952</div></div>
Junio C Hamano14e66832018-06-18 18:32:19953<div class="paragraph"><p>For instance, if you configured the <code>diff.algorithm</code> variable to a
Junio C Hamano80ad00d2013-02-18 00:19:03954non-default value and want to use the default one, then you
Junio C Hamanoac12f0e2014-09-19 22:32:51955have to use <code>--diff-algorithm=default</code> option.</p></div>
Junio C Hamano80ad00d2013-02-18 00:19:03956</dd>
957<dt class="hdlist1">
Junio C Hamano4c4b0122011-06-30 01:19:32958--stat[=&lt;width&gt;[,&lt;name-width&gt;[,&lt;count&gt;]]]
Junio C Hamanoba7c8d82006-04-15 06:17:42959</dt>
960<dd>
961<p>
Junio C Hamanoaea9e6b2012-03-07 00:17:11962 Generate a diffstat. By default, as much space as necessary
963 will be used for the filename part, and the rest for the graph
964 part. Maximum width defaults to terminal width, or 80 columns
Junio C Hamano7f2b3cb2012-06-22 22:42:39965 if not connected to a terminal, and can be overridden by
Junio C Hamanoac12f0e2014-09-19 22:32:51966 <code>&lt;width&gt;</code>. The width of the filename part can be limited by
967 giving another width <code>&lt;name-width&gt;</code> after a comma. The width
Junio C Hamanoaea9e6b2012-03-07 00:17:11968 of the graph part can be limited by using
Junio C Hamanoac12f0e2014-09-19 22:32:51969 <code>--stat-graph-width=&lt;width&gt;</code> (affects all commands generating
970 a stat graph) or by setting <code>diff.statGraphWidth=&lt;width&gt;</code>
971 (does not affect <code>git format-patch</code>).
972 By giving a third parameter <code>&lt;count&gt;</code>, you can limit the
973 output to the first <code>&lt;count&gt;</code> lines, followed by <code>...</code> if
Junio C Hamanoaea9e6b2012-03-07 00:17:11974 there are more.
Junio C Hamanoba7c8d82006-04-15 06:17:42975</p>
Junio C Hamanoac12f0e2014-09-19 22:32:51976<div class="paragraph"><p>These parameters can also be set individually with <code>--stat-width=&lt;width&gt;</code>,
977<code>--stat-name-width=&lt;name-width&gt;</code> and <code>--stat-count=&lt;count&gt;</code>.</p></div>
Junio C Hamanoba7c8d82006-04-15 06:17:42978</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59979<dt class="hdlist1">
Junio C Hamano45badf02018-03-14 21:56:41980--compact-summary
981</dt>
982<dd>
983<p>
984 Output a condensed summary of extended header information such
985 as file creations or deletions ("new" or "gone", optionally "+l"
986 if it&#8217;s a symlink) and mode changes ("+x" or "-x" for adding
987 or removing executable bit respectively) in diffstat. The
Junio C Hamanofa2915c2018-06-19 19:50:18988 information is put between the filename part and the graph
Junio C Hamano45badf02018-03-14 21:56:41989 part. Implies <code>--stat</code>.
990</p>
991</dd>
992<dt class="hdlist1">
Junio C Hamanofbe00522006-10-19 05:58:48993--numstat
994</dt>
995<dd>
996<p>
Junio C Hamanoac12f0e2014-09-19 22:32:51997 Similar to <code>--stat</code>, but shows number of added and
Junio C Hamanofbe00522006-10-19 05:58:48998 deleted lines in decimal notation and pathname without
Junio C Hamanod793de52006-12-26 09:11:43999 abbreviation, to make it more machine friendly. For
Junio C Hamanoac12f0e2014-09-19 22:32:511000 binary files, outputs two <code>-</code> instead of saying
1001 <code>0 0</code>.
Junio C Hamanofbe00522006-10-19 05:58:481002</p>
1003</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591004<dt class="hdlist1">
Junio C Hamano7d23f5e2006-12-16 07:44:041005--shortstat
1006</dt>
1007<dd>
1008<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511009 Output only the last line of the <code>--stat</code> format containing total
Junio C Hamano7d23f5e2006-12-16 07:44:041010 number of modified files, as well as number of added and deleted
1011 lines.
1012</p>
1013</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591014<dt class="hdlist1">
Junio C Hamano11f15372019-03-07 03:17:001015-X[&lt;param1,param2,&#8230;&gt;]
1016</dt>
1017<dt class="hdlist1">
Junio C Hamano1c222c52011-05-13 19:55:321018--dirstat[=&lt;param1,param2,&#8230;&gt;]
Junio C Hamano6a45be92008-04-22 08:19:031019</dt>
1020<dd>
1021<p>
Junio C Hamano1c222c52011-05-13 19:55:321022 Output the distribution of relative amount of changes for each
Junio C Hamanoac12f0e2014-09-19 22:32:511023 sub-directory. The behavior of <code>--dirstat</code> can be customized by
Junio C Hamano1c222c52011-05-13 19:55:321024 passing it a comma separated list of parameters.
Junio C Hamanoac12f0e2014-09-19 22:32:511025 The defaults are controlled by the <code>diff.dirstat</code> configuration
Junio C Hamanoa28a9202012-06-21 07:08:231026 variable (see <a href="git-config.html">git-config(1)</a>).
Junio C Hamano1c222c52011-05-13 19:55:321027 The following parameters are available:
Junio C Hamano6a45be92008-04-22 08:19:031028</p>
Junio C Hamano9629d4f2012-12-19 00:28:271029<div class="openblock">
1030<div class="content">
Junio C Hamano1c222c52011-05-13 19:55:321031<div class="dlist"><dl>
1032<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:511033<code>changes</code>
Junio C Hamano1c222c52011-05-13 19:55:321034</dt>
1035<dd>
1036<p>
1037 Compute the dirstat numbers by counting the lines that have been
1038 removed from the source, or added to the destination. This ignores
1039 the amount of pure code movements within a file. In other words,
1040 rearranging lines in a file is not counted as much as other changes.
1041 This is the default behavior when no parameter is given.
1042</p>
Junio C Hamano6a45be92008-04-22 08:19:031043</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591044<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:511045<code>lines</code>
Junio C Hamanoa476efa2008-10-10 15:31:421046</dt>
1047<dd>
1048<p>
Junio C Hamano1c222c52011-05-13 19:55:321049 Compute the dirstat numbers by doing the regular line-based diff
1050 analysis, and summing the removed/added line counts. (For binary
1051 files, count 64-byte chunks instead, since binary files have no
Junio C Hamanoac12f0e2014-09-19 22:32:511052 natural concept of lines). This is a more expensive <code>--dirstat</code>
1053 behavior than the <code>changes</code> behavior, but it does count rearranged
Junio C Hamano1c222c52011-05-13 19:55:321054 lines within a file as much as other changes. The resulting output
Junio C Hamanoac12f0e2014-09-19 22:32:511055 is consistent with what you get from the other <code>--*stat</code> options.
Junio C Hamanoa476efa2008-10-10 15:31:421056</p>
1057</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591058<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:511059<code>files</code>
Junio C Hamano1c222c52011-05-13 19:55:321060</dt>
1061<dd>
1062<p>
1063 Compute the dirstat numbers by counting the number of files changed.
1064 Each changed file counts equally in the dirstat analysis. This is
Junio C Hamanoac12f0e2014-09-19 22:32:511065 the computationally cheapest <code>--dirstat</code> behavior, since it does
Junio C Hamano1c222c52011-05-13 19:55:321066 not have to look at the file contents at all.
1067</p>
1068</dd>
1069<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:511070<code>cumulative</code>
Junio C Hamano1c222c52011-05-13 19:55:321071</dt>
1072<dd>
1073<p>
1074 Count changes in a child directory for the parent directory as well.
Junio C Hamanoac12f0e2014-09-19 22:32:511075 Note that when using <code>cumulative</code>, the sum of the percentages
Junio C Hamano1c222c52011-05-13 19:55:321076 reported may exceed 100%. The default (non-cumulative) behavior can
Junio C Hamanoac12f0e2014-09-19 22:32:511077 be specified with the <code>noncumulative</code> parameter.
Junio C Hamano1c222c52011-05-13 19:55:321078</p>
1079</dd>
1080<dt class="hdlist1">
1081&lt;limit&gt;
1082</dt>
1083<dd>
1084<p>
1085 An integer parameter specifies a cut-off percent (3% by default).
1086 Directories contributing less than this percentage of the changes
1087 are not shown in the output.
1088</p>
1089</dd>
1090</dl></div>
Junio C Hamano9629d4f2012-12-19 00:28:271091</div></div>
Junio C Hamano1c222c52011-05-13 19:55:321092<div class="paragraph"><p>Example: The following will count changed files, while ignoring
1093directories with less than 10% of the total amount of changed files,
1094and accumulating child directory counts in the parent directories:
Junio C Hamanoac12f0e2014-09-19 22:32:511095<code>--dirstat=files,10,cumulative</code>.</p></div>
Junio C Hamano1c222c52011-05-13 19:55:321096</dd>
1097<dt class="hdlist1">
Junio C Hamano11f15372019-03-07 03:17:001098--cumulative
1099</dt>
1100<dd>
1101<p>
1102 Synonym for --dirstat=cumulative
1103</p>
1104</dd>
1105<dt class="hdlist1">
1106--dirstat-by-file[=&lt;param1,param2&gt;&#8230;]
1107</dt>
1108<dd>
1109<p>
1110 Synonym for --dirstat=files,param1,param2&#8230;
1111</p>
1112</dd>
1113<dt class="hdlist1">
Junio C Hamano6959c6c2006-05-17 10:34:111114--summary
1115</dt>
1116<dd>
1117<p>
1118 Output a condensed summary of extended header information
1119 such as creations, renames and mode changes.
1120</p>
1121</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591122<dt class="hdlist1">
Junio C Hamanod1308c92006-04-16 11:01:091123--patch-with-stat
1124</dt>
1125<dd>
1126<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511127 Synonym for <code>-p --stat</code>.
Junio C Hamanod1308c92006-04-16 11:01:091128</p>
1129</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591130<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231131-z
1132</dt>
1133<dd>
1134<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511135 When <code>--raw</code>, <code>--numstat</code>, <code>--name-only</code> or <code>--name-status</code> has been
Junio C Hamano0c053e82010-04-19 06:46:341136 given, do not munge pathnames and use NULs as output field terminators.
Junio C Hamano1a4e8412005-12-27 08:17:231137</p>
Junio C Hamano0f6f3bf2017-03-13 07:01:531138<div class="paragraph"><p>Without this option, pathnames with "unusual" characters are quoted as
1139explained for the configuration variable <code>core.quotePath</code> (see
1140<a href="git-config.html">git-config(1)</a>).</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231141</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591142<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231143--name-only
1144</dt>
1145<dd>
1146<p>
1147 Show only names of changed files.
1148</p>
1149</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591150<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231151--name-status
1152</dt>
1153<dd>
1154<p>
Junio C Hamanoa9aee782008-04-23 16:09:201155 Show only names and status of changed files. See the description
Junio C Hamanoac12f0e2014-09-19 22:32:511156 of the <code>--diff-filter</code> option on what the status letters mean.
Junio C Hamano1a4e8412005-12-27 08:17:231157</p>
1158</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591159<dt class="hdlist1">
Junio C Hamanoc21ab052009-10-31 04:03:551160--submodule[=&lt;format&gt;]
1161</dt>
1162<dd>
1163<p>
Junio C Hamanocd451662016-09-13 00:54:091164 Specify how differences in submodules are shown. When specifying
1165 <code>--submodule=short</code> the <em>short</em> format is used. This format just
1166 shows the names of the commits at the beginning and end of the range.
1167 When <code>--submodule</code> or <code>--submodule=log</code> is specified, the <em>log</em>
1168 format is used. This format lists the commits in the range like
1169 <a href="git-submodule.html">git-submodule(1)</a> <code>summary</code> does. When <code>--submodule=diff</code>
1170 is specified, the <em>diff</em> format is used. This format shows an
1171 inline diff of the changes in the submodule contents between the
1172 commit range. Defaults to <code>diff.submodule</code> or the <em>short</em> format
1173 if the config option is unset.
Junio C Hamanoc21ab052009-10-31 04:03:551174</p>
1175</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591176<dt class="hdlist1">
Junio C Hamano4aa0bcc2010-03-03 05:13:121177--color[=&lt;when&gt;]
Junio C Hamano9ae1a062006-07-10 08:12:341178</dt>
1179<dd>
1180<p>
1181 Show colored diff.
Junio C Hamanoac12f0e2014-09-19 22:32:511182 <code>--color</code> (i.e. without <em>=&lt;when&gt;</em>) is the same as <code>--color=always</code>.
1183 <em>&lt;when&gt;</em> can be one of <code>always</code>, <code>never</code>, or <code>auto</code>.
Junio C Hamano9ae1a062006-07-10 08:12:341184</p>
1185</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591186<dt class="hdlist1">
Junio C Hamano9ae1a062006-07-10 08:12:341187--no-color
1188</dt>
1189<dd>
1190<p>
Junio C Hamano5f2627d2011-05-06 20:23:481191 Turn off colored diff.
Junio C Hamanoac12f0e2014-09-19 22:32:511192 It is the same as <code>--color=never</code>.
Junio C Hamano9ae1a062006-07-10 08:12:341193</p>
1194</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591195<dt class="hdlist1">
Junio C Hamanofb1fdf12017-08-27 06:14:591196--color-moved[=&lt;mode&gt;]
1197</dt>
1198<dd>
1199<p>
1200 Moved lines of code are colored differently.
1201 The &lt;mode&gt; defaults to <em>no</em> if the option is not given
1202 and to <em>zebra</em> if the option with no mode is given.
1203 The mode must be one of:
1204</p>
1205<div class="openblock">
1206<div class="content">
1207<div class="dlist"><dl>
1208<dt class="hdlist1">
1209no
1210</dt>
1211<dd>
1212<p>
1213 Moved lines are not highlighted.
1214</p>
1215</dd>
1216<dt class="hdlist1">
1217default
1218</dt>
1219<dd>
1220<p>
1221 Is a synonym for <code>zebra</code>. This may change to a more sensible mode
1222 in the future.
1223</p>
1224</dd>
1225<dt class="hdlist1">
1226plain
1227</dt>
1228<dd>
1229<p>
1230 Any line that is added in one location and was removed
1231 in another location will be colored with <em>color.diff.newMoved</em>.
1232 Similarly <em>color.diff.oldMoved</em> will be used for removed lines
1233 that are added somewhere else in the diff. This mode picks up any
1234 moved line, but it is not very useful in a review to determine
1235 if a block of code was moved without permutation.
1236</p>
1237</dd>
1238<dt class="hdlist1">
Junio C Hamanof09b7cd2018-08-02 23:01:451239blocks
Junio C Hamanofb1fdf12017-08-27 06:14:591240</dt>
1241<dd>
1242<p>
1243 Blocks of moved text of at least 20 alphanumeric characters
1244 are detected greedily. The detected blocks are
Junio C Hamanof09b7cd2018-08-02 23:01:451245 painted using either the <em>color.diff.{old,new}Moved</em> color.
1246 Adjacent blocks cannot be told apart.
1247</p>
1248</dd>
1249<dt class="hdlist1">
1250zebra
1251</dt>
1252<dd>
1253<p>
1254 Blocks of moved text are detected as in <em>blocks</em> mode. The blocks
1255 are painted using either the <em>color.diff.{old,new}Moved</em> color or
Junio C Hamanofb1fdf12017-08-27 06:14:591256 <em>color.diff.{old,new}MovedAlternative</em>. The change between
1257 the two colors indicates that a new block was detected.
1258</p>
1259</dd>
1260<dt class="hdlist1">
Junio C Hamanobfd91f42018-08-17 22:21:161261dimmed-zebra
Junio C Hamanofb1fdf12017-08-27 06:14:591262</dt>
1263<dd>
1264<p>
1265 Similar to <em>zebra</em>, but additional dimming of uninteresting parts
1266 of moved code is performed. The bordering lines of two adjacent
1267 blocks are considered interesting, the rest is uninteresting.
Junio C Hamanobfd91f42018-08-17 22:21:161268 <code>dimmed_zebra</code> is a deprecated synonym.
Junio C Hamanofb1fdf12017-08-27 06:14:591269</p>
1270</dd>
1271</dl></div>
1272</div></div>
1273</dd>
1274<dt class="hdlist1">
Junio C Hamanoa90214f2019-01-28 22:05:251275--no-color-moved
1276</dt>
1277<dd>
1278<p>
1279 Turn off move detection. This can be used to override configuration
1280 settings. It is the same as <code>--color-moved=no</code>.
1281</p>
1282</dd>
1283<dt class="hdlist1">
Junio C Hamanof09b7cd2018-08-02 23:01:451284--color-moved-ws=&lt;modes&gt;
1285</dt>
1286<dd>
1287<p>
Junio C Hamanoa90214f2019-01-28 22:05:251288 This configures how whitespace is ignored when performing the
Junio C Hamanof09b7cd2018-08-02 23:01:451289 move detection for <code>--color-moved</code>.
1290 These modes can be given as a comma separated list:
1291</p>
1292<div class="openblock">
1293<div class="content">
1294<div class="dlist"><dl>
1295<dt class="hdlist1">
Junio C Hamanoa90214f2019-01-28 22:05:251296no
1297</dt>
1298<dd>
1299<p>
1300 Do not ignore whitespace when performing move detection.
1301</p>
1302</dd>
1303<dt class="hdlist1">
Junio C Hamanof09b7cd2018-08-02 23:01:451304ignore-space-at-eol
1305</dt>
1306<dd>
1307<p>
1308 Ignore changes in whitespace at EOL.
1309</p>
1310</dd>
1311<dt class="hdlist1">
1312ignore-space-change
1313</dt>
1314<dd>
1315<p>
1316 Ignore changes in amount of whitespace. This ignores whitespace
1317 at line end, and considers all other sequences of one or
1318 more whitespace characters to be equivalent.
1319</p>
1320</dd>
1321<dt class="hdlist1">
1322ignore-all-space
1323</dt>
1324<dd>
1325<p>
1326 Ignore whitespace when comparing lines. This ignores differences
1327 even if one line has whitespace where the other line has none.
1328</p>
1329</dd>
1330<dt class="hdlist1">
1331allow-indentation-change
1332</dt>
1333<dd>
1334<p>
Junio C Hamanoa90214f2019-01-28 22:05:251335 Initially ignore any whitespace in the move detection, then
Junio C Hamanof09b7cd2018-08-02 23:01:451336 group the moved code blocks only into a block if the change in
1337 whitespace is the same per line. This is incompatible with the
1338 other modes.
1339</p>
1340</dd>
1341</dl></div>
1342</div></div>
1343</dd>
1344<dt class="hdlist1">
Junio C Hamanoa90214f2019-01-28 22:05:251345--no-color-moved-ws
1346</dt>
1347<dd>
1348<p>
1349 Do not ignore whitespace when performing move detection. This can be
1350 used to override configuration settings. It is the same as
1351 <code>--color-moved-ws=no</code>.
1352</p>
1353</dd>
1354<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531355--word-diff[=&lt;mode&gt;]
Junio C Hamano85e45fa2006-08-13 07:47:411356</dt>
1357<dd>
1358<p>
Junio C Hamanocc7636a2010-05-21 14:57:531359 Show a word diff, using the &lt;mode&gt; to delimit changed words.
1360 By default, words are delimited by whitespace; see
Junio C Hamanoac12f0e2014-09-19 22:32:511361 <code>--word-diff-regex</code> below. The &lt;mode&gt; defaults to <em>plain</em>, and
Junio C Hamanocc7636a2010-05-21 14:57:531362 must be one of:
Junio C Hamano85e45fa2006-08-13 07:47:411363</p>
Junio C Hamano9629d4f2012-12-19 00:28:271364<div class="openblock">
1365<div class="content">
Junio C Hamano68cf15a2010-11-06 01:01:591366<div class="dlist"><dl>
1367<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531368color
1369</dt>
1370<dd>
1371<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511372 Highlight changed words using only colors. Implies <code>--color</code>.
Junio C Hamanocc7636a2010-05-21 14:57:531373</p>
1374</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591375<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531376plain
1377</dt>
1378<dd>
1379<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511380 Show words as <code>[-removed-]</code> and <code>{+added+}</code>. Makes no
Junio C Hamanocc7636a2010-05-21 14:57:531381 attempts to escape the delimiters if they appear in the input,
1382 so the output may be ambiguous.
1383</p>
1384</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591385<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531386porcelain
1387</dt>
1388<dd>
1389<p>
1390 Use a special line-based format intended for script
1391 consumption. Added/removed/unchanged runs are printed in the
Junio C Hamanoac12f0e2014-09-19 22:32:511392 usual unified diff format, starting with a <code>+</code>/<code>-</code>/` `
Junio C Hamanocc7636a2010-05-21 14:57:531393 character at the beginning of the line and extending to the
1394 end of the line. Newlines in the input are represented by a
Junio C Hamanoac12f0e2014-09-19 22:32:511395 tilde <code>~</code> on a line of its own.
Junio C Hamanocc7636a2010-05-21 14:57:531396</p>
1397</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591398<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531399none
1400</dt>
1401<dd>
1402<p>
1403 Disable word diff again.
1404</p>
1405</dd>
1406</dl></div>
Junio C Hamano9629d4f2012-12-19 00:28:271407</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591408<div class="paragraph"><p>Note that despite the name of the first mode, color is used to
Junio C Hamanocc7636a2010-05-21 14:57:531409highlight the changed parts in all modes if enabled.</p></div>
1410</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591411<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531412--word-diff-regex=&lt;regex&gt;
1413</dt>
1414<dd>
1415<p>
1416 Use &lt;regex&gt; to decide what a word is, instead of considering
1417 runs of non-whitespace to be a word. Also implies
Junio C Hamanoac12f0e2014-09-19 22:32:511418 <code>--word-diff</code> unless it was already enabled.
Junio C Hamanocc7636a2010-05-21 14:57:531419</p>
Junio C Hamano68cf15a2010-11-06 01:01:591420<div class="paragraph"><p>Every non-overlapping match of the
Junio C Hamano20d47e32009-01-26 06:36:021421&lt;regex&gt; is considered a word. Anything between these matches is
1422considered whitespace and ignored(!) for the purposes of finding
Junio C Hamanoac12f0e2014-09-19 22:32:511423differences. You may want to append <code>|[^[:space:]]</code> to your regular
Junio C Hamano20d47e32009-01-26 06:36:021424expression to make sure that it matches all non-whitespace characters.
1425A match that contains a newline is silently truncated(!) at the
1426newline.</p></div>
Junio C Hamano713eded2015-12-03 00:24:021427<div class="paragraph"><p>For example, <code>--word-diff-regex=.</code> will treat each character as a word
1428and, correspondingly, show differences character by character.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591429<div class="paragraph"><p>The regex can also be set via a diff driver or configuration option, see
Junio C Hamano198b1f12016-05-17 22:27:241430<a href="gitattributes.html">gitattributes(5)</a> or <a href="git-config.html">git-config(1)</a>. Giving it explicitly
Junio C Hamano20d47e32009-01-26 06:36:021431overrides any diff driver or configuration setting. Diff drivers
1432override configuration settings.</p></div>
Junio C Hamano85e45fa2006-08-13 07:47:411433</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591434<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:531435--color-words[=&lt;regex&gt;]
1436</dt>
1437<dd>
1438<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511439 Equivalent to <code>--word-diff=color</code> plus (if a regex was
1440 specified) <code>--word-diff-regex=&lt;regex&gt;</code>.
Junio C Hamanocc7636a2010-05-21 14:57:531441</p>
1442</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591443<dt class="hdlist1">
Junio C Hamano9ae1a062006-07-10 08:12:341444--no-renames
1445</dt>
1446<dd>
1447<p>
1448 Turn off rename detection, even when the configuration
1449 file gives the default to do so.
1450</p>
1451</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591452<dt class="hdlist1">
Junio C Hamano11f15372019-03-07 03:17:001453--[no-]rename-empty
1454</dt>
1455<dd>
1456<p>
1457 Whether to use empty blobs as rename source.
1458</p>
1459</dd>
1460<dt class="hdlist1">
Junio C Hamanoa890c4f2007-01-28 10:29:211461--check
1462</dt>
1463<dd>
1464<p>
Junio C Hamano84ea1e42016-04-08 21:53:481465 Warn if changes introduce conflict markers or whitespace errors.
1466 What are considered whitespace errors is controlled by <code>core.whitespace</code>
Junio C Hamano6005bfa2011-06-23 00:51:221467 configuration. By default, trailing whitespaces (including
Junio C Hamano14e66832018-06-18 18:32:191468 lines that consist solely of whitespaces) and a space character
Junio C Hamano6005bfa2011-06-23 00:51:221469 that is immediately followed by a tab character inside the
1470 initial indent of the line are considered whitespace errors.
1471 Exits with non-zero status if problems are found. Not compatible
1472 with --exit-code.
Junio C Hamanoa890c4f2007-01-28 10:29:211473</p>
1474</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591475<dt class="hdlist1">
Junio C Hamano8c5d5942015-06-11 19:37:481476--ws-error-highlight=&lt;kind&gt;
1477</dt>
1478<dd>
1479<p>
Junio C Hamano4b2a6c12017-08-22 18:32:371480 Highlight whitespace errors in the <code>context</code>, <code>old</code> or <code>new</code>
1481 lines of the diff. Multiple values are separated by comma,
1482 <code>none</code> resets previous values, <code>default</code> reset the list to
1483 <code>new</code> and <code>all</code> is a shorthand for <code>old,new,context</code>. When
1484 this option is not given, and the configuration variable
1485 <code>diff.wsErrorHighlight</code> is not set, only whitespace errors in
1486 <code>new</code> lines are highlighted. The whitespace errors are colored
Junio C Hamano14e66832018-06-18 18:32:191487 with <code>color.diff.whitespace</code>.
Junio C Hamano8c5d5942015-06-11 19:37:481488</p>
1489</dd>
1490<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231491--full-index
1492</dt>
1493<dd>
1494<p>
Junio C Hamano5cf43ca2008-08-20 09:14:141495 Instead of the first handful of characters, show the full
1496 pre- and post-image blob object names on the "index"
1497 line when generating patch format output.
Junio C Hamano1a4e8412005-12-27 08:17:231498</p>
1499</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591500<dt class="hdlist1">
Junio C Hamano9ae1a062006-07-10 08:12:341501--binary
1502</dt>
1503<dd>
1504<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511505 In addition to <code>--full-index</code>, output a binary diff that
Junio C Hamanoee43d182020-11-11 22:10:411506 can be applied with <code>git-apply</code>.
1507 Implies <code>--patch</code>.
Junio C Hamano9ae1a062006-07-10 08:12:341508</p>
1509</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591510<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231511--abbrev[=&lt;n&gt;]
1512</dt>
1513<dd>
1514<p>
1515 Instead of showing the full 40-byte hexadecimal object
1516 name in diff-raw format output and diff-tree header
Junio C Hamanoee43d182020-11-11 22:10:411517 lines, show the shortest prefix that is at least <em>&lt;n&gt;</em>
1518 hexdigits long that uniquely refers the object.
Junio C Hamanocf8aeaf2020-08-31 23:16:351519 In diff-patch output format, <code>--full-index</code> takes higher
1520 precedence, i.e. if <code>--full-index</code> is specified, full blob
1521 names will be shown regardless of <code>--abbrev</code>.
1522 Non default number of digits can be specified with <code>--abbrev=&lt;n&gt;</code>.
Junio C Hamano1a4e8412005-12-27 08:17:231523</p>
1524</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591525<dt class="hdlist1">
Junio C Hamanoe85e36f2010-08-10 05:30:141526-B[&lt;n&gt;][/&lt;m&gt;]
Junio C Hamano1a4e8412005-12-27 08:17:231527</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591528<dt class="hdlist1">
Junio C Hamano39c7a692010-10-27 06:08:541529--break-rewrites[=[&lt;n&gt;][/&lt;m&gt;]]
1530</dt>
Junio C Hamano1a4e8412005-12-27 08:17:231531<dd>
1532<p>
Junio C Hamanoe85e36f2010-08-10 05:30:141533 Break complete rewrite changes into pairs of delete and
1534 create. This serves two purposes:
Junio C Hamano1a4e8412005-12-27 08:17:231535</p>
Junio C Hamano68cf15a2010-11-06 01:01:591536<div class="paragraph"><p>It affects the way a change that amounts to a total rewrite of a file
Junio C Hamanoe85e36f2010-08-10 05:30:141537not as a series of deletion and insertion mixed together with a very
1538few lines that happen to match textually as the context, but as a
1539single deletion of everything old followed by a single insertion of
Junio C Hamanoac12f0e2014-09-19 22:32:511540everything new, and the number <code>m</code> controls this aspect of the -B
1541option (defaults to 60%). <code>-B/70%</code> specifies that less than 30% of the
Junio C Hamano076ffcc2013-02-06 05:13:211542original should remain in the result for Git to consider it a total
Junio C Hamanoe85e36f2010-08-10 05:30:141543rewrite (i.e. otherwise the resulting patch will be a series of
1544deletion and insertion mixed together with context lines).</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591545<div class="paragraph"><p>When used with -M, a totally-rewritten file is also considered as the
Junio C Hamanoe85e36f2010-08-10 05:30:141546source of a rename (usually -M only considers a file that disappeared
Junio C Hamanoac12f0e2014-09-19 22:32:511547as the source of a rename), and the number <code>n</code> controls this aspect of
1548the -B option (defaults to 50%). <code>-B20%</code> specifies that a change with
Junio C Hamano68cf15a2010-11-06 01:01:591549addition and deletion compared to 20% or more of the file&#8217;s size are
Junio C Hamanoe85e36f2010-08-10 05:30:141550eligible for being picked up as a possible source of a rename to
1551another file.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231552</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591553<dt class="hdlist1">
Junio C Hamanoe85e36f2010-08-10 05:30:141554-M[&lt;n&gt;]
Junio C Hamano1a4e8412005-12-27 08:17:231555</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591556<dt class="hdlist1">
Junio C Hamano0d75e872010-12-17 06:57:261557--find-renames[=&lt;n&gt;]
Junio C Hamano39c7a692010-10-27 06:08:541558</dt>
Junio C Hamano1a4e8412005-12-27 08:17:231559<dd>
1560<p>
1561 Detect renames.
Junio C Hamanoac12f0e2014-09-19 22:32:511562 If <code>n</code> is specified, it is a threshold on the similarity
Junio C Hamanoe85e36f2010-08-10 05:30:141563 index (i.e. amount of addition/deletions compared to the
Junio C Hamanoac12f0e2014-09-19 22:32:511564 file&#8217;s size). For example, <code>-M90%</code> means Git should consider a
Junio C Hamanoe85e36f2010-08-10 05:30:141565 delete/add pair to be a rename if more than 90% of the file
Junio C Hamanoac12f0e2014-09-19 22:32:511566 hasn&#8217;t changed. Without a <code>%</code> sign, the number is to be read as
1567 a fraction, with a decimal point before it. I.e., <code>-M5</code> becomes
1568 0.5, and is thus the same as <code>-M50%</code>. Similarly, <code>-M05</code> is
1569 the same as <code>-M5%</code>. To limit detection to exact renames, use
1570 <code>-M100%</code>. The default similarity index is 50%.
Junio C Hamano1a4e8412005-12-27 08:17:231571</p>
1572</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591573<dt class="hdlist1">
Junio C Hamanoe85e36f2010-08-10 05:30:141574-C[&lt;n&gt;]
Junio C Hamano1a4e8412005-12-27 08:17:231575</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591576<dt class="hdlist1">
Junio C Hamano0d75e872010-12-17 06:57:261577--find-copies[=&lt;n&gt;]
Junio C Hamano39c7a692010-10-27 06:08:541578</dt>
Junio C Hamano1a4e8412005-12-27 08:17:231579<dd>
1580<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511581 Detect copies as well as renames. See also <code>--find-copies-harder</code>.
1582 If <code>n</code> is specified, it has the same meaning as for <code>-M&lt;n&gt;</code>.
Junio C Hamano1a4e8412005-12-27 08:17:231583</p>
1584</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591585<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231586--find-copies-harder
1587</dt>
1588<dd>
1589<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511590 For performance reasons, by default, <code>-C</code> option finds copies only
Junio C Hamano1a4e8412005-12-27 08:17:231591 if the original file of the copy was modified in the same
1592 changeset. This flag makes the command
1593 inspect unmodified files as candidates for the source of
1594 copy. This is a very expensive operation for large
Junio C Hamano16f98872007-06-12 16:09:141595 projects, so use it with caution. Giving more than one
Junio C Hamanoac12f0e2014-09-19 22:32:511596 <code>-C</code> option has the same effect.
Junio C Hamano1a4e8412005-12-27 08:17:231597</p>
1598</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591599<dt class="hdlist1">
Junio C Hamanob02377c2011-04-28 22:26:021600-D
1601</dt>
1602<dt class="hdlist1">
1603--irreversible-delete
1604</dt>
1605<dd>
1606<p>
1607 Omit the preimage for deletes, i.e. print only the header but not
Junio C Hamanoac12f0e2014-09-19 22:32:511608 the diff between the preimage and <code>/dev/null</code>. The resulting patch
1609 is not meant to be applied with <code>patch</code> or <code>git apply</code>; this is
Junio C Hamanob02377c2011-04-28 22:26:021610 solely for people who want to just concentrate on reviewing the
Junio C Hamanod16fd1b2017-08-04 16:41:511611 text after the change. In addition, the output obviously lacks
Junio C Hamanob02377c2011-04-28 22:26:021612 enough information to apply such a patch in reverse, even manually,
1613 hence the name of the option.
1614</p>
Junio C Hamanoac12f0e2014-09-19 22:32:511615<div class="paragraph"><p>When used together with <code>-B</code>, omit also the preimage in the deletion part
Junio C Hamanob02377c2011-04-28 22:26:021616of a delete/create pair.</p></div>
1617</dd>
1618<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231619-l&lt;num&gt;
1620</dt>
1621<dd>
1622<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511623 The <code>-M</code> and <code>-C</code> options require O(n^2) processing time where n
Junio C Hamano1a4e8412005-12-27 08:17:231624 is the number of potential rename/copy targets. This
1625 option prevents rename/copy detection from running if
1626 the number of rename/copy targets exceeds the specified
1627 number.
1628</p>
1629</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591630<dt class="hdlist1">
Junio C Hamano982eb112010-11-18 00:53:091631--diff-filter=[(A|C|D|M|R|T|U|X|B)&#8230;[*]]
1632</dt>
1633<dd>
1634<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511635 Select only files that are Added (<code>A</code>), Copied (<code>C</code>),
1636 Deleted (<code>D</code>), Modified (<code>M</code>), Renamed (<code>R</code>), have their
1637 type (i.e. regular file, symlink, submodule, &#8230;) changed (<code>T</code>),
1638 are Unmerged (<code>U</code>), are
1639 Unknown (<code>X</code>), or have had their pairing Broken (<code>B</code>).
Junio C Hamano982eb112010-11-18 00:53:091640 Any combination of the filter characters (including none) can be used.
Junio C Hamanoac12f0e2014-09-19 22:32:511641 When <code>*</code> (All-or-none) is added to the combination, all
Junio C Hamano982eb112010-11-18 00:53:091642 paths are selected if there is any file that matches
1643 other criteria in the comparison; if there is no file
1644 that matches other criteria, nothing is selected.
1645</p>
Junio C Hamanoeed15af2016-07-25 22:49:421646<div class="paragraph"><p>Also, these upper-case letters can be downcased to exclude. E.g.
1647<code>--diff-filter=ad</code> excludes added and deleted paths.</p></div>
Junio C Hamano3a34f152018-01-09 23:09:381648<div class="paragraph"><p>Note that not all diffs can feature all types. For instance, diffs
1649from the index to the working tree can never have Added entries
1650(because the set of paths included in the diff is limited by what is in
1651the index). Similarly, copied and renamed entries cannot appear if
1652detection for those types is disabled.</p></div>
Junio C Hamano982eb112010-11-18 00:53:091653</dd>
1654<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231655-S&lt;string&gt;
1656</dt>
1657<dd>
1658<p>
Junio C Hamanof1f5a7b2013-06-11 22:23:521659 Look for differences that change the number of occurrences of
1660 the specified string (i.e. addition/deletion) in a file.
1661 Intended for the scripter&#8217;s use.
Junio C Hamano1a4e8412005-12-27 08:17:231662</p>
Junio C Hamanof1f5a7b2013-06-11 22:23:521663<div class="paragraph"><p>It is useful when you&#8217;re looking for an exact block of code (like a
1664struct), and want to know the history of that block since it first
1665came into being: use the feature iteratively to feed the interesting
Junio C Hamanoac12f0e2014-09-19 22:32:511666block in the preimage back into <code>-S</code>, and keep going until you get the
Junio C Hamanof1f5a7b2013-06-11 22:23:521667very first version of the block.</p></div>
Junio C Hamanoace33e42019-01-18 23:16:051668<div class="paragraph"><p>Binary files are searched as well.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231669</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591670<dt class="hdlist1">
Junio C Hamano3b4609d2010-09-30 00:04:341671-G&lt;regex&gt;
1672</dt>
1673<dd>
1674<p>
Junio C Hamanof1f5a7b2013-06-11 22:23:521675 Look for differences whose patch text contains added/removed
1676 lines that match &lt;regex&gt;.
Junio C Hamano3b4609d2010-09-30 00:04:341677</p>
Junio C Hamanoac12f0e2014-09-19 22:32:511678<div class="paragraph"><p>To illustrate the difference between <code>-S&lt;regex&gt; --pickaxe-regex</code> and
1679<code>-G&lt;regex&gt;</code>, consider a commit with the following diff in the same
Junio C Hamanof1f5a7b2013-06-11 22:23:521680file:</p></div>
1681<div class="listingblock">
1682<div class="content">
Junio C Hamanob7e497f2020-02-12 21:41:371683<pre><code>+ return frotz(nitfol, two-&gt;ptr, 1, 0);
Junio C Hamanof1f5a7b2013-06-11 22:23:521684...
Junio C Hamanob7e497f2020-02-12 21:41:371685- hit = frotz(nitfol, mf2.ptr, 1, 0);</code></pre>
Junio C Hamanof1f5a7b2013-06-11 22:23:521686</div></div>
Junio C Hamanob7e497f2020-02-12 21:41:371687<div class="paragraph"><p>While <code>git log -G"frotz\(nitfol"</code> will show this commit, <code>git log
1688-S"frotz\(nitfol" --pickaxe-regex</code> will not (because the number of
Junio C Hamanof1f5a7b2013-06-11 22:23:521689occurrences of that string did not change).</p></div>
Junio C Hamanoace33e42019-01-18 23:16:051690<div class="paragraph"><p>Unless <code>--text</code> is supplied patches of binary files without a textconv
1691filter will be ignored.</p></div>
Junio C Hamanof1f5a7b2013-06-11 22:23:521692<div class="paragraph"><p>See the <em>pickaxe</em> entry in <a href="gitdiffcore.html">gitdiffcore(7)</a> for more
1693information.</p></div>
Junio C Hamano3b4609d2010-09-30 00:04:341694</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591695<dt class="hdlist1">
Junio C Hamano7b9cce92018-01-23 22:34:271696--find-object=&lt;object-id&gt;
1697</dt>
1698<dd>
1699<p>
1700 Look for differences that change the number of occurrences of
1701 the specified object. Similar to <code>-S</code>, just the argument is different
1702 in that it doesn&#8217;t search for a specific string but for a specific
1703 object id.
1704</p>
1705<div class="paragraph"><p>The object can be a blob or a submodule commit. It implies the <code>-t</code> option in
1706<code>git-log</code> to also find trees.</p></div>
1707</dd>
1708<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231709--pickaxe-all
1710</dt>
1711<dd>
1712<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511713 When <code>-S</code> or <code>-G</code> finds a change, show all the changes in that
Junio C Hamano1a4e8412005-12-27 08:17:231714 changeset, not just the files that contain the change
1715 in &lt;string&gt;.
1716</p>
1717</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591718<dt class="hdlist1">
Junio C Hamanobfe9e752006-04-05 21:43:281719--pickaxe-regex
1720</dt>
1721<dd>
1722<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511723 Treat the &lt;string&gt; given to <code>-S</code> as an extended POSIX regular
Junio C Hamanof1f5a7b2013-06-11 22:23:521724 expression to match.
Junio C Hamanobfe9e752006-04-05 21:43:281725</p>
1726</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591727<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231728-O&lt;orderfile&gt;
1729</dt>
1730<dd>
1731<p>
Junio C Hamanobcd98f42017-01-24 00:12:161732 Control the order in which files appear in the output.
Junio C Hamano322c6242015-03-23 21:32:461733 This overrides the <code>diff.orderFile</code> configuration variable
1734 (see <a href="git-config.html">git-config(1)</a>). To cancel <code>diff.orderFile</code>,
Junio C Hamanoac12f0e2014-09-19 22:32:511735 use <code>-O/dev/null</code>.
Junio C Hamano1a4e8412005-12-27 08:17:231736</p>
Junio C Hamanobcd98f42017-01-24 00:12:161737<div class="paragraph"><p>The output order is determined by the order of glob patterns in
1738&lt;orderfile&gt;.
1739All files with pathnames that match the first pattern are output
1740first, all files with pathnames that match the second pattern (but not
1741the first) are output next, and so on.
1742All files with pathnames that do not match any pattern are output
1743last, as if there was an implicit match-all pattern at the end of the
1744file.
1745If multiple pathnames have the same rank (they match the same pattern
1746but no earlier patterns), their output order relative to each other is
1747the normal order.</p></div>
1748<div class="paragraph"><p>&lt;orderfile&gt; is parsed as follows:</p></div>
1749<div class="openblock">
1750<div class="content">
1751<div class="ulist"><ul>
1752<li>
1753<p>
1754Blank lines are ignored, so they can be used as separators for
1755 readability.
1756</p>
1757</li>
1758<li>
1759<p>
1760Lines starting with a hash ("<code>#</code>") are ignored, so they can be used
1761 for comments. Add a backslash ("<code>\</code>") to the beginning of the
1762 pattern if it starts with a hash.
1763</p>
1764</li>
1765<li>
1766<p>
1767Each other line contains a single pattern.
1768</p>
1769</li>
1770</ul></div>
1771</div></div>
1772<div class="paragraph"><p>Patterns have the same syntax and semantics as patterns used for
Junio C Hamano96153bf2018-04-25 08:25:341773fnmatch(3) without the FNM_PATHNAME flag, except a pathname also
Junio C Hamanobcd98f42017-01-24 00:12:161774matches a pattern if removing any number of the final pathname
1775components matches the pattern. For example, the pattern "<code>foo*bar</code>"
1776matches "<code>fooasdfbar</code>" and "<code>foo/bar/baz/asdf</code>" but not "<code>foobarx</code>".</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231777</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591778<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231779-R
1780</dt>
1781<dd>
1782<p>
1783 Swap two inputs; that is, show differences from index or
1784 on-disk file to tree contents.
1785</p>
1786</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591787<dt class="hdlist1">
Junio C Hamano24bc09a2008-02-28 00:27:441788--relative[=&lt;path&gt;]
1789</dt>
Junio C Hamano3ef9e672020-06-02 21:51:311790<dt class="hdlist1">
1791--no-relative
1792</dt>
Junio C Hamano24bc09a2008-02-28 00:27:441793<dd>
1794<p>
1795 When run from a subdirectory of the project, it can be
1796 told to exclude changes outside the directory and show
1797 pathnames relative to it with this option. When you are
1798 not in a subdirectory (e.g. in a bare repository), you
1799 can name which subdirectory to make the output relative
1800 to by giving a &lt;path&gt; as an argument.
Junio C Hamano3ef9e672020-06-02 21:51:311801 <code>--no-relative</code> can be used to countermand both <code>diff.relative</code> config
1802 option and previous <code>--relative</code>.
Junio C Hamano24bc09a2008-02-28 00:27:441803</p>
1804</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591805<dt class="hdlist1">
Junio C Hamanobbbb8652008-12-29 10:34:221806-a
1807</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591808<dt class="hdlist1">
Junio C Hamanoc26f5482006-07-09 09:38:141809--text
1810</dt>
1811<dd>
1812<p>
1813 Treat all files as text.
1814</p>
1815</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591816<dt class="hdlist1">
Junio C Hamano4886c772017-11-27 03:33:281817--ignore-cr-at-eol
1818</dt>
1819<dd>
1820<p>
Junio C Hamano96153bf2018-04-25 08:25:341821 Ignore carriage-return at the end of line when doing a comparison.
Junio C Hamano4886c772017-11-27 03:33:281822</p>
1823</dd>
1824<dt class="hdlist1">
Junio C Hamanofd468962007-02-14 23:45:041825--ignore-space-at-eol
1826</dt>
1827<dd>
1828<p>
Junio C Hamano3a702342007-12-12 21:34:021829 Ignore changes in whitespace at EOL.
Junio C Hamanofd468962007-02-14 23:45:041830</p>
1831</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591832<dt class="hdlist1">
Junio C Hamanobbbb8652008-12-29 10:34:221833-b
1834</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591835<dt class="hdlist1">
Junio C Hamanod9c2d2f2006-12-06 08:59:071836--ignore-space-change
1837</dt>
1838<dd>
1839<p>
Junio C Hamano3a702342007-12-12 21:34:021840 Ignore changes in amount of whitespace. This ignores whitespace
1841 at line end, and considers all other sequences of one or
1842 more whitespace characters to be equivalent.
Junio C Hamanod9c2d2f2006-12-06 08:59:071843</p>
1844</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591845<dt class="hdlist1">
Junio C Hamanobbbb8652008-12-29 10:34:221846-w
Junio C Hamanod9c2d2f2006-12-06 08:59:071847</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591848<dt class="hdlist1">
Junio C Hamanod9c2d2f2006-12-06 08:59:071849--ignore-all-space
1850</dt>
1851<dd>
1852<p>
Junio C Hamano3a702342007-12-12 21:34:021853 Ignore whitespace when comparing lines. This ignores
1854 differences even if one line has whitespace where the other
Junio C Hamanod9c2d2f2006-12-06 08:59:071855 line has none.
1856</p>
1857</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591858<dt class="hdlist1">
Junio C Hamanoa1952302013-07-01 21:31:181859--ignore-blank-lines
1860</dt>
1861<dd>
1862<p>
1863 Ignore changes whose lines are all blank.
1864</p>
1865</dd>
1866<dt class="hdlist1">
Junio C Hamanodf3d3cd2020-11-02 22:05:051867-I&lt;regex&gt;
1868</dt>
1869<dt class="hdlist1">
1870--ignore-matching-lines=&lt;regex&gt;
1871</dt>
1872<dd>
1873<p>
1874 Ignore changes whose all lines match &lt;regex&gt;. This option may
1875 be specified more than once.
1876</p>
1877</dd>
1878<dt class="hdlist1">
Junio C Hamano1d40ee82009-01-07 10:14:161879--inter-hunk-context=&lt;lines&gt;
1880</dt>
1881<dd>
1882<p>
1883 Show the context between diff hunks, up to the specified number
1884 of lines, thereby fusing hunks that are close to each other.
Junio C Hamanobcd98f42017-01-24 00:12:161885 Defaults to <code>diff.interHunkContext</code> or 0 if the config option
1886 is unset.
Junio C Hamano1d40ee82009-01-07 10:14:161887</p>
1888</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591889<dt class="hdlist1">
Junio C Hamano11821ed2011-10-19 18:42:091890-W
1891</dt>
1892<dt class="hdlist1">
1893--function-context
1894</dt>
1895<dd>
1896<p>
Junio C Hamanob7676d52020-11-18 22:15:081897 Show whole function as context lines for each change.
1898 The function names are determined in the same way as
1899 <code>git diff</code> works out patch hunk headers (see <em>Defining a
1900 custom hunk-header</em> in <a href="gitattributes.html">gitattributes(5)</a>).
Junio C Hamano11821ed2011-10-19 18:42:091901</p>
1902</dd>
1903<dt class="hdlist1">
Junio C Hamano48fd2f62007-03-19 02:02:301904--exit-code
1905</dt>
1906<dd>
1907<p>
1908 Make the program exit with codes similar to diff(1).
1909 That is, it exits with 1 if there were differences and
1910 0 means no differences.
1911</p>
1912</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591913<dt class="hdlist1">
Junio C Hamano35e57552007-03-25 07:54:351914--quiet
1915</dt>
1916<dd>
1917<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511918 Disable all output of the program. Implies <code>--exit-code</code>.
Junio C Hamano35e57552007-03-25 07:54:351919</p>
1920</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591921<dt class="hdlist1">
Junio C Hamanobb0f4042007-07-04 06:41:401922--ext-diff
1923</dt>
1924<dd>
1925<p>
1926 Allow an external diff helper to be executed. If you set an
Junio C Hamanoa28a9202012-06-21 07:08:231927 external diff driver with <a href="gitattributes.html">gitattributes(5)</a>, you need
1928 to use this option with <a href="git-log.html">git-log(1)</a> and friends.
Junio C Hamanobb0f4042007-07-04 06:41:401929</p>
1930</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591931<dt class="hdlist1">
Junio C Hamanobb0f4042007-07-04 06:41:401932--no-ext-diff
1933</dt>
1934<dd>
1935<p>
1936 Disallow external diff drivers.
1937</p>
1938</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591939<dt class="hdlist1">
Junio C Hamanoc652aed2011-07-07 01:14:311940--textconv
1941</dt>
1942<dt class="hdlist1">
1943--no-textconv
1944</dt>
1945<dd>
1946<p>
1947 Allow (or disallow) external text conversion filters to be run
Junio C Hamanoa28a9202012-06-21 07:08:231948 when comparing binary files. See <a href="gitattributes.html">gitattributes(5)</a> for
Junio C Hamanoc652aed2011-07-07 01:14:311949 details. Because textconv filters are typically a one-way
1950 conversion, the resulting diff is suitable for human
1951 consumption, but cannot be applied. For this reason, textconv
Junio C Hamanoa28a9202012-06-21 07:08:231952 filters are enabled by default only for <a href="git-diff.html">git-diff(1)</a> and
1953 <a href="git-log.html">git-log(1)</a>, but not for <a href="git-format-patch.html">git-format-patch(1)</a> or
Junio C Hamanoc652aed2011-07-07 01:14:311954 diff plumbing commands.
1955</p>
1956</dd>
1957<dt class="hdlist1">
Junio C Hamano7d449522010-07-01 00:08:511958--ignore-submodules[=&lt;when&gt;]
Junio C Hamanodfccbb02008-05-26 01:16:141959</dt>
1960<dd>
1961<p>
Junio C Hamano7d449522010-07-01 00:08:511962 Ignore changes to submodules in the diff generation. &lt;when&gt; can be
Junio C Hamanoc7102962013-05-29 23:57:171963 either "none", "untracked", "dirty" or "all", which is the default.
Junio C Hamano619596a2010-08-18 22:15:351964 Using "none" will consider the submodule modified when it either contains
1965 untracked or modified files or its HEAD differs from the commit recorded
1966 in the superproject and can be used to override any settings of the
Junio C Hamanoa28a9202012-06-21 07:08:231967 <em>ignore</em> option in <a href="git-config.html">git-config(1)</a> or <a href="gitmodules.html">gitmodules(5)</a>. When
Junio C Hamano7d449522010-07-01 00:08:511968 "untracked" is used submodules are not considered dirty when they only
1969 contain untracked content (but they are still scanned for modified
1970 content). Using "dirty" ignores all changes to the work tree of submodules,
1971 only changes to the commits stored in the superproject are shown (this was
1972 the behavior until 1.7.0). Using "all" hides all changes to submodules.
Junio C Hamanodfccbb02008-05-26 01:16:141973</p>
1974</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591975<dt class="hdlist1">
Junio C Hamanoe27cbd22007-12-21 17:57:331976--src-prefix=&lt;prefix&gt;
1977</dt>
1978<dd>
1979<p>
1980 Show the given source prefix instead of "a/".
1981</p>
1982</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591983<dt class="hdlist1">
Junio C Hamanoe27cbd22007-12-21 17:57:331984--dst-prefix=&lt;prefix&gt;
1985</dt>
1986<dd>
1987<p>
1988 Show the given destination prefix instead of "b/".
1989</p>
1990</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591991<dt class="hdlist1">
Junio C Hamanoe27cbd22007-12-21 17:57:331992--no-prefix
1993</dt>
1994<dd>
1995<p>
1996 Do not show any source or destination prefix.
1997</p>
1998</dd>
Junio C Hamanocd451662016-09-13 00:54:091999<dt class="hdlist1">
2000--line-prefix=&lt;prefix&gt;
2001</dt>
2002<dd>
2003<p>
2004 Prepend an additional prefix to every line of output.
2005</p>
2006</dd>
Junio C Hamanof7017f12016-10-27 23:31:342007<dt class="hdlist1">
2008--ita-invisible-in-index
2009</dt>
2010<dd>
2011<p>
2012 By default entries added by "git add -N" appear as an existing
2013 empty file in "git diff" and a new file in "git diff --cached".
2014 This option makes the entry appear as a new file in "git diff"
2015 and non-existent in "git diff --cached". This option could be
2016 reverted with <code>--ita-visible-in-index</code>. Both options are
2017 experimental and could be removed in future.
2018</p>
2019</dd>
Junio C Hamanoba4b9282008-07-06 05:20:312020</dl></div>
Junio C Hamano68cf15a2010-11-06 01:01:592021<div class="paragraph"><p>For more detailed explanation on these common options, see also
Junio C Hamanoa28a9202012-06-21 07:08:232022<a href="gitdiffcore.html">gitdiffcore(7)</a>.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592023<div class="dlist"><dl>
2024<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:232025&lt;tree-ish&gt;
2026</dt>
2027<dd>
2028<p>
2029 The id of a tree object.
2030</p>
2031</dd>
Junio C Hamano68cf15a2010-11-06 01:01:592032<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:232033&lt;path&gt;&#8230;
2034</dt>
2035<dd>
2036<p>
2037 If provided, the results are limited to a subset of files
Junio C Hamano23168ef2019-02-07 07:20:472038 matching one of the provided pathspecs.
Junio C Hamano1a4e8412005-12-27 08:17:232039</p>
2040</dd>
Junio C Hamano68cf15a2010-11-06 01:01:592041<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:232042-r
2043</dt>
2044<dd>
2045<p>
2046 recurse into sub-trees
2047</p>
2048</dd>
Junio C Hamano68cf15a2010-11-06 01:01:592049<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:232050-t
2051</dt>
2052<dd>
2053<p>
2054 show tree entry itself as well as subtrees. Implies -r.
2055</p>
2056</dd>
Junio C Hamano68cf15a2010-11-06 01:01:592057<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:232058--root
2059</dt>
2060<dd>
2061<p>
Junio C Hamano92d80372016-07-13 22:00:052062 When <code>--root</code> is specified the initial commit will be shown as a big
Junio C Hamano1a4e8412005-12-27 08:17:232063 creation event. This is equivalent to a diff against the NULL tree.
2064</p>
2065</dd>
Junio C Hamano68cf15a2010-11-06 01:01:592066<dt class="hdlist1">
Junio C Hamanodf3d3cd2020-11-02 22:05:052067--merge-base
2068</dt>
2069<dd>
2070<p>
2071 Instead of comparing the &lt;tree-ish&gt;s directly, use the merge
2072 base between the two &lt;tree-ish&gt;s as the "before" side. There
2073 must be two &lt;tree-ish&gt;s given and they must both be commits.
2074</p>
2075</dd>
2076<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:232077--stdin
2078</dt>
2079<dd>
2080<p>
Junio C Hamano92d80372016-07-13 22:00:052081 When <code>--stdin</code> is specified, the command does not take
Junio C Hamano1a4e8412005-12-27 08:17:232082 &lt;tree-ish&gt; arguments from the command line. Instead, it
Junio C Hamano3f2f6e52008-08-21 10:34:222083 reads lines containing either two &lt;tree&gt;, one &lt;commit&gt;, or a
2084 list of &lt;commit&gt; from its standard input. (Use a single space
2085 as separator.)
Junio C Hamano1a4e8412005-12-27 08:17:232086</p>
Junio C Hamano68cf15a2010-11-06 01:01:592087<div class="paragraph"><p>When two trees are given, it compares the first tree with the second.
Junio C Hamano3f2f6e52008-08-21 10:34:222088When a single commit is given, it compares the commit with its
2089parents. The remaining commits, when given, are used as if they are
Junio C Hamanob53db3c2008-08-07 00:17:522090parents of the first commit.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592091<div class="paragraph"><p>When comparing two trees, the ID of both trees (separated by a space
Junio C Hamano3f2f6e52008-08-21 10:34:222092and terminated by a newline) is printed before the difference. When
2093comparing commits, the ID of the first (or only) commit, followed by a
2094newline, is printed.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592095<div class="paragraph"><p>The following flags further affect the behavior when comparing
Junio C Hamano3f2f6e52008-08-21 10:34:222096commits (but not trees).</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232097</dd>
Junio C Hamano68cf15a2010-11-06 01:01:592098<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:232099-m
2100</dt>
2101<dd>
2102<p>
Junio C Hamano1aa40d22010-01-21 17:46:432103 By default, <em>git diff-tree --stdin</em> does not show
Junio C Hamano1a4e8412005-12-27 08:17:232104 differences for merge commits. With this flag, it shows
Junio C Hamanoa8adb1e2006-04-10 23:46:162105 differences to that commit from all of its parents. See
Junio C Hamano92d80372016-07-13 22:00:052106 also <code>-c</code>.
Junio C Hamano1a4e8412005-12-27 08:17:232107</p>
2108</dd>
Junio C Hamano68cf15a2010-11-06 01:01:592109<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:232110-s
2111</dt>
2112<dd>
2113<p>
Junio C Hamano1aa40d22010-01-21 17:46:432114 By default, <em>git diff-tree --stdin</em> shows differences,
Junio C Hamano92d80372016-07-13 22:00:052115 either in machine-readable form (without <code>-p</code>) or in patch
2116 form (with <code>-p</code>). This output can be suppressed. It is
2117 only useful with <code>-v</code> flag.
Junio C Hamano1a4e8412005-12-27 08:17:232118</p>
2119</dd>
Junio C Hamano68cf15a2010-11-06 01:01:592120<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:232121-v
2122</dt>
2123<dd>
2124<p>
Junio C Hamano1aa40d22010-01-21 17:46:432125 This flag causes <em>git diff-tree --stdin</em> to also show
Junio C Hamano1a4e8412005-12-27 08:17:232126 the commit message before the differences.
2127</p>
2128</dd>
Junio C Hamano68cf15a2010-11-06 01:01:592129<dt class="hdlist1">
Junio C Hamanod2179ef2010-10-22 04:12:172130--pretty[=&lt;format&gt;]
Junio C Hamano1a4e8412005-12-27 08:17:232131</dt>
Junio C Hamano68cf15a2010-11-06 01:01:592132<dt class="hdlist1">
Junio C Hamanod2179ef2010-10-22 04:12:172133--format=&lt;format&gt;
Junio C Hamano0a235222009-03-06 08:21:092134</dt>
Junio C Hamano1a4e8412005-12-27 08:17:232135<dd>
2136<p>
Junio C Hamanoa3770f92007-07-25 08:53:332137 Pretty-print the contents of the commit logs in a given format,
Junio C Hamano0430e3a2007-05-15 03:13:172138 where <em>&lt;format&gt;</em> can be one of <em>oneline</em>, <em>short</em>, <em>medium</em>,
Junio C Hamanob4896852019-12-10 23:15:092139 <em>full</em>, <em>fuller</em>, <em>reference</em>, <em>email</em>, <em>raw</em>, <em>format:&lt;string&gt;</em>
Junio C Hamano6bb32e62015-02-17 22:11:262140 and <em>tformat:&lt;string&gt;</em>. When <em>&lt;format&gt;</em> is none of the above,
2141 and has <em>%placeholder</em> in it, it acts as if
2142 <em>--pretty=tformat:&lt;format&gt;</em> were given.
Junio C Hamano1a4e8412005-12-27 08:17:232143</p>
Junio C Hamano6bb32e62015-02-17 22:11:262144<div class="paragraph"><p>See the "PRETTY FORMATS" section for some additional details for each
2145format. When <em>=&lt;format&gt;</em> part is omitted, it defaults to <em>medium</em>.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592146<div class="paragraph"><p>Note: you can specify the default pretty format in the repository
Junio C Hamanoa28a9202012-06-21 07:08:232147configuration (see <a href="git-config.html">git-config(1)</a>).</p></div>
Junio C Hamano0430e3a2007-05-15 03:13:172148</dd>
Junio C Hamano68cf15a2010-11-06 01:01:592149<dt class="hdlist1">
Junio C Hamanoee695f22007-06-21 00:35:362150--abbrev-commit
2151</dt>
2152<dd>
2153<p>
2154 Instead of showing the full 40-byte hexadecimal commit object
Junio C Hamanoee43d182020-11-11 22:10:412155 name, show a prefix that names the object uniquely.
2156 "--abbrev=&lt;n&gt;" (which also modifies diff output, if it is displayed)
2157 option can be used to specify the minimum length of the prefix.
Junio C Hamanoee695f22007-06-21 00:35:362158</p>
Junio C Hamano68cf15a2010-11-06 01:01:592159<div class="paragraph"><p>This should make "--pretty=oneline" a whole lot more readable for
Junio C Hamanoba4b9282008-07-06 05:20:312160people using 80-column terminals.</p></div>
Junio C Hamanoee695f22007-06-21 00:35:362161</dd>
Junio C Hamano68cf15a2010-11-06 01:01:592162<dt class="hdlist1">
Junio C Hamanof93530e2011-05-25 23:59:592163--no-abbrev-commit
2164</dt>
2165<dd>
2166<p>
2167 Show the full 40-byte hexadecimal commit object name. This negates
Junio C Hamano558abd22020-09-03 20:22:342168 <code>--abbrev-commit</code>, either explicit or implied by other options such
2169 as "--oneline". It also overrides the <code>log.abbrevCommit</code> variable.
Junio C Hamanof93530e2011-05-25 23:59:592170</p>
2171</dd>
2172<dt class="hdlist1">
Junio C Hamano0a235222009-03-06 08:21:092173--oneline
2174</dt>
2175<dd>
2176<p>
2177 This is a shorthand for "--pretty=oneline --abbrev-commit"
2178 used together.
2179</p>
2180</dd>
Junio C Hamano68cf15a2010-11-06 01:01:592181<dt class="hdlist1">
Junio C Hamanoc5bb3b32013-08-05 22:43:362182--encoding=&lt;encoding&gt;
Junio C Hamano0430e3a2007-05-15 03:13:172183</dt>
2184<dd>
2185<p>
2186 The commit objects record the encoding used for the log message
2187 in their encoding header; this option can be used to tell the
2188 command to re-code the commit log message in the encoding
2189 preferred by the user. For non plumbing commands this
Junio C Hamano823eebb2015-07-10 22:29:342190 defaults to UTF-8. Note that if an object claims to be encoded
2191 in <code>X</code> and we are outputting in <code>X</code>, we will output the object
2192 verbatim; this means that invalid sequences in the original
2193 commit may be copied to the output.
Junio C Hamano0430e3a2007-05-15 03:13:172194</p>
2195</dd>
Junio C Hamano68cf15a2010-11-06 01:01:592196<dt class="hdlist1">
Junio C Hamano5996b672016-04-13 22:01:412197--expand-tabs=&lt;n&gt;
2198</dt>
2199<dt class="hdlist1">
2200--expand-tabs
2201</dt>
2202<dt class="hdlist1">
2203--no-expand-tabs
2204</dt>
2205<dd>
2206<p>
2207 Perform a tab expansion (replace each tab with enough spaces
2208 to fill to the next display column that is multiple of <em>&lt;n&gt;</em>)
2209 in the log message before showing it in the output.
2210 <code>--expand-tabs</code> is a short-hand for <code>--expand-tabs=8</code>, and
2211 <code>--no-expand-tabs</code> is a short-hand for <code>--expand-tabs=0</code>,
2212 which disables tab expansion.
2213</p>
2214<div class="paragraph"><p>By default, tabs are expanded in pretty formats that indent the log
2215message by 4 spaces (i.e. <em>medium</em>, which is the default, <em>full</em>,
2216and <em>fuller</em>).</p></div>
2217</dd>
2218<dt class="hdlist1">
Junio C Hamanob3f862c2019-12-05 22:22:002219--notes[=&lt;ref&gt;]
Junio C Hamano57827fb2010-01-23 03:02:502220</dt>
2221<dd>
2222<p>
Junio C Hamanoa28a9202012-06-21 07:08:232223 Show the notes (see <a href="git-notes.html">git-notes(1)</a>) that annotate the
Junio C Hamano57827fb2010-01-23 03:02:502224 commit, when showing the commit log message. This is the default
Junio C Hamanoac12f0e2014-09-19 22:32:512225 for <code>git log</code>, <code>git show</code> and <code>git whatchanged</code> commands when
2226 there is no <code>--pretty</code>, <code>--format</code>, or <code>--oneline</code> option given
Junio C Hamano60033462011-05-03 00:48:432227 on the command line.
Junio C Hamano57827fb2010-01-23 03:02:502228</p>
Junio C Hamano60033462011-05-03 00:48:432229<div class="paragraph"><p>By default, the notes shown are from the notes refs listed in the
Junio C Hamano042f2142016-06-27 18:05:052230<code>core.notesRef</code> and <code>notes.displayRef</code> variables (or corresponding
Junio C Hamanoa28a9202012-06-21 07:08:232231environment overrides). See <a href="git-config.html">git-config(1)</a> for more details.</p></div>
Junio C Hamanob3f862c2019-12-05 22:22:002232<div class="paragraph"><p>With an optional <em>&lt;ref&gt;</em> argument, use the ref to find the notes
2233to display. The ref can specify the full refname when it begins
Junio C Hamano1f7c4a52015-10-14 22:15:512234with <code>refs/notes/</code>; when it begins with <code>notes/</code>, <code>refs/</code> and otherwise
2235<code>refs/notes/</code> is prefixed to form a full name of the ref.</p></div>
Junio C Hamano60033462011-05-03 00:48:432236<div class="paragraph"><p>Multiple --notes options can be combined to control which notes are
2237being displayed. Examples: "--notes=foo" will show only notes from
2238"refs/notes/foo"; "--notes=foo --notes" will show both notes from
2239"refs/notes/foo" and from the default notes ref(s).</p></div>
Junio C Hamano31667362010-03-25 00:38:532240</dd>
Junio C Hamano68cf15a2010-11-06 01:01:592241<dt class="hdlist1">
Junio C Hamano60033462011-05-03 00:48:432242--no-notes
2243</dt>
2244<dd>
2245<p>
Junio C Hamanoac12f0e2014-09-19 22:32:512246 Do not show notes. This negates the above <code>--notes</code> option, by
Junio C Hamano60033462011-05-03 00:48:432247 resetting the list of notes refs from which notes are shown.
2248 Options are parsed in the order given on the command line, so e.g.
2249 "--notes --notes=foo --no-notes --notes=bar" will only show notes
2250 from "refs/notes/bar".
2251</p>
2252</dd>
2253<dt class="hdlist1">
Junio C Hamanob3f862c2019-12-05 22:22:002254--show-notes[=&lt;ref&gt;]
Junio C Hamano60033462011-05-03 00:48:432255</dt>
2256<dt class="hdlist1">
Junio C Hamano31667362010-03-25 00:38:532257--[no-]standard-notes
2258</dt>
2259<dd>
2260<p>
Junio C Hamano60033462011-05-03 00:48:432261 These options are deprecated. Use the above --notes/--no-notes
2262 options instead.
Junio C Hamano31667362010-03-25 00:38:532263</p>
Junio C Hamano57827fb2010-01-23 03:02:502264</dd>
Junio C Hamano68cf15a2010-11-06 01:01:592265<dt class="hdlist1">
Junio C Hamano0acb1ae2012-09-24 21:28:132266--show-signature
2267</dt>
2268<dd>
2269<p>
2270 Check the validity of a signed commit object by passing the signature
Junio C Hamanoac12f0e2014-09-19 22:32:512271 to <code>gpg --verify</code> and show the output.
Junio C Hamano0acb1ae2012-09-24 21:28:132272</p>
2273</dd>
2274<dt class="hdlist1">
Junio C Hamano0430e3a2007-05-15 03:13:172275--no-commit-id
2276</dt>
2277<dd>
2278<p>
Junio C Hamano1aa40d22010-01-21 17:46:432279 <em>git diff-tree</em> outputs a line with the commit ID when
Junio C Hamano0430e3a2007-05-15 03:13:172280 applicable. This flag suppressed the commit ID output.
2281</p>
2282</dd>
Junio C Hamano68cf15a2010-11-06 01:01:592283<dt class="hdlist1">
Junio C Hamano0430e3a2007-05-15 03:13:172284-c
2285</dt>
2286<dd>
2287<p>
2288 This flag changes the way a merge commit is displayed
2289 (which means it is useful only when the command is given
Junio C Hamano92d80372016-07-13 22:00:052290 one &lt;tree-ish&gt;, or <code>--stdin</code>). It shows the differences
Junio C Hamano0430e3a2007-05-15 03:13:172291 from each of the parents to the merge result simultaneously
2292 instead of showing pairwise diff between a parent and the
Junio C Hamano92d80372016-07-13 22:00:052293 result one at a time (which is what the <code>-m</code> option does).
Junio C Hamano0430e3a2007-05-15 03:13:172294 Furthermore, it lists only files which were modified
2295 from all parents.
2296</p>
2297</dd>
Junio C Hamano68cf15a2010-11-06 01:01:592298<dt class="hdlist1">
Junio C Hamano0430e3a2007-05-15 03:13:172299--cc
2300</dt>
2301<dd>
2302<p>
2303 This flag changes the way a merge commit patch is displayed,
Junio C Hamano92d80372016-07-13 22:00:052304 in a similar way to the <code>-c</code> option. It implies the <code>-c</code>
2305 and <code>-p</code> options and further compresses the patch output
Junio C Hamanoccc2f762008-07-24 04:03:332306 by omitting uninteresting hunks whose the contents in the parents
2307 have only two variants and the merge result picks one of them
2308 without modification. When all hunks are uninteresting, the commit
2309 itself and the commit log message is not shown, just like in any other
2310 "empty diff" case.
Junio C Hamano0430e3a2007-05-15 03:13:172311</p>
2312</dd>
Junio C Hamano68cf15a2010-11-06 01:01:592313<dt class="hdlist1">
Junio C Hamano11f15372019-03-07 03:17:002314--combined-all-paths
2315</dt>
2316<dd>
2317<p>
2318 This flag causes combined diffs (used for merge commits) to
2319 list the name of the file from all parents. It thus only has
2320 effect when -c or --cc are specified, and is likely only
2321 useful if filename changes are detected (i.e. when either
2322 rename or copy detection have been requested).
2323</p>
2324</dd>
2325<dt class="hdlist1">
Junio C Hamano0430e3a2007-05-15 03:13:172326--always
2327</dt>
2328<dd>
2329<p>
2330 Show the commit itself and the commit log message even
2331 if the diff itself is empty.
2332</p>
2333</dd>
Junio C Hamanoba4b9282008-07-06 05:20:312334</dl></div>
Junio C Hamano0430e3a2007-05-15 03:13:172335</div>
Junio C Hamano9629d4f2012-12-19 00:28:272336</div>
2337<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:312338<h2 id="_pretty_formats">PRETTY FORMATS</h2>
Junio C Hamano0430e3a2007-05-15 03:13:172339<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:592340<div class="paragraph"><p>If the commit is a merge, and if the pretty-format
Junio C Hamano0430e3a2007-05-15 03:13:172341is not <em>oneline</em>, <em>email</em> or <em>raw</em>, an additional line is
2342inserted before the <em>Author:</em> line. This line begins with
Junio C Hamanob4896852019-12-10 23:15:092343"Merge: " and the hashes of ancestral commits are printed,
Junio C Hamano0430e3a2007-05-15 03:13:172344separated by spaces. Note that the listed commits may not
2345necessarily be the list of the <strong>direct</strong> parent commits if you
2346have limited your view of history: for example, if you are
2347only interested in changes related to a certain directory or
Junio C Hamanoba4b9282008-07-06 05:20:312348file.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592349<div class="paragraph"><p>There are several built-in formats, and you can define
Junio C Hamanoa574a092010-06-13 19:57:102350additional formats by setting a pretty.&lt;name&gt;
2351config option to either another format name, or a
2352<em>format:</em> string, as described below (see
Junio C Hamanoa28a9202012-06-21 07:08:232353<a href="git-config.html">git-config(1)</a>). Here are the details of the
Junio C Hamanoa574a092010-06-13 19:57:102354built-in formats:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592355<div class="ulist"><ul>
Junio C Hamanoa340aaa2006-11-23 02:47:332356<li>
2357<p>
2358<em>oneline</em>
2359</p>
2360<div class="literalblock">
2361<div class="content">
Junio C Hamanob4896852019-12-10 23:15:092362<pre><code>&lt;hash&gt; &lt;title line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332363</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592364<div class="paragraph"><p>This is designed to be as compact as possible.</p></div>
Junio C Hamanoa340aaa2006-11-23 02:47:332365</li>
2366<li>
2367<p>
2368<em>short</em>
2369</p>
2370<div class="literalblock">
2371<div class="content">
Junio C Hamanob4896852019-12-10 23:15:092372<pre><code>commit &lt;hash&gt;
Junio C Hamanoac12f0e2014-09-19 22:32:512373Author: &lt;author&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332374</div></div>
2375<div class="literalblock">
2376<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512377<pre><code>&lt;title line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332378</div></div>
2379</li>
2380<li>
2381<p>
2382<em>medium</em>
2383</p>
2384<div class="literalblock">
2385<div class="content">
Junio C Hamanob4896852019-12-10 23:15:092386<pre><code>commit &lt;hash&gt;
Junio C Hamanoa340aaa2006-11-23 02:47:332387Author: &lt;author&gt;
Junio C Hamanoac12f0e2014-09-19 22:32:512388Date: &lt;author date&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332389</div></div>
2390<div class="literalblock">
2391<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512392<pre><code>&lt;title line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332393</div></div>
2394<div class="literalblock">
2395<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512396<pre><code>&lt;full commit message&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332397</div></div>
2398</li>
2399<li>
2400<p>
2401<em>full</em>
2402</p>
2403<div class="literalblock">
2404<div class="content">
Junio C Hamanob4896852019-12-10 23:15:092405<pre><code>commit &lt;hash&gt;
Junio C Hamanoa340aaa2006-11-23 02:47:332406Author: &lt;author&gt;
Junio C Hamanoac12f0e2014-09-19 22:32:512407Commit: &lt;committer&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332408</div></div>
2409<div class="literalblock">
2410<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512411<pre><code>&lt;title line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332412</div></div>
2413<div class="literalblock">
2414<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512415<pre><code>&lt;full commit message&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332416</div></div>
2417</li>
2418<li>
2419<p>
2420<em>fuller</em>
2421</p>
2422<div class="literalblock">
2423<div class="content">
Junio C Hamanob4896852019-12-10 23:15:092424<pre><code>commit &lt;hash&gt;
Junio C Hamano6a3c8272008-12-19 21:38:182425Author: &lt;author&gt;
Junio C Hamanoba4b9282008-07-06 05:20:312426AuthorDate: &lt;author date&gt;
Junio C Hamano6a3c8272008-12-19 21:38:182427Commit: &lt;committer&gt;
Junio C Hamanoac12f0e2014-09-19 22:32:512428CommitDate: &lt;committer date&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332429</div></div>
2430<div class="literalblock">
2431<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512432<pre><code>&lt;title line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332433</div></div>
2434<div class="literalblock">
2435<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512436<pre><code>&lt;full commit message&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332437</div></div>
2438</li>
2439<li>
2440<p>
Junio C Hamanob4896852019-12-10 23:15:092441<em>reference</em>
2442</p>
2443<div class="literalblock">
2444<div class="content">
2445<pre><code>&lt;abbrev hash&gt; (&lt;title line&gt;, &lt;short author date&gt;)</code></pre>
2446</div></div>
2447<div class="paragraph"><p>This format is used to refer to another commit in a commit message and
2448is the same as <code>--pretty='format:%C(auto)%h (%s, %ad)'</code>. By default,
2449the date is formatted with <code>--date=short</code> unless another <code>--date</code> option
2450is explicitly specified. As with any <code>format:</code> with format
2451placeholders, its output is not affected by other options like
2452<code>--decorate</code> and <code>--walk-reflogs</code>.</p></div>
2453</li>
2454<li>
2455<p>
Junio C Hamanoa340aaa2006-11-23 02:47:332456<em>email</em>
2457</p>
2458<div class="literalblock">
2459<div class="content">
Junio C Hamanob4896852019-12-10 23:15:092460<pre><code>From &lt;hash&gt; &lt;date&gt;
Junio C Hamanoa340aaa2006-11-23 02:47:332461From: &lt;author&gt;
Junio C Hamanoba4b9282008-07-06 05:20:312462Date: &lt;author date&gt;
Junio C Hamanoac12f0e2014-09-19 22:32:512463Subject: [PATCH] &lt;title line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332464</div></div>
2465<div class="literalblock">
2466<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512467<pre><code>&lt;full commit message&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332468</div></div>
2469</li>
2470<li>
2471<p>
Junio C Hamano0dd50942020-04-29 21:21:052472<em>mboxrd</em>
2473</p>
2474<div class="paragraph"><p>Like <em>email</em>, but lines in the commit message starting with "From "
2475(preceded by zero or more "&gt;") are quoted with "&gt;" so they aren&#8217;t
2476confused as starting a new commit.</p></div>
2477</li>
2478<li>
2479<p>
Junio C Hamanoa340aaa2006-11-23 02:47:332480<em>raw</em>
2481</p>
Junio C Hamano68cf15a2010-11-06 01:01:592482<div class="paragraph"><p>The <em>raw</em> format shows the entire commit exactly as
Junio C Hamanob4896852019-12-10 23:15:092483stored in the commit object. Notably, the hashes are
Junio C Hamanoa340aaa2006-11-23 02:47:332484displayed in full, regardless of whether --abbrev or
2485--no-abbrev are used, and <em>parents</em> information show the
Junio C Hamanod75148a2014-04-08 19:48:382486true parent commits, without taking grafts or history
Junio C Hamano85f1fde2015-06-01 20:37:322487simplification into account. Note that this format affects the way
2488commits are displayed, but not the way the diff is shown e.g. with
2489<code>git log --raw</code>. To get full object names in a raw diff format,
2490use <code>--no-abbrev</code>.</p></div>
Junio C Hamanoa340aaa2006-11-23 02:47:332491</li>
Junio C Hamanoa3fd83c2007-03-02 10:34:362492<li>
2493<p>
Junio C Hamanoe32ec8b2010-06-02 23:32:312494<em>format:&lt;string&gt;</em>
Junio C Hamanoa3fd83c2007-03-02 10:34:362495</p>
Junio C Hamano68cf15a2010-11-06 01:01:592496<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:362497you want to show. It works a little bit like printf format,
2498with the notable exception that you get a newline with <em>%n</em>
Junio C Hamanoba4b9282008-07-06 05:20:312499instead of <em>\n</em>.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592500<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:312501would show something like this:</p></div>
Junio C Hamano0430e3a2007-05-15 03:13:172502<div class="listingblock">
2503<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512504<pre><code>The author of fe6e0ee was Junio C Hamano, 23 hours ago
2505The 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:172506</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592507<div class="paragraph"><p>The placeholders are:</p></div>
2508<div class="ulist"><ul>
Junio C Hamanoa3fd83c2007-03-02 10:34:362509<li>
2510<p>
Junio C Hamano11f15372019-03-07 03:17:002511Placeholders that expand to a single literal character:
2512</p>
2513<div class="dlist"><dl>
2514<dt class="hdlist1">
2515<em>%n</em>
2516</dt>
2517<dd>
2518<p>
2519newline
2520</p>
2521</dd>
2522<dt class="hdlist1">
2523<em>%%</em>
2524</dt>
2525<dd>
2526<p>
2527a raw <em>%</em>
2528</p>
2529</dd>
2530<dt class="hdlist1">
2531<em>%x00</em>
2532</dt>
2533<dd>
2534<p>
2535print a byte from a hex code
2536</p>
2537</dd>
2538</dl></div>
2539</li>
2540<li>
2541<p>
2542Placeholders that affect formatting of later placeholders:
2543</p>
2544<div class="dlist"><dl>
2545<dt class="hdlist1">
2546<em>%Cred</em>
2547</dt>
2548<dd>
2549<p>
2550switch color to red
2551</p>
2552</dd>
2553<dt class="hdlist1">
2554<em>%Cgreen</em>
2555</dt>
2556<dd>
2557<p>
2558switch color to green
2559</p>
2560</dd>
2561<dt class="hdlist1">
2562<em>%Cblue</em>
2563</dt>
2564<dd>
2565<p>
2566switch color to blue
2567</p>
2568</dd>
2569<dt class="hdlist1">
2570<em>%Creset</em>
2571</dt>
2572<dd>
2573<p>
2574reset color
2575</p>
2576</dd>
2577<dt class="hdlist1">
2578<em>%C(&#8230;)</em>
2579</dt>
2580<dd>
2581<p>
2582color specification, as described under Values in the
2583 "CONFIGURATION FILE" section of <a href="git-config.html">git-config(1)</a>. By
2584 default, colors are shown only when enabled for log output
2585 (by <code>color.diff</code>, <code>color.ui</code>, or <code>--color</code>, and respecting
2586 the <code>auto</code> settings of the former if we are going to a
2587 terminal). <code>%C(auto,...)</code> is accepted as a historical
2588 synonym for the default (e.g., <code>%C(auto,red)</code>). Specifying
2589 <code>%C(always,...)</code> will show the colors even when color is
2590 not otherwise enabled (though consider just using
2591 <code>--color=always</code> to enable color for the whole output,
2592 including this format and anything else git might color).
2593 <code>auto</code> alone (i.e. <code>%C(auto)</code>) will turn on auto coloring
2594 on the next placeholders until the color is switched
2595 again.
2596</p>
2597</dd>
2598<dt class="hdlist1">
2599<em>%m</em>
2600</dt>
2601<dd>
2602<p>
2603left (<code>&lt;</code>), right (<code>&gt;</code>) or boundary (<code>-</code>) mark
2604</p>
2605</dd>
2606<dt class="hdlist1">
2607<em>%w([&lt;w&gt;[,&lt;i1&gt;[,&lt;i2&gt;]]])</em>
2608</dt>
2609<dd>
2610<p>
2611switch line wrapping, like the -w option of
2612 <a href="git-shortlog.html">git-shortlog(1)</a>.
2613</p>
2614</dd>
2615<dt class="hdlist1">
2616<em>%&lt;(&lt;N&gt;[,trunc|ltrunc|mtrunc])</em>
2617</dt>
2618<dd>
2619<p>
2620make the next placeholder take at
2621 least N columns, padding spaces on
2622 the right if necessary. Optionally
2623 truncate at the beginning (ltrunc),
2624 the middle (mtrunc) or the end
2625 (trunc) if the output is longer than
2626 N columns. Note that truncating
2627 only works correctly with N &gt;= 2.
2628</p>
2629</dd>
2630<dt class="hdlist1">
2631<em>%&lt;|(&lt;N&gt;)</em>
2632</dt>
2633<dd>
2634<p>
2635make the next placeholder take at least until Nth
2636 columns, padding spaces on the right if necessary
2637</p>
2638</dd>
2639<dt class="hdlist1">
2640<em>%&gt;(&lt;N&gt;)</em>, <em>%&gt;|(&lt;N&gt;)</em>
2641</dt>
2642<dd>
2643<p>
2644similar to <em>%&lt;(&lt;N&gt;)</em>, <em>%&lt;|(&lt;N&gt;)</em> respectively,
2645 but padding spaces on the left
2646</p>
2647</dd>
2648<dt class="hdlist1">
2649<em>%&gt;&gt;(&lt;N&gt;)</em>, <em>%&gt;&gt;|(&lt;N&gt;)</em>
2650</dt>
2651<dd>
2652<p>
2653similar to <em>%&gt;(&lt;N&gt;)</em>, <em>%&gt;|(&lt;N&gt;)</em>
2654 respectively, except that if the next
2655 placeholder takes more spaces than given and
2656 there are spaces on its left, use those
2657 spaces
2658</p>
2659</dd>
2660<dt class="hdlist1">
2661<em>%&gt;&lt;(&lt;N&gt;)</em>, <em>%&gt;&lt;|(&lt;N&gt;)</em>
2662</dt>
2663<dd>
2664<p>
2665similar to <em>%&lt;(&lt;N&gt;)</em>, <em>%&lt;|(&lt;N&gt;)</em>
2666 respectively, but padding both sides
2667 (i.e. the text is centered)
2668</p>
2669</dd>
2670</dl></div>
2671</li>
2672<li>
2673<p>
2674Placeholders that expand to information extracted from the commit:
2675</p>
2676<div class="dlist"><dl>
2677<dt class="hdlist1">
2678<em>%H</em>
2679</dt>
2680<dd>
2681<p>
2682commit hash
2683</p>
2684</dd>
2685<dt class="hdlist1">
2686<em>%h</em>
2687</dt>
2688<dd>
2689<p>
2690abbreviated commit hash
2691</p>
2692</dd>
2693<dt class="hdlist1">
2694<em>%T</em>
2695</dt>
2696<dd>
2697<p>
2698tree hash
2699</p>
2700</dd>
2701<dt class="hdlist1">
2702<em>%t</em>
2703</dt>
2704<dd>
2705<p>
2706abbreviated tree hash
2707</p>
2708</dd>
2709<dt class="hdlist1">
2710<em>%P</em>
2711</dt>
2712<dd>
2713<p>
2714parent hashes
2715</p>
2716</dd>
2717<dt class="hdlist1">
2718<em>%p</em>
2719</dt>
2720<dd>
2721<p>
2722abbreviated parent hashes
2723</p>
2724</dd>
2725<dt class="hdlist1">
2726<em>%an</em>
2727</dt>
2728<dd>
2729<p>
2730author name
2731</p>
2732</dd>
2733<dt class="hdlist1">
2734<em>%aN</em>
2735</dt>
2736<dd>
2737<p>
2738author name (respecting .mailmap, see <a href="git-shortlog.html">git-shortlog(1)</a>
2739 or <a href="git-blame.html">git-blame(1)</a>)
2740</p>
2741</dd>
2742<dt class="hdlist1">
2743<em>%ae</em>
2744</dt>
2745<dd>
2746<p>
2747author email
2748</p>
2749</dd>
2750<dt class="hdlist1">
2751<em>%aE</em>
2752</dt>
2753<dd>
2754<p>
2755author email (respecting .mailmap, see <a href="git-shortlog.html">git-shortlog(1)</a>
2756 or <a href="git-blame.html">git-blame(1)</a>)
2757</p>
2758</dd>
2759<dt class="hdlist1">
Junio C Hamano8ac8a3d2019-11-11 04:33:462760<em>%al</em>
2761</dt>
2762<dd>
2763<p>
2764author email local-part (the part before the <em>@</em> sign)
2765</p>
2766</dd>
2767<dt class="hdlist1">
2768<em>%aL</em>
2769</dt>
2770<dd>
2771<p>
2772author local-part (see <em>%al</em>) respecting .mailmap, see
2773 <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)
2774</p>
2775</dd>
2776<dt class="hdlist1">
Junio C Hamano11f15372019-03-07 03:17:002777<em>%ad</em>
2778</dt>
2779<dd>
2780<p>
2781author date (format respects --date= option)
2782</p>
2783</dd>
2784<dt class="hdlist1">
2785<em>%aD</em>
2786</dt>
2787<dd>
2788<p>
2789author date, RFC2822 style
2790</p>
2791</dd>
2792<dt class="hdlist1">
2793<em>%ar</em>
2794</dt>
2795<dd>
2796<p>
2797author date, relative
2798</p>
2799</dd>
2800<dt class="hdlist1">
2801<em>%at</em>
2802</dt>
2803<dd>
2804<p>
2805author date, UNIX timestamp
2806</p>
2807</dd>
2808<dt class="hdlist1">
2809<em>%ai</em>
2810</dt>
2811<dd>
2812<p>
2813author date, ISO 8601-like format
2814</p>
2815</dd>
2816<dt class="hdlist1">
2817<em>%aI</em>
2818</dt>
2819<dd>
2820<p>
2821author date, strict ISO 8601 format
2822</p>
2823</dd>
2824<dt class="hdlist1">
Junio C Hamanob4896852019-12-10 23:15:092825<em>%as</em>
2826</dt>
2827<dd>
2828<p>
2829author date, short format (<code>YYYY-MM-DD</code>)
2830</p>
2831</dd>
2832<dt class="hdlist1">
Junio C Hamano11f15372019-03-07 03:17:002833<em>%cn</em>
2834</dt>
2835<dd>
2836<p>
2837committer name
2838</p>
2839</dd>
2840<dt class="hdlist1">
2841<em>%cN</em>
2842</dt>
2843<dd>
2844<p>
2845committer name (respecting .mailmap, see
2846 <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)
2847</p>
2848</dd>
2849<dt class="hdlist1">
2850<em>%ce</em>
2851</dt>
2852<dd>
2853<p>
2854committer email
2855</p>
2856</dd>
2857<dt class="hdlist1">
2858<em>%cE</em>
2859</dt>
2860<dd>
2861<p>
2862committer email (respecting .mailmap, see
2863 <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)
2864</p>
2865</dd>
2866<dt class="hdlist1">
Junio C Hamano8ac8a3d2019-11-11 04:33:462867<em>%cl</em>
2868</dt>
2869<dd>
2870<p>
Junio C Hamanoa8911782020-07-07 05:35:572871committer email local-part (the part before the <em>@</em> sign)
Junio C Hamano8ac8a3d2019-11-11 04:33:462872</p>
2873</dd>
2874<dt class="hdlist1">
2875<em>%cL</em>
2876</dt>
2877<dd>
2878<p>
Junio C Hamanoa8911782020-07-07 05:35:572879committer local-part (see <em>%cl</em>) respecting .mailmap, see
Junio C Hamano8ac8a3d2019-11-11 04:33:462880 <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)
2881</p>
2882</dd>
2883<dt class="hdlist1">
Junio C Hamano11f15372019-03-07 03:17:002884<em>%cd</em>
2885</dt>
2886<dd>
2887<p>
2888committer date (format respects --date= option)
2889</p>
2890</dd>
2891<dt class="hdlist1">
2892<em>%cD</em>
2893</dt>
2894<dd>
2895<p>
2896committer date, RFC2822 style
2897</p>
2898</dd>
2899<dt class="hdlist1">
2900<em>%cr</em>
2901</dt>
2902<dd>
2903<p>
2904committer date, relative
2905</p>
2906</dd>
2907<dt class="hdlist1">
2908<em>%ct</em>
2909</dt>
2910<dd>
2911<p>
2912committer date, UNIX timestamp
2913</p>
2914</dd>
2915<dt class="hdlist1">
2916<em>%ci</em>
2917</dt>
2918<dd>
2919<p>
2920committer date, ISO 8601-like format
2921</p>
2922</dd>
2923<dt class="hdlist1">
2924<em>%cI</em>
2925</dt>
2926<dd>
2927<p>
2928committer date, strict ISO 8601 format
2929</p>
2930</dd>
2931<dt class="hdlist1">
Junio C Hamanob4896852019-12-10 23:15:092932<em>%cs</em>
2933</dt>
2934<dd>
2935<p>
2936committer date, short format (<code>YYYY-MM-DD</code>)
2937</p>
2938</dd>
2939<dt class="hdlist1">
Junio C Hamano11f15372019-03-07 03:17:002940<em>%d</em>
2941</dt>
2942<dd>
2943<p>
2944ref names, like the --decorate option of <a href="git-log.html">git-log(1)</a>
2945</p>
2946</dd>
2947<dt class="hdlist1">
2948<em>%D</em>
2949</dt>
2950<dd>
2951<p>
2952ref names without the " (", ")" wrapping.
2953</p>
2954</dd>
2955<dt class="hdlist1">
2956<em>%S</em>
2957</dt>
2958<dd>
2959<p>
2960ref name given on the command line by which the commit was reached
2961 (like <code>git log --source</code>), only works with <code>git log</code>
2962</p>
2963</dd>
2964<dt class="hdlist1">
2965<em>%e</em>
2966</dt>
2967<dd>
2968<p>
2969encoding
2970</p>
2971</dd>
2972<dt class="hdlist1">
2973<em>%s</em>
2974</dt>
2975<dd>
2976<p>
2977subject
2978</p>
2979</dd>
2980<dt class="hdlist1">
2981<em>%f</em>
2982</dt>
2983<dd>
2984<p>
2985sanitized subject line, suitable for a filename
2986</p>
2987</dd>
2988<dt class="hdlist1">
2989<em>%b</em>
2990</dt>
2991<dd>
2992<p>
2993body
2994</p>
2995</dd>
2996<dt class="hdlist1">
2997<em>%B</em>
2998</dt>
2999<dd>
3000<p>
3001raw body (unwrapped subject and body)
3002</p>
3003</dd>
3004<dt class="hdlist1">
3005<em>%N</em>
3006</dt>
3007<dd>
3008<p>
3009commit notes
3010</p>
3011</dd>
3012<dt class="hdlist1">
3013<em>%GG</em>
3014</dt>
3015<dd>
3016<p>
3017raw verification message from GPG for a signed commit
3018</p>
3019</dd>
3020<dt class="hdlist1">
3021<em>%G?</em>
3022</dt>
3023<dd>
3024<p>
3025show "G" for a good (valid) signature,
3026 "B" for a bad signature,
3027 "U" for a good signature with unknown validity,
3028 "X" for a good signature that has expired,
3029 "Y" for a good signature made by an expired key,
3030 "R" for a good signature made by a revoked key,
3031 "E" if the signature cannot be checked (e.g. missing key)
3032 and "N" for no signature
3033</p>
3034</dd>
3035<dt class="hdlist1">
3036<em>%GS</em>
3037</dt>
3038<dd>
3039<p>
3040show the name of the signer for a signed commit
3041</p>
3042</dd>
3043<dt class="hdlist1">
3044<em>%GK</em>
3045</dt>
3046<dd>
3047<p>
3048show the key used to sign a signed commit
3049</p>
3050</dd>
3051<dt class="hdlist1">
3052<em>%GF</em>
3053</dt>
3054<dd>
3055<p>
3056show the fingerprint of the key used to sign a signed commit
3057</p>
3058</dd>
3059<dt class="hdlist1">
3060<em>%GP</em>
3061</dt>
3062<dd>
3063<p>
3064show the fingerprint of the primary key whose subkey was used
3065 to sign a signed commit
3066</p>
3067</dd>
3068<dt class="hdlist1">
Junio C Hamanobee061d2020-01-30 23:21:183069<em>%GT</em>
3070</dt>
3071<dd>
3072<p>
3073show the trust level for the key used to sign a signed commit
3074</p>
3075</dd>
3076<dt class="hdlist1">
Junio C Hamano11f15372019-03-07 03:17:003077<em>%gD</em>
3078</dt>
3079<dd>
3080<p>
3081reflog selector, e.g., <code>refs/stash@{1}</code> or <code>refs/stash@{2
Junio C Hamano48cd3f12019-10-09 05:55:303082 minutes ago}</code>; the format follows the rules described for the
Junio C Hamano11f15372019-03-07 03:17:003083 <code>-g</code> option. The portion before the <code>@</code> is the refname as
3084 given on the command line (so <code>git log -g refs/heads/master</code>
3085 would yield <code>refs/heads/master@{0}</code>).
3086</p>
3087</dd>
3088<dt class="hdlist1">
3089<em>%gd</em>
3090</dt>
3091<dd>
3092<p>
3093shortened reflog selector; same as <code>%gD</code>, but the refname
3094 portion is shortened for human readability (so
3095 <code>refs/heads/master</code> becomes just <code>master</code>).
3096</p>
3097</dd>
3098<dt class="hdlist1">
3099<em>%gn</em>
3100</dt>
3101<dd>
3102<p>
3103reflog identity name
3104</p>
3105</dd>
3106<dt class="hdlist1">
3107<em>%gN</em>
3108</dt>
3109<dd>
3110<p>
3111reflog identity name (respecting .mailmap, see
3112 <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)
3113</p>
3114</dd>
3115<dt class="hdlist1">
3116<em>%ge</em>
3117</dt>
3118<dd>
3119<p>
3120reflog identity email
3121</p>
3122</dd>
3123<dt class="hdlist1">
3124<em>%gE</em>
3125</dt>
3126<dd>
3127<p>
3128reflog identity email (respecting .mailmap, see
3129 <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)
3130</p>
3131</dd>
3132<dt class="hdlist1">
3133<em>%gs</em>
3134</dt>
3135<dd>
3136<p>
3137reflog subject
3138</p>
3139</dd>
3140<dt class="hdlist1">
3141<em>%(trailers[:options])</em>
3142</dt>
3143<dd>
3144<p>
3145display the trailers of the body as
3146 interpreted by
3147 <a href="git-interpret-trailers.html">git-interpret-trailers(1)</a>. The
3148 <code>trailers</code> string may be followed by a colon
Junio C Hamano674f3e12021-01-07 08:42:493149 and zero or more comma-separated options.
3150 If any option is provided multiple times the
3151 last occurance wins.
Junio C Hamano11f15372019-03-07 03:17:003152</p>
Junio C Hamano674f3e12021-01-07 08:42:493153<div class="paragraph"><p>The boolean options accept an optional value <code>[=&lt;BOOL&gt;]</code>. The values
3154<code>true</code>, <code>false</code>, <code>on</code>, <code>off</code> etc. are all accepted. See the "boolean"
3155sub-section in "EXAMPLES" in <a href="git-config.html">git-config(1)</a>. If a boolean
3156option is given with no value, it&#8217;s enabled.</p></div>
Junio C Hamano11f15372019-03-07 03:17:003157<div class="ulist"><ul>
3158<li>
3159<p>
3160<em>key=&lt;K&gt;</em>: only show trailers with specified key. Matching is done
3161 case-insensitively and trailing colon is optional. If option is
3162 given multiple times trailer lines matching any of the keys are
3163 shown. This option automatically enables the <code>only</code> option so that
3164 non-trailer lines in the trailer block are hidden. If that is not
3165 desired it can be disabled with <code>only=false</code>. E.g.,
3166 <code>%(trailers:key=Reviewed-by)</code> shows trailer lines with key
3167 <code>Reviewed-by</code>.
Junio C Hamanoa3fd83c2007-03-02 10:34:363168</p>
3169</li>
3170<li>
3171<p>
Junio C Hamano674f3e12021-01-07 08:42:493172<em>only[=&lt;BOOL&gt;]</em>: select whether non-trailer lines from the trailer
3173 block should be included.
Junio C Hamanoa3fd83c2007-03-02 10:34:363174</p>
3175</li>
3176<li>
3177<p>
Junio C Hamano11f15372019-03-07 03:17:003178<em>separator=&lt;SEP&gt;</em>: specify a separator inserted between trailer
3179 lines. When this option is not given each trailer line is
3180 terminated with a line feed character. The string SEP may contain
3181 the literal formatting codes described above. To use comma as
3182 separator one must use <code>%x2C</code> as it would otherwise be parsed as
Junio C Hamano674f3e12021-01-07 08:42:493183 next option. E.g., <code>%(trailers:key=Ticket,separator=%x2C )</code>
Junio C Hamano11f15372019-03-07 03:17:003184 shows all trailer lines whose key is "Ticket" separated by a comma
3185 and a space.
Junio C Hamanoa3fd83c2007-03-02 10:34:363186</p>
3187</li>
3188<li>
3189<p>
Junio C Hamano674f3e12021-01-07 08:42:493190<em>unfold[=&lt;BOOL&gt;]</em>: make it behave as if interpret-trailer&#8217;s <code>--unfold</code>
3191 option was given. E.g.,
Junio C Hamano11f15372019-03-07 03:17:003192 <code>%(trailers:only,unfold=true)</code> unfolds and shows all trailer lines.
Junio C Hamanoa3fd83c2007-03-02 10:34:363193</p>
3194</li>
3195<li>
3196<p>
Junio C Hamano674f3e12021-01-07 08:42:493197<em>keyonly[=&lt;BOOL&gt;]</em>: only show the key part of the trailer.
3198</p>
3199</li>
3200<li>
3201<p>
3202<em>valueonly[=&lt;BOOL&gt;]</em>: only show the value part of the trailer.
3203</p>
3204</li>
3205<li>
3206<p>
3207<em>key_value_separator=&lt;SEP&gt;</em>: specify a separator inserted between
3208 trailer lines. When this option is not given each trailer key-value
3209 pair is separated by ": ". Otherwise it shares the same semantics
3210 as <em>separator=&lt;SEP&gt;</em> above.
Junio C Hamanoa3fd83c2007-03-02 10:34:363211</p>
3212</li>
Junio C Hamano11f15372019-03-07 03:17:003213</ul></div>
3214</dd>
3215</dl></div>
Junio C Hamano04e768d2013-04-23 19:19:263216</li>
Junio C Hamanoba4b9282008-07-06 05:20:313217</ul></div>
Junio C Hamanoa3fd83c2007-03-02 10:34:363218</li>
Junio C Hamanoc21ab052009-10-31 04:03:553219</ul></div>
3220<div class="admonitionblock">
3221<table><tr>
3222<td class="icon">
3223<div class="title">Note</div>
3224</td>
3225<td class="content">Some placeholders may depend on other options given to the
Junio C Hamanoac12f0e2014-09-19 22:32:513226revision traversal engine. For example, the <code>%g*</code> reflog options will
Junio C Hamanoc21ab052009-10-31 04:03:553227insert an empty string unless we are traversing reflog entries (e.g., by
Junio C Hamano00b9f1a2014-09-29 23:11:283228<code>git log -g</code>). The <code>%d</code> and <code>%D</code> placeholders will use the "short"
3229decoration format if <code>--decorate</code> was not already provided on the command
3230line.</td>
Junio C Hamanoc21ab052009-10-31 04:03:553231</tr></table>
3232</div>
Junio C Hamanoac12f0e2014-09-19 22:32:513233<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:593234is inserted immediately before the expansion if and only if the
3235placeholder expands to a non-empty string.</p></div>
Junio C Hamano535c65c2017-06-24 22:51:583236<div class="paragraph"><p>If you add a <code>-</code> (minus sign) after <em>%</em> of a placeholder, all consecutive
3237line-feeds immediately preceding the expansion are deleted if and only if the
Junio C Hamano2bd8a742009-12-01 21:16:593238placeholder expands to an empty string.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:593239<div class="paragraph"><p>If you add a ` ` (space) after <em>%</em> of a placeholder, a space
Junio C Hamano89a57342010-06-22 23:22:553240is inserted immediately before the expansion if and only if the
3241placeholder expands to a non-empty string.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:593242<div class="ulist"><ul>
Junio C Hamano6fb124c2008-06-13 10:04:013243<li>
3244<p>
3245<em>tformat:</em>
3246</p>
Junio C Hamano68cf15a2010-11-06 01:01:593247<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:013248provides "terminator" semantics instead of "separator" semantics. In
3249other words, each commit has the message terminator character (usually a
3250newline) appended, rather than a separator placed between entries.
3251This means that the final entry of a single-line format will be properly
3252terminated with a new line, just as the "oneline" format does.
Junio C Hamanoba4b9282008-07-06 05:20:313253For example:</p></div>
Junio C Hamano6fb124c2008-06-13 10:04:013254<div class="listingblock">
3255<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:513256<pre><code>$ git log -2 --pretty=format:%h 4da45bef \
Junio C Hamano6fb124c2008-06-13 10:04:013257 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
32584da45be
32597134973 -- NO NEWLINE
3260
3261$ git log -2 --pretty=tformat:%h 4da45bef \
3262 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
32634da45be
Junio C Hamanoac12f0e2014-09-19 22:32:5132647134973</code></pre>
Junio C Hamano6fb124c2008-06-13 10:04:013265</div></div>
Junio C Hamanoac12f0e2014-09-19 22:32:513266<div class="paragraph"><p>In addition, any unrecognized string that has a <code>%</code> in it is interpreted
3267as if it has <code>tformat:</code> in front of it. For example, these two are
Junio C Hamano0a235222009-03-06 08:21:093268equivalent:</p></div>
3269<div class="listingblock">
3270<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:513271<pre><code>$ git log -2 --pretty=tformat:%h 4da45bef
3272$ git log -2 --pretty=%h 4da45bef</code></pre>
Junio C Hamano0a235222009-03-06 08:21:093273</div></div>
Junio C Hamano6fb124c2008-06-13 10:04:013274</li>
Junio C Hamanoba4b9282008-07-06 05:20:313275</ul></div>
Junio C Hamano1a4e8412005-12-27 08:17:233276</div>
Junio C Hamano9629d4f2012-12-19 00:28:273277</div>
3278<div class="sect1">
Junio C Hamano543f8d62009-07-29 08:35:213279<h2 id="_raw_output_format">Raw output format</h2>
Junio C Hamano1a4e8412005-12-27 08:17:233280<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:593281<div class="paragraph"><p>The raw output format from "git-diff-index", "git-diff-tree",
Junio C Hamanoba4b9282008-07-06 05:20:313282"git-diff-files" and "git diff --raw" are very similar.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:593283<div class="paragraph"><p>These commands all compare two sets of things; what is
Junio C Hamanoba4b9282008-07-06 05:20:313284compared differs:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:593285<div class="dlist"><dl>
3286<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:233287git-diff-index &lt;tree-ish&gt;
3288</dt>
3289<dd>
3290<p>
3291 compares the &lt;tree-ish&gt; and the files on the filesystem.
3292</p>
3293</dd>
Junio C Hamano68cf15a2010-11-06 01:01:593294<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:233295git-diff-index --cached &lt;tree-ish&gt;
3296</dt>
3297<dd>
3298<p>
3299 compares the &lt;tree-ish&gt; and the index.
3300</p>
3301</dd>
Junio C Hamano68cf15a2010-11-06 01:01:593302<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:233303git-diff-tree [-r] &lt;tree-ish-1&gt; &lt;tree-ish-2&gt; [&lt;pattern&gt;&#8230;]
3304</dt>
3305<dd>
3306<p>
3307 compares the trees named by the two arguments.
3308</p>
3309</dd>
Junio C Hamano68cf15a2010-11-06 01:01:593310<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:233311git-diff-files [&lt;pattern&gt;&#8230;]
3312</dt>
3313<dd>
3314<p>
3315 compares the index and the files on the filesystem.
3316</p>
3317</dd>
Junio C Hamanoba4b9282008-07-06 05:20:313318</dl></div>
Junio C Hamano68cf15a2010-11-06 01:01:593319<div class="paragraph"><p>The "git-diff-tree" command begins its output by printing the hash of
Junio C Hamano543f8d62009-07-29 08:35:213320what is being compared. After that, all the commands print one output
3321line per changed file.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:593322<div class="paragraph"><p>An output line is formatted this way:</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:233323<div class="listingblock">
3324<div class="content">
Junio C Hamanof2b280b2018-12-01 14:45:013325<pre><code>in-place edit :100644 100644 bcd1234 0123456 M file0
3326copy-edit :100644 100644 abcd123 1234567 C68 file1 file2
3327rename-edit :100644 100644 abcd123 1234567 R86 file1 file3
3328create :000000 100644 0000000 1234567 A file4
3329delete :100644 000000 1234567 0000000 D file5
3330unmerged :000000 000000 0000000 0000000 U file6</code></pre>
Junio C Hamano1a4e8412005-12-27 08:17:233331</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:593332<div class="paragraph"><p>That is, from the left to the right:</p></div>
3333<div class="olist arabic"><ol class="arabic">
Junio C Hamano1a4e8412005-12-27 08:17:233334<li>
3335<p>
3336a colon.
3337</p>
3338</li>
3339<li>
3340<p>
3341mode for "src"; 000000 if creation or unmerged.
3342</p>
3343</li>
3344<li>
3345<p>
3346a space.
3347</p>
3348</li>
3349<li>
3350<p>
3351mode for "dst"; 000000 if deletion or unmerged.
3352</p>
3353</li>
3354<li>
3355<p>
3356a space.
3357</p>
3358</li>
3359<li>
3360<p>
3361sha1 for "src"; 0{40} if creation or unmerged.
3362</p>
3363</li>
3364<li>
3365<p>
3366a space.
3367</p>
3368</li>
3369<li>
3370<p>
3371sha1 for "dst"; 0{40} if creation, unmerged or "look at work tree".
3372</p>
3373</li>
3374<li>
3375<p>
3376a space.
3377</p>
3378</li>
3379<li>
3380<p>
3381status, followed by optional "score" number.
3382</p>
3383</li>
3384<li>
3385<p>
Junio C Hamano92d80372016-07-13 22:00:053386a tab or a NUL when <code>-z</code> option is used.
Junio C Hamano1a4e8412005-12-27 08:17:233387</p>
3388</li>
3389<li>
3390<p>
3391path for "src"
3392</p>
3393</li>
3394<li>
3395<p>
Junio C Hamano92d80372016-07-13 22:00:053396a tab or a NUL when <code>-z</code> option is used; only exists for C or R.
Junio C Hamano1a4e8412005-12-27 08:17:233397</p>
3398</li>
3399<li>
3400<p>
3401path for "dst"; only exists for C or R.
3402</p>
3403</li>
3404<li>
3405<p>
Junio C Hamano92d80372016-07-13 22:00:053406an LF or a NUL when <code>-z</code> option is used, to terminate the record.
Junio C Hamano1a4e8412005-12-27 08:17:233407</p>
3408</li>
Junio C Hamanoba4b9282008-07-06 05:20:313409</ol></div>
Junio C Hamano68cf15a2010-11-06 01:01:593410<div class="paragraph"><p>Possible status letters are:</p></div>
3411<div class="ulist"><ul>
Junio C Hamanoaa17c7c2008-11-03 04:36:583412<li>
3413<p>
3414A: addition of a file
3415</p>
3416</li>
3417<li>
3418<p>
3419C: copy of a file into a new one
3420</p>
3421</li>
3422<li>
3423<p>
3424D: deletion of a file
3425</p>
3426</li>
3427<li>
3428<p>
3429M: modification of the contents or mode of a file
3430</p>
3431</li>
3432<li>
3433<p>
3434R: renaming of a file
3435</p>
3436</li>
3437<li>
3438<p>
3439T: change in the type of the file
3440</p>
3441</li>
3442<li>
3443<p>
3444U: file is unmerged (you must complete the merge before it can
Junio C Hamano2f5a9892019-12-25 21:12:553445 be committed)
Junio C Hamanoaa17c7c2008-11-03 04:36:583446</p>
3447</li>
3448<li>
3449<p>
3450X: "unknown" change type (most probably a bug, please report it)
3451</p>
3452</li>
3453</ul></div>
Junio C Hamano68cf15a2010-11-06 01:01:593454<div class="paragraph"><p>Status letters C and R are always followed by a score (denoting the
Junio C Hamanoaa17c7c2008-11-03 04:36:583455percentage of similarity between the source and target of the move or
Junio C Hamano6bb32e62015-02-17 22:11:263456copy). Status letter M may be followed by a score (denoting the
3457percentage of dissimilarity) for file rewrites.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:593458<div class="paragraph"><p>&lt;sha1&gt; is shown as all 0&#8217;s if a file is new on the filesystem
Junio C Hamanoba4b9282008-07-06 05:20:313459and it is out of sync with the index.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:593460<div class="paragraph"><p>Example:</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:233461<div class="listingblock">
3462<div class="content">
Junio C Hamanof2b280b2018-12-01 14:45:013463<pre><code>:100644 100644 5be4a4a 0000000 M file.c</code></pre>
Junio C Hamano1a4e8412005-12-27 08:17:233464</div></div>
Junio C Hamano0f6f3bf2017-03-13 07:01:533465<div class="paragraph"><p>Without the <code>-z</code> option, pathnames with "unusual" characters are
3466quoted as explained for the configuration variable <code>core.quotePath</code>
3467(see <a href="git-config.html">git-config(1)</a>). Using <code>-z</code> the filename is output
3468verbatim and the line is terminated by a NUL byte.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:233469</div>
Junio C Hamano9629d4f2012-12-19 00:28:273470</div>
3471<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:313472<h2 id="_diff_format_for_merges">diff format for merges</h2>
Junio C Hamano67fad6d2007-05-06 08:53:123473<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:593474<div class="paragraph"><p>"git-diff-tree", "git-diff-files" and "git-diff --raw"
Junio C Hamano92d80372016-07-13 22:00:053475can take <code>-c</code> or <code>--cc</code> option
Junio C Hamano67fad6d2007-05-06 08:53:123476to generate diff output also for merge commits. The output differs
Junio C Hamanoba4b9282008-07-06 05:20:313477from the format described above in the following way:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:593478<div class="olist arabic"><ol class="arabic">
Junio C Hamano67fad6d2007-05-06 08:53:123479<li>
3480<p>
3481there is a colon for each parent
3482</p>
3483</li>
3484<li>
3485<p>
3486there are more "src" modes and "src" sha1
3487</p>
3488</li>
3489<li>
3490<p>
3491status is concatenated status characters for each parent
3492</p>
3493</li>
3494<li>
3495<p>
3496no optional "score" number
3497</p>
3498</li>
3499<li>
3500<p>
Junio C Hamano11f15372019-03-07 03:17:003501tab-separated pathname(s) of the file
Junio C Hamano67fad6d2007-05-06 08:53:123502</p>
3503</li>
Junio C Hamanoba4b9282008-07-06 05:20:313504</ol></div>
Junio C Hamano11f15372019-03-07 03:17:003505<div class="paragraph"><p>For <code>-c</code> and <code>--cc</code>, only the destination or final path is shown even
3506if the file was renamed on any side of history. With
3507<code>--combined-all-paths</code>, the name of the path in each parent is shown
3508followed by the name of the path in the merge commit.</p></div>
3509<div class="paragraph"><p>Examples for <code>-c</code> and <code>--cc</code> without <code>--combined-all-paths</code>:</p></div>
Junio C Hamano67fad6d2007-05-06 08:53:123510<div class="listingblock">
3511<div class="content">
Junio C Hamano11f15372019-03-07 03:17:003512<pre><code>::100644 100644 100644 fabadb8 cc95eb0 4866510 MM desc.c
3513::100755 100755 100755 52b7a2d 6d1ac04 d2ac7d7 RM bar.sh
3514::100644 100644 100644 e07d6c5 9042e82 ee91881 RR phooey.c</code></pre>
3515</div></div>
3516<div class="paragraph"><p>Examples when <code>--combined-all-paths</code> added to either <code>-c</code> or <code>--cc</code>:</p></div>
3517<div class="listingblock">
3518<div class="content">
3519<pre><code>::100644 100644 100644 fabadb8 cc95eb0 4866510 MM desc.c desc.c desc.c
3520::100755 100755 100755 52b7a2d 6d1ac04 d2ac7d7 RM foo.sh bar.sh bar.sh
3521::100644 100644 100644 e07d6c5 9042e82 ee91881 RR fooey.c fuey.c phooey.c</code></pre>
Junio C Hamano67fad6d2007-05-06 08:53:123522</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:593523<div class="paragraph"><p>Note that <em>combined diff</em> lists only files which were modified from
Junio C Hamanoba4b9282008-07-06 05:20:313524all parents.</p></div>
Junio C Hamano67fad6d2007-05-06 08:53:123525</div>
Junio C Hamano9629d4f2012-12-19 00:28:273526</div>
3527<div class="sect1">
Junio C Hamano48cd3f12019-10-09 05:55:303528<h2 id="_generating_patch_text_with_p">Generating patch text with -p</h2>
Junio C Hamano1a4e8412005-12-27 08:17:233529<div class="sectionbody">
Junio C Hamano48cd3f12019-10-09 05:55:303530<div class="paragraph"><p>Running
3531<a href="git-diff.html">git-diff(1)</a>,
3532<a href="git-log.html">git-log(1)</a>,
3533<a href="git-show.html">git-show(1)</a>,
3534<a href="git-diff-index.html">git-diff-index(1)</a>,
3535<a href="git-diff-tree.html">git-diff-tree(1)</a>, or
3536<a href="git-diff-files.html">git-diff-files(1)</a>
3537with the <code>-p</code> option produces patch text.
3538You can customize the creation of patch text via the
Junio C Hamano558abd22020-09-03 20:22:343539<code>GIT_EXTERNAL_DIFF</code> and the <code>GIT_DIFF_OPTS</code> environment variables
3540(see <a href="git.html">git(1)</a>).</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:593541<div class="paragraph"><p>What the -p option produces is slightly different from the traditional
Junio C Hamano7f9fa862010-10-19 23:51:143542diff format:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:593543<div class="olist arabic"><ol class="arabic">
Junio C Hamano1a4e8412005-12-27 08:17:233544<li>
3545<p>
Junio C Hamano7f9fa862010-10-19 23:51:143546It is preceded with a "git diff" header that looks like this:
Junio C Hamano1a4e8412005-12-27 08:17:233547</p>
3548<div class="literalblock">
3549<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:513550<pre><code>diff --git a/file1 b/file2</code></pre>
Junio C Hamano1a4e8412005-12-27 08:17:233551</div></div>
Junio C Hamanoac12f0e2014-09-19 22:32:513552<div class="paragraph"><p>The <code>a/</code> and <code>b/</code> filenames are the same unless rename/copy is
Junio C Hamano1a4e8412005-12-27 08:17:233553involved. Especially, even for a creation or a deletion,
Junio C Hamanoac12f0e2014-09-19 22:32:513554<code>/dev/null</code> is <em>not</em> used in place of the <code>a/</code> or <code>b/</code> filenames.</p></div>
3555<div class="paragraph"><p>When rename/copy is involved, <code>file1</code> and <code>file2</code> show the
Junio C Hamano1a4e8412005-12-27 08:17:233556name of the source file of the rename/copy and the name of
Junio C Hamanoba4b9282008-07-06 05:20:313557the file that rename/copy produces, respectively.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:233558</li>
3559<li>
3560<p>
3561It is followed by one or more extended header lines:
3562</p>
3563<div class="literalblock">
3564<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:513565<pre><code>old mode &lt;mode&gt;
Junio C Hamano1a4e8412005-12-27 08:17:233566new mode &lt;mode&gt;
3567deleted file mode &lt;mode&gt;
3568new file mode &lt;mode&gt;
3569copy from &lt;path&gt;
3570copy to &lt;path&gt;
3571rename from &lt;path&gt;
3572rename to &lt;path&gt;
3573similarity index &lt;number&gt;
3574dissimilarity index &lt;number&gt;
Junio C Hamanoac12f0e2014-09-19 22:32:513575index &lt;hash&gt;..&lt;hash&gt; &lt;mode&gt;</code></pre>
Junio C Hamano1a4e8412005-12-27 08:17:233576</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:593577<div class="paragraph"><p>File modes are printed as 6-digit octal numbers including the file type
Junio C Hamano7f9fa862010-10-19 23:51:143578and file permission bits.</p></div>
Junio C Hamanoac12f0e2014-09-19 22:32:513579<div class="paragraph"><p>Path names in extended headers do not include the <code>a/</code> and <code>b/</code> prefixes.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:593580<div class="paragraph"><p>The similarity index is the percentage of unchanged lines, and
Junio C Hamano7f9fa862010-10-19 23:51:143581the dissimilarity index is the percentage of changed lines. It
3582is a rounded down integer, followed by a percent sign. The
3583similarity index value of 100% is thus reserved for two equal
3584files, while 100% dissimilarity means that no line from the old
3585file made it into the new one.</p></div>
Junio C Hamano48cd3f12019-10-09 05:55:303586<div class="paragraph"><p>The index line includes the blob object names before and after the change.
Junio C Hamano7f9fa862010-10-19 23:51:143587The &lt;mode&gt; is included if the file mode does not change; otherwise,
3588separate lines indicate the old and the new mode.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:233589</li>
3590<li>
3591<p>
Junio C Hamano0f6f3bf2017-03-13 07:01:533592Pathnames with "unusual" characters are quoted as explained for
3593 the configuration variable <code>core.quotePath</code> (see
3594 <a href="git-config.html">git-config(1)</a>).
Junio C Hamano1a4e8412005-12-27 08:17:233595</p>
3596</li>
Junio C Hamano7f9fa862010-10-19 23:51:143597<li>
3598<p>
Junio C Hamanoac12f0e2014-09-19 22:32:513599All the <code>file1</code> files in the output refer to files before the
3600 commit, and all the <code>file2</code> files refer to files after the commit.
Junio C Hamano7f9fa862010-10-19 23:51:143601 It is incorrect to apply each change to each file sequentially. For
3602 example, this patch will swap a and b:
3603</p>
3604<div class="literalblock">
3605<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:513606<pre><code>diff --git a/a b/b
Junio C Hamano7f9fa862010-10-19 23:51:143607rename from a
3608rename to b
3609diff --git a/b b/a
3610rename from b
Junio C Hamanoac12f0e2014-09-19 22:32:513611rename to a</code></pre>
Junio C Hamano7f9fa862010-10-19 23:51:143612</div></div>
3613</li>
Junio C Hamanoba4b9282008-07-06 05:20:313614</ol></div>
Junio C Hamano1a4e8412005-12-27 08:17:233615</div>
Junio C Hamano9629d4f2012-12-19 00:28:273616</div>
3617<div class="sect1">
Junio C Hamano48cd3f12019-10-09 05:55:303618<h2 id="_combined_diff_format">Combined diff format</h2>
Junio C Hamanofb56a962006-01-28 10:38:193619<div class="sectionbody">
Junio C Hamano1dbca522015-05-22 20:48:553620<div class="paragraph"><p>Any diff-generating command can take the <code>-c</code> or <code>--cc</code> option to
Junio C Hamanoc5be4cc2011-03-09 07:20:433621produce a <em>combined diff</em> when showing a merge. This is the default
Junio C Hamanoa28a9202012-06-21 07:08:233622format when showing merges with <a href="git-diff.html">git-diff(1)</a> or
Junio C Hamano8c860d62021-02-06 01:37:473623<a href="git-show.html">git-show(1)</a>. Note also that you can give suitable
3624<code>--diff-merges</code> option to any of these commands to force generation of
3625diffs in specific format.</p></div>
Junio C Hamano48cd3f12019-10-09 05:55:303626<div class="paragraph"><p>A "combined diff" format looks like this:</p></div>
Junio C Hamanofb56a962006-01-28 10:38:193627<div class="listingblock">
3628<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:513629<pre><code>diff --combined describe.c
Junio C Hamano29f14312006-10-26 08:47:293630index fabadb8,cc95eb0..4866510
3631--- a/describe.c
3632+++ b/describe.c
3633@@@ -98,20 -98,12 +98,20 @@@
3634 return (a_date &gt; b_date) ? -1 : (a_date == b_date) ? 0 : 1;
Junio C Hamanofb56a962006-01-28 10:38:193635 }
3636
3637- static void describe(char *arg)
3638 -static void describe(struct commit *cmit, int last_one)
3639++static void describe(char *arg, int last_one)
3640 {
Junio C Hamano29f14312006-10-26 08:47:293641 + unsigned char sha1[20];
3642 + struct commit *cmit;
3643 struct commit_list *list;
3644 static int initialized = 0;
3645 struct commit_name *n;
3646
3647 + if (get_sha1(arg, sha1) &lt; 0)
3648 + usage(describe_usage);
3649 + cmit = lookup_commit_reference(sha1);
3650 + if (!cmit)
3651 + usage(describe_usage);
3652 +
3653 if (!initialized) {
3654 initialized = 1;
Junio C Hamanoac12f0e2014-09-19 22:32:513655 for_each_ref(get_name);</code></pre>
Junio C Hamanofb56a962006-01-28 10:38:193656</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:593657<div class="olist arabic"><ol class="arabic">
Junio C Hamano29f14312006-10-26 08:47:293658<li>
3659<p>
3660It is preceded with a "git diff" header, that looks like
Junio C Hamano48cd3f12019-10-09 05:55:303661 this (when the <code>-c</code> option is used):
Junio C Hamano29f14312006-10-26 08:47:293662</p>
3663<div class="literalblock">
3664<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:513665<pre><code>diff --combined file</code></pre>
Junio C Hamano29f14312006-10-26 08:47:293666</div></div>
Junio C Hamano48cd3f12019-10-09 05:55:303667<div class="paragraph"><p>or like this (when the <code>--cc</code> option is used):</p></div>
Junio C Hamano29f14312006-10-26 08:47:293668<div class="literalblock">
3669<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:513670<pre><code>diff --cc file</code></pre>
Junio C Hamano29f14312006-10-26 08:47:293671</div></div>
3672</li>
3673<li>
3674<p>
3675It is followed by one or more extended header lines
3676 (this example shows a merge with two parents):
3677</p>
3678<div class="literalblock">
3679<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:513680<pre><code>index &lt;hash&gt;,&lt;hash&gt;..&lt;hash&gt;
Junio C Hamano29f14312006-10-26 08:47:293681mode &lt;mode&gt;,&lt;mode&gt;..&lt;mode&gt;
3682new file mode &lt;mode&gt;
Junio C Hamanoac12f0e2014-09-19 22:32:513683deleted file mode &lt;mode&gt;,&lt;mode&gt;</code></pre>
Junio C Hamano29f14312006-10-26 08:47:293684</div></div>
Junio C Hamanoac12f0e2014-09-19 22:32:513685<div class="paragraph"><p>The <code>mode &lt;mode&gt;,&lt;mode&gt;..&lt;mode&gt;</code> line appears only if at least one of
Junio C Hamanoee1e4282007-02-04 08:32:043686the &lt;mode&gt; is different from the rest. Extended headers with
Junio C Hamano29f14312006-10-26 08:47:293687information about detected contents movement (renames and
3688copying detection) are designed to work with diff of two
Junio C Hamanoba4b9282008-07-06 05:20:313689&lt;tree-ish&gt; and are not used by combined diff format.</p></div>
Junio C Hamano29f14312006-10-26 08:47:293690</li>
3691<li>
3692<p>
3693It is followed by two-line from-file/to-file header
3694</p>
3695<div class="literalblock">
3696<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:513697<pre><code>--- a/file
3698+++ b/file</code></pre>
Junio C Hamano29f14312006-10-26 08:47:293699</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:593700<div class="paragraph"><p>Similar to two-line header for traditional <em>unified</em> diff
Junio C Hamanoac12f0e2014-09-19 22:32:513701format, <code>/dev/null</code> is used to signal created or deleted
Junio C Hamanoba4b9282008-07-06 05:20:313702files.</p></div>
Junio C Hamano11f15372019-03-07 03:17:003703<div class="paragraph"><p>However, if the --combined-all-paths option is provided, instead of a
3704two-line from-file/to-file you get a N+1 line from-file/to-file header,
3705where N is the number of parents in the merge commit</p></div>
3706<div class="literalblock">
3707<div class="content">
3708<pre><code>--- a/file
3709--- a/file
3710--- a/file
3711+++ b/file</code></pre>
3712</div></div>
3713<div class="paragraph"><p>This extended format can be useful if rename or copy detection is
3714active, to allow you to see the original name of the file in different
3715parents.</p></div>
Junio C Hamano29f14312006-10-26 08:47:293716</li>
3717<li>
3718<p>
3719Chunk header format is modified to prevent people from
Junio C Hamanoac12f0e2014-09-19 22:32:513720 accidentally feeding it to <code>patch -p1</code>. Combined diff format
Junio C Hamano29f14312006-10-26 08:47:293721 was created for review of merge commit changes, and was not
Junio C Hamano48cd3f12019-10-09 05:55:303722 meant to be applied. The change is similar to the change in the
Junio C Hamano29f14312006-10-26 08:47:293723 extended <em>index</em> header:
3724</p>
3725<div class="literalblock">
3726<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:513727<pre><code>@@@ &lt;from-file-range&gt; &lt;from-file-range&gt; &lt;to-file-range&gt; @@@</code></pre>
Junio C Hamano29f14312006-10-26 08:47:293728</div></div>
Junio C Hamanoac12f0e2014-09-19 22:32:513729<div class="paragraph"><p>There are (number of parents + 1) <code>@</code> characters in the chunk
Junio C Hamanoba4b9282008-07-06 05:20:313730header for combined diff format.</p></div>
Junio C Hamano29f14312006-10-26 08:47:293731</li>
Junio C Hamanoba4b9282008-07-06 05:20:313732</ol></div>
Junio C Hamano68cf15a2010-11-06 01:01:593733<div class="paragraph"><p>Unlike the traditional <em>unified</em> diff format, which shows two
Junio C Hamanoac12f0e2014-09-19 22:32:513734files 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
3735added to B), or <code>" "</code> (space&#8201;&#8212;&#8201;unchanged) prefix, this format
Junio C Hamanofb56a962006-01-28 10:38:193736compares two or more files file1, file2,&#8230; with one file X, and
3737shows how X differs from each of fileN. One column for each of
Junio C Hamano68cf15a2010-11-06 01:01:593738fileN is prepended to the output line to note how X&#8217;s line is
Junio C Hamanoba4b9282008-07-06 05:20:313739different from it.</p></div>
Junio C Hamanoac12f0e2014-09-19 22:32:513740<div class="paragraph"><p>A <code>-</code> character in the column N means that the line appears in
3741fileN but it does not appear in the result. A <code>+</code> character
Junio C Hamano54bf1e22008-12-20 06:30:113742in the column N means that the line appears in the result,
Junio C Hamano29f14312006-10-26 08:47:293743and fileN does not have that line (in other words, the line was
Junio C Hamanoba4b9282008-07-06 05:20:313744added, from the point of view of that parent).</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:593745<div class="paragraph"><p>In the above example output, the function signature was changed
Junio C Hamanoac12f0e2014-09-19 22:32:513746from both files (hence two <code>-</code> removals from both file1 and
3747file2, plus <code>++</code> to mean one line that was added does not appear
Junio C Hamanod75148a2014-04-08 19:48:383748in either file1 or file2). Also eight other lines are the same
Junio C Hamanoac12f0e2014-09-19 22:32:513749from file1 but do not appear in file2 (hence prefixed with <code>+</code>).</p></div>
3750<div class="paragraph"><p>When shown by <code>git diff-tree -c</code>, it compares the parents of a
Junio C Hamanofb56a962006-01-28 10:38:193751merge commit with the merge result (i.e. file1..fileN are the
Junio C Hamanoac12f0e2014-09-19 22:32:513752parents). When shown by <code>git diff-files -c</code>, it compares the
Junio C Hamanofb56a962006-01-28 10:38:193753two unresolved merge parents with the working tree file
3754(i.e. file1 is stage 2 aka "our version", file2 is stage 3 aka
Junio C Hamanoba4b9282008-07-06 05:20:313755"their version").</p></div>
Junio C Hamanofb56a962006-01-28 10:38:193756</div>
Junio C Hamano9629d4f2012-12-19 00:28:273757</div>
3758<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:313759<h2 id="_other_diff_formats">other diff formats</h2>
Junio C Hamano3a702342007-12-12 21:34:023760<div class="sectionbody">
Junio C Hamanoac12f0e2014-09-19 22:32:513761<div class="paragraph"><p>The <code>--summary</code> option describes newly added, deleted, renamed and
3762copied files. The <code>--stat</code> option adds diffstat(1) graph to the
Junio C Hamano3a702342007-12-12 21:34:023763output. These options can be combined with other options, such as
Junio C Hamanoac12f0e2014-09-19 22:32:513764<code>-p</code>, and are meant for human consumption.</p></div>
3765<div class="paragraph"><p>When showing a change that involves a rename or a copy, <code>--stat</code> output
Junio C Hamano3a702342007-12-12 21:34:023766formats the pathnames compactly by combining common prefix and suffix of
Junio C Hamanoac12f0e2014-09-19 22:32:513767the pathnames. For example, a change that moves <code>arch/i386/Makefile</code> to
3768<code>arch/x86/Makefile</code> while modifying 4 lines will be shown like this:</p></div>
Junio C Hamano3a702342007-12-12 21:34:023769<div class="listingblock">
3770<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:513771<pre><code>arch/{i386 =&gt; x86}/Makefile | 4 +--</code></pre>
Junio C Hamano3a702342007-12-12 21:34:023772</div></div>
Junio C Hamanoac12f0e2014-09-19 22:32:513773<div class="paragraph"><p>The <code>--numstat</code> option gives the diffstat(1) information but is designed
3774for easier machine consumption. An entry in <code>--numstat</code> output looks
Junio C Hamanoba4b9282008-07-06 05:20:313775like this:</p></div>
Junio C Hamano3a702342007-12-12 21:34:023776<div class="listingblock">
3777<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:513778<pre><code>1 2 README
37793 1 arch/{i386 =&gt; x86}/Makefile</code></pre>
Junio C Hamano3a702342007-12-12 21:34:023780</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:593781<div class="paragraph"><p>That is, from left to right:</p></div>
3782<div class="olist arabic"><ol class="arabic">
Junio C Hamano3a702342007-12-12 21:34:023783<li>
3784<p>
3785the number of added lines;
3786</p>
3787</li>
3788<li>
3789<p>
3790a tab;
3791</p>
3792</li>
3793<li>
3794<p>
3795the number of deleted lines;
3796</p>
3797</li>
3798<li>
3799<p>
3800a tab;
3801</p>
3802</li>
3803<li>
3804<p>
3805pathname (possibly with rename/copy information);
3806</p>
3807</li>
3808<li>
3809<p>
3810a newline.
3811</p>
3812</li>
Junio C Hamanoba4b9282008-07-06 05:20:313813</ol></div>
Junio C Hamanoac12f0e2014-09-19 22:32:513814<div class="paragraph"><p>When <code>-z</code> output option is in effect, the output is formatted this way:</p></div>
Junio C Hamano3a702342007-12-12 21:34:023815<div class="listingblock">
3816<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:513817<pre><code>1 2 README NUL
38183 1 NUL arch/i386/Makefile NUL arch/x86/Makefile NUL</code></pre>
Junio C Hamano3a702342007-12-12 21:34:023819</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:593820<div class="paragraph"><p>That is:</p></div>
3821<div class="olist arabic"><ol class="arabic">
Junio C Hamano3a702342007-12-12 21:34:023822<li>
3823<p>
3824the number of added lines;
3825</p>
3826</li>
3827<li>
3828<p>
3829a tab;
3830</p>
3831</li>
3832<li>
3833<p>
3834the number of deleted lines;
3835</p>
3836</li>
3837<li>
3838<p>
3839a tab;
3840</p>
3841</li>
3842<li>
3843<p>
3844a NUL (only exists if renamed/copied);
3845</p>
3846</li>
3847<li>
3848<p>
3849pathname in preimage;
3850</p>
3851</li>
3852<li>
3853<p>
3854a NUL (only exists if renamed/copied);
3855</p>
3856</li>
3857<li>
3858<p>
3859pathname in postimage (only exists if renamed/copied);
3860</p>
3861</li>
3862<li>
3863<p>
3864a NUL.
3865</p>
3866</li>
Junio C Hamanoba4b9282008-07-06 05:20:313867</ol></div>
Junio C Hamanoac12f0e2014-09-19 22:32:513868<div class="paragraph"><p>The extra <code>NUL</code> before the preimage path in renamed case is to allow
Junio C Hamano3a702342007-12-12 21:34:023869scripts that read the output to tell if the current record being read is
3870a single-path record or a rename/copy record without reading ahead.
Junio C Hamanoac12f0e2014-09-19 22:32:513871After reading added and deleted lines, reading up to <code>NUL</code> would yield
3872the pathname, but if that is <code>NUL</code>, the record will show two paths.</p></div>
Junio C Hamano3a702342007-12-12 21:34:023873</div>
Junio C Hamano9629d4f2012-12-19 00:28:273874</div>
3875<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:313876<h2 id="_git">GIT</h2>
Junio C Hamano1a4e8412005-12-27 08:17:233877<div class="sectionbody">
Junio C Hamanoa28a9202012-06-21 07:08:233878<div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:233879</div>
Junio C Hamano7bd050f2011-09-22 06:32:223880</div>
Junio C Hamano9629d4f2012-12-19 00:28:273881</div>
Junio C Hamano7bd050f2011-09-22 06:32:223882<div id="footnotes"><hr /></div>
Junio C Hamano1a4e8412005-12-27 08:17:233883<div id="footer">
3884<div id="footer-text">
Junio C Hamano2ef0ba32018-01-26 23:13:533885Last updated
Junio C Hamanodf3d3cd2020-11-02 22:05:053886 2020-11-02 14:02:22 PST
Junio C Hamano1a4e8412005-12-27 08:17:233887</div>
3888</div>
3889</body>
3890</html>