blob: a780090bf6d0ab3488a98515e4b1c3771c95de2b [file] [log] [blame]
Junio C Hamano96153bf2018-04-25 08:25:341<?xml version="1.0" encoding="UTF-8"?>
Junio C Hamano1a4e8412005-12-27 08:17:232<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
3 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
4<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
5<head>
Junio C Hamano9629d4f2012-12-19 00:28:276<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
Junio C Hamano98c882d2020-08-13 22:06:577<meta name="generator" content="AsciiDoc 9.0.0rc2" />
Junio C Hamano68cf15a2010-11-06 01:01:598<title>git-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 Hamano7bd050f2011-09-22 06:32:22542var asciidoc = { // Namespace.
543
544/////////////////////////////////////////////////////////////////////
545// Table Of Contents generator
546/////////////////////////////////////////////////////////////////////
547
548/* Author: Mihai Bazon, September 2002
549 * http://students.infoiasi.ro/~mishoo
550 *
551 * Table Of Content generator
552 * Version: 0.4
553 *
554 * Feel free to use this script under the terms of the GNU General Public
555 * License, as long as you do not remove or alter this notice.
556 */
557
558 /* modified by Troy D. Hanson, September 2006. License: GPL */
559 /* modified by Stuart Rackham, 2006, 2009. License: GPL */
560
561// toclevels = 1..4.
562toc: function (toclevels) {
563
564 function getText(el) {
565 var text = "";
566 for (var i = el.firstChild; i != null; i = i.nextSibling) {
567 if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
568 text += i.data;
569 else if (i.firstChild != null)
570 text += getText(i);
571 }
572 return text;
573 }
574
575 function TocEntry(el, text, toclevel) {
576 this.element = el;
577 this.text = text;
578 this.toclevel = toclevel;
579 }
580
581 function tocEntries(el, toclevels) {
582 var result = new Array;
Junio C Hamanoac12f0e2014-09-19 22:32:51583 var re = new RegExp('[hH]([1-'+(toclevels+1)+'])');
Junio C Hamano7bd050f2011-09-22 06:32:22584 // Function that scans the DOM tree for header elements (the DOM2
585 // nodeIterator API would be a better technique but not supported by all
586 // browsers).
587 var iterate = function (el) {
588 for (var i = el.firstChild; i != null; i = i.nextSibling) {
589 if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
590 var mo = re.exec(i.tagName);
591 if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
592 result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
593 }
594 iterate(i);
595 }
596 }
597 }
598 iterate(el);
599 return result;
600 }
601
602 var toc = document.getElementById("toc");
Junio C Hamano9629d4f2012-12-19 00:28:27603 if (!toc) {
604 return;
605 }
606
607 // Delete existing TOC entries in case we're reloading the TOC.
608 var tocEntriesToRemove = [];
609 var i;
610 for (i = 0; i < toc.childNodes.length; i++) {
611 var entry = toc.childNodes[i];
Junio C Hamanoac12f0e2014-09-19 22:32:51612 if (entry.nodeName.toLowerCase() == 'div'
Junio C Hamano9629d4f2012-12-19 00:28:27613 && entry.getAttribute("class")
614 && entry.getAttribute("class").match(/^toclevel/))
615 tocEntriesToRemove.push(entry);
616 }
617 for (i = 0; i < tocEntriesToRemove.length; i++) {
618 toc.removeChild(tocEntriesToRemove[i]);
619 }
620
621 // Rebuild TOC entries.
Junio C Hamano7bd050f2011-09-22 06:32:22622 var entries = tocEntries(document.getElementById("content"), toclevels);
623 for (var i = 0; i < entries.length; ++i) {
624 var entry = entries[i];
625 if (entry.element.id == "")
626 entry.element.id = "_toc_" + i;
627 var a = document.createElement("a");
628 a.href = "#" + entry.element.id;
629 a.appendChild(document.createTextNode(entry.text));
630 var div = document.createElement("div");
631 div.appendChild(a);
632 div.className = "toclevel" + entry.toclevel;
633 toc.appendChild(div);
634 }
635 if (entries.length == 0)
636 toc.parentNode.removeChild(toc);
637},
638
639
640/////////////////////////////////////////////////////////////////////
641// Footnotes generator
642/////////////////////////////////////////////////////////////////////
643
644/* Based on footnote generation code from:
645 * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
646 */
647
648footnotes: function () {
Junio C Hamano9629d4f2012-12-19 00:28:27649 // Delete existing footnote entries in case we're reloading the footnodes.
650 var i;
Junio C Hamano7bd050f2011-09-22 06:32:22651 var noteholder = document.getElementById("footnotes");
Junio C Hamano9629d4f2012-12-19 00:28:27652 if (!noteholder) {
653 return;
654 }
655 var entriesToRemove = [];
656 for (i = 0; i < noteholder.childNodes.length; i++) {
657 var entry = noteholder.childNodes[i];
Junio C Hamanoac12f0e2014-09-19 22:32:51658 if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote")
Junio C Hamano9629d4f2012-12-19 00:28:27659 entriesToRemove.push(entry);
660 }
661 for (i = 0; i < entriesToRemove.length; i++) {
662 noteholder.removeChild(entriesToRemove[i]);
663 }
664
665 // Rebuild footnote entries.
666 var cont = document.getElementById("content");
Junio C Hamano7bd050f2011-09-22 06:32:22667 var spans = cont.getElementsByTagName("span");
668 var refs = {};
669 var n = 0;
670 for (i=0; i<spans.length; i++) {
671 if (spans[i].className == "footnote") {
672 n++;
Junio C Hamano9629d4f2012-12-19 00:28:27673 var note = spans[i].getAttribute("data-note");
674 if (!note) {
675 // Use [\s\S] in place of . so multi-line matches work.
676 // Because JavaScript has no s (dotall) regex flag.
677 note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
678 spans[i].innerHTML =
679 "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
680 "' title='View footnote' class='footnote'>" + n + "</a>]";
681 spans[i].setAttribute("data-note", note);
682 }
Junio C Hamano7bd050f2011-09-22 06:32:22683 noteholder.innerHTML +=
684 "<div class='footnote' id='_footnote_" + n + "'>" +
685 "<a href='#_footnoteref_" + n + "' title='Return to text'>" +
686 n + "</a>. " + note + "</div>";
Junio C Hamano7bd050f2011-09-22 06:32:22687 var id =spans[i].getAttribute("id");
688 if (id != null) refs["#"+id] = n;
689 }
690 }
691 if (n == 0)
692 noteholder.parentNode.removeChild(noteholder);
693 else {
694 // Process footnoterefs.
695 for (i=0; i<spans.length; i++) {
696 if (spans[i].className == "footnoteref") {
697 var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
698 href = href.match(/#.*/)[0]; // Because IE return full URL.
699 n = refs[href];
700 spans[i].innerHTML =
701 "[<a href='#_footnote_" + n +
702 "' title='View footnote' class='footnote'>" + n + "</a>]";
703 }
704 }
705 }
Junio C Hamano9629d4f2012-12-19 00:28:27706},
707
708install: function(toclevels) {
709 var timerId;
710
711 function reinstall() {
712 asciidoc.footnotes();
713 if (toclevels) {
714 asciidoc.toc(toclevels);
715 }
716 }
717
718 function reinstallAndRemoveTimer() {
719 clearInterval(timerId);
720 reinstall();
721 }
722
723 timerId = setInterval(reinstall, 500);
724 if (document.addEventListener)
725 document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false);
726 else
727 window.onload = reinstallAndRemoveTimer;
Junio C Hamano7bd050f2011-09-22 06:32:22728}
729
730}
Junio C Hamano9629d4f2012-12-19 00:28:27731asciidoc.install();
Junio C Hamano7bd050f2011-09-22 06:32:22732/*]]>*/
733</script>
Junio C Hamano1a4e8412005-12-27 08:17:23734</head>
Junio C Hamano9629d4f2012-12-19 00:28:27735<body class="manpage">
Junio C Hamano1a4e8412005-12-27 08:17:23736<div id="header">
737<h1>
738git-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 Hamanof26c77e2013-04-27 00:06:04752<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
827 shown. The default option is <em>short</em>.
Junio C Hamano78e3a782010-07-15 22:24:45828</p>
829</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59830<dt class="hdlist1">
Junio C Hamano371470a2017-12-13 22:26:40831--decorate-refs=&lt;pattern&gt;
832</dt>
833<dt class="hdlist1">
834--decorate-refs-exclude=&lt;pattern&gt;
835</dt>
836<dd>
837<p>
838 If no <code>--decorate-refs</code> is given, pretend as if all refs were
839 included. For each candidate, do not use it for decoration if it
840 matches any patterns given to <code>--decorate-refs-exclude</code> or if it
Junio C Hamano0dd50942020-04-29 21:21:05841 doesn&#8217;t match any of the patterns given to <code>--decorate-refs</code>. The
842 <code>log.excludeDecoration</code> config option allows excluding refs from
843 the decorations, but an explicit <code>--decorate-refs</code> pattern will
844 override a match in <code>log.excludeDecoration</code>.
Junio C Hamano371470a2017-12-13 22:26:40845</p>
846</dd>
847<dt class="hdlist1">
Junio C Hamano78e3a782010-07-15 22:24:45848--source
849</dt>
850<dd>
851<p>
852 Print out the ref name given on the command line by which each
853 commit was reached.
854</p>
855</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59856<dt class="hdlist1">
Junio C Hamano0dd50942020-04-29 21:21:05857--[no-]mailmap
858</dt>
859<dt class="hdlist1">
Junio C Hamano36594952019-07-25 22:26:52860--[no-]use-mailmap
Junio C Hamanoce836cc2013-01-21 02:01:53861</dt>
862<dd>
863<p>
864 Use mailmap file to map author and committer names and email
Junio C Hamanob73af6c2013-12-03 22:07:11865 addresses to canonical real names and email addresses. See
Junio C Hamanoce836cc2013-01-21 02:01:53866 <a href="git-shortlog.html">git-shortlog(1)</a>.
867</p>
868</dd>
869<dt class="hdlist1">
Junio C Hamano78e3a782010-07-15 22:24:45870--full-diff
871</dt>
872<dd>
873<p>
Junio C Hamanoac12f0e2014-09-19 22:32:51874 Without this flag, <code>git log -p &lt;path&gt;...</code> shows commits that
Junio C Hamano78e3a782010-07-15 22:24:45875 touch the specified paths, and diffs about the same specified
876 paths. With this, the full diff is shown for commits that touch
877 the specified paths; this means that "&lt;path&gt;&#8230;" limits only
Junio C Hamano68cf15a2010-11-06 01:01:59878 commits, and doesn&#8217;t limit diff for those commits.
Junio C Hamano78e3a782010-07-15 22:24:45879</p>
Junio C Hamano68cf15a2010-11-06 01:01:59880<div class="paragraph"><p>Note that this affects all diff-based output types, e.g. those
Junio C Hamanoac12f0e2014-09-19 22:32:51881produced by <code>--stat</code>, etc.</p></div>
Junio C Hamano78e3a782010-07-15 22:24:45882</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59883<dt class="hdlist1">
Junio C Hamano78e3a782010-07-15 22:24:45884--log-size
885</dt>
886<dd>
887<p>
Junio C Hamanob73af6c2013-12-03 22:07:11888 Include a line &#8220;log size &lt;number&gt;&#8221; in the output for each commit,
889 where &lt;number&gt; is the length of that commit&#8217;s message in bytes.
Junio C Hamanoac12f0e2014-09-19 22:32:51890 Intended to speed up tools that read log messages from <code>git log</code>
Junio C Hamanob73af6c2013-12-03 22:07:11891 output by allowing them to allocate space in advance.
Junio C Hamano78e3a782010-07-15 22:24:45892</p>
893</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59894<dt class="hdlist1">
Junio C Hamano8eac2682013-09-09 22:35:20895-L &lt;start&gt;,&lt;end&gt;:&lt;file&gt;
896</dt>
897<dt class="hdlist1">
Junio C Hamanodd5004a2015-05-06 19:33:32898-L :&lt;funcname&gt;:&lt;file&gt;
Junio C Hamano7e590a12013-06-02 23:46:52899</dt>
900<dd>
901<p>
902 Trace the evolution of the line range given by "&lt;start&gt;,&lt;end&gt;"
Junio C Hamanodd5004a2015-05-06 19:33:32903 (or the function name regex &lt;funcname&gt;) within the &lt;file&gt;. You may
Junio C Hamano7e590a12013-06-02 23:46:52904 not give any pathspec limiters. This is currently limited to
905 a walk starting from a single revision, i.e., you may only
Junio C Hamano68793842020-01-06 23:07:09906 give zero or one positive revision arguments, and
907 &lt;start&gt; and &lt;end&gt; (or &lt;funcname&gt;) must exist in the starting revision.
908 You can specify this option more than once. Implies <code>--patch</code>.
909 Patch output can be suppressed using <code>--no-patch</code>, but other diff formats
910 (namely <code>--raw</code>, <code>--numstat</code>, <code>--shortstat</code>, <code>--dirstat</code>, <code>--summary</code>,
911 <code>--name-only</code>, <code>--name-status</code>, <code>--check</code>) are not currently implemented.
Junio C Hamano7e590a12013-06-02 23:46:52912</p>
913<div class="paragraph"><p>&lt;start&gt; and &lt;end&gt; can take one of these forms:</p></div>
914<div class="ulist"><ul>
915<li>
916<p>
917number
918</p>
919<div class="paragraph"><p>If &lt;start&gt; or &lt;end&gt; is a number, it specifies an
920absolute line number (lines count from 1).</p></div>
921</li>
922<li>
923<p>
924/regex/
925</p>
926<div class="paragraph"><p>This form will use the first line matching the given
Junio C Hamano8eac2682013-09-09 22:35:20927POSIX regex. If &lt;start&gt; is a regex, it will search from the end of
Junio C Hamanoac12f0e2014-09-19 22:32:51928the previous <code>-L</code> range, if any, otherwise from the start of file.
Junio C Hamano8eac2682013-09-09 22:35:20929If &lt;start&gt; is &#8220;^/regex/&#8221;, it will search from the start of file.
930If &lt;end&gt; is a regex, it will search
Junio C Hamano7e590a12013-06-02 23:46:52931starting at the line given by &lt;start&gt;.</p></div>
932</li>
933<li>
934<p>
935+offset or -offset
936</p>
937<div class="paragraph"><p>This is only valid for &lt;end&gt; and will specify a number
938of lines before or after the line given by &lt;start&gt;.</p></div>
939</li>
Junio C Hamano7e590a12013-06-02 23:46:52940</ul></div>
Junio C Hamanodd5004a2015-05-06 19:33:32941<div class="paragraph"><p>If &#8220;:&lt;funcname&gt;&#8221; is given in place of &lt;start&gt; and &lt;end&gt;, it is a
942regular expression that denotes the range from the first funcname line
943that matches &lt;funcname&gt;, up to the next funcname line. &#8220;:&lt;funcname&gt;&#8221;
944searches from the end of the previous <code>-L</code> range, if any, otherwise
945from the start of file. &#8220;^:&lt;funcname&gt;&#8221; searches from the start of
946file.</p></div>
Junio C Hamano7e590a12013-06-02 23:46:52947</dd>
948<dt class="hdlist1">
Junio C Hamanof26c77e2013-04-27 00:06:04949&lt;revision range&gt;
950</dt>
951<dd>
952<p>
953 Show only commits in the specified revision range. When no
Junio C Hamanoac12f0e2014-09-19 22:32:51954 &lt;revision range&gt; is specified, it defaults to <code>HEAD</code> (i.e. the
955 whole history leading to the current commit). <code>origin..HEAD</code>
Junio C Hamanof26c77e2013-04-27 00:06:04956 specifies all the commits reachable from the current commit
Junio C Hamanoac12f0e2014-09-19 22:32:51957 (i.e. <code>HEAD</code>), but not from <code>origin</code>. For a complete list of
Junio C Hamanob73af6c2013-12-03 22:07:11958 ways to spell &lt;revision range&gt;, see the <em>Specifying Ranges</em>
Junio C Hamanof26c77e2013-04-27 00:06:04959 section of <a href="gitrevisions.html">gitrevisions(7)</a>.
960</p>
961</dd>
962<dt class="hdlist1">
Junio C Hamano78e3a782010-07-15 22:24:45963[--] &lt;path&gt;&#8230;
964</dt>
965<dd>
966<p>
Junio C Hamano5723afa2011-08-31 00:49:23967 Show only commits that are enough to explain how the files
Junio C Hamanob73af6c2013-12-03 22:07:11968 that match the specified paths came to be. See <em>History
969 Simplification</em> below for details and other simplification
Junio C Hamano5723afa2011-08-31 00:49:23970 modes.
Junio C Hamano78e3a782010-07-15 22:24:45971</p>
Junio C Hamanoccb82522018-05-08 07:52:09972<div class="paragraph"><p>Paths may need to be prefixed with <code>--</code> to separate them from
Junio C Hamanof26c77e2013-04-27 00:06:04973options or the revision range, when confusion arises.</p></div>
Junio C Hamano78e3a782010-07-15 22:24:45974</dd>
975</dl></div>
Junio C Hamano9629d4f2012-12-19 00:28:27976<div class="sect2">
977<h3 id="_commit_limiting">Commit Limiting</h3>
Junio C Hamano68cf15a2010-11-06 01:01:59978<div class="paragraph"><p>Besides specifying a range of commits that should be listed using the
Junio C Hamanob0e02952008-01-19 08:02:00979special notations explained in the description, additional commit
Junio C Hamano8ce35d72012-09-18 22:30:42980limiting may be applied.</p></div>
981<div class="paragraph"><p>Using more options generally further limits the output (e.g.
Junio C Hamanoac12f0e2014-09-19 22:32:51982<code>--since=&lt;date1&gt;</code> limits to commits newer than <code>&lt;date1&gt;</code>, and using it
983with <code>--grep=&lt;pattern&gt;</code> further limits to commits whose log message
984has a line that matches <code>&lt;pattern&gt;</code>), unless otherwise noted.</p></div>
Junio C Hamano8ce35d72012-09-18 22:30:42985<div class="paragraph"><p>Note that these are applied before commit
Junio C Hamanoac12f0e2014-09-19 22:32:51986ordering and formatting options, such as <code>--reverse</code>.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:59987<div class="dlist"><dl>
988<dt class="hdlist1">
Junio C Hamano693e7092012-09-12 22:56:53989-&lt;number&gt;
990</dt>
991<dt class="hdlist1">
992-n &lt;number&gt;
Junio C Hamanoeb415992008-06-08 22:49:47993</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59994<dt class="hdlist1">
Junio C Hamanob4a9ede2009-04-08 07:36:32995--max-count=&lt;number&gt;
Junio C Hamanob0e02952008-01-19 08:02:00996</dt>
997<dd>
998<p>
Junio C Hamanoc5be4cc2011-03-09 07:20:43999 Limit the number of commits to output.
Junio C Hamanob0e02952008-01-19 08:02:001000</p>
1001</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591002<dt class="hdlist1">
Junio C Hamanob4a9ede2009-04-08 07:36:321003--skip=&lt;number&gt;
Junio C Hamanob0e02952008-01-19 08:02:001004</dt>
1005<dd>
1006<p>
1007 Skip <em>number</em> commits before starting to show the commit output.
1008</p>
1009</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591010<dt class="hdlist1">
Junio C Hamanob4a9ede2009-04-08 07:36:321011--since=&lt;date&gt;
Junio C Hamanoeb415992008-06-08 22:49:471012</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591013<dt class="hdlist1">
Junio C Hamanob4a9ede2009-04-08 07:36:321014--after=&lt;date&gt;
Junio C Hamanob0e02952008-01-19 08:02:001015</dt>
1016<dd>
1017<p>
1018 Show commits more recent than a specific date.
1019</p>
1020</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591021<dt class="hdlist1">
Junio C Hamanob4a9ede2009-04-08 07:36:321022--until=&lt;date&gt;
Junio C Hamanoeb415992008-06-08 22:49:471023</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591024<dt class="hdlist1">
Junio C Hamanob4a9ede2009-04-08 07:36:321025--before=&lt;date&gt;
Junio C Hamanob0e02952008-01-19 08:02:001026</dt>
1027<dd>
1028<p>
1029 Show commits older than a specific date.
1030</p>
1031</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591032<dt class="hdlist1">
Junio C Hamanob4a9ede2009-04-08 07:36:321033--author=&lt;pattern&gt;
Junio C Hamanoeb415992008-06-08 22:49:471034</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591035<dt class="hdlist1">
Junio C Hamanob4a9ede2009-04-08 07:36:321036--committer=&lt;pattern&gt;
Junio C Hamanob0e02952008-01-19 08:02:001037</dt>
1038<dd>
1039<p>
1040 Limit the commits output to ones with author/committer
Junio C Hamano8ce35d72012-09-18 22:30:421041 header lines that match the specified pattern (regular
Junio C Hamanoac12f0e2014-09-19 22:32:511042 expression). With more than one <code>--author=&lt;pattern&gt;</code>,
Junio C Hamano8ce35d72012-09-18 22:30:421043 commits whose author matches any of the given patterns are
Junio C Hamanoac12f0e2014-09-19 22:32:511044 chosen (similarly for multiple <code>--committer=&lt;pattern&gt;</code>).
Junio C Hamanob0e02952008-01-19 08:02:001045</p>
1046</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591047<dt class="hdlist1">
Junio C Hamano9954ed72012-10-03 04:54:001048--grep-reflog=&lt;pattern&gt;
1049</dt>
1050<dd>
1051<p>
1052 Limit the commits output to ones with reflog entries that
1053 match the specified pattern (regular expression). With
Junio C Hamanoac12f0e2014-09-19 22:32:511054 more than one <code>--grep-reflog</code>, commits whose reflog message
Junio C Hamano9954ed72012-10-03 04:54:001055 matches any of the given patterns are chosen. It is an
Junio C Hamanoac12f0e2014-09-19 22:32:511056 error to use this option unless <code>--walk-reflogs</code> is in use.
Junio C Hamano9954ed72012-10-03 04:54:001057</p>
1058</dd>
1059<dt class="hdlist1">
Junio C Hamanob4a9ede2009-04-08 07:36:321060--grep=&lt;pattern&gt;
Junio C Hamanob0e02952008-01-19 08:02:001061</dt>
1062<dd>
1063<p>
1064 Limit the commits output to ones with log message that
Junio C Hamano8ce35d72012-09-18 22:30:421065 matches the specified pattern (regular expression). With
Junio C Hamanoac12f0e2014-09-19 22:32:511066 more than one <code>--grep=&lt;pattern&gt;</code>, commits whose message
Junio C Hamano8ce35d72012-09-18 22:30:421067 matches any of the given patterns are chosen (but see
Junio C Hamanoac12f0e2014-09-19 22:32:511068 <code>--all-match</code>).
Junio C Hamanob0e02952008-01-19 08:02:001069</p>
Junio C Hamanob3f862c2019-12-05 22:22:001070<div class="paragraph"><p>When <code>--notes</code> is in effect, the message from the notes is
Junio C Hamano8152abf2015-04-28 22:48:021071matched as if it were part of the log message.</p></div>
Junio C Hamanob0e02952008-01-19 08:02:001072</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591073<dt class="hdlist1">
Junio C Hamanoaa17c7c2008-11-03 04:36:581074--all-match
1075</dt>
1076<dd>
1077<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511078 Limit the commits output to ones that match all given <code>--grep</code>,
Junio C Hamano8ce35d72012-09-18 22:30:421079 instead of ones that match at least one.
Junio C Hamanoaa17c7c2008-11-03 04:36:581080</p>
1081</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591082<dt class="hdlist1">
Junio C Hamano6bb32e62015-02-17 22:11:261083--invert-grep
1084</dt>
1085<dd>
1086<p>
1087 Limit the commits output to ones with log message that do not
1088 match the pattern specified with <code>--grep=&lt;pattern&gt;</code>.
1089</p>
1090</dd>
1091<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471092-i
1093</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591094<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471095--regexp-ignore-case
Junio C Hamanob0e02952008-01-19 08:02:001096</dt>
1097<dd>
1098<p>
Junio C Hamanob73af6c2013-12-03 22:07:111099 Match the regular expression limiting patterns without regard to letter
1100 case.
Junio C Hamanob0e02952008-01-19 08:02:001101</p>
1102</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591103<dt class="hdlist1">
Junio C Hamanoa1295452012-11-13 22:32:041104--basic-regexp
1105</dt>
1106<dd>
1107<p>
1108 Consider the limiting patterns to be basic regular expressions;
1109 this is the default.
1110</p>
1111</dd>
1112<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471113-E
1114</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591115<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471116--extended-regexp
Junio C Hamanob0e02952008-01-19 08:02:001117</dt>
1118<dd>
1119<p>
1120 Consider the limiting patterns to be extended regular expressions
1121 instead of the default basic regular expressions.
1122</p>
1123</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591124<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471125-F
1126</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591127<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471128--fixed-strings
Junio C Hamano24bc09a2008-02-28 00:27:441129</dt>
1130<dd>
1131<p>
Junio C Hamano68cf15a2010-11-06 01:01:591132 Consider the limiting patterns to be fixed strings (don&#8217;t interpret
Junio C Hamano24bc09a2008-02-28 00:27:441133 pattern as a regular expression).
1134</p>
1135</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591136<dt class="hdlist1">
Junio C Hamanoa275c1f2017-06-19 20:10:121137-P
1138</dt>
1139<dt class="hdlist1">
Junio C Hamanoa1295452012-11-13 22:32:041140--perl-regexp
1141</dt>
1142<dd>
1143<p>
Junio C Hamano222ed822017-06-02 06:24:061144 Consider the limiting patterns to be Perl-compatible regular
1145 expressions.
Junio C Hamanoa1295452012-11-13 22:32:041146</p>
Junio C Hamano222ed822017-06-02 06:24:061147<div class="paragraph"><p>Support for these types of regular expressions is an optional
1148compile-time dependency. If Git wasn&#8217;t compiled with support for them
1149providing this option will cause it to die.</p></div>
Junio C Hamanoa1295452012-11-13 22:32:041150</dd>
1151<dt class="hdlist1">
Junio C Hamanob0e02952008-01-19 08:02:001152--remove-empty
1153</dt>
1154<dd>
1155<p>
1156 Stop when a given path disappears from the tree.
1157</p>
1158</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591159<dt class="hdlist1">
Junio C Hamano934e1782009-07-16 06:59:151160--merges
1161</dt>
1162<dd>
1163<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511164 Print only merge commits. This is exactly the same as <code>--min-parents=2</code>.
Junio C Hamano934e1782009-07-16 06:59:151165</p>
1166</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591167<dt class="hdlist1">
Junio C Hamanob0e02952008-01-19 08:02:001168--no-merges
1169</dt>
1170<dd>
1171<p>
Junio C Hamanof32ce262011-03-27 07:35:111172 Do not print commits with more than one parent. This is
Junio C Hamanoac12f0e2014-09-19 22:32:511173 exactly the same as <code>--max-parents=1</code>.
Junio C Hamanob0e02952008-01-19 08:02:001174</p>
1175</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591176<dt class="hdlist1">
Junio C Hamanof32ce262011-03-27 07:35:111177--min-parents=&lt;number&gt;
1178</dt>
1179<dt class="hdlist1">
1180--max-parents=&lt;number&gt;
1181</dt>
1182<dt class="hdlist1">
1183--no-min-parents
1184</dt>
1185<dt class="hdlist1">
1186--no-max-parents
1187</dt>
1188<dd>
1189<p>
Junio C Hamanoc5bb3b32013-08-05 22:43:361190 Show only commits which have at least (or at most) that many parent
Junio C Hamanoac12f0e2014-09-19 22:32:511191 commits. In particular, <code>--max-parents=1</code> is the same as <code>--no-merges</code>,
1192 <code>--min-parents=2</code> is the same as <code>--merges</code>. <code>--max-parents=0</code>
1193 gives all root commits and <code>--min-parents=3</code> all octopus merges.
Junio C Hamanof32ce262011-03-27 07:35:111194</p>
Junio C Hamanoac12f0e2014-09-19 22:32:511195<div class="paragraph"><p><code>--no-min-parents</code> and <code>--no-max-parents</code> reset these limits (to no limit)
1196again. Equivalent forms are <code>--min-parents=0</code> (any commit has 0 or more
1197parents) and <code>--max-parents=-1</code> (negative numbers denote no upper limit).</p></div>
Junio C Hamanof32ce262011-03-27 07:35:111198</dd>
1199<dt class="hdlist1">
Junio C Hamanob0e02952008-01-19 08:02:001200--first-parent
1201</dt>
1202<dd>
1203<p>
1204 Follow only the first parent commit upon seeing a merge
1205 commit. This option can give a better overview when
1206 viewing the evolution of a particular topic branch,
1207 because merges into a topic branch tend to be only about
1208 adjusting to updated upstream from time to time, and
1209 this option allows you to ignore the individual commits
Junio C Hamano255163d2020-08-18 00:37:231210 brought in to your history by such a merge.
Junio C Hamanob0e02952008-01-19 08:02:001211</p>
1212</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591213<dt class="hdlist1">
Junio C Hamanob0e02952008-01-19 08:02:001214--not
1215</dt>
1216<dd>
1217<p>
1218 Reverses the meaning of the <em>&#94;</em> prefix (or lack thereof)
Junio C Hamanoac12f0e2014-09-19 22:32:511219 for all following revision specifiers, up to the next <code>--not</code>.
Junio C Hamanob0e02952008-01-19 08:02:001220</p>
1221</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591222<dt class="hdlist1">
Junio C Hamanob0e02952008-01-19 08:02:001223--all
1224</dt>
1225<dd>
1226<p>
Junio C Hamanoe89102f2017-02-15 23:18:151227 Pretend as if all the refs in <code>refs/</code>, along with <code>HEAD</code>, are
1228 listed on the command line as <em>&lt;commit&gt;</em>.
Junio C Hamanob0e02952008-01-19 08:02:001229</p>
1230</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591231<dt class="hdlist1">
Junio C Hamanod2179ef2010-10-22 04:12:171232--branches[=&lt;pattern&gt;]
Junio C Hamano50819852008-11-19 02:07:561233</dt>
1234<dd>
1235<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511236 Pretend as if all the refs in <code>refs/heads</code> are listed
Junio C Hamanod2179ef2010-10-22 04:12:171237 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:501238 branches to ones matching given shell glob. If pattern lacks <em>?</em>,
Junio C Hamano81d540a2012-03-02 19:52:471239 <em>&#42;</em>, or <em>[</em>, <em>/&#42;</em> at the end is implied.
Junio C Hamano50819852008-11-19 02:07:561240</p>
1241</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591242<dt class="hdlist1">
Junio C Hamanod2179ef2010-10-22 04:12:171243--tags[=&lt;pattern&gt;]
Junio C Hamano50819852008-11-19 02:07:561244</dt>
1245<dd>
1246<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511247 Pretend as if all the refs in <code>refs/tags</code> are listed
Junio C Hamanod2179ef2010-10-22 04:12:171248 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:471249 tags to ones matching given shell glob. If pattern lacks <em>?</em>, <em>&#42;</em>,
1250 or <em>[</em>, <em>/&#42;</em> at the end is implied.
Junio C Hamano50819852008-11-19 02:07:561251</p>
1252</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591253<dt class="hdlist1">
Junio C Hamanod2179ef2010-10-22 04:12:171254--remotes[=&lt;pattern&gt;]
Junio C Hamano50819852008-11-19 02:07:561255</dt>
1256<dd>
1257<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511258 Pretend as if all the refs in <code>refs/remotes</code> are listed
Junio C Hamanod2179ef2010-10-22 04:12:171259 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:071260 remote-tracking branches to ones matching given shell glob.
Junio C Hamano81d540a2012-03-02 19:52:471261 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:501262</p>
1263</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591264<dt class="hdlist1">
Junio C Hamanod2179ef2010-10-22 04:12:171265--glob=&lt;glob-pattern&gt;
Junio C Hamano57827fb2010-01-23 03:02:501266</dt>
1267<dd>
1268<p>
Junio C Hamanod2179ef2010-10-22 04:12:171269 Pretend as if all the refs matching shell glob <em>&lt;glob-pattern&gt;</em>
Junio C Hamano57827fb2010-01-23 03:02:501270 are listed on the command line as <em>&lt;commit&gt;</em>. Leading <em>refs/</em>,
Junio C Hamano81d540a2012-03-02 19:52:471271 is automatically prepended if missing. If pattern lacks <em>?</em>, <em>&#42;</em>,
1272 or <em>[</em>, <em>/&#42;</em> at the end is implied.
Junio C Hamano50819852008-11-19 02:07:561273</p>
1274</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591275<dt class="hdlist1">
Junio C Hamanof079f702013-12-06 23:43:181276--exclude=&lt;glob-pattern&gt;
1277</dt>
1278<dd>
1279<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511280 Do not include refs matching <em>&lt;glob-pattern&gt;</em> that the next <code>--all</code>,
1281 <code>--branches</code>, <code>--tags</code>, <code>--remotes</code>, or <code>--glob</code> would otherwise
Junio C Hamanof079f702013-12-06 23:43:181282 consider. Repetitions of this option accumulate exclusion patterns
Junio C Hamanoac12f0e2014-09-19 22:32:511283 up to the next <code>--all</code>, <code>--branches</code>, <code>--tags</code>, <code>--remotes</code>, or
1284 <code>--glob</code> option (other options or arguments do not clear
Junio C Hamanofb5ffde2014-11-04 22:38:561285 accumulated patterns).
Junio C Hamanof079f702013-12-06 23:43:181286</p>
Junio C Hamanoac12f0e2014-09-19 22:32:511287<div class="paragraph"><p>The patterns given should not begin with <code>refs/heads</code>, <code>refs/tags</code>, or
1288<code>refs/remotes</code> when applied to <code>--branches</code>, <code>--tags</code>, or <code>--remotes</code>,
1289respectively, and they must begin with <code>refs/</code> when applied to <code>--glob</code>
1290or <code>--all</code>. If a trailing <em>/&#42;</em> is intended, it must be given
Junio C Hamanof079f702013-12-06 23:43:181291explicitly.</p></div>
1292</dd>
1293<dt class="hdlist1">
Junio C Hamano2a4bcbc2014-10-29 20:07:391294--reflog
1295</dt>
1296<dd>
1297<p>
1298 Pretend as if all objects mentioned by reflogs are listed on the
1299 command line as <code>&lt;commit&gt;</code>.
1300</p>
1301</dd>
1302<dt class="hdlist1">
Junio C Hamanoa42e0332019-07-19 19:49:371303--alternate-refs
1304</dt>
1305<dd>
1306<p>
1307 Pretend as if all objects mentioned as ref tips of alternate
1308 repositories were listed on the command line. An alternate
1309 repository is any repository whose object directory is specified
1310 in <code>objects/info/alternates</code>. The set of included objects may
1311 be modified by <code>core.alternateRefsCommand</code>, etc. See
1312 <a href="git-config.html">git-config(1)</a>.
1313</p>
1314</dd>
1315<dt class="hdlist1">
Junio C Hamano8d57fa92017-09-19 05:01:081316--single-worktree
1317</dt>
1318<dd>
1319<p>
1320 By default, all working trees will be examined by the
1321 following options when there are more than one (see
1322 <a href="git-worktree.html">git-worktree(1)</a>): <code>--all</code>, <code>--reflog</code> and
1323 <code>--indexed-objects</code>.
1324 This option forces them to examine the current working tree
1325 only.
1326</p>
1327</dd>
1328<dt class="hdlist1">
Junio C Hamano084228c2011-05-30 08:13:521329--ignore-missing
1330</dt>
1331<dd>
1332<p>
1333 Upon seeing an invalid object name in the input, pretend as if
1334 the bad input was not given.
1335</p>
1336</dd>
1337<dt class="hdlist1">
Junio C Hamano5706e0b2009-11-24 10:54:161338--bisect
1339</dt>
1340<dd>
1341<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511342 Pretend as if the bad bisection ref <code>refs/bisect/bad</code>
1343 was listed and as if it was followed by <code>--not</code> and the good
1344 bisection refs <code>refs/bisect/good-*</code> on the command
Junio C Hamano255163d2020-08-18 00:37:231345 line.
Junio C Hamano5706e0b2009-11-24 10:54:161346</p>
1347</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591348<dt class="hdlist1">
Junio C Hamano5706e0b2009-11-24 10:54:161349--stdin
1350</dt>
1351<dd>
1352<p>
1353 In addition to the <em>&lt;commit&gt;</em> listed on the command
Junio C Hamano92d80372016-07-13 22:00:051354 line, read them from the standard input. If a <code>--</code> separator is
Junio C Hamano5706e0b2009-11-24 10:54:161355 seen, stop reading commits and start reading paths to limit the
1356 result.
1357</p>
1358</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591359<dt class="hdlist1">
Junio C Hamano9a2fb2d2011-03-23 05:40:151360--cherry-mark
1361</dt>
1362<dd>
1363<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511364 Like <code>--cherry-pick</code> (see below) but mark equivalent commits
1365 with <code>=</code> rather than omitting them, and inequivalent ones with <code>+</code>.
Junio C Hamano9a2fb2d2011-03-23 05:40:151366</p>
1367</dd>
1368<dt class="hdlist1">
Junio C Hamanob0e02952008-01-19 08:02:001369--cherry-pick
1370</dt>
1371<dd>
1372<p>
1373 Omit any commit that introduces the same change as
Junio C Hamanob73af6c2013-12-03 22:07:111374 another commit on the &#8220;other side&#8221; when the set of
Junio C Hamano68cf15a2010-11-06 01:01:591375 commits are limited with symmetric difference.
1376</p>
Junio C Hamanoac12f0e2014-09-19 22:32:511377<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:001378to list all commits on only one side of them is with
Junio C Hamanoac12f0e2014-09-19 22:32:511379<code>--left-right</code> (see the example below in the description of
1380the <code>--left-right</code> option). However, it shows the commits that were
Junio C Hamanob73af6c2013-12-03 22:07:111381cherry-picked from the other branch (for example, &#8220;3rd on b&#8221; may be
1382cherry-picked from branch A). With this option, such pairs of commits are
Junio C Hamano68cf15a2010-11-06 01:01:591383excluded from the output.</p></div>
Junio C Hamanob0e02952008-01-19 08:02:001384</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591385<dt class="hdlist1">
Junio C Hamano9a2fb2d2011-03-23 05:40:151386--left-only
1387</dt>
1388<dt class="hdlist1">
1389--right-only
1390</dt>
1391<dd>
1392<p>
Junio C Hamanocd451662016-09-13 00:54:091393 List only commits on the respective side of a symmetric difference,
Junio C Hamanoac12f0e2014-09-19 22:32:511394 i.e. only those which would be marked <code>&lt;</code> resp. <code>&gt;</code> by
1395 <code>--left-right</code>.
Junio C Hamano9a2fb2d2011-03-23 05:40:151396</p>
Junio C Hamanoac12f0e2014-09-19 22:32:511397<div class="paragraph"><p>For example, <code>--cherry-pick --right-only A...B</code> omits those
1398commits from <code>B</code> which are in <code>A</code> or are patch-equivalent to a commit in
1399<code>A</code>. In other words, this lists the <code>+</code> commits from <code>git cherry A B</code>.
1400More precisely, <code>--cherry-pick --right-only --no-merges</code> gives the exact
Junio C Hamano9a2fb2d2011-03-23 05:40:151401list.</p></div>
1402</dd>
1403<dt class="hdlist1">
1404--cherry
1405</dt>
1406<dd>
1407<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511408 A synonym for <code>--right-only --cherry-mark --no-merges</code>; useful to
Junio C Hamano9a2fb2d2011-03-23 05:40:151409 limit the output to the commits on our side and mark those that
1410 have been applied to the other side of a forked history with
Junio C Hamanoac12f0e2014-09-19 22:32:511411 <code>git log --cherry upstream...mybranch</code>, similar to
1412 <code>git cherry upstream mybranch</code>.
Junio C Hamano9a2fb2d2011-03-23 05:40:151413</p>
1414</dd>
1415<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471416-g
1417</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591418<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471419--walk-reflogs
Junio C Hamanob0e02952008-01-19 08:02:001420</dt>
1421<dd>
1422<p>
1423 Instead of walking the commit ancestry chain, walk
1424 reflog entries from the most recent one to older ones.
1425 When this option is used you cannot specify commits to
1426 exclude (that is, <em>&#94;commit</em>, <em>commit1..commit2</em>,
Junio C Hamanod75148a2014-04-08 19:48:381427 and <em>commit1...commit2</em> notations cannot be used).
Junio C Hamano68cf15a2010-11-06 01:01:591428</p>
Junio C Hamanob4896852019-12-10 23:15:091429<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:001430this causes the output to have two extra lines of information
Junio C Hamanoe548d1b2016-08-08 22:26:491431taken from the reflog. The reflog designator in the output may be shown
1432as <code>ref@{Nth}</code> (where <code>Nth</code> is the reverse-chronological index in the
1433reflog) or as <code>ref@{timestamp}</code> (with the timestamp for that entry),
1434depending on a few rules:</p></div>
1435<div class="openblock">
1436<div class="content">
1437<div class="olist arabic"><ol class="arabic">
1438<li>
1439<p>
1440If the starting point is specified as <code>ref@{Nth}</code>, show the index
Junio C Hamano2567b322019-02-05 23:33:561441 format.
Junio C Hamanoe548d1b2016-08-08 22:26:491442</p>
1443</li>
1444<li>
1445<p>
1446If the starting point was specified as <code>ref@{now}</code>, show the
Junio C Hamano2567b322019-02-05 23:33:561447 timestamp format.
Junio C Hamanoe548d1b2016-08-08 22:26:491448</p>
1449</li>
1450<li>
1451<p>
1452If neither was used, but <code>--date</code> was given on the command line, show
Junio C Hamano2567b322019-02-05 23:33:561453 the timestamp in the format requested by <code>--date</code>.
Junio C Hamanoe548d1b2016-08-08 22:26:491454</p>
1455</li>
1456<li>
1457<p>
1458Otherwise, show the index format.
1459</p>
1460</li>
1461</ol></div>
1462</div></div>
1463<div class="paragraph"><p>Under <code>--pretty=oneline</code>, the commit message is
Junio C Hamanob0e02952008-01-19 08:02:001464prefixed with this information on the same line.
Junio C Hamanoac12f0e2014-09-19 22:32:511465This option cannot be combined with <code>--reverse</code>.
Junio C Hamanoa28a9202012-06-21 07:08:231466See also <a href="git-reflog.html">git-reflog(1)</a>.</p></div>
Junio C Hamanob4896852019-12-10 23:15:091467<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:001468</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591469<dt class="hdlist1">
Junio C Hamanob0e02952008-01-19 08:02:001470--merge
1471</dt>
1472<dd>
1473<p>
1474 After a failed merge, show refs that touch files having a
Junio C Hamano68cf15a2010-11-06 01:01:591475 conflict and don&#8217;t exist on all heads to merge.
Junio C Hamanob0e02952008-01-19 08:02:001476</p>
1477</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591478<dt class="hdlist1">
Junio C Hamanob0e02952008-01-19 08:02:001479--boundary
1480</dt>
1481<dd>
1482<p>
Junio C Hamano27159f82013-06-14 17:19:221483 Output excluded boundary commits. Boundary commits are
Junio C Hamanoac12f0e2014-09-19 22:32:511484 prefixed with <code>-</code>.
Junio C Hamanob0e02952008-01-19 08:02:001485</p>
1486</dd>
Junio C Hamanoa76cb0d2008-08-13 20:04:101487</dl></div>
Junio C Hamano9629d4f2012-12-19 00:28:271488</div>
1489<div class="sect2">
1490<h3 id="_history_simplification">History Simplification</h3>
Junio C Hamano68cf15a2010-11-06 01:01:591491<div class="paragraph"><p>Sometimes you are only interested in parts of the history, for example the
Junio C Hamano28363492008-11-14 08:26:311492commits modifying a particular &lt;path&gt;. But there are two parts of
1493<em>History Simplification</em>, one part is selecting the commits and the other
1494is how to do it, as there are various strategies to simplify the history.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591495<div class="paragraph"><p>The following options select the commits to be shown:</p></div>
1496<div class="dlist"><dl>
1497<dt class="hdlist1">
Junio C Hamano28363492008-11-14 08:26:311498&lt;paths&gt;
1499</dt>
1500<dd>
1501<p>
1502 Commits modifying the given &lt;paths&gt; are selected.
1503</p>
1504</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591505<dt class="hdlist1">
Junio C Hamano28363492008-11-14 08:26:311506--simplify-by-decoration
1507</dt>
1508<dd>
1509<p>
1510 Commits that are referred by some branch or tag are selected.
1511</p>
1512</dd>
1513</dl></div>
Junio C Hamano68cf15a2010-11-06 01:01:591514<div class="paragraph"><p>Note that extra commits can be shown to give a meaningful history.</p></div>
1515<div class="paragraph"><p>The following options affect the way the simplification is performed:</p></div>
1516<div class="dlist"><dl>
1517<dt class="hdlist1">
Junio C Hamano28363492008-11-14 08:26:311518Default mode
1519</dt>
1520<dd>
1521<p>
1522 Simplifies the history to the simplest history explaining the
1523 final state of the tree. Simplest because it prunes some side
1524 branches if the end result is the same (i.e. merging branches
1525 with the same content)
1526</p>
1527</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591528<dt class="hdlist1">
Junio C Hamano67bf2242020-04-22 21:41:441529--show-pulls
1530</dt>
1531<dd>
1532<p>
1533 Include all commits from the default mode, but also any merge
1534 commits that are not TREESAME to the first parent but are
1535 TREESAME to a later parent. This mode is helpful for showing
1536 the merge commits that "first introduced" a change to a branch.
1537</p>
1538</dd>
1539<dt class="hdlist1">
Junio C Hamano28363492008-11-14 08:26:311540--full-history
1541</dt>
1542<dd>
1543<p>
Junio C Hamano15567bc2011-07-23 00:51:591544 Same as the default mode, but does not prune some history.
Junio C Hamano28363492008-11-14 08:26:311545</p>
1546</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591547<dt class="hdlist1">
Junio C Hamano28363492008-11-14 08:26:311548--dense
1549</dt>
1550<dd>
1551<p>
1552 Only the selected commits are shown, plus some to have a
1553 meaningful history.
1554</p>
1555</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591556<dt class="hdlist1">
Junio C Hamano28363492008-11-14 08:26:311557--sparse
1558</dt>
1559<dd>
1560<p>
1561 All commits in the simplified history are shown.
1562</p>
1563</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591564<dt class="hdlist1">
Junio C Hamano28363492008-11-14 08:26:311565--simplify-merges
1566</dt>
1567<dd>
1568<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511569 Additional option to <code>--full-history</code> to remove some needless
Junio C Hamano28363492008-11-14 08:26:311570 merges from the resulting history, as there are no selected
1571 commits contributing to this merge.
1572</p>
1573</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591574<dt class="hdlist1">
Junio C Hamano89a57342010-06-22 23:22:551575--ancestry-path
1576</dt>
1577<dd>
1578<p>
1579 When given a range of commits to display (e.g. <em>commit1..commit2</em>
1580 or <em>commit2 &#94;commit1</em>), only display commits that exist
1581 directly on the ancestry chain between the <em>commit1</em> and
1582 <em>commit2</em>, i.e. commits that are both descendants of <em>commit1</em>,
1583 and ancestors of <em>commit2</em>.
1584</p>
1585</dd>
Junio C Hamano28363492008-11-14 08:26:311586</dl></div>
Junio C Hamano68cf15a2010-11-06 01:01:591587<div class="paragraph"><p>A more detailed explanation follows.</p></div>
Junio C Hamanoac12f0e2014-09-19 22:32:511588<div class="paragraph"><p>Suppose you specified <code>foo</code> as the &lt;paths&gt;. We shall call commits
1589that modify <code>foo</code> !TREESAME, and the rest TREESAME. (In a diff
1590filtered for <code>foo</code>, they look different and equal, respectively.)</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591591<div class="paragraph"><p>In the following, we will always refer to the same example history to
Junio C Hamanoa76cb0d2008-08-13 20:04:101592illustrate the differences between simplification settings. We assume
Junio C Hamanoac12f0e2014-09-19 22:32:511593that you are filtering for a file <code>foo</code> in this commit graph:</p></div>
Junio C Hamanoa76cb0d2008-08-13 20:04:101594<div class="listingblock">
1595<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:511596<pre><code> .-A---M---N---O---P---Q
Junio C Hamano27159f82013-06-14 17:19:221597 / / / / / /
1598 I B C D E Y
1599 \ / / / / /
Junio C Hamanoac12f0e2014-09-19 22:32:511600 `-------------' X</code></pre>
Junio C Hamanoa76cb0d2008-08-13 20:04:101601</div></div>
Junio C Hamano27159f82013-06-14 17:19:221602<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:101603each merge. The commits are:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591604<div class="ulist"><ul>
Junio C Hamanoa76cb0d2008-08-13 20:04:101605<li>
1606<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511607<code>I</code> is the initial commit, in which <code>foo</code> exists with contents
1608 &#8220;asdf&#8221;, and a file <code>quux</code> exists with contents &#8220;quux&#8221;. Initial
1609 commits are compared to an empty tree, so <code>I</code> is !TREESAME.
Junio C Hamanoa76cb0d2008-08-13 20:04:101610</p>
1611</li>
1612<li>
1613<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511614In <code>A</code>, <code>foo</code> contains just &#8220;foo&#8221;.
Junio C Hamanoa76cb0d2008-08-13 20:04:101615</p>
1616</li>
1617<li>
1618<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511619<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:101620 hence TREESAME to all parents.
1621</p>
1622</li>
1623<li>
1624<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511625<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:101626 so it is not TREESAME to any parent.
1627</p>
1628</li>
1629<li>
1630<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511631<code>D</code> sets <code>foo</code> to &#8220;baz&#8221;. Its merge <code>O</code> combines the strings from
1632 <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:101633</p>
1634</li>
1635<li>
1636<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511637<code>E</code> changes <code>quux</code> to &#8220;xyzzy&#8221;, and its merge <code>P</code> combines the
1638 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:221639</p>
1640</li>
1641<li>
1642<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511643<code>X</code> is an independent root commit that added a new file <code>side</code>, and <code>Y</code>
1644 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
1645 <code>Q</code> is TREESAME to <code>P</code>, but not to <code>Y</code>.
Junio C Hamanoa76cb0d2008-08-13 20:04:101646</p>
1647</li>
1648</ul></div>
Junio C Hamanoac12f0e2014-09-19 22:32:511649<div class="paragraph"><p><code>rev-list</code> walks backwards through history, including or excluding
1650commits based on whether <code>--full-history</code> and/or parent rewriting
1651(via <code>--parents</code> or <code>--children</code>) are used. The following settings
Junio C Hamanoa76cb0d2008-08-13 20:04:101652are available.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591653<div class="dlist"><dl>
1654<dt class="hdlist1">
Junio C Hamanoa76cb0d2008-08-13 20:04:101655Default mode
1656</dt>
1657<dd>
1658<p>
1659 Commits are included if they are not TREESAME to any parent
Junio C Hamanoac12f0e2014-09-19 22:32:511660 (though this can be changed, see <code>--sparse</code> below). If the
Junio C Hamanoa76cb0d2008-08-13 20:04:101661 commit was a merge, and it was TREESAME to one parent, follow
1662 only that parent. (Even if there are several TREESAME
1663 parents, follow only one of them.) Otherwise, follow all
1664 parents.
1665</p>
Junio C Hamano68cf15a2010-11-06 01:01:591666<div class="paragraph"><p>This results in:</p></div>
Junio C Hamanoa76cb0d2008-08-13 20:04:101667<div class="listingblock">
1668<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:511669<pre><code> .-A---N---O
Junio C Hamano89a57342010-06-22 23:22:551670 / / /
Junio C Hamanoac12f0e2014-09-19 22:32:511671 I---------D</code></pre>
Junio C Hamanoa76cb0d2008-08-13 20:04:101672</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591673<div class="paragraph"><p>Note how the rule to only follow the TREESAME parent, if one is
Junio C Hamanoac12f0e2014-09-19 22:32:511674available, removed <code>B</code> from consideration entirely. <code>C</code> was
1675considered via <code>N</code>, but is TREESAME. Root commits are compared to an
1676empty tree, so <code>I</code> is !TREESAME.</p></div>
1677<div class="paragraph"><p>Parent/child relations are only visible with <code>--parents</code>, but that does
Junio C Hamanoa76cb0d2008-08-13 20:04:101678not affect the commits selected in default mode, so we have shown the
1679parent lines.</p></div>
1680</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591681<dt class="hdlist1">
Junio C Hamanoa76cb0d2008-08-13 20:04:101682--full-history without parent rewriting
1683</dt>
1684<dd>
1685<p>
1686 This mode differs from the default in one point: always follow
1687 all parents of a merge, even if it is TREESAME to one of them.
1688 Even if more than one side of the merge has commits that are
1689 included, this does not imply that the merge itself is! In
1690 the example, we get
1691</p>
1692<div class="listingblock">
1693<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:511694<pre><code> I A B N D O P Q</code></pre>
Junio C Hamanoa76cb0d2008-08-13 20:04:101695</div></div>
Junio C Hamanoac12f0e2014-09-19 22:32:511696<div class="paragraph"><p><code>M</code> was excluded because it is TREESAME to both parents. <code>E</code>,
1697<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:101698do not appear.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591699<div class="paragraph"><p>Note that without parent rewriting, it is not really possible to talk
Junio C Hamanoa76cb0d2008-08-13 20:04:101700about the parent/child relationships between the commits, so we show
1701them disconnected.</p></div>
1702</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591703<dt class="hdlist1">
Junio C Hamanoa76cb0d2008-08-13 20:04:101704--full-history with parent rewriting
1705</dt>
1706<dd>
1707<p>
1708 Ordinary commits are only included if they are !TREESAME
Junio C Hamanoac12f0e2014-09-19 22:32:511709 (though this can be changed, see <code>--sparse</code> below).
Junio C Hamanoa76cb0d2008-08-13 20:04:101710</p>
Junio C Hamano68cf15a2010-11-06 01:01:591711<div class="paragraph"><p>Merges are always included. However, their parent list is rewritten:
Junio C Hamanoa76cb0d2008-08-13 20:04:101712Along each parent, prune away commits that are not included
1713themselves. This results in</p></div>
1714<div class="listingblock">
1715<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:511716<pre><code> .-A---M---N---O---P---Q
Junio C Hamanoa76cb0d2008-08-13 20:04:101717 / / / / /
1718 I B / D /
1719 \ / / / /
Junio C Hamanoac12f0e2014-09-19 22:32:511720 `-------------'</code></pre>
Junio C Hamanoa76cb0d2008-08-13 20:04:101721</div></div>
Junio C Hamanoac12f0e2014-09-19 22:32:511722<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:101723was pruned away because it is TREESAME, but the parent list of P was
Junio C Hamanoac12f0e2014-09-19 22:32:511724rewritten to contain <code>E</code>'s parent <code>I</code>. The same happened for <code>C</code> and
1725<code>N</code>, and <code>X</code>, <code>Y</code> and <code>Q</code>.</p></div>
Junio C Hamanoa76cb0d2008-08-13 20:04:101726</dd>
1727</dl></div>
Junio C Hamano68cf15a2010-11-06 01:01:591728<div class="paragraph"><p>In addition to the above settings, you can change whether TREESAME
Junio C Hamanoa76cb0d2008-08-13 20:04:101729affects inclusion:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591730<div class="dlist"><dl>
1731<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471732--dense
1733</dt>
Junio C Hamanoa76cb0d2008-08-13 20:04:101734<dd>
1735<p>
1736 Commits that are walked are included if they are not TREESAME
1737 to any parent.
1738</p>
1739</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591740<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471741--sparse
Junio C Hamanob0e02952008-01-19 08:02:001742</dt>
1743<dd>
1744<p>
Junio C Hamanoa76cb0d2008-08-13 20:04:101745 All commits that are walked are included.
Junio C Hamanob0e02952008-01-19 08:02:001746</p>
Junio C Hamanoac12f0e2014-09-19 22:32:511747<div class="paragraph"><p>Note that without <code>--full-history</code>, this still simplifies merges: if
Junio C Hamanoa76cb0d2008-08-13 20:04:101748one of the parents is TREESAME, we follow only that one, so the other
1749sides of the merge are never walked.</p></div>
Junio C Hamanob0e02952008-01-19 08:02:001750</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591751<dt class="hdlist1">
Junio C Hamanoa2f46622008-09-03 05:20:311752--simplify-merges
1753</dt>
1754<dd>
1755<p>
1756 First, build a history graph in the same way that
Junio C Hamanoac12f0e2014-09-19 22:32:511757 <code>--full-history</code> with parent rewriting does (see above).
Junio C Hamanoa2f46622008-09-03 05:20:311758</p>
Junio C Hamanoac12f0e2014-09-19 22:32:511759<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:311760history according to the following rules:</p></div>
Junio C Hamano9629d4f2012-12-19 00:28:271761<div class="openblock">
1762<div class="content">
Junio C Hamano68cf15a2010-11-06 01:01:591763<div class="ulist"><ul>
Junio C Hamanoa2f46622008-09-03 05:20:311764<li>
1765<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511766Set <code>C'</code> to <code>C</code>.
Junio C Hamanoa2f46622008-09-03 05:20:311767</p>
1768</li>
1769<li>
1770<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511771Replace each parent <code>P</code> of <code>C'</code> with its simplification <code>P'</code>. In
Junio C Hamano27159f82013-06-14 17:19:221772 the process, drop parents that are ancestors of other parents or that are
1773 root commits TREESAME to an empty tree, and remove duplicates, but take care
1774 to never drop all parents that we are TREESAME to.
Junio C Hamanoa2f46622008-09-03 05:20:311775</p>
1776</li>
1777<li>
1778<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511779If after this parent rewriting, <code>C'</code> is a root or merge commit (has
Junio C Hamanoa2f46622008-09-03 05:20:311780 zero or &gt;1 parents), a boundary commit, or !TREESAME, it remains.
1781 Otherwise, it is replaced with its only parent.
1782</p>
1783</li>
1784</ul></div>
Junio C Hamano9629d4f2012-12-19 00:28:271785</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591786<div class="paragraph"><p>The effect of this is best shown by way of comparing to
Junio C Hamanoac12f0e2014-09-19 22:32:511787<code>--full-history</code> with parent rewriting. The example turns into:</p></div>
Junio C Hamanoa2f46622008-09-03 05:20:311788<div class="listingblock">
1789<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:511790<pre><code> .-A---M---N---O
Junio C Hamanoa2f46622008-09-03 05:20:311791 / / /
1792 I B D
1793 \ / /
Junio C Hamanoac12f0e2014-09-19 22:32:511794 `---------'</code></pre>
Junio C Hamanoa2f46622008-09-03 05:20:311795</div></div>
Junio C Hamanoac12f0e2014-09-19 22:32:511796<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:271797<div class="openblock">
1798<div class="content">
Junio C Hamano68cf15a2010-11-06 01:01:591799<div class="ulist"><ul>
Junio C Hamanoa2f46622008-09-03 05:20:311800<li>
1801<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511802<code>N</code>'s parent list had <code>I</code> removed, because it is an ancestor of the
1803 other parent <code>M</code>. Still, <code>N</code> remained because it is !TREESAME.
Junio C Hamanoa2f46622008-09-03 05:20:311804</p>
1805</li>
1806<li>
1807<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511808<code>P</code>'s parent list similarly had <code>I</code> removed. <code>P</code> was then
Junio C Hamanoa2f46622008-09-03 05:20:311809 removed completely, because it had one parent and is TREESAME.
1810</p>
1811</li>
Junio C Hamano27159f82013-06-14 17:19:221812<li>
1813<p>
Junio C Hamanoac12f0e2014-09-19 22:32:511814<code>Q</code>'s parent list had <code>Y</code> simplified to <code>X</code>. <code>X</code> was then removed, because it
1815 was a TREESAME root. <code>Q</code> was then removed completely, because it had one
Junio C Hamano27159f82013-06-14 17:19:221816 parent and is TREESAME.
1817</p>
1818</li>
Junio C Hamanoa2f46622008-09-03 05:20:311819</ul></div>
Junio C Hamano9629d4f2012-12-19 00:28:271820</div></div>
Junio C Hamanoa2f46622008-09-03 05:20:311821</dd>
1822</dl></div>
Junio C Hamano67bf2242020-04-22 21:41:441823<div class="paragraph"><p>There is another simplification mode available:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591824<div class="dlist"><dl>
1825<dt class="hdlist1">
Junio C Hamano89a57342010-06-22 23:22:551826--ancestry-path
1827</dt>
1828<dd>
1829<p>
1830 Limit the displayed commits to those directly on the ancestry
Junio C Hamanob73af6c2013-12-03 22:07:111831 chain between the &#8220;from&#8221; and &#8220;to&#8221; commits in the given commit
1832 range. I.e. only display commits that are ancestor of the &#8220;to&#8221;
1833 commit and descendants of the &#8220;from&#8221; commit.
Junio C Hamano89a57342010-06-22 23:22:551834</p>
Junio C Hamano68cf15a2010-11-06 01:01:591835<div class="paragraph"><p>As an example use case, consider the following commit history:</p></div>
Junio C Hamano89a57342010-06-22 23:22:551836<div class="listingblock">
1837<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:511838<pre><code> D---E-------F
Junio C Hamano89a57342010-06-22 23:22:551839 / \ \
1840 B---C---G---H---I---J
1841 / \
Junio C Hamanoac12f0e2014-09-19 22:32:511842 A-------K---------------L--M</code></pre>
Junio C Hamano89a57342010-06-22 23:22:551843</div></div>
Junio C Hamanoac12f0e2014-09-19 22:32:511844<div class="paragraph"><p>A regular <em>D..M</em> computes the set of commits that are ancestors of <code>M</code>,
1845but excludes the ones that are ancestors of <code>D</code>. This is useful to see
1846what happened to the history leading to <code>M</code> since <code>D</code>, in the sense
1847that &#8220;what does <code>M</code> have that did not exist in <code>D</code>&#8221;. The result in this
1848example 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:551849of course).</p></div>
Junio C Hamanoac12f0e2014-09-19 22:32:511850<div class="paragraph"><p>When we want to find out what commits in <code>M</code> are contaminated with the
1851bug introduced by <code>D</code> and need fixing, however, we might want to view
1852only the subset of <em>D..M</em> that are actually descendants of <code>D</code>, i.e.
1853excluding <code>C</code> and <code>K</code>. This is exactly what the <code>--ancestry-path</code>
Junio C Hamano89a57342010-06-22 23:22:551854option does. Applied to the <em>D..M</em> range, it results in:</p></div>
1855<div class="listingblock">
1856<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:511857<pre><code> E-------F
Junio C Hamano89a57342010-06-22 23:22:551858 \ \
1859 G---H---I---J
1860 \
Junio C Hamanoac12f0e2014-09-19 22:32:511861 L--M</code></pre>
Junio C Hamano89a57342010-06-22 23:22:551862</div></div>
1863</dd>
1864</dl></div>
Junio C Hamano67bf2242020-04-22 21:41:441865<div class="paragraph"><p>Before discussing another option, <code>--show-pulls</code>, we need to
1866create a new example history.</p></div>
Junio C Hamano0cb719f2020-05-31 20:04:391867<div class="paragraph"><p>A common problem users face when looking at simplified history is that a
Junio C Hamano67bf2242020-04-22 21:41:441868commit they know changed a file somehow does not appear in the file&#8217;s
1869simplified history. Let&#8217;s demonstrate a new example and show how options
1870such as <code>--full-history</code> and <code>--simplify-merges</code> works in that case:</p></div>
Junio C Hamano67bf2242020-04-22 21:41:441871<div class="listingblock">
1872<div class="content">
1873<pre><code> .-A---M-----C--N---O---P
1874 / / \ \ \/ / /
1875 I B \ R-'`-Z' /
1876 \ / \/ /
1877 \ / /\ /
1878 `---X--' `---Y--'</code></pre>
1879</div></div>
Junio C Hamano0cb719f2020-05-31 20:04:391880<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:441881<code>A</code>, <code>B</code>, and <code>X</code> in different ways. The single-parent commits <code>C</code>, <code>Z</code>,
1882and <code>Y</code> do not change <code>file.txt</code>. The merge commit <code>M</code> was created by
1883resolving the merge conflict to include both changes from <code>A</code> and <code>B</code>
1884and hence is not TREESAME to either. The merge commit <code>R</code>, however, was
1885created by ignoring the contents of <code>file.txt</code> at <code>M</code> and taking only
1886the contents of <code>file.txt</code> at <code>X</code>. Hence, <code>R</code> is TREESAME to <code>X</code> but not
1887<code>M</code>. Finally, the natural merge resolution to create <code>N</code> is to take the
1888contents of <code>file.txt</code> at <code>R</code>, so <code>N</code> is TREESAME to <code>R</code> but not <code>C</code>.
1889The merge commits <code>O</code> and <code>P</code> are TREESAME to their first parents, but
1890not to their second parents, <code>Z</code> and <code>Y</code> respectively.</p></div>
Junio C Hamano0cb719f2020-05-31 20:04:391891<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:441892those edges are walked and the others are ignored. The resulting history
1893graph is:</p></div>
Junio C Hamano67bf2242020-04-22 21:41:441894<div class="listingblock">
1895<div class="content">
1896<pre><code> I---X</code></pre>
1897</div></div>
Junio C Hamano0cb719f2020-05-31 20:04:391898<div class="paragraph"><p>When using <code>--full-history</code>, Git walks every edge. This will discover
Junio C Hamano67bf2242020-04-22 21:41:441899the commits <code>A</code> and <code>B</code> and the merge <code>M</code>, but also will reveal the
1900merge commits <code>O</code> and <code>P</code>. With parent rewriting, the resulting graph is:</p></div>
Junio C Hamano67bf2242020-04-22 21:41:441901<div class="listingblock">
1902<div class="content">
1903<pre><code> .-A---M--------N---O---P
1904 / / \ \ \/ / /
1905 I B \ R-'`--' /
1906 \ / \/ /
1907 \ / /\ /
1908 `---X--' `------'</code></pre>
1909</div></div>
Junio C Hamano0cb719f2020-05-31 20:04:391910<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:441911not actually contribute a change to <code>file.txt</code>. They only merged a topic
1912that was based on an older version of <code>file.txt</code>. This is a common
1913issue in repositories using a workflow where many contributors work in
1914parallel and merge their topic branches along a single trunk: manu
1915unrelated merges appear in the <code>--full-history</code> results.</p></div>
Junio C Hamano0cb719f2020-05-31 20:04:391916<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:441917disappear from the results. This is because the rewritten second parents
1918of <code>O</code> and <code>P</code> are reachable from their first parents. Those edges are
1919removed and then the commits look like single-parent commits that are
1920TREESAME to their parent. This also happens to the commit <code>N</code>, resulting
1921in a history view as follows:</p></div>
Junio C Hamano67bf2242020-04-22 21:41:441922<div class="listingblock">
1923<div class="content">
1924<pre><code> .-A---M--.
1925 / / \
1926 I B R
1927 \ / /
1928 \ / /
1929 `---X--'</code></pre>
1930</div></div>
Junio C Hamano0cb719f2020-05-31 20:04:391931<div class="paragraph"><p>In this view, we see all of the important single-parent changes from
Junio C Hamano67bf2242020-04-22 21:41:441932<code>A</code>, <code>B</code>, and <code>X</code>. We also see the carefully-resolved merge <code>M</code> and the
1933not-so-carefully-resolved merge <code>R</code>. This is usually enough information
1934to determine why the commits <code>A</code> and <code>B</code> "disappeared" from history in
1935the default view. However, there are a few issues with this approach.</p></div>
Junio C Hamano0cb719f2020-05-31 20:04:391936<div class="paragraph"><p>The first issue is performance. Unlike any previous option, the
Junio C Hamano67bf2242020-04-22 21:41:441937<code>--simplify-merges</code> option requires walking the entire commit history
1938before returning a single result. This can make the option difficult to
1939use for very large repositories.</p></div>
Junio C Hamano0cb719f2020-05-31 20:04:391940<div class="paragraph"><p>The second issue is one of auditing. When many contributors are working
Junio C Hamano67bf2242020-04-22 21:41:441941on the same repository, it is important which merge commits introduced
1942a change into an important branch. The problematic merge <code>R</code> above is
1943not likely to be the merge commit that was used to merge into an
1944important branch. Instead, the merge <code>N</code> was used to merge <code>R</code> and <code>X</code>
1945into the important branch. This commit may have information about why
1946the change <code>X</code> came to override the changes from <code>A</code> and <code>B</code> in its
1947commit message.</p></div>
Junio C Hamano0cb719f2020-05-31 20:04:391948<div class="dlist"><dl>
1949<dt class="hdlist1">
1950--show-pulls
1951</dt>
1952<dd>
1953<p>
1954 In addition to the commits shown in the default history, show
1955 each merge commit that is not TREESAME to its first parent but
1956 is TREESAME to a later parent.
1957</p>
1958<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:441959treated as if it "pulled" the change from another branch. When using
1960<code>--show-pulls</code> on this example (and no other options) the resulting
1961graph is:</p></div>
Junio C Hamano67bf2242020-04-22 21:41:441962<div class="listingblock">
1963<div class="content">
1964<pre><code> I---X---R---N</code></pre>
1965</div></div>
Junio C Hamano0cb719f2020-05-31 20:04:391966<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:441967the commits <code>X</code> and <code>R</code> into the base branch, respectively. These
1968merges are the reason the commits <code>A</code> and <code>B</code> do not appear in the
1969default history.</p></div>
Junio C Hamano0cb719f2020-05-31 20:04:391970<div class="paragraph"><p>When <code>--show-pulls</code> is paired with <code>--simplify-merges</code>, the
Junio C Hamano67bf2242020-04-22 21:41:441971graph includes all of the necessary information:</p></div>
Junio C Hamano67bf2242020-04-22 21:41:441972<div class="listingblock">
1973<div class="content">
1974<pre><code> .-A---M--. N
1975 / / \ /
1976 I B R
1977 \ / /
1978 \ / /
1979 `---X--'</code></pre>
1980</div></div>
Junio C Hamano0cb719f2020-05-31 20:04:391981<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:441982was simplified away. However, <code>N</code> still appears in the history as an
1983important commit because it "pulled" the change <code>R</code> into the main
1984branch.</p></div>
Junio C Hamano0cb719f2020-05-31 20:04:391985</dd>
1986</dl></div>
Junio C Hamanoac12f0e2014-09-19 22:32:511987<div class="paragraph"><p>The <code>--simplify-by-decoration</code> option allows you to view only the
Junio C Hamano28363492008-11-14 08:26:311988big picture of the topology of the history, by omitting commits
1989that are not referenced by tags. Commits are marked as !TREESAME
1990(in other words, kept after history simplification rules described
1991above) if (1) they are referenced by tags, or (2) they change the
1992contents of the paths given on the command line. All other
1993commits are marked as TREESAME (subject to be simplified away).</p></div>
Junio C Hamano9629d4f2012-12-19 00:28:271994</div>
1995<div class="sect2">
1996<h3 id="_commit_ordering">Commit Ordering</h3>
Junio C Hamano68cf15a2010-11-06 01:01:591997<div class="paragraph"><p>By default, the commits are shown in reverse chronological order.</p></div>
1998<div class="dlist"><dl>
1999<dt class="hdlist1">
Junio C Hamanob0e02952008-01-19 08:02:002000--date-order
2001</dt>
2002<dd>
2003<p>
Junio C Hamanod0316112012-08-22 19:55:292004 Show no parents before all of its children are shown, but
2005 otherwise show commits in the commit timestamp order.
Junio C Hamanob0e02952008-01-19 08:02:002006</p>
2007</dd>
Junio C Hamano68cf15a2010-11-06 01:01:592008<dt class="hdlist1">
Junio C Hamanoa1952302013-07-01 21:31:182009--author-date-order
2010</dt>
2011<dd>
2012<p>
2013 Show no parents before all of its children are shown, but
2014 otherwise show commits in the author timestamp order.
2015</p>
2016</dd>
2017<dt class="hdlist1">
Junio C Hamanod0316112012-08-22 19:55:292018--topo-order
2019</dt>
2020<dd>
2021<p>
2022 Show no parents before all of its children are shown, and
2023 avoid showing commits on multiple lines of history
2024 intermixed.
2025</p>
2026<div class="paragraph"><p>For example, in a commit history like this:</p></div>
2027<div class="listingblock">
2028<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512029<pre><code> ---1----2----4----7
Junio C Hamanod0316112012-08-22 19:55:292030 \ \
Junio C Hamanoac12f0e2014-09-19 22:32:512031 3----5----6----8---</code></pre>
Junio C Hamanod0316112012-08-22 19:55:292032</div></div>
Junio C Hamanoac12f0e2014-09-19 22:32:512033<div class="paragraph"><p>where the numbers denote the order of commit timestamps, <code>git
2034rev-list</code> and friends with <code>--date-order</code> show the commits in the
Junio C Hamanod0316112012-08-22 19:55:292035timestamp order: 8 7 6 5 4 3 2 1.</p></div>
Junio C Hamanoac12f0e2014-09-19 22:32:512036<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:2920373 1); some older commits are shown before newer ones in order to
2038avoid showing the commits from two parallel development track mixed
2039together.</p></div>
2040</dd>
2041<dt class="hdlist1">
Junio C Hamanob0e02952008-01-19 08:02:002042--reverse
2043</dt>
2044<dd>
2045<p>
Junio C Hamanof3ca7b82016-10-03 22:27:022046 Output the commits chosen to be shown (see Commit Limiting
2047 section above) in reverse order. Cannot be combined with
2048 <code>--walk-reflogs</code>.
Junio C Hamanob0e02952008-01-19 08:02:002049</p>
2050</dd>
Junio C Hamanoba4b9282008-07-06 05:20:312051</dl></div>
Junio C Hamano9629d4f2012-12-19 00:28:272052</div>
2053<div class="sect2">
2054<h3 id="_object_traversal">Object Traversal</h3>
Junio C Hamano076ffcc2013-02-06 05:13:212055<div class="paragraph"><p>These options are mostly targeted for packing of Git repositories.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592056<div class="dlist"><dl>
2057<dt class="hdlist1">
Junio C Hamanoeccdd4a2012-09-10 23:28:172058--no-walk[=(sorted|unsorted)]
Junio C Hamanob0e02952008-01-19 08:02:002059</dt>
2060<dd>
2061<p>
Junio C Hamanoeccdd4a2012-09-10 23:28:172062 Only show the given commits, but do not traverse their ancestors.
2063 This has no effect if a range is specified. If the argument
Junio C Hamanoac12f0e2014-09-19 22:32:512064 <code>unsorted</code> is given, the commits are shown in the order they were
2065 given on the command line. Otherwise (if <code>sorted</code> or no argument
Junio C Hamanob73af6c2013-12-03 22:07:112066 was given), the commits are shown in reverse chronological order
Junio C Hamanoeccdd4a2012-09-10 23:28:172067 by commit time.
Junio C Hamanoef57d1e2015-03-25 21:23:002068 Cannot be combined with <code>--graph</code>.
Junio C Hamanob0e02952008-01-19 08:02:002069</p>
2070</dd>
Junio C Hamano68cf15a2010-11-06 01:01:592071<dt class="hdlist1">
Junio C Hamanob0e02952008-01-19 08:02:002072--do-walk
2073</dt>
2074<dd>
2075<p>
Junio C Hamanoac12f0e2014-09-19 22:32:512076 Overrides a previous <code>--no-walk</code>.
Junio C Hamanob0e02952008-01-19 08:02:002077</p>
2078</dd>
Junio C Hamanoba4b9282008-07-06 05:20:312079</dl></div>
Junio C Hamano9629d4f2012-12-19 00:28:272080</div>
2081<div class="sect2">
2082<h3 id="_commit_formatting">Commit Formatting</h3>
Junio C Hamanod2c978f2011-03-20 19:42:222083<div class="dlist"><dl>
2084<dt class="hdlist1">
2085--pretty[=&lt;format&gt;]
2086</dt>
2087<dt class="hdlist1">
2088--format=&lt;format&gt;
2089</dt>
2090<dd>
2091<p>
2092 Pretty-print the contents of the commit logs in a given format,
2093 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:092094 <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:262095 and <em>tformat:&lt;string&gt;</em>. When <em>&lt;format&gt;</em> is none of the above,
2096 and has <em>%placeholder</em> in it, it acts as if
2097 <em>--pretty=tformat:&lt;format&gt;</em> were given.
Junio C Hamanod2c978f2011-03-20 19:42:222098</p>
Junio C Hamano6bb32e62015-02-17 22:11:262099<div class="paragraph"><p>See the "PRETTY FORMATS" section for some additional details for each
2100format. When <em>=&lt;format&gt;</em> part is omitted, it defaults to <em>medium</em>.</p></div>
Junio C Hamanod2c978f2011-03-20 19:42:222101<div class="paragraph"><p>Note: you can specify the default pretty format in the repository
Junio C Hamanoa28a9202012-06-21 07:08:232102configuration (see <a href="git-config.html">git-config(1)</a>).</p></div>
Junio C Hamanod2c978f2011-03-20 19:42:222103</dd>
2104<dt class="hdlist1">
2105--abbrev-commit
2106</dt>
2107<dd>
2108<p>
2109 Instead of showing the full 40-byte hexadecimal commit object
2110 name, show only a partial prefix. Non default number of
2111 digits can be specified with "--abbrev=&lt;n&gt;" (which also modifies
2112 diff output, if it is displayed).
2113</p>
2114<div class="paragraph"><p>This should make "--pretty=oneline" a whole lot more readable for
2115people using 80-column terminals.</p></div>
2116</dd>
2117<dt class="hdlist1">
Junio C Hamanof93530e2011-05-25 23:59:592118--no-abbrev-commit
2119</dt>
2120<dd>
2121<p>
2122 Show the full 40-byte hexadecimal commit object name. This negates
Junio C Hamano558abd22020-09-03 20:22:342123 <code>--abbrev-commit</code>, either explicit or implied by other options such
2124 as "--oneline". It also overrides the <code>log.abbrevCommit</code> variable.
Junio C Hamanof93530e2011-05-25 23:59:592125</p>
2126</dd>
2127<dt class="hdlist1">
Junio C Hamanod2c978f2011-03-20 19:42:222128--oneline
2129</dt>
2130<dd>
2131<p>
2132 This is a shorthand for "--pretty=oneline --abbrev-commit"
2133 used together.
2134</p>
2135</dd>
2136<dt class="hdlist1">
Junio C Hamanoc5bb3b32013-08-05 22:43:362137--encoding=&lt;encoding&gt;
Junio C Hamanod2c978f2011-03-20 19:42:222138</dt>
2139<dd>
2140<p>
2141 The commit objects record the encoding used for the log message
2142 in their encoding header; this option can be used to tell the
2143 command to re-code the commit log message in the encoding
2144 preferred by the user. For non plumbing commands this
Junio C Hamano823eebb2015-07-10 22:29:342145 defaults to UTF-8. Note that if an object claims to be encoded
2146 in <code>X</code> and we are outputting in <code>X</code>, we will output the object
2147 verbatim; this means that invalid sequences in the original
2148 commit may be copied to the output.
Junio C Hamanod2c978f2011-03-20 19:42:222149</p>
2150</dd>
2151<dt class="hdlist1">
Junio C Hamano5996b672016-04-13 22:01:412152--expand-tabs=&lt;n&gt;
2153</dt>
2154<dt class="hdlist1">
2155--expand-tabs
2156</dt>
2157<dt class="hdlist1">
2158--no-expand-tabs
2159</dt>
2160<dd>
2161<p>
2162 Perform a tab expansion (replace each tab with enough spaces
2163 to fill to the next display column that is multiple of <em>&lt;n&gt;</em>)
2164 in the log message before showing it in the output.
2165 <code>--expand-tabs</code> is a short-hand for <code>--expand-tabs=8</code>, and
2166 <code>--no-expand-tabs</code> is a short-hand for <code>--expand-tabs=0</code>,
2167 which disables tab expansion.
2168</p>
2169<div class="paragraph"><p>By default, tabs are expanded in pretty formats that indent the log
2170message by 4 spaces (i.e. <em>medium</em>, which is the default, <em>full</em>,
2171and <em>fuller</em>).</p></div>
2172</dd>
2173<dt class="hdlist1">
Junio C Hamanob3f862c2019-12-05 22:22:002174--notes[=&lt;ref&gt;]
Junio C Hamanod2c978f2011-03-20 19:42:222175</dt>
2176<dd>
2177<p>
Junio C Hamanoa28a9202012-06-21 07:08:232178 Show the notes (see <a href="git-notes.html">git-notes(1)</a>) that annotate the
Junio C Hamanod2c978f2011-03-20 19:42:222179 commit, when showing the commit log message. This is the default
Junio C Hamanoac12f0e2014-09-19 22:32:512180 for <code>git log</code>, <code>git show</code> and <code>git whatchanged</code> commands when
2181 there is no <code>--pretty</code>, <code>--format</code>, or <code>--oneline</code> option given
Junio C Hamano60033462011-05-03 00:48:432182 on the command line.
Junio C Hamanod2c978f2011-03-20 19:42:222183</p>
Junio C Hamano60033462011-05-03 00:48:432184<div class="paragraph"><p>By default, the notes shown are from the notes refs listed in the
Junio C Hamano042f2142016-06-27 18:05:052185<code>core.notesRef</code> and <code>notes.displayRef</code> variables (or corresponding
Junio C Hamanoa28a9202012-06-21 07:08:232186environment overrides). See <a href="git-config.html">git-config(1)</a> for more details.</p></div>
Junio C Hamanob3f862c2019-12-05 22:22:002187<div class="paragraph"><p>With an optional <em>&lt;ref&gt;</em> argument, use the ref to find the notes
2188to display. The ref can specify the full refname when it begins
Junio C Hamano1f7c4a52015-10-14 22:15:512189with <code>refs/notes/</code>; when it begins with <code>notes/</code>, <code>refs/</code> and otherwise
2190<code>refs/notes/</code> is prefixed to form a full name of the ref.</p></div>
Junio C Hamano60033462011-05-03 00:48:432191<div class="paragraph"><p>Multiple --notes options can be combined to control which notes are
2192being displayed. Examples: "--notes=foo" will show only notes from
2193"refs/notes/foo"; "--notes=foo --notes" will show both notes from
2194"refs/notes/foo" and from the default notes ref(s).</p></div>
Junio C Hamanod2c978f2011-03-20 19:42:222195</dd>
2196<dt class="hdlist1">
Junio C Hamano60033462011-05-03 00:48:432197--no-notes
2198</dt>
2199<dd>
2200<p>
Junio C Hamanoac12f0e2014-09-19 22:32:512201 Do not show notes. This negates the above <code>--notes</code> option, by
Junio C Hamano60033462011-05-03 00:48:432202 resetting the list of notes refs from which notes are shown.
2203 Options are parsed in the order given on the command line, so e.g.
2204 "--notes --notes=foo --no-notes --notes=bar" will only show notes
2205 from "refs/notes/bar".
2206</p>
2207</dd>
2208<dt class="hdlist1">
Junio C Hamanob3f862c2019-12-05 22:22:002209--show-notes[=&lt;ref&gt;]
Junio C Hamano60033462011-05-03 00:48:432210</dt>
2211<dt class="hdlist1">
Junio C Hamanod2c978f2011-03-20 19:42:222212--[no-]standard-notes
2213</dt>
2214<dd>
2215<p>
Junio C Hamano60033462011-05-03 00:48:432216 These options are deprecated. Use the above --notes/--no-notes
2217 options instead.
Junio C Hamanod2c978f2011-03-20 19:42:222218</p>
2219</dd>
2220<dt class="hdlist1">
Junio C Hamano0acb1ae2012-09-24 21:28:132221--show-signature
2222</dt>
2223<dd>
2224<p>
2225 Check the validity of a signed commit object by passing the signature
Junio C Hamanoac12f0e2014-09-19 22:32:512226 to <code>gpg --verify</code> and show the output.
Junio C Hamano0acb1ae2012-09-24 21:28:132227</p>
2228</dd>
2229<dt class="hdlist1">
Junio C Hamanod2c978f2011-03-20 19:42:222230--relative-date
2231</dt>
2232<dd>
2233<p>
Junio C Hamanoac12f0e2014-09-19 22:32:512234 Synonym for <code>--date=relative</code>.
Junio C Hamanod2c978f2011-03-20 19:42:222235</p>
2236</dd>
2237<dt class="hdlist1">
Junio C Hamano1eb56092015-10-05 20:39:532238--date=&lt;format&gt;
Junio C Hamanod2c978f2011-03-20 19:42:222239</dt>
2240<dd>
2241<p>
2242 Only takes effect for dates shown in human-readable format, such
Junio C Hamanoac12f0e2014-09-19 22:32:512243 as when using <code>--pretty</code>. <code>log.date</code> config variable sets a default
Junio C Hamano1eb56092015-10-05 20:39:532244 value for the log command&#8217;s <code>--date</code> option. By default, dates
2245 are shown in the original time zone (either committer&#8217;s or
2246 author&#8217;s). If <code>-local</code> is appended to the format (e.g.,
2247 <code>iso-local</code>), the user&#8217;s local time zone is used instead.
Junio C Hamanod2c978f2011-03-20 19:42:222248</p>
Junio C Hamanob5513772019-04-22 03:38:392249<div class="openblock">
2250<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512251<div class="paragraph"><p><code>--date=relative</code> shows dates relative to the current time,
Junio C Hamanoe548d1b2016-08-08 22:26:492252e.g. &#8220;2 hours ago&#8221;. The <code>-local</code> option has no effect for
2253<code>--date=relative</code>.</p></div>
Junio C Hamano1eb56092015-10-05 20:39:532254<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:512255<div class="paragraph"><p><code>--date=iso</code> (or <code>--date=iso8601</code>) shows timestamps in a ISO 8601-like format.
2256The differences to the strict ISO 8601 format are:</p></div>
2257<div class="ulist"><ul>
2258<li>
2259<p>
2260a space instead of the <code>T</code> date/time delimiter
2261</p>
2262</li>
2263<li>
2264<p>
2265a space between time and time zone
2266</p>
2267</li>
2268<li>
2269<p>
2270no colon between hours and minutes of the time zone
2271</p>
2272</li>
2273</ul></div>
2274<div class="paragraph"><p><code>--date=iso-strict</code> (or <code>--date=iso8601-strict</code>) shows timestamps in strict
2275ISO 8601 format.</p></div>
2276<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:112277format, often found in email messages.</p></div>
Junio C Hamanoac12f0e2014-09-19 22:32:512278<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:492279<div class="paragraph"><p><code>--date=raw</code> shows the date as seconds since the epoch (1970-01-01
228000:00:00 UTC), followed by a space, and then the timezone as an offset
2281from UTC (a <code>+</code> or <code>-</code> with four digits; the first two are hours, and
2282the second two are minutes). I.e., as if the timestamp were formatted
2283with <code>strftime("%s %z")</code>).
2284Note that the <code>-local</code> option does not affect the seconds-since-epoch
2285value (which is always measured in UTC), but does switch the accompanying
2286timezone value.</p></div>
Junio C Hamano23168ef2019-02-07 07:20:472287<div class="paragraph"><p><code>--date=human</code> shows the timezone if the timezone does not match the
2288current time-zone, and doesn&#8217;t print the whole date if that matches
2289(ie skip printing year for dates that are "this year", but also skip
2290the whole date itself if it&#8217;s in the last few days and we can just say
2291what weekday it was). For older dates the hour and minute is also
2292omitted.</p></div>
Junio C Hamanoe548d1b2016-08-08 22:26:492293<div class="paragraph"><p><code>--date=unix</code> shows the date as a Unix epoch timestamp (seconds since
22941970). As with <code>--raw</code>, this is always in UTC and therefore <code>-local</code>
2295has no effect.</p></div>
Junio C Hamano55d91912017-06-22 22:32:462296<div class="paragraph"><p><code>--date=format:...</code> feeds the format <code>...</code> to your system <code>strftime</code>,
2297except for %z and %Z, which are handled internally.
Junio C Hamanod7ed4042015-08-03 19:43:002298Use <code>--date=format:%c</code> to show the date in your system locale&#8217;s
2299preferred format. See the <code>strftime</code> manual for a complete list of
Junio C Hamano1eb56092015-10-05 20:39:532300format placeholders. When using <code>-local</code>, the correct syntax is
2301<code>--date=format-local:...</code>.</p></div>
2302<div class="paragraph"><p><code>--date=default</code> is the default format, and is similar to
2303<code>--date=rfc2822</code>, with a few exceptions:</p></div>
Junio C Hamanob5513772019-04-22 03:38:392304</div></div>
Junio C Hamano1eb56092015-10-05 20:39:532305<div class="ulist"><ul>
2306<li>
2307<p>
2308there is no comma after the day-of-week
2309</p>
2310</li>
2311<li>
2312<p>
2313the time zone is omitted when the local time zone is used
2314</p>
2315</li>
2316</ul></div>
Junio C Hamanod2c978f2011-03-20 19:42:222317</dd>
2318<dt class="hdlist1">
2319--parents
2320</dt>
2321<dd>
2322<p>
2323 Print also the parents of the commit (in the form "commit parent&#8230;").
Junio C Hamanoce019c02017-10-30 05:57:462324 Also enables parent rewriting, see <em>History Simplification</em> above.
Junio C Hamanod2c978f2011-03-20 19:42:222325</p>
2326</dd>
2327<dt class="hdlist1">
2328--children
2329</dt>
2330<dd>
2331<p>
2332 Print also the children of the commit (in the form "commit child&#8230;").
Junio C Hamanoce019c02017-10-30 05:57:462333 Also enables parent rewriting, see <em>History Simplification</em> above.
Junio C Hamanod2c978f2011-03-20 19:42:222334</p>
2335</dd>
2336<dt class="hdlist1">
2337--left-right
2338</dt>
2339<dd>
2340<p>
Junio C Hamanocd451662016-09-13 00:54:092341 Mark which side of a symmetric difference a commit is reachable from.
Junio C Hamanoac12f0e2014-09-19 22:32:512342 Commits from the left side are prefixed with <code>&lt;</code> and those from
2343 the right with <code>&gt;</code>. If combined with <code>--boundary</code>, those
2344 commits are prefixed with <code>-</code>.
Junio C Hamanod2c978f2011-03-20 19:42:222345</p>
2346<div class="paragraph"><p>For example, if you have this topology:</p></div>
2347<div class="listingblock">
2348<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512349<pre><code> y---b---b branch B
Junio C Hamanod2c978f2011-03-20 19:42:222350 / \ /
2351 / .
2352 / / \
Junio C Hamanoac12f0e2014-09-19 22:32:512353 o---x---a---a branch A</code></pre>
Junio C Hamanod2c978f2011-03-20 19:42:222354</div></div>
2355<div class="paragraph"><p>you would get an output like this:</p></div>
2356<div class="listingblock">
2357<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512358<pre><code> $ git rev-list --left-right --boundary --pretty=oneline A...B
Junio C Hamanod2c978f2011-03-20 19:42:222359
2360 &gt;bbbbbbb... 3rd on b
2361 &gt;bbbbbbb... 2nd on b
2362 &lt;aaaaaaa... 3rd on a
2363 &lt;aaaaaaa... 2nd on a
2364 -yyyyyyy... 1st on b
Junio C Hamanoac12f0e2014-09-19 22:32:512365 -xxxxxxx... 1st on a</code></pre>
Junio C Hamanod2c978f2011-03-20 19:42:222366</div></div>
2367</dd>
2368<dt class="hdlist1">
2369--graph
2370</dt>
2371<dd>
2372<p>
2373 Draw a text-based graphical representation of the commit history
2374 on the left hand side of the output. This may cause extra lines
2375 to be printed in between commits, in order for the graph history
2376 to be drawn properly.
Junio C Hamanoef57d1e2015-03-25 21:23:002377 Cannot be combined with <code>--no-walk</code>.
Junio C Hamanod2c978f2011-03-20 19:42:222378</p>
Junio C Hamanoce019c02017-10-30 05:57:462379<div class="paragraph"><p>This enables parent rewriting, see <em>History Simplification</em> above.</p></div>
Junio C Hamanoac12f0e2014-09-19 22:32:512380<div class="paragraph"><p>This implies the <code>--topo-order</code> option by default, but the
2381<code>--date-order</code> option may also be specified.</p></div>
Junio C Hamanod2c978f2011-03-20 19:42:222382</dd>
Junio C Hamano624dd4c2014-04-03 21:56:302383<dt class="hdlist1">
2384--show-linear-break[=&lt;barrier&gt;]
2385</dt>
2386<dd>
2387<p>
2388 When --graph is not used, all history branches are flattened
2389 which can make it hard to see that the two consecutive commits
2390 do not belong to a linear branch. This option puts a barrier
Junio C Hamanoac12f0e2014-09-19 22:32:512391 in between them in that case. If <code>&lt;barrier&gt;</code> is specified, it
Junio C Hamano624dd4c2014-04-03 21:56:302392 is the string that will be shown instead of the default one.
2393</p>
2394</dd>
Junio C Hamanod2c978f2011-03-20 19:42:222395</dl></div>
Junio C Hamano9629d4f2012-12-19 00:28:272396</div>
Junio C Hamano9629d4f2012-12-19 00:28:272397</div>
2398</div>
2399<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:312400<h2 id="_pretty_formats">PRETTY FORMATS</h2>
Junio C Hamano0430e3a2007-05-15 03:13:172401<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:592402<div class="paragraph"><p>If the commit is a merge, and if the pretty-format
Junio C Hamano0430e3a2007-05-15 03:13:172403is not <em>oneline</em>, <em>email</em> or <em>raw</em>, an additional line is
2404inserted before the <em>Author:</em> line. This line begins with
Junio C Hamanob4896852019-12-10 23:15:092405"Merge: " and the hashes of ancestral commits are printed,
Junio C Hamano0430e3a2007-05-15 03:13:172406separated by spaces. Note that the listed commits may not
2407necessarily be the list of the <strong>direct</strong> parent commits if you
2408have limited your view of history: for example, if you are
2409only interested in changes related to a certain directory or
Junio C Hamanoba4b9282008-07-06 05:20:312410file.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592411<div class="paragraph"><p>There are several built-in formats, and you can define
Junio C Hamanoa574a092010-06-13 19:57:102412additional formats by setting a pretty.&lt;name&gt;
2413config option to either another format name, or a
2414<em>format:</em> string, as described below (see
Junio C Hamanoa28a9202012-06-21 07:08:232415<a href="git-config.html">git-config(1)</a>). Here are the details of the
Junio C Hamanoa574a092010-06-13 19:57:102416built-in formats:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592417<div class="ulist"><ul>
Junio C Hamanoa340aaa2006-11-23 02:47:332418<li>
2419<p>
2420<em>oneline</em>
2421</p>
2422<div class="literalblock">
2423<div class="content">
Junio C Hamanob4896852019-12-10 23:15:092424<pre><code>&lt;hash&gt; &lt;title line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332425</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592426<div class="paragraph"><p>This is designed to be as compact as possible.</p></div>
Junio C Hamanoa340aaa2006-11-23 02:47:332427</li>
2428<li>
2429<p>
2430<em>short</em>
2431</p>
2432<div class="literalblock">
2433<div class="content">
Junio C Hamanob4896852019-12-10 23:15:092434<pre><code>commit &lt;hash&gt;
Junio C Hamanoac12f0e2014-09-19 22:32:512435Author: &lt;author&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332436</div></div>
2437<div class="literalblock">
2438<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512439<pre><code>&lt;title line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332440</div></div>
2441</li>
2442<li>
2443<p>
2444<em>medium</em>
2445</p>
2446<div class="literalblock">
2447<div class="content">
Junio C Hamanob4896852019-12-10 23:15:092448<pre><code>commit &lt;hash&gt;
Junio C Hamanoa340aaa2006-11-23 02:47:332449Author: &lt;author&gt;
Junio C Hamanoac12f0e2014-09-19 22:32:512450Date: &lt;author date&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332451</div></div>
2452<div class="literalblock">
2453<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512454<pre><code>&lt;title line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332455</div></div>
2456<div class="literalblock">
2457<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512458<pre><code>&lt;full commit message&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332459</div></div>
2460</li>
2461<li>
2462<p>
2463<em>full</em>
2464</p>
2465<div class="literalblock">
2466<div class="content">
Junio C Hamanob4896852019-12-10 23:15:092467<pre><code>commit &lt;hash&gt;
Junio C Hamanoa340aaa2006-11-23 02:47:332468Author: &lt;author&gt;
Junio C Hamanoac12f0e2014-09-19 22:32:512469Commit: &lt;committer&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332470</div></div>
2471<div class="literalblock">
2472<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512473<pre><code>&lt;title line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332474</div></div>
2475<div class="literalblock">
2476<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512477<pre><code>&lt;full commit message&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332478</div></div>
2479</li>
2480<li>
2481<p>
2482<em>fuller</em>
2483</p>
2484<div class="literalblock">
2485<div class="content">
Junio C Hamanob4896852019-12-10 23:15:092486<pre><code>commit &lt;hash&gt;
Junio C Hamano6a3c8272008-12-19 21:38:182487Author: &lt;author&gt;
Junio C Hamanoba4b9282008-07-06 05:20:312488AuthorDate: &lt;author date&gt;
Junio C Hamano6a3c8272008-12-19 21:38:182489Commit: &lt;committer&gt;
Junio C Hamanoac12f0e2014-09-19 22:32:512490CommitDate: &lt;committer date&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332491</div></div>
2492<div class="literalblock">
2493<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512494<pre><code>&lt;title line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332495</div></div>
2496<div class="literalblock">
2497<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512498<pre><code>&lt;full commit message&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332499</div></div>
2500</li>
2501<li>
2502<p>
Junio C Hamanob4896852019-12-10 23:15:092503<em>reference</em>
2504</p>
2505<div class="literalblock">
2506<div class="content">
2507<pre><code>&lt;abbrev hash&gt; (&lt;title line&gt;, &lt;short author date&gt;)</code></pre>
2508</div></div>
2509<div class="paragraph"><p>This format is used to refer to another commit in a commit message and
2510is the same as <code>--pretty='format:%C(auto)%h (%s, %ad)'</code>. By default,
2511the date is formatted with <code>--date=short</code> unless another <code>--date</code> option
2512is explicitly specified. As with any <code>format:</code> with format
2513placeholders, its output is not affected by other options like
2514<code>--decorate</code> and <code>--walk-reflogs</code>.</p></div>
2515</li>
2516<li>
2517<p>
Junio C Hamanoa340aaa2006-11-23 02:47:332518<em>email</em>
2519</p>
2520<div class="literalblock">
2521<div class="content">
Junio C Hamanob4896852019-12-10 23:15:092522<pre><code>From &lt;hash&gt; &lt;date&gt;
Junio C Hamanoa340aaa2006-11-23 02:47:332523From: &lt;author&gt;
Junio C Hamanoba4b9282008-07-06 05:20:312524Date: &lt;author date&gt;
Junio C Hamanoac12f0e2014-09-19 22:32:512525Subject: [PATCH] &lt;title line&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332526</div></div>
2527<div class="literalblock">
2528<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512529<pre><code>&lt;full commit message&gt;</code></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332530</div></div>
2531</li>
2532<li>
2533<p>
Junio C Hamano0dd50942020-04-29 21:21:052534<em>mboxrd</em>
2535</p>
2536<div class="paragraph"><p>Like <em>email</em>, but lines in the commit message starting with "From "
2537(preceded by zero or more "&gt;") are quoted with "&gt;" so they aren&#8217;t
2538confused as starting a new commit.</p></div>
2539</li>
2540<li>
2541<p>
Junio C Hamanoa340aaa2006-11-23 02:47:332542<em>raw</em>
2543</p>
Junio C Hamano68cf15a2010-11-06 01:01:592544<div class="paragraph"><p>The <em>raw</em> format shows the entire commit exactly as
Junio C Hamanob4896852019-12-10 23:15:092545stored in the commit object. Notably, the hashes are
Junio C Hamanoa340aaa2006-11-23 02:47:332546displayed in full, regardless of whether --abbrev or
2547--no-abbrev are used, and <em>parents</em> information show the
Junio C Hamanod75148a2014-04-08 19:48:382548true parent commits, without taking grafts or history
Junio C Hamano85f1fde2015-06-01 20:37:322549simplification into account. Note that this format affects the way
2550commits are displayed, but not the way the diff is shown e.g. with
2551<code>git log --raw</code>. To get full object names in a raw diff format,
2552use <code>--no-abbrev</code>.</p></div>
Junio C Hamanoa340aaa2006-11-23 02:47:332553</li>
Junio C Hamanoa3fd83c2007-03-02 10:34:362554<li>
2555<p>
Junio C Hamanoe32ec8b2010-06-02 23:32:312556<em>format:&lt;string&gt;</em>
Junio C Hamanoa3fd83c2007-03-02 10:34:362557</p>
Junio C Hamano68cf15a2010-11-06 01:01:592558<div class="paragraph"><p>The <em>format:&lt;string&gt;</em> format allows you to specify which information
Junio C Hamanoa3fd83c2007-03-02 10:34:362559you want to show. It works a little bit like printf format,
2560with the notable exception that you get a newline with <em>%n</em>
Junio C Hamanoba4b9282008-07-06 05:20:312561instead of <em>\n</em>.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592562<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:312563would show something like this:</p></div>
Junio C Hamano0430e3a2007-05-15 03:13:172564<div class="listingblock">
2565<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:512566<pre><code>The author of fe6e0ee was Junio C Hamano, 23 hours ago
2567The 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:172568</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:592569<div class="paragraph"><p>The placeholders are:</p></div>
2570<div class="ulist"><ul>
Junio C Hamanoa3fd83c2007-03-02 10:34:362571<li>
2572<p>
Junio C Hamano11f15372019-03-07 03:17:002573Placeholders that expand to a single literal character:
2574</p>
2575<div class="dlist"><dl>
2576<dt class="hdlist1">
2577<em>%n</em>
2578</dt>
2579<dd>
2580<p>
2581newline
2582</p>
2583</dd>
2584<dt class="hdlist1">
2585<em>%%</em>
2586</dt>
2587<dd>
2588<p>
2589a raw <em>%</em>
2590</p>
2591</dd>
2592<dt class="hdlist1">
2593<em>%x00</em>
2594</dt>
2595<dd>
2596<p>
2597print a byte from a hex code
2598</p>
2599</dd>
2600</dl></div>
2601</li>
2602<li>
2603<p>
2604Placeholders that affect formatting of later placeholders:
2605</p>
2606<div class="dlist"><dl>
2607<dt class="hdlist1">
2608<em>%Cred</em>
2609</dt>
2610<dd>
2611<p>
2612switch color to red
2613</p>
2614</dd>
2615<dt class="hdlist1">
2616<em>%Cgreen</em>
2617</dt>
2618<dd>
2619<p>
2620switch color to green
2621</p>
2622</dd>
2623<dt class="hdlist1">
2624<em>%Cblue</em>
2625</dt>
2626<dd>
2627<p>
2628switch color to blue
2629</p>
2630</dd>
2631<dt class="hdlist1">
2632<em>%Creset</em>
2633</dt>
2634<dd>
2635<p>
2636reset color
2637</p>
2638</dd>
2639<dt class="hdlist1">
2640<em>%C(&#8230;)</em>
2641</dt>
2642<dd>
2643<p>
2644color specification, as described under Values in the
2645 "CONFIGURATION FILE" section of <a href="git-config.html">git-config(1)</a>. By
2646 default, colors are shown only when enabled for log output
2647 (by <code>color.diff</code>, <code>color.ui</code>, or <code>--color</code>, and respecting
2648 the <code>auto</code> settings of the former if we are going to a
2649 terminal). <code>%C(auto,...)</code> is accepted as a historical
2650 synonym for the default (e.g., <code>%C(auto,red)</code>). Specifying
2651 <code>%C(always,...)</code> will show the colors even when color is
2652 not otherwise enabled (though consider just using
2653 <code>--color=always</code> to enable color for the whole output,
2654 including this format and anything else git might color).
2655 <code>auto</code> alone (i.e. <code>%C(auto)</code>) will turn on auto coloring
2656 on the next placeholders until the color is switched
2657 again.
2658</p>
2659</dd>
2660<dt class="hdlist1">
2661<em>%m</em>
2662</dt>
2663<dd>
2664<p>
2665left (<code>&lt;</code>), right (<code>&gt;</code>) or boundary (<code>-</code>) mark
2666</p>
2667</dd>
2668<dt class="hdlist1">
2669<em>%w([&lt;w&gt;[,&lt;i1&gt;[,&lt;i2&gt;]]])</em>
2670</dt>
2671<dd>
2672<p>
2673switch line wrapping, like the -w option of
2674 <a href="git-shortlog.html">git-shortlog(1)</a>.
2675</p>
2676</dd>
2677<dt class="hdlist1">
2678<em>%&lt;(&lt;N&gt;[,trunc|ltrunc|mtrunc])</em>
2679</dt>
2680<dd>
2681<p>
2682make the next placeholder take at
2683 least N columns, padding spaces on
2684 the right if necessary. Optionally
2685 truncate at the beginning (ltrunc),
2686 the middle (mtrunc) or the end
2687 (trunc) if the output is longer than
2688 N columns. Note that truncating
2689 only works correctly with N &gt;= 2.
2690</p>
2691</dd>
2692<dt class="hdlist1">
2693<em>%&lt;|(&lt;N&gt;)</em>
2694</dt>
2695<dd>
2696<p>
2697make the next placeholder take at least until Nth
2698 columns, padding spaces on the right if necessary
2699</p>
2700</dd>
2701<dt class="hdlist1">
2702<em>%&gt;(&lt;N&gt;)</em>, <em>%&gt;|(&lt;N&gt;)</em>
2703</dt>
2704<dd>
2705<p>
2706similar to <em>%&lt;(&lt;N&gt;)</em>, <em>%&lt;|(&lt;N&gt;)</em> respectively,
2707 but padding spaces on the left
2708</p>
2709</dd>
2710<dt class="hdlist1">
2711<em>%&gt;&gt;(&lt;N&gt;)</em>, <em>%&gt;&gt;|(&lt;N&gt;)</em>
2712</dt>
2713<dd>
2714<p>
2715similar to <em>%&gt;(&lt;N&gt;)</em>, <em>%&gt;|(&lt;N&gt;)</em>
2716 respectively, except that if the next
2717 placeholder takes more spaces than given and
2718 there are spaces on its left, use those
2719 spaces
2720</p>
2721</dd>
2722<dt class="hdlist1">
2723<em>%&gt;&lt;(&lt;N&gt;)</em>, <em>%&gt;&lt;|(&lt;N&gt;)</em>
2724</dt>
2725<dd>
2726<p>
2727similar to <em>%&lt;(&lt;N&gt;)</em>, <em>%&lt;|(&lt;N&gt;)</em>
2728 respectively, but padding both sides
2729 (i.e. the text is centered)
2730</p>
2731</dd>
2732</dl></div>
2733</li>
2734<li>
2735<p>
2736Placeholders that expand to information extracted from the commit:
2737</p>
2738<div class="dlist"><dl>
2739<dt class="hdlist1">
2740<em>%H</em>
2741</dt>
2742<dd>
2743<p>
2744commit hash
2745</p>
2746</dd>
2747<dt class="hdlist1">
2748<em>%h</em>
2749</dt>
2750<dd>
2751<p>
2752abbreviated commit hash
2753</p>
2754</dd>
2755<dt class="hdlist1">
2756<em>%T</em>
2757</dt>
2758<dd>
2759<p>
2760tree hash
2761</p>
2762</dd>
2763<dt class="hdlist1">
2764<em>%t</em>
2765</dt>
2766<dd>
2767<p>
2768abbreviated tree hash
2769</p>
2770</dd>
2771<dt class="hdlist1">
2772<em>%P</em>
2773</dt>
2774<dd>
2775<p>
2776parent hashes
2777</p>
2778</dd>
2779<dt class="hdlist1">
2780<em>%p</em>
2781</dt>
2782<dd>
2783<p>
2784abbreviated parent hashes
2785</p>
2786</dd>
2787<dt class="hdlist1">
2788<em>%an</em>
2789</dt>
2790<dd>
2791<p>
2792author name
2793</p>
2794</dd>
2795<dt class="hdlist1">
2796<em>%aN</em>
2797</dt>
2798<dd>
2799<p>
2800author name (respecting .mailmap, see <a href="git-shortlog.html">git-shortlog(1)</a>
2801 or <a href="git-blame.html">git-blame(1)</a>)
2802</p>
2803</dd>
2804<dt class="hdlist1">
2805<em>%ae</em>
2806</dt>
2807<dd>
2808<p>
2809author email
2810</p>
2811</dd>
2812<dt class="hdlist1">
2813<em>%aE</em>
2814</dt>
2815<dd>
2816<p>
2817author email (respecting .mailmap, see <a href="git-shortlog.html">git-shortlog(1)</a>
2818 or <a href="git-blame.html">git-blame(1)</a>)
2819</p>
2820</dd>
2821<dt class="hdlist1">
Junio C Hamano8ac8a3d2019-11-11 04:33:462822<em>%al</em>
2823</dt>
2824<dd>
2825<p>
2826author email local-part (the part before the <em>@</em> sign)
2827</p>
2828</dd>
2829<dt class="hdlist1">
2830<em>%aL</em>
2831</dt>
2832<dd>
2833<p>
2834author local-part (see <em>%al</em>) respecting .mailmap, see
2835 <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)
2836</p>
2837</dd>
2838<dt class="hdlist1">
Junio C Hamano11f15372019-03-07 03:17:002839<em>%ad</em>
2840</dt>
2841<dd>
2842<p>
2843author date (format respects --date= option)
2844</p>
2845</dd>
2846<dt class="hdlist1">
2847<em>%aD</em>
2848</dt>
2849<dd>
2850<p>
2851author date, RFC2822 style
2852</p>
2853</dd>
2854<dt class="hdlist1">
2855<em>%ar</em>
2856</dt>
2857<dd>
2858<p>
2859author date, relative
2860</p>
2861</dd>
2862<dt class="hdlist1">
2863<em>%at</em>
2864</dt>
2865<dd>
2866<p>
2867author date, UNIX timestamp
2868</p>
2869</dd>
2870<dt class="hdlist1">
2871<em>%ai</em>
2872</dt>
2873<dd>
2874<p>
2875author date, ISO 8601-like format
2876</p>
2877</dd>
2878<dt class="hdlist1">
2879<em>%aI</em>
2880</dt>
2881<dd>
2882<p>
2883author date, strict ISO 8601 format
2884</p>
2885</dd>
2886<dt class="hdlist1">
Junio C Hamanob4896852019-12-10 23:15:092887<em>%as</em>
2888</dt>
2889<dd>
2890<p>
2891author date, short format (<code>YYYY-MM-DD</code>)
2892</p>
2893</dd>
2894<dt class="hdlist1">
Junio C Hamano11f15372019-03-07 03:17:002895<em>%cn</em>
2896</dt>
2897<dd>
2898<p>
2899committer name
2900</p>
2901</dd>
2902<dt class="hdlist1">
2903<em>%cN</em>
2904</dt>
2905<dd>
2906<p>
2907committer name (respecting .mailmap, see
2908 <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)
2909</p>
2910</dd>
2911<dt class="hdlist1">
2912<em>%ce</em>
2913</dt>
2914<dd>
2915<p>
2916committer email
2917</p>
2918</dd>
2919<dt class="hdlist1">
2920<em>%cE</em>
2921</dt>
2922<dd>
2923<p>
2924committer email (respecting .mailmap, see
2925 <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)
2926</p>
2927</dd>
2928<dt class="hdlist1">
Junio C Hamano8ac8a3d2019-11-11 04:33:462929<em>%cl</em>
2930</dt>
2931<dd>
2932<p>
Junio C Hamanoa8911782020-07-07 05:35:572933committer email local-part (the part before the <em>@</em> sign)
Junio C Hamano8ac8a3d2019-11-11 04:33:462934</p>
2935</dd>
2936<dt class="hdlist1">
2937<em>%cL</em>
2938</dt>
2939<dd>
2940<p>
Junio C Hamanoa8911782020-07-07 05:35:572941committer local-part (see <em>%cl</em>) respecting .mailmap, see
Junio C Hamano8ac8a3d2019-11-11 04:33:462942 <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)
2943</p>
2944</dd>
2945<dt class="hdlist1">
Junio C Hamano11f15372019-03-07 03:17:002946<em>%cd</em>
2947</dt>
2948<dd>
2949<p>
2950committer date (format respects --date= option)
2951</p>
2952</dd>
2953<dt class="hdlist1">
2954<em>%cD</em>
2955</dt>
2956<dd>
2957<p>
2958committer date, RFC2822 style
2959</p>
2960</dd>
2961<dt class="hdlist1">
2962<em>%cr</em>
2963</dt>
2964<dd>
2965<p>
2966committer date, relative
2967</p>
2968</dd>
2969<dt class="hdlist1">
2970<em>%ct</em>
2971</dt>
2972<dd>
2973<p>
2974committer date, UNIX timestamp
2975</p>
2976</dd>
2977<dt class="hdlist1">
2978<em>%ci</em>
2979</dt>
2980<dd>
2981<p>
2982committer date, ISO 8601-like format
2983</p>
2984</dd>
2985<dt class="hdlist1">
2986<em>%cI</em>
2987</dt>
2988<dd>
2989<p>
2990committer date, strict ISO 8601 format
2991</p>
2992</dd>
2993<dt class="hdlist1">
Junio C Hamanob4896852019-12-10 23:15:092994<em>%cs</em>
2995</dt>
2996<dd>
2997<p>
2998committer date, short format (<code>YYYY-MM-DD</code>)
2999</p>
3000</dd>
3001<dt class="hdlist1">
Junio C Hamano11f15372019-03-07 03:17:003002<em>%d</em>
3003</dt>
3004<dd>
3005<p>
3006ref names, like the --decorate option of <a href="git-log.html">git-log(1)</a>
3007</p>
3008</dd>
3009<dt class="hdlist1">
3010<em>%D</em>
3011</dt>
3012<dd>
3013<p>
3014ref names without the " (", ")" wrapping.
3015</p>
3016</dd>
3017<dt class="hdlist1">
3018<em>%S</em>
3019</dt>
3020<dd>
3021<p>
3022ref name given on the command line by which the commit was reached
3023 (like <code>git log --source</code>), only works with <code>git log</code>
3024</p>
3025</dd>
3026<dt class="hdlist1">
3027<em>%e</em>
3028</dt>
3029<dd>
3030<p>
3031encoding
3032</p>
3033</dd>
3034<dt class="hdlist1">
3035<em>%s</em>
3036</dt>
3037<dd>
3038<p>
3039subject
3040</p>
3041</dd>
3042<dt class="hdlist1">
3043<em>%f</em>
3044</dt>
3045<dd>
3046<p>
3047sanitized subject line, suitable for a filename
3048</p>
3049</dd>
3050<dt class="hdlist1">
3051<em>%b</em>
3052</dt>
3053<dd>
3054<p>
3055body
3056</p>
3057</dd>
3058<dt class="hdlist1">
3059<em>%B</em>
3060</dt>
3061<dd>
3062<p>
3063raw body (unwrapped subject and body)
3064</p>
3065</dd>
3066<dt class="hdlist1">
3067<em>%N</em>
3068</dt>
3069<dd>
3070<p>
3071commit notes
3072</p>
3073</dd>
3074<dt class="hdlist1">
3075<em>%GG</em>
3076</dt>
3077<dd>
3078<p>
3079raw verification message from GPG for a signed commit
3080</p>
3081</dd>
3082<dt class="hdlist1">
3083<em>%G?</em>
3084</dt>
3085<dd>
3086<p>
3087show "G" for a good (valid) signature,
3088 "B" for a bad signature,
3089 "U" for a good signature with unknown validity,
3090 "X" for a good signature that has expired,
3091 "Y" for a good signature made by an expired key,
3092 "R" for a good signature made by a revoked key,
3093 "E" if the signature cannot be checked (e.g. missing key)
3094 and "N" for no signature
3095</p>
3096</dd>
3097<dt class="hdlist1">
3098<em>%GS</em>
3099</dt>
3100<dd>
3101<p>
3102show the name of the signer for a signed commit
3103</p>
3104</dd>
3105<dt class="hdlist1">
3106<em>%GK</em>
3107</dt>
3108<dd>
3109<p>
3110show the key used to sign a signed commit
3111</p>
3112</dd>
3113<dt class="hdlist1">
3114<em>%GF</em>
3115</dt>
3116<dd>
3117<p>
3118show the fingerprint of the key used to sign a signed commit
3119</p>
3120</dd>
3121<dt class="hdlist1">
3122<em>%GP</em>
3123</dt>
3124<dd>
3125<p>
3126show the fingerprint of the primary key whose subkey was used
3127 to sign a signed commit
3128</p>
3129</dd>
3130<dt class="hdlist1">
Junio C Hamanobee061d2020-01-30 23:21:183131<em>%GT</em>
3132</dt>
3133<dd>
3134<p>
3135show the trust level for the key used to sign a signed commit
3136</p>
3137</dd>
3138<dt class="hdlist1">
Junio C Hamano11f15372019-03-07 03:17:003139<em>%gD</em>
3140</dt>
3141<dd>
3142<p>
3143reflog selector, e.g., <code>refs/stash@{1}</code> or <code>refs/stash@{2
Junio C Hamano48cd3f12019-10-09 05:55:303144 minutes ago}</code>; the format follows the rules described for the
Junio C Hamano11f15372019-03-07 03:17:003145 <code>-g</code> option. The portion before the <code>@</code> is the refname as
3146 given on the command line (so <code>git log -g refs/heads/master</code>
3147 would yield <code>refs/heads/master@{0}</code>).
3148</p>
3149</dd>
3150<dt class="hdlist1">
3151<em>%gd</em>
3152</dt>
3153<dd>
3154<p>
3155shortened reflog selector; same as <code>%gD</code>, but the refname
3156 portion is shortened for human readability (so
3157 <code>refs/heads/master</code> becomes just <code>master</code>).
3158</p>
3159</dd>
3160<dt class="hdlist1">
3161<em>%gn</em>
3162</dt>
3163<dd>
3164<p>
3165reflog identity name
3166</p>
3167</dd>
3168<dt class="hdlist1">
3169<em>%gN</em>
3170</dt>
3171<dd>
3172<p>
3173reflog identity name (respecting .mailmap, see
3174 <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)
3175</p>
3176</dd>
3177<dt class="hdlist1">
3178<em>%ge</em>
3179</dt>
3180<dd>
3181<p>
3182reflog identity email
3183</p>
3184</dd>
3185<dt class="hdlist1">
3186<em>%gE</em>
3187</dt>
3188<dd>
3189<p>
3190reflog identity email (respecting .mailmap, see
3191 <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)
3192</p>
3193</dd>
3194<dt class="hdlist1">
3195<em>%gs</em>
3196</dt>
3197<dd>
3198<p>
3199reflog subject
3200</p>
3201</dd>
3202<dt class="hdlist1">
3203<em>%(trailers[:options])</em>
3204</dt>
3205<dd>
3206<p>
3207display the trailers of the body as
3208 interpreted by
3209 <a href="git-interpret-trailers.html">git-interpret-trailers(1)</a>. The
3210 <code>trailers</code> string may be followed by a colon
3211 and zero or more comma-separated options:
3212</p>
3213<div class="ulist"><ul>
3214<li>
3215<p>
3216<em>key=&lt;K&gt;</em>: only show trailers with specified key. Matching is done
3217 case-insensitively and trailing colon is optional. If option is
3218 given multiple times trailer lines matching any of the keys are
3219 shown. This option automatically enables the <code>only</code> option so that
3220 non-trailer lines in the trailer block are hidden. If that is not
3221 desired it can be disabled with <code>only=false</code>. E.g.,
3222 <code>%(trailers:key=Reviewed-by)</code> shows trailer lines with key
3223 <code>Reviewed-by</code>.
Junio C Hamanoa3fd83c2007-03-02 10:34:363224</p>
3225</li>
3226<li>
3227<p>
Junio C Hamano11f15372019-03-07 03:17:003228<em>only[=val]</em>: select whether non-trailer lines from the trailer
3229 block should be included. The <code>only</code> keyword may optionally be
3230 followed by an equal sign and one of <code>true</code>, <code>on</code>, <code>yes</code> to omit or
3231 <code>false</code>, <code>off</code>, <code>no</code> to show the non-trailer lines. If option is
3232 given without value it is enabled. If given multiple times the last
3233 value is used.
Junio C Hamanoa3fd83c2007-03-02 10:34:363234</p>
3235</li>
3236<li>
3237<p>
Junio C Hamano11f15372019-03-07 03:17:003238<em>separator=&lt;SEP&gt;</em>: specify a separator inserted between trailer
3239 lines. When this option is not given each trailer line is
3240 terminated with a line feed character. The string SEP may contain
3241 the literal formatting codes described above. To use comma as
3242 separator one must use <code>%x2C</code> as it would otherwise be parsed as
3243 next option. If separator option is given multiple times only the
3244 last one is used. E.g., <code>%(trailers:key=Ticket,separator=%x2C )</code>
3245 shows all trailer lines whose key is "Ticket" separated by a comma
3246 and a space.
Junio C Hamanoa3fd83c2007-03-02 10:34:363247</p>
3248</li>
3249<li>
3250<p>
Junio C Hamano11f15372019-03-07 03:17:003251<em>unfold[=val]</em>: make it behave as if interpret-trailer&#8217;s <code>--unfold</code>
3252 option was given. In same way as to for <code>only</code> it can be followed
3253 by an equal sign and explicit value. E.g.,
3254 <code>%(trailers:only,unfold=true)</code> unfolds and shows all trailer lines.
Junio C Hamanoa3fd83c2007-03-02 10:34:363255</p>
3256</li>
3257<li>
3258<p>
Junio C Hamano11f15372019-03-07 03:17:003259<em>valueonly[=val]</em>: skip over the key part of the trailer line and only
3260 show the value part. Also this optionally allows explicit value.
Junio C Hamanoa3fd83c2007-03-02 10:34:363261</p>
3262</li>
Junio C Hamano11f15372019-03-07 03:17:003263</ul></div>
3264</dd>
3265</dl></div>
Junio C Hamano04e768d2013-04-23 19:19:263266</li>
Junio C Hamanoba4b9282008-07-06 05:20:313267</ul></div>
Junio C Hamanoa3fd83c2007-03-02 10:34:363268</li>
Junio C Hamanoc21ab052009-10-31 04:03:553269</ul></div>
3270<div class="admonitionblock">
3271<table><tr>
3272<td class="icon">
3273<div class="title">Note</div>
3274</td>
3275<td class="content">Some placeholders may depend on other options given to the
Junio C Hamanoac12f0e2014-09-19 22:32:513276revision traversal engine. For example, the <code>%g*</code> reflog options will
Junio C Hamanoc21ab052009-10-31 04:03:553277insert an empty string unless we are traversing reflog entries (e.g., by
Junio C Hamano00b9f1a2014-09-29 23:11:283278<code>git log -g</code>). The <code>%d</code> and <code>%D</code> placeholders will use the "short"
3279decoration format if <code>--decorate</code> was not already provided on the command
3280line.</td>
Junio C Hamanoc21ab052009-10-31 04:03:553281</tr></table>
3282</div>
Junio C Hamanoac12f0e2014-09-19 22:32:513283<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:593284is inserted immediately before the expansion if and only if the
3285placeholder expands to a non-empty string.</p></div>
Junio C Hamano535c65c2017-06-24 22:51:583286<div class="paragraph"><p>If you add a <code>-</code> (minus sign) after <em>%</em> of a placeholder, all consecutive
3287line-feeds immediately preceding the expansion are deleted if and only if the
Junio C Hamano2bd8a742009-12-01 21:16:593288placeholder expands to an empty string.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:593289<div class="paragraph"><p>If you add a ` ` (space) after <em>%</em> of a placeholder, a space
Junio C Hamano89a57342010-06-22 23:22:553290is inserted immediately before the expansion if and only if the
3291placeholder expands to a non-empty string.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:593292<div class="ulist"><ul>
Junio C Hamano6fb124c2008-06-13 10:04:013293<li>
3294<p>
3295<em>tformat:</em>
3296</p>
Junio C Hamano68cf15a2010-11-06 01:01:593297<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:013298provides "terminator" semantics instead of "separator" semantics. In
3299other words, each commit has the message terminator character (usually a
3300newline) appended, rather than a separator placed between entries.
3301This means that the final entry of a single-line format will be properly
3302terminated with a new line, just as the "oneline" format does.
Junio C Hamanoba4b9282008-07-06 05:20:313303For example:</p></div>
Junio C Hamano6fb124c2008-06-13 10:04:013304<div class="listingblock">
3305<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:513306<pre><code>$ git log -2 --pretty=format:%h 4da45bef \
Junio C Hamano6fb124c2008-06-13 10:04:013307 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
33084da45be
33097134973 -- NO NEWLINE
3310
3311$ git log -2 --pretty=tformat:%h 4da45bef \
3312 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
33134da45be
Junio C Hamanoac12f0e2014-09-19 22:32:5133147134973</code></pre>
Junio C Hamano6fb124c2008-06-13 10:04:013315</div></div>
Junio C Hamanoac12f0e2014-09-19 22:32:513316<div class="paragraph"><p>In addition, any unrecognized string that has a <code>%</code> in it is interpreted
3317as if it has <code>tformat:</code> in front of it. For example, these two are
Junio C Hamano0a235222009-03-06 08:21:093318equivalent:</p></div>
3319<div class="listingblock">
3320<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:513321<pre><code>$ git log -2 --pretty=tformat:%h 4da45bef
3322$ git log -2 --pretty=%h 4da45bef</code></pre>
Junio C Hamano0a235222009-03-06 08:21:093323</div></div>
Junio C Hamano6fb124c2008-06-13 10:04:013324</li>
Junio C Hamanoba4b9282008-07-06 05:20:313325</ul></div>
Junio C Hamano1a4e8412005-12-27 08:17:233326</div>
Junio C Hamano9629d4f2012-12-19 00:28:273327</div>
3328<div class="sect1">
Junio C Hamano255163d2020-08-18 00:37:233329<h2 id="_diff_formatting">DIFF FORMATTING</h2>
Junio C Hamanod2c978f2011-03-20 19:42:223330<div class="sectionbody">
Junio C Hamano255163d2020-08-18 00:37:233331<div class="paragraph"><p>By default, <code>git log</code> does not generate any diff output. The options
3332below can be used to show the changes made by each commit.</p></div>
3333<div class="paragraph"><p>Note that unless one of <code>-c</code>, <code>--cc</code>, or <code>-m</code> is given, merge commits
3334will never show a diff, even if a diff format like <code>--patch</code> is
3335selected, nor will they match search options like <code>-S</code>. The exception is
3336when <code>--first-parent</code> is in use, in which merges are treated like normal
3337single-parent commits (this can be overridden by providing a
3338combined-diff option or with <code>--no-diff-merges</code>).</p></div>
3339<div class="dlist"><dl>
3340<dt class="hdlist1">
3341-c
3342</dt>
3343<dd>
3344<p>
3345 With this option, diff output for a merge commit
3346 shows the differences from each of the parents to the merge result
3347 simultaneously instead of showing pairwise diff between a parent
3348 and the result one at a time. Furthermore, it lists only files
3349 which were modified from all parents.
3350</p>
3351</dd>
3352<dt class="hdlist1">
3353--cc
3354</dt>
3355<dd>
3356<p>
3357 This flag implies the <code>-c</code> option and further compresses the
3358 patch output by omitting uninteresting hunks whose contents in
3359 the parents have only two variants and the merge result picks
3360 one of them without modification.
3361</p>
3362</dd>
3363<dt class="hdlist1">
3364--combined-all-paths
3365</dt>
3366<dd>
3367<p>
3368 This flag causes combined diffs (used for merge commits) to
3369 list the name of the file from all parents. It thus only has
3370 effect when -c or --cc are specified, and is likely only
3371 useful if filename changes are detected (i.e. when either
3372 rename or copy detection have been requested).
3373</p>
3374</dd>
3375<dt class="hdlist1">
3376-m
3377</dt>
3378<dd>
3379<p>
3380 This flag makes the merge commits show the full diff like
3381 regular commits; for each merge parent, a separate log entry
3382 and diff is generated. An exception is that only diff against
3383 the first parent is shown when <code>--first-parent</code> option is given;
3384 in that case, the output represents the changes the merge
3385 brought <em>into</em> the then-current branch.
3386</p>
3387</dd>
3388<dt class="hdlist1">
3389--diff-merges=off
3390</dt>
3391<dt class="hdlist1">
3392--no-diff-merges
3393</dt>
3394<dd>
3395<p>
3396 Disable output of diffs for merge commits (default). Useful to
3397 override <code>-m</code>, <code>-c</code>, or <code>--cc</code>.
3398</p>
3399</dd>
3400</dl></div>
Junio C Hamanod2c978f2011-03-20 19:42:223401<div class="dlist"><dl>
3402<dt class="hdlist1">
3403-p
3404</dt>
3405<dt class="hdlist1">
3406-u
3407</dt>
3408<dt class="hdlist1">
3409--patch
3410</dt>
3411<dd>
3412<p>
3413 Generate patch (see section on generating patches).
Junio C Hamanod2c978f2011-03-20 19:42:223414</p>
3415</dd>
3416<dt class="hdlist1">
Junio C Hamano58f587a2013-07-22 19:20:593417-s
3418</dt>
3419<dt class="hdlist1">
3420--no-patch
3421</dt>
3422<dd>
3423<p>
Junio C Hamanoac12f0e2014-09-19 22:32:513424 Suppress diff output. Useful for commands like <code>git show</code> that
3425 show the patch by default, or to cancel the effect of <code>--patch</code>.
Junio C Hamano58f587a2013-07-22 19:20:593426</p>
3427</dd>
3428<dt class="hdlist1">
Junio C Hamanod2c978f2011-03-20 19:42:223429-U&lt;n&gt;
3430</dt>
3431<dt class="hdlist1">
3432--unified=&lt;n&gt;
3433</dt>
3434<dd>
3435<p>
3436 Generate diffs with &lt;n&gt; lines of context instead of
Junio C Hamano11f15372019-03-07 03:17:003437 the usual three. Implies <code>--patch</code>.
Junio C Hamanoac12f0e2014-09-19 22:32:513438 Implies <code>-p</code>.
Junio C Hamanod2c978f2011-03-20 19:42:223439</p>
3440</dd>
3441<dt class="hdlist1">
Junio C Hamano11f15372019-03-07 03:17:003442--output=&lt;file&gt;
3443</dt>
3444<dd>
3445<p>
3446 Output to a specific file instead of stdout.
3447</p>
3448</dd>
3449<dt class="hdlist1">
3450--output-indicator-new=&lt;char&gt;
3451</dt>
3452<dt class="hdlist1">
3453--output-indicator-old=&lt;char&gt;
3454</dt>
3455<dt class="hdlist1">
3456--output-indicator-context=&lt;char&gt;
3457</dt>
3458<dd>
3459<p>
3460 Specify the character used to indicate new, old or context
3461 lines in the generated patch. Normally they are <em>+</em>, <em>-</em> and
3462 ' ' respectively.
3463</p>
3464</dd>
3465<dt class="hdlist1">
Junio C Hamanod2c978f2011-03-20 19:42:223466--raw
3467</dt>
3468<dd>
3469<p>
Junio C Hamano85f1fde2015-06-01 20:37:323470 For each commit, show a summary of changes using the raw diff
3471 format. See the "RAW OUTPUT FORMAT" section of
3472 <a href="git-diff.html">git-diff(1)</a>. This is different from showing the log
3473 itself in raw format, which you can achieve with
3474 <code>--format=raw</code>.
Junio C Hamanod2c978f2011-03-20 19:42:223475</p>
3476</dd>
3477<dt class="hdlist1">
3478--patch-with-raw
3479</dt>
3480<dd>
3481<p>
Junio C Hamanoac12f0e2014-09-19 22:32:513482 Synonym for <code>-p --raw</code>.
Junio C Hamanod2c978f2011-03-20 19:42:223483</p>
3484</dd>
3485<dt class="hdlist1">
Junio C Hamano255163d2020-08-18 00:37:233486-t
3487</dt>
3488<dd>
3489<p>
3490 Show the tree objects in the diff output.
3491</p>
3492</dd>
3493<dt class="hdlist1">
Junio C Hamanoad70bf02016-09-26 23:44:273494--indent-heuristic
3495</dt>
Junio C Hamanoa65b6762017-11-06 04:45:423496<dd>
3497<p>
Junio C Hamano14e66832018-06-18 18:32:193498 Enable the heuristic that shifts diff hunk boundaries to make patches
Junio C Hamanoa65b6762017-11-06 04:45:423499 easier to read. This is the default.
3500</p>
3501</dd>
Junio C Hamanoad70bf02016-09-26 23:44:273502<dt class="hdlist1">
3503--no-indent-heuristic
3504</dt>
Junio C Hamano5f888332016-06-13 19:28:313505<dd>
3506<p>
Junio C Hamanoa65b6762017-11-06 04:45:423507 Disable the indent heuristic.
Junio C Hamano5f888332016-06-13 19:28:313508</p>
3509</dd>
3510<dt class="hdlist1">
Junio C Hamano5a73f302011-10-14 05:58:343511--minimal
3512</dt>
3513<dd>
3514<p>
3515 Spend extra time to make sure the smallest possible
3516 diff is produced.
3517</p>
3518</dd>
3519<dt class="hdlist1">
Junio C Hamanod2c978f2011-03-20 19:42:223520--patience
3521</dt>
3522<dd>
3523<p>
3524 Generate a diff using the "patience diff" algorithm.
3525</p>
3526</dd>
3527<dt class="hdlist1">
Junio C Hamanoaea9e6b2012-03-07 00:17:113528--histogram
3529</dt>
3530<dd>
3531<p>
3532 Generate a diff using the "histogram diff" algorithm.
3533</p>
3534</dd>
3535<dt class="hdlist1">
Junio C Hamano047135e2017-12-19 21:57:543536--anchored=&lt;text&gt;
3537</dt>
3538<dd>
3539<p>
3540 Generate a diff using the "anchored diff" algorithm.
3541</p>
3542<div class="paragraph"><p>This option may be specified more than once.</p></div>
3543<div class="paragraph"><p>If a line exists in both the source and destination, exists only once,
3544and starts with this text, this algorithm attempts to prevent it from
3545appearing as a deletion or addition in the output. It uses the "patience
3546diff" algorithm internally.</p></div>
3547</dd>
3548<dt class="hdlist1">
Junio C Hamano80ad00d2013-02-18 00:19:033549--diff-algorithm={patience|minimal|histogram|myers}
3550</dt>
3551<dd>
3552<p>
3553 Choose a diff algorithm. The variants are as follows:
3554</p>
3555<div class="openblock">
3556<div class="content">
3557<div class="dlist"><dl>
3558<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:513559<code>default</code>, <code>myers</code>
Junio C Hamano80ad00d2013-02-18 00:19:033560</dt>
3561<dd>
3562<p>
3563 The basic greedy diff algorithm. Currently, this is the default.
3564</p>
3565</dd>
3566<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:513567<code>minimal</code>
Junio C Hamano80ad00d2013-02-18 00:19:033568</dt>
3569<dd>
3570<p>
3571 Spend extra time to make sure the smallest possible diff is
3572 produced.
3573</p>
3574</dd>
3575<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:513576<code>patience</code>
Junio C Hamano80ad00d2013-02-18 00:19:033577</dt>
3578<dd>
3579<p>
3580 Use "patience diff" algorithm when generating patches.
3581</p>
3582</dd>
3583<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:513584<code>histogram</code>
Junio C Hamano80ad00d2013-02-18 00:19:033585</dt>
3586<dd>
3587<p>
3588 This algorithm extends the patience algorithm to "support
3589 low-occurrence common elements".
3590</p>
3591</dd>
3592</dl></div>
3593</div></div>
Junio C Hamano14e66832018-06-18 18:32:193594<div class="paragraph"><p>For instance, if you configured the <code>diff.algorithm</code> variable to a
Junio C Hamano80ad00d2013-02-18 00:19:033595non-default value and want to use the default one, then you
Junio C Hamanoac12f0e2014-09-19 22:32:513596have to use <code>--diff-algorithm=default</code> option.</p></div>
Junio C Hamano80ad00d2013-02-18 00:19:033597</dd>
3598<dt class="hdlist1">
Junio C Hamano4c4b0122011-06-30 01:19:323599--stat[=&lt;width&gt;[,&lt;name-width&gt;[,&lt;count&gt;]]]
Junio C Hamanod2c978f2011-03-20 19:42:223600</dt>
3601<dd>
3602<p>
Junio C Hamanoaea9e6b2012-03-07 00:17:113603 Generate a diffstat. By default, as much space as necessary
3604 will be used for the filename part, and the rest for the graph
3605 part. Maximum width defaults to terminal width, or 80 columns
Junio C Hamano7f2b3cb2012-06-22 22:42:393606 if not connected to a terminal, and can be overridden by
Junio C Hamanoac12f0e2014-09-19 22:32:513607 <code>&lt;width&gt;</code>. The width of the filename part can be limited by
3608 giving another width <code>&lt;name-width&gt;</code> after a comma. The width
Junio C Hamanoaea9e6b2012-03-07 00:17:113609 of the graph part can be limited by using
Junio C Hamanoac12f0e2014-09-19 22:32:513610 <code>--stat-graph-width=&lt;width&gt;</code> (affects all commands generating
3611 a stat graph) or by setting <code>diff.statGraphWidth=&lt;width&gt;</code>
3612 (does not affect <code>git format-patch</code>).
3613 By giving a third parameter <code>&lt;count&gt;</code>, you can limit the
3614 output to the first <code>&lt;count&gt;</code> lines, followed by <code>...</code> if
Junio C Hamanoaea9e6b2012-03-07 00:17:113615 there are more.
Junio C Hamanod2c978f2011-03-20 19:42:223616</p>
Junio C Hamanoac12f0e2014-09-19 22:32:513617<div class="paragraph"><p>These parameters can also be set individually with <code>--stat-width=&lt;width&gt;</code>,
3618<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:223619</dd>
3620<dt class="hdlist1">
Junio C Hamano45badf02018-03-14 21:56:413621--compact-summary
3622</dt>
3623<dd>
3624<p>
3625 Output a condensed summary of extended header information such
3626 as file creations or deletions ("new" or "gone", optionally "+l"
3627 if it&#8217;s a symlink) and mode changes ("+x" or "-x" for adding
3628 or removing executable bit respectively) in diffstat. The
Junio C Hamanofa2915c2018-06-19 19:50:183629 information is put between the filename part and the graph
Junio C Hamano45badf02018-03-14 21:56:413630 part. Implies <code>--stat</code>.
3631</p>
3632</dd>
3633<dt class="hdlist1">
Junio C Hamanod2c978f2011-03-20 19:42:223634--numstat
3635</dt>
3636<dd>
3637<p>
Junio C Hamanoac12f0e2014-09-19 22:32:513638 Similar to <code>--stat</code>, but shows number of added and
Junio C Hamanod2c978f2011-03-20 19:42:223639 deleted lines in decimal notation and pathname without
3640 abbreviation, to make it more machine friendly. For
Junio C Hamanoac12f0e2014-09-19 22:32:513641 binary files, outputs two <code>-</code> instead of saying
3642 <code>0 0</code>.
Junio C Hamanod2c978f2011-03-20 19:42:223643</p>
3644</dd>
3645<dt class="hdlist1">
3646--shortstat
3647</dt>
3648<dd>
3649<p>
Junio C Hamanoac12f0e2014-09-19 22:32:513650 Output only the last line of the <code>--stat</code> format containing total
Junio C Hamanod2c978f2011-03-20 19:42:223651 number of modified files, as well as number of added and deleted
3652 lines.
3653</p>
3654</dd>
3655<dt class="hdlist1">
Junio C Hamano11f15372019-03-07 03:17:003656-X[&lt;param1,param2,&#8230;&gt;]
3657</dt>
3658<dt class="hdlist1">
Junio C Hamano1c222c52011-05-13 19:55:323659--dirstat[=&lt;param1,param2,&#8230;&gt;]
Junio C Hamanod2c978f2011-03-20 19:42:223660</dt>
3661<dd>
3662<p>
Junio C Hamano1c222c52011-05-13 19:55:323663 Output the distribution of relative amount of changes for each
Junio C Hamanoac12f0e2014-09-19 22:32:513664 sub-directory. The behavior of <code>--dirstat</code> can be customized by
Junio C Hamano1c222c52011-05-13 19:55:323665 passing it a comma separated list of parameters.
Junio C Hamanoac12f0e2014-09-19 22:32:513666 The defaults are controlled by the <code>diff.dirstat</code> configuration
Junio C Hamanoa28a9202012-06-21 07:08:233667 variable (see <a href="git-config.html">git-config(1)</a>).
Junio C Hamano1c222c52011-05-13 19:55:323668 The following parameters are available:
Junio C Hamanod2c978f2011-03-20 19:42:223669</p>
Junio C Hamano9629d4f2012-12-19 00:28:273670<div class="openblock">
3671<div class="content">
Junio C Hamano1c222c52011-05-13 19:55:323672<div class="dlist"><dl>
3673<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:513674<code>changes</code>
Junio C Hamano1c222c52011-05-13 19:55:323675</dt>
3676<dd>
3677<p>
3678 Compute the dirstat numbers by counting the lines that have been
3679 removed from the source, or added to the destination. This ignores
3680 the amount of pure code movements within a file. In other words,
3681 rearranging lines in a file is not counted as much as other changes.
3682 This is the default behavior when no parameter is given.
3683</p>
Junio C Hamanod2c978f2011-03-20 19:42:223684</dd>
3685<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:513686<code>lines</code>
Junio C Hamanod2c978f2011-03-20 19:42:223687</dt>
3688<dd>
3689<p>
Junio C Hamano1c222c52011-05-13 19:55:323690 Compute the dirstat numbers by doing the regular line-based diff
3691 analysis, and summing the removed/added line counts. (For binary
3692 files, count 64-byte chunks instead, since binary files have no
Junio C Hamanoac12f0e2014-09-19 22:32:513693 natural concept of lines). This is a more expensive <code>--dirstat</code>
3694 behavior than the <code>changes</code> behavior, but it does count rearranged
Junio C Hamano1c222c52011-05-13 19:55:323695 lines within a file as much as other changes. The resulting output
Junio C Hamanoac12f0e2014-09-19 22:32:513696 is consistent with what you get from the other <code>--*stat</code> options.
Junio C Hamanod2c978f2011-03-20 19:42:223697</p>
3698</dd>
3699<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:513700<code>files</code>
Junio C Hamano1c222c52011-05-13 19:55:323701</dt>
3702<dd>
3703<p>
3704 Compute the dirstat numbers by counting the number of files changed.
3705 Each changed file counts equally in the dirstat analysis. This is
Junio C Hamanoac12f0e2014-09-19 22:32:513706 the computationally cheapest <code>--dirstat</code> behavior, since it does
Junio C Hamano1c222c52011-05-13 19:55:323707 not have to look at the file contents at all.
3708</p>
3709</dd>
3710<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:513711<code>cumulative</code>
Junio C Hamano1c222c52011-05-13 19:55:323712</dt>
3713<dd>
3714<p>
3715 Count changes in a child directory for the parent directory as well.
Junio C Hamanoac12f0e2014-09-19 22:32:513716 Note that when using <code>cumulative</code>, the sum of the percentages
Junio C Hamano1c222c52011-05-13 19:55:323717 reported may exceed 100%. The default (non-cumulative) behavior can
Junio C Hamanoac12f0e2014-09-19 22:32:513718 be specified with the <code>noncumulative</code> parameter.
Junio C Hamano1c222c52011-05-13 19:55:323719</p>
3720</dd>
3721<dt class="hdlist1">
3722&lt;limit&gt;
3723</dt>
3724<dd>
3725<p>
3726 An integer parameter specifies a cut-off percent (3% by default).
3727 Directories contributing less than this percentage of the changes
3728 are not shown in the output.
3729</p>
3730</dd>
3731</dl></div>
Junio C Hamano9629d4f2012-12-19 00:28:273732</div></div>
Junio C Hamano1c222c52011-05-13 19:55:323733<div class="paragraph"><p>Example: The following will count changed files, while ignoring
3734directories with less than 10% of the total amount of changed files,
3735and accumulating child directory counts in the parent directories:
Junio C Hamanoac12f0e2014-09-19 22:32:513736<code>--dirstat=files,10,cumulative</code>.</p></div>
Junio C Hamano1c222c52011-05-13 19:55:323737</dd>
3738<dt class="hdlist1">
Junio C Hamano11f15372019-03-07 03:17:003739--cumulative
3740</dt>
3741<dd>
3742<p>
3743 Synonym for --dirstat=cumulative
3744</p>
3745</dd>
3746<dt class="hdlist1">
3747--dirstat-by-file[=&lt;param1,param2&gt;&#8230;]
3748</dt>
3749<dd>
3750<p>
3751 Synonym for --dirstat=files,param1,param2&#8230;
3752</p>
3753</dd>
3754<dt class="hdlist1">
Junio C Hamanod2c978f2011-03-20 19:42:223755--summary
3756</dt>
3757<dd>
3758<p>
3759 Output a condensed summary of extended header information
3760 such as creations, renames and mode changes.
3761</p>
3762</dd>
3763<dt class="hdlist1">
3764--patch-with-stat
3765</dt>
3766<dd>
3767<p>
Junio C Hamanoac12f0e2014-09-19 22:32:513768 Synonym for <code>-p --stat</code>.
Junio C Hamanod2c978f2011-03-20 19:42:223769</p>
3770</dd>
3771<dt class="hdlist1">
3772-z
3773</dt>
3774<dd>
3775<p>
3776 Separate the commits with NULs instead of with new newlines.
3777</p>
Junio C Hamanoac12f0e2014-09-19 22:32:513778<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:223779pathnames and use NULs as output field terminators.</p></div>
Junio C Hamano0f6f3bf2017-03-13 07:01:533780<div class="paragraph"><p>Without this option, pathnames with "unusual" characters are quoted as
3781explained for the configuration variable <code>core.quotePath</code> (see
3782<a href="git-config.html">git-config(1)</a>).</p></div>
Junio C Hamanod2c978f2011-03-20 19:42:223783</dd>
3784<dt class="hdlist1">
3785--name-only
3786</dt>
3787<dd>
3788<p>
3789 Show only names of changed files.
3790</p>
3791</dd>
3792<dt class="hdlist1">
3793--name-status
3794</dt>
3795<dd>
3796<p>
3797 Show only names and status of changed files. See the description
Junio C Hamanoac12f0e2014-09-19 22:32:513798 of the <code>--diff-filter</code> option on what the status letters mean.
Junio C Hamanod2c978f2011-03-20 19:42:223799</p>
3800</dd>
3801<dt class="hdlist1">
3802--submodule[=&lt;format&gt;]
3803</dt>
3804<dd>
3805<p>
Junio C Hamanocd451662016-09-13 00:54:093806 Specify how differences in submodules are shown. When specifying
3807 <code>--submodule=short</code> the <em>short</em> format is used. This format just
3808 shows the names of the commits at the beginning and end of the range.
3809 When <code>--submodule</code> or <code>--submodule=log</code> is specified, the <em>log</em>
3810 format is used. This format lists the commits in the range like
3811 <a href="git-submodule.html">git-submodule(1)</a> <code>summary</code> does. When <code>--submodule=diff</code>
3812 is specified, the <em>diff</em> format is used. This format shows an
3813 inline diff of the changes in the submodule contents between the
3814 commit range. Defaults to <code>diff.submodule</code> or the <em>short</em> format
3815 if the config option is unset.
Junio C Hamanod2c978f2011-03-20 19:42:223816</p>
3817</dd>
3818<dt class="hdlist1">
3819--color[=&lt;when&gt;]
3820</dt>
3821<dd>
3822<p>
3823 Show colored diff.
Junio C Hamanoac12f0e2014-09-19 22:32:513824 <code>--color</code> (i.e. without <em>=&lt;when&gt;</em>) is the same as <code>--color=always</code>.
3825 <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:223826</p>
3827</dd>
3828<dt class="hdlist1">
3829--no-color
3830</dt>
3831<dd>
3832<p>
Junio C Hamano5f2627d2011-05-06 20:23:483833 Turn off colored diff.
Junio C Hamanoac12f0e2014-09-19 22:32:513834 It is the same as <code>--color=never</code>.
Junio C Hamanod2c978f2011-03-20 19:42:223835</p>
3836</dd>
3837<dt class="hdlist1">
Junio C Hamanofb1fdf12017-08-27 06:14:593838--color-moved[=&lt;mode&gt;]
3839</dt>
3840<dd>
3841<p>
3842 Moved lines of code are colored differently.
3843 The &lt;mode&gt; defaults to <em>no</em> if the option is not given
3844 and to <em>zebra</em> if the option with no mode is given.
3845 The mode must be one of:
3846</p>
3847<div class="openblock">
3848<div class="content">
3849<div class="dlist"><dl>
3850<dt class="hdlist1">
3851no
3852</dt>
3853<dd>
3854<p>
3855 Moved lines are not highlighted.
3856</p>
3857</dd>
3858<dt class="hdlist1">
3859default
3860</dt>
3861<dd>
3862<p>
3863 Is a synonym for <code>zebra</code>. This may change to a more sensible mode
3864 in the future.
3865</p>
3866</dd>
3867<dt class="hdlist1">
3868plain
3869</dt>
3870<dd>
3871<p>
3872 Any line that is added in one location and was removed
3873 in another location will be colored with <em>color.diff.newMoved</em>.
3874 Similarly <em>color.diff.oldMoved</em> will be used for removed lines
3875 that are added somewhere else in the diff. This mode picks up any
3876 moved line, but it is not very useful in a review to determine
3877 if a block of code was moved without permutation.
3878</p>
3879</dd>
3880<dt class="hdlist1">
Junio C Hamanof09b7cd2018-08-02 23:01:453881blocks
Junio C Hamanofb1fdf12017-08-27 06:14:593882</dt>
3883<dd>
3884<p>
3885 Blocks of moved text of at least 20 alphanumeric characters
3886 are detected greedily. The detected blocks are
Junio C Hamanof09b7cd2018-08-02 23:01:453887 painted using either the <em>color.diff.{old,new}Moved</em> color.
3888 Adjacent blocks cannot be told apart.
3889</p>
3890</dd>
3891<dt class="hdlist1">
3892zebra
3893</dt>
3894<dd>
3895<p>
3896 Blocks of moved text are detected as in <em>blocks</em> mode. The blocks
3897 are painted using either the <em>color.diff.{old,new}Moved</em> color or
Junio C Hamanofb1fdf12017-08-27 06:14:593898 <em>color.diff.{old,new}MovedAlternative</em>. The change between
3899 the two colors indicates that a new block was detected.
3900</p>
3901</dd>
3902<dt class="hdlist1">
Junio C Hamanobfd91f42018-08-17 22:21:163903dimmed-zebra
Junio C Hamanofb1fdf12017-08-27 06:14:593904</dt>
3905<dd>
3906<p>
3907 Similar to <em>zebra</em>, but additional dimming of uninteresting parts
3908 of moved code is performed. The bordering lines of two adjacent
3909 blocks are considered interesting, the rest is uninteresting.
Junio C Hamanobfd91f42018-08-17 22:21:163910 <code>dimmed_zebra</code> is a deprecated synonym.
Junio C Hamanofb1fdf12017-08-27 06:14:593911</p>
3912</dd>
3913</dl></div>
3914</div></div>
3915</dd>
3916<dt class="hdlist1">
Junio C Hamanoa90214f2019-01-28 22:05:253917--no-color-moved
3918</dt>
3919<dd>
3920<p>
3921 Turn off move detection. This can be used to override configuration
3922 settings. It is the same as <code>--color-moved=no</code>.
3923</p>
3924</dd>
3925<dt class="hdlist1">
Junio C Hamanof09b7cd2018-08-02 23:01:453926--color-moved-ws=&lt;modes&gt;
3927</dt>
3928<dd>
3929<p>
Junio C Hamanoa90214f2019-01-28 22:05:253930 This configures how whitespace is ignored when performing the
Junio C Hamanof09b7cd2018-08-02 23:01:453931 move detection for <code>--color-moved</code>.
3932 These modes can be given as a comma separated list:
3933</p>
3934<div class="openblock">
3935<div class="content">
3936<div class="dlist"><dl>
3937<dt class="hdlist1">
Junio C Hamanoa90214f2019-01-28 22:05:253938no
3939</dt>
3940<dd>
3941<p>
3942 Do not ignore whitespace when performing move detection.
3943</p>
3944</dd>
3945<dt class="hdlist1">
Junio C Hamanof09b7cd2018-08-02 23:01:453946ignore-space-at-eol
3947</dt>
3948<dd>
3949<p>
3950 Ignore changes in whitespace at EOL.
3951</p>
3952</dd>
3953<dt class="hdlist1">
3954ignore-space-change
3955</dt>
3956<dd>
3957<p>
3958 Ignore changes in amount of whitespace. This ignores whitespace
3959 at line end, and considers all other sequences of one or
3960 more whitespace characters to be equivalent.
3961</p>
3962</dd>
3963<dt class="hdlist1">
3964ignore-all-space
3965</dt>
3966<dd>
3967<p>
3968 Ignore whitespace when comparing lines. This ignores differences
3969 even if one line has whitespace where the other line has none.
3970</p>
3971</dd>
3972<dt class="hdlist1">
3973allow-indentation-change
3974</dt>
3975<dd>
3976<p>
Junio C Hamanoa90214f2019-01-28 22:05:253977 Initially ignore any whitespace in the move detection, then
Junio C Hamanof09b7cd2018-08-02 23:01:453978 group the moved code blocks only into a block if the change in
3979 whitespace is the same per line. This is incompatible with the
3980 other modes.
3981</p>
3982</dd>
3983</dl></div>
3984</div></div>
3985</dd>
3986<dt class="hdlist1">
Junio C Hamanoa90214f2019-01-28 22:05:253987--no-color-moved-ws
3988</dt>
3989<dd>
3990<p>
3991 Do not ignore whitespace when performing move detection. This can be
3992 used to override configuration settings. It is the same as
3993 <code>--color-moved-ws=no</code>.
3994</p>
3995</dd>
3996<dt class="hdlist1">
Junio C Hamanod2c978f2011-03-20 19:42:223997--word-diff[=&lt;mode&gt;]
3998</dt>
3999<dd>
4000<p>
4001 Show a word diff, using the &lt;mode&gt; to delimit changed words.
4002 By default, words are delimited by whitespace; see
Junio C Hamanoac12f0e2014-09-19 22:32:514003 <code>--word-diff-regex</code> below. The &lt;mode&gt; defaults to <em>plain</em>, and
Junio C Hamanod2c978f2011-03-20 19:42:224004 must be one of:
4005</p>
Junio C Hamano9629d4f2012-12-19 00:28:274006<div class="openblock">
4007<div class="content">
Junio C Hamanod2c978f2011-03-20 19:42:224008<div class="dlist"><dl>
4009<dt class="hdlist1">
4010color
4011</dt>
4012<dd>
4013<p>
Junio C Hamanoac12f0e2014-09-19 22:32:514014 Highlight changed words using only colors. Implies <code>--color</code>.
Junio C Hamanod2c978f2011-03-20 19:42:224015</p>
4016</dd>
4017<dt class="hdlist1">
4018plain
4019</dt>
4020<dd>
4021<p>
Junio C Hamanoac12f0e2014-09-19 22:32:514022 Show words as <code>[-removed-]</code> and <code>{+added+}</code>. Makes no
Junio C Hamanod2c978f2011-03-20 19:42:224023 attempts to escape the delimiters if they appear in the input,
4024 so the output may be ambiguous.
4025</p>
4026</dd>
4027<dt class="hdlist1">
4028porcelain
4029</dt>
4030<dd>
4031<p>
4032 Use a special line-based format intended for script
4033 consumption. Added/removed/unchanged runs are printed in the
Junio C Hamanoac12f0e2014-09-19 22:32:514034 usual unified diff format, starting with a <code>+</code>/<code>-</code>/` `
Junio C Hamanod2c978f2011-03-20 19:42:224035 character at the beginning of the line and extending to the
4036 end of the line. Newlines in the input are represented by a
Junio C Hamanoac12f0e2014-09-19 22:32:514037 tilde <code>~</code> on a line of its own.
Junio C Hamanod2c978f2011-03-20 19:42:224038</p>
4039</dd>
4040<dt class="hdlist1">
4041none
4042</dt>
4043<dd>
4044<p>
4045 Disable word diff again.
4046</p>
4047</dd>
4048</dl></div>
Junio C Hamano9629d4f2012-12-19 00:28:274049</div></div>
Junio C Hamanod2c978f2011-03-20 19:42:224050<div class="paragraph"><p>Note that despite the name of the first mode, color is used to
4051highlight the changed parts in all modes if enabled.</p></div>
4052</dd>
4053<dt class="hdlist1">
4054--word-diff-regex=&lt;regex&gt;
4055</dt>
4056<dd>
4057<p>
4058 Use &lt;regex&gt; to decide what a word is, instead of considering
4059 runs of non-whitespace to be a word. Also implies
Junio C Hamanoac12f0e2014-09-19 22:32:514060 <code>--word-diff</code> unless it was already enabled.
Junio C Hamanod2c978f2011-03-20 19:42:224061</p>
4062<div class="paragraph"><p>Every non-overlapping match of the
4063&lt;regex&gt; is considered a word. Anything between these matches is
4064considered whitespace and ignored(!) for the purposes of finding
Junio C Hamanoac12f0e2014-09-19 22:32:514065differences. You may want to append <code>|[^[:space:]]</code> to your regular
Junio C Hamanod2c978f2011-03-20 19:42:224066expression to make sure that it matches all non-whitespace characters.
4067A match that contains a newline is silently truncated(!) at the
4068newline.</p></div>
Junio C Hamano713eded2015-12-03 00:24:024069<div class="paragraph"><p>For example, <code>--word-diff-regex=.</code> will treat each character as a word
4070and, correspondingly, show differences character by character.</p></div>
Junio C Hamanod2c978f2011-03-20 19:42:224071<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:244072<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:224073overrides any diff driver or configuration setting. Diff drivers
4074override configuration settings.</p></div>
4075</dd>
4076<dt class="hdlist1">
4077--color-words[=&lt;regex&gt;]
4078</dt>
4079<dd>
4080<p>
Junio C Hamanoac12f0e2014-09-19 22:32:514081 Equivalent to <code>--word-diff=color</code> plus (if a regex was
4082 specified) <code>--word-diff-regex=&lt;regex&gt;</code>.
Junio C Hamanod2c978f2011-03-20 19:42:224083</p>
4084</dd>
4085<dt class="hdlist1">
4086--no-renames
4087</dt>
4088<dd>
4089<p>
4090 Turn off rename detection, even when the configuration
4091 file gives the default to do so.
4092</p>
4093</dd>
4094<dt class="hdlist1">
Junio C Hamano11f15372019-03-07 03:17:004095--[no-]rename-empty
4096</dt>
4097<dd>
4098<p>
4099 Whether to use empty blobs as rename source.
4100</p>
4101</dd>
4102<dt class="hdlist1">
Junio C Hamanod2c978f2011-03-20 19:42:224103--check
4104</dt>
4105<dd>
4106<p>
Junio C Hamano84ea1e42016-04-08 21:53:484107 Warn if changes introduce conflict markers or whitespace errors.
4108 What are considered whitespace errors is controlled by <code>core.whitespace</code>
Junio C Hamano6005bfa2011-06-23 00:51:224109 configuration. By default, trailing whitespaces (including
Junio C Hamano14e66832018-06-18 18:32:194110 lines that consist solely of whitespaces) and a space character
Junio C Hamano6005bfa2011-06-23 00:51:224111 that is immediately followed by a tab character inside the
4112 initial indent of the line are considered whitespace errors.
4113 Exits with non-zero status if problems are found. Not compatible
4114 with --exit-code.
Junio C Hamanod2c978f2011-03-20 19:42:224115</p>
4116</dd>
4117<dt class="hdlist1">
Junio C Hamano8c5d5942015-06-11 19:37:484118--ws-error-highlight=&lt;kind&gt;
4119</dt>
4120<dd>
4121<p>
Junio C Hamano4b2a6c12017-08-22 18:32:374122 Highlight whitespace errors in the <code>context</code>, <code>old</code> or <code>new</code>
4123 lines of the diff. Multiple values are separated by comma,
4124 <code>none</code> resets previous values, <code>default</code> reset the list to
4125 <code>new</code> and <code>all</code> is a shorthand for <code>old,new,context</code>. When
4126 this option is not given, and the configuration variable
4127 <code>diff.wsErrorHighlight</code> is not set, only whitespace errors in
4128 <code>new</code> lines are highlighted. The whitespace errors are colored
Junio C Hamano14e66832018-06-18 18:32:194129 with <code>color.diff.whitespace</code>.
Junio C Hamano8c5d5942015-06-11 19:37:484130</p>
4131</dd>
4132<dt class="hdlist1">
Junio C Hamanod2c978f2011-03-20 19:42:224133--full-index
4134</dt>
4135<dd>
4136<p>
4137 Instead of the first handful of characters, show the full
4138 pre- and post-image blob object names on the "index"
4139 line when generating patch format output.
4140</p>
4141</dd>
4142<dt class="hdlist1">
4143--binary
4144</dt>
4145<dd>
4146<p>
Junio C Hamanoac12f0e2014-09-19 22:32:514147 In addition to <code>--full-index</code>, output a binary diff that
Junio C Hamano6b7d2152019-04-16 12:51:154148 can be applied with <code>git-apply</code>. Implies <code>--patch</code>.
Junio C Hamanod2c978f2011-03-20 19:42:224149</p>
4150</dd>
4151<dt class="hdlist1">
4152--abbrev[=&lt;n&gt;]
4153</dt>
4154<dd>
4155<p>
4156 Instead of showing the full 40-byte hexadecimal object
4157 name in diff-raw format output and diff-tree header
Junio C Hamanocf8aeaf2020-08-31 23:16:354158 lines, show only a partial prefix.
4159 In diff-patch output format, <code>--full-index</code> takes higher
4160 precedence, i.e. if <code>--full-index</code> is specified, full blob
4161 names will be shown regardless of <code>--abbrev</code>.
4162 Non default number of digits can be specified with <code>--abbrev=&lt;n&gt;</code>.
Junio C Hamanod2c978f2011-03-20 19:42:224163</p>
4164</dd>
4165<dt class="hdlist1">
4166-B[&lt;n&gt;][/&lt;m&gt;]
4167</dt>
4168<dt class="hdlist1">
4169--break-rewrites[=[&lt;n&gt;][/&lt;m&gt;]]
4170</dt>
4171<dd>
4172<p>
4173 Break complete rewrite changes into pairs of delete and
4174 create. This serves two purposes:
4175</p>
4176<div class="paragraph"><p>It affects the way a change that amounts to a total rewrite of a file
4177not as a series of deletion and insertion mixed together with a very
4178few lines that happen to match textually as the context, but as a
4179single deletion of everything old followed by a single insertion of
Junio C Hamanoac12f0e2014-09-19 22:32:514180everything new, and the number <code>m</code> controls this aspect of the -B
4181option (defaults to 60%). <code>-B/70%</code> specifies that less than 30% of the
Junio C Hamano076ffcc2013-02-06 05:13:214182original should remain in the result for Git to consider it a total
Junio C Hamanod2c978f2011-03-20 19:42:224183rewrite (i.e. otherwise the resulting patch will be a series of
4184deletion and insertion mixed together with context lines).</p></div>
4185<div class="paragraph"><p>When used with -M, a totally-rewritten file is also considered as the
4186source of a rename (usually -M only considers a file that disappeared
Junio C Hamanoac12f0e2014-09-19 22:32:514187as the source of a rename), and the number <code>n</code> controls this aspect of
4188the -B option (defaults to 50%). <code>-B20%</code> specifies that a change with
Junio C Hamanod2c978f2011-03-20 19:42:224189addition and deletion compared to 20% or more of the file&#8217;s size are
4190eligible for being picked up as a possible source of a rename to
4191another file.</p></div>
4192</dd>
4193<dt class="hdlist1">
4194-M[&lt;n&gt;]
4195</dt>
4196<dt class="hdlist1">
4197--find-renames[=&lt;n&gt;]
4198</dt>
4199<dd>
4200<p>
4201 If generating diffs, detect and report renames for each commit.
4202 For following files across renames while traversing history, see
Junio C Hamanoac12f0e2014-09-19 22:32:514203 <code>--follow</code>.
4204 If <code>n</code> is specified, it is a threshold on the similarity
Junio C Hamanod2c978f2011-03-20 19:42:224205 index (i.e. amount of addition/deletions compared to the
Junio C Hamanoac12f0e2014-09-19 22:32:514206 file&#8217;s size). For example, <code>-M90%</code> means Git should consider a
Junio C Hamanod2c978f2011-03-20 19:42:224207 delete/add pair to be a rename if more than 90% of the file
Junio C Hamanoac12f0e2014-09-19 22:32:514208 hasn&#8217;t changed. Without a <code>%</code> sign, the number is to be read as
4209 a fraction, with a decimal point before it. I.e., <code>-M5</code> becomes
4210 0.5, and is thus the same as <code>-M50%</code>. Similarly, <code>-M05</code> is
4211 the same as <code>-M5%</code>. To limit detection to exact renames, use
4212 <code>-M100%</code>. The default similarity index is 50%.
Junio C Hamanod2c978f2011-03-20 19:42:224213</p>
4214</dd>
4215<dt class="hdlist1">
4216-C[&lt;n&gt;]
4217</dt>
4218<dt class="hdlist1">
4219--find-copies[=&lt;n&gt;]
4220</dt>
4221<dd>
4222<p>
Junio C Hamanoac12f0e2014-09-19 22:32:514223 Detect copies as well as renames. See also <code>--find-copies-harder</code>.
4224 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:224225</p>
4226</dd>
4227<dt class="hdlist1">
4228--find-copies-harder
4229</dt>
4230<dd>
4231<p>
Junio C Hamanoac12f0e2014-09-19 22:32:514232 For performance reasons, by default, <code>-C</code> option finds copies only
Junio C Hamanod2c978f2011-03-20 19:42:224233 if the original file of the copy was modified in the same
4234 changeset. This flag makes the command
4235 inspect unmodified files as candidates for the source of
4236 copy. This is a very expensive operation for large
4237 projects, so use it with caution. Giving more than one
Junio C Hamanoac12f0e2014-09-19 22:32:514238 <code>-C</code> option has the same effect.
Junio C Hamanod2c978f2011-03-20 19:42:224239</p>
4240</dd>
4241<dt class="hdlist1">
Junio C Hamanob02377c2011-04-28 22:26:024242-D
4243</dt>
4244<dt class="hdlist1">
4245--irreversible-delete
4246</dt>
4247<dd>
4248<p>
4249 Omit the preimage for deletes, i.e. print only the header but not
Junio C Hamanoac12f0e2014-09-19 22:32:514250 the diff between the preimage and <code>/dev/null</code>. The resulting patch
4251 is not meant to be applied with <code>patch</code> or <code>git apply</code>; this is
Junio C Hamanob02377c2011-04-28 22:26:024252 solely for people who want to just concentrate on reviewing the
Junio C Hamanod16fd1b2017-08-04 16:41:514253 text after the change. In addition, the output obviously lacks
Junio C Hamanob02377c2011-04-28 22:26:024254 enough information to apply such a patch in reverse, even manually,
4255 hence the name of the option.
4256</p>
Junio C Hamanoac12f0e2014-09-19 22:32:514257<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:024258of a delete/create pair.</p></div>
4259</dd>
4260<dt class="hdlist1">
Junio C Hamanod2c978f2011-03-20 19:42:224261-l&lt;num&gt;
4262</dt>
4263<dd>
4264<p>
Junio C Hamanoac12f0e2014-09-19 22:32:514265 The <code>-M</code> and <code>-C</code> options require O(n^2) processing time where n
Junio C Hamanod2c978f2011-03-20 19:42:224266 is the number of potential rename/copy targets. This
4267 option prevents rename/copy detection from running if
4268 the number of rename/copy targets exceeds the specified
4269 number.
4270</p>
4271</dd>
4272<dt class="hdlist1">
4273--diff-filter=[(A|C|D|M|R|T|U|X|B)&#8230;[*]]
4274</dt>
4275<dd>
4276<p>
Junio C Hamanoac12f0e2014-09-19 22:32:514277 Select only files that are Added (<code>A</code>), Copied (<code>C</code>),
4278 Deleted (<code>D</code>), Modified (<code>M</code>), Renamed (<code>R</code>), have their
4279 type (i.e. regular file, symlink, submodule, &#8230;) changed (<code>T</code>),
4280 are Unmerged (<code>U</code>), are
4281 Unknown (<code>X</code>), or have had their pairing Broken (<code>B</code>).
Junio C Hamanod2c978f2011-03-20 19:42:224282 Any combination of the filter characters (including none) can be used.
Junio C Hamanoac12f0e2014-09-19 22:32:514283 When <code>*</code> (All-or-none) is added to the combination, all
Junio C Hamanod2c978f2011-03-20 19:42:224284 paths are selected if there is any file that matches
4285 other criteria in the comparison; if there is no file
4286 that matches other criteria, nothing is selected.
4287</p>
Junio C Hamanoeed15af2016-07-25 22:49:424288<div class="paragraph"><p>Also, these upper-case letters can be downcased to exclude. E.g.
4289<code>--diff-filter=ad</code> excludes added and deleted paths.</p></div>
Junio C Hamano3a34f152018-01-09 23:09:384290<div class="paragraph"><p>Note that not all diffs can feature all types. For instance, diffs
4291from the index to the working tree can never have Added entries
4292(because the set of paths included in the diff is limited by what is in
4293the index). Similarly, copied and renamed entries cannot appear if
4294detection for those types is disabled.</p></div>
Junio C Hamanod2c978f2011-03-20 19:42:224295</dd>
4296<dt class="hdlist1">
4297-S&lt;string&gt;
4298</dt>
4299<dd>
4300<p>
Junio C Hamanof1f5a7b2013-06-11 22:23:524301 Look for differences that change the number of occurrences of
4302 the specified string (i.e. addition/deletion) in a file.
4303 Intended for the scripter&#8217;s use.
Junio C Hamanod2c978f2011-03-20 19:42:224304</p>
Junio C Hamanof1f5a7b2013-06-11 22:23:524305<div class="paragraph"><p>It is useful when you&#8217;re looking for an exact block of code (like a
4306struct), and want to know the history of that block since it first
4307came into being: use the feature iteratively to feed the interesting
Junio C Hamanoac12f0e2014-09-19 22:32:514308block in the preimage back into <code>-S</code>, and keep going until you get the
Junio C Hamanof1f5a7b2013-06-11 22:23:524309very first version of the block.</p></div>
Junio C Hamanoace33e42019-01-18 23:16:054310<div class="paragraph"><p>Binary files are searched as well.</p></div>
Junio C Hamanod2c978f2011-03-20 19:42:224311</dd>
4312<dt class="hdlist1">
4313-G&lt;regex&gt;
4314</dt>
4315<dd>
4316<p>
Junio C Hamanof1f5a7b2013-06-11 22:23:524317 Look for differences whose patch text contains added/removed
4318 lines that match &lt;regex&gt;.
Junio C Hamanod2c978f2011-03-20 19:42:224319</p>
Junio C Hamanoac12f0e2014-09-19 22:32:514320<div class="paragraph"><p>To illustrate the difference between <code>-S&lt;regex&gt; --pickaxe-regex</code> and
4321<code>-G&lt;regex&gt;</code>, consider a commit with the following diff in the same
Junio C Hamanof1f5a7b2013-06-11 22:23:524322file:</p></div>
4323<div class="listingblock">
4324<div class="content">
Junio C Hamanob7e497f2020-02-12 21:41:374325<pre><code>+ return frotz(nitfol, two-&gt;ptr, 1, 0);
Junio C Hamanof1f5a7b2013-06-11 22:23:524326...
Junio C Hamanob7e497f2020-02-12 21:41:374327- hit = frotz(nitfol, mf2.ptr, 1, 0);</code></pre>
Junio C Hamanof1f5a7b2013-06-11 22:23:524328</div></div>
Junio C Hamanob7e497f2020-02-12 21:41:374329<div class="paragraph"><p>While <code>git log -G"frotz\(nitfol"</code> will show this commit, <code>git log
4330-S"frotz\(nitfol" --pickaxe-regex</code> will not (because the number of
Junio C Hamanof1f5a7b2013-06-11 22:23:524331occurrences of that string did not change).</p></div>
Junio C Hamanoace33e42019-01-18 23:16:054332<div class="paragraph"><p>Unless <code>--text</code> is supplied patches of binary files without a textconv
4333filter will be ignored.</p></div>
Junio C Hamanof1f5a7b2013-06-11 22:23:524334<div class="paragraph"><p>See the <em>pickaxe</em> entry in <a href="gitdiffcore.html">gitdiffcore(7)</a> for more
4335information.</p></div>
Junio C Hamanod2c978f2011-03-20 19:42:224336</dd>
4337<dt class="hdlist1">
Junio C Hamano7b9cce92018-01-23 22:34:274338--find-object=&lt;object-id&gt;
4339</dt>
4340<dd>
4341<p>
4342 Look for differences that change the number of occurrences of
4343 the specified object. Similar to <code>-S</code>, just the argument is different
4344 in that it doesn&#8217;t search for a specific string but for a specific
4345 object id.
4346</p>
4347<div class="paragraph"><p>The object can be a blob or a submodule commit. It implies the <code>-t</code> option in
4348<code>git-log</code> to also find trees.</p></div>
4349</dd>
4350<dt class="hdlist1">
Junio C Hamanod2c978f2011-03-20 19:42:224351--pickaxe-all
4352</dt>
4353<dd>
4354<p>
Junio C Hamanoac12f0e2014-09-19 22:32:514355 When <code>-S</code> or <code>-G</code> finds a change, show all the changes in that
Junio C Hamanod2c978f2011-03-20 19:42:224356 changeset, not just the files that contain the change
4357 in &lt;string&gt;.
4358</p>
4359</dd>
4360<dt class="hdlist1">
4361--pickaxe-regex
4362</dt>
4363<dd>
4364<p>
Junio C Hamanoac12f0e2014-09-19 22:32:514365 Treat the &lt;string&gt; given to <code>-S</code> as an extended POSIX regular
Junio C Hamanof1f5a7b2013-06-11 22:23:524366 expression to match.
Junio C Hamanod2c978f2011-03-20 19:42:224367</p>
4368</dd>
4369<dt class="hdlist1">
4370-O&lt;orderfile&gt;
4371</dt>
4372<dd>
4373<p>
Junio C Hamanobcd98f42017-01-24 00:12:164374 Control the order in which files appear in the output.
Junio C Hamano322c6242015-03-23 21:32:464375 This overrides the <code>diff.orderFile</code> configuration variable
4376 (see <a href="git-config.html">git-config(1)</a>). To cancel <code>diff.orderFile</code>,
Junio C Hamanoac12f0e2014-09-19 22:32:514377 use <code>-O/dev/null</code>.
Junio C Hamanod2c978f2011-03-20 19:42:224378</p>
Junio C Hamanobcd98f42017-01-24 00:12:164379<div class="paragraph"><p>The output order is determined by the order of glob patterns in
4380&lt;orderfile&gt;.
4381All files with pathnames that match the first pattern are output
4382first, all files with pathnames that match the second pattern (but not
4383the first) are output next, and so on.
4384All files with pathnames that do not match any pattern are output
4385last, as if there was an implicit match-all pattern at the end of the
4386file.
4387If multiple pathnames have the same rank (they match the same pattern
4388but no earlier patterns), their output order relative to each other is
4389the normal order.</p></div>
4390<div class="paragraph"><p>&lt;orderfile&gt; is parsed as follows:</p></div>
4391<div class="openblock">
4392<div class="content">
4393<div class="ulist"><ul>
4394<li>
4395<p>
4396Blank lines are ignored, so they can be used as separators for
4397 readability.
4398</p>
4399</li>
4400<li>
4401<p>
4402Lines starting with a hash ("<code>#</code>") are ignored, so they can be used
4403 for comments. Add a backslash ("<code>\</code>") to the beginning of the
4404 pattern if it starts with a hash.
4405</p>
4406</li>
4407<li>
4408<p>
4409Each other line contains a single pattern.
4410</p>
4411</li>
4412</ul></div>
4413</div></div>
4414<div class="paragraph"><p>Patterns have the same syntax and semantics as patterns used for
Junio C Hamano96153bf2018-04-25 08:25:344415fnmatch(3) without the FNM_PATHNAME flag, except a pathname also
Junio C Hamanobcd98f42017-01-24 00:12:164416matches a pattern if removing any number of the final pathname
4417components matches the pattern. For example, the pattern "<code>foo*bar</code>"
4418matches "<code>fooasdfbar</code>" and "<code>foo/bar/baz/asdf</code>" but not "<code>foobarx</code>".</p></div>
Junio C Hamanod2c978f2011-03-20 19:42:224419</dd>
4420<dt class="hdlist1">
4421-R
4422</dt>
4423<dd>
4424<p>
4425 Swap two inputs; that is, show differences from index or
4426 on-disk file to tree contents.
4427</p>
4428</dd>
4429<dt class="hdlist1">
4430--relative[=&lt;path&gt;]
4431</dt>
Junio C Hamano3ef9e672020-06-02 21:51:314432<dt class="hdlist1">
4433--no-relative
4434</dt>
Junio C Hamanod2c978f2011-03-20 19:42:224435<dd>
4436<p>
4437 When run from a subdirectory of the project, it can be
4438 told to exclude changes outside the directory and show
4439 pathnames relative to it with this option. When you are
4440 not in a subdirectory (e.g. in a bare repository), you
4441 can name which subdirectory to make the output relative
4442 to by giving a &lt;path&gt; as an argument.
Junio C Hamano3ef9e672020-06-02 21:51:314443 <code>--no-relative</code> can be used to countermand both <code>diff.relative</code> config
4444 option and previous <code>--relative</code>.
Junio C Hamanod2c978f2011-03-20 19:42:224445</p>
4446</dd>
4447<dt class="hdlist1">
4448-a
4449</dt>
4450<dt class="hdlist1">
4451--text
4452</dt>
4453<dd>
4454<p>
4455 Treat all files as text.
4456</p>
4457</dd>
4458<dt class="hdlist1">
Junio C Hamano4886c772017-11-27 03:33:284459--ignore-cr-at-eol
4460</dt>
4461<dd>
4462<p>
Junio C Hamano96153bf2018-04-25 08:25:344463 Ignore carriage-return at the end of line when doing a comparison.
Junio C Hamano4886c772017-11-27 03:33:284464</p>
4465</dd>
4466<dt class="hdlist1">
Junio C Hamanod2c978f2011-03-20 19:42:224467--ignore-space-at-eol
4468</dt>
4469<dd>
4470<p>
4471 Ignore changes in whitespace at EOL.
4472</p>
4473</dd>
4474<dt class="hdlist1">
4475-b
4476</dt>
4477<dt class="hdlist1">
4478--ignore-space-change
4479</dt>
4480<dd>
4481<p>
4482 Ignore changes in amount of whitespace. This ignores whitespace
4483 at line end, and considers all other sequences of one or
4484 more whitespace characters to be equivalent.
4485</p>
4486</dd>
4487<dt class="hdlist1">
4488-w
4489</dt>
4490<dt class="hdlist1">
4491--ignore-all-space
4492</dt>
4493<dd>
4494<p>
4495 Ignore whitespace when comparing lines. This ignores
4496 differences even if one line has whitespace where the other
4497 line has none.
4498</p>
4499</dd>
4500<dt class="hdlist1">
Junio C Hamanoa1952302013-07-01 21:31:184501--ignore-blank-lines
4502</dt>
4503<dd>
4504<p>
4505 Ignore changes whose lines are all blank.
4506</p>
4507</dd>
4508<dt class="hdlist1">
Junio C Hamanodf3d3cd2020-11-02 22:05:054509-I&lt;regex&gt;
4510</dt>
4511<dt class="hdlist1">
4512--ignore-matching-lines=&lt;regex&gt;
4513</dt>
4514<dd>
4515<p>
4516 Ignore changes whose all lines match &lt;regex&gt;. This option may
4517 be specified more than once.
4518</p>
4519</dd>
4520<dt class="hdlist1">
Junio C Hamanod2c978f2011-03-20 19:42:224521--inter-hunk-context=&lt;lines&gt;
4522</dt>
4523<dd>
4524<p>
4525 Show the context between diff hunks, up to the specified number
4526 of lines, thereby fusing hunks that are close to each other.
Junio C Hamanobcd98f42017-01-24 00:12:164527 Defaults to <code>diff.interHunkContext</code> or 0 if the config option
4528 is unset.
Junio C Hamanod2c978f2011-03-20 19:42:224529</p>
4530</dd>
4531<dt class="hdlist1">
Junio C Hamano11821ed2011-10-19 18:42:094532-W
4533</dt>
4534<dt class="hdlist1">
4535--function-context
4536</dt>
4537<dd>
4538<p>
4539 Show whole surrounding functions of changes.
4540</p>
4541</dd>
4542<dt class="hdlist1">
Junio C Hamanod2c978f2011-03-20 19:42:224543--ext-diff
4544</dt>
4545<dd>
4546<p>
4547 Allow an external diff helper to be executed. If you set an
Junio C Hamanoa28a9202012-06-21 07:08:234548 external diff driver with <a href="gitattributes.html">gitattributes(5)</a>, you need
4549 to use this option with <a href="git-log.html">git-log(1)</a> and friends.
Junio C Hamanod2c978f2011-03-20 19:42:224550</p>
4551</dd>
4552<dt class="hdlist1">
4553--no-ext-diff
4554</dt>
4555<dd>
4556<p>
4557 Disallow external diff drivers.
4558</p>
4559</dd>
4560<dt class="hdlist1">
Junio C Hamanoc652aed2011-07-07 01:14:314561--textconv
4562</dt>
4563<dt class="hdlist1">
4564--no-textconv
4565</dt>
4566<dd>
4567<p>
4568 Allow (or disallow) external text conversion filters to be run
Junio C Hamanoa28a9202012-06-21 07:08:234569 when comparing binary files. See <a href="gitattributes.html">gitattributes(5)</a> for
Junio C Hamanoc652aed2011-07-07 01:14:314570 details. Because textconv filters are typically a one-way
4571 conversion, the resulting diff is suitable for human
4572 consumption, but cannot be applied. For this reason, textconv
Junio C Hamanoa28a9202012-06-21 07:08:234573 filters are enabled by default only for <a href="git-diff.html">git-diff(1)</a> and
4574 <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:314575 diff plumbing commands.
4576</p>
4577</dd>
4578<dt class="hdlist1">
Junio C Hamanod2c978f2011-03-20 19:42:224579--ignore-submodules[=&lt;when&gt;]
4580</dt>
4581<dd>
4582<p>
4583 Ignore changes to submodules in the diff generation. &lt;when&gt; can be
Junio C Hamanoc7102962013-05-29 23:57:174584 either "none", "untracked", "dirty" or "all", which is the default.
Junio C Hamanod2c978f2011-03-20 19:42:224585 Using "none" will consider the submodule modified when it either contains
4586 untracked or modified files or its HEAD differs from the commit recorded
4587 in the superproject and can be used to override any settings of the
Junio C Hamanoa28a9202012-06-21 07:08:234588 <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:224589 "untracked" is used submodules are not considered dirty when they only
4590 contain untracked content (but they are still scanned for modified
4591 content). Using "dirty" ignores all changes to the work tree of submodules,
4592 only changes to the commits stored in the superproject are shown (this was
4593 the behavior until 1.7.0). Using "all" hides all changes to submodules.
4594</p>
4595</dd>
4596<dt class="hdlist1">
4597--src-prefix=&lt;prefix&gt;
4598</dt>
4599<dd>
4600<p>
4601 Show the given source prefix instead of "a/".
4602</p>
4603</dd>
4604<dt class="hdlist1">
4605--dst-prefix=&lt;prefix&gt;
4606</dt>
4607<dd>
4608<p>
4609 Show the given destination prefix instead of "b/".
4610</p>
4611</dd>
4612<dt class="hdlist1">
4613--no-prefix
4614</dt>
4615<dd>
4616<p>
4617 Do not show any source or destination prefix.
4618</p>
4619</dd>
Junio C Hamanocd451662016-09-13 00:54:094620<dt class="hdlist1">
4621--line-prefix=&lt;prefix&gt;
4622</dt>
4623<dd>
4624<p>
4625 Prepend an additional prefix to every line of output.
4626</p>
4627</dd>
Junio C Hamanof7017f12016-10-27 23:31:344628<dt class="hdlist1">
4629--ita-invisible-in-index
4630</dt>
4631<dd>
4632<p>
4633 By default entries added by "git add -N" appear as an existing
4634 empty file in "git diff" and a new file in "git diff --cached".
4635 This option makes the entry appear as a new file in "git diff"
4636 and non-existent in "git diff --cached". This option could be
4637 reverted with <code>--ita-visible-in-index</code>. Both options are
4638 experimental and could be removed in future.
4639</p>
4640</dd>
Junio C Hamanod2c978f2011-03-20 19:42:224641</dl></div>
4642<div class="paragraph"><p>For more detailed explanation on these common options, see also
Junio C Hamanoa28a9202012-06-21 07:08:234643<a href="gitdiffcore.html">gitdiffcore(7)</a>.</p></div>
Junio C Hamanod2c978f2011-03-20 19:42:224644</div>
Junio C Hamano9629d4f2012-12-19 00:28:274645</div>
4646<div class="sect1">
Junio C Hamano48cd3f12019-10-09 05:55:304647<h2 id="_generating_patch_text_with_p">Generating patch text with -p</h2>
Junio C Hamano00b8b632007-12-07 09:50:494648<div class="sectionbody">
Junio C Hamano48cd3f12019-10-09 05:55:304649<div class="paragraph"><p>Running
4650<a href="git-diff.html">git-diff(1)</a>,
4651<a href="git-log.html">git-log(1)</a>,
4652<a href="git-show.html">git-show(1)</a>,
4653<a href="git-diff-index.html">git-diff-index(1)</a>,
4654<a href="git-diff-tree.html">git-diff-tree(1)</a>, or
4655<a href="git-diff-files.html">git-diff-files(1)</a>
4656with the <code>-p</code> option produces patch text.
4657You can customize the creation of patch text via the
Junio C Hamano558abd22020-09-03 20:22:344658<code>GIT_EXTERNAL_DIFF</code> and the <code>GIT_DIFF_OPTS</code> environment variables
4659(see <a href="git.html">git(1)</a>).</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:594660<div class="paragraph"><p>What the -p option produces is slightly different from the traditional
Junio C Hamano7f9fa862010-10-19 23:51:144661diff format:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:594662<div class="olist arabic"><ol class="arabic">
Junio C Hamano00b8b632007-12-07 09:50:494663<li>
4664<p>
Junio C Hamano7f9fa862010-10-19 23:51:144665It is preceded with a "git diff" header that looks like this:
Junio C Hamano00b8b632007-12-07 09:50:494666</p>
4667<div class="literalblock">
4668<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:514669<pre><code>diff --git a/file1 b/file2</code></pre>
Junio C Hamano00b8b632007-12-07 09:50:494670</div></div>
Junio C Hamanoac12f0e2014-09-19 22:32:514671<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:494672involved. Especially, even for a creation or a deletion,
Junio C Hamanoac12f0e2014-09-19 22:32:514673<code>/dev/null</code> is <em>not</em> used in place of the <code>a/</code> or <code>b/</code> filenames.</p></div>
4674<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:494675name of the source file of the rename/copy and the name of
Junio C Hamanoba4b9282008-07-06 05:20:314676the file that rename/copy produces, respectively.</p></div>
Junio C Hamano00b8b632007-12-07 09:50:494677</li>
4678<li>
4679<p>
4680It is followed by one or more extended header lines:
4681</p>
4682<div class="literalblock">
4683<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:514684<pre><code>old mode &lt;mode&gt;
Junio C Hamano00b8b632007-12-07 09:50:494685new mode &lt;mode&gt;
4686deleted file mode &lt;mode&gt;
4687new file mode &lt;mode&gt;
4688copy from &lt;path&gt;
4689copy to &lt;path&gt;
4690rename from &lt;path&gt;
4691rename to &lt;path&gt;
4692similarity index &lt;number&gt;
4693dissimilarity index &lt;number&gt;
Junio C Hamanoac12f0e2014-09-19 22:32:514694index &lt;hash&gt;..&lt;hash&gt; &lt;mode&gt;</code></pre>
Junio C Hamano00b8b632007-12-07 09:50:494695</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:594696<div class="paragraph"><p>File modes are printed as 6-digit octal numbers including the file type
Junio C Hamano7f9fa862010-10-19 23:51:144697and file permission bits.</p></div>
Junio C Hamanoac12f0e2014-09-19 22:32:514698<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:594699<div class="paragraph"><p>The similarity index is the percentage of unchanged lines, and
Junio C Hamano7f9fa862010-10-19 23:51:144700the dissimilarity index is the percentage of changed lines. It
4701is a rounded down integer, followed by a percent sign. The
4702similarity index value of 100% is thus reserved for two equal
4703files, while 100% dissimilarity means that no line from the old
4704file made it into the new one.</p></div>
Junio C Hamano48cd3f12019-10-09 05:55:304705<div class="paragraph"><p>The index line includes the blob object names before and after the change.
Junio C Hamano7f9fa862010-10-19 23:51:144706The &lt;mode&gt; is included if the file mode does not change; otherwise,
4707separate lines indicate the old and the new mode.</p></div>
Junio C Hamano00b8b632007-12-07 09:50:494708</li>
4709<li>
4710<p>
Junio C Hamano0f6f3bf2017-03-13 07:01:534711Pathnames with "unusual" characters are quoted as explained for
4712 the configuration variable <code>core.quotePath</code> (see
4713 <a href="git-config.html">git-config(1)</a>).
Junio C Hamano00b8b632007-12-07 09:50:494714</p>
4715</li>
Junio C Hamano7f9fa862010-10-19 23:51:144716<li>
4717<p>
Junio C Hamanoac12f0e2014-09-19 22:32:514718All the <code>file1</code> files in the output refer to files before the
4719 commit, and all the <code>file2</code> files refer to files after the commit.
Junio C Hamano7f9fa862010-10-19 23:51:144720 It is incorrect to apply each change to each file sequentially. For
4721 example, this patch will swap a and b:
4722</p>
4723<div class="literalblock">
4724<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:514725<pre><code>diff --git a/a b/b
Junio C Hamano7f9fa862010-10-19 23:51:144726rename from a
4727rename to b
4728diff --git a/b b/a
4729rename from b
Junio C Hamanoac12f0e2014-09-19 22:32:514730rename to a</code></pre>
Junio C Hamano7f9fa862010-10-19 23:51:144731</div></div>
4732</li>
Junio C Hamanoba4b9282008-07-06 05:20:314733</ol></div>
Junio C Hamano00b8b632007-12-07 09:50:494734</div>
Junio C Hamano9629d4f2012-12-19 00:28:274735</div>
4736<div class="sect1">
Junio C Hamano48cd3f12019-10-09 05:55:304737<h2 id="_combined_diff_format">Combined diff format</h2>
Junio C Hamano00b8b632007-12-07 09:50:494738<div class="sectionbody">
Junio C Hamano1dbca522015-05-22 20:48:554739<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:434740produce a <em>combined diff</em> when showing a merge. This is the default
Junio C Hamanoa28a9202012-06-21 07:08:234741format when showing merges with <a href="git-diff.html">git-diff(1)</a> or
Junio C Hamano1dbca522015-05-22 20:48:554742<a href="git-show.html">git-show(1)</a>. Note also that you can give the <code>-m</code> option to any
Junio C Hamanoc5be4cc2011-03-09 07:20:434743of these commands to force generation of diffs with individual parents
4744of a merge.</p></div>
Junio C Hamano48cd3f12019-10-09 05:55:304745<div class="paragraph"><p>A "combined diff" format looks like this:</p></div>
Junio C Hamano00b8b632007-12-07 09:50:494746<div class="listingblock">
4747<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:514748<pre><code>diff --combined describe.c
Junio C Hamano00b8b632007-12-07 09:50:494749index fabadb8,cc95eb0..4866510
4750--- a/describe.c
4751+++ b/describe.c
4752@@@ -98,20 -98,12 +98,20 @@@
4753 return (a_date &gt; b_date) ? -1 : (a_date == b_date) ? 0 : 1;
4754 }
4755
4756- static void describe(char *arg)
4757 -static void describe(struct commit *cmit, int last_one)
4758++static void describe(char *arg, int last_one)
4759 {
4760 + unsigned char sha1[20];
4761 + struct commit *cmit;
4762 struct commit_list *list;
4763 static int initialized = 0;
4764 struct commit_name *n;
4765
4766 + if (get_sha1(arg, sha1) &lt; 0)
4767 + usage(describe_usage);
4768 + cmit = lookup_commit_reference(sha1);
4769 + if (!cmit)
4770 + usage(describe_usage);
4771 +
4772 if (!initialized) {
4773 initialized = 1;
Junio C Hamanoac12f0e2014-09-19 22:32:514774 for_each_ref(get_name);</code></pre>
Junio C Hamano00b8b632007-12-07 09:50:494775</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:594776<div class="olist arabic"><ol class="arabic">
Junio C Hamano00b8b632007-12-07 09:50:494777<li>
4778<p>
4779It is preceded with a "git diff" header, that looks like
Junio C Hamano48cd3f12019-10-09 05:55:304780 this (when the <code>-c</code> option is used):
Junio C Hamano00b8b632007-12-07 09:50:494781</p>
4782<div class="literalblock">
4783<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:514784<pre><code>diff --combined file</code></pre>
Junio C Hamano00b8b632007-12-07 09:50:494785</div></div>
Junio C Hamano48cd3f12019-10-09 05:55:304786<div class="paragraph"><p>or like this (when the <code>--cc</code> option is used):</p></div>
Junio C Hamano00b8b632007-12-07 09:50:494787<div class="literalblock">
4788<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:514789<pre><code>diff --cc file</code></pre>
Junio C Hamano00b8b632007-12-07 09:50:494790</div></div>
4791</li>
4792<li>
4793<p>
4794It is followed by one or more extended header lines
4795 (this example shows a merge with two parents):
4796</p>
4797<div class="literalblock">
4798<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:514799<pre><code>index &lt;hash&gt;,&lt;hash&gt;..&lt;hash&gt;
Junio C Hamano00b8b632007-12-07 09:50:494800mode &lt;mode&gt;,&lt;mode&gt;..&lt;mode&gt;
4801new file mode &lt;mode&gt;
Junio C Hamanoac12f0e2014-09-19 22:32:514802deleted file mode &lt;mode&gt;,&lt;mode&gt;</code></pre>
Junio C Hamano00b8b632007-12-07 09:50:494803</div></div>
Junio C Hamanoac12f0e2014-09-19 22:32:514804<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:494805the &lt;mode&gt; is different from the rest. Extended headers with
4806information about detected contents movement (renames and
4807copying detection) are designed to work with diff of two
Junio C Hamanoba4b9282008-07-06 05:20:314808&lt;tree-ish&gt; and are not used by combined diff format.</p></div>
Junio C Hamano00b8b632007-12-07 09:50:494809</li>
4810<li>
4811<p>
4812It is followed by two-line from-file/to-file header
4813</p>
4814<div class="literalblock">
4815<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:514816<pre><code>--- a/file
4817+++ b/file</code></pre>
Junio C Hamano00b8b632007-12-07 09:50:494818</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:594819<div class="paragraph"><p>Similar to two-line header for traditional <em>unified</em> diff
Junio C Hamanoac12f0e2014-09-19 22:32:514820format, <code>/dev/null</code> is used to signal created or deleted
Junio C Hamanoba4b9282008-07-06 05:20:314821files.</p></div>
Junio C Hamano11f15372019-03-07 03:17:004822<div class="paragraph"><p>However, if the --combined-all-paths option is provided, instead of a
4823two-line from-file/to-file you get a N+1 line from-file/to-file header,
4824where N is the number of parents in the merge commit</p></div>
4825<div class="literalblock">
4826<div class="content">
4827<pre><code>--- a/file
4828--- a/file
4829--- a/file
4830+++ b/file</code></pre>
4831</div></div>
4832<div class="paragraph"><p>This extended format can be useful if rename or copy detection is
4833active, to allow you to see the original name of the file in different
4834parents.</p></div>
Junio C Hamano00b8b632007-12-07 09:50:494835</li>
4836<li>
4837<p>
4838Chunk header format is modified to prevent people from
Junio C Hamanoac12f0e2014-09-19 22:32:514839 accidentally feeding it to <code>patch -p1</code>. Combined diff format
Junio C Hamano00b8b632007-12-07 09:50:494840 was created for review of merge commit changes, and was not
Junio C Hamano48cd3f12019-10-09 05:55:304841 meant to be applied. The change is similar to the change in the
Junio C Hamano00b8b632007-12-07 09:50:494842 extended <em>index</em> header:
4843</p>
4844<div class="literalblock">
4845<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:514846<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:494847</div></div>
Junio C Hamanoac12f0e2014-09-19 22:32:514848<div class="paragraph"><p>There are (number of parents + 1) <code>@</code> characters in the chunk
Junio C Hamanoba4b9282008-07-06 05:20:314849header for combined diff format.</p></div>
Junio C Hamano00b8b632007-12-07 09:50:494850</li>
Junio C Hamanoba4b9282008-07-06 05:20:314851</ol></div>
Junio C Hamano68cf15a2010-11-06 01:01:594852<div class="paragraph"><p>Unlike the traditional <em>unified</em> diff format, which shows two
Junio C Hamanoac12f0e2014-09-19 22:32:514853files 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
4854added to B), or <code>" "</code> (space&#8201;&#8212;&#8201;unchanged) prefix, this format
Junio C Hamano00b8b632007-12-07 09:50:494855compares two or more files file1, file2,&#8230; with one file X, and
4856shows how X differs from each of fileN. One column for each of
Junio C Hamano68cf15a2010-11-06 01:01:594857fileN is prepended to the output line to note how X&#8217;s line is
Junio C Hamanoba4b9282008-07-06 05:20:314858different from it.</p></div>
Junio C Hamanoac12f0e2014-09-19 22:32:514859<div class="paragraph"><p>A <code>-</code> character in the column N means that the line appears in
4860fileN but it does not appear in the result. A <code>+</code> character
Junio C Hamano54bf1e22008-12-20 06:30:114861in the column N means that the line appears in the result,
Junio C Hamano00b8b632007-12-07 09:50:494862and fileN does not have that line (in other words, the line was
Junio C Hamanoba4b9282008-07-06 05:20:314863added, from the point of view of that parent).</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:594864<div class="paragraph"><p>In the above example output, the function signature was changed
Junio C Hamanoac12f0e2014-09-19 22:32:514865from both files (hence two <code>-</code> removals from both file1 and
4866file2, plus <code>++</code> to mean one line that was added does not appear
Junio C Hamanod75148a2014-04-08 19:48:384867in either file1 or file2). Also eight other lines are the same
Junio C Hamanoac12f0e2014-09-19 22:32:514868from file1 but do not appear in file2 (hence prefixed with <code>+</code>).</p></div>
4869<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:494870merge commit with the merge result (i.e. file1..fileN are the
Junio C Hamanoac12f0e2014-09-19 22:32:514871parents). When shown by <code>git diff-files -c</code>, it compares the
Junio C Hamano00b8b632007-12-07 09:50:494872two unresolved merge parents with the working tree file
4873(i.e. file1 is stage 2 aka "our version", file2 is stage 3 aka
Junio C Hamanoba4b9282008-07-06 05:20:314874"their version").</p></div>
Junio C Hamano00b8b632007-12-07 09:50:494875</div>
Junio C Hamano9629d4f2012-12-19 00:28:274876</div>
4877<div class="sect1">
Junio C Hamano58f587a2013-07-22 19:20:594878<h2 id="_examples">EXAMPLES</h2>
Junio C Hamano1a4e8412005-12-27 08:17:234879<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:594880<div class="dlist"><dl>
4881<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:514882<code>git log --no-merges</code>
Junio C Hamano1a4e8412005-12-27 08:17:234883</dt>
4884<dd>
4885<p>
4886 Show the whole commit history, but skip any merges
4887</p>
4888</dd>
Junio C Hamano68cf15a2010-11-06 01:01:594889<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:514890<code>git log v2.6.12.. include/scsi drivers/scsi</code>
Junio C Hamano1a4e8412005-12-27 08:17:234891</dt>
4892<dd>
4893<p>
4894 Show all commits since version <em>v2.6.12</em> that changed any file
Junio C Hamanoac12f0e2014-09-19 22:32:514895 in the <code>include/scsi</code> or <code>drivers/scsi</code> subdirectories
Junio C Hamano1a4e8412005-12-27 08:17:234896</p>
4897</dd>
Junio C Hamano68cf15a2010-11-06 01:01:594898<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:514899<code>git log --since="2 weeks ago" -- gitk</code>
Junio C Hamano1a4e8412005-12-27 08:17:234900</dt>
4901<dd>
4902<p>
4903 Show the changes during the last two weeks to the file <em>gitk</em>.
Junio C Hamanoccb82522018-05-08 07:52:094904 The <code>--</code> is necessary to avoid confusion with the <strong>branch</strong> named
Junio C Hamano1a4e8412005-12-27 08:17:234905 <em>gitk</em>
4906</p>
4907</dd>
Junio C Hamano68cf15a2010-11-06 01:01:594908<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:514909<code>git log --name-status release..test</code>
Junio C Hamanoba7c8d82006-04-15 06:17:424910</dt>
4911<dd>
4912<p>
4913 Show the commits that are in the "test" branch but not yet
4914 in the "release" branch, along with the list of paths
4915 each commit modifies.
4916</p>
4917</dd>
Junio C Hamano68cf15a2010-11-06 01:01:594918<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:514919<code>git log --follow builtin/rev-list.c</code>
Junio C Hamano235d53f2007-07-13 00:25:154920</dt>
4921<dd>
4922<p>
Junio C Hamanoac12f0e2014-09-19 22:32:514923 Shows the commits that changed <code>builtin/rev-list.c</code>, including
Junio C Hamano235d53f2007-07-13 00:25:154924 those commits that occurred before the file was given its
4925 present name.
4926</p>
4927</dd>
Junio C Hamano68cf15a2010-11-06 01:01:594928<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:514929<code>git log --branches --not --remotes=origin</code>
Junio C Hamano57827fb2010-01-23 03:02:504930</dt>
4931<dd>
4932<p>
4933 Shows all commits that are in any of local branches but not in
Junio C Hamano97bcb482010-11-25 03:16:074934 any of remote-tracking branches for <em>origin</em> (what you have that
Junio C Hamano68cf15a2010-11-06 01:01:594935 origin doesn&#8217;t).
Junio C Hamano57827fb2010-01-23 03:02:504936</p>
4937</dd>
Junio C Hamano68cf15a2010-11-06 01:01:594938<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:514939<code>git log master --not --remotes=*/master</code>
Junio C Hamano57827fb2010-01-23 03:02:504940</dt>
4941<dd>
4942<p>
4943 Shows all commits that are in local master but not in any remote
4944 repository master branches.
4945</p>
4946</dd>
Junio C Hamano68cf15a2010-11-06 01:01:594947<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:514948<code>git log -p -m --first-parent</code>
Junio C Hamano31667362010-03-25 00:38:534949</dt>
4950<dd>
4951<p>
4952 Shows the history including change diffs, but only from the
Junio C Hamanob73af6c2013-12-03 22:07:114953 &#8220;main branch&#8221; perspective, skipping commits that come from merged
Junio C Hamano31667362010-03-25 00:38:534954 branches, and showing full diffs of changes introduced by the merges.
4955 This makes sense only when following a strict policy of merging all
4956 topic branches when staying on a single integration branch.
4957</p>
4958</dd>
Junio C Hamano693e7092012-09-12 22:56:534959<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:514960<code>git log -L '/int main/',/^}/:main.c</code>
Junio C Hamano7e590a12013-06-02 23:46:524961</dt>
4962<dd>
4963<p>
Junio C Hamanoac12f0e2014-09-19 22:32:514964 Shows how the function <code>main()</code> in the file <code>main.c</code> evolved
Junio C Hamano7e590a12013-06-02 23:46:524965 over time.
4966</p>
4967</dd>
4968<dt class="hdlist1">
Junio C Hamanoac12f0e2014-09-19 22:32:514969<code>git log -3</code>
Junio C Hamano693e7092012-09-12 22:56:534970</dt>
4971<dd>
4972<p>
4973 Limits the number of commits to show to 3.
4974</p>
4975</dd>
Junio C Hamanoba4b9282008-07-06 05:20:314976</dl></div>
Junio C Hamano1a4e8412005-12-27 08:17:234977</div>
Junio C Hamano9629d4f2012-12-19 00:28:274978</div>
4979<div class="sect1">
Junio C Hamano58f587a2013-07-22 19:20:594980<h2 id="_discussion">DISCUSSION</h2>
Junio C Hamano775a0f42006-12-31 01:19:144981<div class="sectionbody">
Junio C Hamanod7ed4042015-08-03 19:43:004982<div class="paragraph"><p>Git is to some extent character encoding agnostic.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:594983<div class="ulist"><ul>
Junio C Hamano775a0f42006-12-31 01:19:144984<li>
4985<p>
Junio C Hamano54bf1e22008-12-20 06:30:114986The contents of the blob objects are uninterpreted sequences
Junio C Hamano775a0f42006-12-31 01:19:144987 of bytes. There is no encoding translation at the core
4988 level.
4989</p>
4990</li>
4991<li>
4992<p>
Junio C Hamanod7ed4042015-08-03 19:43:004993Path names are encoded in UTF-8 normalization form C. This
4994 applies to tree objects, the index file, ref names, as well as
4995 path names in command line arguments, environment variables
4996 and config files (<code>.git/config</code> (see <a href="git-config.html">git-config(1)</a>),
4997 <a href="gitignore.html">gitignore(5)</a>, <a href="gitattributes.html">gitattributes(5)</a> and
4998 <a href="gitmodules.html">gitmodules(5)</a>).
4999</p>
5000<div class="paragraph"><p>Note that Git at the core level treats path names simply as
5001sequences of non-NUL bytes, there are no path name encoding
5002conversions (except on Mac and Windows). Therefore, using
5003non-ASCII path names will mostly work even on platforms and file
5004systems that use legacy extended ASCII encodings. However,
5005repositories created on such systems will not work properly on
5006UTF-8-based systems (e.g. Linux, Mac, Windows) and vice versa.
5007Additionally, many Git-based tools simply assume path names to
5008be UTF-8 and will fail to display other encodings correctly.</p></div>
5009</li>
5010<li>
5011<p>
5012Commit log messages are typically encoded in UTF-8, but other
5013 extended ASCII encodings are also supported. This includes
5014 ISO-8859-x, CP125x and many others, but <em>not</em> UTF-16/32,
5015 EBCDIC and CJK multi-byte encodings (GBK, Shift-JIS, Big5,
5016 EUC-x, CP9xx etc.).
Junio C Hamano775a0f42006-12-31 01:19:145017</p>
5018</li>
Junio C Hamanoba4b9282008-07-06 05:20:315019</ul></div>
Junio C Hamano68cf15a2010-11-06 01:01:595020<div class="paragraph"><p>Although we encourage that the commit log messages are encoded
Junio C Hamano076ffcc2013-02-06 05:13:215021in UTF-8, both the core and Git Porcelain are designed not to
Junio C Hamano775a0f42006-12-31 01:19:145022force UTF-8 on projects. If all participants of a particular
Junio C Hamano076ffcc2013-02-06 05:13:215023project find it more convenient to use legacy encodings, Git
Junio C Hamano775a0f42006-12-31 01:19:145024does not forbid it. However, there are a few things to keep in
Junio C Hamanoba4b9282008-07-06 05:20:315025mind.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:595026<div class="olist arabic"><ol class="arabic">
Junio C Hamano775a0f42006-12-31 01:19:145027<li>
5028<p>
Junio C Hamano1aa40d22010-01-21 17:46:435029<em>git commit</em> and <em>git commit-tree</em> issues
Junio C Hamano14b76482008-01-05 10:32:265030 a warning if the commit log message given to it does not look
Junio C Hamano775a0f42006-12-31 01:19:145031 like a valid UTF-8 string, unless you explicitly say your
5032 project uses a legacy encoding. The way to say this is to
Junio C Hamanoac12f0e2014-09-19 22:32:515033 have i18n.commitencoding in <code>.git/config</code> file, like this:
Junio C Hamano775a0f42006-12-31 01:19:145034</p>
5035<div class="listingblock">
5036<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:515037<pre><code>[i18n]
Junio C Hamanobb34c102017-07-21 22:42:285038 commitEncoding = ISO-8859-1</code></pre>
Junio C Hamano775a0f42006-12-31 01:19:145039</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:595040<div class="paragraph"><p>Commit objects created with the above setting record the value
Junio C Hamanobb34c102017-07-21 22:42:285041of <code>i18n.commitEncoding</code> in its <code>encoding</code> header. This is to
Junio C Hamano775a0f42006-12-31 01:19:145042help other people who look at them later. Lack of this header
Junio C Hamanoba4b9282008-07-06 05:20:315043implies that the commit log message is encoded in UTF-8.</p></div>
Junio C Hamano775a0f42006-12-31 01:19:145044</li>
5045<li>
5046<p>
Junio C Hamano1aa40d22010-01-21 17:46:435047<em>git log</em>, <em>git show</em>, <em>git blame</em> and friends look at the
Junio C Hamanoac12f0e2014-09-19 22:32:515048 <code>encoding</code> header of a commit object, and try to re-code the
Junio C Hamanoaa17c7c2008-11-03 04:36:585049 log message into UTF-8 unless otherwise specified. You can
Junio C Hamano775a0f42006-12-31 01:19:145050 specify the desired output encoding with
Junio C Hamanobb34c102017-07-21 22:42:285051 <code>i18n.logOutputEncoding</code> in <code>.git/config</code> file, like this:
Junio C Hamano775a0f42006-12-31 01:19:145052</p>
5053<div class="listingblock">
5054<div class="content">
Junio C Hamanoac12f0e2014-09-19 22:32:515055<pre><code>[i18n]
Junio C Hamanobb34c102017-07-21 22:42:285056 logOutputEncoding = ISO-8859-1</code></pre>
Junio C Hamano775a0f42006-12-31 01:19:145057</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:595058<div class="paragraph"><p>If you do not have this configuration variable, the value of
Junio C Hamanobb34c102017-07-21 22:42:285059<code>i18n.commitEncoding</code> is used instead.</p></div>
Junio C Hamano775a0f42006-12-31 01:19:145060</li>
Junio C Hamanoba4b9282008-07-06 05:20:315061</ol></div>
Junio C Hamano68cf15a2010-11-06 01:01:595062<div class="paragraph"><p>Note that we deliberately chose not to re-code the commit log
Junio C Hamano775a0f42006-12-31 01:19:145063message when a commit is made to force UTF-8 at the commit
5064object level, because re-coding to UTF-8 is not necessarily a
Junio C Hamanoba4b9282008-07-06 05:20:315065reversible operation.</p></div>
Junio C Hamano775a0f42006-12-31 01:19:145066</div>
Junio C Hamano9629d4f2012-12-19 00:28:275067</div>
5068<div class="sect1">
Junio C Hamano58f587a2013-07-22 19:20:595069<h2 id="_configuration">CONFIGURATION</h2>
Junio C Hamanoa574a092010-06-13 19:57:105070<div class="sectionbody">
Junio C Hamanoa28a9202012-06-21 07:08:235071<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:105072for settings related to diff generation.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:595073<div class="dlist"><dl>
5074<dt class="hdlist1">
Junio C Hamanoa574a092010-06-13 19:57:105075format.pretty
5076</dt>
5077<dd>
5078<p>
Junio C Hamanoac12f0e2014-09-19 22:32:515079 Default for the <code>--format</code> option. (See <em>Pretty Formats</em> above.)
5080 Defaults to <code>medium</code>.
Junio C Hamanoa574a092010-06-13 19:57:105081</p>
5082</dd>
Junio C Hamano68cf15a2010-11-06 01:01:595083<dt class="hdlist1">
Junio C Hamanoa574a092010-06-13 19:57:105084i18n.logOutputEncoding
5085</dt>
5086<dd>
5087<p>
Junio C Hamanob73af6c2013-12-03 22:07:115088 Encoding to use when displaying logs. (See <em>Discussion</em> above.)
Junio C Hamanoac12f0e2014-09-19 22:32:515089 Defaults to the value of <code>i18n.commitEncoding</code> if set, and UTF-8
Junio C Hamanoa574a092010-06-13 19:57:105090 otherwise.
5091</p>
5092</dd>
Junio C Hamano68cf15a2010-11-06 01:01:595093<dt class="hdlist1">
Junio C Hamanoa574a092010-06-13 19:57:105094log.date
5095</dt>
5096<dd>
5097<p>
5098 Default format for human-readable dates. (Compare the
Junio C Hamanoac12f0e2014-09-19 22:32:515099 <code>--date</code> option.) Defaults to "default", which means to write
5100 dates like <code>Sat May 8 19:35:34 2010 -0500</code>.
Junio C Hamanoa574a092010-06-13 19:57:105101</p>
Junio C Hamano23168ef2019-02-07 07:20:475102<div class="paragraph"><p>If the format is set to "auto:foo" and the pager is in use, format
5103"foo" will be the used for the date format. Otherwise "default" will
5104be used.</p></div>
Junio C Hamanoa574a092010-06-13 19:57:105105</dd>
Junio C Hamano68cf15a2010-11-06 01:01:595106<dt class="hdlist1">
Junio C Hamanod7ed4042015-08-03 19:43:005107log.follow
5108</dt>
5109<dd>
5110<p>
Junio C Hamanob0a1e832015-10-15 23:08:315111 If <code>true</code>, <code>git log</code> will act as if the <code>--follow</code> option was used when
5112 a single &lt;path&gt; is given. This has the same limitations as <code>--follow</code>,
5113 i.e. it cannot be used to follow multiple files and does not work well
5114 on non-linear history.
Junio C Hamanod7ed4042015-08-03 19:43:005115</p>
5116</dd>
5117<dt class="hdlist1">
Junio C Hamano322c6242015-03-23 21:32:465118log.showRoot
Junio C Hamanoa574a092010-06-13 19:57:105119</dt>
5120<dd>
5121<p>
Junio C Hamanoac12f0e2014-09-19 22:32:515122 If <code>false</code>, <code>git log</code> and related commands will not treat the
Junio C Hamanoa574a092010-06-13 19:57:105123 initial commit as a big creation event. Any root commits in
Junio C Hamanoac12f0e2014-09-19 22:32:515124 <code>git log -p</code> output would be shown without a diff attached.
5125 The default is <code>true</code>.
Junio C Hamanoa574a092010-06-13 19:57:105126</p>
5127</dd>
Junio C Hamano68cf15a2010-11-06 01:01:595128<dt class="hdlist1">
Junio C Hamano48931e22016-07-11 20:08:475129log.showSignature
5130</dt>
5131<dd>
5132<p>
5133 If <code>true</code>, <code>git log</code> and related commands will act as if the
5134 <code>--show-signature</code> option was passed to them.
5135</p>
5136</dd>
5137<dt class="hdlist1">
Junio C Hamanoabad6da2013-01-06 09:06:325138mailmap.*
Junio C Hamanoa574a092010-06-13 19:57:105139</dt>
5140<dd>
5141<p>
Junio C Hamanoa28a9202012-06-21 07:08:235142 See <a href="git-shortlog.html">git-shortlog(1)</a>.
Junio C Hamanoa574a092010-06-13 19:57:105143</p>
5144</dd>
Junio C Hamano68cf15a2010-11-06 01:01:595145<dt class="hdlist1">
Junio C Hamanoa574a092010-06-13 19:57:105146notes.displayRef
5147</dt>
5148<dd>
5149<p>
Junio C Hamanoac12f0e2014-09-19 22:32:515150 Which refs, in addition to the default set by <code>core.notesRef</code>
Junio C Hamano042f2142016-06-27 18:05:055151 or <code>GIT_NOTES_REF</code>, to read notes from when showing commit
Junio C Hamanoac12f0e2014-09-19 22:32:515152 messages with the <code>log</code> family of commands. See
Junio C Hamanoa28a9202012-06-21 07:08:235153 <a href="git-notes.html">git-notes(1)</a>.
Junio C Hamanoa574a092010-06-13 19:57:105154</p>
Junio C Hamano68cf15a2010-11-06 01:01:595155<div class="paragraph"><p>May be an unabbreviated ref name or a glob and may be specified
Junio C Hamanoa574a092010-06-13 19:57:105156multiple times. A warning will be issued for refs that do not exist,
5157but a glob that does not match any refs is silently ignored.</p></div>
Junio C Hamanoac12f0e2014-09-19 22:32:515158<div class="paragraph"><p>This setting can be disabled by the <code>--no-notes</code> option,
Junio C Hamano042f2142016-06-27 18:05:055159overridden by the <code>GIT_NOTES_DISPLAY_REF</code> environment variable,
Junio C Hamanoac12f0e2014-09-19 22:32:515160and overridden by the <code>--notes=&lt;ref&gt;</code> option.</p></div>
Junio C Hamanoa574a092010-06-13 19:57:105161</dd>
5162</dl></div>
5163</div>
Junio C Hamano9629d4f2012-12-19 00:28:275164</div>
5165<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:315166<h2 id="_git">GIT</h2>
Junio C Hamano1a4e8412005-12-27 08:17:235167<div class="sectionbody">
Junio C Hamanoa28a9202012-06-21 07:08:235168<div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:235169</div>
Junio C Hamano7bd050f2011-09-22 06:32:225170</div>
Junio C Hamano9629d4f2012-12-19 00:28:275171</div>
Junio C Hamano7bd050f2011-09-22 06:32:225172<div id="footnotes"><hr /></div>
Junio C Hamano1a4e8412005-12-27 08:17:235173<div id="footer">
5174<div id="footer-text">
Junio C Hamano2ef0ba32018-01-26 23:13:535175Last updated
Junio C Hamano255163d2020-08-18 00:37:235176 2020-08-17 17:32:33 PDT
Junio C Hamano1a4e8412005-12-27 08:17:235177</div>
5178</div>
5179</body>
5180</html>