blob: 3a1ee79e218fb5c80e56a69e332d00d3fd5a8aef [file] [log] [blame]
Junio C Hamano1a4e8412005-12-27 08:17:231<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
2 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
4<head>
5<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
Junio C Hamanoba4b9282008-07-06 05:20:316<meta name="generator" content="AsciiDoc 8.2.5" />
Junio C Hamano1a4e8412005-12-27 08:17:237<style type="text/css">
8/* Debug borders */
9p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {
10/*
11 border: 1px solid red;
12*/
13}
14
15body {
16 margin: 1em 5% 1em 5%;
17}
18
Junio C Hamanoba4b9282008-07-06 05:20:3119a {
20 color: blue;
21 text-decoration: underline;
22}
23a:visited {
24 color: fuchsia;
25}
Junio C Hamano1a4e8412005-12-27 08:17:2326
27em {
28 font-style: italic;
29}
30
31strong {
32 font-weight: bold;
33}
34
35tt {
36 color: navy;
37}
38
39h1, h2, h3, h4, h5, h6 {
40 color: #527bbd;
41 font-family: sans-serif;
42 margin-top: 1.2em;
43 margin-bottom: 0.5em;
44 line-height: 1.3;
45}
46
Junio C Hamanoba4b9282008-07-06 05:20:3147h1, h2, h3 {
Junio C Hamano1a4e8412005-12-27 08:17:2348 border-bottom: 2px solid silver;
49}
50h2 {
Junio C Hamano1a4e8412005-12-27 08:17:2351 padding-top: 0.5em;
52}
Junio C Hamanoba4b9282008-07-06 05:20:3153h3 {
54 float: left;
55}
56h3 + * {
57 clear: left;
58}
Junio C Hamano1a4e8412005-12-27 08:17:2359
60div.sectionbody {
61 font-family: serif;
62 margin-left: 0;
63}
64
65hr {
66 border: 1px solid silver;
67}
68
69p {
70 margin-top: 0.5em;
71 margin-bottom: 0.5em;
72}
73
74pre {
75 padding: 0;
76 margin: 0;
77}
78
79span#author {
80 color: #527bbd;
81 font-family: sans-serif;
82 font-weight: bold;
Junio C Hamanoba4b9282008-07-06 05:20:3183 font-size: 1.1em;
Junio C Hamano1a4e8412005-12-27 08:17:2384}
85span#email {
86}
87span#revision {
88 font-family: sans-serif;
89}
90
91div#footer {
92 font-family: sans-serif;
93 font-size: small;
94 border-top: 2px solid silver;
95 padding-top: 0.5em;
96 margin-top: 4.0em;
97}
98div#footer-text {
99 float: left;
100 padding-bottom: 0.5em;
101}
102div#footer-badges {
103 float: right;
104 padding-bottom: 0.5em;
105}
106
107div#preamble,
108div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
109div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
110div.admonitionblock {
111 margin-right: 10%;
112 margin-top: 1.5em;
113 margin-bottom: 1.5em;
114}
115div.admonitionblock {
116 margin-top: 2.5em;
117 margin-bottom: 2.5em;
118}
119
120div.content { /* Block element content. */
121 padding: 0;
122}
123
124/* Block element titles. */
125div.title, caption.title {
126 font-family: sans-serif;
127 font-weight: bold;
128 text-align: left;
129 margin-top: 1.0em;
130 margin-bottom: 0.5em;
131}
132div.title + * {
133 margin-top: 0;
134}
135
136td div.title:first-child {
137 margin-top: 0.0em;
138}
139div.content div.title:first-child {
140 margin-top: 0.0em;
141}
142div.content + div.title {
143 margin-top: 0.0em;
144}
145
146div.sidebarblock > div.content {
147 background: #ffffee;
148 border: 1px solid silver;
149 padding: 0.5em;
150}
151
Junio C Hamanoba4b9282008-07-06 05:20:31152div.listingblock {
153 margin-right: 0%;
154}
Junio C Hamano1a4e8412005-12-27 08:17:23155div.listingblock > div.content {
156 border: 1px solid silver;
157 background: #f4f4f4;
158 padding: 0.5em;
159}
160
161div.quoteblock > div.content {
162 padding-left: 2.0em;
163}
Junio C Hamanoba4b9282008-07-06 05:20:31164
165div.attribution {
Junio C Hamano1a4e8412005-12-27 08:17:23166 text-align: right;
167}
Junio C Hamanoba4b9282008-07-06 05:20:31168div.verseblock + div.attribution {
169 text-align: left;
170}
Junio C Hamano1a4e8412005-12-27 08:17:23171
172div.admonitionblock .icon {
173 vertical-align: top;
174 font-size: 1.1em;
175 font-weight: bold;
176 text-decoration: underline;
177 color: #527bbd;
178 padding-right: 0.5em;
179}
180div.admonitionblock td.content {
181 padding-left: 0.5em;
182 border-left: 2px solid silver;
183}
184
185div.exampleblock > div.content {
186 border-left: 2px solid silver;
187 padding: 0.5em;
188}
189
190div.verseblock div.content {
191 white-space: pre;
192}
193
194div.imageblock div.content { padding-left: 0; }
195div.imageblock img { border: 1px solid silver; }
196span.image img { border-style: none; }
197
198dl {
199 margin-top: 0.8em;
200 margin-bottom: 0.8em;
201}
202dt {
203 margin-top: 0.5em;
204 margin-bottom: 0;
205 font-style: italic;
206}
207dd > *:first-child {
208 margin-top: 0;
209}
210
211ul, ol {
212 list-style-position: outside;
213}
Junio C Hamanoba4b9282008-07-06 05:20:31214div.olist2 ol {
Junio C Hamano1a4e8412005-12-27 08:17:23215 list-style-type: lower-alpha;
216}
217
218div.tableblock > table {
Junio C Hamanoba4b9282008-07-06 05:20:31219 border: 3px solid #527bbd;
Junio C Hamano1a4e8412005-12-27 08:17:23220}
221thead {
222 font-family: sans-serif;
223 font-weight: bold;
224}
225tfoot {
226 font-weight: bold;
227}
228
229div.hlist {
230 margin-top: 0.8em;
231 margin-bottom: 0.8em;
232}
Junio C Hamanoba4b9282008-07-06 05:20:31233div.hlist td {
234 padding-bottom: 5px;
235}
Junio C Hamano1a4e8412005-12-27 08:17:23236td.hlist1 {
237 vertical-align: top;
238 font-style: italic;
239 padding-right: 0.8em;
240}
241td.hlist2 {
242 vertical-align: top;
243}
244
245@media print {
246 div#footer-badges { display: none; }
247}
Junio C Hamanoba4b9282008-07-06 05:20:31248
249div#toctitle {
250 color: #527bbd;
251 font-family: sans-serif;
252 font-size: 1.1em;
253 font-weight: bold;
254 margin-top: 1.0em;
255 margin-bottom: 0.1em;
256}
257
258div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
259 margin-top: 0;
260 margin-bottom: 0;
261}
262div.toclevel2 {
263 margin-left: 2em;
264 font-size: 0.9em;
265}
266div.toclevel3 {
267 margin-left: 4em;
268 font-size: 0.9em;
269}
270div.toclevel4 {
271 margin-left: 6em;
272 font-size: 0.9em;
273}
274include1::./stylesheets/xhtml11-manpage.css[]
Junio C Hamano1a4e8412005-12-27 08:17:23275/* Workarounds for IE6's broken and incomplete CSS2. */
276
277div.sidebar-content {
278 background: #ffffee;
279 border: 1px solid silver;
280 padding: 0.5em;
281}
282div.sidebar-title, div.image-title {
283 font-family: sans-serif;
284 font-weight: bold;
285 margin-top: 0.0em;
286 margin-bottom: 0.5em;
287}
288
289div.listingblock div.content {
290 border: 1px solid silver;
291 background: #f4f4f4;
292 padding: 0.5em;
293}
294
295div.quoteblock-content {
296 padding-left: 2.0em;
297}
298
299div.exampleblock-content {
300 border-left: 2px solid silver;
301 padding-left: 0.5em;
302}
Junio C Hamanoba4b9282008-07-06 05:20:31303
304/* IE6 sets dynamically generated links as visited. */
305div#toc a:visited { color: blue; }
Junio C Hamano1a4e8412005-12-27 08:17:23306</style>
307<title>git-log(1)</title>
308</head>
309<body>
310<div id="header">
311<h1>
312git-log(1) Manual Page
313</h1>
314<h2>NAME</h2>
315<div class="sectionbody">
316<p>git-log -
317 Show commit logs
318</p>
319</div>
320</div>
321<h2>SYNOPSIS</h2>
322<div class="sectionbody">
Junio C Hamanoa476efa2008-10-10 15:31:42323<div class="para"><p><em>git log</em> [&lt;options&gt;] [&lt;since&gt;..&lt;until&gt;] [[--] &lt;path&gt;&#8230;]</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:23324</div>
Junio C Hamanoba4b9282008-07-06 05:20:31325<h2 id="_description">DESCRIPTION</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23326<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:31327<div class="para"><p>Shows the commit logs.</p></div>
Junio C Hamano1aa40d22010-01-21 17:46:43328<div class="para"><p>The command takes options applicable to the <em>git rev-list</em>
Junio C Hamanoba7c8d82006-04-15 06:17:42329command to control what is shown and how, and options applicable to
Junio C Hamano1aa40d22010-01-21 17:46:43330the <em>git diff-*</em> commands to control how the changes
Junio C Hamanoba4b9282008-07-06 05:20:31331each commit introduces are shown.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:23332</div>
Junio C Hamanoba4b9282008-07-06 05:20:31333<h2 id="_options">OPTIONS</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23334<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:31335<div class="vlist"><dl>
Junio C Hamano1a4e8412005-12-27 08:17:23336<dt>
Junio C Hamano78e3a782010-07-15 22:24:45337-&lt;n&gt;
338</dt>
339<dd>
340<p>
341 Limits the number of commits to show.
342</p>
343</dd>
344<dt>
345&lt;since&gt;..&lt;until&gt;
346</dt>
347<dd>
348<p>
349 Show only commits between the named two commits. When
350 either &lt;since&gt; or &lt;until&gt; is omitted, it defaults to
351 <tt>HEAD</tt>, i.e. the tip of the current branch.
352 For a more complete list of ways to spell &lt;since&gt;
353 and &lt;until&gt;, see <a href="gitrevisions.html">gitrevisions(1)</a>.
354</p>
355</dd>
356<dt>
357--follow
358</dt>
359<dd>
360<p>
361 Continue listing the history of a file beyond renames
362 (works only for a single file).
363</p>
364</dd>
365<dt>
366--no-decorate
367</dt>
368<dt>
369--decorate[=short|full|no]
370</dt>
371<dd>
372<p>
373 Print out the ref names of any commits that are shown. If <em>short</em> is
374 specified, the ref name prefixes <em>refs/heads/</em>, <em>refs/tags/</em> and
375 <em>refs/remotes/</em> will not be printed. If <em>full</em> is specified, the
376 full ref name (including prefix) will be printed. The default option
377 is <em>short</em>.
378</p>
379</dd>
380<dt>
381--source
382</dt>
383<dd>
384<p>
385 Print out the ref name given on the command line by which each
386 commit was reached.
387</p>
388</dd>
389<dt>
390--full-diff
391</dt>
392<dd>
393<p>
394 Without this flag, "git log -p &lt;path&gt;&#8230;" shows commits that
395 touch the specified paths, and diffs about the same specified
396 paths. With this, the full diff is shown for commits that touch
397 the specified paths; this means that "&lt;path&gt;&#8230;" limits only
398 commits, and doesn't limit diff for those commits.
399</p>
400</dd>
401<dt>
402--log-size
403</dt>
404<dd>
405<p>
406 Before the log message print out its size in bytes. Intended
407 mainly for porcelain tools consumption. If git is unable to
408 produce a valid value size is set to zero.
409 Note that only message is considered, if also a diff is shown
410 its size is not included.
411</p>
412</dd>
413<dt>
414[--] &lt;path&gt;&#8230;
415</dt>
416<dd>
417<p>
418 Show only commits that affect any of the specified paths. To
419 prevent confusion with options and branch names, paths may need
420 to be prefixed with "-- " to separate them from options or
421 refnames.
422</p>
423</dd>
424</dl></div>
425<h3 id="_common_diff_options">Common diff options</h3><div style="clear:left"></div>
426<div class="vlist"><dl>
427<dt>
Junio C Hamano00b8b632007-12-07 09:50:49428-p
429</dt>
Junio C Hamanobbbb8652008-12-29 10:34:22430<dt>
431-u
432</dt>
Junio C Hamanoe97d5772010-05-19 08:13:58433<dt>
434--patch
435</dt>
Junio C Hamano00b8b632007-12-07 09:50:49436<dd>
437<p>
438 Generate patch (see section on generating patches).
439
440</p>
441</dd>
442<dt>
Junio C Hamano00b8b632007-12-07 09:50:49443-U&lt;n&gt;
444</dt>
Junio C Hamano00b8b632007-12-07 09:50:49445<dt>
446--unified=&lt;n&gt;
447</dt>
448<dd>
449<p>
450 Generate diffs with &lt;n&gt; lines of context instead of
Junio C Hamano3b70d3c2009-11-21 17:37:37451 the usual three.
452 Implies <tt>-p</tt>.
Junio C Hamano00b8b632007-12-07 09:50:49453</p>
454</dd>
455<dt>
456--raw
457</dt>
458<dd>
459<p>
460 Generate the raw format.
461
462</p>
463</dd>
464<dt>
465--patch-with-raw
466</dt>
467<dd>
468<p>
Junio C Hamano3b70d3c2009-11-21 17:37:37469 Synonym for <tt>-p --raw</tt>.
Junio C Hamano00b8b632007-12-07 09:50:49470</p>
471</dd>
Junio C Hamano20d47e32009-01-26 06:36:02472<dt>
473--patience
474</dt>
475<dd>
476<p>
477 Generate a diff using the "patience diff" algorithm.
478</p>
479</dd>
Junio C Hamano00b8b632007-12-07 09:50:49480<dt>
481--stat[=width[,name-width]]
482</dt>
483<dd>
484<p>
485 Generate a diffstat. You can override the default
Junio C Hamano3b70d3c2009-11-21 17:37:37486 output width for 80-column terminal by <tt>--stat=width</tt>.
Junio C Hamano00b8b632007-12-07 09:50:49487 The width of the filename part can be controlled by
488 giving another width to it separated by a comma.
489</p>
490</dd>
491<dt>
492--numstat
493</dt>
494<dd>
495<p>
Junio C Hamano3b70d3c2009-11-21 17:37:37496 Similar to <tt>--stat</tt>, but shows number of added and
Junio C Hamano00b8b632007-12-07 09:50:49497 deleted lines in decimal notation and pathname without
498 abbreviation, to make it more machine friendly. For
499 binary files, outputs two <tt>-</tt> instead of saying
500 <tt>0 0</tt>.
501</p>
502</dd>
503<dt>
504--shortstat
505</dt>
506<dd>
507<p>
Junio C Hamano3b70d3c2009-11-21 17:37:37508 Output only the last line of the <tt>--stat</tt> format containing total
Junio C Hamano00b8b632007-12-07 09:50:49509 number of modified files, as well as number of added and deleted
510 lines.
511</p>
512</dd>
513<dt>
Junio C Hamano6a45be92008-04-22 08:19:03514--dirstat[=limit]
515</dt>
516<dd>
517<p>
Junio C Hamanoa2f46622008-09-03 05:20:31518 Output the distribution of relative amount of changes (number of lines added or
519 removed) for each sub-directory. Directories with changes below
520 a cut-off percent (3% by default) are not shown. The cut-off percent
Junio C Hamano3b70d3c2009-11-21 17:37:37521 can be set with <tt>--dirstat=limit</tt>. Changes in a child directory is not
522 counted for the parent directory, unless <tt>--cumulative</tt> is used.
Junio C Hamano6a45be92008-04-22 08:19:03523</p>
524</dd>
525<dt>
Junio C Hamanoa476efa2008-10-10 15:31:42526--dirstat-by-file[=limit]
527</dt>
528<dd>
529<p>
Junio C Hamano3b70d3c2009-11-21 17:37:37530 Same as <tt>--dirstat</tt>, but counts changed files instead of lines.
Junio C Hamanoa476efa2008-10-10 15:31:42531</p>
532</dd>
533<dt>
Junio C Hamano00b8b632007-12-07 09:50:49534--summary
535</dt>
536<dd>
537<p>
538 Output a condensed summary of extended header information
539 such as creations, renames and mode changes.
540</p>
541</dd>
542<dt>
543--patch-with-stat
544</dt>
545<dd>
546<p>
Junio C Hamano3b70d3c2009-11-21 17:37:37547 Synonym for <tt>-p --stat</tt>.
Junio C Hamano00b8b632007-12-07 09:50:49548</p>
549</dd>
550<dt>
551-z
552</dt>
553<dd>
554<p>
Junio C Hamano5706e0b2009-11-24 10:54:16555 Separate the commits with NULs instead of with new newlines.
Junio C Hamano00b8b632007-12-07 09:50:49556</p>
Junio C Hamano5706e0b2009-11-24 10:54:16557<div class="para"><p>Also, when <tt>--raw</tt> or <tt>--numstat</tt> has been given, do not munge
558pathnames and use NULs as output field terminators.</p></div>
559<div class="para"><p>Without this option, each pathname output will have TAB, LF, double quotes,
560and backslash characters replaced with <tt>\t</tt>, <tt>\n</tt>, <tt>\"</tt>, and <tt>\\</tt>,
561respectively, and the pathname will be enclosed in double quotes if
562any of those replacements occurred.</p></div>
Junio C Hamano00b8b632007-12-07 09:50:49563</dd>
564<dt>
565--name-only
566</dt>
567<dd>
568<p>
569 Show only names of changed files.
570</p>
571</dd>
572<dt>
573--name-status
574</dt>
575<dd>
576<p>
Junio C Hamanoa9aee782008-04-23 16:09:20577 Show only names and status of changed files. See the description
578 of the <tt>--diff-filter</tt> option on what the status letters mean.
Junio C Hamano00b8b632007-12-07 09:50:49579</p>
580</dd>
581<dt>
Junio C Hamanoc21ab052009-10-31 04:03:55582--submodule[=&lt;format&gt;]
583</dt>
584<dd>
585<p>
586 Chose the output format for submodule differences. &lt;format&gt; can be one of
587 <em>short</em> and <em>log</em>. <em>short</em> just shows pairs of commit names, this format
588 is used when this option is not given. <em>log</em> is the default value for this
589 option and lists the commits in that commit range like the <em>summary</em>
590 option of <a href="git-submodule.html">git-submodule(1)</a> does.
591</p>
592</dd>
593<dt>
Junio C Hamano4aa0bcc2010-03-03 05:13:12594--color[=&lt;when&gt;]
Junio C Hamano00b8b632007-12-07 09:50:49595</dt>
596<dd>
597<p>
598 Show colored diff.
Junio C Hamano4aa0bcc2010-03-03 05:13:12599 The value must be always (the default), never, or auto.
Junio C Hamano00b8b632007-12-07 09:50:49600</p>
601</dd>
602<dt>
603--no-color
604</dt>
605<dd>
606<p>
607 Turn off colored diff, even when the configuration file
608 gives the default to color output.
Junio C Hamano4aa0bcc2010-03-03 05:13:12609 Same as <tt>--color=never</tt>.
Junio C Hamano00b8b632007-12-07 09:50:49610</p>
611</dd>
612<dt>
Junio C Hamanocc7636a2010-05-21 14:57:53613--word-diff[=&lt;mode&gt;]
Junio C Hamano00b8b632007-12-07 09:50:49614</dt>
615<dd>
616<p>
Junio C Hamanocc7636a2010-05-21 14:57:53617 Show a word diff, using the &lt;mode&gt; to delimit changed words.
618 By default, words are delimited by whitespace; see
619 <tt>--word-diff-regex</tt> below. The &lt;mode&gt; defaults to <em>plain</em>, and
620 must be one of:
Junio C Hamano00b8b632007-12-07 09:50:49621</p>
Junio C Hamanocc7636a2010-05-21 14:57:53622<div class="vlist"><dl>
623<dt>
624color
625</dt>
626<dd>
627<p>
628 Highlight changed words using only colors. Implies <tt>--color</tt>.
629</p>
630</dd>
631<dt>
632plain
633</dt>
634<dd>
635<p>
636 Show words as <tt>[-removed-]</tt> and <tt>{+added+}</tt>. Makes no
637 attempts to escape the delimiters if they appear in the input,
638 so the output may be ambiguous.
639</p>
640</dd>
641<dt>
642porcelain
643</dt>
644<dd>
645<p>
646 Use a special line-based format intended for script
647 consumption. Added/removed/unchanged runs are printed in the
648 usual unified diff format, starting with a <tt>+</tt>/<tt>-</tt>/<tt> </tt>
649 character at the beginning of the line and extending to the
650 end of the line. Newlines in the input are represented by a
651 tilde <tt>~</tt> on a line of its own.
652</p>
653</dd>
654<dt>
655none
656</dt>
657<dd>
658<p>
659 Disable word diff again.
660</p>
661</dd>
662</dl></div>
663<div class="para"><p>Note that despite the name of the first mode, color is used to
664highlight the changed parts in all modes if enabled.</p></div>
665</dd>
666<dt>
667--word-diff-regex=&lt;regex&gt;
668</dt>
669<dd>
670<p>
671 Use &lt;regex&gt; to decide what a word is, instead of considering
672 runs of non-whitespace to be a word. Also implies
673 <tt>--word-diff</tt> unless it was already enabled.
674</p>
675<div class="para"><p>Every non-overlapping match of the
Junio C Hamano20d47e32009-01-26 06:36:02676&lt;regex&gt; is considered a word. Anything between these matches is
677considered whitespace and ignored(!) for the purposes of finding
678differences. You may want to append <tt>|[^[:space:]]</tt> to your regular
679expression to make sure that it matches all non-whitespace characters.
680A match that contains a newline is silently truncated(!) at the
681newline.</p></div>
682<div class="para"><p>The regex can also be set via a diff driver or configuration option, see
683<a href="gitattributes.html">gitattributes(1)</a> or <a href="git-config.html">git-config(1)</a>. Giving it explicitly
684overrides any diff driver or configuration setting. Diff drivers
685override configuration settings.</p></div>
Junio C Hamano00b8b632007-12-07 09:50:49686</dd>
687<dt>
Junio C Hamanocc7636a2010-05-21 14:57:53688--color-words[=&lt;regex&gt;]
689</dt>
690<dd>
691<p>
692 Equivalent to <tt>--word-diff=color</tt> plus (if a regex was
693 specified) <tt>--word-diff-regex=&lt;regex&gt;</tt>.
694</p>
695</dd>
696<dt>
Junio C Hamano00b8b632007-12-07 09:50:49697--no-renames
698</dt>
699<dd>
700<p>
701 Turn off rename detection, even when the configuration
702 file gives the default to do so.
703</p>
704</dd>
705<dt>
706--check
707</dt>
708<dd>
709<p>
710 Warn if changes introduce trailing whitespace
Junio C Hamano3dac5042007-12-15 08:40:54711 or an indent that uses a space before a tab. Exits with
712 non-zero status if problems are found. Not compatible with
713 --exit-code.
Junio C Hamano00b8b632007-12-07 09:50:49714</p>
715</dd>
716<dt>
717--full-index
718</dt>
719<dd>
720<p>
Junio C Hamano5cf43ca2008-08-20 09:14:14721 Instead of the first handful of characters, show the full
722 pre- and post-image blob object names on the "index"
723 line when generating patch format output.
Junio C Hamano00b8b632007-12-07 09:50:49724</p>
725</dd>
726<dt>
727--binary
728</dt>
729<dd>
730<p>
Junio C Hamano3b70d3c2009-11-21 17:37:37731 In addition to <tt>--full-index</tt>, output a binary diff that
732 can be applied with <tt>git-apply</tt>.
Junio C Hamano00b8b632007-12-07 09:50:49733</p>
734</dd>
735<dt>
736--abbrev[=&lt;n&gt;]
737</dt>
738<dd>
739<p>
740 Instead of showing the full 40-byte hexadecimal object
741 name in diff-raw format output and diff-tree header
Junio C Hamano6efe3022009-01-13 16:47:56742 lines, show only a partial prefix. This is
Junio C Hamano3b70d3c2009-11-21 17:37:37743 independent of the <tt>--full-index</tt> option above, which controls
Junio C Hamano00b8b632007-12-07 09:50:49744 the diff-patch output format. Non default number of
Junio C Hamano3b70d3c2009-11-21 17:37:37745 digits can be specified with <tt>--abbrev=&lt;n&gt;</tt>.
Junio C Hamano00b8b632007-12-07 09:50:49746</p>
747</dd>
748<dt>
749-B
750</dt>
751<dd>
752<p>
753 Break complete rewrite changes into pairs of delete and create.
754</p>
755</dd>
756<dt>
757-M
758</dt>
759<dd>
760<p>
Junio C Hamanoa574a092010-06-13 19:57:10761 If generating diffs, detect and report renames for each commit.
762 For following files across renames while traversing history, see
763 <tt>--follow</tt>.
Junio C Hamano00b8b632007-12-07 09:50:49764</p>
765</dd>
766<dt>
767-C
768</dt>
769<dd>
770<p>
771 Detect copies as well as renames. See also <tt>--find-copies-harder</tt>.
772</p>
773</dd>
774<dt>
775--diff-filter=[ACDMRTUXB*]
776</dt>
777<dd>
778<p>
779 Select only files that are Added (<tt>A</tt>), Copied (<tt>C</tt>),
780 Deleted (<tt>D</tt>), Modified (<tt>M</tt>), Renamed (<tt>R</tt>), have their
Junio C Hamanoa2deec52008-10-18 18:58:09781 type (i.e. regular file, symlink, submodule, &#8230;) changed (<tt>T</tt>),
782 are Unmerged (<tt>U</tt>), are
Junio C Hamano00b8b632007-12-07 09:50:49783 Unknown (<tt>X</tt>), or have had their pairing Broken (<tt>B</tt>).
784 Any combination of the filter characters may be used.
785 When <tt>*</tt> (All-or-none) is added to the combination, all
786 paths are selected if there is any file that matches
787 other criteria in the comparison; if there is no file
788 that matches other criteria, nothing is selected.
789</p>
790</dd>
791<dt>
792--find-copies-harder
793</dt>
794<dd>
795<p>
796 For performance reasons, by default, <tt>-C</tt> option finds copies only
797 if the original file of the copy was modified in the same
798 changeset. This flag makes the command
799 inspect unmodified files as candidates for the source of
800 copy. This is a very expensive operation for large
801 projects, so use it with caution. Giving more than one
802 <tt>-C</tt> option has the same effect.
803</p>
804</dd>
805<dt>
806-l&lt;num&gt;
807</dt>
808<dd>
809<p>
Junio C Hamano3b70d3c2009-11-21 17:37:37810 The <tt>-M</tt> and <tt>-C</tt> options require O(n^2) processing time where n
Junio C Hamano00b8b632007-12-07 09:50:49811 is the number of potential rename/copy targets. This
812 option prevents rename/copy detection from running if
813 the number of rename/copy targets exceeds the specified
814 number.
815</p>
816</dd>
817<dt>
818-S&lt;string&gt;
819</dt>
820<dd>
821<p>
Junio C Hamano5217a272009-03-21 00:39:33822 Look for differences that introduce or remove an instance of
823 &lt;string&gt;. Note that this is different than the string simply
824 appearing in diff output; see the <em>pickaxe</em> entry in
825 <a href="gitdiffcore.html">gitdiffcore(7)</a> for more details.
Junio C Hamano00b8b632007-12-07 09:50:49826</p>
827</dd>
828<dt>
829--pickaxe-all
830</dt>
831<dd>
832<p>
Junio C Hamano3b70d3c2009-11-21 17:37:37833 When <tt>-S</tt> finds a change, show all the changes in that
Junio C Hamano00b8b632007-12-07 09:50:49834 changeset, not just the files that contain the change
835 in &lt;string&gt;.
836</p>
837</dd>
838<dt>
839--pickaxe-regex
840</dt>
841<dd>
842<p>
843 Make the &lt;string&gt; not a plain string but an extended POSIX
844 regex to match.
845</p>
846</dd>
847<dt>
848-O&lt;orderfile&gt;
849</dt>
850<dd>
851<p>
852 Output the patch in the order specified in the
853 &lt;orderfile&gt;, which has one shell glob pattern per line.
854</p>
855</dd>
856<dt>
857-R
858</dt>
859<dd>
860<p>
861 Swap two inputs; that is, show differences from index or
862 on-disk file to tree contents.
863</p>
864</dd>
865<dt>
Junio C Hamano24bc09a2008-02-28 00:27:44866--relative[=&lt;path&gt;]
867</dt>
868<dd>
869<p>
870 When run from a subdirectory of the project, it can be
871 told to exclude changes outside the directory and show
872 pathnames relative to it with this option. When you are
873 not in a subdirectory (e.g. in a bare repository), you
874 can name which subdirectory to make the output relative
875 to by giving a &lt;path&gt; as an argument.
876</p>
877</dd>
878<dt>
Junio C Hamanobbbb8652008-12-29 10:34:22879-a
880</dt>
881<dt>
Junio C Hamano00b8b632007-12-07 09:50:49882--text
883</dt>
884<dd>
885<p>
886 Treat all files as text.
887</p>
888</dd>
889<dt>
Junio C Hamano00b8b632007-12-07 09:50:49890--ignore-space-at-eol
891</dt>
892<dd>
893<p>
Junio C Hamano3a702342007-12-12 21:34:02894 Ignore changes in whitespace at EOL.
Junio C Hamano00b8b632007-12-07 09:50:49895</p>
896</dd>
897<dt>
Junio C Hamanobbbb8652008-12-29 10:34:22898-b
899</dt>
900<dt>
Junio C Hamano00b8b632007-12-07 09:50:49901--ignore-space-change
902</dt>
903<dd>
904<p>
Junio C Hamano3a702342007-12-12 21:34:02905 Ignore changes in amount of whitespace. This ignores whitespace
906 at line end, and considers all other sequences of one or
907 more whitespace characters to be equivalent.
Junio C Hamano00b8b632007-12-07 09:50:49908</p>
909</dd>
910<dt>
Junio C Hamanobbbb8652008-12-29 10:34:22911-w
Junio C Hamano00b8b632007-12-07 09:50:49912</dt>
Junio C Hamano00b8b632007-12-07 09:50:49913<dt>
914--ignore-all-space
915</dt>
916<dd>
917<p>
Junio C Hamano3a702342007-12-12 21:34:02918 Ignore whitespace when comparing lines. This ignores
919 differences even if one line has whitespace where the other
Junio C Hamano00b8b632007-12-07 09:50:49920 line has none.
921</p>
922</dd>
923<dt>
Junio C Hamano1d40ee82009-01-07 10:14:16924--inter-hunk-context=&lt;lines&gt;
925</dt>
926<dd>
927<p>
928 Show the context between diff hunks, up to the specified number
929 of lines, thereby fusing hunks that are close to each other.
930</p>
931</dd>
932<dt>
Junio C Hamano00b8b632007-12-07 09:50:49933--exit-code
934</dt>
935<dd>
936<p>
937 Make the program exit with codes similar to diff(1).
938 That is, it exits with 1 if there were differences and
939 0 means no differences.
940</p>
941</dd>
942<dt>
943--quiet
944</dt>
945<dd>
946<p>
Junio C Hamano3b70d3c2009-11-21 17:37:37947 Disable all output of the program. Implies <tt>--exit-code</tt>.
Junio C Hamano00b8b632007-12-07 09:50:49948</p>
949</dd>
950<dt>
951--ext-diff
952</dt>
953<dd>
954<p>
955 Allow an external diff helper to be executed. If you set an
956 external diff driver with <a href="gitattributes.html">gitattributes(5)</a>, you need
957 to use this option with <a href="git-log.html">git-log(1)</a> and friends.
958</p>
959</dd>
960<dt>
961--no-ext-diff
962</dt>
963<dd>
964<p>
965 Disallow external diff drivers.
966</p>
967</dd>
Junio C Hamanoe27cbd22007-12-21 17:57:33968<dt>
Junio C Hamano7d449522010-07-01 00:08:51969--ignore-submodules[=&lt;when&gt;]
Junio C Hamanodfccbb02008-05-26 01:16:14970</dt>
971<dd>
972<p>
Junio C Hamano7d449522010-07-01 00:08:51973 Ignore changes to submodules in the diff generation. &lt;when&gt; can be
974 either "untracked", "dirty" or "all", which is the default. When
975 "untracked" is used submodules are not considered dirty when they only
976 contain untracked content (but they are still scanned for modified
977 content). Using "dirty" ignores all changes to the work tree of submodules,
978 only changes to the commits stored in the superproject are shown (this was
979 the behavior until 1.7.0). Using "all" hides all changes to submodules.
Junio C Hamanodfccbb02008-05-26 01:16:14980</p>
981</dd>
982<dt>
Junio C Hamanoe27cbd22007-12-21 17:57:33983--src-prefix=&lt;prefix&gt;
984</dt>
985<dd>
986<p>
987 Show the given source prefix instead of "a/".
988</p>
989</dd>
990<dt>
991--dst-prefix=&lt;prefix&gt;
992</dt>
993<dd>
994<p>
995 Show the given destination prefix instead of "b/".
996</p>
997</dd>
998<dt>
999--no-prefix
1000</dt>
1001<dd>
1002<p>
1003 Do not show any source or destination prefix.
1004</p>
1005</dd>
Junio C Hamanoba4b9282008-07-06 05:20:311006</dl></div>
1007<div class="para"><p>For more detailed explanation on these common options, see also
1008<a href="gitdiffcore.html">gitdiffcore(7)</a>.</p></div>
Junio C Hamanoba4b9282008-07-06 05:20:311009<h3 id="_commit_formatting">Commit Formatting</h3><div style="clear:left"></div>
1010<div class="vlist"><dl>
Junio C Hamanob0e02952008-01-19 08:02:001011<dt>
1012--pretty[=<em>&lt;format&gt;</em>]
1013</dt>
Junio C Hamano0a235222009-03-06 08:21:091014<dt>
1015--format[=<em>&lt;format&gt;</em>]
1016</dt>
Junio C Hamanob0e02952008-01-19 08:02:001017<dd>
1018<p>
1019 Pretty-print the contents of the commit logs in a given format,
1020 where <em>&lt;format&gt;</em> can be one of <em>oneline</em>, <em>short</em>, <em>medium</em>,
Junio C Hamanoe32ec8b2010-06-02 23:32:311021 <em>full</em>, <em>fuller</em>, <em>email</em>, <em>raw</em> and <em>format:&lt;string&gt;</em>. See
1022 the "PRETTY FORMATS" section for some additional details for each
1023 format. When omitted, the format defaults to <em>medium</em>.
Junio C Hamanob0e02952008-01-19 08:02:001024</p>
Junio C Hamanoba4b9282008-07-06 05:20:311025<div class="para"><p>Note: you can specify the default pretty format in the repository
1026configuration (see <a href="git-config.html">git-config(1)</a>).</p></div>
Junio C Hamanob0e02952008-01-19 08:02:001027</dd>
1028<dt>
1029--abbrev-commit
1030</dt>
1031<dd>
1032<p>
1033 Instead of showing the full 40-byte hexadecimal commit object
Junio C Hamano6efe3022009-01-13 16:47:561034 name, show only a partial prefix. Non default number of
Junio C Hamanob0e02952008-01-19 08:02:001035 digits can be specified with "--abbrev=&lt;n&gt;" (which also modifies
1036 diff output, if it is displayed).
1037</p>
Junio C Hamanoba4b9282008-07-06 05:20:311038<div class="para"><p>This should make "--pretty=oneline" a whole lot more readable for
1039people using 80-column terminals.</p></div>
Junio C Hamanob0e02952008-01-19 08:02:001040</dd>
1041<dt>
Junio C Hamano0a235222009-03-06 08:21:091042--oneline
1043</dt>
1044<dd>
1045<p>
1046 This is a shorthand for "--pretty=oneline --abbrev-commit"
1047 used together.
1048</p>
1049</dd>
1050<dt>
Junio C Hamanob0e02952008-01-19 08:02:001051--encoding[=&lt;encoding&gt;]
1052</dt>
1053<dd>
1054<p>
1055 The commit objects record the encoding used for the log message
1056 in their encoding header; this option can be used to tell the
1057 command to re-code the commit log message in the encoding
1058 preferred by the user. For non plumbing commands this
1059 defaults to UTF-8.
1060</p>
1061</dd>
1062<dt>
Junio C Hamano57827fb2010-01-23 03:02:501063--no-notes
1064</dt>
1065<dt>
Junio C Hamano31667362010-03-25 00:38:531066--show-notes[=&lt;ref&gt;]
Junio C Hamano57827fb2010-01-23 03:02:501067</dt>
1068<dd>
1069<p>
1070 Show the notes (see <a href="git-notes.html">git-notes(1)</a>) that annotate the
1071 commit, when showing the commit log message. This is the default
1072 for <tt>git log</tt>, <tt>git show</tt> and <tt>git whatchanged</tt> commands when
1073 there is no <tt>--pretty</tt>, <tt>--format</tt> nor <tt>--oneline</tt> option is
1074 given on the command line.
1075</p>
Junio C Hamano31667362010-03-25 00:38:531076<div class="para"><p>With an optional argument, add this ref to the list of notes. The ref
1077is taken to be in <tt>refs/notes/</tt> if it is not qualified.</p></div>
1078</dd>
1079<dt>
1080--[no-]standard-notes
1081</dt>
1082<dd>
1083<p>
1084 Enable or disable populating the notes ref list from the
1085 <em>core.notesRef</em> and <em>notes.displayRef</em> variables (or
1086 corresponding environment overrides). Enabled by default.
1087 See <a href="git-config.html">git-config(1)</a>.
1088</p>
Junio C Hamano57827fb2010-01-23 03:02:501089</dd>
1090<dt>
Junio C Hamanob0e02952008-01-19 08:02:001091--relative-date
1092</dt>
1093<dd>
1094<p>
1095 Synonym for <tt>--date=relative</tt>.
1096</p>
1097</dd>
1098<dt>
Junio C Hamanobb653132009-02-22 08:09:351099--date={relative,local,default,iso,rfc,short,raw}
Junio C Hamanob0e02952008-01-19 08:02:001100</dt>
1101<dd>
1102<p>
1103 Only takes effect for dates shown in human-readable format, such
Junio C Hamanob713ff12008-05-24 01:12:301104 as when using "--pretty". <tt>log.date</tt> config variable sets a default
1105 value for log command's --date option.
Junio C Hamanob0e02952008-01-19 08:02:001106</p>
Junio C Hamanoba4b9282008-07-06 05:20:311107<div class="para"><p><tt>--date=relative</tt> shows dates relative to the current time,
1108e.g. "2 hours ago".</p></div>
1109<div class="para"><p><tt>--date=local</tt> shows timestamps in user's local timezone.</p></div>
1110<div class="para"><p><tt>--date=iso</tt> (or <tt>--date=iso8601</tt>) shows timestamps in ISO 8601 format.</p></div>
1111<div class="para"><p><tt>--date=rfc</tt> (or <tt>--date=rfc2822</tt>) shows timestamps in RFC 2822
1112format, often found in E-mail messages.</p></div>
1113<div class="para"><p><tt>--date=short</tt> shows only date but not time, in <tt>YYYY-MM-DD</tt> format.</p></div>
Junio C Hamanobb653132009-02-22 08:09:351114<div class="para"><p><tt>--date=raw</tt> shows the date in the internal raw git format <tt>%s %z</tt> format.</p></div>
Junio C Hamanoba4b9282008-07-06 05:20:311115<div class="para"><p><tt>--date=default</tt> shows timestamps in the original timezone
1116(either committer's or author's).</p></div>
Junio C Hamanob0e02952008-01-19 08:02:001117</dd>
1118<dt>
Junio C Hamanob0e02952008-01-19 08:02:001119--parents
1120</dt>
1121<dd>
1122<p>
Junio C Hamanoa76cb0d2008-08-13 20:04:101123 Print the parents of the commit. Also enables parent
1124 rewriting, see <em>History Simplification</em> below.
Junio C Hamanob0e02952008-01-19 08:02:001125</p>
1126</dd>
1127<dt>
Junio C Hamano46a38aa2008-07-14 03:13:271128--children
1129</dt>
1130<dd>
1131<p>
Junio C Hamanoa76cb0d2008-08-13 20:04:101132 Print the children of the commit. Also enables parent
1133 rewriting, see <em>History Simplification</em> below.
Junio C Hamano46a38aa2008-07-14 03:13:271134</p>
1135</dd>
1136<dt>
Junio C Hamanob0e02952008-01-19 08:02:001137--left-right
1138</dt>
1139<dd>
1140<p>
1141 Mark which side of a symmetric diff a commit is reachable from.
1142 Commits from the left side are prefixed with <tt>&lt;</tt> and those from
1143 the right with <tt>&gt;</tt>. If combined with <tt>--boundary</tt>, those
1144 commits are prefixed with <tt>-</tt>.
1145</p>
Junio C Hamanoba4b9282008-07-06 05:20:311146<div class="para"><p>For example, if you have this topology:</p></div>
Junio C Hamanob0e02952008-01-19 08:02:001147<div class="listingblock">
1148<div class="content">
1149<pre><tt> y---b---b branch B
1150 / \ /
1151 / .
1152 / / \
1153 o---x---a---a branch A</tt></pre>
1154</div></div>
Junio C Hamanoc96fb5a2008-08-12 06:59:381155<div class="para"><p>you would get an output like this:</p></div>
Junio C Hamanob0e02952008-01-19 08:02:001156<div class="listingblock">
1157<div class="content">
1158<pre><tt> $ git rev-list --left-right --boundary --pretty=oneline A...B
1159
1160 &gt;bbbbbbb... 3rd on b
1161 &gt;bbbbbbb... 2nd on b
1162 &lt;aaaaaaa... 3rd on a
1163 &lt;aaaaaaa... 2nd on a
1164 -yyyyyyy... 1st on b
1165 -xxxxxxx... 1st on a</tt></pre>
1166</div></div>
1167</dd>
Junio C Hamanofeeb1be2008-05-22 00:53:351168<dt>
1169--graph
1170</dt>
1171<dd>
1172<p>
1173 Draw a text-based graphical representation of the commit history
1174 on the left hand side of the output. This may cause extra lines
1175 to be printed in between commits, in order for the graph history
1176 to be drawn properly.
1177</p>
Junio C Hamanoba4b9282008-07-06 05:20:311178<div class="para"><p>This implies the <em>--topo-order</em> option by default, but the
1179<em>--date-order</em> option may also be specified.</p></div>
Junio C Hamanofeeb1be2008-05-22 00:53:351180</dd>
Junio C Hamanoba4b9282008-07-06 05:20:311181</dl></div>
1182<h3 id="_diff_formatting">Diff Formatting</h3><div style="clear:left"></div>
1183<div class="para"><p>Below are listed options that control the formatting of diff output.
Junio C Hamanob0e02952008-01-19 08:02:001184Some of them are specific to <a href="git-rev-list.html">git-rev-list(1)</a>, however other diff
Junio C Hamanoba4b9282008-07-06 05:20:311185options may be given. See <a href="git-diff-files.html">git-diff-files(1)</a> for more options.</p></div>
1186<div class="vlist"><dl>
Junio C Hamanob0e02952008-01-19 08:02:001187<dt>
1188-c
1189</dt>
1190<dd>
1191<p>
Junio C Hamano31667362010-03-25 00:38:531192 With this option, diff output for a merge commit
1193 shows the differences from each of the parents to the merge result
Junio C Hamanob0e02952008-01-19 08:02:001194 simultaneously instead of showing pairwise diff between a parent
1195 and the result one at a time. Furthermore, it lists only files
1196 which were modified from all parents.
1197</p>
1198</dd>
1199<dt>
1200--cc
1201</dt>
1202<dd>
1203<p>
1204 This flag implies the <em>-c</em> options and further compresses the
Junio C Hamanoccc2f762008-07-24 04:03:331205 patch output by omitting uninteresting hunks whose contents in
1206 the parents have only two variants and the merge result picks
1207 one of them without modification.
Junio C Hamanob0e02952008-01-19 08:02:001208</p>
1209</dd>
1210<dt>
Junio C Hamano31667362010-03-25 00:38:531211-m
1212</dt>
1213<dd>
1214<p>
1215 This flag makes the merge commits show the full diff like
1216 regular commits; for each merge parent, a separate log entry
1217 and diff is generated. An exception is that only diff against
1218 the first parent is shown when <em>--first-parent</em> option is given;
1219 in that case, the output represents the changes the merge
1220 brought _into_ the then-current branch.
1221</p>
1222</dd>
1223<dt>
Junio C Hamanob0e02952008-01-19 08:02:001224-r
1225</dt>
1226<dd>
1227<p>
1228 Show recursive diffs.
1229</p>
1230</dd>
1231<dt>
1232-t
1233</dt>
1234<dd>
1235<p>
1236 Show the tree objects in the diff output. This implies <em>-r</em>.
1237</p>
1238</dd>
Junio C Hamanoba4b9282008-07-06 05:20:311239</dl></div>
1240<h3 id="_commit_limiting">Commit Limiting</h3><div style="clear:left"></div>
1241<div class="para"><p>Besides specifying a range of commits that should be listed using the
Junio C Hamanob0e02952008-01-19 08:02:001242special notations explained in the description, additional commit
Junio C Hamanoba4b9282008-07-06 05:20:311243limiting may be applied.</p></div>
1244<div class="vlist"><dl>
Junio C Hamanob0e02952008-01-19 08:02:001245<dt>
Junio C Hamanoeb415992008-06-08 22:49:471246-n <em>number</em>
1247</dt>
1248<dt>
Junio C Hamanob4a9ede2009-04-08 07:36:321249--max-count=&lt;number&gt;
Junio C Hamanob0e02952008-01-19 08:02:001250</dt>
1251<dd>
1252<p>
1253 Limit the number of commits output.
1254</p>
1255</dd>
1256<dt>
Junio C Hamanob4a9ede2009-04-08 07:36:321257--skip=&lt;number&gt;
Junio C Hamanob0e02952008-01-19 08:02:001258</dt>
1259<dd>
1260<p>
1261 Skip <em>number</em> commits before starting to show the commit output.
1262</p>
1263</dd>
1264<dt>
Junio C Hamanob4a9ede2009-04-08 07:36:321265--since=&lt;date&gt;
Junio C Hamanoeb415992008-06-08 22:49:471266</dt>
1267<dt>
Junio C Hamanob4a9ede2009-04-08 07:36:321268--after=&lt;date&gt;
Junio C Hamanob0e02952008-01-19 08:02:001269</dt>
1270<dd>
1271<p>
1272 Show commits more recent than a specific date.
1273</p>
1274</dd>
1275<dt>
Junio C Hamanob4a9ede2009-04-08 07:36:321276--until=&lt;date&gt;
Junio C Hamanoeb415992008-06-08 22:49:471277</dt>
1278<dt>
Junio C Hamanob4a9ede2009-04-08 07:36:321279--before=&lt;date&gt;
Junio C Hamanob0e02952008-01-19 08:02:001280</dt>
1281<dd>
1282<p>
1283 Show commits older than a specific date.
1284</p>
1285</dd>
1286<dt>
Junio C Hamanob4a9ede2009-04-08 07:36:321287--author=&lt;pattern&gt;
Junio C Hamanoeb415992008-06-08 22:49:471288</dt>
1289<dt>
Junio C Hamanob4a9ede2009-04-08 07:36:321290--committer=&lt;pattern&gt;
Junio C Hamanob0e02952008-01-19 08:02:001291</dt>
1292<dd>
1293<p>
1294 Limit the commits output to ones with author/committer
1295 header lines that match the specified pattern (regular expression).
1296</p>
1297</dd>
1298<dt>
Junio C Hamanob4a9ede2009-04-08 07:36:321299--grep=&lt;pattern&gt;
Junio C Hamanob0e02952008-01-19 08:02:001300</dt>
1301<dd>
1302<p>
1303 Limit the commits output to ones with log message that
1304 matches the specified pattern (regular expression).
1305</p>
1306</dd>
1307<dt>
Junio C Hamanoaa17c7c2008-11-03 04:36:581308--all-match
1309</dt>
1310<dd>
1311<p>
1312 Limit the commits output to ones that match all given --grep,
1313 --author and --committer instead of ones that match at least one.
1314</p>
1315</dd>
1316<dt>
Junio C Hamanoeb415992008-06-08 22:49:471317-i
1318</dt>
1319<dt>
1320--regexp-ignore-case
Junio C Hamanob0e02952008-01-19 08:02:001321</dt>
1322<dd>
1323<p>
1324 Match the regexp limiting patterns without regard to letters case.
1325</p>
1326</dd>
1327<dt>
Junio C Hamanoeb415992008-06-08 22:49:471328-E
1329</dt>
1330<dt>
1331--extended-regexp
Junio C Hamanob0e02952008-01-19 08:02:001332</dt>
1333<dd>
1334<p>
1335 Consider the limiting patterns to be extended regular expressions
1336 instead of the default basic regular expressions.
1337</p>
1338</dd>
1339<dt>
Junio C Hamanoeb415992008-06-08 22:49:471340-F
1341</dt>
1342<dt>
1343--fixed-strings
Junio C Hamano24bc09a2008-02-28 00:27:441344</dt>
1345<dd>
1346<p>
1347 Consider the limiting patterns to be fixed strings (don't interpret
1348 pattern as a regular expression).
1349</p>
1350</dd>
1351<dt>
Junio C Hamanob0e02952008-01-19 08:02:001352--remove-empty
1353</dt>
1354<dd>
1355<p>
1356 Stop when a given path disappears from the tree.
1357</p>
1358</dd>
1359<dt>
Junio C Hamano934e1782009-07-16 06:59:151360--merges
1361</dt>
1362<dd>
1363<p>
1364 Print only merge commits.
1365</p>
1366</dd>
1367<dt>
Junio C Hamanob0e02952008-01-19 08:02:001368--no-merges
1369</dt>
1370<dd>
1371<p>
1372 Do not print commits with more than one parent.
1373</p>
1374</dd>
1375<dt>
1376--first-parent
1377</dt>
1378<dd>
1379<p>
1380 Follow only the first parent commit upon seeing a merge
1381 commit. This option can give a better overview when
1382 viewing the evolution of a particular topic branch,
1383 because merges into a topic branch tend to be only about
1384 adjusting to updated upstream from time to time, and
1385 this option allows you to ignore the individual commits
1386 brought in to your history by such a merge.
1387</p>
1388</dd>
1389<dt>
1390--not
1391</dt>
1392<dd>
1393<p>
1394 Reverses the meaning of the <em>&#94;</em> prefix (or lack thereof)
1395 for all following revision specifiers, up to the next <em>--not</em>.
1396</p>
1397</dd>
1398<dt>
1399--all
1400</dt>
1401<dd>
1402<p>
Junio C Hamano4fdccb22010-02-19 09:58:141403 Pretend as if all the refs in <tt>refs/</tt> are listed on the
Junio C Hamanob0e02952008-01-19 08:02:001404 command line as <em>&lt;commit&gt;</em>.
1405</p>
1406</dd>
1407<dt>
Junio C Hamano57827fb2010-01-23 03:02:501408--branches[=pattern]
Junio C Hamano50819852008-11-19 02:07:561409</dt>
1410<dd>
1411<p>
Junio C Hamano4fdccb22010-02-19 09:58:141412 Pretend as if all the refs in <tt>refs/heads</tt> are listed
Junio C Hamano57827fb2010-01-23 03:02:501413 on the command line as <em>&lt;commit&gt;</em>. If <tt>pattern</tt> is given, limit
1414 branches to ones matching given shell glob. If pattern lacks <em>?</em>,
Junio C Hamano167b1382010-01-31 23:04:311415 <em><strong></em>, or <em>[</em>, <em>/</strong></em> at the end is implied.
Junio C Hamano50819852008-11-19 02:07:561416</p>
1417</dd>
1418<dt>
Junio C Hamano57827fb2010-01-23 03:02:501419--tags[=pattern]
Junio C Hamano50819852008-11-19 02:07:561420</dt>
1421<dd>
1422<p>
Junio C Hamano4fdccb22010-02-19 09:58:141423 Pretend as if all the refs in <tt>refs/tags</tt> are listed
Junio C Hamano57827fb2010-01-23 03:02:501424 on the command line as <em>&lt;commit&gt;</em>. If <tt>pattern</tt> is given, limit
1425 tags to ones matching given shell glob. If pattern lacks <em>?</em>, <em><strong></em>,
Junio C Hamano167b1382010-01-31 23:04:311426 or <em>[</em>, <em>/</strong></em> at the end is implied.
Junio C Hamano50819852008-11-19 02:07:561427</p>
1428</dd>
1429<dt>
Junio C Hamano57827fb2010-01-23 03:02:501430--remotes[=pattern]
Junio C Hamano50819852008-11-19 02:07:561431</dt>
1432<dd>
1433<p>
Junio C Hamano4fdccb22010-02-19 09:58:141434 Pretend as if all the refs in <tt>refs/remotes</tt> are listed
Junio C Hamano57827fb2010-01-23 03:02:501435 on the command line as <em>&lt;commit&gt;</em>. If `pattern`is given, limit
1436 remote tracking branches to ones matching given shell glob.
Junio C Hamano167b1382010-01-31 23:04:311437 If pattern lacks <em>?</em>, <em><strong></em>, or <em>[</em>, <em>/</strong></em> at the end is implied.
Junio C Hamano57827fb2010-01-23 03:02:501438</p>
1439</dd>
1440<dt>
1441--glob=glob-pattern
1442</dt>
1443<dd>
1444<p>
1445 Pretend as if all the refs matching shell glob <tt>glob-pattern</tt>
1446 are listed on the command line as <em>&lt;commit&gt;</em>. Leading <em>refs/</em>,
1447 is automatically prepended if missing. If pattern lacks <em>?</em>, <em><strong></em>,
Junio C Hamano167b1382010-01-31 23:04:311448 or <em>[</em>, <em>/</strong></em> at the end is implied.
Junio C Hamano50819852008-11-19 02:07:561449</p>
1450</dd>
1451<dt>
Junio C Hamano5706e0b2009-11-24 10:54:161452--bisect
1453</dt>
1454<dd>
1455<p>
Junio C Hamano4fdccb22010-02-19 09:58:141456 Pretend as if the bad bisection ref <tt>refs/bisect/bad</tt>
Junio C Hamano5706e0b2009-11-24 10:54:161457 was listed and as if it was followed by <tt>--not</tt> and the good
Junio C Hamano4fdccb22010-02-19 09:58:141458 bisection refs <tt>refs/bisect/good-*</tt> on the command
Junio C Hamano5706e0b2009-11-24 10:54:161459 line.
1460</p>
1461</dd>
1462<dt>
1463--stdin
1464</dt>
1465<dd>
1466<p>
1467 In addition to the <em>&lt;commit&gt;</em> listed on the command
1468 line, read them from the standard input. If a <em>--</em> separator is
1469 seen, stop reading commits and start reading paths to limit the
1470 result.
1471</p>
1472</dd>
1473<dt>
Junio C Hamanob0e02952008-01-19 08:02:001474--cherry-pick
1475</dt>
1476<dd>
1477<p>
1478 Omit any commit that introduces the same change as
1479 another commit on the "other side" when the set of
1480 commits are limited with symmetric difference.<br />
1481For example, if you have two branches, <tt>A</tt> and <tt>B</tt>, a usual way
1482to list all commits on only one side of them is with
1483<tt>--left-right</tt>, like the example above in the description of
1484that option. It however shows the commits that were cherry-picked
1485from the other branch (for example, "3rd on b" may be cherry-picked
1486from branch A). With this option, such pairs of commits are
1487excluded from the output.
1488</p>
1489</dd>
1490<dt>
Junio C Hamanoeb415992008-06-08 22:49:471491-g
1492</dt>
1493<dt>
1494--walk-reflogs
Junio C Hamanob0e02952008-01-19 08:02:001495</dt>
1496<dd>
1497<p>
1498 Instead of walking the commit ancestry chain, walk
1499 reflog entries from the most recent one to older ones.
1500 When this option is used you cannot specify commits to
1501 exclude (that is, <em>&#94;commit</em>, <em>commit1..commit2</em>,
1502 nor <em>commit1&#8230;commit2</em> notations cannot be used).<br />
1503With <em>--pretty</em> format other than oneline (for obvious reasons),
1504this causes the output to have two extra lines of information
1505taken from the reflog. By default, <em>commit@{Nth}</em> notation is
1506used in the output. When the starting commit is specified as
Junio C Hamano1d368882008-08-11 22:03:101507<em>commit@{now}</em>, output also uses <em>commit@{timestamp}</em> notation
Junio C Hamanob0e02952008-01-19 08:02:001508instead. Under <em>--pretty=oneline</em>, the commit message is
1509prefixed with this information on the same line.
Junio C Hamano1d368882008-08-11 22:03:101510This option cannot be combined with <em>--reverse</em>.
1511See also <a href="git-reflog.html">git-reflog(1)</a>.
Junio C Hamanob0e02952008-01-19 08:02:001512</p>
Junio C Hamanob0e02952008-01-19 08:02:001513</dd>
1514<dt>
1515--merge
1516</dt>
1517<dd>
1518<p>
1519 After a failed merge, show refs that touch files having a
1520 conflict and don't exist on all heads to merge.
1521</p>
1522</dd>
1523<dt>
1524--boundary
1525</dt>
1526<dd>
1527<p>
1528 Output uninteresting commits at the boundary, which are usually
1529 not shown.
1530</p>
1531</dd>
Junio C Hamanoa76cb0d2008-08-13 20:04:101532</dl></div>
1533<h3 id="_history_simplification">History Simplification</h3><div style="clear:left"></div>
Junio C Hamano28363492008-11-14 08:26:311534<div class="para"><p>Sometimes you are only interested in parts of the history, for example the
1535commits modifying a particular &lt;path&gt;. But there are two parts of
1536<em>History Simplification</em>, one part is selecting the commits and the other
1537is how to do it, as there are various strategies to simplify the history.</p></div>
1538<div class="para"><p>The following options select the commits to be shown:</p></div>
1539<div class="vlist"><dl>
1540<dt>
1541&lt;paths&gt;
1542</dt>
1543<dd>
1544<p>
1545 Commits modifying the given &lt;paths&gt; are selected.
1546</p>
1547</dd>
1548<dt>
1549--simplify-by-decoration
1550</dt>
1551<dd>
1552<p>
1553 Commits that are referred by some branch or tag are selected.
1554</p>
1555</dd>
1556</dl></div>
1557<div class="para"><p>Note that extra commits can be shown to give a meaningful history.</p></div>
1558<div class="para"><p>The following options affect the way the simplification is performed:</p></div>
1559<div class="vlist"><dl>
1560<dt>
1561Default mode
1562</dt>
1563<dd>
1564<p>
1565 Simplifies the history to the simplest history explaining the
1566 final state of the tree. Simplest because it prunes some side
1567 branches if the end result is the same (i.e. merging branches
1568 with the same content)
1569</p>
1570</dd>
1571<dt>
1572--full-history
1573</dt>
1574<dd>
1575<p>
1576 As the default mode but does not prune some history.
1577</p>
1578</dd>
1579<dt>
1580--dense
1581</dt>
1582<dd>
1583<p>
1584 Only the selected commits are shown, plus some to have a
1585 meaningful history.
1586</p>
1587</dd>
1588<dt>
1589--sparse
1590</dt>
1591<dd>
1592<p>
1593 All commits in the simplified history are shown.
1594</p>
1595</dd>
1596<dt>
1597--simplify-merges
1598</dt>
1599<dd>
1600<p>
1601 Additional option to <em>--full-history</em> to remove some needless
1602 merges from the resulting history, as there are no selected
1603 commits contributing to this merge.
1604</p>
1605</dd>
Junio C Hamano89a57342010-06-22 23:22:551606<dt>
1607--ancestry-path
1608</dt>
1609<dd>
1610<p>
1611 When given a range of commits to display (e.g. <em>commit1..commit2</em>
1612 or <em>commit2 &#94;commit1</em>), only display commits that exist
1613 directly on the ancestry chain between the <em>commit1</em> and
1614 <em>commit2</em>, i.e. commits that are both descendants of <em>commit1</em>,
1615 and ancestors of <em>commit2</em>.
1616</p>
1617</dd>
Junio C Hamano28363492008-11-14 08:26:311618</dl></div>
1619<div class="para"><p>A more detailed explanation follows.</p></div>
Junio C Hamanoa76cb0d2008-08-13 20:04:101620<div class="para"><p>Suppose you specified <tt>foo</tt> as the &lt;paths&gt;. We shall call commits
1621that modify <tt>foo</tt> !TREESAME, and the rest TREESAME. (In a diff
1622filtered for <tt>foo</tt>, they look different and equal, respectively.)</p></div>
1623<div class="para"><p>In the following, we will always refer to the same example history to
1624illustrate the differences between simplification settings. We assume
1625that you are filtering for a file <tt>foo</tt> in this commit graph:</p></div>
1626<div class="listingblock">
1627<div class="content">
1628<pre><tt> .-A---M---N---O---P
1629 / / / / /
1630 I B C D E
1631 \ / / / /
1632 `-------------'</tt></pre>
1633</div></div>
1634<div class="para"><p>The horizontal line of history A--P is taken to be the first parent of
1635each merge. The commits are:</p></div>
1636<div class="ilist"><ul>
1637<li>
1638<p>
1639<tt>I</tt> is the initial commit, in which <tt>foo</tt> exists with contents
1640 "asdf", and a file <tt>quux</tt> exists with contents "quux". Initial
1641 commits are compared to an empty tree, so <tt>I</tt> is !TREESAME.
1642</p>
1643</li>
1644<li>
1645<p>
1646In <tt>A</tt>, <tt>foo</tt> contains just "foo".
1647</p>
1648</li>
1649<li>
1650<p>
1651<tt>B</tt> contains the same change as <tt>A</tt>. Its merge <tt>M</tt> is trivial and
1652 hence TREESAME to all parents.
1653</p>
1654</li>
1655<li>
1656<p>
1657<tt>C</tt> does not change <tt>foo</tt>, but its merge <tt>N</tt> changes it to "foobar",
1658 so it is not TREESAME to any parent.
1659</p>
1660</li>
1661<li>
1662<p>
1663<tt>D</tt> sets <tt>foo</tt> to "baz". Its merge <tt>O</tt> combines the strings from
1664 <tt>N</tt> and <tt>D</tt> to "foobarbaz"; i.e., it is not TREESAME to any parent.
1665</p>
1666</li>
1667<li>
1668<p>
1669<tt>E</tt> changes <tt>quux</tt> to "xyzzy", and its merge <tt>P</tt> combines the
1670 strings to "quux xyzzy". Despite appearing interesting, <tt>P</tt> is
1671 TREESAME to all parents.
1672</p>
1673</li>
1674</ul></div>
1675<div class="para"><p><em>rev-list</em> walks backwards through history, including or excluding
1676commits based on whether <em>--full-history</em> and/or parent rewriting
1677(via <em>--parents</em> or <em>--children</em>) are used. The following settings
1678are available.</p></div>
1679<div class="vlist"><dl>
1680<dt>
1681Default mode
1682</dt>
1683<dd>
1684<p>
1685 Commits are included if they are not TREESAME to any parent
1686 (though this can be changed, see <em>--sparse</em> below). If the
1687 commit was a merge, and it was TREESAME to one parent, follow
1688 only that parent. (Even if there are several TREESAME
1689 parents, follow only one of them.) Otherwise, follow all
1690 parents.
1691</p>
1692<div class="para"><p>This results in:</p></div>
1693<div class="listingblock">
1694<div class="content">
1695<pre><tt> .-A---N---O
Junio C Hamano89a57342010-06-22 23:22:551696 / / /
Junio C Hamanoa76cb0d2008-08-13 20:04:101697 I---------D</tt></pre>
1698</div></div>
1699<div class="para"><p>Note how the rule to only follow the TREESAME parent, if one is
1700available, removed <tt>B</tt> from consideration entirely. <tt>C</tt> was
1701considered via <tt>N</tt>, but is TREESAME. Root commits are compared to an
1702empty tree, so <tt>I</tt> is !TREESAME.</p></div>
1703<div class="para"><p>Parent/child relations are only visible with --parents, but that does
1704not affect the commits selected in default mode, so we have shown the
1705parent lines.</p></div>
1706</dd>
1707<dt>
1708--full-history without parent rewriting
1709</dt>
1710<dd>
1711<p>
1712 This mode differs from the default in one point: always follow
1713 all parents of a merge, even if it is TREESAME to one of them.
1714 Even if more than one side of the merge has commits that are
1715 included, this does not imply that the merge itself is! In
1716 the example, we get
1717</p>
1718<div class="listingblock">
1719<div class="content">
1720<pre><tt> I A B N D O</tt></pre>
1721</div></div>
1722<div class="para"><p><tt>P</tt> and <tt>M</tt> were excluded because they are TREESAME to a parent. <tt>E</tt>,
1723<tt>C</tt> and <tt>B</tt> were all walked, but only <tt>B</tt> was !TREESAME, so the others
1724do not appear.</p></div>
1725<div class="para"><p>Note that without parent rewriting, it is not really possible to talk
1726about the parent/child relationships between the commits, so we show
1727them disconnected.</p></div>
1728</dd>
1729<dt>
1730--full-history with parent rewriting
1731</dt>
1732<dd>
1733<p>
1734 Ordinary commits are only included if they are !TREESAME
1735 (though this can be changed, see <em>--sparse</em> below).
1736</p>
1737<div class="para"><p>Merges are always included. However, their parent list is rewritten:
1738Along each parent, prune away commits that are not included
1739themselves. This results in</p></div>
1740<div class="listingblock">
1741<div class="content">
1742<pre><tt> .-A---M---N---O---P
1743 / / / / /
1744 I B / D /
1745 \ / / / /
1746 `-------------'</tt></pre>
1747</div></div>
1748<div class="para"><p>Compare to <em>--full-history</em> without rewriting above. Note that <tt>E</tt>
1749was pruned away because it is TREESAME, but the parent list of P was
1750rewritten to contain <tt>E</tt>'s parent <tt>I</tt>. The same happened for <tt>C</tt> and
1751<tt>N</tt>. Note also that <tt>P</tt> was included despite being TREESAME.</p></div>
1752</dd>
1753</dl></div>
1754<div class="para"><p>In addition to the above settings, you can change whether TREESAME
1755affects inclusion:</p></div>
1756<div class="vlist"><dl>
Junio C Hamanob0e02952008-01-19 08:02:001757<dt>
Junio C Hamanoeb415992008-06-08 22:49:471758--dense
1759</dt>
Junio C Hamanoa76cb0d2008-08-13 20:04:101760<dd>
1761<p>
1762 Commits that are walked are included if they are not TREESAME
1763 to any parent.
1764</p>
1765</dd>
Junio C Hamanoeb415992008-06-08 22:49:471766<dt>
1767--sparse
Junio C Hamanob0e02952008-01-19 08:02:001768</dt>
1769<dd>
1770<p>
Junio C Hamanoa76cb0d2008-08-13 20:04:101771 All commits that are walked are included.
Junio C Hamanob0e02952008-01-19 08:02:001772</p>
Junio C Hamanoa76cb0d2008-08-13 20:04:101773<div class="para"><p>Note that without <em>--full-history</em>, this still simplifies merges: if
1774one of the parents is TREESAME, we follow only that one, so the other
1775sides of the merge are never walked.</p></div>
Junio C Hamanob0e02952008-01-19 08:02:001776</dd>
Junio C Hamanoa2f46622008-09-03 05:20:311777<dt>
1778--simplify-merges
1779</dt>
1780<dd>
1781<p>
1782 First, build a history graph in the same way that
1783 <em>--full-history</em> with parent rewriting does (see above).
1784</p>
1785<div class="para"><p>Then simplify each commit <tt>C</tt> to its replacement <tt>C'</tt> in the final
1786history according to the following rules:</p></div>
1787<div class="ilist"><ul>
1788<li>
1789<p>
1790Set <tt>C'</tt> to <tt>C</tt>.<br />
1791</p>
1792</li>
1793<li>
1794<p>
1795Replace each parent <tt>P</tt> of <tt>C'</tt> with its simplification <tt>P'</tt>. In
1796 the process, drop parents that are ancestors of other parents, and
1797 remove duplicates.<br />
1798</p>
1799</li>
1800<li>
1801<p>
1802If after this parent rewriting, <tt>C'</tt> is a root or merge commit (has
1803 zero or &gt;1 parents), a boundary commit, or !TREESAME, it remains.
1804 Otherwise, it is replaced with its only parent.
1805</p>
1806</li>
1807</ul></div>
1808<div class="para"><p>The effect of this is best shown by way of comparing to
1809<em>--full-history</em> with parent rewriting. The example turns into:</p></div>
1810<div class="listingblock">
1811<div class="content">
1812<pre><tt> .-A---M---N---O
1813 / / /
1814 I B D
1815 \ / /
1816 `---------'</tt></pre>
1817</div></div>
1818<div class="para"><p>Note the major differences in <tt>N</tt> and <tt>P</tt> over <em>--full-history</em>:</p></div>
1819<div class="ilist"><ul>
1820<li>
1821<p>
1822<tt>N</tt>'s parent list had <tt>I</tt> removed, because it is an ancestor of the
1823 other parent <tt>M</tt>. Still, <tt>N</tt> remained because it is !TREESAME.<br />
1824</p>
1825</li>
1826<li>
1827<p>
1828<tt>P</tt>'s parent list similarly had <tt>I</tt> removed. <tt>P</tt> was then
1829 removed completely, because it had one parent and is TREESAME.
1830</p>
1831</li>
1832</ul></div>
1833</dd>
1834</dl></div>
Junio C Hamano89a57342010-06-22 23:22:551835<div class="para"><p>Finally, there is a fifth simplification mode available:</p></div>
1836<div class="vlist"><dl>
1837<dt>
1838--ancestry-path
1839</dt>
1840<dd>
1841<p>
1842 Limit the displayed commits to those directly on the ancestry
1843 chain between the "from" and "to" commits in the given commit
1844 range. I.e. only display commits that are ancestor of the "to"
1845 commit, and descendants of the "from" commit.
1846</p>
1847<div class="para"><p>As an example use case, consider the following commit history:</p></div>
1848<div class="listingblock">
1849<div class="content">
1850<pre><tt> D---E-------F
1851 / \ \
1852 B---C---G---H---I---J
1853 / \
1854 A-------K---------------L--M</tt></pre>
1855</div></div>
1856<div class="para"><p>A regular <em>D..M</em> computes the set of commits that are ancestors of <tt>M</tt>,
1857but excludes the ones that are ancestors of <tt>D</tt>. This is useful to see
1858what happened to the history leading to <tt>M</tt> since <tt>D</tt>, in the sense
1859that "what does <tt>M</tt> have that did not exist in <tt>D</tt>". The result in this
1860example would be all the commits, except <tt>A</tt> and <tt>B</tt> (and <tt>D</tt> itself,
1861of course).</p></div>
1862<div class="para"><p>When we want to find out what commits in <tt>M</tt> are contaminated with the
1863bug introduced by <tt>D</tt> and need fixing, however, we might want to view
1864only the subset of <em>D..M</em> that are actually descendants of <tt>D</tt>, i.e.
1865excluding <tt>C</tt> and <tt>K</tt>. This is exactly what the <em>--ancestry-path</em>
1866option does. Applied to the <em>D..M</em> range, it results in:</p></div>
1867<div class="listingblock">
1868<div class="content">
1869<pre><tt> E-------F
1870 \ \
1871 G---H---I---J
1872 \
1873 L--M</tt></pre>
1874</div></div>
1875</dd>
1876</dl></div>
Junio C Hamano28363492008-11-14 08:26:311877<div class="para"><p>The <em>--simplify-by-decoration</em> option allows you to view only the
1878big picture of the topology of the history, by omitting commits
1879that are not referenced by tags. Commits are marked as !TREESAME
1880(in other words, kept after history simplification rules described
1881above) if (1) they are referenced by tags, or (2) they change the
1882contents of the paths given on the command line. All other
1883commits are marked as TREESAME (subject to be simplified away).</p></div>
Junio C Hamanoba4b9282008-07-06 05:20:311884<h3 id="_commit_ordering">Commit Ordering</h3><div style="clear:left"></div>
1885<div class="para"><p>By default, the commits are shown in reverse chronological order.</p></div>
1886<div class="vlist"><dl>
Junio C Hamanob0e02952008-01-19 08:02:001887<dt>
1888--topo-order
1889</dt>
1890<dd>
1891<p>
1892 This option makes them appear in topological order (i.e.
1893 descendant commits are shown before their parents).
1894</p>
1895</dd>
1896<dt>
1897--date-order
1898</dt>
1899<dd>
1900<p>
1901 This option is similar to <em>--topo-order</em> in the sense that no
1902 parent comes before all of its children, but otherwise things
1903 are still ordered in the commit timestamp order.
1904</p>
1905</dd>
1906<dt>
1907--reverse
1908</dt>
1909<dd>
1910<p>
1911 Output the commits in reverse order.
1912 Cannot be combined with <em>--walk-reflogs</em>.
1913</p>
1914</dd>
Junio C Hamanoba4b9282008-07-06 05:20:311915</dl></div>
1916<h3 id="_object_traversal">Object Traversal</h3><div style="clear:left"></div>
1917<div class="para"><p>These options are mostly targeted for packing of git repositories.</p></div>
1918<div class="vlist"><dl>
Junio C Hamanob0e02952008-01-19 08:02:001919<dt>
1920--objects
1921</dt>
1922<dd>
1923<p>
1924 Print the object IDs of any object referenced by the listed
1925 commits. <em>--objects foo ^bar</em> thus means "send me
1926 all object IDs which I need to download if I have the commit
1927 object <em>bar</em>, but not <em>foo</em>".
1928</p>
1929</dd>
1930<dt>
1931--objects-edge
1932</dt>
1933<dd>
1934<p>
1935 Similar to <em>--objects</em>, but also print the IDs of excluded
1936 commits prefixed with a "-" character. This is used by
1937 <a href="git-pack-objects.html">git-pack-objects(1)</a> to build "thin" pack, which records
1938 objects in deltified form based on objects contained in these
1939 excluded commits to reduce network traffic.
1940</p>
1941</dd>
1942<dt>
1943--unpacked
1944</dt>
1945<dd>
1946<p>
1947 Only useful with <em>--objects</em>; print the object IDs that are not
1948 in packs.
1949</p>
1950</dd>
1951<dt>
1952--no-walk
1953</dt>
1954<dd>
1955<p>
1956 Only show the given revs, but do not traverse their ancestors.
1957</p>
1958</dd>
1959<dt>
1960--do-walk
1961</dt>
1962<dd>
1963<p>
1964 Overrides a previous --no-walk.
1965</p>
1966</dd>
Junio C Hamanoba4b9282008-07-06 05:20:311967</dl></div>
Junio C Hamano0430e3a2007-05-15 03:13:171968</div>
Junio C Hamanoba4b9282008-07-06 05:20:311969<h2 id="_pretty_formats">PRETTY FORMATS</h2>
Junio C Hamano0430e3a2007-05-15 03:13:171970<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:311971<div class="para"><p>If the commit is a merge, and if the pretty-format
Junio C Hamano0430e3a2007-05-15 03:13:171972is not <em>oneline</em>, <em>email</em> or <em>raw</em>, an additional line is
1973inserted before the <em>Author:</em> line. This line begins with
1974"Merge: " and the sha1s of ancestral commits are printed,
1975separated by spaces. Note that the listed commits may not
1976necessarily be the list of the <strong>direct</strong> parent commits if you
1977have limited your view of history: for example, if you are
1978only interested in changes related to a certain directory or
Junio C Hamanoba4b9282008-07-06 05:20:311979file.</p></div>
Junio C Hamanoa574a092010-06-13 19:57:101980<div class="para"><p>There are several built-in formats, and you can define
1981additional formats by setting a pretty.&lt;name&gt;
1982config option to either another format name, or a
1983<em>format:</em> string, as described below (see
1984<a href="git-config.html">git-config(1)</a>). Here are the details of the
1985built-in formats:</p></div>
Junio C Hamanoba4b9282008-07-06 05:20:311986<div class="ilist"><ul>
Junio C Hamanoa340aaa2006-11-23 02:47:331987<li>
1988<p>
1989<em>oneline</em>
1990</p>
1991<div class="literalblock">
1992<div class="content">
1993<pre><tt>&lt;sha1&gt; &lt;title line&gt;</tt></pre>
1994</div></div>
Junio C Hamanoba4b9282008-07-06 05:20:311995<div class="para"><p>This is designed to be as compact as possible.</p></div>
Junio C Hamanoa340aaa2006-11-23 02:47:331996</li>
1997<li>
1998<p>
1999<em>short</em>
2000</p>
2001<div class="literalblock">
2002<div class="content">
2003<pre><tt>commit &lt;sha1&gt;
2004Author: &lt;author&gt;</tt></pre>
2005</div></div>
2006<div class="literalblock">
2007<div class="content">
2008<pre><tt>&lt;title line&gt;</tt></pre>
2009</div></div>
2010</li>
2011<li>
2012<p>
2013<em>medium</em>
2014</p>
2015<div class="literalblock">
2016<div class="content">
2017<pre><tt>commit &lt;sha1&gt;
2018Author: &lt;author&gt;
Junio C Hamano6a3c8272008-12-19 21:38:182019Date: &lt;author date&gt;</tt></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332020</div></div>
2021<div class="literalblock">
2022<div class="content">
2023<pre><tt>&lt;title line&gt;</tt></pre>
2024</div></div>
2025<div class="literalblock">
2026<div class="content">
2027<pre><tt>&lt;full commit message&gt;</tt></pre>
2028</div></div>
2029</li>
2030<li>
2031<p>
2032<em>full</em>
2033</p>
2034<div class="literalblock">
2035<div class="content">
2036<pre><tt>commit &lt;sha1&gt;
2037Author: &lt;author&gt;
2038Commit: &lt;committer&gt;</tt></pre>
2039</div></div>
2040<div class="literalblock">
2041<div class="content">
2042<pre><tt>&lt;title line&gt;</tt></pre>
2043</div></div>
2044<div class="literalblock">
2045<div class="content">
2046<pre><tt>&lt;full commit message&gt;</tt></pre>
2047</div></div>
2048</li>
2049<li>
2050<p>
2051<em>fuller</em>
2052</p>
2053<div class="literalblock">
2054<div class="content">
2055<pre><tt>commit &lt;sha1&gt;
Junio C Hamano6a3c8272008-12-19 21:38:182056Author: &lt;author&gt;
Junio C Hamanoba4b9282008-07-06 05:20:312057AuthorDate: &lt;author date&gt;
Junio C Hamano6a3c8272008-12-19 21:38:182058Commit: &lt;committer&gt;
Junio C Hamanoba4b9282008-07-06 05:20:312059CommitDate: &lt;committer date&gt;</tt></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332060</div></div>
2061<div class="literalblock">
2062<div class="content">
2063<pre><tt>&lt;title line&gt;</tt></pre>
2064</div></div>
2065<div class="literalblock">
2066<div class="content">
2067<pre><tt>&lt;full commit message&gt;</tt></pre>
2068</div></div>
2069</li>
2070<li>
2071<p>
2072<em>email</em>
2073</p>
2074<div class="literalblock">
2075<div class="content">
2076<pre><tt>From &lt;sha1&gt; &lt;date&gt;
2077From: &lt;author&gt;
Junio C Hamanoba4b9282008-07-06 05:20:312078Date: &lt;author date&gt;
Junio C Hamanoa340aaa2006-11-23 02:47:332079Subject: [PATCH] &lt;title line&gt;</tt></pre>
2080</div></div>
2081<div class="literalblock">
2082<div class="content">
Junio C Hamano0430e3a2007-05-15 03:13:172083<pre><tt>&lt;full commit message&gt;</tt></pre>
Junio C Hamanoa340aaa2006-11-23 02:47:332084</div></div>
2085</li>
2086<li>
2087<p>
2088<em>raw</em>
2089</p>
Junio C Hamanoba4b9282008-07-06 05:20:312090<div class="para"><p>The <em>raw</em> format shows the entire commit exactly as
Junio C Hamanoa340aaa2006-11-23 02:47:332091stored in the commit object. Notably, the SHA1s are
2092displayed in full, regardless of whether --abbrev or
2093--no-abbrev are used, and <em>parents</em> information show the
2094true parent commits, without taking grafts nor history
Junio C Hamanoba4b9282008-07-06 05:20:312095simplification into account.</p></div>
Junio C Hamanoa340aaa2006-11-23 02:47:332096</li>
Junio C Hamanoa3fd83c2007-03-02 10:34:362097<li>
2098<p>
Junio C Hamanoe32ec8b2010-06-02 23:32:312099<em>format:&lt;string&gt;</em>
Junio C Hamanoa3fd83c2007-03-02 10:34:362100</p>
Junio C Hamanoe32ec8b2010-06-02 23:32:312101<div class="para"><p>The <em>format:&lt;string&gt;</em> format allows you to specify which information
Junio C Hamanoa3fd83c2007-03-02 10:34:362102you want to show. It works a little bit like printf format,
2103with the notable exception that you get a newline with <em>%n</em>
Junio C Hamanoba4b9282008-07-06 05:20:312104instead of <em>\n</em>.</p></div>
2105<div class="para"><p>E.g, <em>format:"The author of %h was %an, %ar%nThe title was &gt;&gt;%s&lt;&lt;%n"</em>
2106would show something like this:</p></div>
Junio C Hamano0430e3a2007-05-15 03:13:172107<div class="listingblock">
2108<div class="content">
2109<pre><tt>The author of fe6e0ee was Junio C Hamano, 23 hours ago
2110The title was &gt;&gt;t4119: test autocomputing -p&lt;n&gt; for traditional diff input.&lt;&lt;
2111</tt></pre>
2112</div></div>
Junio C Hamanoba4b9282008-07-06 05:20:312113<div class="para"><p>The placeholders are:</p></div>
2114<div class="ilist"><ul>
Junio C Hamanoa3fd83c2007-03-02 10:34:362115<li>
2116<p>
2117<em>%H</em>: commit hash
2118</p>
2119</li>
2120<li>
2121<p>
2122<em>%h</em>: abbreviated commit hash
2123</p>
2124</li>
2125<li>
2126<p>
2127<em>%T</em>: tree hash
2128</p>
2129</li>
2130<li>
2131<p>
2132<em>%t</em>: abbreviated tree hash
2133</p>
2134</li>
2135<li>
2136<p>
2137<em>%P</em>: parent hashes
2138</p>
2139</li>
2140<li>
2141<p>
2142<em>%p</em>: abbreviated parent hashes
2143</p>
2144</li>
2145<li>
2146<p>
2147<em>%an</em>: author name
2148</p>
2149</li>
2150<li>
2151<p>
Junio C Hamano8bc410e2009-02-15 10:38:192152<em>%aN</em>: author name (respecting .mailmap, see <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)
Junio C Hamanof5a93622008-07-16 03:23:572153</p>
2154</li>
2155<li>
2156<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:362157<em>%ae</em>: author email
2158</p>
2159</li>
2160<li>
2161<p>
Junio C Hamano8bc410e2009-02-15 10:38:192162<em>%aE</em>: author email (respecting .mailmap, see <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)
2163</p>
2164</li>
2165<li>
2166<p>
Junio C Hamanoa387df32008-08-29 08:56:582167<em>%ad</em>: author date (format respects --date= option)
Junio C Hamanoa3fd83c2007-03-02 10:34:362168</p>
2169</li>
2170<li>
2171<p>
2172<em>%aD</em>: author date, RFC2822 style
2173</p>
2174</li>
2175<li>
2176<p>
2177<em>%ar</em>: author date, relative
2178</p>
2179</li>
2180<li>
2181<p>
2182<em>%at</em>: author date, UNIX timestamp
2183</p>
2184</li>
2185<li>
2186<p>
Junio C Hamano02f130b2007-07-14 08:26:562187<em>%ai</em>: author date, ISO 8601 format
2188</p>
2189</li>
2190<li>
2191<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:362192<em>%cn</em>: committer name
2193</p>
2194</li>
2195<li>
2196<p>
Junio C Hamano8bc410e2009-02-15 10:38:192197<em>%cN</em>: committer name (respecting .mailmap, see <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)
Junio C Hamanof5a93622008-07-16 03:23:572198</p>
2199</li>
2200<li>
2201<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:362202<em>%ce</em>: committer email
2203</p>
2204</li>
2205<li>
2206<p>
Junio C Hamano8bc410e2009-02-15 10:38:192207<em>%cE</em>: committer email (respecting .mailmap, see <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)
2208</p>
2209</li>
2210<li>
2211<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:362212<em>%cd</em>: committer date
2213</p>
2214</li>
2215<li>
2216<p>
2217<em>%cD</em>: committer date, RFC2822 style
2218</p>
2219</li>
2220<li>
2221<p>
2222<em>%cr</em>: committer date, relative
2223</p>
2224</li>
2225<li>
2226<p>
2227<em>%ct</em>: committer date, UNIX timestamp
2228</p>
2229</li>
2230<li>
2231<p>
Junio C Hamano02f130b2007-07-14 08:26:562232<em>%ci</em>: committer date, ISO 8601 format
2233</p>
2234</li>
2235<li>
2236<p>
Junio C Hamano5e4d8de2008-09-19 06:27:022237<em>%d</em>: ref names, like the --decorate option of <a href="git-log.html">git-log(1)</a>
2238</p>
2239</li>
2240<li>
2241<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:362242<em>%e</em>: encoding
2243</p>
2244</li>
2245<li>
2246<p>
2247<em>%s</em>: subject
2248</p>
2249</li>
2250<li>
2251<p>
Junio C Hamano5f9a6f02009-04-06 08:26:562252<em>%f</em>: sanitized subject line, suitable for a filename
2253</p>
2254</li>
2255<li>
2256<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:362257<em>%b</em>: body
2258</p>
2259</li>
2260<li>
2261<p>
Junio C Hamanocb39aea2010-05-09 07:24:482262<em>%B</em>: raw body (unwrapped subject and body)
2263</p>
2264</li>
2265<li>
2266<p>
Junio C Hamano3b70d3c2009-11-21 17:37:372267<em>%N</em>: commit notes
2268</p>
2269</li>
2270<li>
2271<p>
Junio C Hamanoc21ab052009-10-31 04:03:552272<em>%gD</em>: reflog selector, e.g., <tt>refs/stash@{1}</tt>
2273</p>
2274</li>
2275<li>
2276<p>
2277<em>%gd</em>: shortened reflog selector, e.g., <tt>stash@{1}</tt>
2278</p>
2279</li>
2280<li>
2281<p>
2282<em>%gs</em>: reflog subject
2283</p>
2284</li>
2285<li>
2286<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:362287<em>%Cred</em>: switch color to red
2288</p>
2289</li>
2290<li>
2291<p>
2292<em>%Cgreen</em>: switch color to green
2293</p>
2294</li>
2295<li>
2296<p>
2297<em>%Cblue</em>: switch color to blue
2298</p>
2299</li>
2300<li>
2301<p>
2302<em>%Creset</em>: reset color
2303</p>
2304</li>
2305<li>
2306<p>
Junio C Hamanocc0cb312009-01-22 03:38:502307<em>%C(&#8230;)</em>: color specification, as described in color.branch.* config option
2308</p>
2309</li>
2310<li>
2311<p>
Junio C Hamanod9e0e5d2007-04-14 16:22:042312<em>%m</em>: left, right or boundary mark
2313</p>
2314</li>
2315<li>
2316<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:362317<em>%n</em>: newline
2318</p>
Junio C Hamano0430e3a2007-05-15 03:13:172319</li>
Junio C Hamanob78d2592008-04-09 09:39:082320<li>
2321<p>
Junio C Hamanoa9701f02010-01-21 00:42:162322<em>%%</em>: a raw <em>%</em>
2323</p>
2324</li>
2325<li>
2326<p>
Junio C Hamanob78d2592008-04-09 09:39:082327<em>%x00</em>: print a byte from a hex code
2328</p>
2329</li>
Junio C Hamanobf984de2009-11-23 06:11:192330<li>
2331<p>
2332<em>%w([&lt;w&gt;[,&lt;i1&gt;[,&lt;i2&gt;]]])</em>: switch line wrapping, like the -w option of
Junio C Hamano5706e0b2009-11-24 10:54:162333 <a href="git-shortlog.html">git-shortlog(1)</a>.
Junio C Hamanobf984de2009-11-23 06:11:192334</p>
2335</li>
Junio C Hamanoba4b9282008-07-06 05:20:312336</ul></div>
Junio C Hamanoa3fd83c2007-03-02 10:34:362337</li>
Junio C Hamanoc21ab052009-10-31 04:03:552338</ul></div>
2339<div class="admonitionblock">
2340<table><tr>
2341<td class="icon">
2342<div class="title">Note</div>
2343</td>
2344<td class="content">Some placeholders may depend on other options given to the
2345revision traversal engine. For example, the <tt>%g*</tt> reflog options will
2346insert an empty string unless we are traversing reflog entries (e.g., by
2347<tt>git log -g</tt>). The <tt>%d</tt> placeholder will use the "short" decoration
2348format if <tt>--decorate</tt> was not already provided on the command line.</td>
2349</tr></table>
2350</div>
Junio C Hamano2bd8a742009-12-01 21:16:592351<div class="para"><p>If you add a <tt>&#43;</tt> (plus sign) after <em>%</em> of a placeholder, a line-feed
2352is inserted immediately before the expansion if and only if the
2353placeholder expands to a non-empty string.</p></div>
2354<div class="para"><p>If you add a <tt>-</tt> (minus sign) after <em>%</em> of a placeholder, line-feeds that
2355immediately precede the expansion are deleted if and only if the
2356placeholder expands to an empty string.</p></div>
Junio C Hamano89a57342010-06-22 23:22:552357<div class="para"><p>If you add a <tt> </tt> (space) after <em>%</em> of a placeholder, a space
2358is inserted immediately before the expansion if and only if the
2359placeholder expands to a non-empty string.</p></div>
Junio C Hamanoc21ab052009-10-31 04:03:552360<div class="ilist"><ul>
Junio C Hamano6fb124c2008-06-13 10:04:012361<li>
2362<p>
2363<em>tformat:</em>
2364</p>
Junio C Hamanoba4b9282008-07-06 05:20:312365<div class="para"><p>The <em>tformat:</em> format works exactly like <em>format:</em>, except that it
Junio C Hamano6fb124c2008-06-13 10:04:012366provides "terminator" semantics instead of "separator" semantics. In
2367other words, each commit has the message terminator character (usually a
2368newline) appended, rather than a separator placed between entries.
2369This means that the final entry of a single-line format will be properly
2370terminated with a new line, just as the "oneline" format does.
Junio C Hamanoba4b9282008-07-06 05:20:312371For example:</p></div>
Junio C Hamano6fb124c2008-06-13 10:04:012372<div class="listingblock">
2373<div class="content">
2374<pre><tt>$ git log -2 --pretty=format:%h 4da45bef \
2375 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
23764da45be
23777134973 -- NO NEWLINE
2378
2379$ git log -2 --pretty=tformat:%h 4da45bef \
2380 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
23814da45be
23827134973</tt></pre>
2383</div></div>
Junio C Hamano0a235222009-03-06 08:21:092384<div class="para"><p>In addition, any unrecognized string that has a <tt>%</tt> in it is interpreted
2385as if it has <tt>tformat:</tt> in front of it. For example, these two are
2386equivalent:</p></div>
2387<div class="listingblock">
2388<div class="content">
2389<pre><tt>$ git log -2 --pretty=tformat:%h 4da45bef
2390$ git log -2 --pretty=%h 4da45bef</tt></pre>
2391</div></div>
Junio C Hamano6fb124c2008-06-13 10:04:012392</li>
Junio C Hamanoba4b9282008-07-06 05:20:312393</ul></div>
Junio C Hamano1a4e8412005-12-27 08:17:232394</div>
Junio C Hamanoba4b9282008-07-06 05:20:312395<h2 id="_generating_patches_with_p">Generating patches with -p</h2>
Junio C Hamano00b8b632007-12-07 09:50:492396<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:312397<div class="para"><p>When "git-diff-index", "git-diff-tree", or "git-diff-files" are run
Junio C Hamano00b8b632007-12-07 09:50:492398with a <em>-p</em> option, "git diff" without the <em>--raw</em> option, or
2399"git log" with the "-p" option, they
2400do not produce the output described above; instead they produce a
2401patch file. You can customize the creation of such patches via the
Junio C Hamanoba4b9282008-07-06 05:20:312402GIT_EXTERNAL_DIFF and the GIT_DIFF_OPTS environment variables.</p></div>
2403<div class="para"><p>What the -p option produces is slightly different from the traditional
2404diff format.</p></div>
2405<div class="olist"><ol>
Junio C Hamano00b8b632007-12-07 09:50:492406<li>
2407<p>
2408It is preceded with a "git diff" header, that looks like
2409 this:
2410</p>
2411<div class="literalblock">
2412<div class="content">
2413<pre><tt>diff --git a/file1 b/file2</tt></pre>
2414</div></div>
Junio C Hamanoba4b9282008-07-06 05:20:312415<div class="para"><p>The <tt>a/</tt> and <tt>b/</tt> filenames are the same unless rename/copy is
Junio C Hamano00b8b632007-12-07 09:50:492416involved. Especially, even for a creation or a deletion,
Junio C Hamanoe1b26832009-11-15 10:02:562417<tt>/dev/null</tt> is _not_ used in place of <tt>a/</tt> or <tt>b/</tt> filenames.</p></div>
Junio C Hamanoba4b9282008-07-06 05:20:312418<div class="para"><p>When rename/copy is involved, <tt>file1</tt> and <tt>file2</tt> show the
Junio C Hamano00b8b632007-12-07 09:50:492419name of the source file of the rename/copy and the name of
Junio C Hamanoba4b9282008-07-06 05:20:312420the file that rename/copy produces, respectively.</p></div>
Junio C Hamano00b8b632007-12-07 09:50:492421</li>
2422<li>
2423<p>
2424It is followed by one or more extended header lines:
2425</p>
2426<div class="literalblock">
2427<div class="content">
2428<pre><tt>old mode &lt;mode&gt;
2429new mode &lt;mode&gt;
2430deleted file mode &lt;mode&gt;
2431new file mode &lt;mode&gt;
2432copy from &lt;path&gt;
2433copy to &lt;path&gt;
2434rename from &lt;path&gt;
2435rename to &lt;path&gt;
2436similarity index &lt;number&gt;
2437dissimilarity index &lt;number&gt;
2438index &lt;hash&gt;..&lt;hash&gt; &lt;mode&gt;</tt></pre>
2439</div></div>
2440</li>
2441<li>
2442<p>
2443TAB, LF, double quote and backslash characters in pathnames
2444 are represented as <tt>\t</tt>, <tt>\n</tt>, <tt>\"</tt> and <tt>\\</tt>, respectively.
2445 If there is need for such substitution then the whole
2446 pathname is put in double quotes.
2447</p>
2448</li>
Junio C Hamanoba4b9282008-07-06 05:20:312449</ol></div>
2450<div class="para"><p>The similarity index is the percentage of unchanged lines, and
Junio C Hamano00b8b632007-12-07 09:50:492451the dissimilarity index is the percentage of changed lines. It
2452is a rounded down integer, followed by a percent sign. The
2453similarity index value of 100% is thus reserved for two equal
2454files, while 100% dissimilarity means that no line from the old
Junio C Hamanoba4b9282008-07-06 05:20:312455file made it into the new one.</p></div>
Junio C Hamano00b8b632007-12-07 09:50:492456</div>
Junio C Hamanoba4b9282008-07-06 05:20:312457<h2 id="_combined_diff_format">combined diff format</h2>
Junio C Hamano00b8b632007-12-07 09:50:492458<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:312459<div class="para"><p>"git-diff-tree", "git-diff-files" and "git-diff" can take <em>-c</em> or
Junio C Hamano00b8b632007-12-07 09:50:492460<em>--cc</em> option to produce <em>combined diff</em>. For showing a merge commit
Junio C Hamano31667362010-03-25 00:38:532461with "git log -p", this is the default format; you can force showing
2462full diff with the <em>-m</em> option.
Junio C Hamanoba4b9282008-07-06 05:20:312463A <em>combined diff</em> format looks like this:</p></div>
Junio C Hamano00b8b632007-12-07 09:50:492464<div class="listingblock">
2465<div class="content">
2466<pre><tt>diff --combined describe.c
2467index fabadb8,cc95eb0..4866510
2468--- a/describe.c
2469+++ b/describe.c
2470@@@ -98,20 -98,12 +98,20 @@@
2471 return (a_date &gt; b_date) ? -1 : (a_date == b_date) ? 0 : 1;
2472 }
2473
2474- static void describe(char *arg)
2475 -static void describe(struct commit *cmit, int last_one)
2476++static void describe(char *arg, int last_one)
2477 {
2478 + unsigned char sha1[20];
2479 + struct commit *cmit;
2480 struct commit_list *list;
2481 static int initialized = 0;
2482 struct commit_name *n;
2483
2484 + if (get_sha1(arg, sha1) &lt; 0)
2485 + usage(describe_usage);
2486 + cmit = lookup_commit_reference(sha1);
2487 + if (!cmit)
2488 + usage(describe_usage);
2489 +
2490 if (!initialized) {
2491 initialized = 1;
2492 for_each_ref(get_name);</tt></pre>
2493</div></div>
Junio C Hamanoba4b9282008-07-06 05:20:312494<div class="olist"><ol>
Junio C Hamano00b8b632007-12-07 09:50:492495<li>
2496<p>
2497It is preceded with a "git diff" header, that looks like
2498 this (when <em>-c</em> option is used):
2499</p>
2500<div class="literalblock">
2501<div class="content">
2502<pre><tt>diff --combined file</tt></pre>
2503</div></div>
Junio C Hamanoba4b9282008-07-06 05:20:312504<div class="para"><p>or like this (when <em>--cc</em> option is used):</p></div>
Junio C Hamano00b8b632007-12-07 09:50:492505<div class="literalblock">
2506<div class="content">
Junio C Hamano0868a302008-07-22 09:20:442507<pre><tt>diff --cc file</tt></pre>
Junio C Hamano00b8b632007-12-07 09:50:492508</div></div>
2509</li>
2510<li>
2511<p>
2512It is followed by one or more extended header lines
2513 (this example shows a merge with two parents):
2514</p>
2515<div class="literalblock">
2516<div class="content">
2517<pre><tt>index &lt;hash&gt;,&lt;hash&gt;..&lt;hash&gt;
2518mode &lt;mode&gt;,&lt;mode&gt;..&lt;mode&gt;
2519new file mode &lt;mode&gt;
2520deleted file mode &lt;mode&gt;,&lt;mode&gt;</tt></pre>
2521</div></div>
Junio C Hamanoba4b9282008-07-06 05:20:312522<div class="para"><p>The <tt>mode &lt;mode&gt;,&lt;mode&gt;..&lt;mode&gt;</tt> line appears only if at least one of
Junio C Hamano00b8b632007-12-07 09:50:492523the &lt;mode&gt; is different from the rest. Extended headers with
2524information about detected contents movement (renames and
2525copying detection) are designed to work with diff of two
Junio C Hamanoba4b9282008-07-06 05:20:312526&lt;tree-ish&gt; and are not used by combined diff format.</p></div>
Junio C Hamano00b8b632007-12-07 09:50:492527</li>
2528<li>
2529<p>
2530It is followed by two-line from-file/to-file header
2531</p>
2532<div class="literalblock">
2533<div class="content">
2534<pre><tt>--- a/file
2535+++ b/file</tt></pre>
2536</div></div>
Junio C Hamanoba4b9282008-07-06 05:20:312537<div class="para"><p>Similar to two-line header for traditional <em>unified</em> diff
Junio C Hamano00b8b632007-12-07 09:50:492538format, <tt>/dev/null</tt> is used to signal created or deleted
Junio C Hamanoba4b9282008-07-06 05:20:312539files.</p></div>
Junio C Hamano00b8b632007-12-07 09:50:492540</li>
2541<li>
2542<p>
2543Chunk header format is modified to prevent people from
2544 accidentally feeding it to <tt>patch -p1</tt>. Combined diff format
2545 was created for review of merge commit changes, and was not
2546 meant for apply. The change is similar to the change in the
2547 extended <em>index</em> header:
2548</p>
2549<div class="literalblock">
2550<div class="content">
2551<pre><tt>@@@ &lt;from-file-range&gt; &lt;from-file-range&gt; &lt;to-file-range&gt; @@@</tt></pre>
2552</div></div>
Junio C Hamanoba4b9282008-07-06 05:20:312553<div class="para"><p>There are (number of parents + 1) <tt>@</tt> characters in the chunk
2554header for combined diff format.</p></div>
Junio C Hamano00b8b632007-12-07 09:50:492555</li>
Junio C Hamanoba4b9282008-07-06 05:20:312556</ol></div>
2557<div class="para"><p>Unlike the traditional <em>unified</em> diff format, which shows two
Junio C Hamano00b8b632007-12-07 09:50:492558files A and B with a single column that has <tt>-</tt> (minus &#8212;
2559appears in A but removed in B), <tt>+</tt> (plus &#8212; missing in A but
2560added to B), or <tt>" "</tt> (space &#8212; unchanged) prefix, this format
2561compares two or more files file1, file2,&#8230; with one file X, and
2562shows how X differs from each of fileN. One column for each of
2563fileN is prepended to the output line to note how X's line is
Junio C Hamanoba4b9282008-07-06 05:20:312564different from it.</p></div>
2565<div class="para"><p>A <tt>-</tt> character in the column N means that the line appears in
Junio C Hamano00b8b632007-12-07 09:50:492566fileN but it does not appear in the result. A <tt>+</tt> character
Junio C Hamano54bf1e22008-12-20 06:30:112567in the column N means that the line appears in the result,
Junio C Hamano00b8b632007-12-07 09:50:492568and fileN does not have that line (in other words, the line was
Junio C Hamanoba4b9282008-07-06 05:20:312569added, from the point of view of that parent).</p></div>
2570<div class="para"><p>In the above example output, the function signature was changed
Junio C Hamano00b8b632007-12-07 09:50:492571from both files (hence two <tt>-</tt> removals from both file1 and
Junio C Hamano5e4d8de2008-09-19 06:27:022572file2, plus <tt>++</tt> to mean one line that was added does not appear
Junio C Hamano54bf1e22008-12-20 06:30:112573in either file1 nor file2). Also eight other lines are the same
2574from file1 but do not appear in file2 (hence prefixed with <tt>&#43;</tt>).</p></div>
Junio C Hamanoba4b9282008-07-06 05:20:312575<div class="para"><p>When shown by <tt>git diff-tree -c</tt>, it compares the parents of a
Junio C Hamano00b8b632007-12-07 09:50:492576merge commit with the merge result (i.e. file1..fileN are the
2577parents). When shown by <tt>git diff-files -c</tt>, it compares the
2578two unresolved merge parents with the working tree file
2579(i.e. file1 is stage 2 aka "our version", file2 is stage 3 aka
Junio C Hamanoba4b9282008-07-06 05:20:312580"their version").</p></div>
Junio C Hamano00b8b632007-12-07 09:50:492581</div>
Junio C Hamanoba4b9282008-07-06 05:20:312582<h2 id="_examples">Examples</h2>
Junio C Hamano1a4e8412005-12-27 08:17:232583<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:312584<div class="vlist"><dl>
Junio C Hamano1a4e8412005-12-27 08:17:232585<dt>
2586git log --no-merges
2587</dt>
2588<dd>
2589<p>
2590 Show the whole commit history, but skip any merges
2591</p>
2592</dd>
2593<dt>
2594git log v2.6.12.. include/scsi drivers/scsi
2595</dt>
2596<dd>
2597<p>
2598 Show all commits since version <em>v2.6.12</em> that changed any file
2599 in the include/scsi or drivers/scsi subdirectories
2600</p>
2601</dd>
2602<dt>
Junio C Hamano1bb569e2006-05-05 23:14:252603git log --since="2 weeks ago" -- gitk
Junio C Hamano1a4e8412005-12-27 08:17:232604</dt>
2605<dd>
2606<p>
2607 Show the changes during the last two weeks to the file <em>gitk</em>.
2608 The "--" is necessary to avoid confusion with the <strong>branch</strong> named
2609 <em>gitk</em>
2610</p>
2611</dd>
Junio C Hamanoba7c8d82006-04-15 06:17:422612<dt>
Junio C Hamano7d9e9bd2007-08-29 07:31:472613git log --name-status release..test
Junio C Hamanoba7c8d82006-04-15 06:17:422614</dt>
2615<dd>
2616<p>
2617 Show the commits that are in the "test" branch but not yet
2618 in the "release" branch, along with the list of paths
2619 each commit modifies.
2620</p>
2621</dd>
Junio C Hamano235d53f2007-07-13 00:25:152622<dt>
2623git log --follow builtin-rev-list.c
2624</dt>
2625<dd>
2626<p>
2627 Shows the commits that changed builtin-rev-list.c, including
2628 those commits that occurred before the file was given its
2629 present name.
2630</p>
2631</dd>
Junio C Hamano57827fb2010-01-23 03:02:502632<dt>
2633git log --branches --not --remotes=origin
2634</dt>
2635<dd>
2636<p>
2637 Shows all commits that are in any of local branches but not in
2638 any of remote tracking branches for <em>origin</em> (what you have that
2639 origin doesn't).
2640</p>
2641</dd>
2642<dt>
2643git log master --not --remotes=*/master
2644</dt>
2645<dd>
2646<p>
2647 Shows all commits that are in local master but not in any remote
2648 repository master branches.
2649</p>
2650</dd>
Junio C Hamano31667362010-03-25 00:38:532651<dt>
2652git log -p -m --first-parent
2653</dt>
2654<dd>
2655<p>
2656 Shows the history including change diffs, but only from the
2657 "main branch" perspective, skipping commits that come from merged
2658 branches, and showing full diffs of changes introduced by the merges.
2659 This makes sense only when following a strict policy of merging all
2660 topic branches when staying on a single integration branch.
2661</p>
2662</dd>
Junio C Hamanoba4b9282008-07-06 05:20:312663</dl></div>
Junio C Hamano1a4e8412005-12-27 08:17:232664</div>
Junio C Hamanoba4b9282008-07-06 05:20:312665<h2 id="_discussion">Discussion</h2>
Junio C Hamano775a0f42006-12-31 01:19:142666<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:312667<div class="para"><p>At the core level, git is character encoding agnostic.</p></div>
2668<div class="ilist"><ul>
Junio C Hamano775a0f42006-12-31 01:19:142669<li>
2670<p>
2671The pathnames recorded in the index and in the tree objects
2672 are treated as uninterpreted sequences of non-NUL bytes.
2673 What readdir(2) returns are what are recorded and compared
2674 with the data git keeps track of, which in turn are expected
2675 to be what lstat(2) and creat(2) accepts. There is no such
2676 thing as pathname encoding translation.
2677</p>
2678</li>
2679<li>
2680<p>
Junio C Hamano54bf1e22008-12-20 06:30:112681The contents of the blob objects are uninterpreted sequences
Junio C Hamano775a0f42006-12-31 01:19:142682 of bytes. There is no encoding translation at the core
2683 level.
2684</p>
2685</li>
2686<li>
2687<p>
Junio C Hamano54bf1e22008-12-20 06:30:112688The commit log messages are uninterpreted sequences of non-NUL
Junio C Hamano775a0f42006-12-31 01:19:142689 bytes.
2690</p>
2691</li>
Junio C Hamanoba4b9282008-07-06 05:20:312692</ul></div>
2693<div class="para"><p>Although we encourage that the commit log messages are encoded
Junio C Hamano775a0f42006-12-31 01:19:142694in UTF-8, both the core and git Porcelain are designed not to
2695force UTF-8 on projects. If all participants of a particular
2696project find it more convenient to use legacy encodings, git
2697does not forbid it. However, there are a few things to keep in
Junio C Hamanoba4b9282008-07-06 05:20:312698mind.</p></div>
2699<div class="olist"><ol>
Junio C Hamano775a0f42006-12-31 01:19:142700<li>
2701<p>
Junio C Hamano1aa40d22010-01-21 17:46:432702<em>git commit</em> and <em>git commit-tree</em> issues
Junio C Hamano14b76482008-01-05 10:32:262703 a warning if the commit log message given to it does not look
Junio C Hamano775a0f42006-12-31 01:19:142704 like a valid UTF-8 string, unless you explicitly say your
2705 project uses a legacy encoding. The way to say this is to
Junio C Hamano35bb3f62007-02-19 05:35:532706 have i18n.commitencoding in <tt>.git/config</tt> file, like this:
Junio C Hamano775a0f42006-12-31 01:19:142707</p>
2708<div class="listingblock">
2709<div class="content">
Junio C Hamano35bb3f62007-02-19 05:35:532710<pre><tt>[i18n]
Junio C Hamano775a0f42006-12-31 01:19:142711 commitencoding = ISO-8859-1</tt></pre>
2712</div></div>
Junio C Hamanoba4b9282008-07-06 05:20:312713<div class="para"><p>Commit objects created with the above setting record the value
Junio C Hamano35bb3f62007-02-19 05:35:532714of <tt>i18n.commitencoding</tt> in its <tt>encoding</tt> header. This is to
Junio C Hamano775a0f42006-12-31 01:19:142715help other people who look at them later. Lack of this header
Junio C Hamanoba4b9282008-07-06 05:20:312716implies that the commit log message is encoded in UTF-8.</p></div>
Junio C Hamano775a0f42006-12-31 01:19:142717</li>
2718<li>
2719<p>
Junio C Hamano1aa40d22010-01-21 17:46:432720<em>git log</em>, <em>git show</em>, <em>git blame</em> and friends look at the
Junio C Hamanoaa17c7c2008-11-03 04:36:582721 <tt>encoding</tt> header of a commit object, and try to re-code the
2722 log message into UTF-8 unless otherwise specified. You can
Junio C Hamano775a0f42006-12-31 01:19:142723 specify the desired output encoding with
Junio C Hamano35bb3f62007-02-19 05:35:532724 <tt>i18n.logoutputencoding</tt> in <tt>.git/config</tt> file, like this:
Junio C Hamano775a0f42006-12-31 01:19:142725</p>
2726<div class="listingblock">
2727<div class="content">
Junio C Hamano35bb3f62007-02-19 05:35:532728<pre><tt>[i18n]
Junio C Hamano775a0f42006-12-31 01:19:142729 logoutputencoding = ISO-8859-1</tt></pre>
2730</div></div>
Junio C Hamanoba4b9282008-07-06 05:20:312731<div class="para"><p>If you do not have this configuration variable, the value of
2732<tt>i18n.commitencoding</tt> is used instead.</p></div>
Junio C Hamano775a0f42006-12-31 01:19:142733</li>
Junio C Hamanoba4b9282008-07-06 05:20:312734</ol></div>
2735<div class="para"><p>Note that we deliberately chose not to re-code the commit log
Junio C Hamano775a0f42006-12-31 01:19:142736message when a commit is made to force UTF-8 at the commit
2737object level, because re-coding to UTF-8 is not necessarily a
Junio C Hamanoba4b9282008-07-06 05:20:312738reversible operation.</p></div>
Junio C Hamano775a0f42006-12-31 01:19:142739</div>
Junio C Hamanoa574a092010-06-13 19:57:102740<h2 id="_configuration">Configuration</h2>
2741<div class="sectionbody">
2742<div class="para"><p>See <a href="git-config.html">git-config(1)</a> for core variables and <a href="git-diff.html">git-diff(1)</a>
2743for settings related to diff generation.</p></div>
2744<div class="vlist"><dl>
2745<dt>
2746format.pretty
2747</dt>
2748<dd>
2749<p>
2750 Default for the <tt>--format</tt> option. (See "PRETTY FORMATS" above.)
2751 Defaults to "medium".
2752</p>
2753</dd>
2754<dt>
2755i18n.logOutputEncoding
2756</dt>
2757<dd>
2758<p>
2759 Encoding to use when displaying logs. (See "Discussion", above.)
2760 Defaults to the value of <tt>i18n.commitEncoding</tt> if set, UTF-8
2761 otherwise.
2762</p>
2763</dd>
2764<dt>
2765log.date
2766</dt>
2767<dd>
2768<p>
2769 Default format for human-readable dates. (Compare the
2770 <tt>--date</tt> option.) Defaults to "default", which means to write
2771 dates like <tt>Sat May 8 19:35:34 2010 -0500</tt>.
2772</p>
2773</dd>
2774<dt>
2775log.showroot
2776</dt>
2777<dd>
2778<p>
2779 If <tt>false</tt>, <em>git log</em> and related commands will not treat the
2780 initial commit as a big creation event. Any root commits in
2781 <tt>git log -p</tt> output would be shown without a diff attached.
2782 The default is <tt>true</tt>.
2783</p>
2784</dd>
2785<dt>
2786mailmap.file
2787</dt>
2788<dd>
2789<p>
2790 See <a href="git-shortlog.html">git-shortlog(1)</a>.
2791</p>
2792</dd>
2793<dt>
2794notes.displayRef
2795</dt>
2796<dd>
2797<p>
2798 Which refs, in addition to the default set by <tt>core.notesRef</tt>
2799 or <em>GIT_NOTES_REF</em>, to read notes from when showing commit
2800 messages with the <em>log</em> family of commands. See
2801 <a href="git-notes.html">git-notes(1)</a>.
2802</p>
2803<div class="para"><p>May be an unabbreviated ref name or a glob and may be specified
2804multiple times. A warning will be issued for refs that do not exist,
2805but a glob that does not match any refs is silently ignored.</p></div>
2806<div class="para"><p>This setting can be disabled by the <tt>--no-standard-notes</tt> option,
2807overridden by the <em>GIT_NOTES_DISPLAY_REF</em> environment variable,
2808and supplemented by the <tt>--show-notes</tt> option.</p></div>
2809</dd>
2810</dl></div>
2811</div>
Junio C Hamanoba4b9282008-07-06 05:20:312812<h2 id="_author">Author</h2>
Junio C Hamano1a4e8412005-12-27 08:17:232813<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:312814<div class="para"><p>Written by Linus Torvalds &lt;torvalds@osdl.org&gt;</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232815</div>
Junio C Hamanoba4b9282008-07-06 05:20:312816<h2 id="_documentation">Documentation</h2>
Junio C Hamano1a4e8412005-12-27 08:17:232817<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:312818<div class="para"><p>Documentation by David Greaves, Junio C Hamano and the git-list &lt;git@vger.kernel.org&gt;.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232819</div>
Junio C Hamanoba4b9282008-07-06 05:20:312820<h2 id="_git">GIT</h2>
Junio C Hamano1a4e8412005-12-27 08:17:232821<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:312822<div class="para"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232823</div>
2824<div id="footer">
2825<div id="footer-text">
Junio C Hamano08acb732010-07-21 21:58:332826Last updated 2010-07-21 21:55:27 UTC
Junio C Hamano1a4e8412005-12-27 08:17:232827</div>
2828</div>
2829</body>
2830</html>