blob: 4a08cba3e134547328380159514faecd557ff820 [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 Hamanoa85030a2022-07-27 16:48:217<meta name="generator" content="AsciiDoc 10.2.0" />
Junio C Hamano68cf15a2010-11-06 01:01:598<title>git-log(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 Hamano2b153182021-12-15 21:00:31542var 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;
583 var re = new RegExp('[hH]([1-'+(toclevels+1)+'])');
584 // 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");
603 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];
612 if (entry.nodeName.toLowerCase() == 'div'
613 && 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.
622 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 () {
649 // Delete existing footnote entries in case we're reloading the footnodes.
650 var i;
651 var noteholder = document.getElementById("footnotes");
652 if (!noteholder) {
653 return;
654 }
655 var entriesToRemove = [];
656 for (i = 0; i < noteholder.childNodes.length; i++) {
657 var entry = noteholder.childNodes[i];
658 if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote")
659 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");
667 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++;
673 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 }
683 noteholder.innerHTML +=
684 "<div class='footnote' id='_footnote_" + n + "'>" +
685 "<a href='#_footnoteref_" + n + "' title='Return to text'>" +
686 n + "</a>. " + note + "</div>";
687 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 }
706},
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;
728}
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-log(1) Manual Page
739</h1>
740<h2>NAME</h2>
741<div class="sectionbody">
742<p>git-log -
743 Show commit logs
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 Hamano15567bc2011-07-23 00:51:59751<div class="verseblock">
Junio C Hamano59a32b02021-12-10 22:53:38752<pre class="content"><em>git log</em> [&lt;options&gt;] [&lt;revision-range&gt;] [[--] &lt;path&gt;&#8230;]</pre>
Junio C Hamano9629d4f2012-12-19 00:28:27753<div class="attribution">
Junio C Hamano15567bc2011-07-23 00:51:59754</div></div>
Junio C Hamano1a4e8412005-12-27 08:17:23755</div>
Junio C Hamano9629d4f2012-12-19 00:28:27756</div>
757<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:31758<h2 id="_description">DESCRIPTION</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23759<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:59760<div class="paragraph"><p>Shows the commit logs.</p></div>
Junio C Hamano28c33de2020-07-30 21:22:26761<div class="paragraph"><p>List commits that are reachable by following the <code>parent</code> links from the
762given commit(s), but exclude commits that are reachable from the one(s)
763given with a <em>&#94;</em> in front of them. The output is given in reverse
764chronological order by default.</p></div>
765<div class="paragraph"><p>You can think of this as a set operation. Commits reachable from any of
766the commits given on the command line form a set, and then commits reachable
767from any of the ones given with <em>&#94;</em> in front are subtracted from that
768set. The remaining commits are what comes out in the command&#8217;s output.
769Various other options and paths parameters can be used to further limit the
770result.</p></div>
771<div class="paragraph"><p>Thus, the following command:</p></div>
772<div class="listingblock">
773<div class="content">
774<pre><code>$ git log foo bar ^baz</code></pre>
775</div></div>
776<div class="paragraph"><p>means "list all the commits which are reachable from <em>foo</em> or <em>bar</em>, but
777not from <em>baz</em>".</p></div>
778<div class="paragraph"><p>A special notation "<em>&lt;commit1&gt;</em>..<em>&lt;commit2&gt;</em>" can be used as a
779short-hand for "^<em>&lt;commit1&gt;</em> <em>&lt;commit2&gt;</em>". For example, either of
780the following may be used interchangeably:</p></div>
781<div class="listingblock">
782<div class="content">
783<pre><code>$ git log origin..HEAD
784$ git log HEAD ^origin</code></pre>
785</div></div>
786<div class="paragraph"><p>Another special notation is "<em>&lt;commit1&gt;</em>&#8230;<em>&lt;commit2&gt;</em>" which is useful
787for merges. The resulting set of commits is the symmetric difference
788between the two operands. The following two commands are equivalent:</p></div>
789<div class="listingblock">
790<div class="content">
791<pre><code>$ git log A B --not $(git merge-base --all A B)
792$ git log A...B</code></pre>
793</div></div>
794<div class="paragraph"><p>The command takes options applicable to the <a href="git-rev-list.html">git-rev-list(1)</a>
Junio C Hamanoba7c8d82006-04-15 06:17:42795command to control what is shown and how, and options applicable to
Junio C Hamano28c33de2020-07-30 21:22:26796the <a href="git-diff.html">git-diff(1)</a> command to control how the changes
Junio C Hamanoba4b9282008-07-06 05:20:31797each commit introduces are shown.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:23798</div>
Junio C Hamano9629d4f2012-12-19 00:28:27799</div>
800<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:31801<h2 id="_options">OPTIONS</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23802<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:59803<div class="dlist"><dl>
804<dt class="hdlist1">
Junio C Hamano78e3a782010-07-15 22:24:45805--follow
806</dt>
807<dd>
808<p>
809 Continue listing the history of a file beyond renames
810 (works only for a single file).
811</p>
812</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59813<dt class="hdlist1">
Junio C Hamano78e3a782010-07-15 22:24:45814--no-decorate
815</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59816<dt class="hdlist1">
Junio C Hamano37cf4082016-05-30 01:22:14817--decorate[=short|full|auto|no]
Junio C Hamano78e3a782010-07-15 22:24:45818</dt>
819<dd>
820<p>
821 Print out the ref names of any commits that are shown. If <em>short</em> is
822 specified, the ref name prefixes <em>refs/heads/</em>, <em>refs/tags/</em> and
823 <em>refs/remotes/</em> will not be printed. If <em>full</em> is specified, the
Junio C Hamano37cf4082016-05-30 01:22:14824 full ref name (including prefix) will be printed. If <em>auto</em> is
825 specified, then if the output is going to a terminal, the ref names
826 are shown as if <em>short</em> were given, otherwise no ref names are
Junio C Hamano91a411f2021-07-14 00:40:50827 shown. The option <code>--decorate</code> is short-hand for <code>--decorate=short</code>.
828 Default to configuration value of <code>log.decorate</code> if configured,
829 otherwise, <code>auto</code>.
Junio C Hamano78e3a782010-07-15 22:24:45830</p>
831</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59832<dt class="hdlist1">
Junio C Hamano371470a2017-12-13 22:26:40833--decorate-refs=&lt;pattern&gt;
834</dt>
835<dt class="hdlist1">
836--decorate-refs-exclude=&lt;pattern&gt;
837</dt>
838<dd>
839<p>
Junio C Hamano594d2d42022-08-30 17:58:50840 For each candidate reference, do not use it for decoration if it
Junio C Hamano371470a2017-12-13 22:26:40841 matches any patterns given to <code>--decorate-refs-exclude</code> or if it
Junio C Hamano0dd50942020-04-29 21:21:05842 doesn&#8217;t match any of the patterns given to <code>--decorate-refs</code>. The
843 <code>log.excludeDecoration</code> config option allows excluding refs from
844 the decorations, but an explicit <code>--decorate-refs</code> pattern will
845 override a match in <code>log.excludeDecoration</code>.
Junio C Hamano371470a2017-12-13 22:26:40846</p>
Junio C Hamano594d2d42022-08-30 17:58:50847<div class="paragraph"><p>If none of these options or config settings are given, then references are
848used as decoration if they match <code>HEAD</code>, <code>refs/heads/</code>, <code>refs/remotes/</code>,
849<code>refs/stash/</code>, or <code>refs/tags/</code>.</p></div>
850</dd>
851<dt class="hdlist1">
852--clear-decorations
853</dt>
854<dd>
855<p>
856 When specified, this option clears all previous <code>--decorate-refs</code>
857 or <code>--decorate-refs-exclude</code> options and relaxes the default
858 decoration filter to include all references. This option is
859 assumed if the config value <code>log.initialDecorationSet</code> is set to
860 <code>all</code>.
861</p>
Junio C Hamano371470a2017-12-13 22:26:40862</dd>
863<dt class="hdlist1">
Junio C Hamano78e3a782010-07-15 22:24:45864--source
865</dt>
866<dd>
867<p>
868 Print out the ref name given on the command line by which each
869 commit was reached.
870</p>
871</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59872<dt class="hdlist1">
Junio C Hamano0dd50942020-04-29 21:21:05873--[no-]mailmap
874</dt>
875<dt class="hdlist1">
Junio C Hamano36594952019-07-25 22:26:52876--[no-]use-mailmap
Junio C Hamanoce836cc2013-01-21 02:01:53877</dt>
878<dd>
879<p>
880 Use mailmap file to map author and committer names and email
Junio C Hamanob73af6c2013-12-03 22:07:11881 addresses to canonical real names and email addresses. See
Junio C Hamanoce836cc2013-01-21 02:01:53882 <a href="git-shortlog.html">git-shortlog(1)</a>.
883</p>
884</dd>
885<dt class="hdlist1">
Junio C Hamano78e3a782010-07-15 22:24:45886--full-diff
887</dt>
888<dd>
889<p>
Junio C Hamanoac12f0e2014-09-19 22:32:51890 Without this flag, <code>git log -p &lt;path&gt;...</code> shows commits that
Junio C Hamano78e3a782010-07-15 22:24:45891 touch the specified paths, and diffs about the same specified
892 paths. With this, the full diff is shown for commits that touch
893 the specified paths; this means that "&lt;path&gt;&#8230;" limits only
Junio C Hamano68cf15a2010-11-06 01:01:59894 commits, and doesn&#8217;t limit diff for those commits.
Junio C Hamano78e3a782010-07-15 22:24:45895</p>
Junio C Hamano68cf15a2010-11-06 01:01:59896<div class="paragraph"><p>Note that this affects all diff-based output types, e.g. those
Junio C Hamanoac12f0e2014-09-19 22:32:51897produced by <code>--stat</code>, etc.</p></div>
Junio C Hamano78e3a782010-07-15 22:24:45898</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59899<dt class="hdlist1">
Junio C Hamano78e3a782010-07-15 22:24:45900--log-size
901</dt>
902<dd>
903<p>
Junio C Hamanob73af6c2013-12-03 22:07:11904 Include a line &#8220;log size &lt;number&gt;&#8221; in the output for each commit,
905 where &lt;number&gt; is the length of that commit&#8217;s message in bytes.
Junio C Hamanoac12f0e2014-09-19 22:32:51906 Intended to speed up tools that read log messages from <code>git log</code>
Junio C Hamanob73af6c2013-12-03 22:07:11907 output by allowing them to allocate space in advance.
Junio C Hamano78e3a782010-07-15 22:24:45908</p>
909</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59910<dt class="hdlist1">
Junio C Hamanob7676d52020-11-18 22:15:08911-L&lt;start&gt;,&lt;end&gt;:&lt;file&gt;
Junio C Hamano8eac2682013-09-09 22:35:20912</dt>
913<dt class="hdlist1">
Junio C Hamanob7676d52020-11-18 22:15:08914-L:&lt;funcname&gt;:&lt;file&gt;
Junio C Hamano7e590a12013-06-02 23:46:52915</dt>
916<dd>
917<p>
Junio C Hamanob7676d52020-11-18 22:15:08918 Trace the evolution of the line range given by <em>&lt;start&gt;,&lt;end&gt;</em>,
919 or by the function name regex <em>&lt;funcname&gt;</em>, within the <em>&lt;file&gt;</em>. You may
Junio C Hamano7e590a12013-06-02 23:46:52920 not give any pathspec limiters. This is currently limited to
921 a walk starting from a single revision, i.e., you may only
Junio C Hamano68793842020-01-06 23:07:09922 give zero or one positive revision arguments, and
Junio C Hamanob7676d52020-11-18 22:15:08923 <em>&lt;start&gt;</em> and <em>&lt;end&gt;</em> (or <em>&lt;funcname&gt;</em>) must exist in the starting revision.
Junio C Hamano68793842020-01-06 23:07:09924 You can specify this option more than once. Implies <code>--patch</code>.
925 Patch output can be suppressed using <code>--no-patch</code>, but other diff formats
926 (namely <code>--raw</code>, <code>--numstat</code>, <code>--shortstat</code>, <code>--dirstat</code>, <code>--summary</code>,
927 <code>--name-only</code>, <code>--name-status</code>, <code>--check</code>) are not currently implemented.
Junio C Hamano7e590a12013-06-02 23:46:52928</p>
Junio C Hamanob7676d52020-11-18 22:15:08929<div class="paragraph"><p><em>&lt;start&gt;</em> and <em>&lt;end&gt;</em> can take one of these forms:</p></div>
Junio C Hamano7e590a12013-06-02 23:46:52930<div class="ulist"><ul>
931<li>
932<p>
933number
934</p>
Junio C Hamanob7676d52020-11-18 22:15:08935<div class="paragraph"><p>If <em>&lt;start&gt;</em> or <em>&lt;end&gt;</em> is a number, it specifies an
Junio C Hamano7e590a12013-06-02 23:46:52936absolute line number (lines count from 1).</p></div>
937</li>
938<li>
939<p>
Junio C Hamanob7676d52020-11-18 22:15:08940<code>/regex/</code>
Junio C Hamano7e590a12013-06-02 23:46:52941</p>
942<div class="paragraph"><p>This form will use the first line matching the given
Junio C Hamanob7676d52020-11-18 22:15:08943POSIX regex. If <em>&lt;start&gt;</em> is a regex, it will search from the end of
Junio C Hamanoac12f0e2014-09-19 22:32:51944the previous <code>-L</code> range, if any, otherwise from the start of file.
Junio C Hamanob7676d52020-11-18 22:15:08945If <em>&lt;start&gt;</em> is <code>^/regex/</code>, it will search from the start of file.
946If <em>&lt;end&gt;</em> is a regex, it will search
947starting at the line given by <em>&lt;start&gt;</em>.</p></div>
Junio C Hamano7e590a12013-06-02 23:46:52948</li>
949<li>
950<p>
951+offset or -offset
952</p>
Junio C Hamanob7676d52020-11-18 22:15:08953<div class="paragraph"><p>This is only valid for <em>&lt;end&gt;</em> and will specify a number
954of lines before or after the line given by <em>&lt;start&gt;</em>.</p></div>
Junio C Hamano7e590a12013-06-02 23:46:52955</li>
Junio C Hamano7e590a12013-06-02 23:46:52956</ul></div>
Junio C Hamanob7676d52020-11-18 22:15:08957<div class="paragraph"><p>If <code>:&lt;funcname&gt;</code> is given in place of <em>&lt;start&gt;</em> and <em>&lt;end&gt;</em>, it is a
Junio C Hamanodd5004a2015-05-06 19:33:32958regular expression that denotes the range from the first funcname line
Junio C Hamanob7676d52020-11-18 22:15:08959that matches <em>&lt;funcname&gt;</em>, up to the next funcname line. <code>:&lt;funcname&gt;</code>
Junio C Hamanodd5004a2015-05-06 19:33:32960searches from the end of the previous <code>-L</code> range, if any, otherwise
Junio C Hamanob7676d52020-11-18 22:15:08961from the start of file. <code>^:&lt;funcname&gt;</code> searches from the start of
962file. The function names are determined in the same way as <code>git diff</code>
963works out patch hunk headers (see <em>Defining a custom hunk-header</em>
964in <a href="gitattributes.html">gitattributes(5)</a>).</p></div>
Junio C Hamano7e590a12013-06-02 23:46:52965</dd>
966<dt class="hdlist1">
Junio C Hamano59a32b02021-12-10 22:53:38967&lt;revision-range&gt;
Junio C Hamanof26c77e2013-04-27 00:06:04968</dt>
969<dd>
970<p>
971 Show only commits in the specified revision range. When no
Junio C Hamano59a32b02021-12-10 22:53:38972 &lt;revision-range&gt; is specified, it defaults to <code>HEAD</code> (i.e. the
Junio C Hamanoac12f0e2014-09-19 22:32:51973 whole history leading to the current commit). <code>origin..HEAD</code>
Junio C Hamanof26c77e2013-04-27 00:06:04974 specifies all the commits reachable from the current commit
Junio C Hamanoac12f0e2014-09-19 22:32:51975 (i.e. <code>HEAD</code>), but not from <code>origin</code>. For a complete list of
Junio C Hamano59a32b02021-12-10 22:53:38976 ways to spell &lt;revision-range&gt;, see the <em>Specifying Ranges</em>
Junio C Hamanof26c77e2013-04-27 00:06:04977 section of <a href="gitrevisions.html">gitrevisions(7)</a>.
978</p>
979</dd>
980<dt class="hdlist1">
Junio C Hamano78e3a782010-07-15 22:24:45981[--] &lt;path&gt;&#8230;
982</dt>
983<dd>
984<p>
Junio C Hamano5723afa2011-08-31 00:49:23985 Show only commits that are enough to explain how the files
Junio C Hamanob73af6c2013-12-03 22:07:11986 that match the specified paths came to be. See <em>History
987 Simplification</em> below for details and other simplification
Junio C Hamano5723afa2011-08-31 00:49:23988 modes.
Junio C Hamano78e3a782010-07-15 22:24:45989</p>
Junio C Hamanoccb82522018-05-08 07:52:09990<div class="paragraph"><p>Paths may need to be prefixed with <code>--</code> to separate them from
Junio C Hamanof26c77e2013-04-27 00:06:04991options or the revision range, when confusion arises.</p></div>
Junio C Hamano78e3a782010-07-15 22:24:45992</dd>
993</dl></div>
Junio C Hamano9629d4f2012-12-19 00:28:27994<div class="sect2">
995<h3 id="_commit_limiting">Commit Limiting</h3>
Junio C Hamano68cf15a2010-11-06 01:01:59996<div class="paragraph"><p>Besides specifying a range of commits that should be listed using the
Junio C Hamanob0e02952008-01-19 08:02:00997special notations explained in the description, additional commit
Junio C Hamano8ce35d72012-09-18 22:30:42998limiting may be applied.</p></div>
999<div class="paragraph"><p>Using more options generally further limits the output (e.g.
Junio C Hamanoac12f0e2014-09-19 22:32:511000<code>--since=&lt;date1&gt;</code> limits to commits newer than <code>&lt;date1&gt;</code>, and using it
1001with <code>--grep=&lt;pattern&gt;</code> further limits to commits whose log message
1002has a line that matches <code>&lt;pattern&gt;</code>), unless otherwise noted.</p></div>
Junio C Hamano8ce35d72012-09-18 22:30:421003<div class="paragraph"><p>Note that these are applied before commit
Junio C Hamanoac12f0e2014-09-19 22:32:511004ordering and formatting options, such as <code>--reverse</code>.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591005<div class="dlist"><dl>
1006<dt class="hdlist1">
Junio C Hamano693e7092012-09-12 22:56:531007-&lt;number&gt;
1008</dt>
1009<dt class="hdlist1">
1010-n &lt;number&gt;
Junio C Hamanoeb415992008-06-08 22:49:471011</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591012<dt class="hdlist1">
Junio C Hamanob4a9ede2009-04-08 07:36:321013--max-count=&lt;number&gt;
Junio C Hamanob0e02952008-01-19 08:02:001014</dt>
1015<dd>
1016<p>
Junio C Hamanoc5be4cc2011-03-09 07:20:431017 Limit the number of commits to output.
Junio C Hamanob0e02952008-01-19 08:02:001018</p>
1019</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591020<dt class="hdlist1">
Junio C Hamanob4a9ede2009-04-08 07:36:321021--skip=&lt;number&gt;
Junio C Hamanob0e02952008-01-19 08:02:001022</dt>
1023<dd>
1024<p>
1025 Skip <em>number</em> commits before starting to show the commit output.
1026</p>
1027</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591028<dt class="hdlist1">
Junio C Hamanob4a9ede2009-04-08 07:36:321029--since=&lt;date&gt;
Junio C Hamanoeb415992008-06-08 22:49:471030</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591031<dt class="hdlist1">
Junio C Hamanob4a9ede2009-04-08 07:36:321032--after=&lt;date&gt;
Junio C Hamanob0e02952008-01-19 08:02:001033</dt>
1034<dd>
1035<p>
1036 Show commits more recent than a specific date.
1037</p>
1038</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591039<dt class="hdlist1">
Junio C Hamano72ea2ca2022-05-21 00:51:231040--since-as-filter=&lt;date&gt;
1041</dt>
1042<dd>
1043<p>
1044 Show all commits more recent than a specific date. This visits
1045 all commits in the range, rather than stopping at the first commit which
1046 is older than a specific date.
1047</p>
1048</dd>
1049<dt class="hdlist1">
Junio C Hamanob4a9ede2009-04-08 07:36:321050--until=&lt;date&gt;
Junio C Hamanoeb415992008-06-08 22:49:471051</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591052<dt class="hdlist1">
Junio C Hamanob4a9ede2009-04-08 07:36:321053--before=&lt;date&gt;
Junio C Hamanob0e02952008-01-19 08:02:001054</dt>
1055<dd>
1056<p>
1057 Show commits older than a specific date.
1058</p>
1059</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591060<dt class="hdlist1">
Junio C Hamanob4a9ede2009-04-08 07:36:321061--author=&lt;pattern&gt;
Junio C Hamanoeb415992008-06-08 22:49:471062</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591063<dt class="hdlist1">
Junio C Hamanob4a9ede2009-04-08 07:36:321064--committer=&lt;pattern&gt;
Junio C Hamanob0e02952008-01-19 08:02:001065</dt>
1066<dd>
1067<p>
1068 Limit the commits output to ones with author/committer
Junio C Hamano8ce35d72012-09-18 22:30:421069 header lines that match the specified pattern (regular
Junio C Hamanoac12f0e2014-09-19 22:32:511070 expression). With more than one <code>--author=&lt;pattern&gt;</code>,
Junio C Hamano8ce35d72012-09-18 22:30:421071 commits whose author matches any of the given patterns are
Junio C Hamanoac12f0e2014-09-19 22:32:511072 chosen (similarly for multiple <code>--committer=&lt;pattern&gt;</code>).
Junio C Hamanob0e02952008-01-19 08:02:001073</p>
1074</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591075<dt class="hdlist1">
Junio C Hamano9954ed72012-10-03 04:54:001076--grep-reflog=&lt;pattern&gt;
1077</dt>
1078<dd>
1079<p>
1080 Limit the commits output to ones with reflog entries that
1081 match the specified pattern (regular expression). With
Junio C Hamanoac12f0e2014-09-19 22:32:511082 more than one <code>--grep-reflog</code>, commits whose reflog message
Junio C Hamano9954ed72012-10-03 04:54:001083 matches any of the given patterns are chosen. It is an
Junio C Hamanoac12f0e2014-09-19 22:32:511084 error to use this option unless <code>--walk-reflogs</code> is in use.
Junio C Hamano9954ed72012-10-03 04:54:001085</p>
1086</dd>
1087<dt class="hdlist1">
Junio C Hamanob4a9ede2009-04-08 07:36:321088--grep=&lt;pattern&gt;
Junio C Hamanob0e02952008-01-19 08:02:001089</dt>
1090<dd>
1091<p>
1092 Limit the commits output to ones with log message that
Junio C Hamano8ce35d72012-09-18 22:30:421093 matches the specified pattern (regular expression). With
Junio C Hamanoac12f0e2014-09-19 22:32:511094 more than one <code>--grep=&lt;pattern&gt;</code>, commits whose message
Junio C Hamano8ce35d72012-09-18 22:30:421095 matches any of the given patterns are chosen (but see
Junio C Hamanoac12f0e2014-09-19 22:32:511096 <code>--all-match</code>).
Junio C Hamanob0e02952008-01-19 08:02:001097</p>
Junio C Hamanob3f862c2019-12-05 22:22:001098<div class="paragraph"><p>When <code>--notes</code> is in effect, the message from the notes is
Junio C Hamano8152abf2015-04-28 22:48:021099matched as if it were part of the log message.</p></div>
Junio C Hamanob0e02952008-01-19 08:02:001100</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591101<dt class="hdlist1">
Junio C Hamanoaa17c7c2008-11-03 04:36:581102--all-match
1103</dt>
1104<dd>
1105<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511106 Limit the commits output to ones that match all given <code>--grep</code>,
Junio C Hamano8ce35d72012-09-18 22:30:421107 instead of ones that match at least one.
Junio C Hamanoaa17c7c2008-11-03 04:36:581108</p>
1109</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591110<dt class="hdlist1">
Junio C Hamano6bb32e62015-02-17 22:11:261111--invert-grep
1112</dt>
1113<dd>
1114<p>
1115 Limit the commits output to ones with log message that do not
1116 match the pattern specified with <code>--grep=&lt;pattern&gt;</code>.
1117</p>
1118</dd>
1119<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471120-i
1121</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591122<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471123--regexp-ignore-case
Junio C Hamanob0e02952008-01-19 08:02:001124</dt>
1125<dd>
1126<p>
Junio C Hamanob73af6c2013-12-03 22:07:111127 Match the regular expression limiting patterns without regard to letter
1128 case.
Junio C Hamanob0e02952008-01-19 08:02:001129</p>
1130</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591131<dt class="hdlist1">
Junio C Hamanoa1295452012-11-13 22:32:041132--basic-regexp
1133</dt>
1134<dd>
1135<p>
1136 Consider the limiting patterns to be basic regular expressions;
1137 this is the default.
1138</p>
1139</dd>
1140<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471141-E
1142</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591143<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471144--extended-regexp
Junio C Hamanob0e02952008-01-19 08:02:001145</dt>
1146<dd>
1147<p>
1148 Consider the limiting patterns to be extended regular expressions
1149 instead of the default basic regular expressions.
1150</p>
1151</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591152<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471153-F
1154</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591155<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471156--fixed-strings
Junio C Hamano24bc09a2008-02-28 00:27:441157</dt>
1158<dd>
1159<p>
Junio C Hamano68cf15a2010-11-06 01:01:591160 Consider the limiting patterns to be fixed strings (don&#8217;t interpret
Junio C Hamano24bc09a2008-02-28 00:27:441161 pattern as a regular expression).
1162</p>
1163</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591164<dt class="hdlist1">
Junio C Hamanoa275c1f2017-06-19 20:10:121165-P
1166</dt>
1167<dt class="hdlist1">
Junio C Hamanoa1295452012-11-13 22:32:041168--perl-regexp
1169</dt>
1170<dd>
1171<p>
Junio C Hamano222ed822017-06-02 06:24:061172 Consider the limiting patterns to be Perl-compatible regular
1173 expressions.
Junio C Hamanoa1295452012-11-13 22:32:041174</p>
Junio C Hamano222ed822017-06-02 06:24:061175<div class="paragraph"><p>Support for these types of regular expressions is an optional
1176compile-time dependency. If Git wasn&#8217;t compiled with support for them
1177providing this option will cause it to die.</p></div>
Junio C Hamanoa1295452012-11-13 22:32:041178</dd>
1179<dt class="hdlist1">
Junio C Hamanob0e02952008-01-19 08:02:001180--remove-empty
1181</dt>
1182<dd>
1183<p>
1184 Stop when a given path disappears from the tree.
1185</p>
1186</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591187<dt class="hdlist1">
Junio C Hamano934e1782009-07-16 06:59:151188--merges
1189</dt>
1190<dd>
1191<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511192 Print only merge commits. This is exactly the same as <code>--min-parents=2</code>.
Junio C Hamano934e1782009-07-16 06:59:151193</p>
1194</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591195<dt class="hdlist1">
Junio C Hamanob0e02952008-01-19 08:02:001196--no-merges
1197</dt>
1198<dd>
1199<p>
Junio C Hamanof32ce262011-03-27 07:35:111200 Do not print commits with more than one parent. This is
Junio C Hamanoac12f0e2014-09-19 22:32:511201 exactly the same as <code>--max-parents=1</code>.
Junio C Hamanob0e02952008-01-19 08:02:001202</p>
1203</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591204<dt class="hdlist1">
Junio C Hamanof32ce262011-03-27 07:35:111205--min-parents=&lt;number&gt;
1206</dt>
1207<dt class="hdlist1">
1208--max-parents=&lt;number&gt;
1209</dt>
1210<dt class="hdlist1">
1211--no-min-parents
1212</dt>
1213<dt class="hdlist1">
1214--no-max-parents
1215</dt>
1216<dd>
1217<p>
Junio C Hamanoc5bb3b32013-08-05 22:43:361218 Show only commits which have at least (or at most) that many parent
Junio C Hamanoac12f0e2014-09-19 22:32:511219 commits. In particular, <code>--max-parents=1</code> is the same as <code>--no-merges</code>,
1220 <code>--min-parents=2</code> is the same as <code>--merges</code>. <code>--max-parents=0</code>
1221 gives all root commits and <code>--min-parents=3</code> all octopus merges.
Junio C Hamanof32ce262011-03-27 07:35:111222</p>
Junio C Hamanoac12f0e2014-09-19 22:32:511223<div class="paragraph"><p><code>--no-min-parents</code> and <code>--no-max-parents</code> reset these limits (to no limit)
1224again. Equivalent forms are <code>--min-parents=0</code> (any commit has 0 or more
1225parents) and <code>--max-parents=-1</code> (negative numbers denote no upper limit).</p></div>
Junio C Hamanof32ce262011-03-27 07:35:111226</dd>
1227<dt class="hdlist1">
Junio C Hamanob0e02952008-01-19 08:02:001228--first-parent
1229</dt>
1230<dd>
1231<p>
Junio C Hamano034a2ff2022-02-18 00:40:111232 When finding commits to include, follow only the first
1233 parent commit upon seeing a merge commit. This option
1234 can give a better overview when viewing the evolution of
1235 a particular topic branch, because merges into a topic
1236 branch tend to be only about adjusting to updated upstream
1237 from time to time, and this option allows you to ignore
1238 the individual commits brought in to your history by such
1239 a merge.
Junio C Hamanob0e02952008-01-19 08:02:001240</p>
Junio C Hamanoa372d5b2021-02-26 01:34:371241<div class="paragraph"><p>This option also changes default diff format for merge commits
1242to <code>first-parent</code>, see <code>--diff-merges=first-parent</code> for details.</p></div>
Junio C Hamanob0e02952008-01-19 08:02:001243</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591244<dt class="hdlist1">
Junio C Hamano034a2ff2022-02-18 00:40:111245--exclude-first-parent-only
1246</dt>
1247<dd>
1248<p>
1249 When finding commits to exclude (with a <em>&#94;</em>), follow only
1250 the first parent commit upon seeing a merge commit.
1251 This can be used to find the set of changes in a topic branch
1252 from the point where it diverged from the remote branch, given
1253 that arbitrary merges can be valid topic branch changes.
1254</p>
1255</dd>
1256<dt class="hdlist1">
Junio C Hamanob0e02952008-01-19 08:02:001257--not
1258</dt>
1259<dd>
1260<p>
1261 Reverses the meaning of the <em>&#94;</em> prefix (or lack thereof)
Junio C Hamanoac12f0e2014-09-19 22:32:511262 for all following revision specifiers, up to the next <code>--not</code>.
Junio C Hamanob0e02952008-01-19 08:02:001263</p>
1264</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591265<dt class="hdlist1">
Junio C Hamanob0e02952008-01-19 08:02:001266--all
1267</dt>
1268<dd>
1269<p>
Junio C Hamanoe89102f2017-02-15 23:18:151270 Pretend as if all the refs in <code>refs/</code>, along with <code>HEAD</code>, are
1271 listed on the command line as <em>&lt;commit&gt;</em>.
Junio C Hamanob0e02952008-01-19 08:02:001272</p>
1273</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591274<dt class="hdlist1">
Junio C Hamanod2179ef2010-10-22 04:12:171275--branches[=&lt;pattern&gt;]
Junio C Hamano50819852008-11-19 02:07:561276</dt>
1277<dd>
1278<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511279 Pretend as if all the refs in <code>refs/heads</code> are listed
Junio C Hamanod2179ef2010-10-22 04:12:171280 on the command line as <em>&lt;commit&gt;</em>. If <em>&lt;pattern&gt;</em> is given, limit
Junio C Hamano57827fb2010-01-23 03:02:501281 branches to ones matching given shell glob. If pattern lacks <em>?</em>,
Junio C Hamano81d540a2012-03-02 19:52:471282 <em>&#42;</em>, or <em>[</em>, <em>/&#42;</em> at the end is implied.
Junio C Hamano50819852008-11-19 02:07:561283</p>
1284</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591285<dt class="hdlist1">
Junio C Hamanod2179ef2010-10-22 04:12:171286--tags[=&lt;pattern&gt;]
Junio C Hamano50819852008-11-19 02:07:561287</dt>
1288<dd>
1289<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511290 Pretend as if all the refs in <code>refs/tags</code> are listed
Junio C Hamanod2179ef2010-10-22 04:12:171291 on the command line as <em>&lt;commit&gt;</em>. If <em>&lt;pattern&gt;</em> is given, limit
Junio C Hamano81d540a2012-03-02 19:52:471292 tags to ones matching given shell glob. If pattern lacks <em>?</em>, <em>&#42;</em>,
1293 or <em>[</em>, <em>/&#42;</em> at the end is implied.
Junio C Hamano50819852008-11-19 02:07:561294</p>
1295</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591296<dt class="hdlist1">
Junio C Hamanod2179ef2010-10-22 04:12:171297--remotes[=&lt;pattern&gt;]
Junio C Hamano50819852008-11-19 02:07:561298</dt>
1299<dd>
1300<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511301 Pretend as if all the refs in <code>refs/remotes</code> are listed
Junio C Hamanod2179ef2010-10-22 04:12:171302 on the command line as <em>&lt;commit&gt;</em>. If <em>&lt;pattern&gt;</em> is given, limit
Junio C Hamano97bcb482010-11-25 03:16:071303 remote-tracking branches to ones matching given shell glob.
Junio C Hamano81d540a2012-03-02 19:52:471304 If pattern lacks <em>?</em>, <em>&#42;</em>, or <em>[</em>, <em>/&#42;</em> at the end is implied.
Junio C Hamano57827fb2010-01-23 03:02:501305</p>
1306</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591307<dt class="hdlist1">
Junio C Hamanod2179ef2010-10-22 04:12:171308--glob=&lt;glob-pattern&gt;
Junio C Hamano57827fb2010-01-23 03:02:501309</dt>
1310<dd>
1311<p>
Junio C Hamanod2179ef2010-10-22 04:12:171312 Pretend as if all the refs matching shell glob <em>&lt;glob-pattern&gt;</em>
Junio C Hamano57827fb2010-01-23 03:02:501313 are listed on the command line as <em>&lt;commit&gt;</em>. Leading <em>refs/</em>,
Junio C Hamano81d540a2012-03-02 19:52:471314 is automatically prepended if missing. If pattern lacks <em>?</em>, <em>&#42;</em>,
1315 or <em>[</em>, <em>/&#42;</em> at the end is implied.
Junio C Hamano50819852008-11-19 02:07:561316</p>
1317</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591318<dt class="hdlist1">
Junio C Hamanof079f702013-12-06 23:43:181319--exclude=&lt;glob-pattern&gt;
1320</dt>
1321<dd>
1322<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511323 Do not include refs matching <em>&lt;glob-pattern&gt;</em> that the next <code>--all</code>,
1324 <code>--branches</code>, <code>--tags</code>, <code>--remotes</code>, or <code>--glob</code> would otherwise
Junio C Hamanof079f702013-12-06 23:43:181325 consider. Repetitions of this option accumulate exclusion patterns
Junio C Hamanoac12f0e2014-09-19 22:32:511326 up to the next <code>--all</code>, <code>--branches</code>, <code>--tags</code>, <code>--remotes</code>, or
1327 <code>--glob</code> option (other options or arguments do not clear
Junio C Hamanofb5ffde2014-11-04 22:38:561328 accumulated patterns).
Junio C Hamanof079f702013-12-06 23:43:181329</p>
Junio C Hamanoac12f0e2014-09-19 22:32:511330<div class="paragraph"><p>The patterns given should not begin with <code>refs/heads</code>, <code>refs/tags</code>, or
1331<code>refs/remotes</code> when applied to <code>--branches</code>, <code>--tags</code>, or <code>--remotes</code>,
1332respectively, and they must begin with <code>refs/</code> when applied to <code>--glob</code>
1333or <code>--all</code>. If a trailing <em>/&#42;</em> is intended, it must be given
Junio C Hamanof079f702013-12-06 23:43:181334explicitly.</p></div>
1335</dd>
1336<dt class="hdlist1">
Junio C Hamano42ce67d2023-03-17 21:36:411337--exclude-hidden=[fetch|receive|uploadpack]
Junio C Hamanoe6ab9192022-11-23 04:01:361338</dt>
1339<dd>
1340<p>
Junio C Hamano42ce67d2023-03-17 21:36:411341 Do not include refs that would be hidden by <code>git-fetch</code>,
1342 <code>git-receive-pack</code> or <code>git-upload-pack</code> by consulting the appropriate
1343 <code>fetch.hideRefs</code>, <code>receive.hideRefs</code> or <code>uploadpack.hideRefs</code>
1344 configuration along with <code>transfer.hideRefs</code> (see
Junio C Hamanoe6ab9192022-11-23 04:01:361345 <a href="git-config.html">git-config(1)</a>). This option affects the next pseudo-ref option
1346 <code>--all</code> or <code>--glob</code> and is cleared after processing them.
1347</p>
1348</dd>
1349<dt class="hdlist1">
Junio C Hamano2a4bcbc2014-10-29 20:07:391350--reflog
1351</dt>
1352<dd>
1353<p>
1354 Pretend as if all objects mentioned by reflogs are listed on the
1355 command line as <code>&lt;commit&gt;</code>.
1356</p>
1357</dd>
1358<dt class="hdlist1">
Junio C Hamanoa42e0332019-07-19 19:49:371359--alternate-refs
1360</dt>
1361<dd>
1362<p>
1363 Pretend as if all objects mentioned as ref tips of alternate
1364 repositories were listed on the command line. An alternate
1365 repository is any repository whose object directory is specified
1366 in <code>objects/info/alternates</code>. The set of included objects may
1367 be modified by <code>core.alternateRefsCommand</code>, etc. See
1368 <a href="git-config.html">git-config(1)</a>.
1369</p>
1370</dd>
1371<dt class="hdlist1">
Junio C Hamano8d57fa92017-09-19 05:01:081372--single-worktree
1373</dt>
1374<dd>
1375<p>
1376 By default, all working trees will be examined by the
1377 following options when there are more than one (see
1378 <a href="git-worktree.html">git-worktree(1)</a>): <code>--all</code>, <code>--reflog</code> and
1379 <code>--indexed-objects</code>.
1380 This option forces them to examine the current working tree
1381 only.
1382</p>
1383</dd>
1384<dt class="hdlist1">
Junio C Hamano084228c2011-05-30 08:13:521385--ignore-missing
1386</dt>
1387<dd>
1388<p>
1389 Upon seeing an invalid object name in the input, pretend as if
1390 the bad input was not given.
1391</p>
1392</dd>
1393<dt class="hdlist1">
Junio C Hamano5706e0b2009-11-24 10:54:161394--bisect
1395</dt>
1396<dd>
1397<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511398 Pretend as if the bad bisection ref <code>refs/bisect/bad</code>
1399 was listed and as if it was followed by <code>--not</code> and the good
1400 bisection refs <code>refs/bisect/good-*</code> on the command
Junio C Hamano255163d2020-08-18 00:37:231401 line.
Junio C Hamano5706e0b2009-11-24 10:54:161402</p>
1403</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591404<dt class="hdlist1">
Junio C Hamano5706e0b2009-11-24 10:54:161405--stdin
1406</dt>
1407<dd>
1408<p>
1409 In addition to the <em>&lt;commit&gt;</em> listed on the command
Junio C Hamano92d80372016-07-13 22:00:051410 line, read them from the standard input. If a <code>--</code> separator is
Junio C Hamano5706e0b2009-11-24 10:54:161411 seen, stop reading commits and start reading paths to limit the
1412 result.
1413</p>
1414</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591415<dt class="hdlist1">
Junio C Hamano9a2fb2d2011-03-23 05:40:151416--cherry-mark
1417</dt>
1418<dd>
1419<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511420 Like <code>--cherry-pick</code> (see below) but mark equivalent commits
1421 with <code>=</code> rather than omitting them, and inequivalent ones with <code>+</code>.
Junio C Hamano9a2fb2d2011-03-23 05:40:151422</p>
1423</dd>
1424<dt class="hdlist1">
Junio C Hamanob0e02952008-01-19 08:02:001425--cherry-pick
1426</dt>
1427<dd>
1428<p>
1429 Omit any commit that introduces the same change as
Junio C Hamanob73af6c2013-12-03 22:07:111430 another commit on the &#8220;other side&#8221; when the set of
Junio C Hamano68cf15a2010-11-06 01:01:591431 commits are limited with symmetric difference.
1432</p>
Junio C Hamanoac12f0e2014-09-19 22:32:511433<div class="paragraph"><p>For example, if you have two branches, <code>A</code> and <code>B</code>, a usual way
Junio C Hamanob0e02952008-01-19 08:02:001434to list all commits on only one side of them is with
Junio C Hamanoac12f0e2014-09-19 22:32:511435<code>--left-right</code> (see the example below in the description of
1436the <code>--left-right</code> option). However, it shows the commits that were
Junio C Hamanob73af6c2013-12-03 22:07:111437cherry-picked from the other branch (for example, &#8220;3rd on b&#8221; may be
1438cherry-picked from branch A). With this option, such pairs of commits are
Junio C Hamano68cf15a2010-11-06 01:01:591439excluded from the output.</p></div>
Junio C Hamanob0e02952008-01-19 08:02:001440</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591441<dt class="hdlist1">
Junio C Hamano9a2fb2d2011-03-23 05:40:151442--left-only
1443</dt>
1444<dt class="hdlist1">
1445--right-only
1446</dt>
1447<dd>
1448<p>
Junio C Hamanocd451662016-09-13 00:54:091449 List only commits on the respective side of a symmetric difference,
Junio C Hamanoac12f0e2014-09-19 22:32:511450 i.e. only those which would be marked <code>&lt;</code> resp. <code>&gt;</code> by
1451 <code>--left-right</code>.
Junio C Hamano9a2fb2d2011-03-23 05:40:151452</p>
Junio C Hamanoac12f0e2014-09-19 22:32:511453<div class="paragraph"><p>For example, <code>--cherry-pick --right-only A...B</code> omits those
1454commits from <code>B</code> which are in <code>A</code> or are patch-equivalent to a commit in
1455<code>A</code>. In other words, this lists the <code>+</code> commits from <code>git cherry A B</code>.
1456More precisely, <code>--cherry-pick --right-only --no-merges</code> gives the exact
Junio C Hamano9a2fb2d2011-03-23 05:40:151457list.</p></div>
1458</dd>
1459<dt class="hdlist1">
1460--cherry
1461</dt>
1462<dd>
1463<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511464 A synonym for <code>--right-only --cherry-mark --no-merges</code>; useful to
Junio C Hamano9a2fb2d2011-03-23 05:40:151465 limit the output to the commits on our side and mark those that
1466 have been applied to the other side of a forked history with
Junio C Hamanoac12f0e2014-09-19 22:32:511467 <code>git log --cherry upstream...mybranch</code>, similar to
1468 <code>git cherry upstream mybranch</code>.
Junio C Hamano9a2fb2d2011-03-23 05:40:151469</p>
1470</dd>
1471<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471472-g
1473</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591474<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471475--walk-reflogs
Junio C Hamanob0e02952008-01-19 08:02:001476</dt>
1477<dd>
1478<p>
1479 Instead of walking the commit ancestry chain, walk
1480 reflog entries from the most recent one to older ones.
1481 When this option is used you cannot specify commits to
1482 exclude (that is, <em>&#94;commit</em>, <em>commit1..commit2</em>,
Junio C Hamanod75148a2014-04-08 19:48:381483 and <em>commit1...commit2</em> notations cannot be used).
Junio C Hamano68cf15a2010-11-06 01:01:591484</p>
Junio C Hamanob4896852019-12-10 23:15:091485<div class="paragraph"><p>With <code>--pretty</code> format other than <code>oneline</code> and <code>reference</code> (for obvious reasons),
Junio C Hamanob0e02952008-01-19 08:02:001486this causes the output to have two extra lines of information
Junio C Hamanoe548d1b2016-08-08 22:26:491487taken from the reflog. The reflog designator in the output may be shown
1488as <code>ref@{Nth}</code> (where <code>Nth</code> is the reverse-chronological index in the
1489reflog) or as <code>ref@{timestamp}</code> (with the timestamp for that entry),
1490depending on a few rules:</p></div>
1491<div class="openblock">
1492<div class="content">
1493<div class="olist arabic"><ol class="arabic">
1494<li>
1495<p>
1496If the starting point is specified as <code>ref@{Nth}</code>, show the index
Junio C Hamano2567b322019-02-05 23:33:561497 format.
Junio C Hamanoe548d1b2016-08-08 22:26:491498</p>
1499</li>
1500<li>
1501<p>
1502If the starting point was specified as <code>ref@{now}</code>, show the
Junio C Hamano2567b322019-02-05 23:33:561503 timestamp format.
Junio C Hamanoe548d1b2016-08-08 22:26:491504</p>
1505</li>
1506<li>
1507<p>
1508If neither was used, but <code>--date</code> was given on the command line, show
Junio C Hamano2567b322019-02-05 23:33:561509 the timestamp in the format requested by <code>--date</code>.
Junio C Hamanoe548d1b2016-08-08 22:26:491510</p>
1511</li>
1512<li>
1513<p>
1514Otherwise, show the index format.
1515</p>
1516</li>
1517</ol></div>
1518</div></div>
1519<div class="paragraph"><p>Under <code>--pretty=oneline</code>, the commit message is
Junio C Hamanob0e02952008-01-19 08:02:001520prefixed with this information on the same line.
Junio C Hamanoac12f0e2014-09-19 22:32:511521This option cannot be combined with <code>--reverse</code>.
Junio C Hamanoa28a9202012-06-21 07:08:231522See also <a href="git-reflog.html">git-reflog(1)</a>.</p></div>
Junio C Hamanob4896852019-12-10 23:15:091523<div class="paragraph"><p>Under <code>--pretty=reference</code>, this information will not be shown at all.</p></div>
Junio C Hamanob0e02952008-01-19 08:02:001524</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591525<dt class="hdlist1">
Junio C Hamanob0e02952008-01-19 08:02:001526--merge
1527</dt>
1528<dd>
1529<p>
1530 After a failed merge, show refs that touch files having a
Junio C Hamano68cf15a2010-11-06 01:01:591531 conflict and don&#8217;t exist on all heads to merge.
Junio C Hamanob0e02952008-01-19 08:02:001532</p>
1533</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591534<dt class="hdlist1">
Junio C Hamanob0e02952008-01-19 08:02:001535--boundary
1536</dt>
1537<dd>
1538<p>
Junio C Hamano27159f82013-06-14 17:19:221539 Output excluded boundary commits. Boundary commits are
Junio C Hamanoac12f0e2014-09-19 22:32:511540 prefixed with <code>-</code>.
Junio C Hamanob0e02952008-01-19 08:02:001541</p>
1542</dd>
Junio C Hamanoa76cb0d2008-08-13 20:04:101543</dl></div>
Junio C Hamano9629d4f2012-12-19 00:28:271544</div>
1545<div class="sect2">
1546<h3 id="_history_simplification">History Simplification</h3>
Junio C Hamano68cf15a2010-11-06 01:01:591547<div class="paragraph"><p>Sometimes you are only interested in parts of the history, for example the
Junio C Hamano28363492008-11-14 08:26:311548commits modifying a particular &lt;path&gt;. But there are two parts of
1549<em>History Simplification</em>, one part is selecting the commits and the other
1550is how to do it, as there are various strategies to simplify the history.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591551<div class="paragraph"><p>The following options select the commits to be shown:</p></div>
1552<div class="dlist"><dl>
1553<dt class="hdlist1">
Junio C Hamano28363492008-11-14 08:26:311554&lt;paths&gt;
1555</dt>
1556<dd>
1557<p>
1558 Commits modifying the given &lt;paths&gt; are selected.
1559</p>
1560</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591561<dt class="hdlist1">
Junio C Hamano28363492008-11-14 08:26:311562--simplify-by-decoration
1563</dt>
1564<dd>
1565<p>
1566 Commits that are referred by some branch or tag are selected.
1567</p>
1568</dd>
1569</dl></div>
Junio C Hamano68cf15a2010-11-06 01:01:591570<div class="paragraph"><p>Note that extra commits can be shown to give a meaningful history.</p></div>
1571<div class="paragraph"><p>The following options affect the way the simplification is performed:</p></div>
1572<div class="dlist"><dl>
1573<dt class="hdlist1">
Junio C Hamano28363492008-11-14 08:26:311574Default mode
1575</dt>
1576<dd>
1577<p>
1578 Simplifies the history to the simplest history explaining the
1579 final state of the tree. Simplest because it prunes some side
1580 branches if the end result is the same (i.e. merging branches
1581 with the same content)
1582</p>
1583</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591584<dt class="hdlist1">
Junio C Hamano67bf2242020-04-22 21:41:441585--show-pulls
1586</dt>
1587<dd>
1588<p>
1589 Include all commits from the default mode, but also any merge
1590 commits that are not TREESAME to the first parent but are
1591 TREESAME to a later parent. This mode is helpful for showing
1592 the merge commits that "first introduced" a change to a branch.
1593</p>
1594</dd>
1595<dt class="hdlist1">
Junio C Hamano28363492008-11-14 08:26:311596--full-history
1597</dt>
1598<dd>
1599<p>
Junio C Hamano15567bc2011-07-23 00:51:591600 Same as the default mode, but does not prune some history.
Junio C Hamano28363492008-11-14 08:26:311601</p>
1602</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591603<dt class="hdlist1">
Junio C Hamano28363492008-11-14 08:26:311604--dense
1605</dt>
1606<dd>
1607<p>
1608 Only the selected commits are shown, plus some to have a
1609 meaningful history.
1610</p>
1611</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591612<dt class="hdlist1">
Junio C Hamano28363492008-11-14 08:26:311613--sparse
1614</dt>
1615<dd>
1616<p>
1617 All commits in the simplified history are shown.
1618</p>
1619</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591620<dt class="hdlist1">
Junio C Hamano28363492008-11-14 08:26:311621--simplify-merges
1622</dt>
1623<dd>
1624<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511625 Additional option to <code>--full-history</code> to remove some needless
Junio C Hamano28363492008-11-14 08:26:311626 merges from the resulting history, as there are no selected
1627 commits contributing to this merge.
1628</p>
1629</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591630<dt class="hdlist1">
Junio C Hamano594d2d42022-08-30 17:58:501631--ancestry-path[=&lt;commit&gt;]
Junio C Hamano89a57342010-06-22 23:22:551632</dt>
1633<dd>
1634<p>
1635 When given a range of commits to display (e.g. <em>commit1..commit2</em>
Junio C Hamano594d2d42022-08-30 17:58:501636 or <em>commit2 &#94;commit1</em>), only display commits in that range
1637 that are ancestors of &lt;commit&gt;, descendants of &lt;commit&gt;, or
1638 &lt;commit&gt; itself. If no commit is specified, use <em>commit1</em> (the
1639 excluded part of the range) as &lt;commit&gt;. Can be passed multiple
1640 times; if so, a commit is included if it is any of the commits
1641 given or if it is an ancestor or descendant of one of them.
Junio C Hamano89a57342010-06-22 23:22:551642</p>
1643</dd>
Junio C Hamano28363492008-11-14 08:26:311644</dl></div>
Junio C Hamano68cf15a2010-11-06 01:01:591645<div class="paragraph"><p>A more detailed explanation follows.</p></div>
Junio C Hamanoac12f0e2014-09-19 22:32:511646<div class="paragraph"><p>Suppose you specified <code>foo</code> as the &lt;paths&gt;. We shall call commits
1647that modify <code>foo</code> !TREESAME, and the rest TREESAME. (In a diff
1648filtered for <code>foo</code>, they look different and equal, respectively.)</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591649<div class="paragraph"><p>In the following, we will always refer to the same example history to
Junio C Hamanoa76cb0d2008-08-13 20:04:101650illustrate the differences between simplification settings. We assume
Junio C Hamanoac12f0e2014-09-19 22:32:511651that you are filtering for a file <code>foo</code> in this commit graph:</p></div>
Junio C Hamanoa76cb0d2008-08-13 20:04:101652<div class="listingblock">
1653<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:511654<pre><code> .-A---M---N---O---P---Q
Junio C Hamano27159f82013-06-14 17:19:221655 / / / / / /
1656 I B C D E Y
1657 \ / / / / /
Junio C Hamanoac12f0e2014-09-19 22:32:511658 `-------------' X</code></pre>
Junio C Hamanoa76cb0d2008-08-13 20:04:101659</div></div>
Junio C Hamano27159f82013-06-14 17:19:221660<div class="paragraph"><p>The horizontal line of history A---Q is taken to be the first parent of
Junio C Hamanoa76cb0d2008-08-13 20:04:101661each merge. The commits are:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591662<div class="ulist"><ul>
Junio C Hamanoa76cb0d2008-08-13 20:04:101663<li>
1664<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511665<code>I</code> is the initial commit, in which <code>foo</code> exists with contents
1666 &#8220;asdf&#8221;, and a file <code>quux</code> exists with contents &#8220;quux&#8221;. Initial
1667 commits are compared to an empty tree, so <code>I</code> is !TREESAME.
Junio C Hamanoa76cb0d2008-08-13 20:04:101668</p>
1669</li>
1670<li>
1671<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511672In <code>A</code>, <code>foo</code> contains just &#8220;foo&#8221;.
Junio C Hamanoa76cb0d2008-08-13 20:04:101673</p>
1674</li>
1675<li>
1676<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511677<code>B</code> contains the same change as <code>A</code>. Its merge <code>M</code> is trivial and
Junio C Hamanoa76cb0d2008-08-13 20:04:101678 hence TREESAME to all parents.
1679</p>
1680</li>
1681<li>
1682<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511683<code>C</code> does not change <code>foo</code>, but its merge <code>N</code> changes it to &#8220;foobar&#8221;,
Junio C Hamanoa76cb0d2008-08-13 20:04:101684 so it is not TREESAME to any parent.
1685</p>
1686</li>
1687<li>
1688<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511689<code>D</code> sets <code>foo</code> to &#8220;baz&#8221;. Its merge <code>O</code> combines the strings from
1690 <code>N</code> and <code>D</code> to &#8220;foobarbaz&#8221;; i.e., it is not TREESAME to any parent.
Junio C Hamanoa76cb0d2008-08-13 20:04:101691</p>
1692</li>
1693<li>
1694<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511695<code>E</code> changes <code>quux</code> to &#8220;xyzzy&#8221;, and its merge <code>P</code> combines the
1696 strings to &#8220;quux xyzzy&#8221;. <code>P</code> is TREESAME to <code>O</code>, but not to <code>E</code>.
Junio C Hamano27159f82013-06-14 17:19:221697</p>
1698</li>
1699<li>
1700<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511701<code>X</code> is an independent root commit that added a new file <code>side</code>, and <code>Y</code>
1702 modified it. <code>Y</code> is TREESAME to <code>X</code>. Its merge <code>Q</code> added <code>side</code> to <code>P</code>, and
1703 <code>Q</code> is TREESAME to <code>P</code>, but not to <code>Y</code>.
Junio C Hamanoa76cb0d2008-08-13 20:04:101704</p>
1705</li>
1706</ul></div>
Junio C Hamanoac12f0e2014-09-19 22:32:511707<div class="paragraph"><p><code>rev-list</code> walks backwards through history, including or excluding
1708commits based on whether <code>--full-history</code> and/or parent rewriting
1709(via <code>--parents</code> or <code>--children</code>) are used. The following settings
Junio C Hamanoa76cb0d2008-08-13 20:04:101710are available.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591711<div class="dlist"><dl>
1712<dt class="hdlist1">
Junio C Hamanoa76cb0d2008-08-13 20:04:101713Default mode
1714</dt>
1715<dd>
1716<p>
1717 Commits are included if they are not TREESAME to any parent
Junio C Hamanoac12f0e2014-09-19 22:32:511718 (though this can be changed, see <code>--sparse</code> below). If the
Junio C Hamanoa76cb0d2008-08-13 20:04:101719 commit was a merge, and it was TREESAME to one parent, follow
1720 only that parent. (Even if there are several TREESAME
1721 parents, follow only one of them.) Otherwise, follow all
1722 parents.
1723</p>
Junio C Hamano68cf15a2010-11-06 01:01:591724<div class="paragraph"><p>This results in:</p></div>
Junio C Hamanoa76cb0d2008-08-13 20:04:101725<div class="listingblock">
1726<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:511727<pre><code> .-A---N---O
Junio C Hamano89a57342010-06-22 23:22:551728 / / /
Junio C Hamanoac12f0e2014-09-19 22:32:511729 I---------D</code></pre>
Junio C Hamanoa76cb0d2008-08-13 20:04:101730</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591731<div class="paragraph"><p>Note how the rule to only follow the TREESAME parent, if one is
Junio C Hamanoac12f0e2014-09-19 22:32:511732available, removed <code>B</code> from consideration entirely. <code>C</code> was
1733considered via <code>N</code>, but is TREESAME. Root commits are compared to an
1734empty tree, so <code>I</code> is !TREESAME.</p></div>
1735<div class="paragraph"><p>Parent/child relations are only visible with <code>--parents</code>, but that does
Junio C Hamanoa76cb0d2008-08-13 20:04:101736not affect the commits selected in default mode, so we have shown the
1737parent lines.</p></div>
1738</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591739<dt class="hdlist1">
Junio C Hamanoa76cb0d2008-08-13 20:04:101740--full-history without parent rewriting
1741</dt>
1742<dd>
1743<p>
1744 This mode differs from the default in one point: always follow
1745 all parents of a merge, even if it is TREESAME to one of them.
1746 Even if more than one side of the merge has commits that are
1747 included, this does not imply that the merge itself is! In
1748 the example, we get
1749</p>
1750<div class="listingblock">
1751<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:511752<pre><code> I A B N D O P Q</code></pre>
Junio C Hamanoa76cb0d2008-08-13 20:04:101753</div></div>
Junio C Hamanoac12f0e2014-09-19 22:32:511754<div class="paragraph"><p><code>M</code> was excluded because it is TREESAME to both parents. <code>E</code>,
1755<code>C</code> and <code>B</code> were all walked, but only <code>B</code> was !TREESAME, so the others
Junio C Hamanoa76cb0d2008-08-13 20:04:101756do not appear.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591757<div class="paragraph"><p>Note that without parent rewriting, it is not really possible to talk
Junio C Hamanoa76cb0d2008-08-13 20:04:101758about the parent/child relationships between the commits, so we show
1759them disconnected.</p></div>
1760</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591761<dt class="hdlist1">
Junio C Hamanoa76cb0d2008-08-13 20:04:101762--full-history with parent rewriting
1763</dt>
1764<dd>
1765<p>
1766 Ordinary commits are only included if they are !TREESAME
Junio C Hamanoac12f0e2014-09-19 22:32:511767 (though this can be changed, see <code>--sparse</code> below).
Junio C Hamanoa76cb0d2008-08-13 20:04:101768</p>
Junio C Hamano68cf15a2010-11-06 01:01:591769<div class="paragraph"><p>Merges are always included. However, their parent list is rewritten:
Junio C Hamanoa76cb0d2008-08-13 20:04:101770Along each parent, prune away commits that are not included
1771themselves. This results in</p></div>
1772<div class="listingblock">
1773<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:511774<pre><code> .-A---M---N---O---P---Q
Junio C Hamanoa76cb0d2008-08-13 20:04:101775 / / / / /
1776 I B / D /
1777 \ / / / /
Junio C Hamanoac12f0e2014-09-19 22:32:511778 `-------------'</code></pre>
Junio C Hamanoa76cb0d2008-08-13 20:04:101779</div></div>
Junio C Hamanoac12f0e2014-09-19 22:32:511780<div class="paragraph"><p>Compare to <code>--full-history</code> without rewriting above. Note that <code>E</code>
Junio C Hamanoa76cb0d2008-08-13 20:04:101781was pruned away because it is TREESAME, but the parent list of P was
Junio C Hamanoac12f0e2014-09-19 22:32:511782rewritten to contain <code>E</code>'s parent <code>I</code>. The same happened for <code>C</code> and
1783<code>N</code>, and <code>X</code>, <code>Y</code> and <code>Q</code>.</p></div>
Junio C Hamanoa76cb0d2008-08-13 20:04:101784</dd>
1785</dl></div>
Junio C Hamano68cf15a2010-11-06 01:01:591786<div class="paragraph"><p>In addition to the above settings, you can change whether TREESAME
Junio C Hamanoa76cb0d2008-08-13 20:04:101787affects inclusion:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591788<div class="dlist"><dl>
1789<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471790--dense
1791</dt>
Junio C Hamanoa76cb0d2008-08-13 20:04:101792<dd>
1793<p>
1794 Commits that are walked are included if they are not TREESAME
1795 to any parent.
1796</p>
1797</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591798<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471799--sparse
Junio C Hamanob0e02952008-01-19 08:02:001800</dt>
1801<dd>
1802<p>
Junio C Hamanoa76cb0d2008-08-13 20:04:101803 All commits that are walked are included.
Junio C Hamanob0e02952008-01-19 08:02:001804</p>
Junio C Hamanoac12f0e2014-09-19 22:32:511805<div class="paragraph"><p>Note that without <code>--full-history</code>, this still simplifies merges: if
Junio C Hamanoa76cb0d2008-08-13 20:04:101806one of the parents is TREESAME, we follow only that one, so the other
1807sides of the merge are never walked.</p></div>
Junio C Hamanob0e02952008-01-19 08:02:001808</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591809<dt class="hdlist1">
Junio C Hamanoa2f46622008-09-03 05:20:311810--simplify-merges
1811</dt>
1812<dd>
1813<p>
1814 First, build a history graph in the same way that
Junio C Hamanoac12f0e2014-09-19 22:32:511815 <code>--full-history</code> with parent rewriting does (see above).
Junio C Hamanoa2f46622008-09-03 05:20:311816</p>
Junio C Hamanoac12f0e2014-09-19 22:32:511817<div class="paragraph"><p>Then simplify each commit <code>C</code> to its replacement <code>C'</code> in the final
Junio C Hamanoa2f46622008-09-03 05:20:311818history according to the following rules:</p></div>
Junio C Hamano9629d4f2012-12-19 00:28:271819<div class="openblock">
1820<div class="content">
Junio C Hamano68cf15a2010-11-06 01:01:591821<div class="ulist"><ul>
Junio C Hamanoa2f46622008-09-03 05:20:311822<li>
1823<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511824Set <code>C'</code> to <code>C</code>.
Junio C Hamanoa2f46622008-09-03 05:20:311825</p>
1826</li>
1827<li>
1828<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511829Replace each parent <code>P</code> of <code>C'</code> with its simplification <code>P'</code>. In
Junio C Hamano27159f82013-06-14 17:19:221830 the process, drop parents that are ancestors of other parents or that are
1831 root commits TREESAME to an empty tree, and remove duplicates, but take care
1832 to never drop all parents that we are TREESAME to.
Junio C Hamanoa2f46622008-09-03 05:20:311833</p>
1834</li>
1835<li>
1836<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511837If after this parent rewriting, <code>C'</code> is a root or merge commit (has
Junio C Hamanoa2f46622008-09-03 05:20:311838 zero or &gt;1 parents), a boundary commit, or !TREESAME, it remains.
1839 Otherwise, it is replaced with its only parent.
1840</p>
1841</li>
1842</ul></div>
Junio C Hamano9629d4f2012-12-19 00:28:271843</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591844<div class="paragraph"><p>The effect of this is best shown by way of comparing to
Junio C Hamanoac12f0e2014-09-19 22:32:511845<code>--full-history</code> with parent rewriting. The example turns into:</p></div>
Junio C Hamanoa2f46622008-09-03 05:20:311846<div class="listingblock">
1847<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:511848<pre><code> .-A---M---N---O
Junio C Hamanoa2f46622008-09-03 05:20:311849 / / /
1850 I B D
1851 \ / /
Junio C Hamanoac12f0e2014-09-19 22:32:511852 `---------'</code></pre>
Junio C Hamanoa2f46622008-09-03 05:20:311853</div></div>
Junio C Hamanoac12f0e2014-09-19 22:32:511854<div class="paragraph"><p>Note the major differences in <code>N</code>, <code>P</code>, and <code>Q</code> over <code>--full-history</code>:</p></div>
Junio C Hamano9629d4f2012-12-19 00:28:271855<div class="openblock">
1856<div class="content">
Junio C Hamano68cf15a2010-11-06 01:01:591857<div class="ulist"><ul>
Junio C Hamanoa2f46622008-09-03 05:20:311858<li>
1859<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511860<code>N</code>'s parent list had <code>I</code> removed, because it is an ancestor of the
1861 other parent <code>M</code>. Still, <code>N</code> remained because it is !TREESAME.
Junio C Hamanoa2f46622008-09-03 05:20:311862</p>
1863</li>
1864<li>
1865<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511866<code>P</code>'s parent list similarly had <code>I</code> removed. <code>P</code> was then
Junio C Hamanoa2f46622008-09-03 05:20:311867 removed completely, because it had one parent and is TREESAME.
1868</p>
1869</li>
Junio C Hamano27159f82013-06-14 17:19:221870<li>
1871<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511872<code>Q</code>'s parent list had <code>Y</code> simplified to <code>X</code>. <code>X</code> was then removed, because it
1873 was a TREESAME root. <code>Q</code> was then removed completely, because it had one
Junio C Hamano27159f82013-06-14 17:19:221874 parent and is TREESAME.
1875</p>
1876</li>
Junio C Hamanoa2f46622008-09-03 05:20:311877</ul></div>
Junio C Hamano9629d4f2012-12-19 00:28:271878</div></div>
Junio C Hamanoa2f46622008-09-03 05:20:311879</dd>
1880</dl></div>
Junio C Hamano67bf2242020-04-22 21:41:441881<div class="paragraph"><p>There is another simplification mode available:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591882<div class="dlist"><dl>
1883<dt class="hdlist1">
Junio C Hamano594d2d42022-08-30 17:58:501884--ancestry-path[=&lt;commit&gt;]
Junio C Hamano89a57342010-06-22 23:22:551885</dt>
1886<dd>
1887<p>
Junio C Hamano594d2d42022-08-30 17:58:501888 Limit the displayed commits to those which are an ancestor of
1889 &lt;commit&gt;, or which are a descendant of &lt;commit&gt;, or are &lt;commit&gt;
1890 itself.
Junio C Hamano89a57342010-06-22 23:22:551891</p>
Junio C Hamano68cf15a2010-11-06 01:01:591892<div class="paragraph"><p>As an example use case, consider the following commit history:</p></div>
Junio C Hamano89a57342010-06-22 23:22:551893<div class="listingblock">
1894<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:511895<pre><code> D---E-------F
Junio C Hamano89a57342010-06-22 23:22:551896 / \ \
1897 B---C---G---H---I---J
1898 / \
Junio C Hamanoac12f0e2014-09-19 22:32:511899 A-------K---------------L--M</code></pre>
Junio C Hamano89a57342010-06-22 23:22:551900</div></div>
Junio C Hamanoac12f0e2014-09-19 22:32:511901<div class="paragraph"><p>A regular <em>D..M</em> computes the set of commits that are ancestors of <code>M</code>,
1902but excludes the ones that are ancestors of <code>D</code>. This is useful to see
1903what happened to the history leading to <code>M</code> since <code>D</code>, in the sense
1904that &#8220;what does <code>M</code> have that did not exist in <code>D</code>&#8221;. The result in this
1905example would be all the commits, except <code>A</code> and <code>B</code> (and <code>D</code> itself,
Junio C Hamano89a57342010-06-22 23:22:551906of course).</p></div>
Junio C Hamanoac12f0e2014-09-19 22:32:511907<div class="paragraph"><p>When we want to find out what commits in <code>M</code> are contaminated with the
1908bug introduced by <code>D</code> and need fixing, however, we might want to view
1909only the subset of <em>D..M</em> that are actually descendants of <code>D</code>, i.e.
1910excluding <code>C</code> and <code>K</code>. This is exactly what the <code>--ancestry-path</code>
Junio C Hamano89a57342010-06-22 23:22:551911option does. Applied to the <em>D..M</em> range, it results in:</p></div>
1912<div class="listingblock">
1913<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:511914<pre><code> E-------F
Junio C Hamano89a57342010-06-22 23:22:551915 \ \
1916 G---H---I---J
1917 \
Junio C Hamanoac12f0e2014-09-19 22:32:511918 L--M</code></pre>
Junio C Hamano89a57342010-06-22 23:22:551919</div></div>
Junio C Hamano594d2d42022-08-30 17:58:501920<div class="paragraph"><p>We can also use <code>--ancestry-path=D</code> instead of <code>--ancestry-path</code> which
1921means the same thing when applied to the <em>D..M</em> range but is just more
1922explicit.</p></div>
1923<div class="paragraph"><p>If we instead are interested in a given topic within this range, and all
1924commits affected by that topic, we may only want to view the subset of
1925<code>D..M</code> which contain that topic in their ancestry path. So, using
1926<code>--ancestry-path=H D..M</code> for example would result in:</p></div>
1927<div class="listingblock">
1928<div class="content">
1929<pre><code> E
1930 \
1931 G---H---I---J
1932 \
1933 L--M</code></pre>
1934</div></div>
1935<div class="paragraph"><p>Whereas <code>--ancestry-path=K D..M</code> would result in</p></div>
1936<div class="listingblock">
1937<div class="content">
1938<pre><code> K---------------L--M</code></pre>
1939</div></div>
Junio C Hamano89a57342010-06-22 23:22:551940</dd>
1941</dl></div>
Junio C Hamano67bf2242020-04-22 21:41:441942<div class="paragraph"><p>Before discussing another option, <code>--show-pulls</code>, we need to
1943create a new example history.</p></div>
Junio C Hamano0cb719f2020-05-31 20:04:391944<div class="paragraph"><p>A common problem users face when looking at simplified history is that a
Junio C Hamano67bf2242020-04-22 21:41:441945commit they know changed a file somehow does not appear in the file&#8217;s
1946simplified history. Let&#8217;s demonstrate a new example and show how options
1947such as <code>--full-history</code> and <code>--simplify-merges</code> works in that case:</p></div>
Junio C Hamano67bf2242020-04-22 21:41:441948<div class="listingblock">
1949<div class="content">
1950<pre><code> .-A---M-----C--N---O---P
1951 / / \ \ \/ / /
1952 I B \ R-'`-Z' /
1953 \ / \/ /
1954 \ / /\ /
1955 `---X--' `---Y--'</code></pre>
1956</div></div>
Junio C Hamano0cb719f2020-05-31 20:04:391957<div class="paragraph"><p>For this example, suppose <code>I</code> created <code>file.txt</code> which was modified by
Junio C Hamano67bf2242020-04-22 21:41:441958<code>A</code>, <code>B</code>, and <code>X</code> in different ways. The single-parent commits <code>C</code>, <code>Z</code>,
1959and <code>Y</code> do not change <code>file.txt</code>. The merge commit <code>M</code> was created by
1960resolving the merge conflict to include both changes from <code>A</code> and <code>B</code>
1961and hence is not TREESAME to either. The merge commit <code>R</code>, however, was
1962created by ignoring the contents of <code>file.txt</code> at <code>M</code> and taking only
1963the contents of <code>file.txt</code> at <code>X</code>. Hence, <code>R</code> is TREESAME to <code>X</code> but not
1964<code>M</code>. Finally, the natural merge resolution to create <code>N</code> is to take the
1965contents of <code>file.txt</code> at <code>R</code>, so <code>N</code> is TREESAME to <code>R</code> but not <code>C</code>.
1966The merge commits <code>O</code> and <code>P</code> are TREESAME to their first parents, but
1967not to their second parents, <code>Z</code> and <code>Y</code> respectively.</p></div>
Junio C Hamano0cb719f2020-05-31 20:04:391968<div class="paragraph"><p>When using the default mode, <code>N</code> and <code>R</code> both have a TREESAME parent, so
Junio C Hamano67bf2242020-04-22 21:41:441969those edges are walked and the others are ignored. The resulting history
1970graph is:</p></div>
Junio C Hamano67bf2242020-04-22 21:41:441971<div class="listingblock">
1972<div class="content">
1973<pre><code> I---X</code></pre>
1974</div></div>
Junio C Hamano0cb719f2020-05-31 20:04:391975<div class="paragraph"><p>When using <code>--full-history</code>, Git walks every edge. This will discover
Junio C Hamano67bf2242020-04-22 21:41:441976the commits <code>A</code> and <code>B</code> and the merge <code>M</code>, but also will reveal the
1977merge commits <code>O</code> and <code>P</code>. With parent rewriting, the resulting graph is:</p></div>
Junio C Hamano67bf2242020-04-22 21:41:441978<div class="listingblock">
1979<div class="content">
1980<pre><code> .-A---M--------N---O---P
1981 / / \ \ \/ / /
1982 I B \ R-'`--' /
1983 \ / \/ /
1984 \ / /\ /
1985 `---X--' `------'</code></pre>
1986</div></div>
Junio C Hamano0cb719f2020-05-31 20:04:391987<div class="paragraph"><p>Here, the merge commits <code>O</code> and <code>P</code> contribute extra noise, as they did
Junio C Hamano67bf2242020-04-22 21:41:441988not actually contribute a change to <code>file.txt</code>. They only merged a topic
1989that was based on an older version of <code>file.txt</code>. This is a common
1990issue in repositories using a workflow where many contributors work in
Junio C Hamano594d2d42022-08-30 17:58:501991parallel and merge their topic branches along a single trunk: many
Junio C Hamano67bf2242020-04-22 21:41:441992unrelated merges appear in the <code>--full-history</code> results.</p></div>
Junio C Hamano0cb719f2020-05-31 20:04:391993<div class="paragraph"><p>When using the <code>--simplify-merges</code> option, the commits <code>O</code> and <code>P</code>
Junio C Hamano67bf2242020-04-22 21:41:441994disappear from the results. This is because the rewritten second parents
1995of <code>O</code> and <code>P</code> are reachable from their first parents. Those edges are
1996removed and then the commits look like single-parent commits that are
1997TREESAME to their parent. This also happens to the commit <code>N</code>, resulting
1998in a history view as follows:</p></div>
Junio C Hamano67bf2242020-04-22 21:41:441999<div class="listingblock">
2000<div class="content">
2001<pre><code> .-A---M--.
2002 / / \
2003 I B R
2004 \ / /
2005 \ / /
2006 `---X--'</code></pre>
2007</div></div>
Junio C Hamano0cb719f2020-05-31 20:04:392008<div class="paragraph"><p>In this view, we see all of the important single-parent changes from
Junio C Hamano67bf2242020-04-22 21:41:442009<code>A</code>, <code>B</code>, and <code>X</code>. We also see the carefully-resolved merge <code>M</code> and the
2010not-so-carefully-resolved merge <code>R</code>. This is usually enough information
2011to determine why the commits <code>A</code> and <code>B</code> "disappeared" from history in
2012the default view. However, there are a few issues with this approach.</p></div>
Junio C Hamano0cb719f2020-05-31 20:04:392013<div class="paragraph"><p>The first issue is performance. Unlike any previous option, the
Junio C Hamano67bf2242020-04-22 21:41:442014<code>--simplify-merges</code> option requires walking the entire commit history
2015before returning a single result. This can make the option difficult to
2016use for very large repositories.</p></div>
Junio C Hamano0cb719f2020-05-31 20:04:392017<div class="paragraph"><p>The second issue is one of auditing. When many contributors are working
Junio C Hamano67bf2242020-04-22 21:41:442018on the same repository, it is important which merge commits introduced
2019a change into an important branch. The problematic merge <code>R</code> above is
2020not likely to be the merge commit that was used to merge into an
2021important branch. Instead, the merge <code>N</code> was used to merge <code>R</code> and <code>X</code>
2022into the important branch. This commit may have information about why
2023the change <code>X</code> came to override the changes from <code>A</code> and <code>B</code> in its
2024commit message.</p></div>
Junio C Hamano0cb719f2020-05-31 20:04:392025<div class="dlist"><dl>
2026<dt class="hdlist1">
2027--show-pulls
2028</dt>
2029<dd>
2030<p>
2031 In addition to the commits shown in the default history, show
2032 each merge commit that is not TREESAME to its first parent but
2033 is TREESAME to a later parent.
2034</p>
2035<div class="paragraph"><p>When a merge commit is included by <code>--show-pulls</code>, the merge is
Junio C Hamano67bf2242020-04-22 21:41:442036treated as if it "pulled" the change from another branch. When using
2037<code>--show-pulls</code> on this example (and no other options) the resulting
2038graph is:</p></div>
Junio C Hamano67bf2242020-04-22 21:41:442039<div class="listingblock">
2040<div class="content">
2041<pre><code> I---X---R---N</code></pre>
2042</div></div>
Junio C Hamano0cb719f2020-05-31 20:04:392043<div class="paragraph"><p>Here, the merge commits <code>R</code> and <code>N</code> are included because they pulled
Junio C Hamano67bf2242020-04-22 21:41:442044the commits <code>X</code> and <code>R</code> into the base branch, respectively. These
2045merges are the reason the commits <code>A</code> and <code>B</code> do not appear in the
2046default history.</p></div>
Junio C Hamano0cb719f2020-05-31 20:04:392047<div class="paragraph"><p>When <code>--show-pulls</code> is paired with <code>--simplify-merges</code>, the
Junio C Hamano67bf2242020-04-22 21:41:442048graph includes all of the necessary information:</p></div>
Junio C Hamano67bf2242020-04-22 21:41:442049<div class="listingblock">
2050<div class="content">
2051<pre><code> .-A---M--. N
2052 / / \ /
2053 I B R
2054 \ / /
2055 \ / /
2056 `---X--'</code></pre>
2057</div></div>
Junio C Hamano0cb719f2020-05-31 20:04:392058<div class="paragraph"><p>Notice that since <code>M</code> is reachable from <code>R</code>, the edge from <code>N</code> to <code>M</code>
Junio C Hamano67bf2242020-04-22 21:41:442059was simplified away. However, <code>N</code> still appears in the history as an
2060important commit because it "pulled" the change <code>R</code> into the main
2061branch.</p></div>
Junio C Hamano0cb719f2020-05-31 20:04:392062</dd>
2063</dl></div>
Junio C Hamanoac12f0e2014-09-19 22:32:512064<div class="paragraph"><p>The <code>--simplify-by-decoration</code> option allows you to view only the
Junio C Hamano28363492008-11-14 08:26:312065big picture of the topology of the history, by omitting commits
2066that are not referenced by tags. Commits are marked as !TREESAME
2067(in other words, kept after history simplification rules described
2068above) if (1) they are referenced by tags, or (2) they change the
2069contents of the paths given on the command line. All other
2070commits are marked as TREESAME (subject to be simplified away).</p></div>
Junio C Hamano9629d4f2012-12-19 00:28:272071</div>
2072<div class="sect2">
2073<h3 id="_commit_ordering">Commit Ordering</h3>
Junio C Hamano68cf15a2010-11-06 01:01:592074<div class="paragraph"><p>By default, the commits are shown in reverse chronological order.</p></div>
2075<div class="dlist"><dl>
2076<dt class="hdlist1">
Junio C Hamanob0e02952008-01-19 08:02:002077--date-order
2078</dt>
2079<dd>
2080<p>
Junio C Hamanod0316112012-08-22 19:55:292081 Show no parents before all of its children are shown, but
2082 otherwise show commits in the commit timestamp order.
Junio C Hamanob0e02952008-01-19 08:02:002083</p>
2084</dd>
Junio C Hamano68cf15a2010-11-06 01:01:592085<dt class="hdlist1">
Junio C Hamanoa1952302013-07-01 21:31:182086--author-date-order
2087</dt>
2088<dd>
2089<p>
2090 Show no parents before all of its children are shown, but
2091 otherwise show commits in the author timestamp order.
2092</p>
2093</dd>
2094<dt class="hdlist1">
Junio C Hamanod0316112012-08-22 19:55:292095--topo-order
2096</dt>
2097<dd>
2098<p>
2099 Show no parents before all of its children are shown, and
2100 avoid showing commits on multiple lines of history
2101 intermixed.
2102</p>
2103<div class="paragraph"><p>For example, in a commit history like this:</p></div>
2104<div class="listingblock">
2105<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512106<pre><code> ---1----2----4----7
Junio C Hamanod0316112012-08-22 19:55:292107 \ \
Junio C Hamanoac12f0e2014-09-19 22:32:512108 3----5----6----8---</code></pre>
Junio C Hamanod0316112012-08-22 19:55:292109</div></div>
Junio C Hamanoac12f0e2014-09-19 22:32:512110<div class="paragraph"><p>where the numbers denote the order of commit timestamps, <code>git
2111rev-list</code> and friends with <code>--date-order</code> show the commits in the
Junio C Hamanod0316112012-08-22 19:55:292112timestamp order: 8 7 6 5 4 3 2 1.</p></div>
Junio C Hamanoac12f0e2014-09-19 22:32:512113<div class="paragraph"><p>With <code>--topo-order</code>, they would show 8 6 5 3 7 4 2 1 (or 8 7 4 2 6 5
Junio C Hamanod0316112012-08-22 19:55:2921143 1); some older commits are shown before newer ones in order to
2115avoid showing the commits from two parallel development track mixed
2116together.</p></div>
2117</dd>
2118<dt class="hdlist1">
Junio C Hamanob0e02952008-01-19 08:02:002119--reverse
2120</dt>
2121<dd>
2122<p>
Junio C Hamanof3ca7b82016-10-03 22:27:022123 Output the commits chosen to be shown (see Commit Limiting
2124 section above) in reverse order. Cannot be combined with
2125 <code>--walk-reflogs</code>.
Junio C Hamanob0e02952008-01-19 08:02:002126</p>
2127</dd>
Junio C Hamanoba4b9282008-07-06 05:20:312128</dl></div>
Junio C Hamano9629d4f2012-12-19 00:28:272129</div>
2130<div class="sect2">
2131<h3 id="_object_traversal">Object Traversal</h3>
Junio C Hamano076ffcc2013-02-06 05:13:212132<div class="paragraph"><p>These options are mostly targeted for packing of Git repositories.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592133<div class="dlist"><dl>
2134<dt class="hdlist1">
Junio C Hamanoeccdd4a2012-09-10 23:28:172135--no-walk[=(sorted|unsorted)]
Junio C Hamanob0e02952008-01-19 08:02:002136</dt>
2137<dd>
2138<p>
Junio C Hamanoeccdd4a2012-09-10 23:28:172139 Only show the given commits, but do not traverse their ancestors.
2140 This has no effect if a range is specified. If the argument
Junio C Hamanoac12f0e2014-09-19 22:32:512141 <code>unsorted</code> is given, the commits are shown in the order they were
2142 given on the command line. Otherwise (if <code>sorted</code> or no argument
Junio C Hamanob73af6c2013-12-03 22:07:112143 was given), the commits are shown in reverse chronological order
Junio C Hamanoeccdd4a2012-09-10 23:28:172144 by commit time.
Junio C Hamanoe8fdbbb2021-11-12 23:42:032145 Cannot be combined with <code>--graph</code>.
Junio C Hamanob0e02952008-01-19 08:02:002146</p>
2147</dd>
Junio C Hamano68cf15a2010-11-06 01:01:592148<dt class="hdlist1">
Junio C Hamanob0e02952008-01-19 08:02:002149--do-walk
2150</dt>
2151<dd>
2152<p>
Junio C Hamanoac12f0e2014-09-19 22:32:512153 Overrides a previous <code>--no-walk</code>.
Junio C Hamanob0e02952008-01-19 08:02:002154</p>
2155</dd>
Junio C Hamanoba4b9282008-07-06 05:20:312156</dl></div>
Junio C Hamano9629d4f2012-12-19 00:28:272157</div>
2158<div class="sect2">
2159<h3 id="_commit_formatting">Commit Formatting</h3>
Junio C Hamanod2c978f2011-03-20 19:42:222160<div class="dlist"><dl>
2161<dt class="hdlist1">
2162--pretty[=&lt;format&gt;]
2163</dt>
2164<dt class="hdlist1">
2165--format=&lt;format&gt;
2166</dt>
2167<dd>
2168<p>
2169 Pretty-print the contents of the commit logs in a given format,
2170 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:092171 <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:262172 and <em>tformat:&lt;string&gt;</em>. When <em>&lt;format&gt;</em> is none of the above,
2173 and has <em>%placeholder</em> in it, it acts as if
2174 <em>--pretty=tformat:&lt;format&gt;</em> were given.
Junio C Hamanod2c978f2011-03-20 19:42:222175</p>
Junio C Hamano6bb32e62015-02-17 22:11:262176<div class="paragraph"><p>See the "PRETTY FORMATS" section for some additional details for each
2177format. When <em>=&lt;format&gt;</em> part is omitted, it defaults to <em>medium</em>.</p></div>
Junio C Hamanod2c978f2011-03-20 19:42:222178<div class="paragraph"><p>Note: you can specify the default pretty format in the repository
Junio C Hamanoa28a9202012-06-21 07:08:232179configuration (see <a href="git-config.html">git-config(1)</a>).</p></div>
Junio C Hamanod2c978f2011-03-20 19:42:222180</dd>
2181<dt class="hdlist1">
2182--abbrev-commit
2183</dt>
2184<dd>
2185<p>
2186 Instead of showing the full 40-byte hexadecimal commit object
Junio C Hamanoee43d182020-11-11 22:10:412187 name, show a prefix that names the object uniquely.
2188 "--abbrev=&lt;n&gt;" (which also modifies diff output, if it is displayed)
2189 option can be used to specify the minimum length of the prefix.
Junio C Hamanod2c978f2011-03-20 19:42:222190</p>
2191<div class="paragraph"><p>This should make "--pretty=oneline" a whole lot more readable for
2192people using 80-column terminals.</p></div>
2193</dd>
2194<dt class="hdlist1">
Junio C Hamanof93530e2011-05-25 23:59:592195--no-abbrev-commit
2196</dt>
2197<dd>
2198<p>
2199 Show the full 40-byte hexadecimal commit object name. This negates
Junio C Hamano558abd22020-09-03 20:22:342200 <code>--abbrev-commit</code>, either explicit or implied by other options such
2201 as "--oneline". It also overrides the <code>log.abbrevCommit</code> variable.
Junio C Hamanof93530e2011-05-25 23:59:592202</p>
2203</dd>
2204<dt class="hdlist1">
Junio C Hamanod2c978f2011-03-20 19:42:222205--oneline
2206</dt>
2207<dd>
2208<p>
2209 This is a shorthand for "--pretty=oneline --abbrev-commit"
2210 used together.
2211</p>
2212</dd>
2213<dt class="hdlist1">
Junio C Hamanoc5bb3b32013-08-05 22:43:362214--encoding=&lt;encoding&gt;
Junio C Hamanod2c978f2011-03-20 19:42:222215</dt>
2216<dd>
2217<p>
Junio C Hamano7d6f46e2021-09-10 19:54:212218 Commit objects record the character encoding used for the log message
Junio C Hamanod2c978f2011-03-20 19:42:222219 in their encoding header; this option can be used to tell the
2220 command to re-code the commit log message in the encoding
2221 preferred by the user. For non plumbing commands this
Junio C Hamano823eebb2015-07-10 22:29:342222 defaults to UTF-8. Note that if an object claims to be encoded
2223 in <code>X</code> and we are outputting in <code>X</code>, we will output the object
2224 verbatim; this means that invalid sequences in the original
Junio C Hamano7d6f46e2021-09-10 19:54:212225 commit may be copied to the output. Likewise, if iconv(3) fails
Junio C Hamano19dcd3f2021-10-29 23:20:472226 to convert the commit, we will quietly output the original
2227 object verbatim.
Junio C Hamanod2c978f2011-03-20 19:42:222228</p>
2229</dd>
2230<dt class="hdlist1">
Junio C Hamano5996b672016-04-13 22:01:412231--expand-tabs=&lt;n&gt;
2232</dt>
2233<dt class="hdlist1">
2234--expand-tabs
2235</dt>
2236<dt class="hdlist1">
2237--no-expand-tabs
2238</dt>
2239<dd>
2240<p>
2241 Perform a tab expansion (replace each tab with enough spaces
2242 to fill to the next display column that is multiple of <em>&lt;n&gt;</em>)
2243 in the log message before showing it in the output.
2244 <code>--expand-tabs</code> is a short-hand for <code>--expand-tabs=8</code>, and
2245 <code>--no-expand-tabs</code> is a short-hand for <code>--expand-tabs=0</code>,
2246 which disables tab expansion.
2247</p>
2248<div class="paragraph"><p>By default, tabs are expanded in pretty formats that indent the log
2249message by 4 spaces (i.e. <em>medium</em>, which is the default, <em>full</em>,
2250and <em>fuller</em>).</p></div>
2251</dd>
2252<dt class="hdlist1">
Junio C Hamanob3f862c2019-12-05 22:22:002253--notes[=&lt;ref&gt;]
Junio C Hamanod2c978f2011-03-20 19:42:222254</dt>
2255<dd>
2256<p>
Junio C Hamanoa28a9202012-06-21 07:08:232257 Show the notes (see <a href="git-notes.html">git-notes(1)</a>) that annotate the
Junio C Hamanod2c978f2011-03-20 19:42:222258 commit, when showing the commit log message. This is the default
Junio C Hamanoac12f0e2014-09-19 22:32:512259 for <code>git log</code>, <code>git show</code> and <code>git whatchanged</code> commands when
2260 there is no <code>--pretty</code>, <code>--format</code>, or <code>--oneline</code> option given
Junio C Hamano60033462011-05-03 00:48:432261 on the command line.
Junio C Hamanod2c978f2011-03-20 19:42:222262</p>
Junio C Hamano60033462011-05-03 00:48:432263<div class="paragraph"><p>By default, the notes shown are from the notes refs listed in the
Junio C Hamano042f2142016-06-27 18:05:052264<code>core.notesRef</code> and <code>notes.displayRef</code> variables (or corresponding
Junio C Hamanoa28a9202012-06-21 07:08:232265environment overrides). See <a href="git-config.html">git-config(1)</a> for more details.</p></div>
Junio C Hamanob3f862c2019-12-05 22:22:002266<div class="paragraph"><p>With an optional <em>&lt;ref&gt;</em> argument, use the ref to find the notes
2267to display. The ref can specify the full refname when it begins
Junio C Hamano1f7c4a52015-10-14 22:15:512268with <code>refs/notes/</code>; when it begins with <code>notes/</code>, <code>refs/</code> and otherwise
2269<code>refs/notes/</code> is prefixed to form a full name of the ref.</p></div>
Junio C Hamano60033462011-05-03 00:48:432270<div class="paragraph"><p>Multiple --notes options can be combined to control which notes are
2271being displayed. Examples: "--notes=foo" will show only notes from
2272"refs/notes/foo"; "--notes=foo --notes" will show both notes from
2273"refs/notes/foo" and from the default notes ref(s).</p></div>
Junio C Hamanod2c978f2011-03-20 19:42:222274</dd>
2275<dt class="hdlist1">
Junio C Hamano60033462011-05-03 00:48:432276--no-notes
2277</dt>
2278<dd>
2279<p>
Junio C Hamanoac12f0e2014-09-19 22:32:512280 Do not show notes. This negates the above <code>--notes</code> option, by
Junio C Hamano60033462011-05-03 00:48:432281 resetting the list of notes refs from which notes are shown.
2282 Options are parsed in the order given on the command line, so e.g.
2283 "--notes --notes=foo --no-notes --notes=bar" will only show notes
2284 from "refs/notes/bar".
2285</p>
2286</dd>
2287<dt class="hdlist1">
Junio C Hamanob3f862c2019-12-05 22:22:002288--show-notes[=&lt;ref&gt;]
Junio C Hamano60033462011-05-03 00:48:432289</dt>
2290<dt class="hdlist1">
Junio C Hamanod2c978f2011-03-20 19:42:222291--[no-]standard-notes
2292</dt>
2293<dd>
2294<p>
Junio C Hamano60033462011-05-03 00:48:432295 These options are deprecated. Use the above --notes/--no-notes
2296 options instead.
Junio C Hamanod2c978f2011-03-20 19:42:222297</p>
2298</dd>
2299<dt class="hdlist1">
Junio C Hamano0acb1ae2012-09-24 21:28:132300--show-signature
2301</dt>
2302<dd>
2303<p>
2304 Check the validity of a signed commit object by passing the signature
Junio C Hamanoac12f0e2014-09-19 22:32:512305 to <code>gpg --verify</code> and show the output.
Junio C Hamano0acb1ae2012-09-24 21:28:132306</p>
2307</dd>
2308<dt class="hdlist1">
Junio C Hamanod2c978f2011-03-20 19:42:222309--relative-date
2310</dt>
2311<dd>
2312<p>
Junio C Hamanoac12f0e2014-09-19 22:32:512313 Synonym for <code>--date=relative</code>.
Junio C Hamanod2c978f2011-03-20 19:42:222314</p>
2315</dd>
2316<dt class="hdlist1">
Junio C Hamano1eb56092015-10-05 20:39:532317--date=&lt;format&gt;
Junio C Hamanod2c978f2011-03-20 19:42:222318</dt>
2319<dd>
2320<p>
2321 Only takes effect for dates shown in human-readable format, such
Junio C Hamanoac12f0e2014-09-19 22:32:512322 as when using <code>--pretty</code>. <code>log.date</code> config variable sets a default
Junio C Hamano1eb56092015-10-05 20:39:532323 value for the log command&#8217;s <code>--date</code> option. By default, dates
2324 are shown in the original time zone (either committer&#8217;s or
2325 author&#8217;s). If <code>-local</code> is appended to the format (e.g.,
2326 <code>iso-local</code>), the user&#8217;s local time zone is used instead.
Junio C Hamanod2c978f2011-03-20 19:42:222327</p>
Junio C Hamanob5513772019-04-22 03:38:392328<div class="openblock">
2329<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512330<div class="paragraph"><p><code>--date=relative</code> shows dates relative to the current time,
Junio C Hamanoe548d1b2016-08-08 22:26:492331e.g. &#8220;2 hours ago&#8221;. The <code>-local</code> option has no effect for
2332<code>--date=relative</code>.</p></div>
Junio C Hamano1eb56092015-10-05 20:39:532333<div class="paragraph"><p><code>--date=local</code> is an alias for <code>--date=default-local</code>.</p></div>
Junio C Hamanoac12f0e2014-09-19 22:32:512334<div class="paragraph"><p><code>--date=iso</code> (or <code>--date=iso8601</code>) shows timestamps in a ISO 8601-like format.
2335The differences to the strict ISO 8601 format are:</p></div>
2336<div class="ulist"><ul>
2337<li>
2338<p>
2339a space instead of the <code>T</code> date/time delimiter
2340</p>
2341</li>
2342<li>
2343<p>
2344a space between time and time zone
2345</p>
2346</li>
2347<li>
2348<p>
2349no colon between hours and minutes of the time zone
2350</p>
2351</li>
2352</ul></div>
2353<div class="paragraph"><p><code>--date=iso-strict</code> (or <code>--date=iso8601-strict</code>) shows timestamps in strict
2354ISO 8601 format.</p></div>
2355<div class="paragraph"><p><code>--date=rfc</code> (or <code>--date=rfc2822</code>) shows timestamps in RFC 2822
Junio C Hamanob73af6c2013-12-03 22:07:112356format, often found in email messages.</p></div>
Junio C Hamanoac12f0e2014-09-19 22:32:512357<div class="paragraph"><p><code>--date=short</code> shows only the date, but not the time, in <code>YYYY-MM-DD</code> format.</p></div>
Junio C Hamanoe548d1b2016-08-08 22:26:492358<div class="paragraph"><p><code>--date=raw</code> shows the date as seconds since the epoch (1970-01-01
235900:00:00 UTC), followed by a space, and then the timezone as an offset
2360from UTC (a <code>+</code> or <code>-</code> with four digits; the first two are hours, and
2361the second two are minutes). I.e., as if the timestamp were formatted
2362with <code>strftime("%s %z")</code>).
2363Note that the <code>-local</code> option does not affect the seconds-since-epoch
2364value (which is always measured in UTC), but does switch the accompanying
2365timezone value.</p></div>
Junio C Hamano23168ef2019-02-07 07:20:472366<div class="paragraph"><p><code>--date=human</code> shows the timezone if the timezone does not match the
2367current time-zone, and doesn&#8217;t print the whole date if that matches
2368(ie skip printing year for dates that are "this year", but also skip
2369the whole date itself if it&#8217;s in the last few days and we can just say
2370what weekday it was). For older dates the hour and minute is also
2371omitted.</p></div>
Junio C Hamanoe548d1b2016-08-08 22:26:492372<div class="paragraph"><p><code>--date=unix</code> shows the date as a Unix epoch timestamp (seconds since
23731970). As with <code>--raw</code>, this is always in UTC and therefore <code>-local</code>
2374has no effect.</p></div>
Junio C Hamano55d91912017-06-22 22:32:462375<div class="paragraph"><p><code>--date=format:...</code> feeds the format <code>...</code> to your system <code>strftime</code>,
Junio C Hamano59a32b02021-12-10 22:53:382376except for %s, %z, and %Z, which are handled internally.
Junio C Hamanod7ed4042015-08-03 19:43:002377Use <code>--date=format:%c</code> to show the date in your system locale&#8217;s
2378preferred format. See the <code>strftime</code> manual for a complete list of
Junio C Hamano1eb56092015-10-05 20:39:532379format placeholders. When using <code>-local</code>, the correct syntax is
2380<code>--date=format-local:...</code>.</p></div>
Junio C Hamano613334c2023-02-24 19:54:382381<div class="paragraph"><p><code>--date=default</code> is the default format, and is based on ctime(3)
2382output. It shows a single line with three-letter day of the week,
2383three-letter month, day-of-month, hour-minute-seconds in "HH:MM:SS"
2384format, followed by 4-digit year, plus timezone information, unless
2385the local time zone is used, e.g. <code>Thu Jan 1 00:00:00 1970 +0000</code>.</p></div>
Junio C Hamanob5513772019-04-22 03:38:392386</div></div>
Junio C Hamanod2c978f2011-03-20 19:42:222387</dd>
2388<dt class="hdlist1">
2389--parents
2390</dt>
2391<dd>
2392<p>
2393 Print also the parents of the commit (in the form "commit parent&#8230;").
Junio C Hamanoce019c02017-10-30 05:57:462394 Also enables parent rewriting, see <em>History Simplification</em> above.
Junio C Hamanod2c978f2011-03-20 19:42:222395</p>
2396</dd>
2397<dt class="hdlist1">
2398--children
2399</dt>
2400<dd>
2401<p>
2402 Print also the children of the commit (in the form "commit child&#8230;").
Junio C Hamanoce019c02017-10-30 05:57:462403 Also enables parent rewriting, see <em>History Simplification</em> above.
Junio C Hamanod2c978f2011-03-20 19:42:222404</p>
2405</dd>
2406<dt class="hdlist1">
2407--left-right
2408</dt>
2409<dd>
2410<p>
Junio C Hamanocd451662016-09-13 00:54:092411 Mark which side of a symmetric difference a commit is reachable from.
Junio C Hamanoac12f0e2014-09-19 22:32:512412 Commits from the left side are prefixed with <code>&lt;</code> and those from
2413 the right with <code>&gt;</code>. If combined with <code>--boundary</code>, those
2414 commits are prefixed with <code>-</code>.
Junio C Hamanod2c978f2011-03-20 19:42:222415</p>
2416<div class="paragraph"><p>For example, if you have this topology:</p></div>
2417<div class="listingblock">
2418<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512419<pre><code> y---b---b branch B
Junio C Hamanod2c978f2011-03-20 19:42:222420 / \ /
2421 / .
2422 / / \
Junio C Hamanoac12f0e2014-09-19 22:32:512423 o---x---a---a branch A</code></pre>
Junio C Hamanod2c978f2011-03-20 19:42:222424</div></div>
2425<div class="paragraph"><p>you would get an output like this:</p></div>
2426<div class="listingblock">
2427<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512428<pre><code> $ git rev-list --left-right --boundary --pretty=oneline A...B
Junio C Hamanod2c978f2011-03-20 19:42:222429
2430 &gt;bbbbbbb... 3rd on b
2431 &gt;bbbbbbb... 2nd on b
2432 &lt;aaaaaaa... 3rd on a
2433 &lt;aaaaaaa... 2nd on a
2434 -yyyyyyy... 1st on b
Junio C Hamanoac12f0e2014-09-19 22:32:512435 -xxxxxxx... 1st on a</code></pre>
Junio C Hamanod2c978f2011-03-20 19:42:222436</div></div>
2437</dd>
2438<dt class="hdlist1">
2439--graph
2440</dt>
2441<dd>
2442<p>
2443 Draw a text-based graphical representation of the commit history
2444 on the left hand side of the output. This may cause extra lines
2445 to be printed in between commits, in order for the graph history
2446 to be drawn properly.
Junio C Hamanoef57d1e2015-03-25 21:23:002447 Cannot be combined with <code>--no-walk</code>.
Junio C Hamanod2c978f2011-03-20 19:42:222448</p>
Junio C Hamanoce019c02017-10-30 05:57:462449<div class="paragraph"><p>This enables parent rewriting, see <em>History Simplification</em> above.</p></div>
Junio C Hamanoac12f0e2014-09-19 22:32:512450<div class="paragraph"><p>This implies the <code>--topo-order</code> option by default, but the
2451<code>--date-order</code> option may also be specified.</p></div>
Junio C Hamanod2c978f2011-03-20 19:42:222452</dd>
Junio C Hamano624dd4c2014-04-03 21:56:302453<dt class="hdlist1">
2454--show-linear-break[=&lt;barrier&gt;]
2455</dt>
2456<dd>
2457<p>
2458 When --graph is not used, all history branches are flattened
2459 which can make it hard to see that the two consecutive commits
2460 do not belong to a linear branch. This option puts a barrier
Junio C Hamanoac12f0e2014-09-19 22:32:512461 in between them in that case. If <code>&lt;barrier&gt;</code> is specified, it
Junio C Hamano624dd4c2014-04-03 21:56:302462 is the string that will be shown instead of the default one.
2463</p>
2464</dd>
Junio C Hamanod2c978f2011-03-20 19:42:222465</dl></div>
Junio C Hamano9629d4f2012-12-19 00:28:272466</div>
Junio C Hamano9629d4f2012-12-19 00:28:272467</div>
2468</div>
2469<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:312470<h2 id="_pretty_formats">PRETTY FORMATS</h2>
Junio C Hamano0430e3a2007-05-15 03:13:172471<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:592472<div class="paragraph"><p>If the commit is a merge, and if the pretty-format
Junio C Hamano0430e3a2007-05-15 03:13:172473is not <em>oneline</em>, <em>email</em> or <em>raw</em>, an additional line is
2474inserted before the <em>Author:</em> line. This line begins with
Junio C Hamanob4896852019-12-10 23:15:092475"Merge: " and the hashes of ancestral commits are printed,
Junio C Hamano0430e3a2007-05-15 03:13:172476separated by spaces. Note that the listed commits may not
2477necessarily be the list of the <strong>direct</strong> parent commits if you
2478have limited your view of history: for example, if you are
2479only interested in changes related to a certain directory or
Junio C Hamanoba4b9282008-07-06 05:20:312480file.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592481<div class="paragraph"><p>There are several built-in formats, and you can define
Junio C Hamanoa574a092010-06-13 19:57:102482additional formats by setting a pretty.&lt;name&gt;
2483config option to either another format name, or a
2484<em>format:</em> string, as described below (see
Junio C Hamanoa28a9202012-06-21 07:08:232485<a href="git-config.html">git-config(1)</a>). Here are the details of the
Junio C Hamanoa574a092010-06-13 19:57:102486built-in formats:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592487<div class="ulist"><ul>
Junio C Hamanoa340aaa2006-11-23 02:47:332488<li>
2489<p>
2490<em>oneline</em>
2491</p>
2492<div class="literalblock">
2493<div class="content">
Junio C Hamano59a32b02021-12-10 22:53:382494<pre><code>&lt;hash&gt; &lt;title-line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332495</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592496<div class="paragraph"><p>This is designed to be as compact as possible.</p></div>
Junio C Hamanoa340aaa2006-11-23 02:47:332497</li>
2498<li>
2499<p>
2500<em>short</em>
2501</p>
2502<div class="literalblock">
2503<div class="content">
Junio C Hamanob4896852019-12-10 23:15:092504<pre><code>commit &lt;hash&gt;
Junio C Hamanoac12f0e2014-09-19 22:32:512505Author: &lt;author&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332506</div></div>
2507<div class="literalblock">
2508<div class="content">
Junio C Hamano59a32b02021-12-10 22:53:382509<pre><code>&lt;title-line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332510</div></div>
2511</li>
2512<li>
2513<p>
2514<em>medium</em>
2515</p>
2516<div class="literalblock">
2517<div class="content">
Junio C Hamanob4896852019-12-10 23:15:092518<pre><code>commit &lt;hash&gt;
Junio C Hamanoa340aaa2006-11-23 02:47:332519Author: &lt;author&gt;
Junio C Hamano59a32b02021-12-10 22:53:382520Date: &lt;author-date&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332521</div></div>
2522<div class="literalblock">
2523<div class="content">
Junio C Hamano59a32b02021-12-10 22:53:382524<pre><code>&lt;title-line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332525</div></div>
2526<div class="literalblock">
2527<div class="content">
Junio C Hamano59a32b02021-12-10 22:53:382528<pre><code>&lt;full-commit-message&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332529</div></div>
2530</li>
2531<li>
2532<p>
2533<em>full</em>
2534</p>
2535<div class="literalblock">
2536<div class="content">
Junio C Hamanob4896852019-12-10 23:15:092537<pre><code>commit &lt;hash&gt;
Junio C Hamanoa340aaa2006-11-23 02:47:332538Author: &lt;author&gt;
Junio C Hamanoac12f0e2014-09-19 22:32:512539Commit: &lt;committer&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332540</div></div>
2541<div class="literalblock">
2542<div class="content">
Junio C Hamano59a32b02021-12-10 22:53:382543<pre><code>&lt;title-line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332544</div></div>
2545<div class="literalblock">
2546<div class="content">
Junio C Hamano59a32b02021-12-10 22:53:382547<pre><code>&lt;full-commit-message&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332548</div></div>
2549</li>
2550<li>
2551<p>
2552<em>fuller</em>
2553</p>
2554<div class="literalblock">
2555<div class="content">
Junio C Hamanob4896852019-12-10 23:15:092556<pre><code>commit &lt;hash&gt;
Junio C Hamano6a3c8272008-12-19 21:38:182557Author: &lt;author&gt;
Junio C Hamano59a32b02021-12-10 22:53:382558AuthorDate: &lt;author-date&gt;
Junio C Hamano6a3c8272008-12-19 21:38:182559Commit: &lt;committer&gt;
Junio C Hamano59a32b02021-12-10 22:53:382560CommitDate: &lt;committer-date&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332561</div></div>
2562<div class="literalblock">
2563<div class="content">
Junio C Hamano59a32b02021-12-10 22:53:382564<pre><code>&lt;title-line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332565</div></div>
2566<div class="literalblock">
2567<div class="content">
Junio C Hamano59a32b02021-12-10 22:53:382568<pre><code>&lt;full-commit-message&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332569</div></div>
2570</li>
2571<li>
2572<p>
Junio C Hamanob4896852019-12-10 23:15:092573<em>reference</em>
2574</p>
2575<div class="literalblock">
2576<div class="content">
Junio C Hamano59a32b02021-12-10 22:53:382577<pre><code>&lt;abbrev-hash&gt; (&lt;title-line&gt;, &lt;short-author-date&gt;)</code></pre>
Junio C Hamanob4896852019-12-10 23:15:092578</div></div>
2579<div class="paragraph"><p>This format is used to refer to another commit in a commit message and
2580is the same as <code>--pretty='format:%C(auto)%h (%s, %ad)'</code>. By default,
2581the date is formatted with <code>--date=short</code> unless another <code>--date</code> option
2582is explicitly specified. As with any <code>format:</code> with format
2583placeholders, its output is not affected by other options like
2584<code>--decorate</code> and <code>--walk-reflogs</code>.</p></div>
2585</li>
2586<li>
2587<p>
Junio C Hamanoa340aaa2006-11-23 02:47:332588<em>email</em>
2589</p>
2590<div class="literalblock">
2591<div class="content">
Junio C Hamanob4896852019-12-10 23:15:092592<pre><code>From &lt;hash&gt; &lt;date&gt;
Junio C Hamanoa340aaa2006-11-23 02:47:332593From: &lt;author&gt;
Junio C Hamano59a32b02021-12-10 22:53:382594Date: &lt;author-date&gt;
2595Subject: [PATCH] &lt;title-line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332596</div></div>
2597<div class="literalblock">
2598<div class="content">
Junio C Hamano59a32b02021-12-10 22:53:382599<pre><code>&lt;full-commit-message&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332600</div></div>
2601</li>
2602<li>
2603<p>
Junio C Hamano0dd50942020-04-29 21:21:052604<em>mboxrd</em>
2605</p>
2606<div class="paragraph"><p>Like <em>email</em>, but lines in the commit message starting with "From "
2607(preceded by zero or more "&gt;") are quoted with "&gt;" so they aren&#8217;t
2608confused as starting a new commit.</p></div>
2609</li>
2610<li>
2611<p>
Junio C Hamanoa340aaa2006-11-23 02:47:332612<em>raw</em>
2613</p>
Junio C Hamano68cf15a2010-11-06 01:01:592614<div class="paragraph"><p>The <em>raw</em> format shows the entire commit exactly as
Junio C Hamanob4896852019-12-10 23:15:092615stored in the commit object. Notably, the hashes are
Junio C Hamanoa340aaa2006-11-23 02:47:332616displayed in full, regardless of whether --abbrev or
2617--no-abbrev are used, and <em>parents</em> information show the
Junio C Hamanod75148a2014-04-08 19:48:382618true parent commits, without taking grafts or history
Junio C Hamano85f1fde2015-06-01 20:37:322619simplification into account. Note that this format affects the way
2620commits are displayed, but not the way the diff is shown e.g. with
2621<code>git log --raw</code>. To get full object names in a raw diff format,
2622use <code>--no-abbrev</code>.</p></div>
Junio C Hamanoa340aaa2006-11-23 02:47:332623</li>
Junio C Hamanoa3fd83c2007-03-02 10:34:362624<li>
2625<p>
Junio C Hamano59a32b02021-12-10 22:53:382626<em>format:&lt;format-string&gt;</em>
Junio C Hamanoa3fd83c2007-03-02 10:34:362627</p>
Junio C Hamano59a32b02021-12-10 22:53:382628<div class="paragraph"><p>The <em>format:&lt;format-string&gt;</em> format allows you to specify which information
Junio C Hamanoa3fd83c2007-03-02 10:34:362629you want to show. It works a little bit like printf format,
2630with the notable exception that you get a newline with <em>%n</em>
Junio C Hamanoba4b9282008-07-06 05:20:312631instead of <em>\n</em>.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592632<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:312633would show something like this:</p></div>
Junio C Hamano0430e3a2007-05-15 03:13:172634<div class="listingblock">
2635<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512636<pre><code>The author of fe6e0ee was Junio C Hamano, 23 hours ago
2637The 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:172638</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592639<div class="paragraph"><p>The placeholders are:</p></div>
2640<div class="ulist"><ul>
Junio C Hamanoa3fd83c2007-03-02 10:34:362641<li>
2642<p>
Junio C Hamano11f15372019-03-07 03:17:002643Placeholders that expand to a single literal character:
2644</p>
2645<div class="dlist"><dl>
2646<dt class="hdlist1">
2647<em>%n</em>
2648</dt>
2649<dd>
2650<p>
2651newline
2652</p>
2653</dd>
2654<dt class="hdlist1">
2655<em>%%</em>
2656</dt>
2657<dd>
2658<p>
2659a raw <em>%</em>
2660</p>
2661</dd>
2662<dt class="hdlist1">
2663<em>%x00</em>
2664</dt>
2665<dd>
2666<p>
2667print a byte from a hex code
2668</p>
2669</dd>
2670</dl></div>
2671</li>
2672<li>
2673<p>
2674Placeholders that affect formatting of later placeholders:
2675</p>
2676<div class="dlist"><dl>
2677<dt class="hdlist1">
2678<em>%Cred</em>
2679</dt>
2680<dd>
2681<p>
2682switch color to red
2683</p>
2684</dd>
2685<dt class="hdlist1">
2686<em>%Cgreen</em>
2687</dt>
2688<dd>
2689<p>
2690switch color to green
2691</p>
2692</dd>
2693<dt class="hdlist1">
2694<em>%Cblue</em>
2695</dt>
2696<dd>
2697<p>
2698switch color to blue
2699</p>
2700</dd>
2701<dt class="hdlist1">
2702<em>%Creset</em>
2703</dt>
2704<dd>
2705<p>
2706reset color
2707</p>
2708</dd>
2709<dt class="hdlist1">
2710<em>%C(&#8230;)</em>
2711</dt>
2712<dd>
2713<p>
2714color specification, as described under Values in the
2715 "CONFIGURATION FILE" section of <a href="git-config.html">git-config(1)</a>. By
2716 default, colors are shown only when enabled for log output
2717 (by <code>color.diff</code>, <code>color.ui</code>, or <code>--color</code>, and respecting
2718 the <code>auto</code> settings of the former if we are going to a
2719 terminal). <code>%C(auto,...)</code> is accepted as a historical
2720 synonym for the default (e.g., <code>%C(auto,red)</code>). Specifying
2721 <code>%C(always,...)</code> will show the colors even when color is
2722 not otherwise enabled (though consider just using
2723 <code>--color=always</code> to enable color for the whole output,
2724 including this format and anything else git might color).
2725 <code>auto</code> alone (i.e. <code>%C(auto)</code>) will turn on auto coloring
2726 on the next placeholders until the color is switched
2727 again.
2728</p>
2729</dd>
2730<dt class="hdlist1">
2731<em>%m</em>
2732</dt>
2733<dd>
2734<p>
2735left (<code>&lt;</code>), right (<code>&gt;</code>) or boundary (<code>-</code>) mark
2736</p>
2737</dd>
2738<dt class="hdlist1">
2739<em>%w([&lt;w&gt;[,&lt;i1&gt;[,&lt;i2&gt;]]])</em>
2740</dt>
2741<dd>
2742<p>
2743switch line wrapping, like the -w option of
2744 <a href="git-shortlog.html">git-shortlog(1)</a>.
2745</p>
2746</dd>
2747<dt class="hdlist1">
Junio C Hamano11f1df12023-01-30 22:48:082748<em>%&lt;( &lt;N&gt; [,trunc|ltrunc|mtrunc])</em>
Junio C Hamano11f15372019-03-07 03:17:002749</dt>
2750<dd>
2751<p>
2752make the next placeholder take at
Junio C Hamano11f1df12023-01-30 22:48:082753 least N column widths, padding spaces on
Junio C Hamano11f15372019-03-07 03:17:002754 the right if necessary. Optionally
Junio C Hamano11f1df12023-01-30 22:48:082755 truncate (with ellipsis <em>..</em>) at the left (ltrunc) <code>..ft</code>,
2756 the middle (mtrunc) <code>mi..le</code>, or the end
2757 (trunc) <code>rig..</code>, if the output is longer than
2758 N columns.
2759 Note 1: that truncating
Junio C Hamano11f15372019-03-07 03:17:002760 only works correctly with N &gt;= 2.
Junio C Hamano11f1df12023-01-30 22:48:082761 Note 2: spaces around the N and M (see below)
2762 values are optional.
2763 Note 3: Emojis and other wide characters
2764 will take two display columns, which may
2765 over-run column boundaries.
2766 Note 4: decomposed character combining marks
2767 may be misplaced at padding boundaries.
Junio C Hamano11f15372019-03-07 03:17:002768</p>
2769</dd>
2770<dt class="hdlist1">
Junio C Hamano11f1df12023-01-30 22:48:082771<em>%&lt;|( &lt;M&gt; )</em>
Junio C Hamano11f15372019-03-07 03:17:002772</dt>
2773<dd>
2774<p>
Junio C Hamano11f1df12023-01-30 22:48:082775make the next placeholder take at least until Mth
2776 display column, padding spaces on the right if necessary.
2777 Use negative M values for column positions measured
2778 from the right hand edge of the terminal window.
Junio C Hamano11f15372019-03-07 03:17:002779</p>
2780</dd>
2781<dt class="hdlist1">
Junio C Hamano11f1df12023-01-30 22:48:082782<em>%&gt;( &lt;N&gt; )</em>, <em>%&gt;|( &lt;M&gt; )</em>
Junio C Hamano11f15372019-03-07 03:17:002783</dt>
2784<dd>
2785<p>
Junio C Hamano11f1df12023-01-30 22:48:082786similar to <em>%&lt;( &lt;N&gt; )</em>, <em>%&lt;|( &lt;M&gt; )</em> respectively,
Junio C Hamano11f15372019-03-07 03:17:002787 but padding spaces on the left
2788</p>
2789</dd>
2790<dt class="hdlist1">
Junio C Hamano11f1df12023-01-30 22:48:082791<em>%&gt;&gt;( &lt;N&gt; )</em>, <em>%&gt;&gt;|( &lt;M&gt; )</em>
Junio C Hamano11f15372019-03-07 03:17:002792</dt>
2793<dd>
2794<p>
Junio C Hamano11f1df12023-01-30 22:48:082795similar to <em>%&gt;( &lt;N&gt; )</em>, <em>%&gt;|( &lt;M&gt; )</em>
Junio C Hamano11f15372019-03-07 03:17:002796 respectively, except that if the next
2797 placeholder takes more spaces than given and
2798 there are spaces on its left, use those
2799 spaces
2800</p>
2801</dd>
2802<dt class="hdlist1">
Junio C Hamano11f1df12023-01-30 22:48:082803<em>%&gt;&lt;( &lt;N&gt; )</em>, <em>%&gt;&lt;|( &lt;M&gt; )</em>
Junio C Hamano11f15372019-03-07 03:17:002804</dt>
2805<dd>
2806<p>
Junio C Hamano11f1df12023-01-30 22:48:082807similar to <em>%&lt;( &lt;N&gt; )</em>, <em>%&lt;|( &lt;M&gt; )</em>
Junio C Hamano11f15372019-03-07 03:17:002808 respectively, but padding both sides
2809 (i.e. the text is centered)
2810</p>
2811</dd>
2812</dl></div>
2813</li>
2814<li>
2815<p>
2816Placeholders that expand to information extracted from the commit:
2817</p>
2818<div class="dlist"><dl>
2819<dt class="hdlist1">
2820<em>%H</em>
2821</dt>
2822<dd>
2823<p>
2824commit hash
2825</p>
2826</dd>
2827<dt class="hdlist1">
2828<em>%h</em>
2829</dt>
2830<dd>
2831<p>
2832abbreviated commit hash
2833</p>
2834</dd>
2835<dt class="hdlist1">
2836<em>%T</em>
2837</dt>
2838<dd>
2839<p>
2840tree hash
2841</p>
2842</dd>
2843<dt class="hdlist1">
2844<em>%t</em>
2845</dt>
2846<dd>
2847<p>
2848abbreviated tree hash
2849</p>
2850</dd>
2851<dt class="hdlist1">
2852<em>%P</em>
2853</dt>
2854<dd>
2855<p>
2856parent hashes
2857</p>
2858</dd>
2859<dt class="hdlist1">
2860<em>%p</em>
2861</dt>
2862<dd>
2863<p>
2864abbreviated parent hashes
2865</p>
2866</dd>
2867<dt class="hdlist1">
2868<em>%an</em>
2869</dt>
2870<dd>
2871<p>
2872author name
2873</p>
2874</dd>
2875<dt class="hdlist1">
2876<em>%aN</em>
2877</dt>
2878<dd>
2879<p>
2880author name (respecting .mailmap, see <a href="git-shortlog.html">git-shortlog(1)</a>
2881 or <a href="git-blame.html">git-blame(1)</a>)
2882</p>
2883</dd>
2884<dt class="hdlist1">
2885<em>%ae</em>
2886</dt>
2887<dd>
2888<p>
2889author email
2890</p>
2891</dd>
2892<dt class="hdlist1">
2893<em>%aE</em>
2894</dt>
2895<dd>
2896<p>
2897author email (respecting .mailmap, see <a href="git-shortlog.html">git-shortlog(1)</a>
2898 or <a href="git-blame.html">git-blame(1)</a>)
2899</p>
2900</dd>
2901<dt class="hdlist1">
Junio C Hamano8ac8a3d2019-11-11 04:33:462902<em>%al</em>
2903</dt>
2904<dd>
2905<p>
2906author email local-part (the part before the <em>@</em> sign)
2907</p>
2908</dd>
2909<dt class="hdlist1">
2910<em>%aL</em>
2911</dt>
2912<dd>
2913<p>
2914author local-part (see <em>%al</em>) respecting .mailmap, see
2915 <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)
2916</p>
2917</dd>
2918<dt class="hdlist1">
Junio C Hamano11f15372019-03-07 03:17:002919<em>%ad</em>
2920</dt>
2921<dd>
2922<p>
2923author date (format respects --date= option)
2924</p>
2925</dd>
2926<dt class="hdlist1">
2927<em>%aD</em>
2928</dt>
2929<dd>
2930<p>
2931author date, RFC2822 style
2932</p>
2933</dd>
2934<dt class="hdlist1">
2935<em>%ar</em>
2936</dt>
2937<dd>
2938<p>
2939author date, relative
2940</p>
2941</dd>
2942<dt class="hdlist1">
2943<em>%at</em>
2944</dt>
2945<dd>
2946<p>
2947author date, UNIX timestamp
2948</p>
2949</dd>
2950<dt class="hdlist1">
2951<em>%ai</em>
2952</dt>
2953<dd>
2954<p>
2955author date, ISO 8601-like format
2956</p>
2957</dd>
2958<dt class="hdlist1">
2959<em>%aI</em>
2960</dt>
2961<dd>
2962<p>
2963author date, strict ISO 8601 format
2964</p>
2965</dd>
2966<dt class="hdlist1">
Junio C Hamanob4896852019-12-10 23:15:092967<em>%as</em>
2968</dt>
2969<dd>
2970<p>
2971author date, short format (<code>YYYY-MM-DD</code>)
2972</p>
2973</dd>
2974<dt class="hdlist1">
Junio C Hamanobe601db2021-05-07 04:20:282975<em>%ah</em>
2976</dt>
2977<dd>
2978<p>
2979author date, human style (like the <code>--date=human</code> option of
2980 <a href="git-rev-list.html">git-rev-list(1)</a>)
2981</p>
2982</dd>
2983<dt class="hdlist1">
Junio C Hamano11f15372019-03-07 03:17:002984<em>%cn</em>
2985</dt>
2986<dd>
2987<p>
2988committer name
2989</p>
2990</dd>
2991<dt class="hdlist1">
2992<em>%cN</em>
2993</dt>
2994<dd>
2995<p>
2996committer name (respecting .mailmap, see
2997 <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)
2998</p>
2999</dd>
3000<dt class="hdlist1">
3001<em>%ce</em>
3002</dt>
3003<dd>
3004<p>
3005committer email
3006</p>
3007</dd>
3008<dt class="hdlist1">
3009<em>%cE</em>
3010</dt>
3011<dd>
3012<p>
3013committer email (respecting .mailmap, see
3014 <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)
3015</p>
3016</dd>
3017<dt class="hdlist1">
Junio C Hamano8ac8a3d2019-11-11 04:33:463018<em>%cl</em>
3019</dt>
3020<dd>
3021<p>
Junio C Hamanoa8911782020-07-07 05:35:573022committer email local-part (the part before the <em>@</em> sign)
Junio C Hamano8ac8a3d2019-11-11 04:33:463023</p>
3024</dd>
3025<dt class="hdlist1">
3026<em>%cL</em>
3027</dt>
3028<dd>
3029<p>
Junio C Hamanoa8911782020-07-07 05:35:573030committer local-part (see <em>%cl</em>) respecting .mailmap, see
Junio C Hamano8ac8a3d2019-11-11 04:33:463031 <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)
3032</p>
3033</dd>
3034<dt class="hdlist1">
Junio C Hamano11f15372019-03-07 03:17:003035<em>%cd</em>
3036</dt>
3037<dd>
3038<p>
3039committer date (format respects --date= option)
3040</p>
3041</dd>
3042<dt class="hdlist1">
3043<em>%cD</em>
3044</dt>
3045<dd>
3046<p>
3047committer date, RFC2822 style
3048</p>
3049</dd>
3050<dt class="hdlist1">
3051<em>%cr</em>
3052</dt>
3053<dd>
3054<p>
3055committer date, relative
3056</p>
3057</dd>
3058<dt class="hdlist1">
3059<em>%ct</em>
3060</dt>
3061<dd>
3062<p>
3063committer date, UNIX timestamp
3064</p>
3065</dd>
3066<dt class="hdlist1">
3067<em>%ci</em>
3068</dt>
3069<dd>
3070<p>
3071committer date, ISO 8601-like format
3072</p>
3073</dd>
3074<dt class="hdlist1">
3075<em>%cI</em>
3076</dt>
3077<dd>
3078<p>
3079committer date, strict ISO 8601 format
3080</p>
3081</dd>
3082<dt class="hdlist1">
Junio C Hamanob4896852019-12-10 23:15:093083<em>%cs</em>
3084</dt>
3085<dd>
3086<p>
3087committer date, short format (<code>YYYY-MM-DD</code>)
3088</p>
3089</dd>
3090<dt class="hdlist1">
Junio C Hamanobe601db2021-05-07 04:20:283091<em>%ch</em>
3092</dt>
3093<dd>
3094<p>
Junio C Hamano608b11d2021-05-16 21:40:453095committer date, human style (like the <code>--date=human</code> option of
Junio C Hamanobe601db2021-05-07 04:20:283096 <a href="git-rev-list.html">git-rev-list(1)</a>)
3097</p>
3098</dd>
3099<dt class="hdlist1">
Junio C Hamano11f15372019-03-07 03:17:003100<em>%d</em>
3101</dt>
3102<dd>
3103<p>
3104ref names, like the --decorate option of <a href="git-log.html">git-log(1)</a>
3105</p>
3106</dd>
3107<dt class="hdlist1">
3108<em>%D</em>
3109</dt>
3110<dd>
3111<p>
3112ref names without the " (", ")" wrapping.
3113</p>
3114</dd>
3115<dt class="hdlist1">
Junio C Hamano458281a2021-03-22 21:20:263116<em>%(describe[:options])</em>
3117</dt>
3118<dd>
3119<p>
3120human-readable name, like
3121 <a href="git-describe.html">git-describe(1)</a>; empty string for
3122 undescribable commits. The <code>describe</code> string
3123 may be followed by a colon and zero or more
3124 comma-separated options. Descriptions can be
3125 inconsistent when tags are added or removed at
3126 the same time.
3127</p>
3128<div class="ulist"><ul>
3129<li>
3130<p>
Junio C Hamano2b153182021-12-15 21:00:313131<em>tags[=&lt;bool-value&gt;]</em>: Instead of only considering annotated tags,
3132 consider lightweight tags as well.
3133</p>
3134</li>
3135<li>
3136<p>
3137<em>abbrev=&lt;number&gt;</em>: Instead of using the default number of hexadecimal digits
3138 (which will vary according to the number of objects in the repository with a
3139 default of 7) of the abbreviated object name, use &lt;number&gt; digits, or as many
3140 digits as needed to form a unique object name.
3141</p>
3142</li>
3143<li>
3144<p>
Junio C Hamano458281a2021-03-22 21:20:263145<em>match=&lt;pattern&gt;</em>: Only consider tags matching the given
3146 <code>glob(7)</code> pattern, excluding the "refs/tags/" prefix.
3147</p>
3148</li>
3149<li>
3150<p>
3151<em>exclude=&lt;pattern&gt;</em>: Do not consider tags matching the given
3152 <code>glob(7)</code> pattern, excluding the "refs/tags/" prefix.
3153</p>
3154</li>
3155</ul></div>
3156</dd>
3157<dt class="hdlist1">
Junio C Hamano11f15372019-03-07 03:17:003158<em>%S</em>
3159</dt>
3160<dd>
3161<p>
3162ref name given on the command line by which the commit was reached
3163 (like <code>git log --source</code>), only works with <code>git log</code>
3164</p>
3165</dd>
3166<dt class="hdlist1">
3167<em>%e</em>
3168</dt>
3169<dd>
3170<p>
3171encoding
3172</p>
3173</dd>
3174<dt class="hdlist1">
3175<em>%s</em>
3176</dt>
3177<dd>
3178<p>
3179subject
3180</p>
3181</dd>
3182<dt class="hdlist1">
3183<em>%f</em>
3184</dt>
3185<dd>
3186<p>
3187sanitized subject line, suitable for a filename
3188</p>
3189</dd>
3190<dt class="hdlist1">
3191<em>%b</em>
3192</dt>
3193<dd>
3194<p>
3195body
3196</p>
3197</dd>
3198<dt class="hdlist1">
3199<em>%B</em>
3200</dt>
3201<dd>
3202<p>
3203raw body (unwrapped subject and body)
3204</p>
3205</dd>
3206<dt class="hdlist1">
3207<em>%N</em>
3208</dt>
3209<dd>
3210<p>
3211commit notes
3212</p>
3213</dd>
3214<dt class="hdlist1">
3215<em>%GG</em>
3216</dt>
3217<dd>
3218<p>
3219raw verification message from GPG for a signed commit
3220</p>
3221</dd>
3222<dt class="hdlist1">
3223<em>%G?</em>
3224</dt>
3225<dd>
3226<p>
3227show "G" for a good (valid) signature,
3228 "B" for a bad signature,
3229 "U" for a good signature with unknown validity,
3230 "X" for a good signature that has expired,
3231 "Y" for a good signature made by an expired key,
3232 "R" for a good signature made by a revoked key,
3233 "E" if the signature cannot be checked (e.g. missing key)
3234 and "N" for no signature
3235</p>
3236</dd>
3237<dt class="hdlist1">
3238<em>%GS</em>
3239</dt>
3240<dd>
3241<p>
3242show the name of the signer for a signed commit
3243</p>
3244</dd>
3245<dt class="hdlist1">
3246<em>%GK</em>
3247</dt>
3248<dd>
3249<p>
3250show the key used to sign a signed commit
3251</p>
3252</dd>
3253<dt class="hdlist1">
3254<em>%GF</em>
3255</dt>
3256<dd>
3257<p>
3258show the fingerprint of the key used to sign a signed commit
3259</p>
3260</dd>
3261<dt class="hdlist1">
3262<em>%GP</em>
3263</dt>
3264<dd>
3265<p>
3266show the fingerprint of the primary key whose subkey was used
3267 to sign a signed commit
3268</p>
3269</dd>
3270<dt class="hdlist1">
Junio C Hamanobee061d2020-01-30 23:21:183271<em>%GT</em>
3272</dt>
3273<dd>
3274<p>
3275show the trust level for the key used to sign a signed commit
3276</p>
3277</dd>
3278<dt class="hdlist1">
Junio C Hamano11f15372019-03-07 03:17:003279<em>%gD</em>
3280</dt>
3281<dd>
3282<p>
3283reflog selector, e.g., <code>refs/stash@{1}</code> or <code>refs/stash@{2
Junio C Hamano48cd3f12019-10-09 05:55:303284 minutes ago}</code>; the format follows the rules described for the
Junio C Hamano11f15372019-03-07 03:17:003285 <code>-g</code> option. The portion before the <code>@</code> is the refname as
3286 given on the command line (so <code>git log -g refs/heads/master</code>
3287 would yield <code>refs/heads/master@{0}</code>).
3288</p>
3289</dd>
3290<dt class="hdlist1">
3291<em>%gd</em>
3292</dt>
3293<dd>
3294<p>
3295shortened reflog selector; same as <code>%gD</code>, but the refname
3296 portion is shortened for human readability (so
3297 <code>refs/heads/master</code> becomes just <code>master</code>).
3298</p>
3299</dd>
3300<dt class="hdlist1">
3301<em>%gn</em>
3302</dt>
3303<dd>
3304<p>
3305reflog identity name
3306</p>
3307</dd>
3308<dt class="hdlist1">
3309<em>%gN</em>
3310</dt>
3311<dd>
3312<p>
3313reflog identity name (respecting .mailmap, see
3314 <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)
3315</p>
3316</dd>
3317<dt class="hdlist1">
3318<em>%ge</em>
3319</dt>
3320<dd>
3321<p>
3322reflog identity email
3323</p>
3324</dd>
3325<dt class="hdlist1">
3326<em>%gE</em>
3327</dt>
3328<dd>
3329<p>
3330reflog identity email (respecting .mailmap, see
3331 <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)
3332</p>
3333</dd>
3334<dt class="hdlist1">
3335<em>%gs</em>
3336</dt>
3337<dd>
3338<p>
3339reflog subject
3340</p>
3341</dd>
3342<dt class="hdlist1">
3343<em>%(trailers[:options])</em>
3344</dt>
3345<dd>
3346<p>
3347display the trailers of the body as
3348 interpreted by
3349 <a href="git-interpret-trailers.html">git-interpret-trailers(1)</a>. The
3350 <code>trailers</code> string may be followed by a colon
Junio C Hamano674f3e12021-01-07 08:42:493351 and zero or more comma-separated options.
3352 If any option is provided multiple times the
Junio C Hamano608b11d2021-05-16 21:40:453353 last occurrence wins.
Junio C Hamano11f15372019-03-07 03:17:003354</p>
3355<div class="ulist"><ul>
3356<li>
3357<p>
Junio C Hamano59a32b02021-12-10 22:53:383358<em>key=&lt;key&gt;</em>: only show trailers with specified &lt;key&gt;. Matching is done
Junio C Hamano11f15372019-03-07 03:17:003359 case-insensitively and trailing colon is optional. If option is
3360 given multiple times trailer lines matching any of the keys are
3361 shown. This option automatically enables the <code>only</code> option so that
3362 non-trailer lines in the trailer block are hidden. If that is not
3363 desired it can be disabled with <code>only=false</code>. E.g.,
3364 <code>%(trailers:key=Reviewed-by)</code> shows trailer lines with key
3365 <code>Reviewed-by</code>.
Junio C Hamanoa3fd83c2007-03-02 10:34:363366</p>
3367</li>
3368<li>
3369<p>
Junio C Hamano59a32b02021-12-10 22:53:383370<em>only[=&lt;bool&gt;]</em>: select whether non-trailer lines from the trailer
Junio C Hamano674f3e12021-01-07 08:42:493371 block should be included.
Junio C Hamanoa3fd83c2007-03-02 10:34:363372</p>
3373</li>
3374<li>
3375<p>
Junio C Hamano59a32b02021-12-10 22:53:383376<em>separator=&lt;sep&gt;</em>: specify a separator inserted between trailer
Junio C Hamano11f15372019-03-07 03:17:003377 lines. When this option is not given each trailer line is
Junio C Hamano59a32b02021-12-10 22:53:383378 terminated with a line feed character. The string &lt;sep&gt; may contain
Junio C Hamano11f15372019-03-07 03:17:003379 the literal formatting codes described above. To use comma as
3380 separator one must use <code>%x2C</code> as it would otherwise be parsed as
Junio C Hamano674f3e12021-01-07 08:42:493381 next option. E.g., <code>%(trailers:key=Ticket,separator=%x2C )</code>
Junio C Hamano11f15372019-03-07 03:17:003382 shows all trailer lines whose key is "Ticket" separated by a comma
3383 and a space.
Junio C Hamanoa3fd83c2007-03-02 10:34:363384</p>
3385</li>
3386<li>
3387<p>
Junio C Hamano59a32b02021-12-10 22:53:383388<em>unfold[=&lt;bool&gt;]</em>: make it behave as if interpret-trailer&#8217;s <code>--unfold</code>
Junio C Hamano674f3e12021-01-07 08:42:493389 option was given. E.g.,
Junio C Hamano11f15372019-03-07 03:17:003390 <code>%(trailers:only,unfold=true)</code> unfolds and shows all trailer lines.
Junio C Hamanoa3fd83c2007-03-02 10:34:363391</p>
3392</li>
3393<li>
3394<p>
Junio C Hamano59a32b02021-12-10 22:53:383395<em>keyonly[=&lt;bool&gt;]</em>: only show the key part of the trailer.
Junio C Hamano674f3e12021-01-07 08:42:493396</p>
3397</li>
3398<li>
3399<p>
Junio C Hamano59a32b02021-12-10 22:53:383400<em>valueonly[=&lt;bool&gt;]</em>: only show the value part of the trailer.
Junio C Hamano674f3e12021-01-07 08:42:493401</p>
3402</li>
3403<li>
3404<p>
Junio C Hamano59a32b02021-12-10 22:53:383405<em>key_value_separator=&lt;sep&gt;</em>: specify a separator inserted between
Junio C Hamano674f3e12021-01-07 08:42:493406 trailer lines. When this option is not given each trailer key-value
3407 pair is separated by ": ". Otherwise it shares the same semantics
Junio C Hamano59a32b02021-12-10 22:53:383408 as <em>separator=&lt;sep&gt;</em> above.
Junio C Hamanoa3fd83c2007-03-02 10:34:363409</p>
3410</li>
Junio C Hamano11f15372019-03-07 03:17:003411</ul></div>
3412</dd>
3413</dl></div>
Junio C Hamano04e768d2013-04-23 19:19:263414</li>
Junio C Hamanoba4b9282008-07-06 05:20:313415</ul></div>
Junio C Hamanoa3fd83c2007-03-02 10:34:363416</li>
Junio C Hamanoc21ab052009-10-31 04:03:553417</ul></div>
3418<div class="admonitionblock">
3419<table><tr>
3420<td class="icon">
3421<div class="title">Note</div>
3422</td>
3423<td class="content">Some placeholders may depend on other options given to the
Junio C Hamanoac12f0e2014-09-19 22:32:513424revision traversal engine. For example, the <code>%g*</code> reflog options will
Junio C Hamanoc21ab052009-10-31 04:03:553425insert an empty string unless we are traversing reflog entries (e.g., by
Junio C Hamano00b9f1a2014-09-29 23:11:283426<code>git log -g</code>). The <code>%d</code> and <code>%D</code> placeholders will use the "short"
3427decoration format if <code>--decorate</code> was not already provided on the command
3428line.</td>
Junio C Hamanoc21ab052009-10-31 04:03:553429</tr></table>
3430</div>
Junio C Hamano2b153182021-12-15 21:00:313431<div class="paragraph"><p>The boolean options accept an optional value <code>[=&lt;bool-value&gt;]</code>. The values
3432<code>true</code>, <code>false</code>, <code>on</code>, <code>off</code> etc. are all accepted. See the "boolean"
3433sub-section in "EXAMPLES" in <a href="git-config.html">git-config(1)</a>. If a boolean
3434option is given with no value, it&#8217;s enabled.</p></div>
Junio C Hamanoac12f0e2014-09-19 22:32:513435<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:593436is inserted immediately before the expansion if and only if the
3437placeholder expands to a non-empty string.</p></div>
Junio C Hamano535c65c2017-06-24 22:51:583438<div class="paragraph"><p>If you add a <code>-</code> (minus sign) after <em>%</em> of a placeholder, all consecutive
3439line-feeds immediately preceding the expansion are deleted if and only if the
Junio C Hamano2bd8a742009-12-01 21:16:593440placeholder expands to an empty string.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:593441<div class="paragraph"><p>If you add a ` ` (space) after <em>%</em> of a placeholder, a space
Junio C Hamano89a57342010-06-22 23:22:553442is inserted immediately before the expansion if and only if the
3443placeholder expands to a non-empty string.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:593444<div class="ulist"><ul>
Junio C Hamano6fb124c2008-06-13 10:04:013445<li>
3446<p>
3447<em>tformat:</em>
3448</p>
Junio C Hamano68cf15a2010-11-06 01:01:593449<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:013450provides "terminator" semantics instead of "separator" semantics. In
3451other words, each commit has the message terminator character (usually a
3452newline) appended, rather than a separator placed between entries.
3453This means that the final entry of a single-line format will be properly
3454terminated with a new line, just as the "oneline" format does.
Junio C Hamanoba4b9282008-07-06 05:20:313455For example:</p></div>
Junio C Hamano6fb124c2008-06-13 10:04:013456<div class="listingblock">
3457<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:513458<pre><code>$ git log -2 --pretty=format:%h 4da45bef \
Junio C Hamano6fb124c2008-06-13 10:04:013459 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
34604da45be
34617134973 -- NO NEWLINE
3462
3463$ git log -2 --pretty=tformat:%h 4da45bef \
3464 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
34654da45be
Junio C Hamanoac12f0e2014-09-19 22:32:5134667134973</code></pre>
Junio C Hamano6fb124c2008-06-13 10:04:013467</div></div>
Junio C Hamanoac12f0e2014-09-19 22:32:513468<div class="paragraph"><p>In addition, any unrecognized string that has a <code>%</code> in it is interpreted
3469as if it has <code>tformat:</code> in front of it. For example, these two are
Junio C Hamano0a235222009-03-06 08:21:093470equivalent:</p></div>
3471<div class="listingblock">
3472<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:513473<pre><code>$ git log -2 --pretty=tformat:%h 4da45bef
3474$ git log -2 --pretty=%h 4da45bef</code></pre>
Junio C Hamano0a235222009-03-06 08:21:093475</div></div>
Junio C Hamano6fb124c2008-06-13 10:04:013476</li>
Junio C Hamanoba4b9282008-07-06 05:20:313477</ul></div>
Junio C Hamano1a4e8412005-12-27 08:17:233478</div>
Junio C Hamano9629d4f2012-12-19 00:28:273479</div>
3480<div class="sect1">
Junio C Hamano255163d2020-08-18 00:37:233481<h2 id="_diff_formatting">DIFF FORMATTING</h2>
Junio C Hamanod2c978f2011-03-20 19:42:223482<div class="sectionbody">
Junio C Hamano255163d2020-08-18 00:37:233483<div class="paragraph"><p>By default, <code>git log</code> does not generate any diff output. The options
3484below can be used to show the changes made by each commit.</p></div>
Junio C Hamano8c860d62021-02-06 01:37:473485<div class="paragraph"><p>Note that unless one of <code>--diff-merges</code> variants (including short
3486<code>-m</code>, <code>-c</code>, and <code>--cc</code> options) is explicitly given, merge commits
3487will not show a diff, even if a diff format like <code>--patch</code> is
3488selected, nor will they match search options like <code>-S</code>. The exception
3489is when <code>--first-parent</code> is in use, in which case <code>first-parent</code> is
3490the default format.</p></div>
Junio C Hamanod2c978f2011-03-20 19:42:223491<div class="dlist"><dl>
3492<dt class="hdlist1">
3493-p
3494</dt>
3495<dt class="hdlist1">
3496-u
3497</dt>
3498<dt class="hdlist1">
3499--patch
3500</dt>
3501<dd>
3502<p>
Junio C Hamanoa75aada2023-01-22 01:54:303503 Generate patch (see section titled
3504<a href="#generate_patch_text_with_p">"Generating patch text with -p"</a>).
Junio C Hamanod2c978f2011-03-20 19:42:223505</p>
3506</dd>
3507<dt class="hdlist1">
Junio C Hamano58f587a2013-07-22 19:20:593508-s
3509</dt>
3510<dt class="hdlist1">
3511--no-patch
3512</dt>
3513<dd>
3514<p>
Junio C Hamanoa7b2c102023-06-13 21:00:153515 Suppress all output from the diff machinery. Useful for
3516 commands like <code>git show</code> that show the patch by default to
3517 squelch their output, or to cancel the effect of options like
3518 <code>--patch</code>, <code>--stat</code> earlier on the command line in an alias.
Junio C Hamano58f587a2013-07-22 19:20:593519</p>
3520</dd>
3521<dt class="hdlist1">
Junio C Hamanof1fc6ca2022-02-17 01:32:333522--diff-merges=(off|none|on|first-parent|1|separate|m|combined|c|dense-combined|cc|remerge|r)
Junio C Hamano8c860d62021-02-06 01:37:473523</dt>
3524<dt class="hdlist1">
3525--no-diff-merges
3526</dt>
3527<dd>
3528<p>
3529 Specify diff format to be used for merge commits. Default is
3530 <code>off</code> unless <code>--first-parent</code> is in use, in which case
3531 <code>first-parent</code> is the default.
3532</p>
3533<div class="dlist"><dl>
3534<dt class="hdlist1">
3535--diff-merges=(off|none)
3536</dt>
3537<dt class="hdlist1">
3538--no-diff-merges
3539</dt>
3540<dd>
3541<p>
3542 Disable output of diffs for merge commits. Useful to override
3543 implied value.
3544</p>
3545</dd>
3546<dt class="hdlist1">
Junio C Hamano4078a552021-04-30 06:08:103547--diff-merges=on
3548</dt>
3549<dt class="hdlist1">
3550--diff-merges=m
3551</dt>
3552<dt class="hdlist1">
3553-m
3554</dt>
3555<dd>
3556<p>
3557 This option makes diff output for merge commits to be shown in
Junio C Hamano86505432021-08-11 20:13:583558 the default format. <code>-m</code> will produce the output only if <code>-p</code>
3559 is given as well. The default format could be changed using
Junio C Hamano4078a552021-04-30 06:08:103560 <code>log.diffMerges</code> configuration parameter, which default value
Junio C Hamano86505432021-08-11 20:13:583561 is <code>separate</code>.
Junio C Hamano4078a552021-04-30 06:08:103562</p>
3563</dd>
3564<dt class="hdlist1">
Junio C Hamano8c860d62021-02-06 01:37:473565--diff-merges=first-parent
3566</dt>
3567<dt class="hdlist1">
3568--diff-merges=1
3569</dt>
3570<dd>
3571<p>
3572 This option makes merge commits show the full diff with
3573 respect to the first parent only.
3574</p>
3575</dd>
3576<dt class="hdlist1">
3577--diff-merges=separate
3578</dt>
Junio C Hamano8c860d62021-02-06 01:37:473579<dd>
3580<p>
3581 This makes merge commits show the full diff with respect to
3582 each of the parents. Separate log entry and diff is generated
Junio C Hamano86505432021-08-11 20:13:583583 for each parent.
Junio C Hamano8c860d62021-02-06 01:37:473584</p>
3585</dd>
3586<dt class="hdlist1">
Junio C Hamanof1fc6ca2022-02-17 01:32:333587--diff-merges=remerge
3588</dt>
3589<dt class="hdlist1">
3590--diff-merges=r
3591</dt>
3592<dt class="hdlist1">
3593--remerge-diff
3594</dt>
3595<dd>
3596<p>
3597 With this option, two-parent merge commits are remerged to
3598 create a temporary tree object&#8201;&#8212;&#8201;potentially containing files
3599 with conflict markers and such. A diff is then shown between
3600 that temporary tree and the actual merge commit.
3601</p>
3602<div class="paragraph"><p>The output emitted when this option is used is subject to change, and
3603so is its interaction with other options (unless explicitly
3604documented).</p></div>
3605</dd>
3606<dt class="hdlist1">
Junio C Hamano8c860d62021-02-06 01:37:473607--diff-merges=combined
3608</dt>
3609<dt class="hdlist1">
3610--diff-merges=c
3611</dt>
3612<dt class="hdlist1">
3613-c
3614</dt>
3615<dd>
3616<p>
3617 With this option, diff output for a merge commit shows the
3618 differences from each of the parents to the merge result
3619 simultaneously instead of showing pairwise diff between a
3620 parent and the result one at a time. Furthermore, it lists
3621 only files which were modified from all parents. <code>-c</code> implies
3622 <code>-p</code>.
3623</p>
3624</dd>
3625<dt class="hdlist1">
3626--diff-merges=dense-combined
3627</dt>
3628<dt class="hdlist1">
3629--diff-merges=cc
3630</dt>
3631<dt class="hdlist1">
3632--cc
3633</dt>
3634<dd>
3635<p>
3636 With this option the output produced by
3637 <code>--diff-merges=combined</code> is further compressed by omitting
3638 uninteresting hunks whose contents in the parents have only
3639 two variants and the merge result picks one of them without
3640 modification. <code>--cc</code> implies <code>-p</code>.
3641</p>
3642</dd>
3643</dl></div>
3644</dd>
3645<dt class="hdlist1">
3646--combined-all-paths
3647</dt>
3648<dd>
3649<p>
3650 This flag causes combined diffs (used for merge commits) to
3651 list the name of the file from all parents. It thus only has
3652 effect when <code>--diff-merges=[dense-]combined</code> is in use, and
3653 is likely only useful if filename changes are detected (i.e.
3654 when either rename or copy detection have been requested).
3655</p>
3656</dd>
3657<dt class="hdlist1">
Junio C Hamanod2c978f2011-03-20 19:42:223658-U&lt;n&gt;
3659</dt>
3660<dt class="hdlist1">
3661--unified=&lt;n&gt;
3662</dt>
3663<dd>
3664<p>
3665 Generate diffs with &lt;n&gt; lines of context instead of
Junio C Hamanoee43d182020-11-11 22:10:413666 the usual three.
3667 Implies <code>--patch</code>.
Junio C Hamanod2c978f2011-03-20 19:42:223668</p>
3669</dd>
3670<dt class="hdlist1">
Junio C Hamano11f15372019-03-07 03:17:003671--output=&lt;file&gt;
3672</dt>
3673<dd>
3674<p>
3675 Output to a specific file instead of stdout.
3676</p>
3677</dd>
3678<dt class="hdlist1">
3679--output-indicator-new=&lt;char&gt;
3680</dt>
3681<dt class="hdlist1">
3682--output-indicator-old=&lt;char&gt;
3683</dt>
3684<dt class="hdlist1">
3685--output-indicator-context=&lt;char&gt;
3686</dt>
3687<dd>
3688<p>
3689 Specify the character used to indicate new, old or context
3690 lines in the generated patch. Normally they are <em>+</em>, <em>-</em> and
3691 ' ' respectively.
3692</p>
3693</dd>
3694<dt class="hdlist1">
Junio C Hamanod2c978f2011-03-20 19:42:223695--raw
3696</dt>
3697<dd>
3698<p>
Junio C Hamano85f1fde2015-06-01 20:37:323699 For each commit, show a summary of changes using the raw diff
3700 format. See the "RAW OUTPUT FORMAT" section of
3701 <a href="git-diff.html">git-diff(1)</a>. This is different from showing the log
3702 itself in raw format, which you can achieve with
3703 <code>--format=raw</code>.
Junio C Hamanod2c978f2011-03-20 19:42:223704</p>
3705</dd>
3706<dt class="hdlist1">
3707--patch-with-raw
3708</dt>
3709<dd>
3710<p>
Junio C Hamanoac12f0e2014-09-19 22:32:513711 Synonym for <code>-p --raw</code>.
Junio C Hamanod2c978f2011-03-20 19:42:223712</p>
3713</dd>
3714<dt class="hdlist1">
Junio C Hamano255163d2020-08-18 00:37:233715-t
3716</dt>
3717<dd>
3718<p>
3719 Show the tree objects in the diff output.
3720</p>
3721</dd>
3722<dt class="hdlist1">
Junio C Hamanoad70bf02016-09-26 23:44:273723--indent-heuristic
3724</dt>
Junio C Hamanoa65b6762017-11-06 04:45:423725<dd>
3726<p>
Junio C Hamano14e66832018-06-18 18:32:193727 Enable the heuristic that shifts diff hunk boundaries to make patches
Junio C Hamanoa65b6762017-11-06 04:45:423728 easier to read. This is the default.
3729</p>
3730</dd>
Junio C Hamanoad70bf02016-09-26 23:44:273731<dt class="hdlist1">
3732--no-indent-heuristic
3733</dt>
Junio C Hamano5f888332016-06-13 19:28:313734<dd>
3735<p>
Junio C Hamanoa65b6762017-11-06 04:45:423736 Disable the indent heuristic.
Junio C Hamano5f888332016-06-13 19:28:313737</p>
3738</dd>
3739<dt class="hdlist1">
Junio C Hamano5a73f302011-10-14 05:58:343740--minimal
3741</dt>
3742<dd>
3743<p>
3744 Spend extra time to make sure the smallest possible
3745 diff is produced.
3746</p>
3747</dd>
3748<dt class="hdlist1">
Junio C Hamanod2c978f2011-03-20 19:42:223749--patience
3750</dt>
3751<dd>
3752<p>
3753 Generate a diff using the "patience diff" algorithm.
3754</p>
3755</dd>
3756<dt class="hdlist1">
Junio C Hamanoaea9e6b2012-03-07 00:17:113757--histogram
3758</dt>
3759<dd>
3760<p>
3761 Generate a diff using the "histogram diff" algorithm.
3762</p>
3763</dd>
3764<dt class="hdlist1">
Junio C Hamano047135e2017-12-19 21:57:543765--anchored=&lt;text&gt;
3766</dt>
3767<dd>
3768<p>
3769 Generate a diff using the "anchored diff" algorithm.
3770</p>
3771<div class="paragraph"><p>This option may be specified more than once.</p></div>
3772<div class="paragraph"><p>If a line exists in both the source and destination, exists only once,
3773and starts with this text, this algorithm attempts to prevent it from
3774appearing as a deletion or addition in the output. It uses the "patience
3775diff" algorithm internally.</p></div>
3776</dd>
3777<dt class="hdlist1">
Junio C Hamano80ad00d2013-02-18 00:19:033778--diff-algorithm={patience|minimal|histogram|myers}
3779</dt>
3780<dd>
3781<p>
3782 Choose a diff algorithm. The variants are as follows:
3783</p>
3784<div class="openblock">
3785<div class="content">
3786<div class="dlist"><dl>
3787<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:513788<code>default</code>, <code>myers</code>
Junio C Hamano80ad00d2013-02-18 00:19:033789</dt>
3790<dd>
3791<p>
3792 The basic greedy diff algorithm. Currently, this is the default.
3793</p>
3794</dd>
3795<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:513796<code>minimal</code>
Junio C Hamano80ad00d2013-02-18 00:19:033797</dt>
3798<dd>
3799<p>
3800 Spend extra time to make sure the smallest possible diff is
3801 produced.
3802</p>
3803</dd>
3804<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:513805<code>patience</code>
Junio C Hamano80ad00d2013-02-18 00:19:033806</dt>
3807<dd>
3808<p>
3809 Use "patience diff" algorithm when generating patches.
3810</p>
3811</dd>
3812<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:513813<code>histogram</code>
Junio C Hamano80ad00d2013-02-18 00:19:033814</dt>
3815<dd>
3816<p>
3817 This algorithm extends the patience algorithm to "support
3818 low-occurrence common elements".
3819</p>
3820</dd>
3821</dl></div>
3822</div></div>
Junio C Hamano14e66832018-06-18 18:32:193823<div class="paragraph"><p>For instance, if you configured the <code>diff.algorithm</code> variable to a
Junio C Hamano80ad00d2013-02-18 00:19:033824non-default value and want to use the default one, then you
Junio C Hamanoac12f0e2014-09-19 22:32:513825have to use <code>--diff-algorithm=default</code> option.</p></div>
Junio C Hamano80ad00d2013-02-18 00:19:033826</dd>
3827<dt class="hdlist1">
Junio C Hamano4c4b0122011-06-30 01:19:323828--stat[=&lt;width&gt;[,&lt;name-width&gt;[,&lt;count&gt;]]]
Junio C Hamanod2c978f2011-03-20 19:42:223829</dt>
3830<dd>
3831<p>
Junio C Hamanoaea9e6b2012-03-07 00:17:113832 Generate a diffstat. By default, as much space as necessary
3833 will be used for the filename part, and the rest for the graph
3834 part. Maximum width defaults to terminal width, or 80 columns
Junio C Hamano7f2b3cb2012-06-22 22:42:393835 if not connected to a terminal, and can be overridden by
Junio C Hamanoac12f0e2014-09-19 22:32:513836 <code>&lt;width&gt;</code>. The width of the filename part can be limited by
3837 giving another width <code>&lt;name-width&gt;</code> after a comma. The width
Junio C Hamanoaea9e6b2012-03-07 00:17:113838 of the graph part can be limited by using
Junio C Hamanoac12f0e2014-09-19 22:32:513839 <code>--stat-graph-width=&lt;width&gt;</code> (affects all commands generating
3840 a stat graph) or by setting <code>diff.statGraphWidth=&lt;width&gt;</code>
3841 (does not affect <code>git format-patch</code>).
3842 By giving a third parameter <code>&lt;count&gt;</code>, you can limit the
3843 output to the first <code>&lt;count&gt;</code> lines, followed by <code>...</code> if
Junio C Hamanoaea9e6b2012-03-07 00:17:113844 there are more.
Junio C Hamanod2c978f2011-03-20 19:42:223845</p>
Junio C Hamanoac12f0e2014-09-19 22:32:513846<div class="paragraph"><p>These parameters can also be set individually with <code>--stat-width=&lt;width&gt;</code>,
3847<code>--stat-name-width=&lt;name-width&gt;</code> and <code>--stat-count=&lt;count&gt;</code>.</p></div>
Junio C Hamanod2c978f2011-03-20 19:42:223848</dd>
3849<dt class="hdlist1">
Junio C Hamano45badf02018-03-14 21:56:413850--compact-summary
3851</dt>
3852<dd>
3853<p>
3854 Output a condensed summary of extended header information such
3855 as file creations or deletions ("new" or "gone", optionally "+l"
3856 if it&#8217;s a symlink) and mode changes ("+x" or "-x" for adding
3857 or removing executable bit respectively) in diffstat. The
Junio C Hamanofa2915c2018-06-19 19:50:183858 information is put between the filename part and the graph
Junio C Hamano45badf02018-03-14 21:56:413859 part. Implies <code>--stat</code>.
3860</p>
3861</dd>
3862<dt class="hdlist1">
Junio C Hamanod2c978f2011-03-20 19:42:223863--numstat
3864</dt>
3865<dd>
3866<p>
Junio C Hamanoac12f0e2014-09-19 22:32:513867 Similar to <code>--stat</code>, but shows number of added and
Junio C Hamanod2c978f2011-03-20 19:42:223868 deleted lines in decimal notation and pathname without
3869 abbreviation, to make it more machine friendly. For
Junio C Hamanoac12f0e2014-09-19 22:32:513870 binary files, outputs two <code>-</code> instead of saying
3871 <code>0 0</code>.
Junio C Hamanod2c978f2011-03-20 19:42:223872</p>
3873</dd>
3874<dt class="hdlist1">
3875--shortstat
3876</dt>
3877<dd>
3878<p>
Junio C Hamanoac12f0e2014-09-19 22:32:513879 Output only the last line of the <code>--stat</code> format containing total
Junio C Hamanod2c978f2011-03-20 19:42:223880 number of modified files, as well as number of added and deleted
3881 lines.
3882</p>
3883</dd>
3884<dt class="hdlist1">
Junio C Hamano11f15372019-03-07 03:17:003885-X[&lt;param1,param2,&#8230;&gt;]
3886</dt>
3887<dt class="hdlist1">
Junio C Hamano1c222c52011-05-13 19:55:323888--dirstat[=&lt;param1,param2,&#8230;&gt;]
Junio C Hamanod2c978f2011-03-20 19:42:223889</dt>
3890<dd>
3891<p>
Junio C Hamano1c222c52011-05-13 19:55:323892 Output the distribution of relative amount of changes for each
Junio C Hamanoac12f0e2014-09-19 22:32:513893 sub-directory. The behavior of <code>--dirstat</code> can be customized by
Junio C Hamano1c222c52011-05-13 19:55:323894 passing it a comma separated list of parameters.
Junio C Hamanoac12f0e2014-09-19 22:32:513895 The defaults are controlled by the <code>diff.dirstat</code> configuration
Junio C Hamanoa28a9202012-06-21 07:08:233896 variable (see <a href="git-config.html">git-config(1)</a>).
Junio C Hamano1c222c52011-05-13 19:55:323897 The following parameters are available:
Junio C Hamanod2c978f2011-03-20 19:42:223898</p>
Junio C Hamano9629d4f2012-12-19 00:28:273899<div class="openblock">
3900<div class="content">
Junio C Hamano1c222c52011-05-13 19:55:323901<div class="dlist"><dl>
3902<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:513903<code>changes</code>
Junio C Hamano1c222c52011-05-13 19:55:323904</dt>
3905<dd>
3906<p>
3907 Compute the dirstat numbers by counting the lines that have been
3908 removed from the source, or added to the destination. This ignores
3909 the amount of pure code movements within a file. In other words,
3910 rearranging lines in a file is not counted as much as other changes.
3911 This is the default behavior when no parameter is given.
3912</p>
Junio C Hamanod2c978f2011-03-20 19:42:223913</dd>
3914<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:513915<code>lines</code>
Junio C Hamanod2c978f2011-03-20 19:42:223916</dt>
3917<dd>
3918<p>
Junio C Hamano1c222c52011-05-13 19:55:323919 Compute the dirstat numbers by doing the regular line-based diff
3920 analysis, and summing the removed/added line counts. (For binary
3921 files, count 64-byte chunks instead, since binary files have no
Junio C Hamanoac12f0e2014-09-19 22:32:513922 natural concept of lines). This is a more expensive <code>--dirstat</code>
3923 behavior than the <code>changes</code> behavior, but it does count rearranged
Junio C Hamano1c222c52011-05-13 19:55:323924 lines within a file as much as other changes. The resulting output
Junio C Hamanoac12f0e2014-09-19 22:32:513925 is consistent with what you get from the other <code>--*stat</code> options.
Junio C Hamanod2c978f2011-03-20 19:42:223926</p>
3927</dd>
3928<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:513929<code>files</code>
Junio C Hamano1c222c52011-05-13 19:55:323930</dt>
3931<dd>
3932<p>
3933 Compute the dirstat numbers by counting the number of files changed.
3934 Each changed file counts equally in the dirstat analysis. This is
Junio C Hamanoac12f0e2014-09-19 22:32:513935 the computationally cheapest <code>--dirstat</code> behavior, since it does
Junio C Hamano1c222c52011-05-13 19:55:323936 not have to look at the file contents at all.
3937</p>
3938</dd>
3939<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:513940<code>cumulative</code>
Junio C Hamano1c222c52011-05-13 19:55:323941</dt>
3942<dd>
3943<p>
3944 Count changes in a child directory for the parent directory as well.
Junio C Hamanoac12f0e2014-09-19 22:32:513945 Note that when using <code>cumulative</code>, the sum of the percentages
Junio C Hamano1c222c52011-05-13 19:55:323946 reported may exceed 100%. The default (non-cumulative) behavior can
Junio C Hamanoac12f0e2014-09-19 22:32:513947 be specified with the <code>noncumulative</code> parameter.
Junio C Hamano1c222c52011-05-13 19:55:323948</p>
3949</dd>
3950<dt class="hdlist1">
3951&lt;limit&gt;
3952</dt>
3953<dd>
3954<p>
3955 An integer parameter specifies a cut-off percent (3% by default).
3956 Directories contributing less than this percentage of the changes
3957 are not shown in the output.
3958</p>
3959</dd>
3960</dl></div>
Junio C Hamano9629d4f2012-12-19 00:28:273961</div></div>
Junio C Hamano1c222c52011-05-13 19:55:323962<div class="paragraph"><p>Example: The following will count changed files, while ignoring
3963directories with less than 10% of the total amount of changed files,
3964and accumulating child directory counts in the parent directories:
Junio C Hamanoac12f0e2014-09-19 22:32:513965<code>--dirstat=files,10,cumulative</code>.</p></div>
Junio C Hamano1c222c52011-05-13 19:55:323966</dd>
3967<dt class="hdlist1">
Junio C Hamano11f15372019-03-07 03:17:003968--cumulative
3969</dt>
3970<dd>
3971<p>
3972 Synonym for --dirstat=cumulative
3973</p>
3974</dd>
3975<dt class="hdlist1">
3976--dirstat-by-file[=&lt;param1,param2&gt;&#8230;]
3977</dt>
3978<dd>
3979<p>
3980 Synonym for --dirstat=files,param1,param2&#8230;
3981</p>
3982</dd>
3983<dt class="hdlist1">
Junio C Hamanod2c978f2011-03-20 19:42:223984--summary
3985</dt>
3986<dd>
3987<p>
3988 Output a condensed summary of extended header information
3989 such as creations, renames and mode changes.
3990</p>
3991</dd>
3992<dt class="hdlist1">
3993--patch-with-stat
3994</dt>
3995<dd>
3996<p>
Junio C Hamanoac12f0e2014-09-19 22:32:513997 Synonym for <code>-p --stat</code>.
Junio C Hamanod2c978f2011-03-20 19:42:223998</p>
3999</dd>
4000<dt class="hdlist1">
4001-z
4002</dt>
4003<dd>
4004<p>
4005 Separate the commits with NULs instead of with new newlines.
4006</p>
Junio C Hamanoac12f0e2014-09-19 22:32:514007<div class="paragraph"><p>Also, when <code>--raw</code> or <code>--numstat</code> has been given, do not munge
Junio C Hamanod2c978f2011-03-20 19:42:224008pathnames and use NULs as output field terminators.</p></div>
Junio C Hamano0f6f3bf2017-03-13 07:01:534009<div class="paragraph"><p>Without this option, pathnames with "unusual" characters are quoted as
4010explained for the configuration variable <code>core.quotePath</code> (see
4011<a href="git-config.html">git-config(1)</a>).</p></div>
Junio C Hamanod2c978f2011-03-20 19:42:224012</dd>
4013<dt class="hdlist1">
4014--name-only
4015</dt>
4016<dd>
4017<p>
Junio C Hamano4078a552021-04-30 06:08:104018 Show only names of changed files. The file names are often encoded in UTF-8.
4019 For more information see the discussion about encoding in the <a href="git-log.html">git-log(1)</a>
4020 manual page.
Junio C Hamanod2c978f2011-03-20 19:42:224021</p>
4022</dd>
4023<dt class="hdlist1">
4024--name-status
4025</dt>
4026<dd>
4027<p>
4028 Show only names and status of changed files. See the description
Junio C Hamanoac12f0e2014-09-19 22:32:514029 of the <code>--diff-filter</code> option on what the status letters mean.
Junio C Hamano4078a552021-04-30 06:08:104030 Just like <code>--name-only</code> the file names are often encoded in UTF-8.
Junio C Hamanod2c978f2011-03-20 19:42:224031</p>
4032</dd>
4033<dt class="hdlist1">
4034--submodule[=&lt;format&gt;]
4035</dt>
4036<dd>
4037<p>
Junio C Hamanocd451662016-09-13 00:54:094038 Specify how differences in submodules are shown. When specifying
4039 <code>--submodule=short</code> the <em>short</em> format is used. This format just
4040 shows the names of the commits at the beginning and end of the range.
4041 When <code>--submodule</code> or <code>--submodule=log</code> is specified, the <em>log</em>
4042 format is used. This format lists the commits in the range like
4043 <a href="git-submodule.html">git-submodule(1)</a> <code>summary</code> does. When <code>--submodule=diff</code>
4044 is specified, the <em>diff</em> format is used. This format shows an
4045 inline diff of the changes in the submodule contents between the
4046 commit range. Defaults to <code>diff.submodule</code> or the <em>short</em> format
4047 if the config option is unset.
Junio C Hamanod2c978f2011-03-20 19:42:224048</p>
4049</dd>
4050<dt class="hdlist1">
4051--color[=&lt;when&gt;]
4052</dt>
4053<dd>
4054<p>
4055 Show colored diff.
Junio C Hamanoac12f0e2014-09-19 22:32:514056 <code>--color</code> (i.e. without <em>=&lt;when&gt;</em>) is the same as <code>--color=always</code>.
4057 <em>&lt;when&gt;</em> can be one of <code>always</code>, <code>never</code>, or <code>auto</code>.
Junio C Hamanod2c978f2011-03-20 19:42:224058</p>
4059</dd>
4060<dt class="hdlist1">
4061--no-color
4062</dt>
4063<dd>
4064<p>
Junio C Hamano5f2627d2011-05-06 20:23:484065 Turn off colored diff.
Junio C Hamanoac12f0e2014-09-19 22:32:514066 It is the same as <code>--color=never</code>.
Junio C Hamanod2c978f2011-03-20 19:42:224067</p>
4068</dd>
4069<dt class="hdlist1">
Junio C Hamanofb1fdf12017-08-27 06:14:594070--color-moved[=&lt;mode&gt;]
4071</dt>
4072<dd>
4073<p>
4074 Moved lines of code are colored differently.
4075 The &lt;mode&gt; defaults to <em>no</em> if the option is not given
4076 and to <em>zebra</em> if the option with no mode is given.
4077 The mode must be one of:
4078</p>
4079<div class="openblock">
4080<div class="content">
4081<div class="dlist"><dl>
4082<dt class="hdlist1">
4083no
4084</dt>
4085<dd>
4086<p>
4087 Moved lines are not highlighted.
4088</p>
4089</dd>
4090<dt class="hdlist1">
4091default
4092</dt>
4093<dd>
4094<p>
4095 Is a synonym for <code>zebra</code>. This may change to a more sensible mode
4096 in the future.
4097</p>
4098</dd>
4099<dt class="hdlist1">
4100plain
4101</dt>
4102<dd>
4103<p>
4104 Any line that is added in one location and was removed
4105 in another location will be colored with <em>color.diff.newMoved</em>.
4106 Similarly <em>color.diff.oldMoved</em> will be used for removed lines
4107 that are added somewhere else in the diff. This mode picks up any
4108 moved line, but it is not very useful in a review to determine
4109 if a block of code was moved without permutation.
4110</p>
4111</dd>
4112<dt class="hdlist1">
Junio C Hamanof09b7cd2018-08-02 23:01:454113blocks
Junio C Hamanofb1fdf12017-08-27 06:14:594114</dt>
4115<dd>
4116<p>
4117 Blocks of moved text of at least 20 alphanumeric characters
4118 are detected greedily. The detected blocks are
Junio C Hamanof09b7cd2018-08-02 23:01:454119 painted using either the <em>color.diff.{old,new}Moved</em> color.
4120 Adjacent blocks cannot be told apart.
4121</p>
4122</dd>
4123<dt class="hdlist1">
4124zebra
4125</dt>
4126<dd>
4127<p>
4128 Blocks of moved text are detected as in <em>blocks</em> mode. The blocks
4129 are painted using either the <em>color.diff.{old,new}Moved</em> color or
Junio C Hamanofb1fdf12017-08-27 06:14:594130 <em>color.diff.{old,new}MovedAlternative</em>. The change between
4131 the two colors indicates that a new block was detected.
4132</p>
4133</dd>
4134<dt class="hdlist1">
Junio C Hamanobfd91f42018-08-17 22:21:164135dimmed-zebra
Junio C Hamanofb1fdf12017-08-27 06:14:594136</dt>
4137<dd>
4138<p>
4139 Similar to <em>zebra</em>, but additional dimming of uninteresting parts
4140 of moved code is performed. The bordering lines of two adjacent
4141 blocks are considered interesting, the rest is uninteresting.
Junio C Hamanobfd91f42018-08-17 22:21:164142 <code>dimmed_zebra</code> is a deprecated synonym.
Junio C Hamanofb1fdf12017-08-27 06:14:594143</p>
4144</dd>
4145</dl></div>
4146</div></div>
4147</dd>
4148<dt class="hdlist1">
Junio C Hamanoa90214f2019-01-28 22:05:254149--no-color-moved
4150</dt>
4151<dd>
4152<p>
4153 Turn off move detection. This can be used to override configuration
4154 settings. It is the same as <code>--color-moved=no</code>.
4155</p>
4156</dd>
4157<dt class="hdlist1">
Junio C Hamanof09b7cd2018-08-02 23:01:454158--color-moved-ws=&lt;modes&gt;
4159</dt>
4160<dd>
4161<p>
Junio C Hamanoa90214f2019-01-28 22:05:254162 This configures how whitespace is ignored when performing the
Junio C Hamanof09b7cd2018-08-02 23:01:454163 move detection for <code>--color-moved</code>.
4164 These modes can be given as a comma separated list:
4165</p>
4166<div class="openblock">
4167<div class="content">
4168<div class="dlist"><dl>
4169<dt class="hdlist1">
Junio C Hamanoa90214f2019-01-28 22:05:254170no
4171</dt>
4172<dd>
4173<p>
4174 Do not ignore whitespace when performing move detection.
4175</p>
4176</dd>
4177<dt class="hdlist1">
Junio C Hamanof09b7cd2018-08-02 23:01:454178ignore-space-at-eol
4179</dt>
4180<dd>
4181<p>
4182 Ignore changes in whitespace at EOL.
4183</p>
4184</dd>
4185<dt class="hdlist1">
4186ignore-space-change
4187</dt>
4188<dd>
4189<p>
4190 Ignore changes in amount of whitespace. This ignores whitespace
4191 at line end, and considers all other sequences of one or
4192 more whitespace characters to be equivalent.
4193</p>
4194</dd>
4195<dt class="hdlist1">
4196ignore-all-space
4197</dt>
4198<dd>
4199<p>
4200 Ignore whitespace when comparing lines. This ignores differences
4201 even if one line has whitespace where the other line has none.
4202</p>
4203</dd>
4204<dt class="hdlist1">
4205allow-indentation-change
4206</dt>
4207<dd>
4208<p>
Junio C Hamanoa90214f2019-01-28 22:05:254209 Initially ignore any whitespace in the move detection, then
Junio C Hamanof09b7cd2018-08-02 23:01:454210 group the moved code blocks only into a block if the change in
4211 whitespace is the same per line. This is incompatible with the
4212 other modes.
4213</p>
4214</dd>
4215</dl></div>
4216</div></div>
4217</dd>
4218<dt class="hdlist1">
Junio C Hamanoa90214f2019-01-28 22:05:254219--no-color-moved-ws
4220</dt>
4221<dd>
4222<p>
4223 Do not ignore whitespace when performing move detection. This can be
4224 used to override configuration settings. It is the same as
4225 <code>--color-moved-ws=no</code>.
4226</p>
4227</dd>
4228<dt class="hdlist1">
Junio C Hamanod2c978f2011-03-20 19:42:224229--word-diff[=&lt;mode&gt;]
4230</dt>
4231<dd>
4232<p>
4233 Show a word diff, using the &lt;mode&gt; to delimit changed words.
4234 By default, words are delimited by whitespace; see
Junio C Hamanoac12f0e2014-09-19 22:32:514235 <code>--word-diff-regex</code> below. The &lt;mode&gt; defaults to <em>plain</em>, and
Junio C Hamanod2c978f2011-03-20 19:42:224236 must be one of:
4237</p>
Junio C Hamano9629d4f2012-12-19 00:28:274238<div class="openblock">
4239<div class="content">
Junio C Hamanod2c978f2011-03-20 19:42:224240<div class="dlist"><dl>
4241<dt class="hdlist1">
4242color
4243</dt>
4244<dd>
4245<p>
Junio C Hamanoac12f0e2014-09-19 22:32:514246 Highlight changed words using only colors. Implies <code>--color</code>.
Junio C Hamanod2c978f2011-03-20 19:42:224247</p>
4248</dd>
4249<dt class="hdlist1">
4250plain
4251</dt>
4252<dd>
4253<p>
Junio C Hamanoac12f0e2014-09-19 22:32:514254 Show words as <code>[-removed-]</code> and <code>{+added+}</code>. Makes no
Junio C Hamanod2c978f2011-03-20 19:42:224255 attempts to escape the delimiters if they appear in the input,
4256 so the output may be ambiguous.
4257</p>
4258</dd>
4259<dt class="hdlist1">
4260porcelain
4261</dt>
4262<dd>
4263<p>
4264 Use a special line-based format intended for script
4265 consumption. Added/removed/unchanged runs are printed in the
Junio C Hamanoac12f0e2014-09-19 22:32:514266 usual unified diff format, starting with a <code>+</code>/<code>-</code>/` `
Junio C Hamanod2c978f2011-03-20 19:42:224267 character at the beginning of the line and extending to the
4268 end of the line. Newlines in the input are represented by a
Junio C Hamanoac12f0e2014-09-19 22:32:514269 tilde <code>~</code> on a line of its own.
Junio C Hamanod2c978f2011-03-20 19:42:224270</p>
4271</dd>
4272<dt class="hdlist1">
4273none
4274</dt>
4275<dd>
4276<p>
4277 Disable word diff again.
4278</p>
4279</dd>
4280</dl></div>
Junio C Hamano9629d4f2012-12-19 00:28:274281</div></div>
Junio C Hamanod2c978f2011-03-20 19:42:224282<div class="paragraph"><p>Note that despite the name of the first mode, color is used to
4283highlight the changed parts in all modes if enabled.</p></div>
4284</dd>
4285<dt class="hdlist1">
4286--word-diff-regex=&lt;regex&gt;
4287</dt>
4288<dd>
4289<p>
4290 Use &lt;regex&gt; to decide what a word is, instead of considering
4291 runs of non-whitespace to be a word. Also implies
Junio C Hamanoac12f0e2014-09-19 22:32:514292 <code>--word-diff</code> unless it was already enabled.
Junio C Hamanod2c978f2011-03-20 19:42:224293</p>
4294<div class="paragraph"><p>Every non-overlapping match of the
4295&lt;regex&gt; is considered a word. Anything between these matches is
4296considered whitespace and ignored(!) for the purposes of finding
Junio C Hamanoac12f0e2014-09-19 22:32:514297differences. You may want to append <code>|[^[:space:]]</code> to your regular
Junio C Hamanod2c978f2011-03-20 19:42:224298expression to make sure that it matches all non-whitespace characters.
4299A match that contains a newline is silently truncated(!) at the
4300newline.</p></div>
Junio C Hamano713eded2015-12-03 00:24:024301<div class="paragraph"><p>For example, <code>--word-diff-regex=.</code> will treat each character as a word
4302and, correspondingly, show differences character by character.</p></div>
Junio C Hamanod2c978f2011-03-20 19:42:224303<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:244304<a href="gitattributes.html">gitattributes(5)</a> or <a href="git-config.html">git-config(1)</a>. Giving it explicitly
Junio C Hamanod2c978f2011-03-20 19:42:224305overrides any diff driver or configuration setting. Diff drivers
4306override configuration settings.</p></div>
4307</dd>
4308<dt class="hdlist1">
4309--color-words[=&lt;regex&gt;]
4310</dt>
4311<dd>
4312<p>
Junio C Hamanoac12f0e2014-09-19 22:32:514313 Equivalent to <code>--word-diff=color</code> plus (if a regex was
4314 specified) <code>--word-diff-regex=&lt;regex&gt;</code>.
Junio C Hamanod2c978f2011-03-20 19:42:224315</p>
4316</dd>
4317<dt class="hdlist1">
4318--no-renames
4319</dt>
4320<dd>
4321<p>
4322 Turn off rename detection, even when the configuration
4323 file gives the default to do so.
4324</p>
4325</dd>
4326<dt class="hdlist1">
Junio C Hamano11f15372019-03-07 03:17:004327--[no-]rename-empty
4328</dt>
4329<dd>
4330<p>
4331 Whether to use empty blobs as rename source.
4332</p>
4333</dd>
4334<dt class="hdlist1">
Junio C Hamanod2c978f2011-03-20 19:42:224335--check
4336</dt>
4337<dd>
4338<p>
Junio C Hamano84ea1e42016-04-08 21:53:484339 Warn if changes introduce conflict markers or whitespace errors.
4340 What are considered whitespace errors is controlled by <code>core.whitespace</code>
Junio C Hamano6005bfa2011-06-23 00:51:224341 configuration. By default, trailing whitespaces (including
Junio C Hamano14e66832018-06-18 18:32:194342 lines that consist solely of whitespaces) and a space character
Junio C Hamano6005bfa2011-06-23 00:51:224343 that is immediately followed by a tab character inside the
4344 initial indent of the line are considered whitespace errors.
4345 Exits with non-zero status if problems are found. Not compatible
4346 with --exit-code.
Junio C Hamanod2c978f2011-03-20 19:42:224347</p>
4348</dd>
4349<dt class="hdlist1">
Junio C Hamano8c5d5942015-06-11 19:37:484350--ws-error-highlight=&lt;kind&gt;
4351</dt>
4352<dd>
4353<p>
Junio C Hamano4b2a6c12017-08-22 18:32:374354 Highlight whitespace errors in the <code>context</code>, <code>old</code> or <code>new</code>
4355 lines of the diff. Multiple values are separated by comma,
4356 <code>none</code> resets previous values, <code>default</code> reset the list to
4357 <code>new</code> and <code>all</code> is a shorthand for <code>old,new,context</code>. When
4358 this option is not given, and the configuration variable
4359 <code>diff.wsErrorHighlight</code> is not set, only whitespace errors in
4360 <code>new</code> lines are highlighted. The whitespace errors are colored
Junio C Hamano14e66832018-06-18 18:32:194361 with <code>color.diff.whitespace</code>.
Junio C Hamano8c5d5942015-06-11 19:37:484362</p>
4363</dd>
4364<dt class="hdlist1">
Junio C Hamanod2c978f2011-03-20 19:42:224365--full-index
4366</dt>
4367<dd>
4368<p>
4369 Instead of the first handful of characters, show the full
4370 pre- and post-image blob object names on the "index"
4371 line when generating patch format output.
4372</p>
4373</dd>
4374<dt class="hdlist1">
4375--binary
4376</dt>
4377<dd>
4378<p>
Junio C Hamanoac12f0e2014-09-19 22:32:514379 In addition to <code>--full-index</code>, output a binary diff that
Junio C Hamanoee43d182020-11-11 22:10:414380 can be applied with <code>git-apply</code>.
4381 Implies <code>--patch</code>.
Junio C Hamanod2c978f2011-03-20 19:42:224382</p>
4383</dd>
4384<dt class="hdlist1">
4385--abbrev[=&lt;n&gt;]
4386</dt>
4387<dd>
4388<p>
4389 Instead of showing the full 40-byte hexadecimal object
4390 name in diff-raw format output and diff-tree header
Junio C Hamanoee43d182020-11-11 22:10:414391 lines, show the shortest prefix that is at least <em>&lt;n&gt;</em>
4392 hexdigits long that uniquely refers the object.
Junio C Hamanocf8aeaf2020-08-31 23:16:354393 In diff-patch output format, <code>--full-index</code> takes higher
4394 precedence, i.e. if <code>--full-index</code> is specified, full blob
4395 names will be shown regardless of <code>--abbrev</code>.
4396 Non default number of digits can be specified with <code>--abbrev=&lt;n&gt;</code>.
Junio C Hamanod2c978f2011-03-20 19:42:224397</p>
4398</dd>
4399<dt class="hdlist1">
4400-B[&lt;n&gt;][/&lt;m&gt;]
4401</dt>
4402<dt class="hdlist1">
4403--break-rewrites[=[&lt;n&gt;][/&lt;m&gt;]]
4404</dt>
4405<dd>
4406<p>
4407 Break complete rewrite changes into pairs of delete and
4408 create. This serves two purposes:
4409</p>
4410<div class="paragraph"><p>It affects the way a change that amounts to a total rewrite of a file
4411not as a series of deletion and insertion mixed together with a very
4412few lines that happen to match textually as the context, but as a
4413single deletion of everything old followed by a single insertion of
Junio C Hamanoac12f0e2014-09-19 22:32:514414everything new, and the number <code>m</code> controls this aspect of the -B
4415option (defaults to 60%). <code>-B/70%</code> specifies that less than 30% of the
Junio C Hamano076ffcc2013-02-06 05:13:214416original should remain in the result for Git to consider it a total
Junio C Hamanod2c978f2011-03-20 19:42:224417rewrite (i.e. otherwise the resulting patch will be a series of
4418deletion and insertion mixed together with context lines).</p></div>
4419<div class="paragraph"><p>When used with -M, a totally-rewritten file is also considered as the
4420source of a rename (usually -M only considers a file that disappeared
Junio C Hamanoac12f0e2014-09-19 22:32:514421as the source of a rename), and the number <code>n</code> controls this aspect of
4422the -B option (defaults to 50%). <code>-B20%</code> specifies that a change with
Junio C Hamanod2c978f2011-03-20 19:42:224423addition and deletion compared to 20% or more of the file&#8217;s size are
4424eligible for being picked up as a possible source of a rename to
4425another file.</p></div>
4426</dd>
4427<dt class="hdlist1">
4428-M[&lt;n&gt;]
4429</dt>
4430<dt class="hdlist1">
4431--find-renames[=&lt;n&gt;]
4432</dt>
4433<dd>
4434<p>
4435 If generating diffs, detect and report renames for each commit.
4436 For following files across renames while traversing history, see
Junio C Hamanoac12f0e2014-09-19 22:32:514437 <code>--follow</code>.
4438 If <code>n</code> is specified, it is a threshold on the similarity
Junio C Hamanod2c978f2011-03-20 19:42:224439 index (i.e. amount of addition/deletions compared to the
Junio C Hamanoac12f0e2014-09-19 22:32:514440 file&#8217;s size). For example, <code>-M90%</code> means Git should consider a
Junio C Hamanod2c978f2011-03-20 19:42:224441 delete/add pair to be a rename if more than 90% of the file
Junio C Hamanoac12f0e2014-09-19 22:32:514442 hasn&#8217;t changed. Without a <code>%</code> sign, the number is to be read as
4443 a fraction, with a decimal point before it. I.e., <code>-M5</code> becomes
4444 0.5, and is thus the same as <code>-M50%</code>. Similarly, <code>-M05</code> is
4445 the same as <code>-M5%</code>. To limit detection to exact renames, use
4446 <code>-M100%</code>. The default similarity index is 50%.
Junio C Hamanod2c978f2011-03-20 19:42:224447</p>
4448</dd>
4449<dt class="hdlist1">
4450-C[&lt;n&gt;]
4451</dt>
4452<dt class="hdlist1">
4453--find-copies[=&lt;n&gt;]
4454</dt>
4455<dd>
4456<p>
Junio C Hamanoac12f0e2014-09-19 22:32:514457 Detect copies as well as renames. See also <code>--find-copies-harder</code>.
4458 If <code>n</code> is specified, it has the same meaning as for <code>-M&lt;n&gt;</code>.
Junio C Hamanod2c978f2011-03-20 19:42:224459</p>
4460</dd>
4461<dt class="hdlist1">
4462--find-copies-harder
4463</dt>
4464<dd>
4465<p>
Junio C Hamanoac12f0e2014-09-19 22:32:514466 For performance reasons, by default, <code>-C</code> option finds copies only
Junio C Hamanod2c978f2011-03-20 19:42:224467 if the original file of the copy was modified in the same
4468 changeset. This flag makes the command
4469 inspect unmodified files as candidates for the source of
4470 copy. This is a very expensive operation for large
4471 projects, so use it with caution. Giving more than one
Junio C Hamanoac12f0e2014-09-19 22:32:514472 <code>-C</code> option has the same effect.
Junio C Hamanod2c978f2011-03-20 19:42:224473</p>
4474</dd>
4475<dt class="hdlist1">
Junio C Hamanob02377c2011-04-28 22:26:024476-D
4477</dt>
4478<dt class="hdlist1">
4479--irreversible-delete
4480</dt>
4481<dd>
4482<p>
4483 Omit the preimage for deletes, i.e. print only the header but not
Junio C Hamanoac12f0e2014-09-19 22:32:514484 the diff between the preimage and <code>/dev/null</code>. The resulting patch
4485 is not meant to be applied with <code>patch</code> or <code>git apply</code>; this is
Junio C Hamanob02377c2011-04-28 22:26:024486 solely for people who want to just concentrate on reviewing the
Junio C Hamanod16fd1b2017-08-04 16:41:514487 text after the change. In addition, the output obviously lacks
Junio C Hamanob02377c2011-04-28 22:26:024488 enough information to apply such a patch in reverse, even manually,
4489 hence the name of the option.
4490</p>
Junio C Hamanoac12f0e2014-09-19 22:32:514491<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:024492of a delete/create pair.</p></div>
4493</dd>
4494<dt class="hdlist1">
Junio C Hamanod2c978f2011-03-20 19:42:224495-l&lt;num&gt;
4496</dt>
4497<dd>
4498<p>
Junio C Hamano20cf4932021-07-28 21:02:524499 The <code>-M</code> and <code>-C</code> options involve some preliminary steps that
4500 can detect subsets of renames/copies cheaply, followed by an
4501 exhaustive fallback portion that compares all remaining
4502 unpaired destinations to all relevant sources. (For renames,
4503 only remaining unpaired sources are relevant; for copies, all
4504 original sources are relevant.) For N sources and
4505 destinations, this exhaustive check is O(N^2). This option
4506 prevents the exhaustive portion of rename/copy detection from
4507 running if the number of source/destination files involved
4508 exceeds the specified number. Defaults to diff.renameLimit.
4509 Note that a value of 0 is treated as unlimited.
Junio C Hamanod2c978f2011-03-20 19:42:224510</p>
4511</dd>
4512<dt class="hdlist1">
4513--diff-filter=[(A|C|D|M|R|T|U|X|B)&#8230;[*]]
4514</dt>
4515<dd>
4516<p>
Junio C Hamanoac12f0e2014-09-19 22:32:514517 Select only files that are Added (<code>A</code>), Copied (<code>C</code>),
4518 Deleted (<code>D</code>), Modified (<code>M</code>), Renamed (<code>R</code>), have their
4519 type (i.e. regular file, symlink, submodule, &#8230;) changed (<code>T</code>),
4520 are Unmerged (<code>U</code>), are
4521 Unknown (<code>X</code>), or have had their pairing Broken (<code>B</code>).
Junio C Hamanod2c978f2011-03-20 19:42:224522 Any combination of the filter characters (including none) can be used.
Junio C Hamanoac12f0e2014-09-19 22:32:514523 When <code>*</code> (All-or-none) is added to the combination, all
Junio C Hamanod2c978f2011-03-20 19:42:224524 paths are selected if there is any file that matches
4525 other criteria in the comparison; if there is no file
4526 that matches other criteria, nothing is selected.
4527</p>
Junio C Hamanoeed15af2016-07-25 22:49:424528<div class="paragraph"><p>Also, these upper-case letters can be downcased to exclude. E.g.
4529<code>--diff-filter=ad</code> excludes added and deleted paths.</p></div>
Junio C Hamanof1fc6ca2022-02-17 01:32:334530<div class="paragraph"><p>Note that not all diffs can feature all types. For instance, copied and
4531renamed entries cannot appear if detection for those types is disabled.</p></div>
Junio C Hamanod2c978f2011-03-20 19:42:224532</dd>
4533<dt class="hdlist1">
4534-S&lt;string&gt;
4535</dt>
4536<dd>
4537<p>
Junio C Hamanof1f5a7b2013-06-11 22:23:524538 Look for differences that change the number of occurrences of
4539 the specified string (i.e. addition/deletion) in a file.
4540 Intended for the scripter&#8217;s use.
Junio C Hamanod2c978f2011-03-20 19:42:224541</p>
Junio C Hamanof1f5a7b2013-06-11 22:23:524542<div class="paragraph"><p>It is useful when you&#8217;re looking for an exact block of code (like a
4543struct), and want to know the history of that block since it first
4544came into being: use the feature iteratively to feed the interesting
Junio C Hamanoac12f0e2014-09-19 22:32:514545block in the preimage back into <code>-S</code>, and keep going until you get the
Junio C Hamanof1f5a7b2013-06-11 22:23:524546very first version of the block.</p></div>
Junio C Hamanoace33e42019-01-18 23:16:054547<div class="paragraph"><p>Binary files are searched as well.</p></div>
Junio C Hamanod2c978f2011-03-20 19:42:224548</dd>
4549<dt class="hdlist1">
4550-G&lt;regex&gt;
4551</dt>
4552<dd>
4553<p>
Junio C Hamanof1f5a7b2013-06-11 22:23:524554 Look for differences whose patch text contains added/removed
4555 lines that match &lt;regex&gt;.
Junio C Hamanod2c978f2011-03-20 19:42:224556</p>
Junio C Hamanoac12f0e2014-09-19 22:32:514557<div class="paragraph"><p>To illustrate the difference between <code>-S&lt;regex&gt; --pickaxe-regex</code> and
4558<code>-G&lt;regex&gt;</code>, consider a commit with the following diff in the same
Junio C Hamanof1f5a7b2013-06-11 22:23:524559file:</p></div>
4560<div class="listingblock">
4561<div class="content">
Junio C Hamanob7e497f2020-02-12 21:41:374562<pre><code>+ return frotz(nitfol, two-&gt;ptr, 1, 0);
Junio C Hamanof1f5a7b2013-06-11 22:23:524563...
Junio C Hamanob7e497f2020-02-12 21:41:374564- hit = frotz(nitfol, mf2.ptr, 1, 0);</code></pre>
Junio C Hamanof1f5a7b2013-06-11 22:23:524565</div></div>
Junio C Hamanob7e497f2020-02-12 21:41:374566<div class="paragraph"><p>While <code>git log -G"frotz\(nitfol"</code> will show this commit, <code>git log
4567-S"frotz\(nitfol" --pickaxe-regex</code> will not (because the number of
Junio C Hamanof1f5a7b2013-06-11 22:23:524568occurrences of that string did not change).</p></div>
Junio C Hamanoace33e42019-01-18 23:16:054569<div class="paragraph"><p>Unless <code>--text</code> is supplied patches of binary files without a textconv
4570filter will be ignored.</p></div>
Junio C Hamanof1f5a7b2013-06-11 22:23:524571<div class="paragraph"><p>See the <em>pickaxe</em> entry in <a href="gitdiffcore.html">gitdiffcore(7)</a> for more
4572information.</p></div>
Junio C Hamanod2c978f2011-03-20 19:42:224573</dd>
4574<dt class="hdlist1">
Junio C Hamano7b9cce92018-01-23 22:34:274575--find-object=&lt;object-id&gt;
4576</dt>
4577<dd>
4578<p>
4579 Look for differences that change the number of occurrences of
4580 the specified object. Similar to <code>-S</code>, just the argument is different
4581 in that it doesn&#8217;t search for a specific string but for a specific
4582 object id.
4583</p>
4584<div class="paragraph"><p>The object can be a blob or a submodule commit. It implies the <code>-t</code> option in
4585<code>git-log</code> to also find trees.</p></div>
4586</dd>
4587<dt class="hdlist1">
Junio C Hamanod2c978f2011-03-20 19:42:224588--pickaxe-all
4589</dt>
4590<dd>
4591<p>
Junio C Hamanoac12f0e2014-09-19 22:32:514592 When <code>-S</code> or <code>-G</code> finds a change, show all the changes in that
Junio C Hamanod2c978f2011-03-20 19:42:224593 changeset, not just the files that contain the change
4594 in &lt;string&gt;.
4595</p>
4596</dd>
4597<dt class="hdlist1">
4598--pickaxe-regex
4599</dt>
4600<dd>
4601<p>
Junio C Hamanoac12f0e2014-09-19 22:32:514602 Treat the &lt;string&gt; given to <code>-S</code> as an extended POSIX regular
Junio C Hamanof1f5a7b2013-06-11 22:23:524603 expression to match.
Junio C Hamanod2c978f2011-03-20 19:42:224604</p>
4605</dd>
4606<dt class="hdlist1">
4607-O&lt;orderfile&gt;
4608</dt>
4609<dd>
4610<p>
Junio C Hamanobcd98f42017-01-24 00:12:164611 Control the order in which files appear in the output.
Junio C Hamano322c6242015-03-23 21:32:464612 This overrides the <code>diff.orderFile</code> configuration variable
4613 (see <a href="git-config.html">git-config(1)</a>). To cancel <code>diff.orderFile</code>,
Junio C Hamanoac12f0e2014-09-19 22:32:514614 use <code>-O/dev/null</code>.
Junio C Hamanod2c978f2011-03-20 19:42:224615</p>
Junio C Hamanobcd98f42017-01-24 00:12:164616<div class="paragraph"><p>The output order is determined by the order of glob patterns in
4617&lt;orderfile&gt;.
4618All files with pathnames that match the first pattern are output
4619first, all files with pathnames that match the second pattern (but not
4620the first) are output next, and so on.
4621All files with pathnames that do not match any pattern are output
4622last, as if there was an implicit match-all pattern at the end of the
4623file.
4624If multiple pathnames have the same rank (they match the same pattern
4625but no earlier patterns), their output order relative to each other is
4626the normal order.</p></div>
4627<div class="paragraph"><p>&lt;orderfile&gt; is parsed as follows:</p></div>
4628<div class="openblock">
4629<div class="content">
4630<div class="ulist"><ul>
4631<li>
4632<p>
4633Blank lines are ignored, so they can be used as separators for
4634 readability.
4635</p>
4636</li>
4637<li>
4638<p>
4639Lines starting with a hash ("<code>#</code>") are ignored, so they can be used
4640 for comments. Add a backslash ("<code>\</code>") to the beginning of the
4641 pattern if it starts with a hash.
4642</p>
4643</li>
4644<li>
4645<p>
4646Each other line contains a single pattern.
4647</p>
4648</li>
4649</ul></div>
4650</div></div>
4651<div class="paragraph"><p>Patterns have the same syntax and semantics as patterns used for
Junio C Hamano96153bf2018-04-25 08:25:344652fnmatch(3) without the FNM_PATHNAME flag, except a pathname also
Junio C Hamanobcd98f42017-01-24 00:12:164653matches a pattern if removing any number of the final pathname
4654components matches the pattern. For example, the pattern "<code>foo*bar</code>"
4655matches "<code>fooasdfbar</code>" and "<code>foo/bar/baz/asdf</code>" but not "<code>foobarx</code>".</p></div>
Junio C Hamanod2c978f2011-03-20 19:42:224656</dd>
4657<dt class="hdlist1">
Junio C Hamanoa372d5b2021-02-26 01:34:374658--skip-to=&lt;file&gt;
4659</dt>
4660<dt class="hdlist1">
4661--rotate-to=&lt;file&gt;
4662</dt>
4663<dd>
4664<p>
4665 Discard the files before the named &lt;file&gt; from the output
4666 (i.e. <em>skip to</em>), or move them to the end of the output
4667 (i.e. <em>rotate to</em>). These were invented primarily for use
4668 of the <code>git difftool</code> command, and may not be very useful
4669 otherwise.
4670</p>
4671</dd>
4672<dt class="hdlist1">
Junio C Hamanod2c978f2011-03-20 19:42:224673-R
4674</dt>
4675<dd>
4676<p>
4677 Swap two inputs; that is, show differences from index or
4678 on-disk file to tree contents.
4679</p>
4680</dd>
4681<dt class="hdlist1">
4682--relative[=&lt;path&gt;]
4683</dt>
Junio C Hamano3ef9e672020-06-02 21:51:314684<dt class="hdlist1">
4685--no-relative
4686</dt>
Junio C Hamanod2c978f2011-03-20 19:42:224687<dd>
4688<p>
4689 When run from a subdirectory of the project, it can be
4690 told to exclude changes outside the directory and show
4691 pathnames relative to it with this option. When you are
4692 not in a subdirectory (e.g. in a bare repository), you
4693 can name which subdirectory to make the output relative
4694 to by giving a &lt;path&gt; as an argument.
Junio C Hamano3ef9e672020-06-02 21:51:314695 <code>--no-relative</code> can be used to countermand both <code>diff.relative</code> config
4696 option and previous <code>--relative</code>.
Junio C Hamanod2c978f2011-03-20 19:42:224697</p>
4698</dd>
4699<dt class="hdlist1">
4700-a
4701</dt>
4702<dt class="hdlist1">
4703--text
4704</dt>
4705<dd>
4706<p>
4707 Treat all files as text.
4708</p>
4709</dd>
4710<dt class="hdlist1">
Junio C Hamano4886c772017-11-27 03:33:284711--ignore-cr-at-eol
4712</dt>
4713<dd>
4714<p>
Junio C Hamano96153bf2018-04-25 08:25:344715 Ignore carriage-return at the end of line when doing a comparison.
Junio C Hamano4886c772017-11-27 03:33:284716</p>
4717</dd>
4718<dt class="hdlist1">
Junio C Hamanod2c978f2011-03-20 19:42:224719--ignore-space-at-eol
4720</dt>
4721<dd>
4722<p>
4723 Ignore changes in whitespace at EOL.
4724</p>
4725</dd>
4726<dt class="hdlist1">
4727-b
4728</dt>
4729<dt class="hdlist1">
4730--ignore-space-change
4731</dt>
4732<dd>
4733<p>
4734 Ignore changes in amount of whitespace. This ignores whitespace
4735 at line end, and considers all other sequences of one or
4736 more whitespace characters to be equivalent.
4737</p>
4738</dd>
4739<dt class="hdlist1">
4740-w
4741</dt>
4742<dt class="hdlist1">
4743--ignore-all-space
4744</dt>
4745<dd>
4746<p>
4747 Ignore whitespace when comparing lines. This ignores
4748 differences even if one line has whitespace where the other
4749 line has none.
4750</p>
4751</dd>
4752<dt class="hdlist1">
Junio C Hamanoa1952302013-07-01 21:31:184753--ignore-blank-lines
4754</dt>
4755<dd>
4756<p>
4757 Ignore changes whose lines are all blank.
4758</p>
4759</dd>
4760<dt class="hdlist1">
Junio C Hamanodf3d3cd2020-11-02 22:05:054761-I&lt;regex&gt;
4762</dt>
4763<dt class="hdlist1">
4764--ignore-matching-lines=&lt;regex&gt;
4765</dt>
4766<dd>
4767<p>
4768 Ignore changes whose all lines match &lt;regex&gt;. This option may
4769 be specified more than once.
4770</p>
4771</dd>
4772<dt class="hdlist1">
Junio C Hamanod2c978f2011-03-20 19:42:224773--inter-hunk-context=&lt;lines&gt;
4774</dt>
4775<dd>
4776<p>
4777 Show the context between diff hunks, up to the specified number
4778 of lines, thereby fusing hunks that are close to each other.
Junio C Hamanobcd98f42017-01-24 00:12:164779 Defaults to <code>diff.interHunkContext</code> or 0 if the config option
4780 is unset.
Junio C Hamanod2c978f2011-03-20 19:42:224781</p>
4782</dd>
4783<dt class="hdlist1">
Junio C Hamano11821ed2011-10-19 18:42:094784-W
4785</dt>
4786<dt class="hdlist1">
4787--function-context
4788</dt>
4789<dd>
4790<p>
Junio C Hamanob7676d52020-11-18 22:15:084791 Show whole function as context lines for each change.
4792 The function names are determined in the same way as
4793 <code>git diff</code> works out patch hunk headers (see <em>Defining a
4794 custom hunk-header</em> in <a href="gitattributes.html">gitattributes(5)</a>).
Junio C Hamano11821ed2011-10-19 18:42:094795</p>
4796</dd>
4797<dt class="hdlist1">
Junio C Hamanod2c978f2011-03-20 19:42:224798--ext-diff
4799</dt>
4800<dd>
4801<p>
4802 Allow an external diff helper to be executed. If you set an
Junio C Hamanoa28a9202012-06-21 07:08:234803 external diff driver with <a href="gitattributes.html">gitattributes(5)</a>, you need
4804 to use this option with <a href="git-log.html">git-log(1)</a> and friends.
Junio C Hamanod2c978f2011-03-20 19:42:224805</p>
4806</dd>
4807<dt class="hdlist1">
4808--no-ext-diff
4809</dt>
4810<dd>
4811<p>
4812 Disallow external diff drivers.
4813</p>
4814</dd>
4815<dt class="hdlist1">
Junio C Hamanoc652aed2011-07-07 01:14:314816--textconv
4817</dt>
4818<dt class="hdlist1">
4819--no-textconv
4820</dt>
4821<dd>
4822<p>
4823 Allow (or disallow) external text conversion filters to be run
Junio C Hamanoa28a9202012-06-21 07:08:234824 when comparing binary files. See <a href="gitattributes.html">gitattributes(5)</a> for
Junio C Hamanoc652aed2011-07-07 01:14:314825 details. Because textconv filters are typically a one-way
4826 conversion, the resulting diff is suitable for human
4827 consumption, but cannot be applied. For this reason, textconv
Junio C Hamanoa28a9202012-06-21 07:08:234828 filters are enabled by default only for <a href="git-diff.html">git-diff(1)</a> and
4829 <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:314830 diff plumbing commands.
4831</p>
4832</dd>
4833<dt class="hdlist1">
Junio C Hamanod2c978f2011-03-20 19:42:224834--ignore-submodules[=&lt;when&gt;]
4835</dt>
4836<dd>
4837<p>
4838 Ignore changes to submodules in the diff generation. &lt;when&gt; can be
Junio C Hamanoc7102962013-05-29 23:57:174839 either "none", "untracked", "dirty" or "all", which is the default.
Junio C Hamanod2c978f2011-03-20 19:42:224840 Using "none" will consider the submodule modified when it either contains
4841 untracked or modified files or its HEAD differs from the commit recorded
4842 in the superproject and can be used to override any settings of the
Junio C Hamanoa28a9202012-06-21 07:08:234843 <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 Hamanod2c978f2011-03-20 19:42:224844 "untracked" is used submodules are not considered dirty when they only
4845 contain untracked content (but they are still scanned for modified
4846 content). Using "dirty" ignores all changes to the work tree of submodules,
4847 only changes to the commits stored in the superproject are shown (this was
4848 the behavior until 1.7.0). Using "all" hides all changes to submodules.
4849</p>
4850</dd>
4851<dt class="hdlist1">
4852--src-prefix=&lt;prefix&gt;
4853</dt>
4854<dd>
4855<p>
4856 Show the given source prefix instead of "a/".
4857</p>
4858</dd>
4859<dt class="hdlist1">
4860--dst-prefix=&lt;prefix&gt;
4861</dt>
4862<dd>
4863<p>
4864 Show the given destination prefix instead of "b/".
4865</p>
4866</dd>
4867<dt class="hdlist1">
4868--no-prefix
4869</dt>
4870<dd>
4871<p>
4872 Do not show any source or destination prefix.
4873</p>
4874</dd>
Junio C Hamanocd451662016-09-13 00:54:094875<dt class="hdlist1">
Junio C Hamano6d774cf2023-03-21 21:38:044876--default-prefix
4877</dt>
4878<dd>
4879<p>
4880 Use the default source and destination prefixes ("a/" and "b/").
4881 This is usually the default already, but may be used to override
4882 config such as <code>diff.noprefix</code>.
4883</p>
4884</dd>
4885<dt class="hdlist1">
Junio C Hamanocd451662016-09-13 00:54:094886--line-prefix=&lt;prefix&gt;
4887</dt>
4888<dd>
4889<p>
4890 Prepend an additional prefix to every line of output.
4891</p>
4892</dd>
Junio C Hamanof7017f12016-10-27 23:31:344893<dt class="hdlist1">
4894--ita-invisible-in-index
4895</dt>
4896<dd>
4897<p>
4898 By default entries added by "git add -N" appear as an existing
4899 empty file in "git diff" and a new file in "git diff --cached".
4900 This option makes the entry appear as a new file in "git diff"
4901 and non-existent in "git diff --cached". This option could be
4902 reverted with <code>--ita-visible-in-index</code>. Both options are
4903 experimental and could be removed in future.
4904</p>
4905</dd>
Junio C Hamanod2c978f2011-03-20 19:42:224906</dl></div>
4907<div class="paragraph"><p>For more detailed explanation on these common options, see also
Junio C Hamanoa28a9202012-06-21 07:08:234908<a href="gitdiffcore.html">gitdiffcore(7)</a>.</p></div>
Junio C Hamanod2c978f2011-03-20 19:42:224909</div>
Junio C Hamano9629d4f2012-12-19 00:28:274910</div>
4911<div class="sect1">
Junio C Hamanoa75aada2023-01-22 01:54:304912<h2 id="generate_patch_text_with_p">Generating patch text with -p</h2>
Junio C Hamano00b8b632007-12-07 09:50:494913<div class="sectionbody">
Junio C Hamano48cd3f12019-10-09 05:55:304914<div class="paragraph"><p>Running
4915<a href="git-diff.html">git-diff(1)</a>,
4916<a href="git-log.html">git-log(1)</a>,
4917<a href="git-show.html">git-show(1)</a>,
4918<a href="git-diff-index.html">git-diff-index(1)</a>,
4919<a href="git-diff-tree.html">git-diff-tree(1)</a>, or
4920<a href="git-diff-files.html">git-diff-files(1)</a>
4921with the <code>-p</code> option produces patch text.
4922You can customize the creation of patch text via the
Junio C Hamano558abd22020-09-03 20:22:344923<code>GIT_EXTERNAL_DIFF</code> and the <code>GIT_DIFF_OPTS</code> environment variables
Junio C Hamanobe601db2021-05-07 04:20:284924(see <a href="git.html">git(1)</a>), and the <code>diff</code> attribute (see <a href="gitattributes.html">gitattributes(5)</a>).</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:594925<div class="paragraph"><p>What the -p option produces is slightly different from the traditional
Junio C Hamano7f9fa862010-10-19 23:51:144926diff format:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:594927<div class="olist arabic"><ol class="arabic">
Junio C Hamano00b8b632007-12-07 09:50:494928<li>
4929<p>
Junio C Hamano7f9fa862010-10-19 23:51:144930It is preceded with a "git diff" header that looks like this:
Junio C Hamano00b8b632007-12-07 09:50:494931</p>
4932<div class="literalblock">
4933<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:514934<pre><code>diff --git a/file1 b/file2</code></pre>
Junio C Hamano00b8b632007-12-07 09:50:494935</div></div>
Junio C Hamanoac12f0e2014-09-19 22:32:514936<div class="paragraph"><p>The <code>a/</code> and <code>b/</code> filenames are the same unless rename/copy is
Junio C Hamano00b8b632007-12-07 09:50:494937involved. Especially, even for a creation or a deletion,
Junio C Hamanoac12f0e2014-09-19 22:32:514938<code>/dev/null</code> is <em>not</em> used in place of the <code>a/</code> or <code>b/</code> filenames.</p></div>
4939<div class="paragraph"><p>When rename/copy is involved, <code>file1</code> and <code>file2</code> show the
Junio C Hamano00b8b632007-12-07 09:50:494940name of the source file of the rename/copy and the name of
Junio C Hamanoba4b9282008-07-06 05:20:314941the file that rename/copy produces, respectively.</p></div>
Junio C Hamano00b8b632007-12-07 09:50:494942</li>
4943<li>
4944<p>
4945It is followed by one or more extended header lines:
4946</p>
4947<div class="literalblock">
4948<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:514949<pre><code>old mode &lt;mode&gt;
Junio C Hamano00b8b632007-12-07 09:50:494950new mode &lt;mode&gt;
4951deleted file mode &lt;mode&gt;
4952new file mode &lt;mode&gt;
4953copy from &lt;path&gt;
4954copy to &lt;path&gt;
4955rename from &lt;path&gt;
4956rename to &lt;path&gt;
4957similarity index &lt;number&gt;
4958dissimilarity index &lt;number&gt;
Junio C Hamanoac12f0e2014-09-19 22:32:514959index &lt;hash&gt;..&lt;hash&gt; &lt;mode&gt;</code></pre>
Junio C Hamano00b8b632007-12-07 09:50:494960</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:594961<div class="paragraph"><p>File modes are printed as 6-digit octal numbers including the file type
Junio C Hamano7f9fa862010-10-19 23:51:144962and file permission bits.</p></div>
Junio C Hamanoac12f0e2014-09-19 22:32:514963<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:594964<div class="paragraph"><p>The similarity index is the percentage of unchanged lines, and
Junio C Hamano7f9fa862010-10-19 23:51:144965the dissimilarity index is the percentage of changed lines. It
4966is a rounded down integer, followed by a percent sign. The
4967similarity index value of 100% is thus reserved for two equal
4968files, while 100% dissimilarity means that no line from the old
4969file made it into the new one.</p></div>
Junio C Hamano48cd3f12019-10-09 05:55:304970<div class="paragraph"><p>The index line includes the blob object names before and after the change.
Junio C Hamano7f9fa862010-10-19 23:51:144971The &lt;mode&gt; is included if the file mode does not change; otherwise,
4972separate lines indicate the old and the new mode.</p></div>
Junio C Hamano00b8b632007-12-07 09:50:494973</li>
4974<li>
4975<p>
Junio C Hamano0f6f3bf2017-03-13 07:01:534976Pathnames with "unusual" characters are quoted as explained for
4977 the configuration variable <code>core.quotePath</code> (see
4978 <a href="git-config.html">git-config(1)</a>).
Junio C Hamano00b8b632007-12-07 09:50:494979</p>
4980</li>
Junio C Hamano7f9fa862010-10-19 23:51:144981<li>
4982<p>
Junio C Hamanoac12f0e2014-09-19 22:32:514983All the <code>file1</code> files in the output refer to files before the
4984 commit, and all the <code>file2</code> files refer to files after the commit.
Junio C Hamano7f9fa862010-10-19 23:51:144985 It is incorrect to apply each change to each file sequentially. For
4986 example, this patch will swap a and b:
4987</p>
4988<div class="literalblock">
4989<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:514990<pre><code>diff --git a/a b/b
Junio C Hamano7f9fa862010-10-19 23:51:144991rename from a
4992rename to b
4993diff --git a/b b/a
4994rename from b
Junio C Hamanoac12f0e2014-09-19 22:32:514995rename to a</code></pre>
Junio C Hamano7f9fa862010-10-19 23:51:144996</div></div>
4997</li>
Junio C Hamanobe601db2021-05-07 04:20:284998<li>
4999<p>
5000Hunk headers mention the name of the function to which the hunk
5001 applies. See "Defining a custom hunk-header" in
5002 <a href="gitattributes.html">gitattributes(5)</a> for details of how to tailor to this to
5003 specific languages.
5004</p>
5005</li>
Junio C Hamanoba4b9282008-07-06 05:20:315006</ol></div>
Junio C Hamano00b8b632007-12-07 09:50:495007</div>
Junio C Hamano9629d4f2012-12-19 00:28:275008</div>
5009<div class="sect1">
Junio C Hamano48cd3f12019-10-09 05:55:305010<h2 id="_combined_diff_format">Combined diff format</h2>
Junio C Hamano00b8b632007-12-07 09:50:495011<div class="sectionbody">
Junio C Hamano1dbca522015-05-22 20:48:555012<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:435013produce a <em>combined diff</em> when showing a merge. This is the default
Junio C Hamanoa28a9202012-06-21 07:08:235014format when showing merges with <a href="git-diff.html">git-diff(1)</a> or
Junio C Hamano8c860d62021-02-06 01:37:475015<a href="git-show.html">git-show(1)</a>. Note also that you can give suitable
5016<code>--diff-merges</code> option to any of these commands to force generation of
5017diffs in specific format.</p></div>
Junio C Hamano48cd3f12019-10-09 05:55:305018<div class="paragraph"><p>A "combined diff" format looks like this:</p></div>
Junio C Hamano00b8b632007-12-07 09:50:495019<div class="listingblock">
5020<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:515021<pre><code>diff --combined describe.c
Junio C Hamano00b8b632007-12-07 09:50:495022index fabadb8,cc95eb0..4866510
5023--- a/describe.c
5024+++ b/describe.c
5025@@@ -98,20 -98,12 +98,20 @@@
5026 return (a_date &gt; b_date) ? -1 : (a_date == b_date) ? 0 : 1;
5027 }
5028
5029- static void describe(char *arg)
5030 -static void describe(struct commit *cmit, int last_one)
5031++static void describe(char *arg, int last_one)
5032 {
5033 + unsigned char sha1[20];
5034 + struct commit *cmit;
5035 struct commit_list *list;
5036 static int initialized = 0;
5037 struct commit_name *n;
5038
5039 + if (get_sha1(arg, sha1) &lt; 0)
5040 + usage(describe_usage);
5041 + cmit = lookup_commit_reference(sha1);
5042 + if (!cmit)
5043 + usage(describe_usage);
5044 +
5045 if (!initialized) {
5046 initialized = 1;
Junio C Hamanoac12f0e2014-09-19 22:32:515047 for_each_ref(get_name);</code></pre>
Junio C Hamano00b8b632007-12-07 09:50:495048</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:595049<div class="olist arabic"><ol class="arabic">
Junio C Hamano00b8b632007-12-07 09:50:495050<li>
5051<p>
5052It is preceded with a "git diff" header, that looks like
Junio C Hamano48cd3f12019-10-09 05:55:305053 this (when the <code>-c</code> option is used):
Junio C Hamano00b8b632007-12-07 09:50:495054</p>
5055<div class="literalblock">
5056<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:515057<pre><code>diff --combined file</code></pre>
Junio C Hamano00b8b632007-12-07 09:50:495058</div></div>
Junio C Hamano48cd3f12019-10-09 05:55:305059<div class="paragraph"><p>or like this (when the <code>--cc</code> option is used):</p></div>
Junio C Hamano00b8b632007-12-07 09:50:495060<div class="literalblock">
5061<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:515062<pre><code>diff --cc file</code></pre>
Junio C Hamano00b8b632007-12-07 09:50:495063</div></div>
5064</li>
5065<li>
5066<p>
5067It is followed by one or more extended header lines
5068 (this example shows a merge with two parents):
5069</p>
5070<div class="literalblock">
5071<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:515072<pre><code>index &lt;hash&gt;,&lt;hash&gt;..&lt;hash&gt;
Junio C Hamano00b8b632007-12-07 09:50:495073mode &lt;mode&gt;,&lt;mode&gt;..&lt;mode&gt;
5074new file mode &lt;mode&gt;
Junio C Hamanoac12f0e2014-09-19 22:32:515075deleted file mode &lt;mode&gt;,&lt;mode&gt;</code></pre>
Junio C Hamano00b8b632007-12-07 09:50:495076</div></div>
Junio C Hamanoac12f0e2014-09-19 22:32:515077<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 Hamano00b8b632007-12-07 09:50:495078the &lt;mode&gt; is different from the rest. Extended headers with
5079information about detected contents movement (renames and
5080copying detection) are designed to work with diff of two
Junio C Hamanoba4b9282008-07-06 05:20:315081&lt;tree-ish&gt; and are not used by combined diff format.</p></div>
Junio C Hamano00b8b632007-12-07 09:50:495082</li>
5083<li>
5084<p>
5085It is followed by two-line from-file/to-file header
5086</p>
5087<div class="literalblock">
5088<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:515089<pre><code>--- a/file
5090+++ b/file</code></pre>
Junio C Hamano00b8b632007-12-07 09:50:495091</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:595092<div class="paragraph"><p>Similar to two-line header for traditional <em>unified</em> diff
Junio C Hamanoac12f0e2014-09-19 22:32:515093format, <code>/dev/null</code> is used to signal created or deleted
Junio C Hamanoba4b9282008-07-06 05:20:315094files.</p></div>
Junio C Hamano11f15372019-03-07 03:17:005095<div class="paragraph"><p>However, if the --combined-all-paths option is provided, instead of a
5096two-line from-file/to-file you get a N+1 line from-file/to-file header,
5097where N is the number of parents in the merge commit</p></div>
5098<div class="literalblock">
5099<div class="content">
5100<pre><code>--- a/file
5101--- a/file
5102--- a/file
5103+++ b/file</code></pre>
5104</div></div>
5105<div class="paragraph"><p>This extended format can be useful if rename or copy detection is
5106active, to allow you to see the original name of the file in different
5107parents.</p></div>
Junio C Hamano00b8b632007-12-07 09:50:495108</li>
5109<li>
5110<p>
5111Chunk header format is modified to prevent people from
Junio C Hamanoac12f0e2014-09-19 22:32:515112 accidentally feeding it to <code>patch -p1</code>. Combined diff format
Junio C Hamano00b8b632007-12-07 09:50:495113 was created for review of merge commit changes, and was not
Junio C Hamano48cd3f12019-10-09 05:55:305114 meant to be applied. The change is similar to the change in the
Junio C Hamano00b8b632007-12-07 09:50:495115 extended <em>index</em> header:
5116</p>
5117<div class="literalblock">
5118<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:515119<pre><code>@@@ &lt;from-file-range&gt; &lt;from-file-range&gt; &lt;to-file-range&gt; @@@</code></pre>
Junio C Hamano00b8b632007-12-07 09:50:495120</div></div>
Junio C Hamanoac12f0e2014-09-19 22:32:515121<div class="paragraph"><p>There are (number of parents + 1) <code>@</code> characters in the chunk
Junio C Hamanoba4b9282008-07-06 05:20:315122header for combined diff format.</p></div>
Junio C Hamano00b8b632007-12-07 09:50:495123</li>
Junio C Hamanoba4b9282008-07-06 05:20:315124</ol></div>
Junio C Hamano68cf15a2010-11-06 01:01:595125<div class="paragraph"><p>Unlike the traditional <em>unified</em> diff format, which shows two
Junio C Hamanoac12f0e2014-09-19 22:32:515126files 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
5127added to B), or <code>" "</code> (space&#8201;&#8212;&#8201;unchanged) prefix, this format
Junio C Hamano00b8b632007-12-07 09:50:495128compares two or more files file1, file2,&#8230; with one file X, and
5129shows how X differs from each of fileN. One column for each of
Junio C Hamano68cf15a2010-11-06 01:01:595130fileN is prepended to the output line to note how X&#8217;s line is
Junio C Hamanoba4b9282008-07-06 05:20:315131different from it.</p></div>
Junio C Hamanoac12f0e2014-09-19 22:32:515132<div class="paragraph"><p>A <code>-</code> character in the column N means that the line appears in
5133fileN but it does not appear in the result. A <code>+</code> character
Junio C Hamano54bf1e22008-12-20 06:30:115134in the column N means that the line appears in the result,
Junio C Hamano00b8b632007-12-07 09:50:495135and fileN does not have that line (in other words, the line was
Junio C Hamanoba4b9282008-07-06 05:20:315136added, from the point of view of that parent).</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:595137<div class="paragraph"><p>In the above example output, the function signature was changed
Junio C Hamanoac12f0e2014-09-19 22:32:515138from both files (hence two <code>-</code> removals from both file1 and
5139file2, plus <code>++</code> to mean one line that was added does not appear
Junio C Hamanod75148a2014-04-08 19:48:385140in either file1 or file2). Also eight other lines are the same
Junio C Hamanoac12f0e2014-09-19 22:32:515141from file1 but do not appear in file2 (hence prefixed with <code>+</code>).</p></div>
5142<div class="paragraph"><p>When shown by <code>git diff-tree -c</code>, it compares the parents of a
Junio C Hamano00b8b632007-12-07 09:50:495143merge commit with the merge result (i.e. file1..fileN are the
Junio C Hamanoac12f0e2014-09-19 22:32:515144parents). When shown by <code>git diff-files -c</code>, it compares the
Junio C Hamano00b8b632007-12-07 09:50:495145two unresolved merge parents with the working tree file
5146(i.e. file1 is stage 2 aka "our version", file2 is stage 3 aka
Junio C Hamanoba4b9282008-07-06 05:20:315147"their version").</p></div>
Junio C Hamano00b8b632007-12-07 09:50:495148</div>
Junio C Hamano9629d4f2012-12-19 00:28:275149</div>
5150<div class="sect1">
Junio C Hamano58f587a2013-07-22 19:20:595151<h2 id="_examples">EXAMPLES</h2>
Junio C Hamano1a4e8412005-12-27 08:17:235152<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:595153<div class="dlist"><dl>
5154<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:515155<code>git log --no-merges</code>
Junio C Hamano1a4e8412005-12-27 08:17:235156</dt>
5157<dd>
5158<p>
5159 Show the whole commit history, but skip any merges
5160</p>
5161</dd>
Junio C Hamano68cf15a2010-11-06 01:01:595162<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:515163<code>git log v2.6.12.. include/scsi drivers/scsi</code>
Junio C Hamano1a4e8412005-12-27 08:17:235164</dt>
5165<dd>
5166<p>
5167 Show all commits since version <em>v2.6.12</em> that changed any file
Junio C Hamanoac12f0e2014-09-19 22:32:515168 in the <code>include/scsi</code> or <code>drivers/scsi</code> subdirectories
Junio C Hamano1a4e8412005-12-27 08:17:235169</p>
5170</dd>
Junio C Hamano68cf15a2010-11-06 01:01:595171<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:515172<code>git log --since="2 weeks ago" -- gitk</code>
Junio C Hamano1a4e8412005-12-27 08:17:235173</dt>
5174<dd>
5175<p>
5176 Show the changes during the last two weeks to the file <em>gitk</em>.
Junio C Hamanoccb82522018-05-08 07:52:095177 The <code>--</code> is necessary to avoid confusion with the <strong>branch</strong> named
Junio C Hamano1a4e8412005-12-27 08:17:235178 <em>gitk</em>
5179</p>
5180</dd>
Junio C Hamano68cf15a2010-11-06 01:01:595181<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:515182<code>git log --name-status release..test</code>
Junio C Hamanoba7c8d82006-04-15 06:17:425183</dt>
5184<dd>
5185<p>
5186 Show the commits that are in the "test" branch but not yet
5187 in the "release" branch, along with the list of paths
5188 each commit modifies.
5189</p>
5190</dd>
Junio C Hamano68cf15a2010-11-06 01:01:595191<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:515192<code>git log --follow builtin/rev-list.c</code>
Junio C Hamano235d53f2007-07-13 00:25:155193</dt>
5194<dd>
5195<p>
Junio C Hamanoac12f0e2014-09-19 22:32:515196 Shows the commits that changed <code>builtin/rev-list.c</code>, including
Junio C Hamano235d53f2007-07-13 00:25:155197 those commits that occurred before the file was given its
5198 present name.
5199</p>
5200</dd>
Junio C Hamano68cf15a2010-11-06 01:01:595201<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:515202<code>git log --branches --not --remotes=origin</code>
Junio C Hamano57827fb2010-01-23 03:02:505203</dt>
5204<dd>
5205<p>
5206 Shows all commits that are in any of local branches but not in
Junio C Hamano97bcb482010-11-25 03:16:075207 any of remote-tracking branches for <em>origin</em> (what you have that
Junio C Hamano68cf15a2010-11-06 01:01:595208 origin doesn&#8217;t).
Junio C Hamano57827fb2010-01-23 03:02:505209</p>
5210</dd>
Junio C Hamano68cf15a2010-11-06 01:01:595211<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:515212<code>git log master --not --remotes=*/master</code>
Junio C Hamano57827fb2010-01-23 03:02:505213</dt>
5214<dd>
5215<p>
5216 Shows all commits that are in local master but not in any remote
5217 repository master branches.
5218</p>
5219</dd>
Junio C Hamano68cf15a2010-11-06 01:01:595220<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:515221<code>git log -p -m --first-parent</code>
Junio C Hamano31667362010-03-25 00:38:535222</dt>
5223<dd>
5224<p>
5225 Shows the history including change diffs, but only from the
Junio C Hamanob73af6c2013-12-03 22:07:115226 &#8220;main branch&#8221; perspective, skipping commits that come from merged
Junio C Hamano31667362010-03-25 00:38:535227 branches, and showing full diffs of changes introduced by the merges.
5228 This makes sense only when following a strict policy of merging all
5229 topic branches when staying on a single integration branch.
5230</p>
5231</dd>
Junio C Hamano693e7092012-09-12 22:56:535232<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:515233<code>git log -L '/int main/',/^}/:main.c</code>
Junio C Hamano7e590a12013-06-02 23:46:525234</dt>
5235<dd>
5236<p>
Junio C Hamanoac12f0e2014-09-19 22:32:515237 Shows how the function <code>main()</code> in the file <code>main.c</code> evolved
Junio C Hamano7e590a12013-06-02 23:46:525238 over time.
5239</p>
5240</dd>
5241<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:515242<code>git log -3</code>
Junio C Hamano693e7092012-09-12 22:56:535243</dt>
5244<dd>
5245<p>
5246 Limits the number of commits to show to 3.
5247</p>
5248</dd>
Junio C Hamanoba4b9282008-07-06 05:20:315249</dl></div>
Junio C Hamano1a4e8412005-12-27 08:17:235250</div>
Junio C Hamano9629d4f2012-12-19 00:28:275251</div>
5252<div class="sect1">
Junio C Hamano58f587a2013-07-22 19:20:595253<h2 id="_discussion">DISCUSSION</h2>
Junio C Hamano775a0f42006-12-31 01:19:145254<div class="sectionbody">
Junio C Hamanod7ed4042015-08-03 19:43:005255<div class="paragraph"><p>Git is to some extent character encoding agnostic.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:595256<div class="ulist"><ul>
Junio C Hamano775a0f42006-12-31 01:19:145257<li>
5258<p>
Junio C Hamano54bf1e22008-12-20 06:30:115259The contents of the blob objects are uninterpreted sequences
Junio C Hamano775a0f42006-12-31 01:19:145260 of bytes. There is no encoding translation at the core
5261 level.
5262</p>
5263</li>
5264<li>
5265<p>
Junio C Hamanod7ed4042015-08-03 19:43:005266Path names are encoded in UTF-8 normalization form C. This
5267 applies to tree objects, the index file, ref names, as well as
5268 path names in command line arguments, environment variables
5269 and config files (<code>.git/config</code> (see <a href="git-config.html">git-config(1)</a>),
5270 <a href="gitignore.html">gitignore(5)</a>, <a href="gitattributes.html">gitattributes(5)</a> and
5271 <a href="gitmodules.html">gitmodules(5)</a>).
5272</p>
5273<div class="paragraph"><p>Note that Git at the core level treats path names simply as
5274sequences of non-NUL bytes, there are no path name encoding
5275conversions (except on Mac and Windows). Therefore, using
5276non-ASCII path names will mostly work even on platforms and file
5277systems that use legacy extended ASCII encodings. However,
5278repositories created on such systems will not work properly on
5279UTF-8-based systems (e.g. Linux, Mac, Windows) and vice versa.
5280Additionally, many Git-based tools simply assume path names to
5281be UTF-8 and will fail to display other encodings correctly.</p></div>
5282</li>
5283<li>
5284<p>
5285Commit log messages are typically encoded in UTF-8, but other
5286 extended ASCII encodings are also supported. This includes
5287 ISO-8859-x, CP125x and many others, but <em>not</em> UTF-16/32,
5288 EBCDIC and CJK multi-byte encodings (GBK, Shift-JIS, Big5,
5289 EUC-x, CP9xx etc.).
Junio C Hamano775a0f42006-12-31 01:19:145290</p>
5291</li>
Junio C Hamanoba4b9282008-07-06 05:20:315292</ul></div>
Junio C Hamano68cf15a2010-11-06 01:01:595293<div class="paragraph"><p>Although we encourage that the commit log messages are encoded
Junio C Hamano076ffcc2013-02-06 05:13:215294in UTF-8, both the core and Git Porcelain are designed not to
Junio C Hamano775a0f42006-12-31 01:19:145295force UTF-8 on projects. If all participants of a particular
Junio C Hamano076ffcc2013-02-06 05:13:215296project find it more convenient to use legacy encodings, Git
Junio C Hamano775a0f42006-12-31 01:19:145297does not forbid it. However, there are a few things to keep in
Junio C Hamanoba4b9282008-07-06 05:20:315298mind.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:595299<div class="olist arabic"><ol class="arabic">
Junio C Hamano775a0f42006-12-31 01:19:145300<li>
5301<p>
Junio C Hamano1aa40d22010-01-21 17:46:435302<em>git commit</em> and <em>git commit-tree</em> issues
Junio C Hamano14b76482008-01-05 10:32:265303 a warning if the commit log message given to it does not look
Junio C Hamano775a0f42006-12-31 01:19:145304 like a valid UTF-8 string, unless you explicitly say your
5305 project uses a legacy encoding. The way to say this is to
Junio C Hamanoa372d5b2021-02-26 01:34:375306 have <code>i18n.commitEncoding</code> in <code>.git/config</code> file, like this:
Junio C Hamano775a0f42006-12-31 01:19:145307</p>
5308<div class="listingblock">
5309<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:515310<pre><code>[i18n]
Junio C Hamanobb34c102017-07-21 22:42:285311 commitEncoding = ISO-8859-1</code></pre>
Junio C Hamano775a0f42006-12-31 01:19:145312</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:595313<div class="paragraph"><p>Commit objects created with the above setting record the value
Junio C Hamanobb34c102017-07-21 22:42:285314of <code>i18n.commitEncoding</code> in its <code>encoding</code> header. This is to
Junio C Hamano775a0f42006-12-31 01:19:145315help other people who look at them later. Lack of this header
Junio C Hamanoba4b9282008-07-06 05:20:315316implies that the commit log message is encoded in UTF-8.</p></div>
Junio C Hamano775a0f42006-12-31 01:19:145317</li>
5318<li>
5319<p>
Junio C Hamano1aa40d22010-01-21 17:46:435320<em>git log</em>, <em>git show</em>, <em>git blame</em> and friends look at the
Junio C Hamanoac12f0e2014-09-19 22:32:515321 <code>encoding</code> header of a commit object, and try to re-code the
Junio C Hamanoaa17c7c2008-11-03 04:36:585322 log message into UTF-8 unless otherwise specified. You can
Junio C Hamano775a0f42006-12-31 01:19:145323 specify the desired output encoding with
Junio C Hamanobb34c102017-07-21 22:42:285324 <code>i18n.logOutputEncoding</code> in <code>.git/config</code> file, like this:
Junio C Hamano775a0f42006-12-31 01:19:145325</p>
5326<div class="listingblock">
5327<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:515328<pre><code>[i18n]
Junio C Hamanobb34c102017-07-21 22:42:285329 logOutputEncoding = ISO-8859-1</code></pre>
Junio C Hamano775a0f42006-12-31 01:19:145330</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:595331<div class="paragraph"><p>If you do not have this configuration variable, the value of
Junio C Hamanobb34c102017-07-21 22:42:285332<code>i18n.commitEncoding</code> is used instead.</p></div>
Junio C Hamano775a0f42006-12-31 01:19:145333</li>
Junio C Hamanoba4b9282008-07-06 05:20:315334</ol></div>
Junio C Hamano68cf15a2010-11-06 01:01:595335<div class="paragraph"><p>Note that we deliberately chose not to re-code the commit log
Junio C Hamano775a0f42006-12-31 01:19:145336message when a commit is made to force UTF-8 at the commit
5337object level, because re-coding to UTF-8 is not necessarily a
Junio C Hamanoba4b9282008-07-06 05:20:315338reversible operation.</p></div>
Junio C Hamano775a0f42006-12-31 01:19:145339</div>
Junio C Hamano9629d4f2012-12-19 00:28:275340</div>
5341<div class="sect1">
Junio C Hamano58f587a2013-07-22 19:20:595342<h2 id="_configuration">CONFIGURATION</h2>
Junio C Hamanoa574a092010-06-13 19:57:105343<div class="sectionbody">
Junio C Hamanoa28a9202012-06-21 07:08:235344<div class="paragraph"><p>See <a href="git-config.html">git-config(1)</a> for core variables and <a href="git-diff.html">git-diff(1)</a>
Junio C Hamanoa574a092010-06-13 19:57:105345for settings related to diff generation.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:595346<div class="dlist"><dl>
5347<dt class="hdlist1">
Junio C Hamanoa574a092010-06-13 19:57:105348format.pretty
5349</dt>
5350<dd>
5351<p>
Junio C Hamanoac12f0e2014-09-19 22:32:515352 Default for the <code>--format</code> option. (See <em>Pretty Formats</em> above.)
5353 Defaults to <code>medium</code>.
Junio C Hamanoa574a092010-06-13 19:57:105354</p>
5355</dd>
Junio C Hamano68cf15a2010-11-06 01:01:595356<dt class="hdlist1">
Junio C Hamanoa574a092010-06-13 19:57:105357i18n.logOutputEncoding
5358</dt>
5359<dd>
5360<p>
Junio C Hamanob73af6c2013-12-03 22:07:115361 Encoding to use when displaying logs. (See <em>Discussion</em> above.)
Junio C Hamanoac12f0e2014-09-19 22:32:515362 Defaults to the value of <code>i18n.commitEncoding</code> if set, and UTF-8
Junio C Hamanoa574a092010-06-13 19:57:105363 otherwise.
5364</p>
5365</dd>
Junio C Hamanoba8baee2022-09-14 20:25:235366</dl></div>
5367<div class="paragraph"><p>Everything above this line in this section isn&#8217;t included from the
5368<a href="git-config.html">git-config(1)</a> documentation. The content that follows is the
5369same as what&#8217;s found there:</p></div>
5370<div class="dlist"><dl>
5371<dt class="hdlist1">
5372log.abbrevCommit
5373</dt>
5374<dd>
5375<p>
5376 If true, makes <a href="git-log.html">git-log(1)</a>, <a href="git-show.html">git-show(1)</a>, and
5377 <a href="git-whatchanged.html">git-whatchanged(1)</a> assume <code>--abbrev-commit</code>. You may
5378 override this option with <code>--no-abbrev-commit</code>.
5379</p>
5380</dd>
Junio C Hamano68cf15a2010-11-06 01:01:595381<dt class="hdlist1">
Junio C Hamanoa574a092010-06-13 19:57:105382log.date
5383</dt>
5384<dd>
5385<p>
Junio C Hamanoba8baee2022-09-14 20:25:235386 Set the default date-time mode for the <em>log</em> command.
5387 Setting a value for log.date is similar to using <em>git log</em>'s
5388 <code>--date</code> option. See <a href="git-log.html">git-log(1)</a> for details.
Junio C Hamanoa574a092010-06-13 19:57:105389</p>
Junio C Hamano23168ef2019-02-07 07:20:475390<div class="paragraph"><p>If the format is set to "auto:foo" and the pager is in use, format
5391"foo" will be the used for the date format. Otherwise "default" will
5392be used.</p></div>
Junio C Hamanoa574a092010-06-13 19:57:105393</dd>
Junio C Hamano68cf15a2010-11-06 01:01:595394<dt class="hdlist1">
Junio C Hamanoba8baee2022-09-14 20:25:235395log.decorate
5396</dt>
5397<dd>
5398<p>
5399 Print out the ref names of any commits that are shown by the log
5400 command. If <em>short</em> is specified, the ref name prefixes <em>refs/heads/</em>,
5401 <em>refs/tags/</em> and <em>refs/remotes/</em> will not be printed. If <em>full</em> is
5402 specified, the full ref name (including prefix) will be printed.
5403 If <em>auto</em> is specified, then if the output is going to a terminal,
5404 the ref names are shown as if <em>short</em> were given, otherwise no ref
5405 names are shown. This is the same as the <code>--decorate</code> option
5406 of the <code>git log</code>.
5407</p>
5408</dd>
5409<dt class="hdlist1">
5410log.initialDecorationSet
5411</dt>
5412<dd>
5413<p>
5414 By default, <code>git log</code> only shows decorations for certain known ref
5415 namespaces. If <em>all</em> is specified, then show all refs as
5416 decorations.
5417</p>
5418</dd>
5419<dt class="hdlist1">
5420log.excludeDecoration
5421</dt>
5422<dd>
5423<p>
5424 Exclude the specified patterns from the log decorations. This is
5425 similar to the <code>--decorate-refs-exclude</code> command-line option, but
5426 the config option can be overridden by the <code>--decorate-refs</code>
5427 option.
5428</p>
5429</dd>
5430<dt class="hdlist1">
5431log.diffMerges
5432</dt>
5433<dd>
5434<p>
Junio C Hamano53cd02b2022-10-10 21:42:315435 Set diff format to be used when <code>--diff-merges=on</code> is
5436 specified, see <code>--diff-merges</code> in <a href="git-log.html">git-log(1)</a> for
5437 details. Defaults to <code>separate</code>.
Junio C Hamanoba8baee2022-09-14 20:25:235438</p>
5439</dd>
5440<dt class="hdlist1">
Junio C Hamanod7ed4042015-08-03 19:43:005441log.follow
5442</dt>
5443<dd>
5444<p>
Junio C Hamanob0a1e832015-10-15 23:08:315445 If <code>true</code>, <code>git log</code> will act as if the <code>--follow</code> option was used when
5446 a single &lt;path&gt; is given. This has the same limitations as <code>--follow</code>,
5447 i.e. it cannot be used to follow multiple files and does not work well
5448 on non-linear history.
Junio C Hamanod7ed4042015-08-03 19:43:005449</p>
5450</dd>
5451<dt class="hdlist1">
Junio C Hamanoba8baee2022-09-14 20:25:235452log.graphColors
5453</dt>
5454<dd>
5455<p>
5456 A list of colors, separated by commas, that can be used to draw
5457 history lines in <code>git log --graph</code>.
5458</p>
5459</dd>
5460<dt class="hdlist1">
Junio C Hamano322c6242015-03-23 21:32:465461log.showRoot
Junio C Hamanoa574a092010-06-13 19:57:105462</dt>
5463<dd>
5464<p>
Junio C Hamanoba8baee2022-09-14 20:25:235465 If true, the initial commit will be shown as a big creation event.
5466 This is equivalent to a diff against an empty tree.
5467 Tools like <a href="git-log.html">git-log(1)</a> or <a href="git-whatchanged.html">git-whatchanged(1)</a>, which
5468 normally hide the root commit will now show it. True by default.
Junio C Hamanoa574a092010-06-13 19:57:105469</p>
5470</dd>
Junio C Hamano68cf15a2010-11-06 01:01:595471<dt class="hdlist1">
Junio C Hamano48931e22016-07-11 20:08:475472log.showSignature
5473</dt>
5474<dd>
5475<p>
Junio C Hamanoba8baee2022-09-14 20:25:235476 If true, makes <a href="git-log.html">git-log(1)</a>, <a href="git-show.html">git-show(1)</a>, and
5477 <a href="git-whatchanged.html">git-whatchanged(1)</a> assume <code>--show-signature</code>.
Junio C Hamano48931e22016-07-11 20:08:475478</p>
5479</dd>
5480<dt class="hdlist1">
Junio C Hamanoba8baee2022-09-14 20:25:235481log.mailmap
Junio C Hamanoa574a092010-06-13 19:57:105482</dt>
5483<dd>
5484<p>
Junio C Hamanoba8baee2022-09-14 20:25:235485 If true, makes <a href="git-log.html">git-log(1)</a>, <a href="git-show.html">git-show(1)</a>, and
5486 <a href="git-whatchanged.html">git-whatchanged(1)</a> assume <code>--use-mailmap</code>, otherwise
5487 assume <code>--no-use-mailmap</code>. True by default.
5488</p>
5489</dd>
5490<dt class="hdlist1">
5491notes.mergeStrategy
5492</dt>
5493<dd>
5494<p>
5495 Which merge strategy to choose by default when resolving notes
5496 conflicts. Must be one of <code>manual</code>, <code>ours</code>, <code>theirs</code>, <code>union</code>, or
5497 <code>cat_sort_uniq</code>. Defaults to <code>manual</code>. See "NOTES MERGE STRATEGIES"
5498 section of <a href="git-notes.html">git-notes(1)</a> for more information on each strategy.
5499</p>
5500<div class="paragraph"><p>This setting can be overridden by passing the <code>--strategy</code> option to
5501<a href="git-notes.html">git-notes(1)</a>.</p></div>
5502</dd>
5503<dt class="hdlist1">
5504notes.&lt;name&gt;.mergeStrategy
5505</dt>
5506<dd>
5507<p>
5508 Which merge strategy to choose when doing a notes merge into
5509 refs/notes/&lt;name&gt;. This overrides the more general
5510 "notes.mergeStrategy". See the "NOTES MERGE STRATEGIES" section in
5511 <a href="git-notes.html">git-notes(1)</a> for more information on the available strategies.
Junio C Hamanoa574a092010-06-13 19:57:105512</p>
5513</dd>
Junio C Hamano68cf15a2010-11-06 01:01:595514<dt class="hdlist1">
Junio C Hamanoa574a092010-06-13 19:57:105515notes.displayRef
5516</dt>
5517<dd>
5518<p>
Junio C Hamanoba8baee2022-09-14 20:25:235519 Which ref (or refs, if a glob or specified more than once), in
5520 addition to the default set by <code>core.notesRef</code> or
5521 <code>GIT_NOTES_REF</code>, to read notes from when showing commit
5522 messages with the <em>git log</em> family of commands.
Junio C Hamanoa574a092010-06-13 19:57:105523</p>
Junio C Hamanoba8baee2022-09-14 20:25:235524<div class="paragraph"><p>This setting can be overridden with the <code>GIT_NOTES_DISPLAY_REF</code>
5525environment variable, which must be a colon separated list of refs or
5526globs.</p></div>
5527<div class="paragraph"><p>A warning will be issued for refs that do not exist,
Junio C Hamanoa574a092010-06-13 19:57:105528but a glob that does not match any refs is silently ignored.</p></div>
Junio C Hamanoba8baee2022-09-14 20:25:235529<div class="paragraph"><p>This setting can be disabled by the <code>--no-notes</code> option to the <em>git
5530log</em> family of commands, or by the <code>--notes=&lt;ref&gt;</code> option accepted by
5531those commands.</p></div>
5532<div class="paragraph"><p>The effective value of "core.notesRef" (possibly overridden by
5533GIT_NOTES_REF) is also implicitly added to the list of refs to be
5534displayed.</p></div>
5535</dd>
5536<dt class="hdlist1">
5537notes.rewrite.&lt;command&gt;
5538</dt>
5539<dd>
5540<p>
5541 When rewriting commits with &lt;command&gt; (currently <code>amend</code> or
5542 <code>rebase</code>), if this variable is <code>false</code>, git will not copy
5543 notes from the original to the rewritten commit. Defaults to
5544 <code>true</code>. See also "<code>notes.rewriteRef</code>" below.
5545</p>
5546<div class="paragraph"><p>This setting can be overridden with the <code>GIT_NOTES_REWRITE_REF</code>
5547environment variable, which must be a colon separated list of refs or
5548globs.</p></div>
5549</dd>
5550<dt class="hdlist1">
5551notes.rewriteMode
5552</dt>
5553<dd>
5554<p>
5555 When copying notes during a rewrite (see the
5556 "notes.rewrite.&lt;command&gt;" option), determines what to do if
5557 the target commit already has a note. Must be one of
5558 <code>overwrite</code>, <code>concatenate</code>, <code>cat_sort_uniq</code>, or <code>ignore</code>.
5559 Defaults to <code>concatenate</code>.
5560</p>
5561<div class="paragraph"><p>This setting can be overridden with the <code>GIT_NOTES_REWRITE_MODE</code>
5562environment variable.</p></div>
5563</dd>
5564<dt class="hdlist1">
5565notes.rewriteRef
5566</dt>
5567<dd>
5568<p>
5569 When copying notes during a rewrite, specifies the (fully
5570 qualified) ref whose notes should be copied. May be a glob,
5571 in which case notes in all matching refs will be copied. You
5572 may also specify this configuration several times.
5573</p>
5574<div class="paragraph"><p>Does not have a default value; you must configure this variable to
5575enable note rewriting. Set it to <code>refs/notes/commits</code> to enable
5576rewriting for the default commit notes.</p></div>
5577<div class="paragraph"><p>Can be overridden with the <code>GIT_NOTES_REWRITE_REF</code> environment variable.
5578See <code>notes.rewrite.&lt;command&gt;</code> above for a further description of its format.</p></div>
Junio C Hamanoa574a092010-06-13 19:57:105579</dd>
5580</dl></div>
5581</div>
Junio C Hamano9629d4f2012-12-19 00:28:275582</div>
5583<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:315584<h2 id="_git">GIT</h2>
Junio C Hamano1a4e8412005-12-27 08:17:235585<div class="sectionbody">
Junio C Hamanoa28a9202012-06-21 07:08:235586<div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:235587</div>
Junio C Hamano7bd050f2011-09-22 06:32:225588</div>
Junio C Hamano9629d4f2012-12-19 00:28:275589</div>
Junio C Hamano7bd050f2011-09-22 06:32:225590<div id="footnotes"><hr /></div>
Junio C Hamano1a4e8412005-12-27 08:17:235591<div id="footer">
5592<div id="footer-text">
Junio C Hamano2ef0ba32018-01-26 23:13:535593Last updated
Junio C Hamanoa7b2c102023-06-13 21:00:155594 2022-09-14 13:23:11 PDT
Junio C Hamano1a4e8412005-12-27 08:17:235595</div>
5596</div>
5597</body>
5598</html>