Autogenerated HTML docs for v1.7.5-rc1
[git/jnareb-git.git] / git-log.html
blob6ce5a54f9240a3ac9852d176dfdc181551199a9f
1 <!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" />
6 <meta name="generator" content="AsciiDoc 8.4.5" />
7 <title>git-log(1)</title>
8 <style type="text/css">
9 /* Debug borders */
10 p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {
12 border: 1px solid red;
16 body {
17 margin: 1em 5% 1em 5%;
20 a {
21 color: blue;
22 text-decoration: underline;
24 a:visited {
25 color: fuchsia;
28 em {
29 font-style: italic;
30 color: navy;
33 strong {
34 font-weight: bold;
35 color: #083194;
38 tt {
39 color: navy;
42 h1, h2, h3, h4, h5, h6 {
43 color: #527bbd;
44 font-family: sans-serif;
45 margin-top: 1.2em;
46 margin-bottom: 0.5em;
47 line-height: 1.3;
50 h1, h2, h3 {
51 border-bottom: 2px solid silver;
53 h2 {
54 padding-top: 0.5em;
56 h3 {
57 float: left;
59 h3 + * {
60 clear: left;
63 div.sectionbody {
64 font-family: serif;
65 margin-left: 0;
68 hr {
69 border: 1px solid silver;
72 p {
73 margin-top: 0.5em;
74 margin-bottom: 0.5em;
77 ul, ol, li > p {
78 margin-top: 0;
81 pre {
82 padding: 0;
83 margin: 0;
86 span#author {
87 color: #527bbd;
88 font-family: sans-serif;
89 font-weight: bold;
90 font-size: 1.1em;
92 span#email {
94 span#revnumber, span#revdate, span#revremark {
95 font-family: sans-serif;
98 div#footer {
99 font-family: sans-serif;
100 font-size: small;
101 border-top: 2px solid silver;
102 padding-top: 0.5em;
103 margin-top: 4.0em;
105 div#footer-text {
106 float: left;
107 padding-bottom: 0.5em;
109 div#footer-badges {
110 float: right;
111 padding-bottom: 0.5em;
114 div#preamble {
115 margin-top: 1.5em;
116 margin-bottom: 1.5em;
118 div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
119 div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
120 div.admonitionblock {
121 margin-top: 1.5em;
122 margin-bottom: 1.5em;
124 div.admonitionblock {
125 margin-top: 2.5em;
126 margin-bottom: 2.5em;
129 div.content { /* Block element content. */
130 padding: 0;
133 /* Block element titles. */
134 div.title, caption.title {
135 color: #527bbd;
136 font-family: sans-serif;
137 font-weight: bold;
138 text-align: left;
139 margin-top: 1.0em;
140 margin-bottom: 0.5em;
142 div.title + * {
143 margin-top: 0;
146 td div.title:first-child {
147 margin-top: 0.0em;
149 div.content div.title:first-child {
150 margin-top: 0.0em;
152 div.content + div.title {
153 margin-top: 0.0em;
156 div.sidebarblock > div.content {
157 background: #ffffee;
158 border: 1px solid silver;
159 padding: 0.5em;
162 div.listingblock > div.content {
163 border: 1px solid silver;
164 background: #f4f4f4;
165 padding: 0.5em;
168 div.quoteblock {
169 padding-left: 2.0em;
170 margin-right: 10%;
172 div.quoteblock > div.attribution {
173 padding-top: 0.5em;
174 text-align: right;
177 div.verseblock {
178 padding-left: 2.0em;
179 margin-right: 10%;
181 div.verseblock > div.content {
182 white-space: pre;
184 div.verseblock > div.attribution {
185 padding-top: 0.75em;
186 text-align: left;
188 /* DEPRECATED: Pre version 8.2.7 verse style literal block. */
189 div.verseblock + div.attribution {
190 text-align: left;
193 div.admonitionblock .icon {
194 vertical-align: top;
195 font-size: 1.1em;
196 font-weight: bold;
197 text-decoration: underline;
198 color: #527bbd;
199 padding-right: 0.5em;
201 div.admonitionblock td.content {
202 padding-left: 0.5em;
203 border-left: 2px solid silver;
206 div.exampleblock > div.content {
207 border-left: 2px solid silver;
208 padding: 0.5em;
211 div.imageblock div.content { padding-left: 0; }
212 span.image img { border-style: none; }
213 a.image:visited { color: white; }
215 dl {
216 margin-top: 0.8em;
217 margin-bottom: 0.8em;
219 dt {
220 margin-top: 0.5em;
221 margin-bottom: 0;
222 font-style: normal;
223 color: navy;
225 dd > *:first-child {
226 margin-top: 0.1em;
229 ul, ol {
230 list-style-position: outside;
232 ol.arabic {
233 list-style-type: decimal;
235 ol.loweralpha {
236 list-style-type: lower-alpha;
238 ol.upperalpha {
239 list-style-type: upper-alpha;
241 ol.lowerroman {
242 list-style-type: lower-roman;
244 ol.upperroman {
245 list-style-type: upper-roman;
248 div.compact ul, div.compact ol,
249 div.compact p, div.compact p,
250 div.compact div, div.compact div {
251 margin-top: 0.1em;
252 margin-bottom: 0.1em;
255 div.tableblock > table {
256 border: 3px solid #527bbd;
258 thead {
259 font-family: sans-serif;
260 font-weight: bold;
262 tfoot {
263 font-weight: bold;
265 td > div.verse {
266 white-space: pre;
268 p.table {
269 margin-top: 0;
271 /* Because the table frame attribute is overriden by CSS in most browsers. */
272 div.tableblock > table[frame="void"] {
273 border-style: none;
275 div.tableblock > table[frame="hsides"] {
276 border-left-style: none;
277 border-right-style: none;
279 div.tableblock > table[frame="vsides"] {
280 border-top-style: none;
281 border-bottom-style: none;
285 div.hdlist {
286 margin-top: 0.8em;
287 margin-bottom: 0.8em;
289 div.hdlist tr {
290 padding-bottom: 15px;
292 dt.hdlist1.strong, td.hdlist1.strong {
293 font-weight: bold;
295 td.hdlist1 {
296 vertical-align: top;
297 font-style: normal;
298 padding-right: 0.8em;
299 color: navy;
301 td.hdlist2 {
302 vertical-align: top;
304 div.hdlist.compact tr {
305 margin: 0;
306 padding-bottom: 0;
309 .comment {
310 background: yellow;
313 @media print {
314 div#footer-badges { display: none; }
317 div#toctitle {
318 color: #527bbd;
319 font-family: sans-serif;
320 font-size: 1.1em;
321 font-weight: bold;
322 margin-top: 1.0em;
323 margin-bottom: 0.1em;
326 div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
327 margin-top: 0;
328 margin-bottom: 0;
330 div.toclevel2 {
331 margin-left: 2em;
332 font-size: 0.9em;
334 div.toclevel3 {
335 margin-left: 4em;
336 font-size: 0.9em;
338 div.toclevel4 {
339 margin-left: 6em;
340 font-size: 0.9em;
342 /* Overrides for manpage documents */
343 h1 {
344 padding-top: 0.5em;
345 padding-bottom: 0.5em;
346 border-top: 2px solid silver;
347 border-bottom: 2px solid silver;
349 h2 {
350 border-style: none;
352 div.sectionbody {
353 margin-left: 5%;
356 @media print {
357 div#toc { display: none; }
360 /* Workarounds for IE6's broken and incomplete CSS2. */
362 div.sidebar-content {
363 background: #ffffee;
364 border: 1px solid silver;
365 padding: 0.5em;
367 div.sidebar-title, div.image-title {
368 color: #527bbd;
369 font-family: sans-serif;
370 font-weight: bold;
371 margin-top: 0.0em;
372 margin-bottom: 0.5em;
375 div.listingblock div.content {
376 border: 1px solid silver;
377 background: #f4f4f4;
378 padding: 0.5em;
381 div.quoteblock-attribution {
382 padding-top: 0.5em;
383 text-align: right;
386 div.verseblock-content {
387 white-space: pre;
389 div.verseblock-attribution {
390 padding-top: 0.75em;
391 text-align: left;
394 div.exampleblock-content {
395 border-left: 2px solid silver;
396 padding-left: 0.5em;
399 /* IE6 sets dynamically generated links as visited. */
400 div#toc a:visited { color: blue; }
401 </style>
402 </head>
403 <body>
404 <div id="header">
405 <h1>
406 git-log(1) Manual Page
407 </h1>
408 <h2>NAME</h2>
409 <div class="sectionbody">
410 <p>git-log -
411 Show commit logs
412 </p>
413 </div>
414 </div>
415 <h2 id="_synopsis">SYNOPSIS</h2>
416 <div class="sectionbody">
417 <div class="paragraph"><p><em>git log</em> [&lt;options&gt;] [&lt;since&gt;..&lt;until&gt;] [[--] &lt;path&gt;&#8230;]</p></div>
418 </div>
419 <h2 id="_description">DESCRIPTION</h2>
420 <div class="sectionbody">
421 <div class="paragraph"><p>Shows the commit logs.</p></div>
422 <div class="paragraph"><p>The command takes options applicable to the <em>git rev-list</em>
423 command to control what is shown and how, and options applicable to
424 the <em>git diff-*</em> commands to control how the changes
425 each commit introduces are shown.</p></div>
426 </div>
427 <h2 id="_options">OPTIONS</h2>
428 <div class="sectionbody">
429 <div class="dlist"><dl>
430 <dt class="hdlist1">
431 -&lt;n&gt;
432 </dt>
433 <dd>
435 Limits the number of commits to show.
436 Note that this is a commit limiting option, see below.
437 </p>
438 </dd>
439 <dt class="hdlist1">
440 &lt;since&gt;..&lt;until&gt;
441 </dt>
442 <dd>
444 Show only commits between the named two commits. When
445 either &lt;since&gt; or &lt;until&gt; is omitted, it defaults to
446 <tt>HEAD</tt>, i.e. the tip of the current branch.
447 For a more complete list of ways to spell &lt;since&gt;
448 and &lt;until&gt;, see <a href="gitrevisions.html">gitrevisions(7)</a>.
449 </p>
450 </dd>
451 <dt class="hdlist1">
452 --follow
453 </dt>
454 <dd>
456 Continue listing the history of a file beyond renames
457 (works only for a single file).
458 </p>
459 </dd>
460 <dt class="hdlist1">
461 --no-decorate
462 </dt>
463 <dt class="hdlist1">
464 --decorate[=short|full|no]
465 </dt>
466 <dd>
468 Print out the ref names of any commits that are shown. If <em>short</em> is
469 specified, the ref name prefixes <em>refs/heads/</em>, <em>refs/tags/</em> and
470 <em>refs/remotes/</em> will not be printed. If <em>full</em> is specified, the
471 full ref name (including prefix) will be printed. The default option
472 is <em>short</em>.
473 </p>
474 </dd>
475 <dt class="hdlist1">
476 --source
477 </dt>
478 <dd>
480 Print out the ref name given on the command line by which each
481 commit was reached.
482 </p>
483 </dd>
484 <dt class="hdlist1">
485 --full-diff
486 </dt>
487 <dd>
489 Without this flag, "git log -p &lt;path&gt;&#8230;" shows commits that
490 touch the specified paths, and diffs about the same specified
491 paths. With this, the full diff is shown for commits that touch
492 the specified paths; this means that "&lt;path&gt;&#8230;" limits only
493 commits, and doesn&#8217;t limit diff for those commits.
494 </p>
495 <div class="paragraph"><p>Note that this affects all diff-based output types, e.g. those
496 produced by --stat etc.</p></div>
497 </dd>
498 <dt class="hdlist1">
499 --log-size
500 </dt>
501 <dd>
503 Before the log message print out its size in bytes. Intended
504 mainly for porcelain tools consumption. If git is unable to
505 produce a valid value size is set to zero.
506 Note that only message is considered, if also a diff is shown
507 its size is not included.
508 </p>
509 </dd>
510 <dt class="hdlist1">
511 [--] &lt;path&gt;&#8230;
512 </dt>
513 <dd>
515 Show only commits that affect any of the specified paths. To
516 prevent confusion with options and branch names, paths may need
517 to be prefixed with "-- " to separate them from options or
518 refnames.
519 </p>
520 </dd>
521 </dl></div>
522 <h3 id="_commit_limiting">Commit Limiting</h3><div style="clear:left"></div>
523 <div class="paragraph"><p>Besides specifying a range of commits that should be listed using the
524 special notations explained in the description, additional commit
525 limiting may be applied. Note that they are applied before commit
526 ordering and formatting options, such as <em>--reverse</em>.</p></div>
527 <div class="dlist"><dl>
528 <dt class="hdlist1">
529 -n <em>number</em>
530 </dt>
531 <dt class="hdlist1">
532 --max-count=&lt;number&gt;
533 </dt>
534 <dd>
536 Limit the number of commits to output.
537 </p>
538 </dd>
539 <dt class="hdlist1">
540 --skip=&lt;number&gt;
541 </dt>
542 <dd>
544 Skip <em>number</em> commits before starting to show the commit output.
545 </p>
546 </dd>
547 <dt class="hdlist1">
548 --since=&lt;date&gt;
549 </dt>
550 <dt class="hdlist1">
551 --after=&lt;date&gt;
552 </dt>
553 <dd>
555 Show commits more recent than a specific date.
556 </p>
557 </dd>
558 <dt class="hdlist1">
559 --until=&lt;date&gt;
560 </dt>
561 <dt class="hdlist1">
562 --before=&lt;date&gt;
563 </dt>
564 <dd>
566 Show commits older than a specific date.
567 </p>
568 </dd>
569 <dt class="hdlist1">
570 --author=&lt;pattern&gt;
571 </dt>
572 <dt class="hdlist1">
573 --committer=&lt;pattern&gt;
574 </dt>
575 <dd>
577 Limit the commits output to ones with author/committer
578 header lines that match the specified pattern (regular expression).
579 </p>
580 </dd>
581 <dt class="hdlist1">
582 --grep=&lt;pattern&gt;
583 </dt>
584 <dd>
586 Limit the commits output to ones with log message that
587 matches the specified pattern (regular expression).
588 </p>
589 </dd>
590 <dt class="hdlist1">
591 --all-match
592 </dt>
593 <dd>
595 Limit the commits output to ones that match all given --grep,
596 --author and --committer instead of ones that match at least one.
597 </p>
598 </dd>
599 <dt class="hdlist1">
601 </dt>
602 <dt class="hdlist1">
603 --regexp-ignore-case
604 </dt>
605 <dd>
607 Match the regexp limiting patterns without regard to letters case.
608 </p>
609 </dd>
610 <dt class="hdlist1">
612 </dt>
613 <dt class="hdlist1">
614 --extended-regexp
615 </dt>
616 <dd>
618 Consider the limiting patterns to be extended regular expressions
619 instead of the default basic regular expressions.
620 </p>
621 </dd>
622 <dt class="hdlist1">
624 </dt>
625 <dt class="hdlist1">
626 --fixed-strings
627 </dt>
628 <dd>
630 Consider the limiting patterns to be fixed strings (don&#8217;t interpret
631 pattern as a regular expression).
632 </p>
633 </dd>
634 <dt class="hdlist1">
635 --remove-empty
636 </dt>
637 <dd>
639 Stop when a given path disappears from the tree.
640 </p>
641 </dd>
642 <dt class="hdlist1">
643 --merges
644 </dt>
645 <dd>
647 Print only merge commits. This is exactly the same as <tt>--min-parents=2</tt>.
648 </p>
649 </dd>
650 <dt class="hdlist1">
651 --no-merges
652 </dt>
653 <dd>
655 Do not print commits with more than one parent. This is
656 exactly the same as <tt>--max-parents=1</tt>.
657 </p>
658 </dd>
659 <dt class="hdlist1">
660 --min-parents=&lt;number&gt;
661 </dt>
662 <dt class="hdlist1">
663 --max-parents=&lt;number&gt;
664 </dt>
665 <dt class="hdlist1">
666 --no-min-parents
667 </dt>
668 <dt class="hdlist1">
669 --no-max-parents
670 </dt>
671 <dd>
673 Show only commits which have at least (or at most) that many
674 commits. In particular, <tt>--max-parents=1</tt> is the same as <tt>--no-merges</tt>,
675 <tt>--min-parents=2</tt> is the same as <tt>--merges</tt>. <tt>--max-parents=0</tt>
676 gives all root commits and <tt>--min-parents=3</tt> all octopus merges.
677 </p>
678 <div class="paragraph"><p><tt>--no-min-parents</tt> and <tt>--no-max-parents</tt> reset these limits (to no limit)
679 again. Equivalent forms are <tt>--min-parents=0</tt> (any commit has 0 or more
680 parents) and <tt>--max-parents=-1</tt> (negative numbers denote no upper limit).</p></div>
681 </dd>
682 <dt class="hdlist1">
683 --first-parent
684 </dt>
685 <dd>
687 Follow only the first parent commit upon seeing a merge
688 commit. This option can give a better overview when
689 viewing the evolution of a particular topic branch,
690 because merges into a topic branch tend to be only about
691 adjusting to updated upstream from time to time, and
692 this option allows you to ignore the individual commits
693 brought in to your history by such a merge.
694 </p>
695 </dd>
696 <dt class="hdlist1">
697 --not
698 </dt>
699 <dd>
701 Reverses the meaning of the <em>&#94;</em> prefix (or lack thereof)
702 for all following revision specifiers, up to the next <em>--not</em>.
703 </p>
704 </dd>
705 <dt class="hdlist1">
706 --all
707 </dt>
708 <dd>
710 Pretend as if all the refs in <tt>refs/</tt> are listed on the
711 command line as <em>&lt;commit&gt;</em>.
712 </p>
713 </dd>
714 <dt class="hdlist1">
715 --branches[=&lt;pattern&gt;]
716 </dt>
717 <dd>
719 Pretend as if all the refs in <tt>refs/heads</tt> are listed
720 on the command line as <em>&lt;commit&gt;</em>. If <em>&lt;pattern&gt;</em> is given, limit
721 branches to ones matching given shell glob. If pattern lacks <em>?</em>,
722 <em><strong></em>, or <em>[</em>, <em>/</strong></em> at the end is implied.
723 </p>
724 </dd>
725 <dt class="hdlist1">
726 --tags[=&lt;pattern&gt;]
727 </dt>
728 <dd>
730 Pretend as if all the refs in <tt>refs/tags</tt> are listed
731 on the command line as <em>&lt;commit&gt;</em>. If <em>&lt;pattern&gt;</em> is given, limit
732 tags to ones matching given shell glob. If pattern lacks <em>?</em>, <em><strong></em>,
733 or <em>[</em>, <em>/</strong></em> at the end is implied.
734 </p>
735 </dd>
736 <dt class="hdlist1">
737 --remotes[=&lt;pattern&gt;]
738 </dt>
739 <dd>
741 Pretend as if all the refs in <tt>refs/remotes</tt> are listed
742 on the command line as <em>&lt;commit&gt;</em>. If <em>&lt;pattern&gt;</em> is given, limit
743 remote-tracking branches to ones matching given shell glob.
744 If pattern lacks <em>?</em>, <em><strong></em>, or <em>[</em>, <em>/</strong></em> at the end is implied.
745 </p>
746 </dd>
747 <dt class="hdlist1">
748 --glob=&lt;glob-pattern&gt;
749 </dt>
750 <dd>
752 Pretend as if all the refs matching shell glob <em>&lt;glob-pattern&gt;</em>
753 are listed on the command line as <em>&lt;commit&gt;</em>. Leading <em>refs/</em>,
754 is automatically prepended if missing. If pattern lacks <em>?</em>, <em><strong></em>,
755 or <em>[</em>, <em>/</strong></em> at the end is implied.
756 </p>
757 </dd>
758 <dt class="hdlist1">
759 --bisect
760 </dt>
761 <dd>
763 Pretend as if the bad bisection ref <tt>refs/bisect/bad</tt>
764 was listed and as if it was followed by <tt>--not</tt> and the good
765 bisection refs <tt>refs/bisect/good-*</tt> on the command
766 line.
767 </p>
768 </dd>
769 <dt class="hdlist1">
770 --stdin
771 </dt>
772 <dd>
774 In addition to the <em>&lt;commit&gt;</em> listed on the command
775 line, read them from the standard input. If a <em>--</em> separator is
776 seen, stop reading commits and start reading paths to limit the
777 result.
778 </p>
779 </dd>
780 <dt class="hdlist1">
781 --cherry-mark
782 </dt>
783 <dd>
785 Like <tt>--cherry-pick</tt> (see below) but mark equivalent commits
786 with <tt>=</tt> rather than omitting them, and inequivalent ones with <tt>+</tt>.
787 </p>
788 </dd>
789 <dt class="hdlist1">
790 --cherry-pick
791 </dt>
792 <dd>
794 Omit any commit that introduces the same change as
795 another commit on the "other side" when the set of
796 commits are limited with symmetric difference.
797 </p>
798 <div class="paragraph"><p>For example, if you have two branches, <tt>A</tt> and <tt>B</tt>, a usual way
799 to list all commits on only one side of them is with
800 <tt>--left-right</tt> (see the example below in the description of
801 the <tt>--left-right</tt> option). It however shows the commits that were cherry-picked
802 from the other branch (for example, "3rd on b" may be cherry-picked
803 from branch A). With this option, such pairs of commits are
804 excluded from the output.</p></div>
805 </dd>
806 <dt class="hdlist1">
807 --left-only
808 </dt>
809 <dt class="hdlist1">
810 --right-only
811 </dt>
812 <dd>
814 List only commits on the respective side of a symmetric range,
815 i.e. only those which would be marked <tt>&lt;</tt> resp. <tt>&gt;</tt> by
816 <tt>--left-right</tt>.
817 </p>
818 <div class="paragraph"><p>For example, <tt>--cherry-pick --right-only A&#8230;B</tt> omits those
819 commits from <tt>B</tt> which are in <tt>A</tt> or are patch-equivalent to a commit in
820 <tt>A</tt>. In other words, this lists the <tt>&#43;</tt> commits from <tt>git cherry A B</tt>.
821 More precisely, <tt>--cherry-pick --right-only --no-merges</tt> gives the exact
822 list.</p></div>
823 </dd>
824 <dt class="hdlist1">
825 --cherry
826 </dt>
827 <dd>
829 A synonym for <tt>--right-only --cherry-mark --no-merges</tt>; useful to
830 limit the output to the commits on our side and mark those that
831 have been applied to the other side of a forked history with
832 <tt>git log --cherry upstream&#8230;mybranch</tt>, similar to
833 <tt>git cherry upstream mybranch</tt>.
834 </p>
835 </dd>
836 <dt class="hdlist1">
838 </dt>
839 <dt class="hdlist1">
840 --walk-reflogs
841 </dt>
842 <dd>
844 Instead of walking the commit ancestry chain, walk
845 reflog entries from the most recent one to older ones.
846 When this option is used you cannot specify commits to
847 exclude (that is, <em>&#94;commit</em>, <em>commit1..commit2</em>,
848 nor <em>commit1...commit2</em> notations cannot be used).
849 </p>
850 <div class="paragraph"><p>With <em>--pretty</em> format other than oneline (for obvious reasons),
851 this causes the output to have two extra lines of information
852 taken from the reflog. By default, <em>commit@{Nth}</em> notation is
853 used in the output. When the starting commit is specified as
854 <em>commit@{now}</em>, output also uses <em>commit@{timestamp}</em> notation
855 instead. Under <em>--pretty=oneline</em>, the commit message is
856 prefixed with this information on the same line.
857 This option cannot be combined with <em>--reverse</em>.
858 See also <a href="git-reflog.html">git-reflog(1)</a>.</p></div>
859 </dd>
860 <dt class="hdlist1">
861 --merge
862 </dt>
863 <dd>
865 After a failed merge, show refs that touch files having a
866 conflict and don&#8217;t exist on all heads to merge.
867 </p>
868 </dd>
869 <dt class="hdlist1">
870 --boundary
871 </dt>
872 <dd>
874 Output uninteresting commits at the boundary, which are usually
875 not shown.
876 </p>
877 </dd>
878 </dl></div>
879 <h3 id="_history_simplification">History Simplification</h3><div style="clear:left"></div>
880 <div class="paragraph"><p>Sometimes you are only interested in parts of the history, for example the
881 commits modifying a particular &lt;path&gt;. But there are two parts of
882 <em>History Simplification</em>, one part is selecting the commits and the other
883 is how to do it, as there are various strategies to simplify the history.</p></div>
884 <div class="paragraph"><p>The following options select the commits to be shown:</p></div>
885 <div class="dlist"><dl>
886 <dt class="hdlist1">
887 &lt;paths&gt;
888 </dt>
889 <dd>
891 Commits modifying the given &lt;paths&gt; are selected.
892 </p>
893 </dd>
894 <dt class="hdlist1">
895 --simplify-by-decoration
896 </dt>
897 <dd>
899 Commits that are referred by some branch or tag are selected.
900 </p>
901 </dd>
902 </dl></div>
903 <div class="paragraph"><p>Note that extra commits can be shown to give a meaningful history.</p></div>
904 <div class="paragraph"><p>The following options affect the way the simplification is performed:</p></div>
905 <div class="dlist"><dl>
906 <dt class="hdlist1">
907 Default mode
908 </dt>
909 <dd>
911 Simplifies the history to the simplest history explaining the
912 final state of the tree. Simplest because it prunes some side
913 branches if the end result is the same (i.e. merging branches
914 with the same content)
915 </p>
916 </dd>
917 <dt class="hdlist1">
918 --full-history
919 </dt>
920 <dd>
922 As the default mode but does not prune some history.
923 </p>
924 </dd>
925 <dt class="hdlist1">
926 --dense
927 </dt>
928 <dd>
930 Only the selected commits are shown, plus some to have a
931 meaningful history.
932 </p>
933 </dd>
934 <dt class="hdlist1">
935 --sparse
936 </dt>
937 <dd>
939 All commits in the simplified history are shown.
940 </p>
941 </dd>
942 <dt class="hdlist1">
943 --simplify-merges
944 </dt>
945 <dd>
947 Additional option to <em>--full-history</em> to remove some needless
948 merges from the resulting history, as there are no selected
949 commits contributing to this merge.
950 </p>
951 </dd>
952 <dt class="hdlist1">
953 --ancestry-path
954 </dt>
955 <dd>
957 When given a range of commits to display (e.g. <em>commit1..commit2</em>
958 or <em>commit2 &#94;commit1</em>), only display commits that exist
959 directly on the ancestry chain between the <em>commit1</em> and
960 <em>commit2</em>, i.e. commits that are both descendants of <em>commit1</em>,
961 and ancestors of <em>commit2</em>.
962 </p>
963 </dd>
964 </dl></div>
965 <div class="paragraph"><p>A more detailed explanation follows.</p></div>
966 <div class="paragraph"><p>Suppose you specified <tt>foo</tt> as the &lt;paths&gt;. We shall call commits
967 that modify <tt>foo</tt> !TREESAME, and the rest TREESAME. (In a diff
968 filtered for <tt>foo</tt>, they look different and equal, respectively.)</p></div>
969 <div class="paragraph"><p>In the following, we will always refer to the same example history to
970 illustrate the differences between simplification settings. We assume
971 that you are filtering for a file <tt>foo</tt> in this commit graph:</p></div>
972 <div class="listingblock">
973 <div class="content">
974 <pre><tt> .-A---M---N---O---P
975 / / / / /
976 I B C D E
977 \ / / / /
978 `-------------'</tt></pre>
979 </div></div>
980 <div class="paragraph"><p>The horizontal line of history A&#8212;P is taken to be the first parent of
981 each merge. The commits are:</p></div>
982 <div class="ulist"><ul>
983 <li>
985 <tt>I</tt> is the initial commit, in which <tt>foo</tt> exists with contents
986 "asdf", and a file <tt>quux</tt> exists with contents "quux". Initial
987 commits are compared to an empty tree, so <tt>I</tt> is !TREESAME.
988 </p>
989 </li>
990 <li>
992 In <tt>A</tt>, <tt>foo</tt> contains just "foo".
993 </p>
994 </li>
995 <li>
997 <tt>B</tt> contains the same change as <tt>A</tt>. Its merge <tt>M</tt> is trivial and
998 hence TREESAME to all parents.
999 </p>
1000 </li>
1001 <li>
1003 <tt>C</tt> does not change <tt>foo</tt>, but its merge <tt>N</tt> changes it to "foobar",
1004 so it is not TREESAME to any parent.
1005 </p>
1006 </li>
1007 <li>
1009 <tt>D</tt> sets <tt>foo</tt> to "baz". Its merge <tt>O</tt> combines the strings from
1010 <tt>N</tt> and <tt>D</tt> to "foobarbaz"; i.e., it is not TREESAME to any parent.
1011 </p>
1012 </li>
1013 <li>
1015 <tt>E</tt> changes <tt>quux</tt> to "xyzzy", and its merge <tt>P</tt> combines the
1016 strings to "quux xyzzy". Despite appearing interesting, <tt>P</tt> is
1017 TREESAME to all parents.
1018 </p>
1019 </li>
1020 </ul></div>
1021 <div class="paragraph"><p><em>rev-list</em> walks backwards through history, including or excluding
1022 commits based on whether <em>--full-history</em> and/or parent rewriting
1023 (via <em>--parents</em> or <em>--children</em>) are used. The following settings
1024 are available.</p></div>
1025 <div class="dlist"><dl>
1026 <dt class="hdlist1">
1027 Default mode
1028 </dt>
1029 <dd>
1031 Commits are included if they are not TREESAME to any parent
1032 (though this can be changed, see <em>--sparse</em> below). If the
1033 commit was a merge, and it was TREESAME to one parent, follow
1034 only that parent. (Even if there are several TREESAME
1035 parents, follow only one of them.) Otherwise, follow all
1036 parents.
1037 </p>
1038 <div class="paragraph"><p>This results in:</p></div>
1039 <div class="listingblock">
1040 <div class="content">
1041 <pre><tt> .-A---N---O
1042 / / /
1043 I---------D</tt></pre>
1044 </div></div>
1045 <div class="paragraph"><p>Note how the rule to only follow the TREESAME parent, if one is
1046 available, removed <tt>B</tt> from consideration entirely. <tt>C</tt> was
1047 considered via <tt>N</tt>, but is TREESAME. Root commits are compared to an
1048 empty tree, so <tt>I</tt> is !TREESAME.</p></div>
1049 <div class="paragraph"><p>Parent/child relations are only visible with --parents, but that does
1050 not affect the commits selected in default mode, so we have shown the
1051 parent lines.</p></div>
1052 </dd>
1053 <dt class="hdlist1">
1054 --full-history without parent rewriting
1055 </dt>
1056 <dd>
1058 This mode differs from the default in one point: always follow
1059 all parents of a merge, even if it is TREESAME to one of them.
1060 Even if more than one side of the merge has commits that are
1061 included, this does not imply that the merge itself is! In
1062 the example, we get
1063 </p>
1064 <div class="listingblock">
1065 <div class="content">
1066 <pre><tt> I A B N D O</tt></pre>
1067 </div></div>
1068 <div class="paragraph"><p><tt>P</tt> and <tt>M</tt> were excluded because they are TREESAME to a parent. <tt>E</tt>,
1069 <tt>C</tt> and <tt>B</tt> were all walked, but only <tt>B</tt> was !TREESAME, so the others
1070 do not appear.</p></div>
1071 <div class="paragraph"><p>Note that without parent rewriting, it is not really possible to talk
1072 about the parent/child relationships between the commits, so we show
1073 them disconnected.</p></div>
1074 </dd>
1075 <dt class="hdlist1">
1076 --full-history with parent rewriting
1077 </dt>
1078 <dd>
1080 Ordinary commits are only included if they are !TREESAME
1081 (though this can be changed, see <em>--sparse</em> below).
1082 </p>
1083 <div class="paragraph"><p>Merges are always included. However, their parent list is rewritten:
1084 Along each parent, prune away commits that are not included
1085 themselves. This results in</p></div>
1086 <div class="listingblock">
1087 <div class="content">
1088 <pre><tt> .-A---M---N---O---P
1089 / / / / /
1090 I B / D /
1091 \ / / / /
1092 `-------------'</tt></pre>
1093 </div></div>
1094 <div class="paragraph"><p>Compare to <em>--full-history</em> without rewriting above. Note that <tt>E</tt>
1095 was pruned away because it is TREESAME, but the parent list of P was
1096 rewritten to contain <tt>E</tt>'s parent <tt>I</tt>. The same happened for <tt>C</tt> and
1097 <tt>N</tt>. Note also that <tt>P</tt> was included despite being TREESAME.</p></div>
1098 </dd>
1099 </dl></div>
1100 <div class="paragraph"><p>In addition to the above settings, you can change whether TREESAME
1101 affects inclusion:</p></div>
1102 <div class="dlist"><dl>
1103 <dt class="hdlist1">
1104 --dense
1105 </dt>
1106 <dd>
1108 Commits that are walked are included if they are not TREESAME
1109 to any parent.
1110 </p>
1111 </dd>
1112 <dt class="hdlist1">
1113 --sparse
1114 </dt>
1115 <dd>
1117 All commits that are walked are included.
1118 </p>
1119 <div class="paragraph"><p>Note that without <em>--full-history</em>, this still simplifies merges: if
1120 one of the parents is TREESAME, we follow only that one, so the other
1121 sides of the merge are never walked.</p></div>
1122 </dd>
1123 <dt class="hdlist1">
1124 --simplify-merges
1125 </dt>
1126 <dd>
1128 First, build a history graph in the same way that
1129 <em>--full-history</em> with parent rewriting does (see above).
1130 </p>
1131 <div class="paragraph"><p>Then simplify each commit &#8216;C` to its replacement <tt>C&#8217;</tt> in the final
1132 history according to the following rules:</p></div>
1133 <div class="ulist"><ul>
1134 <li>
1136 Set &#8216;C&#8217;` to <tt>C</tt>.
1137 </p>
1138 </li>
1139 <li>
1141 Replace each parent &#8216;P` of <tt>C&#8217;</tt> with its simplification &#8216;P&#8217;`. In
1142 the process, drop parents that are ancestors of other parents, and
1143 remove duplicates.
1144 </p>
1145 </li>
1146 <li>
1148 If after this parent rewriting, &#8216;C&#8217;` is a root or merge commit (has
1149 zero or &gt;1 parents), a boundary commit, or !TREESAME, it remains.
1150 Otherwise, it is replaced with its only parent.
1151 </p>
1152 </li>
1153 </ul></div>
1154 <div class="paragraph"><p>The effect of this is best shown by way of comparing to
1155 <em>--full-history</em> with parent rewriting. The example turns into:</p></div>
1156 <div class="listingblock">
1157 <div class="content">
1158 <pre><tt> .-A---M---N---O
1159 / / /
1160 I B D
1161 \ / /
1162 `---------'</tt></pre>
1163 </div></div>
1164 <div class="paragraph"><p>Note the major differences in <tt>N</tt> and <tt>P</tt> over <em>--full-history</em>:</p></div>
1165 <div class="ulist"><ul>
1166 <li>
1168 <tt>N</tt>'s parent list had <tt>I</tt> removed, because it is an ancestor of the
1169 other parent <tt>M</tt>. Still, <tt>N</tt> remained because it is !TREESAME.
1170 </p>
1171 </li>
1172 <li>
1174 <tt>P</tt>'s parent list similarly had <tt>I</tt> removed. <tt>P</tt> was then
1175 removed completely, because it had one parent and is TREESAME.
1176 </p>
1177 </li>
1178 </ul></div>
1179 </dd>
1180 </dl></div>
1181 <div class="paragraph"><p>Finally, there is a fifth simplification mode available:</p></div>
1182 <div class="dlist"><dl>
1183 <dt class="hdlist1">
1184 --ancestry-path
1185 </dt>
1186 <dd>
1188 Limit the displayed commits to those directly on the ancestry
1189 chain between the "from" and "to" commits in the given commit
1190 range. I.e. only display commits that are ancestor of the "to"
1191 commit, and descendants of the "from" commit.
1192 </p>
1193 <div class="paragraph"><p>As an example use case, consider the following commit history:</p></div>
1194 <div class="listingblock">
1195 <div class="content">
1196 <pre><tt> D---E-------F
1197 / \ \
1198 B---C---G---H---I---J
1200 A-------K---------------L--M</tt></pre>
1201 </div></div>
1202 <div class="paragraph"><p>A regular <em>D..M</em> computes the set of commits that are ancestors of <tt>M</tt>,
1203 but excludes the ones that are ancestors of <tt>D</tt>. This is useful to see
1204 what happened to the history leading to <tt>M</tt> since <tt>D</tt>, in the sense
1205 that "what does <tt>M</tt> have that did not exist in <tt>D</tt>". The result in this
1206 example would be all the commits, except <tt>A</tt> and <tt>B</tt> (and <tt>D</tt> itself,
1207 of course).</p></div>
1208 <div class="paragraph"><p>When we want to find out what commits in <tt>M</tt> are contaminated with the
1209 bug introduced by <tt>D</tt> and need fixing, however, we might want to view
1210 only the subset of <em>D..M</em> that are actually descendants of <tt>D</tt>, i.e.
1211 excluding <tt>C</tt> and <tt>K</tt>. This is exactly what the <em>--ancestry-path</em>
1212 option does. Applied to the <em>D..M</em> range, it results in:</p></div>
1213 <div class="listingblock">
1214 <div class="content">
1215 <pre><tt> E-------F
1217 G---H---I---J
1219 L--M</tt></pre>
1220 </div></div>
1221 </dd>
1222 </dl></div>
1223 <div class="paragraph"><p>The <em>--simplify-by-decoration</em> option allows you to view only the
1224 big picture of the topology of the history, by omitting commits
1225 that are not referenced by tags. Commits are marked as !TREESAME
1226 (in other words, kept after history simplification rules described
1227 above) if (1) they are referenced by tags, or (2) they change the
1228 contents of the paths given on the command line. All other
1229 commits are marked as TREESAME (subject to be simplified away).</p></div>
1230 <h3 id="_commit_ordering">Commit Ordering</h3><div style="clear:left"></div>
1231 <div class="paragraph"><p>By default, the commits are shown in reverse chronological order.</p></div>
1232 <div class="dlist"><dl>
1233 <dt class="hdlist1">
1234 --topo-order
1235 </dt>
1236 <dd>
1238 This option makes them appear in topological order (i.e.
1239 descendant commits are shown before their parents).
1240 </p>
1241 </dd>
1242 <dt class="hdlist1">
1243 --date-order
1244 </dt>
1245 <dd>
1247 This option is similar to <em>--topo-order</em> in the sense that no
1248 parent comes before all of its children, but otherwise things
1249 are still ordered in the commit timestamp order.
1250 </p>
1251 </dd>
1252 <dt class="hdlist1">
1253 --reverse
1254 </dt>
1255 <dd>
1257 Output the commits in reverse order.
1258 Cannot be combined with <em>--walk-reflogs</em>.
1259 </p>
1260 </dd>
1261 </dl></div>
1262 <h3 id="_object_traversal">Object Traversal</h3><div style="clear:left"></div>
1263 <div class="paragraph"><p>These options are mostly targeted for packing of git repositories.</p></div>
1264 <div class="dlist"><dl>
1265 <dt class="hdlist1">
1266 --objects
1267 </dt>
1268 <dd>
1270 Print the object IDs of any object referenced by the listed
1271 commits. <em>--objects foo ^bar</em> thus means "send me
1272 all object IDs which I need to download if I have the commit
1273 object <em>bar</em>, but not <em>foo</em>".
1274 </p>
1275 </dd>
1276 <dt class="hdlist1">
1277 --objects-edge
1278 </dt>
1279 <dd>
1281 Similar to <em>--objects</em>, but also print the IDs of excluded
1282 commits prefixed with a "-" character. This is used by
1283 <a href="git-pack-objects.html">git-pack-objects(1)</a> to build "thin" pack, which records
1284 objects in deltified form based on objects contained in these
1285 excluded commits to reduce network traffic.
1286 </p>
1287 </dd>
1288 <dt class="hdlist1">
1289 --unpacked
1290 </dt>
1291 <dd>
1293 Only useful with <em>--objects</em>; print the object IDs that are not
1294 in packs.
1295 </p>
1296 </dd>
1297 <dt class="hdlist1">
1298 --no-walk
1299 </dt>
1300 <dd>
1302 Only show the given revs, but do not traverse their ancestors.
1303 </p>
1304 </dd>
1305 <dt class="hdlist1">
1306 --do-walk
1307 </dt>
1308 <dd>
1310 Overrides a previous --no-walk.
1311 </p>
1312 </dd>
1313 </dl></div>
1314 <h3 id="_commit_formatting">Commit Formatting</h3><div style="clear:left"></div>
1315 <div class="dlist"><dl>
1316 <dt class="hdlist1">
1317 --pretty[=&lt;format&gt;]
1318 </dt>
1319 <dt class="hdlist1">
1320 --format=&lt;format&gt;
1321 </dt>
1322 <dd>
1324 Pretty-print the contents of the commit logs in a given format,
1325 where <em>&lt;format&gt;</em> can be one of <em>oneline</em>, <em>short</em>, <em>medium</em>,
1326 <em>full</em>, <em>fuller</em>, <em>email</em>, <em>raw</em> and <em>format:&lt;string&gt;</em>. See
1327 the "PRETTY FORMATS" section for some additional details for each
1328 format. When omitted, the format defaults to <em>medium</em>.
1329 </p>
1330 <div class="paragraph"><p>Note: you can specify the default pretty format in the repository
1331 configuration (see <a href="git-config.html">git-config(1)</a>).</p></div>
1332 </dd>
1333 <dt class="hdlist1">
1334 --abbrev-commit
1335 </dt>
1336 <dd>
1338 Instead of showing the full 40-byte hexadecimal commit object
1339 name, show only a partial prefix. Non default number of
1340 digits can be specified with "--abbrev=&lt;n&gt;" (which also modifies
1341 diff output, if it is displayed).
1342 </p>
1343 <div class="paragraph"><p>This should make "--pretty=oneline" a whole lot more readable for
1344 people using 80-column terminals.</p></div>
1345 </dd>
1346 <dt class="hdlist1">
1347 --oneline
1348 </dt>
1349 <dd>
1351 This is a shorthand for "--pretty=oneline --abbrev-commit"
1352 used together.
1353 </p>
1354 </dd>
1355 <dt class="hdlist1">
1356 --encoding[=&lt;encoding&gt;]
1357 </dt>
1358 <dd>
1360 The commit objects record the encoding used for the log message
1361 in their encoding header; this option can be used to tell the
1362 command to re-code the commit log message in the encoding
1363 preferred by the user. For non plumbing commands this
1364 defaults to UTF-8.
1365 </p>
1366 </dd>
1367 <dt class="hdlist1">
1368 --no-notes
1369 </dt>
1370 <dt class="hdlist1">
1371 --show-notes[=&lt;ref&gt;]
1372 </dt>
1373 <dd>
1375 Show the notes (see <a href="git-notes.html">git-notes(1)</a>) that annotate the
1376 commit, when showing the commit log message. This is the default
1377 for <tt>git log</tt>, <tt>git show</tt> and <tt>git whatchanged</tt> commands when
1378 there is no <tt>--pretty</tt>, <tt>--format</tt> nor <tt>--oneline</tt> option is
1379 given on the command line.
1380 </p>
1381 <div class="paragraph"><p>With an optional argument, add this ref to the list of notes. The ref
1382 is taken to be in <tt>refs/notes/</tt> if it is not qualified.</p></div>
1383 </dd>
1384 <dt class="hdlist1">
1385 --[no-]standard-notes
1386 </dt>
1387 <dd>
1389 Enable or disable populating the notes ref list from the
1390 <em>core.notesRef</em> and <em>notes.displayRef</em> variables (or
1391 corresponding environment overrides). Enabled by default.
1392 See <a href="git-config.html">git-config(1)</a>.
1393 </p>
1394 </dd>
1395 <dt class="hdlist1">
1396 --relative-date
1397 </dt>
1398 <dd>
1400 Synonym for <tt>--date=relative</tt>.
1401 </p>
1402 </dd>
1403 <dt class="hdlist1">
1404 --date=(relative|local|default|iso|rfc|short|raw)
1405 </dt>
1406 <dd>
1408 Only takes effect for dates shown in human-readable format, such
1409 as when using "--pretty". <tt>log.date</tt> config variable sets a default
1410 value for log command&#8217;s --date option.
1411 </p>
1412 <div class="paragraph"><p><tt>--date=relative</tt> shows dates relative to the current time,
1413 e.g. "2 hours ago".</p></div>
1414 <div class="paragraph"><p><tt>--date=local</tt> shows timestamps in user&#8217;s local timezone.</p></div>
1415 <div class="paragraph"><p><tt>--date=iso</tt> (or <tt>--date=iso8601</tt>) shows timestamps in ISO 8601 format.</p></div>
1416 <div class="paragraph"><p><tt>--date=rfc</tt> (or <tt>--date=rfc2822</tt>) shows timestamps in RFC 2822
1417 format, often found in E-mail messages.</p></div>
1418 <div class="paragraph"><p><tt>--date=short</tt> shows only date but not time, in <tt>YYYY-MM-DD</tt> format.</p></div>
1419 <div class="paragraph"><p><tt>--date=raw</tt> shows the date in the internal raw git format <tt>%s %z</tt> format.</p></div>
1420 <div class="paragraph"><p><tt>--date=default</tt> shows timestamps in the original timezone
1421 (either committer&#8217;s or author&#8217;s).</p></div>
1422 </dd>
1423 <dt class="hdlist1">
1424 --parents
1425 </dt>
1426 <dd>
1428 Print also the parents of the commit (in the form "commit parent&#8230;").
1429 Also enables parent rewriting, see <em>History Simplification</em> below.
1430 </p>
1431 </dd>
1432 <dt class="hdlist1">
1433 --children
1434 </dt>
1435 <dd>
1437 Print also the children of the commit (in the form "commit child&#8230;").
1438 Also enables parent rewriting, see <em>History Simplification</em> below.
1439 </p>
1440 </dd>
1441 <dt class="hdlist1">
1442 --left-right
1443 </dt>
1444 <dd>
1446 Mark which side of a symmetric diff a commit is reachable from.
1447 Commits from the left side are prefixed with <tt>&lt;</tt> and those from
1448 the right with <tt>&gt;</tt>. If combined with <tt>--boundary</tt>, those
1449 commits are prefixed with <tt>-</tt>.
1450 </p>
1451 <div class="paragraph"><p>For example, if you have this topology:</p></div>
1452 <div class="listingblock">
1453 <div class="content">
1454 <pre><tt> y---b---b branch B
1455 / \ /
1457 / / \
1458 o---x---a---a branch A</tt></pre>
1459 </div></div>
1460 <div class="paragraph"><p>you would get an output like this:</p></div>
1461 <div class="listingblock">
1462 <div class="content">
1463 <pre><tt> $ git rev-list --left-right --boundary --pretty=oneline A...B
1465 &gt;bbbbbbb... 3rd on b
1466 &gt;bbbbbbb... 2nd on b
1467 &lt;aaaaaaa... 3rd on a
1468 &lt;aaaaaaa... 2nd on a
1469 -yyyyyyy... 1st on b
1470 -xxxxxxx... 1st on a</tt></pre>
1471 </div></div>
1472 </dd>
1473 <dt class="hdlist1">
1474 --graph
1475 </dt>
1476 <dd>
1478 Draw a text-based graphical representation of the commit history
1479 on the left hand side of the output. This may cause extra lines
1480 to be printed in between commits, in order for the graph history
1481 to be drawn properly.
1482 </p>
1483 <div class="paragraph"><p>This enables parent rewriting, see <em>History Simplification</em> below.</p></div>
1484 <div class="paragraph"><p>This implies the <em>--topo-order</em> option by default, but the
1485 <em>--date-order</em> option may also be specified.</p></div>
1486 </dd>
1487 </dl></div>
1488 <h3 id="_diff_formatting">Diff Formatting</h3><div style="clear:left"></div>
1489 <div class="paragraph"><p>Below are listed options that control the formatting of diff output.
1490 Some of them are specific to <a href="git-rev-list.html">git-rev-list(1)</a>, however other diff
1491 options may be given. See <a href="git-diff-files.html">git-diff-files(1)</a> for more options.</p></div>
1492 <div class="dlist"><dl>
1493 <dt class="hdlist1">
1495 </dt>
1496 <dd>
1498 With this option, diff output for a merge commit
1499 shows the differences from each of the parents to the merge result
1500 simultaneously instead of showing pairwise diff between a parent
1501 and the result one at a time. Furthermore, it lists only files
1502 which were modified from all parents.
1503 </p>
1504 </dd>
1505 <dt class="hdlist1">
1506 --cc
1507 </dt>
1508 <dd>
1510 This flag implies the <em>-c</em> options and further compresses the
1511 patch output by omitting uninteresting hunks whose contents in
1512 the parents have only two variants and the merge result picks
1513 one of them without modification.
1514 </p>
1515 </dd>
1516 <dt class="hdlist1">
1518 </dt>
1519 <dd>
1521 This flag makes the merge commits show the full diff like
1522 regular commits; for each merge parent, a separate log entry
1523 and diff is generated. An exception is that only diff against
1524 the first parent is shown when <em>--first-parent</em> option is given;
1525 in that case, the output represents the changes the merge
1526 brought <em>into</em> the then-current branch.
1527 </p>
1528 </dd>
1529 <dt class="hdlist1">
1531 </dt>
1532 <dd>
1534 Show recursive diffs.
1535 </p>
1536 </dd>
1537 <dt class="hdlist1">
1539 </dt>
1540 <dd>
1542 Show the tree objects in the diff output. This implies <em>-r</em>.
1543 </p>
1544 </dd>
1545 <dt class="hdlist1">
1547 </dt>
1548 <dd>
1550 Suppress diff output.
1551 </p>
1552 </dd>
1553 </dl></div>
1554 </div>
1555 <h2 id="_pretty_formats">PRETTY FORMATS</h2>
1556 <div class="sectionbody">
1557 <div class="paragraph"><p>If the commit is a merge, and if the pretty-format
1558 is not <em>oneline</em>, <em>email</em> or <em>raw</em>, an additional line is
1559 inserted before the <em>Author:</em> line. This line begins with
1560 "Merge: " and the sha1s of ancestral commits are printed,
1561 separated by spaces. Note that the listed commits may not
1562 necessarily be the list of the <strong>direct</strong> parent commits if you
1563 have limited your view of history: for example, if you are
1564 only interested in changes related to a certain directory or
1565 file.</p></div>
1566 <div class="paragraph"><p>There are several built-in formats, and you can define
1567 additional formats by setting a pretty.&lt;name&gt;
1568 config option to either another format name, or a
1569 <em>format:</em> string, as described below (see
1570 <a href="git-config.html">git-config(1)</a>). Here are the details of the
1571 built-in formats:</p></div>
1572 <div class="ulist"><ul>
1573 <li>
1575 <em>oneline</em>
1576 </p>
1577 <div class="literalblock">
1578 <div class="content">
1579 <pre><tt>&lt;sha1&gt; &lt;title line&gt;</tt></pre>
1580 </div></div>
1581 <div class="paragraph"><p>This is designed to be as compact as possible.</p></div>
1582 </li>
1583 <li>
1585 <em>short</em>
1586 </p>
1587 <div class="literalblock">
1588 <div class="content">
1589 <pre><tt>commit &lt;sha1&gt;
1590 Author: &lt;author&gt;</tt></pre>
1591 </div></div>
1592 <div class="literalblock">
1593 <div class="content">
1594 <pre><tt>&lt;title line&gt;</tt></pre>
1595 </div></div>
1596 </li>
1597 <li>
1599 <em>medium</em>
1600 </p>
1601 <div class="literalblock">
1602 <div class="content">
1603 <pre><tt>commit &lt;sha1&gt;
1604 Author: &lt;author&gt;
1605 Date: &lt;author date&gt;</tt></pre>
1606 </div></div>
1607 <div class="literalblock">
1608 <div class="content">
1609 <pre><tt>&lt;title line&gt;</tt></pre>
1610 </div></div>
1611 <div class="literalblock">
1612 <div class="content">
1613 <pre><tt>&lt;full commit message&gt;</tt></pre>
1614 </div></div>
1615 </li>
1616 <li>
1618 <em>full</em>
1619 </p>
1620 <div class="literalblock">
1621 <div class="content">
1622 <pre><tt>commit &lt;sha1&gt;
1623 Author: &lt;author&gt;
1624 Commit: &lt;committer&gt;</tt></pre>
1625 </div></div>
1626 <div class="literalblock">
1627 <div class="content">
1628 <pre><tt>&lt;title line&gt;</tt></pre>
1629 </div></div>
1630 <div class="literalblock">
1631 <div class="content">
1632 <pre><tt>&lt;full commit message&gt;</tt></pre>
1633 </div></div>
1634 </li>
1635 <li>
1637 <em>fuller</em>
1638 </p>
1639 <div class="literalblock">
1640 <div class="content">
1641 <pre><tt>commit &lt;sha1&gt;
1642 Author: &lt;author&gt;
1643 AuthorDate: &lt;author date&gt;
1644 Commit: &lt;committer&gt;
1645 CommitDate: &lt;committer date&gt;</tt></pre>
1646 </div></div>
1647 <div class="literalblock">
1648 <div class="content">
1649 <pre><tt>&lt;title line&gt;</tt></pre>
1650 </div></div>
1651 <div class="literalblock">
1652 <div class="content">
1653 <pre><tt>&lt;full commit message&gt;</tt></pre>
1654 </div></div>
1655 </li>
1656 <li>
1658 <em>email</em>
1659 </p>
1660 <div class="literalblock">
1661 <div class="content">
1662 <pre><tt>From &lt;sha1&gt; &lt;date&gt;
1663 From: &lt;author&gt;
1664 Date: &lt;author date&gt;
1665 Subject: [PATCH] &lt;title line&gt;</tt></pre>
1666 </div></div>
1667 <div class="literalblock">
1668 <div class="content">
1669 <pre><tt>&lt;full commit message&gt;</tt></pre>
1670 </div></div>
1671 </li>
1672 <li>
1674 <em>raw</em>
1675 </p>
1676 <div class="paragraph"><p>The <em>raw</em> format shows the entire commit exactly as
1677 stored in the commit object. Notably, the SHA1s are
1678 displayed in full, regardless of whether --abbrev or
1679 --no-abbrev are used, and <em>parents</em> information show the
1680 true parent commits, without taking grafts nor history
1681 simplification into account.</p></div>
1682 </li>
1683 <li>
1685 <em>format:&lt;string&gt;</em>
1686 </p>
1687 <div class="paragraph"><p>The <em>format:&lt;string&gt;</em> format allows you to specify which information
1688 you want to show. It works a little bit like printf format,
1689 with the notable exception that you get a newline with <em>%n</em>
1690 instead of <em>\n</em>.</p></div>
1691 <div class="paragraph"><p>E.g, <em>format:"The author of %h was %an, %ar%nThe title was &gt;&gt;%s&lt;&lt;%n"</em>
1692 would show something like this:</p></div>
1693 <div class="listingblock">
1694 <div class="content">
1695 <pre><tt>The author of fe6e0ee was Junio C Hamano, 23 hours ago
1696 The title was &gt;&gt;t4119: test autocomputing -p&lt;n&gt; for traditional diff input.&lt;&lt;</tt></pre>
1697 </div></div>
1698 <div class="paragraph"><p>The placeholders are:</p></div>
1699 <div class="ulist"><ul>
1700 <li>
1702 <em>%H</em>: commit hash
1703 </p>
1704 </li>
1705 <li>
1707 <em>%h</em>: abbreviated commit hash
1708 </p>
1709 </li>
1710 <li>
1712 <em>%T</em>: tree hash
1713 </p>
1714 </li>
1715 <li>
1717 <em>%t</em>: abbreviated tree hash
1718 </p>
1719 </li>
1720 <li>
1722 <em>%P</em>: parent hashes
1723 </p>
1724 </li>
1725 <li>
1727 <em>%p</em>: abbreviated parent hashes
1728 </p>
1729 </li>
1730 <li>
1732 <em>%an</em>: author name
1733 </p>
1734 </li>
1735 <li>
1737 <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>)
1738 </p>
1739 </li>
1740 <li>
1742 <em>%ae</em>: author email
1743 </p>
1744 </li>
1745 <li>
1747 <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>)
1748 </p>
1749 </li>
1750 <li>
1752 <em>%ad</em>: author date (format respects --date= option)
1753 </p>
1754 </li>
1755 <li>
1757 <em>%aD</em>: author date, RFC2822 style
1758 </p>
1759 </li>
1760 <li>
1762 <em>%ar</em>: author date, relative
1763 </p>
1764 </li>
1765 <li>
1767 <em>%at</em>: author date, UNIX timestamp
1768 </p>
1769 </li>
1770 <li>
1772 <em>%ai</em>: author date, ISO 8601 format
1773 </p>
1774 </li>
1775 <li>
1777 <em>%cn</em>: committer name
1778 </p>
1779 </li>
1780 <li>
1782 <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>)
1783 </p>
1784 </li>
1785 <li>
1787 <em>%ce</em>: committer email
1788 </p>
1789 </li>
1790 <li>
1792 <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>)
1793 </p>
1794 </li>
1795 <li>
1797 <em>%cd</em>: committer date
1798 </p>
1799 </li>
1800 <li>
1802 <em>%cD</em>: committer date, RFC2822 style
1803 </p>
1804 </li>
1805 <li>
1807 <em>%cr</em>: committer date, relative
1808 </p>
1809 </li>
1810 <li>
1812 <em>%ct</em>: committer date, UNIX timestamp
1813 </p>
1814 </li>
1815 <li>
1817 <em>%ci</em>: committer date, ISO 8601 format
1818 </p>
1819 </li>
1820 <li>
1822 <em>%d</em>: ref names, like the --decorate option of <a href="git-log.html">git-log(1)</a>
1823 </p>
1824 </li>
1825 <li>
1827 <em>%e</em>: encoding
1828 </p>
1829 </li>
1830 <li>
1832 <em>%s</em>: subject
1833 </p>
1834 </li>
1835 <li>
1837 <em>%f</em>: sanitized subject line, suitable for a filename
1838 </p>
1839 </li>
1840 <li>
1842 <em>%b</em>: body
1843 </p>
1844 </li>
1845 <li>
1847 <em>%B</em>: raw body (unwrapped subject and body)
1848 </p>
1849 </li>
1850 <li>
1852 <em>%N</em>: commit notes
1853 </p>
1854 </li>
1855 <li>
1857 <em>%gD</em>: reflog selector, e.g., <tt>refs/stash@{1}</tt>
1858 </p>
1859 </li>
1860 <li>
1862 <em>%gd</em>: shortened reflog selector, e.g., <tt>stash@{1}</tt>
1863 </p>
1864 </li>
1865 <li>
1867 <em>%gs</em>: reflog subject
1868 </p>
1869 </li>
1870 <li>
1872 <em>%Cred</em>: switch color to red
1873 </p>
1874 </li>
1875 <li>
1877 <em>%Cgreen</em>: switch color to green
1878 </p>
1879 </li>
1880 <li>
1882 <em>%Cblue</em>: switch color to blue
1883 </p>
1884 </li>
1885 <li>
1887 <em>%Creset</em>: reset color
1888 </p>
1889 </li>
1890 <li>
1892 <em>%C(&#8230;)</em>: color specification, as described in color.branch.* config option
1893 </p>
1894 </li>
1895 <li>
1897 <em>%m</em>: left, right or boundary mark
1898 </p>
1899 </li>
1900 <li>
1902 <em>%n</em>: newline
1903 </p>
1904 </li>
1905 <li>
1907 <em>%%</em>: a raw <em>%</em>
1908 </p>
1909 </li>
1910 <li>
1912 <em>%x00</em>: print a byte from a hex code
1913 </p>
1914 </li>
1915 <li>
1917 <em>%w([&lt;w&gt;[,&lt;i1&gt;[,&lt;i2&gt;]]])</em>: switch line wrapping, like the -w option of
1918 <a href="git-shortlog.html">git-shortlog(1)</a>.
1919 </p>
1920 </li>
1921 </ul></div>
1922 </li>
1923 </ul></div>
1924 <div class="admonitionblock">
1925 <table><tr>
1926 <td class="icon">
1927 <div class="title">Note</div>
1928 </td>
1929 <td class="content">Some placeholders may depend on other options given to the
1930 revision traversal engine. For example, the <tt>%g*</tt> reflog options will
1931 insert an empty string unless we are traversing reflog entries (e.g., by
1932 <tt>git log -g</tt>). The <tt>%d</tt> placeholder will use the "short" decoration
1933 format if <tt>--decorate</tt> was not already provided on the command line.</td>
1934 </tr></table>
1935 </div>
1936 <div class="paragraph"><p>If you add a <tt>&#43;</tt> (plus sign) after <em>%</em> of a placeholder, a line-feed
1937 is inserted immediately before the expansion if and only if the
1938 placeholder expands to a non-empty string.</p></div>
1939 <div class="paragraph"><p>If you add a <tt>-</tt> (minus sign) after <em>%</em> of a placeholder, line-feeds that
1940 immediately precede the expansion are deleted if and only if the
1941 placeholder expands to an empty string.</p></div>
1942 <div class="paragraph"><p>If you add a ` ` (space) after <em>%</em> of a placeholder, a space
1943 is inserted immediately before the expansion if and only if the
1944 placeholder expands to a non-empty string.</p></div>
1945 <div class="ulist"><ul>
1946 <li>
1948 <em>tformat:</em>
1949 </p>
1950 <div class="paragraph"><p>The <em>tformat:</em> format works exactly like <em>format:</em>, except that it
1951 provides "terminator" semantics instead of "separator" semantics. In
1952 other words, each commit has the message terminator character (usually a
1953 newline) appended, rather than a separator placed between entries.
1954 This means that the final entry of a single-line format will be properly
1955 terminated with a new line, just as the "oneline" format does.
1956 For example:</p></div>
1957 <div class="listingblock">
1958 <div class="content">
1959 <pre><tt>$ git log -2 --pretty=format:%h 4da45bef \
1960 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
1961 4da45be
1962 7134973 -- NO NEWLINE
1964 $ git log -2 --pretty=tformat:%h 4da45bef \
1965 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
1966 4da45be
1967 7134973</tt></pre>
1968 </div></div>
1969 <div class="paragraph"><p>In addition, any unrecognized string that has a <tt>%</tt> in it is interpreted
1970 as if it has <tt>tformat:</tt> in front of it. For example, these two are
1971 equivalent:</p></div>
1972 <div class="listingblock">
1973 <div class="content">
1974 <pre><tt>$ git log -2 --pretty=tformat:%h 4da45bef
1975 $ git log -2 --pretty=%h 4da45bef</tt></pre>
1976 </div></div>
1977 </li>
1978 </ul></div>
1979 </div>
1980 <h2 id="_common_diff_options">Common diff options</h2>
1981 <div class="sectionbody">
1982 <div class="dlist"><dl>
1983 <dt class="hdlist1">
1985 </dt>
1986 <dt class="hdlist1">
1988 </dt>
1989 <dt class="hdlist1">
1990 --patch
1991 </dt>
1992 <dd>
1994 Generate patch (see section on generating patches).
1996 </p>
1997 </dd>
1998 <dt class="hdlist1">
1999 -U&lt;n&gt;
2000 </dt>
2001 <dt class="hdlist1">
2002 --unified=&lt;n&gt;
2003 </dt>
2004 <dd>
2006 Generate diffs with &lt;n&gt; lines of context instead of
2007 the usual three.
2008 Implies <tt>-p</tt>.
2009 </p>
2010 </dd>
2011 <dt class="hdlist1">
2012 --raw
2013 </dt>
2014 <dd>
2016 Generate the raw format.
2018 </p>
2019 </dd>
2020 <dt class="hdlist1">
2021 --patch-with-raw
2022 </dt>
2023 <dd>
2025 Synonym for <tt>-p --raw</tt>.
2026 </p>
2027 </dd>
2028 <dt class="hdlist1">
2029 --patience
2030 </dt>
2031 <dd>
2033 Generate a diff using the "patience diff" algorithm.
2034 </p>
2035 </dd>
2036 <dt class="hdlist1">
2037 --stat[=&lt;width&gt;[,&lt;name-width&gt;]]
2038 </dt>
2039 <dd>
2041 Generate a diffstat. You can override the default
2042 output width for 80-column terminal by <tt>--stat=&lt;width&gt;</tt>.
2043 The width of the filename part can be controlled by
2044 giving another width to it separated by a comma.
2045 </p>
2046 </dd>
2047 <dt class="hdlist1">
2048 --numstat
2049 </dt>
2050 <dd>
2052 Similar to <tt>--stat</tt>, but shows number of added and
2053 deleted lines in decimal notation and pathname without
2054 abbreviation, to make it more machine friendly. For
2055 binary files, outputs two <tt>-</tt> instead of saying
2056 <tt>0 0</tt>.
2057 </p>
2058 </dd>
2059 <dt class="hdlist1">
2060 --shortstat
2061 </dt>
2062 <dd>
2064 Output only the last line of the <tt>--stat</tt> format containing total
2065 number of modified files, as well as number of added and deleted
2066 lines.
2067 </p>
2068 </dd>
2069 <dt class="hdlist1">
2070 --dirstat[=&lt;limit&gt;]
2071 </dt>
2072 <dd>
2074 Output the distribution of relative amount of changes (number of lines added or
2075 removed) for each sub-directory. Directories with changes below
2076 a cut-off percent (3% by default) are not shown. The cut-off percent
2077 can be set with <tt>--dirstat=&lt;limit&gt;</tt>. Changes in a child directory are not
2078 counted for the parent directory, unless <tt>--cumulative</tt> is used.
2079 </p>
2080 </dd>
2081 <dt class="hdlist1">
2082 --dirstat-by-file[=&lt;limit&gt;]
2083 </dt>
2084 <dd>
2086 Same as <tt>--dirstat</tt>, but counts changed files instead of lines.
2087 </p>
2088 </dd>
2089 <dt class="hdlist1">
2090 --summary
2091 </dt>
2092 <dd>
2094 Output a condensed summary of extended header information
2095 such as creations, renames and mode changes.
2096 </p>
2097 </dd>
2098 <dt class="hdlist1">
2099 --patch-with-stat
2100 </dt>
2101 <dd>
2103 Synonym for <tt>-p --stat</tt>.
2104 </p>
2105 </dd>
2106 <dt class="hdlist1">
2108 </dt>
2109 <dd>
2111 Separate the commits with NULs instead of with new newlines.
2112 </p>
2113 <div class="paragraph"><p>Also, when <tt>--raw</tt> or <tt>--numstat</tt> has been given, do not munge
2114 pathnames and use NULs as output field terminators.</p></div>
2115 <div class="paragraph"><p>Without this option, each pathname output will have TAB, LF, double quotes,
2116 and backslash characters replaced with <tt>\t</tt>, <tt>\n</tt>, <tt>\"</tt>, and <tt>\\</tt>,
2117 respectively, and the pathname will be enclosed in double quotes if
2118 any of those replacements occurred.</p></div>
2119 </dd>
2120 <dt class="hdlist1">
2121 --name-only
2122 </dt>
2123 <dd>
2125 Show only names of changed files.
2126 </p>
2127 </dd>
2128 <dt class="hdlist1">
2129 --name-status
2130 </dt>
2131 <dd>
2133 Show only names and status of changed files. See the description
2134 of the <tt>--diff-filter</tt> option on what the status letters mean.
2135 </p>
2136 </dd>
2137 <dt class="hdlist1">
2138 --submodule[=&lt;format&gt;]
2139 </dt>
2140 <dd>
2142 Chose the output format for submodule differences. &lt;format&gt; can be one of
2143 <em>short</em> and <em>log</em>. <em>short</em> just shows pairs of commit names, this format
2144 is used when this option is not given. <em>log</em> is the default value for this
2145 option and lists the commits in that commit range like the <em>summary</em>
2146 option of <a href="git-submodule.html">git-submodule(1)</a> does.
2147 </p>
2148 </dd>
2149 <dt class="hdlist1">
2150 --color[=&lt;when&gt;]
2151 </dt>
2152 <dd>
2154 Show colored diff.
2155 The value must be always (the default), never, or auto.
2156 </p>
2157 </dd>
2158 <dt class="hdlist1">
2159 --no-color
2160 </dt>
2161 <dd>
2163 Turn off colored diff, even when the configuration file
2164 gives the default to color output.
2165 Same as <tt>--color=never</tt>.
2166 </p>
2167 </dd>
2168 <dt class="hdlist1">
2169 --word-diff[=&lt;mode&gt;]
2170 </dt>
2171 <dd>
2173 Show a word diff, using the &lt;mode&gt; to delimit changed words.
2174 By default, words are delimited by whitespace; see
2175 <tt>--word-diff-regex</tt> below. The &lt;mode&gt; defaults to <em>plain</em>, and
2176 must be one of:
2177 </p>
2178 <div class="dlist"><dl>
2179 <dt class="hdlist1">
2180 color
2181 </dt>
2182 <dd>
2184 Highlight changed words using only colors. Implies <tt>--color</tt>.
2185 </p>
2186 </dd>
2187 <dt class="hdlist1">
2188 plain
2189 </dt>
2190 <dd>
2192 Show words as <tt>[-removed-]</tt> and <tt>{<tt>added</tt>}</tt>. Makes no
2193 attempts to escape the delimiters if they appear in the input,
2194 so the output may be ambiguous.
2195 </p>
2196 </dd>
2197 <dt class="hdlist1">
2198 porcelain
2199 </dt>
2200 <dd>
2202 Use a special line-based format intended for script
2203 consumption. Added/removed/unchanged runs are printed in the
2204 usual unified diff format, starting with a <tt>+</tt>/<tt>-</tt>/` `
2205 character at the beginning of the line and extending to the
2206 end of the line. Newlines in the input are represented by a
2207 tilde <tt>~</tt> on a line of its own.
2208 </p>
2209 </dd>
2210 <dt class="hdlist1">
2211 none
2212 </dt>
2213 <dd>
2215 Disable word diff again.
2216 </p>
2217 </dd>
2218 </dl></div>
2219 <div class="paragraph"><p>Note that despite the name of the first mode, color is used to
2220 highlight the changed parts in all modes if enabled.</p></div>
2221 </dd>
2222 <dt class="hdlist1">
2223 --word-diff-regex=&lt;regex&gt;
2224 </dt>
2225 <dd>
2227 Use &lt;regex&gt; to decide what a word is, instead of considering
2228 runs of non-whitespace to be a word. Also implies
2229 <tt>--word-diff</tt> unless it was already enabled.
2230 </p>
2231 <div class="paragraph"><p>Every non-overlapping match of the
2232 &lt;regex&gt; is considered a word. Anything between these matches is
2233 considered whitespace and ignored(!) for the purposes of finding
2234 differences. You may want to append <tt>|[^[:space:]]</tt> to your regular
2235 expression to make sure that it matches all non-whitespace characters.
2236 A match that contains a newline is silently truncated(!) at the
2237 newline.</p></div>
2238 <div class="paragraph"><p>The regex can also be set via a diff driver or configuration option, see
2239 <a href="gitattributes.html">gitattributes(1)</a> or <a href="git-config.html">git-config(1)</a>. Giving it explicitly
2240 overrides any diff driver or configuration setting. Diff drivers
2241 override configuration settings.</p></div>
2242 </dd>
2243 <dt class="hdlist1">
2244 --color-words[=&lt;regex&gt;]
2245 </dt>
2246 <dd>
2248 Equivalent to <tt>--word-diff=color</tt> plus (if a regex was
2249 specified) <tt>--word-diff-regex=&lt;regex&gt;</tt>.
2250 </p>
2251 </dd>
2252 <dt class="hdlist1">
2253 --no-renames
2254 </dt>
2255 <dd>
2257 Turn off rename detection, even when the configuration
2258 file gives the default to do so.
2259 </p>
2260 </dd>
2261 <dt class="hdlist1">
2262 --check
2263 </dt>
2264 <dd>
2266 Warn if changes introduce trailing whitespace
2267 or an indent that uses a space before a tab. Exits with
2268 non-zero status if problems are found. Not compatible with
2269 --exit-code.
2270 </p>
2271 </dd>
2272 <dt class="hdlist1">
2273 --full-index
2274 </dt>
2275 <dd>
2277 Instead of the first handful of characters, show the full
2278 pre- and post-image blob object names on the "index"
2279 line when generating patch format output.
2280 </p>
2281 </dd>
2282 <dt class="hdlist1">
2283 --binary
2284 </dt>
2285 <dd>
2287 In addition to <tt>--full-index</tt>, output a binary diff that
2288 can be applied with <tt>git-apply</tt>.
2289 </p>
2290 </dd>
2291 <dt class="hdlist1">
2292 --abbrev[=&lt;n&gt;]
2293 </dt>
2294 <dd>
2296 Instead of showing the full 40-byte hexadecimal object
2297 name in diff-raw format output and diff-tree header
2298 lines, show only a partial prefix. This is
2299 independent of the <tt>--full-index</tt> option above, which controls
2300 the diff-patch output format. Non default number of
2301 digits can be specified with <tt>--abbrev=&lt;n&gt;</tt>.
2302 </p>
2303 </dd>
2304 <dt class="hdlist1">
2305 -B[&lt;n&gt;][/&lt;m&gt;]
2306 </dt>
2307 <dt class="hdlist1">
2308 --break-rewrites[=[&lt;n&gt;][/&lt;m&gt;]]
2309 </dt>
2310 <dd>
2312 Break complete rewrite changes into pairs of delete and
2313 create. This serves two purposes:
2314 </p>
2315 <div class="paragraph"><p>It affects the way a change that amounts to a total rewrite of a file
2316 not as a series of deletion and insertion mixed together with a very
2317 few lines that happen to match textually as the context, but as a
2318 single deletion of everything old followed by a single insertion of
2319 everything new, and the number <tt>m</tt> controls this aspect of the -B
2320 option (defaults to 60%). <tt>-B/70%</tt> specifies that less than 30% of the
2321 original should remain in the result for git to consider it a total
2322 rewrite (i.e. otherwise the resulting patch will be a series of
2323 deletion and insertion mixed together with context lines).</p></div>
2324 <div class="paragraph"><p>When used with -M, a totally-rewritten file is also considered as the
2325 source of a rename (usually -M only considers a file that disappeared
2326 as the source of a rename), and the number <tt>n</tt> controls this aspect of
2327 the -B option (defaults to 50%). <tt>-B20%</tt> specifies that a change with
2328 addition and deletion compared to 20% or more of the file&#8217;s size are
2329 eligible for being picked up as a possible source of a rename to
2330 another file.</p></div>
2331 </dd>
2332 <dt class="hdlist1">
2333 -M[&lt;n&gt;]
2334 </dt>
2335 <dt class="hdlist1">
2336 --find-renames[=&lt;n&gt;]
2337 </dt>
2338 <dd>
2340 If generating diffs, detect and report renames for each commit.
2341 For following files across renames while traversing history, see
2342 <tt>--follow</tt>.
2343 If <tt>n</tt> is specified, it is a is a threshold on the similarity
2344 index (i.e. amount of addition/deletions compared to the
2345 file&#8217;s size). For example, <tt>-M90%</tt> means git should consider a
2346 delete/add pair to be a rename if more than 90% of the file
2347 hasn&#8217;t changed.
2348 </p>
2349 </dd>
2350 <dt class="hdlist1">
2351 -C[&lt;n&gt;]
2352 </dt>
2353 <dt class="hdlist1">
2354 --find-copies[=&lt;n&gt;]
2355 </dt>
2356 <dd>
2358 Detect copies as well as renames. See also <tt>--find-copies-harder</tt>.
2359 If <tt>n</tt> is specified, it has the same meaning as for <tt>-M&lt;n&gt;</tt>.
2360 </p>
2361 </dd>
2362 <dt class="hdlist1">
2363 --find-copies-harder
2364 </dt>
2365 <dd>
2367 For performance reasons, by default, <tt>-C</tt> option finds copies only
2368 if the original file of the copy was modified in the same
2369 changeset. This flag makes the command
2370 inspect unmodified files as candidates for the source of
2371 copy. This is a very expensive operation for large
2372 projects, so use it with caution. Giving more than one
2373 <tt>-C</tt> option has the same effect.
2374 </p>
2375 </dd>
2376 <dt class="hdlist1">
2377 -l&lt;num&gt;
2378 </dt>
2379 <dd>
2381 The <tt>-M</tt> and <tt>-C</tt> options require O(n^2) processing time where n
2382 is the number of potential rename/copy targets. This
2383 option prevents rename/copy detection from running if
2384 the number of rename/copy targets exceeds the specified
2385 number.
2386 </p>
2387 </dd>
2388 <dt class="hdlist1">
2389 --diff-filter=[(A|C|D|M|R|T|U|X|B)&#8230;[*]]
2390 </dt>
2391 <dd>
2393 Select only files that are Added (<tt>A</tt>), Copied (<tt>C</tt>),
2394 Deleted (<tt>D</tt>), Modified (<tt>M</tt>), Renamed (<tt>R</tt>), have their
2395 type (i.e. regular file, symlink, submodule, &#8230;) changed (<tt>T</tt>),
2396 are Unmerged (<tt>U</tt>), are
2397 Unknown (<tt>X</tt>), or have had their pairing Broken (<tt>B</tt>).
2398 Any combination of the filter characters (including none) can be used.
2399 When <tt>*</tt> (All-or-none) is added to the combination, all
2400 paths are selected if there is any file that matches
2401 other criteria in the comparison; if there is no file
2402 that matches other criteria, nothing is selected.
2403 </p>
2404 </dd>
2405 <dt class="hdlist1">
2406 -S&lt;string&gt;
2407 </dt>
2408 <dd>
2410 Look for differences that introduce or remove an instance of
2411 &lt;string&gt;. Note that this is different than the string simply
2412 appearing in diff output; see the <em>pickaxe</em> entry in
2413 <a href="gitdiffcore.html">gitdiffcore(7)</a> for more details.
2414 </p>
2415 </dd>
2416 <dt class="hdlist1">
2417 -G&lt;regex&gt;
2418 </dt>
2419 <dd>
2421 Look for differences whose added or removed line matches
2422 the given &lt;regex&gt;.
2423 </p>
2424 </dd>
2425 <dt class="hdlist1">
2426 --pickaxe-all
2427 </dt>
2428 <dd>
2430 When <tt>-S</tt> or <tt>-G</tt> finds a change, show all the changes in that
2431 changeset, not just the files that contain the change
2432 in &lt;string&gt;.
2433 </p>
2434 </dd>
2435 <dt class="hdlist1">
2436 --pickaxe-regex
2437 </dt>
2438 <dd>
2440 Make the &lt;string&gt; not a plain string but an extended POSIX
2441 regex to match.
2442 </p>
2443 </dd>
2444 <dt class="hdlist1">
2445 -O&lt;orderfile&gt;
2446 </dt>
2447 <dd>
2449 Output the patch in the order specified in the
2450 &lt;orderfile&gt;, which has one shell glob pattern per line.
2451 </p>
2452 </dd>
2453 <dt class="hdlist1">
2455 </dt>
2456 <dd>
2458 Swap two inputs; that is, show differences from index or
2459 on-disk file to tree contents.
2460 </p>
2461 </dd>
2462 <dt class="hdlist1">
2463 --relative[=&lt;path&gt;]
2464 </dt>
2465 <dd>
2467 When run from a subdirectory of the project, it can be
2468 told to exclude changes outside the directory and show
2469 pathnames relative to it with this option. When you are
2470 not in a subdirectory (e.g. in a bare repository), you
2471 can name which subdirectory to make the output relative
2472 to by giving a &lt;path&gt; as an argument.
2473 </p>
2474 </dd>
2475 <dt class="hdlist1">
2477 </dt>
2478 <dt class="hdlist1">
2479 --text
2480 </dt>
2481 <dd>
2483 Treat all files as text.
2484 </p>
2485 </dd>
2486 <dt class="hdlist1">
2487 --ignore-space-at-eol
2488 </dt>
2489 <dd>
2491 Ignore changes in whitespace at EOL.
2492 </p>
2493 </dd>
2494 <dt class="hdlist1">
2496 </dt>
2497 <dt class="hdlist1">
2498 --ignore-space-change
2499 </dt>
2500 <dd>
2502 Ignore changes in amount of whitespace. This ignores whitespace
2503 at line end, and considers all other sequences of one or
2504 more whitespace characters to be equivalent.
2505 </p>
2506 </dd>
2507 <dt class="hdlist1">
2509 </dt>
2510 <dt class="hdlist1">
2511 --ignore-all-space
2512 </dt>
2513 <dd>
2515 Ignore whitespace when comparing lines. This ignores
2516 differences even if one line has whitespace where the other
2517 line has none.
2518 </p>
2519 </dd>
2520 <dt class="hdlist1">
2521 --inter-hunk-context=&lt;lines&gt;
2522 </dt>
2523 <dd>
2525 Show the context between diff hunks, up to the specified number
2526 of lines, thereby fusing hunks that are close to each other.
2527 </p>
2528 </dd>
2529 <dt class="hdlist1">
2530 --exit-code
2531 </dt>
2532 <dd>
2534 Make the program exit with codes similar to diff(1).
2535 That is, it exits with 1 if there were differences and
2536 0 means no differences.
2537 </p>
2538 </dd>
2539 <dt class="hdlist1">
2540 --quiet
2541 </dt>
2542 <dd>
2544 Disable all output of the program. Implies <tt>--exit-code</tt>.
2545 </p>
2546 </dd>
2547 <dt class="hdlist1">
2548 --ext-diff
2549 </dt>
2550 <dd>
2552 Allow an external diff helper to be executed. If you set an
2553 external diff driver with <a href="gitattributes.html">gitattributes(5)</a>, you need
2554 to use this option with <a href="git-log.html">git-log(1)</a> and friends.
2555 </p>
2556 </dd>
2557 <dt class="hdlist1">
2558 --no-ext-diff
2559 </dt>
2560 <dd>
2562 Disallow external diff drivers.
2563 </p>
2564 </dd>
2565 <dt class="hdlist1">
2566 --ignore-submodules[=&lt;when&gt;]
2567 </dt>
2568 <dd>
2570 Ignore changes to submodules in the diff generation. &lt;when&gt; can be
2571 either "none", "untracked", "dirty" or "all", which is the default
2572 Using "none" will consider the submodule modified when it either contains
2573 untracked or modified files or its HEAD differs from the commit recorded
2574 in the superproject and can be used to override any settings of the
2575 <em>ignore</em> option in <a href="git-config.html">git-config(1)</a> or <a href="gitmodules.html">gitmodules(5)</a>. When
2576 "untracked" is used submodules are not considered dirty when they only
2577 contain untracked content (but they are still scanned for modified
2578 content). Using "dirty" ignores all changes to the work tree of submodules,
2579 only changes to the commits stored in the superproject are shown (this was
2580 the behavior until 1.7.0). Using "all" hides all changes to submodules.
2581 </p>
2582 </dd>
2583 <dt class="hdlist1">
2584 --src-prefix=&lt;prefix&gt;
2585 </dt>
2586 <dd>
2588 Show the given source prefix instead of "a/".
2589 </p>
2590 </dd>
2591 <dt class="hdlist1">
2592 --dst-prefix=&lt;prefix&gt;
2593 </dt>
2594 <dd>
2596 Show the given destination prefix instead of "b/".
2597 </p>
2598 </dd>
2599 <dt class="hdlist1">
2600 --no-prefix
2601 </dt>
2602 <dd>
2604 Do not show any source or destination prefix.
2605 </p>
2606 </dd>
2607 </dl></div>
2608 <div class="paragraph"><p>For more detailed explanation on these common options, see also
2609 <a href="gitdiffcore.html">gitdiffcore(7)</a>.</p></div>
2610 </div>
2611 <h2 id="_generating_patches_with_p">Generating patches with -p</h2>
2612 <div class="sectionbody">
2613 <div class="paragraph"><p>When "git-diff-index", "git-diff-tree", or "git-diff-files" are run
2614 with a <em>-p</em> option, "git diff" without the <em>--raw</em> option, or
2615 "git log" with the "-p" option, they
2616 do not produce the output described above; instead they produce a
2617 patch file. You can customize the creation of such patches via the
2618 GIT_EXTERNAL_DIFF and the GIT_DIFF_OPTS environment variables.</p></div>
2619 <div class="paragraph"><p>What the -p option produces is slightly different from the traditional
2620 diff format:</p></div>
2621 <div class="olist arabic"><ol class="arabic">
2622 <li>
2624 It is preceded with a "git diff" header that looks like this:
2625 </p>
2626 <div class="literalblock">
2627 <div class="content">
2628 <pre><tt>diff --git a/file1 b/file2</tt></pre>
2629 </div></div>
2630 <div class="paragraph"><p>The <tt>a/</tt> and <tt>b/</tt> filenames are the same unless rename/copy is
2631 involved. Especially, even for a creation or a deletion,
2632 <tt>/dev/null</tt> is <em>not</em> used in place of the <tt>a/</tt> or <tt>b/</tt> filenames.</p></div>
2633 <div class="paragraph"><p>When rename/copy is involved, <tt>file1</tt> and <tt>file2</tt> show the
2634 name of the source file of the rename/copy and the name of
2635 the file that rename/copy produces, respectively.</p></div>
2636 </li>
2637 <li>
2639 It is followed by one or more extended header lines:
2640 </p>
2641 <div class="literalblock">
2642 <div class="content">
2643 <pre><tt>old mode &lt;mode&gt;
2644 new mode &lt;mode&gt;
2645 deleted file mode &lt;mode&gt;
2646 new file mode &lt;mode&gt;
2647 copy from &lt;path&gt;
2648 copy to &lt;path&gt;
2649 rename from &lt;path&gt;
2650 rename to &lt;path&gt;
2651 similarity index &lt;number&gt;
2652 dissimilarity index &lt;number&gt;
2653 index &lt;hash&gt;..&lt;hash&gt; &lt;mode&gt;</tt></pre>
2654 </div></div>
2655 <div class="paragraph"><p>File modes are printed as 6-digit octal numbers including the file type
2656 and file permission bits.</p></div>
2657 <div class="paragraph"><p>Path names in extended headers do not include the <tt>a/</tt> and <tt>b/</tt> prefixes.</p></div>
2658 <div class="paragraph"><p>The similarity index is the percentage of unchanged lines, and
2659 the dissimilarity index is the percentage of changed lines. It
2660 is a rounded down integer, followed by a percent sign. The
2661 similarity index value of 100% is thus reserved for two equal
2662 files, while 100% dissimilarity means that no line from the old
2663 file made it into the new one.</p></div>
2664 <div class="paragraph"><p>The index line includes the SHA-1 checksum before and after the change.
2665 The &lt;mode&gt; is included if the file mode does not change; otherwise,
2666 separate lines indicate the old and the new mode.</p></div>
2667 </li>
2668 <li>
2670 TAB, LF, double quote and backslash characters in pathnames
2671 are represented as <tt>\t</tt>, <tt>\n</tt>, <tt>\"</tt> and <tt>\\</tt>, respectively.
2672 If there is need for such substitution then the whole
2673 pathname is put in double quotes.
2674 </p>
2675 </li>
2676 <li>
2678 All the <tt>file1</tt> files in the output refer to files before the
2679 commit, and all the <tt>file2</tt> files refer to files after the commit.
2680 It is incorrect to apply each change to each file sequentially. For
2681 example, this patch will swap a and b:
2682 </p>
2683 <div class="literalblock">
2684 <div class="content">
2685 <pre><tt>diff --git a/a b/b
2686 rename from a
2687 rename to b
2688 diff --git a/b b/a
2689 rename from b
2690 rename to a</tt></pre>
2691 </div></div>
2692 </li>
2693 </ol></div>
2694 </div>
2695 <h2 id="_combined_diff_format">combined diff format</h2>
2696 <div class="sectionbody">
2697 <div class="paragraph"><p>Any diff-generating command can take the &#8216;-c` or <tt>--cc</tt> option to
2698 produce a <em>combined diff</em> when showing a merge. This is the default
2699 format when showing merges with <a href="git-diff.html">git-diff(1)</a> or
2700 <a href="git-show.html">git-show(1)</a>. Note also that you can give the `-m&#8217; option to any
2701 of these commands to force generation of diffs with individual parents
2702 of a merge.</p></div>
2703 <div class="paragraph"><p>A <em>combined diff</em> format looks like this:</p></div>
2704 <div class="listingblock">
2705 <div class="content">
2706 <pre><tt>diff --combined describe.c
2707 index fabadb8,cc95eb0..4866510
2708 --- a/describe.c
2709 +++ b/describe.c
2710 @@@ -98,20 -98,12 +98,20 @@@
2711 return (a_date &gt; b_date) ? -1 : (a_date == b_date) ? 0 : 1;
2714 - static void describe(char *arg)
2715 -static void describe(struct commit *cmit, int last_one)
2716 ++static void describe(char *arg, int last_one)
2718 + unsigned char sha1[20];
2719 + struct commit *cmit;
2720 struct commit_list *list;
2721 static int initialized = 0;
2722 struct commit_name *n;
2724 + if (get_sha1(arg, sha1) &lt; 0)
2725 + usage(describe_usage);
2726 + cmit = lookup_commit_reference(sha1);
2727 + if (!cmit)
2728 + usage(describe_usage);
2730 if (!initialized) {
2731 initialized = 1;
2732 for_each_ref(get_name);</tt></pre>
2733 </div></div>
2734 <div class="olist arabic"><ol class="arabic">
2735 <li>
2737 It is preceded with a "git diff" header, that looks like
2738 this (when <em>-c</em> option is used):
2739 </p>
2740 <div class="literalblock">
2741 <div class="content">
2742 <pre><tt>diff --combined file</tt></pre>
2743 </div></div>
2744 <div class="paragraph"><p>or like this (when <em>--cc</em> option is used):</p></div>
2745 <div class="literalblock">
2746 <div class="content">
2747 <pre><tt>diff --cc file</tt></pre>
2748 </div></div>
2749 </li>
2750 <li>
2752 It is followed by one or more extended header lines
2753 (this example shows a merge with two parents):
2754 </p>
2755 <div class="literalblock">
2756 <div class="content">
2757 <pre><tt>index &lt;hash&gt;,&lt;hash&gt;..&lt;hash&gt;
2758 mode &lt;mode&gt;,&lt;mode&gt;..&lt;mode&gt;
2759 new file mode &lt;mode&gt;
2760 deleted file mode &lt;mode&gt;,&lt;mode&gt;</tt></pre>
2761 </div></div>
2762 <div class="paragraph"><p>The <tt>mode &lt;mode&gt;,&lt;mode&gt;..&lt;mode&gt;</tt> line appears only if at least one of
2763 the &lt;mode&gt; is different from the rest. Extended headers with
2764 information about detected contents movement (renames and
2765 copying detection) are designed to work with diff of two
2766 &lt;tree-ish&gt; and are not used by combined diff format.</p></div>
2767 </li>
2768 <li>
2770 It is followed by two-line from-file/to-file header
2771 </p>
2772 <div class="literalblock">
2773 <div class="content">
2774 <pre><tt>--- a/file
2775 +++ b/file</tt></pre>
2776 </div></div>
2777 <div class="paragraph"><p>Similar to two-line header for traditional <em>unified</em> diff
2778 format, <tt>/dev/null</tt> is used to signal created or deleted
2779 files.</p></div>
2780 </li>
2781 <li>
2783 Chunk header format is modified to prevent people from
2784 accidentally feeding it to <tt>patch -p1</tt>. Combined diff format
2785 was created for review of merge commit changes, and was not
2786 meant for apply. The change is similar to the change in the
2787 extended <em>index</em> header:
2788 </p>
2789 <div class="literalblock">
2790 <div class="content">
2791 <pre><tt>@@@ &lt;from-file-range&gt; &lt;from-file-range&gt; &lt;to-file-range&gt; @@@</tt></pre>
2792 </div></div>
2793 <div class="paragraph"><p>There are (number of parents + 1) <tt>@</tt> characters in the chunk
2794 header for combined diff format.</p></div>
2795 </li>
2796 </ol></div>
2797 <div class="paragraph"><p>Unlike the traditional <em>unified</em> diff format, which shows two
2798 files A and B with a single column that has <tt>-</tt> (minus&#8201;&#8212;&#8201;appears in A but removed in B), <tt>+</tt> (plus&#8201;&#8212;&#8201;missing in A but
2799 added to B), or <tt>" "</tt> (space&#8201;&#8212;&#8201;unchanged) prefix, this format
2800 compares two or more files file1, file2,&#8230; with one file X, and
2801 shows how X differs from each of fileN. One column for each of
2802 fileN is prepended to the output line to note how X&#8217;s line is
2803 different from it.</p></div>
2804 <div class="paragraph"><p>A <tt>-</tt> character in the column N means that the line appears in
2805 fileN but it does not appear in the result. A <tt>+</tt> character
2806 in the column N means that the line appears in the result,
2807 and fileN does not have that line (in other words, the line was
2808 added, from the point of view of that parent).</p></div>
2809 <div class="paragraph"><p>In the above example output, the function signature was changed
2810 from both files (hence two <tt>-</tt> removals from both file1 and
2811 file2, plus <tt>++</tt> to mean one line that was added does not appear
2812 in either file1 nor file2). Also eight other lines are the same
2813 from file1 but do not appear in file2 (hence prefixed with <tt>&#43;</tt>).</p></div>
2814 <div class="paragraph"><p>When shown by <tt>git diff-tree -c</tt>, it compares the parents of a
2815 merge commit with the merge result (i.e. file1..fileN are the
2816 parents). When shown by <tt>git diff-files -c</tt>, it compares the
2817 two unresolved merge parents with the working tree file
2818 (i.e. file1 is stage 2 aka "our version", file2 is stage 3 aka
2819 "their version").</p></div>
2820 </div>
2821 <h2 id="_examples">Examples</h2>
2822 <div class="sectionbody">
2823 <div class="dlist"><dl>
2824 <dt class="hdlist1">
2825 git log --no-merges
2826 </dt>
2827 <dd>
2829 Show the whole commit history, but skip any merges
2830 </p>
2831 </dd>
2832 <dt class="hdlist1">
2833 git log v2.6.12.. include/scsi drivers/scsi
2834 </dt>
2835 <dd>
2837 Show all commits since version <em>v2.6.12</em> that changed any file
2838 in the include/scsi or drivers/scsi subdirectories
2839 </p>
2840 </dd>
2841 <dt class="hdlist1">
2842 git log --since="2 weeks ago" -- gitk
2843 </dt>
2844 <dd>
2846 Show the changes during the last two weeks to the file <em>gitk</em>.
2847 The "--" is necessary to avoid confusion with the <strong>branch</strong> named
2848 <em>gitk</em>
2849 </p>
2850 </dd>
2851 <dt class="hdlist1">
2852 git log --name-status release..test
2853 </dt>
2854 <dd>
2856 Show the commits that are in the "test" branch but not yet
2857 in the "release" branch, along with the list of paths
2858 each commit modifies.
2859 </p>
2860 </dd>
2861 <dt class="hdlist1">
2862 git log --follow builtin-rev-list.c
2863 </dt>
2864 <dd>
2866 Shows the commits that changed builtin-rev-list.c, including
2867 those commits that occurred before the file was given its
2868 present name.
2869 </p>
2870 </dd>
2871 <dt class="hdlist1">
2872 git log --branches --not --remotes=origin
2873 </dt>
2874 <dd>
2876 Shows all commits that are in any of local branches but not in
2877 any of remote-tracking branches for <em>origin</em> (what you have that
2878 origin doesn&#8217;t).
2879 </p>
2880 </dd>
2881 <dt class="hdlist1">
2882 git log master --not --remotes=*/master
2883 </dt>
2884 <dd>
2886 Shows all commits that are in local master but not in any remote
2887 repository master branches.
2888 </p>
2889 </dd>
2890 <dt class="hdlist1">
2891 git log -p -m --first-parent
2892 </dt>
2893 <dd>
2895 Shows the history including change diffs, but only from the
2896 "main branch" perspective, skipping commits that come from merged
2897 branches, and showing full diffs of changes introduced by the merges.
2898 This makes sense only when following a strict policy of merging all
2899 topic branches when staying on a single integration branch.
2900 </p>
2901 </dd>
2902 </dl></div>
2903 </div>
2904 <h2 id="_discussion">Discussion</h2>
2905 <div class="sectionbody">
2906 <div class="paragraph"><p>At the core level, git is character encoding agnostic.</p></div>
2907 <div class="ulist"><ul>
2908 <li>
2910 The pathnames recorded in the index and in the tree objects
2911 are treated as uninterpreted sequences of non-NUL bytes.
2912 What readdir(2) returns are what are recorded and compared
2913 with the data git keeps track of, which in turn are expected
2914 to be what lstat(2) and creat(2) accepts. There is no such
2915 thing as pathname encoding translation.
2916 </p>
2917 </li>
2918 <li>
2920 The contents of the blob objects are uninterpreted sequences
2921 of bytes. There is no encoding translation at the core
2922 level.
2923 </p>
2924 </li>
2925 <li>
2927 The commit log messages are uninterpreted sequences of non-NUL
2928 bytes.
2929 </p>
2930 </li>
2931 </ul></div>
2932 <div class="paragraph"><p>Although we encourage that the commit log messages are encoded
2933 in UTF-8, both the core and git Porcelain are designed not to
2934 force UTF-8 on projects. If all participants of a particular
2935 project find it more convenient to use legacy encodings, git
2936 does not forbid it. However, there are a few things to keep in
2937 mind.</p></div>
2938 <div class="olist arabic"><ol class="arabic">
2939 <li>
2941 <em>git commit</em> and <em>git commit-tree</em> issues
2942 a warning if the commit log message given to it does not look
2943 like a valid UTF-8 string, unless you explicitly say your
2944 project uses a legacy encoding. The way to say this is to
2945 have i18n.commitencoding in <tt>.git/config</tt> file, like this:
2946 </p>
2947 <div class="listingblock">
2948 <div class="content">
2949 <pre><tt>[i18n]
2950 commitencoding = ISO-8859-1</tt></pre>
2951 </div></div>
2952 <div class="paragraph"><p>Commit objects created with the above setting record the value
2953 of <tt>i18n.commitencoding</tt> in its <tt>encoding</tt> header. This is to
2954 help other people who look at them later. Lack of this header
2955 implies that the commit log message is encoded in UTF-8.</p></div>
2956 </li>
2957 <li>
2959 <em>git log</em>, <em>git show</em>, <em>git blame</em> and friends look at the
2960 <tt>encoding</tt> header of a commit object, and try to re-code the
2961 log message into UTF-8 unless otherwise specified. You can
2962 specify the desired output encoding with
2963 <tt>i18n.logoutputencoding</tt> in <tt>.git/config</tt> file, like this:
2964 </p>
2965 <div class="listingblock">
2966 <div class="content">
2967 <pre><tt>[i18n]
2968 logoutputencoding = ISO-8859-1</tt></pre>
2969 </div></div>
2970 <div class="paragraph"><p>If you do not have this configuration variable, the value of
2971 <tt>i18n.commitencoding</tt> is used instead.</p></div>
2972 </li>
2973 </ol></div>
2974 <div class="paragraph"><p>Note that we deliberately chose not to re-code the commit log
2975 message when a commit is made to force UTF-8 at the commit
2976 object level, because re-coding to UTF-8 is not necessarily a
2977 reversible operation.</p></div>
2978 </div>
2979 <h2 id="_configuration">Configuration</h2>
2980 <div class="sectionbody">
2981 <div class="paragraph"><p>See <a href="git-config.html">git-config(1)</a> for core variables and <a href="git-diff.html">git-diff(1)</a>
2982 for settings related to diff generation.</p></div>
2983 <div class="dlist"><dl>
2984 <dt class="hdlist1">
2985 format.pretty
2986 </dt>
2987 <dd>
2989 Default for the <tt>--format</tt> option. (See "PRETTY FORMATS" above.)
2990 Defaults to "medium".
2991 </p>
2992 </dd>
2993 <dt class="hdlist1">
2994 i18n.logOutputEncoding
2995 </dt>
2996 <dd>
2998 Encoding to use when displaying logs. (See "Discussion", above.)
2999 Defaults to the value of <tt>i18n.commitEncoding</tt> if set, UTF-8
3000 otherwise.
3001 </p>
3002 </dd>
3003 <dt class="hdlist1">
3004 log.date
3005 </dt>
3006 <dd>
3008 Default format for human-readable dates. (Compare the
3009 <tt>--date</tt> option.) Defaults to "default", which means to write
3010 dates like <tt>Sat May 8 19:35:34 2010 -0500</tt>.
3011 </p>
3012 </dd>
3013 <dt class="hdlist1">
3014 log.showroot
3015 </dt>
3016 <dd>
3018 If <tt>false</tt>, <em>git log</em> and related commands will not treat the
3019 initial commit as a big creation event. Any root commits in
3020 <tt>git log -p</tt> output would be shown without a diff attached.
3021 The default is <tt>true</tt>.
3022 </p>
3023 </dd>
3024 <dt class="hdlist1">
3025 mailmap.file
3026 </dt>
3027 <dd>
3029 See <a href="git-shortlog.html">git-shortlog(1)</a>.
3030 </p>
3031 </dd>
3032 <dt class="hdlist1">
3033 notes.displayRef
3034 </dt>
3035 <dd>
3037 Which refs, in addition to the default set by <tt>core.notesRef</tt>
3038 or <em>GIT_NOTES_REF</em>, to read notes from when showing commit
3039 messages with the <em>log</em> family of commands. See
3040 <a href="git-notes.html">git-notes(1)</a>.
3041 </p>
3042 <div class="paragraph"><p>May be an unabbreviated ref name or a glob and may be specified
3043 multiple times. A warning will be issued for refs that do not exist,
3044 but a glob that does not match any refs is silently ignored.</p></div>
3045 <div class="paragraph"><p>This setting can be disabled by the <tt>--no-standard-notes</tt> option,
3046 overridden by the <em>GIT_NOTES_DISPLAY_REF</em> environment variable,
3047 and supplemented by the <tt>--show-notes</tt> option.</p></div>
3048 </dd>
3049 </dl></div>
3050 </div>
3051 <h2 id="_git">GIT</h2>
3052 <div class="sectionbody">
3053 <div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
3054 </div>
3055 <div id="footer">
3056 <div id="footer-text">
3057 Last updated 2011-03-20 19:41:42 UTC
3058 </div>
3059 </div>
3060 </body>
3061 </html>