Autogenerated HTML docs for v1.6.6.1-383-g5a9f
[git/jnareb-git.git] / git-log.html
blob61292ac7b502da6e2883a1aa9e227db6d2aa5319
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.2.5" />
7 <style type="text/css">
8 /* Debug borders */
9 p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {
11 border: 1px solid red;
15 body {
16 margin: 1em 5% 1em 5%;
19 a {
20 color: blue;
21 text-decoration: underline;
23 a:visited {
24 color: fuchsia;
27 em {
28 font-style: italic;
31 strong {
32 font-weight: bold;
35 tt {
36 color: navy;
39 h1, h2, h3, h4, h5, h6 {
40 color: #527bbd;
41 font-family: sans-serif;
42 margin-top: 1.2em;
43 margin-bottom: 0.5em;
44 line-height: 1.3;
47 h1, h2, h3 {
48 border-bottom: 2px solid silver;
50 h2 {
51 padding-top: 0.5em;
53 h3 {
54 float: left;
56 h3 + * {
57 clear: left;
60 div.sectionbody {
61 font-family: serif;
62 margin-left: 0;
65 hr {
66 border: 1px solid silver;
69 p {
70 margin-top: 0.5em;
71 margin-bottom: 0.5em;
74 pre {
75 padding: 0;
76 margin: 0;
79 span#author {
80 color: #527bbd;
81 font-family: sans-serif;
82 font-weight: bold;
83 font-size: 1.1em;
85 span#email {
87 span#revision {
88 font-family: sans-serif;
91 div#footer {
92 font-family: sans-serif;
93 font-size: small;
94 border-top: 2px solid silver;
95 padding-top: 0.5em;
96 margin-top: 4.0em;
98 div#footer-text {
99 float: left;
100 padding-bottom: 0.5em;
102 div#footer-badges {
103 float: right;
104 padding-bottom: 0.5em;
107 div#preamble,
108 div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
109 div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
110 div.admonitionblock {
111 margin-right: 10%;
112 margin-top: 1.5em;
113 margin-bottom: 1.5em;
115 div.admonitionblock {
116 margin-top: 2.5em;
117 margin-bottom: 2.5em;
120 div.content { /* Block element content. */
121 padding: 0;
124 /* Block element titles. */
125 div.title, caption.title {
126 font-family: sans-serif;
127 font-weight: bold;
128 text-align: left;
129 margin-top: 1.0em;
130 margin-bottom: 0.5em;
132 div.title + * {
133 margin-top: 0;
136 td div.title:first-child {
137 margin-top: 0.0em;
139 div.content div.title:first-child {
140 margin-top: 0.0em;
142 div.content + div.title {
143 margin-top: 0.0em;
146 div.sidebarblock > div.content {
147 background: #ffffee;
148 border: 1px solid silver;
149 padding: 0.5em;
152 div.listingblock {
153 margin-right: 0%;
155 div.listingblock > div.content {
156 border: 1px solid silver;
157 background: #f4f4f4;
158 padding: 0.5em;
161 div.quoteblock > div.content {
162 padding-left: 2.0em;
165 div.attribution {
166 text-align: right;
168 div.verseblock + div.attribution {
169 text-align: left;
172 div.admonitionblock .icon {
173 vertical-align: top;
174 font-size: 1.1em;
175 font-weight: bold;
176 text-decoration: underline;
177 color: #527bbd;
178 padding-right: 0.5em;
180 div.admonitionblock td.content {
181 padding-left: 0.5em;
182 border-left: 2px solid silver;
185 div.exampleblock > div.content {
186 border-left: 2px solid silver;
187 padding: 0.5em;
190 div.verseblock div.content {
191 white-space: pre;
194 div.imageblock div.content { padding-left: 0; }
195 div.imageblock img { border: 1px solid silver; }
196 span.image img { border-style: none; }
198 dl {
199 margin-top: 0.8em;
200 margin-bottom: 0.8em;
202 dt {
203 margin-top: 0.5em;
204 margin-bottom: 0;
205 font-style: italic;
207 dd > *:first-child {
208 margin-top: 0;
211 ul, ol {
212 list-style-position: outside;
214 div.olist2 ol {
215 list-style-type: lower-alpha;
218 div.tableblock > table {
219 border: 3px solid #527bbd;
221 thead {
222 font-family: sans-serif;
223 font-weight: bold;
225 tfoot {
226 font-weight: bold;
229 div.hlist {
230 margin-top: 0.8em;
231 margin-bottom: 0.8em;
233 div.hlist td {
234 padding-bottom: 5px;
236 td.hlist1 {
237 vertical-align: top;
238 font-style: italic;
239 padding-right: 0.8em;
241 td.hlist2 {
242 vertical-align: top;
245 @media print {
246 div#footer-badges { display: none; }
249 div#toctitle {
250 color: #527bbd;
251 font-family: sans-serif;
252 font-size: 1.1em;
253 font-weight: bold;
254 margin-top: 1.0em;
255 margin-bottom: 0.1em;
258 div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
259 margin-top: 0;
260 margin-bottom: 0;
262 div.toclevel2 {
263 margin-left: 2em;
264 font-size: 0.9em;
266 div.toclevel3 {
267 margin-left: 4em;
268 font-size: 0.9em;
270 div.toclevel4 {
271 margin-left: 6em;
272 font-size: 0.9em;
274 include1::./stylesheets/xhtml11-manpage.css[]
275 /* Workarounds for IE6's broken and incomplete CSS2. */
277 div.sidebar-content {
278 background: #ffffee;
279 border: 1px solid silver;
280 padding: 0.5em;
282 div.sidebar-title, div.image-title {
283 font-family: sans-serif;
284 font-weight: bold;
285 margin-top: 0.0em;
286 margin-bottom: 0.5em;
289 div.listingblock div.content {
290 border: 1px solid silver;
291 background: #f4f4f4;
292 padding: 0.5em;
295 div.quoteblock-content {
296 padding-left: 2.0em;
299 div.exampleblock-content {
300 border-left: 2px solid silver;
301 padding-left: 0.5em;
304 /* IE6 sets dynamically generated links as visited. */
305 div#toc a:visited { color: blue; }
306 </style>
307 <title>git-log(1)</title>
308 </head>
309 <body>
310 <div id="header">
311 <h1>
312 git-log(1) Manual Page
313 </h1>
314 <h2>NAME</h2>
315 <div class="sectionbody">
316 <p>git-log -
317 Show commit logs
318 </p>
319 </div>
320 </div>
321 <h2>SYNOPSIS</h2>
322 <div class="sectionbody">
323 <div class="para"><p><em>git log</em> [&lt;options&gt;] [&lt;since&gt;..&lt;until&gt;] [[--] &lt;path&gt;&#8230;]</p></div>
324 </div>
325 <h2 id="_description">DESCRIPTION</h2>
326 <div class="sectionbody">
327 <div class="para"><p>Shows the commit logs.</p></div>
328 <div class="para"><p>The command takes options applicable to the <em>git rev-list</em>
329 command to control what is shown and how, and options applicable to
330 the <em>git diff-*</em> commands to control how the changes
331 each commit introduces are shown.</p></div>
332 </div>
333 <h2 id="_options">OPTIONS</h2>
334 <div class="sectionbody">
335 <div class="vlist"><dl>
336 <dt>
338 </dt>
339 <dt>
341 </dt>
342 <dd>
344 Generate patch (see section on generating patches).
346 </p>
347 </dd>
348 <dt>
349 -U&lt;n&gt;
350 </dt>
351 <dt>
352 --unified=&lt;n&gt;
353 </dt>
354 <dd>
356 Generate diffs with &lt;n&gt; lines of context instead of
357 the usual three.
358 Implies <tt>-p</tt>.
359 </p>
360 </dd>
361 <dt>
362 --raw
363 </dt>
364 <dd>
366 Generate the raw format.
368 </p>
369 </dd>
370 <dt>
371 --patch-with-raw
372 </dt>
373 <dd>
375 Synonym for <tt>-p --raw</tt>.
376 </p>
377 </dd>
378 <dt>
379 --patience
380 </dt>
381 <dd>
383 Generate a diff using the "patience diff" algorithm.
384 </p>
385 </dd>
386 <dt>
387 --stat[=width[,name-width]]
388 </dt>
389 <dd>
391 Generate a diffstat. You can override the default
392 output width for 80-column terminal by <tt>--stat=width</tt>.
393 The width of the filename part can be controlled by
394 giving another width to it separated by a comma.
395 </p>
396 </dd>
397 <dt>
398 --numstat
399 </dt>
400 <dd>
402 Similar to <tt>--stat</tt>, but shows number of added and
403 deleted lines in decimal notation and pathname without
404 abbreviation, to make it more machine friendly. For
405 binary files, outputs two <tt>-</tt> instead of saying
406 <tt>0 0</tt>.
407 </p>
408 </dd>
409 <dt>
410 --shortstat
411 </dt>
412 <dd>
414 Output only the last line of the <tt>--stat</tt> format containing total
415 number of modified files, as well as number of added and deleted
416 lines.
417 </p>
418 </dd>
419 <dt>
420 --dirstat[=limit]
421 </dt>
422 <dd>
424 Output the distribution of relative amount of changes (number of lines added or
425 removed) for each sub-directory. Directories with changes below
426 a cut-off percent (3% by default) are not shown. The cut-off percent
427 can be set with <tt>--dirstat=limit</tt>. Changes in a child directory is not
428 counted for the parent directory, unless <tt>--cumulative</tt> is used.
429 </p>
430 </dd>
431 <dt>
432 --dirstat-by-file[=limit]
433 </dt>
434 <dd>
436 Same as <tt>--dirstat</tt>, but counts changed files instead of lines.
437 </p>
438 </dd>
439 <dt>
440 --summary
441 </dt>
442 <dd>
444 Output a condensed summary of extended header information
445 such as creations, renames and mode changes.
446 </p>
447 </dd>
448 <dt>
449 --patch-with-stat
450 </dt>
451 <dd>
453 Synonym for <tt>-p --stat</tt>.
454 </p>
455 </dd>
456 <dt>
458 </dt>
459 <dd>
461 Separate the commits with NULs instead of with new newlines.
462 </p>
463 <div class="para"><p>Also, when <tt>--raw</tt> or <tt>--numstat</tt> has been given, do not munge
464 pathnames and use NULs as output field terminators.</p></div>
465 <div class="para"><p>Without this option, each pathname output will have TAB, LF, double quotes,
466 and backslash characters replaced with <tt>\t</tt>, <tt>\n</tt>, <tt>\"</tt>, and <tt>\\</tt>,
467 respectively, and the pathname will be enclosed in double quotes if
468 any of those replacements occurred.</p></div>
469 </dd>
470 <dt>
471 --name-only
472 </dt>
473 <dd>
475 Show only names of changed files.
476 </p>
477 </dd>
478 <dt>
479 --name-status
480 </dt>
481 <dd>
483 Show only names and status of changed files. See the description
484 of the <tt>--diff-filter</tt> option on what the status letters mean.
485 </p>
486 </dd>
487 <dt>
488 --submodule[=&lt;format&gt;]
489 </dt>
490 <dd>
492 Chose the output format for submodule differences. &lt;format&gt; can be one of
493 <em>short</em> and <em>log</em>. <em>short</em> just shows pairs of commit names, this format
494 is used when this option is not given. <em>log</em> is the default value for this
495 option and lists the commits in that commit range like the <em>summary</em>
496 option of <a href="git-submodule.html">git-submodule(1)</a> does.
497 </p>
498 </dd>
499 <dt>
500 --color
501 </dt>
502 <dd>
504 Show colored diff.
505 </p>
506 </dd>
507 <dt>
508 --no-color
509 </dt>
510 <dd>
512 Turn off colored diff, even when the configuration file
513 gives the default to color output.
514 </p>
515 </dd>
516 <dt>
517 --color-words[=&lt;regex&gt;]
518 </dt>
519 <dd>
521 Show colored word diff, i.e., color words which have changed.
522 By default, words are separated by whitespace.
523 </p>
524 <div class="para"><p>When a &lt;regex&gt; is specified, every non-overlapping match of the
525 &lt;regex&gt; is considered a word. Anything between these matches is
526 considered whitespace and ignored(!) for the purposes of finding
527 differences. You may want to append <tt>|[^[:space:]]</tt> to your regular
528 expression to make sure that it matches all non-whitespace characters.
529 A match that contains a newline is silently truncated(!) at the
530 newline.</p></div>
531 <div class="para"><p>The regex can also be set via a diff driver or configuration option, see
532 <a href="gitattributes.html">gitattributes(1)</a> or <a href="git-config.html">git-config(1)</a>. Giving it explicitly
533 overrides any diff driver or configuration setting. Diff drivers
534 override configuration settings.</p></div>
535 </dd>
536 <dt>
537 --no-renames
538 </dt>
539 <dd>
541 Turn off rename detection, even when the configuration
542 file gives the default to do so.
543 </p>
544 </dd>
545 <dt>
546 --check
547 </dt>
548 <dd>
550 Warn if changes introduce trailing whitespace
551 or an indent that uses a space before a tab. Exits with
552 non-zero status if problems are found. Not compatible with
553 --exit-code.
554 </p>
555 </dd>
556 <dt>
557 --full-index
558 </dt>
559 <dd>
561 Instead of the first handful of characters, show the full
562 pre- and post-image blob object names on the "index"
563 line when generating patch format output.
564 </p>
565 </dd>
566 <dt>
567 --binary
568 </dt>
569 <dd>
571 In addition to <tt>--full-index</tt>, output a binary diff that
572 can be applied with <tt>git-apply</tt>.
573 </p>
574 </dd>
575 <dt>
576 --abbrev[=&lt;n&gt;]
577 </dt>
578 <dd>
580 Instead of showing the full 40-byte hexadecimal object
581 name in diff-raw format output and diff-tree header
582 lines, show only a partial prefix. This is
583 independent of the <tt>--full-index</tt> option above, which controls
584 the diff-patch output format. Non default number of
585 digits can be specified with <tt>--abbrev=&lt;n&gt;</tt>.
586 </p>
587 </dd>
588 <dt>
590 </dt>
591 <dd>
593 Break complete rewrite changes into pairs of delete and create.
594 </p>
595 </dd>
596 <dt>
598 </dt>
599 <dd>
601 Detect renames.
602 </p>
603 </dd>
604 <dt>
606 </dt>
607 <dd>
609 Detect copies as well as renames. See also <tt>--find-copies-harder</tt>.
610 </p>
611 </dd>
612 <dt>
613 --diff-filter=[ACDMRTUXB*]
614 </dt>
615 <dd>
617 Select only files that are Added (<tt>A</tt>), Copied (<tt>C</tt>),
618 Deleted (<tt>D</tt>), Modified (<tt>M</tt>), Renamed (<tt>R</tt>), have their
619 type (i.e. regular file, symlink, submodule, &#8230;) changed (<tt>T</tt>),
620 are Unmerged (<tt>U</tt>), are
621 Unknown (<tt>X</tt>), or have had their pairing Broken (<tt>B</tt>).
622 Any combination of the filter characters may be used.
623 When <tt>*</tt> (All-or-none) is added to the combination, all
624 paths are selected if there is any file that matches
625 other criteria in the comparison; if there is no file
626 that matches other criteria, nothing is selected.
627 </p>
628 </dd>
629 <dt>
630 --find-copies-harder
631 </dt>
632 <dd>
634 For performance reasons, by default, <tt>-C</tt> option finds copies only
635 if the original file of the copy was modified in the same
636 changeset. This flag makes the command
637 inspect unmodified files as candidates for the source of
638 copy. This is a very expensive operation for large
639 projects, so use it with caution. Giving more than one
640 <tt>-C</tt> option has the same effect.
641 </p>
642 </dd>
643 <dt>
644 -l&lt;num&gt;
645 </dt>
646 <dd>
648 The <tt>-M</tt> and <tt>-C</tt> options require O(n^2) processing time where n
649 is the number of potential rename/copy targets. This
650 option prevents rename/copy detection from running if
651 the number of rename/copy targets exceeds the specified
652 number.
653 </p>
654 </dd>
655 <dt>
656 -S&lt;string&gt;
657 </dt>
658 <dd>
660 Look for differences that introduce or remove an instance of
661 &lt;string&gt;. Note that this is different than the string simply
662 appearing in diff output; see the <em>pickaxe</em> entry in
663 <a href="gitdiffcore.html">gitdiffcore(7)</a> for more details.
664 </p>
665 </dd>
666 <dt>
667 --pickaxe-all
668 </dt>
669 <dd>
671 When <tt>-S</tt> finds a change, show all the changes in that
672 changeset, not just the files that contain the change
673 in &lt;string&gt;.
674 </p>
675 </dd>
676 <dt>
677 --pickaxe-regex
678 </dt>
679 <dd>
681 Make the &lt;string&gt; not a plain string but an extended POSIX
682 regex to match.
683 </p>
684 </dd>
685 <dt>
686 -O&lt;orderfile&gt;
687 </dt>
688 <dd>
690 Output the patch in the order specified in the
691 &lt;orderfile&gt;, which has one shell glob pattern per line.
692 </p>
693 </dd>
694 <dt>
696 </dt>
697 <dd>
699 Swap two inputs; that is, show differences from index or
700 on-disk file to tree contents.
701 </p>
702 </dd>
703 <dt>
704 --relative[=&lt;path&gt;]
705 </dt>
706 <dd>
708 When run from a subdirectory of the project, it can be
709 told to exclude changes outside the directory and show
710 pathnames relative to it with this option. When you are
711 not in a subdirectory (e.g. in a bare repository), you
712 can name which subdirectory to make the output relative
713 to by giving a &lt;path&gt; as an argument.
714 </p>
715 </dd>
716 <dt>
718 </dt>
719 <dt>
720 --text
721 </dt>
722 <dd>
724 Treat all files as text.
725 </p>
726 </dd>
727 <dt>
728 --ignore-space-at-eol
729 </dt>
730 <dd>
732 Ignore changes in whitespace at EOL.
733 </p>
734 </dd>
735 <dt>
737 </dt>
738 <dt>
739 --ignore-space-change
740 </dt>
741 <dd>
743 Ignore changes in amount of whitespace. This ignores whitespace
744 at line end, and considers all other sequences of one or
745 more whitespace characters to be equivalent.
746 </p>
747 </dd>
748 <dt>
750 </dt>
751 <dt>
752 --ignore-all-space
753 </dt>
754 <dd>
756 Ignore whitespace when comparing lines. This ignores
757 differences even if one line has whitespace where the other
758 line has none.
759 </p>
760 </dd>
761 <dt>
762 --inter-hunk-context=&lt;lines&gt;
763 </dt>
764 <dd>
766 Show the context between diff hunks, up to the specified number
767 of lines, thereby fusing hunks that are close to each other.
768 </p>
769 </dd>
770 <dt>
771 --exit-code
772 </dt>
773 <dd>
775 Make the program exit with codes similar to diff(1).
776 That is, it exits with 1 if there were differences and
777 0 means no differences.
778 </p>
779 </dd>
780 <dt>
781 --quiet
782 </dt>
783 <dd>
785 Disable all output of the program. Implies <tt>--exit-code</tt>.
786 </p>
787 </dd>
788 <dt>
789 --ext-diff
790 </dt>
791 <dd>
793 Allow an external diff helper to be executed. If you set an
794 external diff driver with <a href="gitattributes.html">gitattributes(5)</a>, you need
795 to use this option with <a href="git-log.html">git-log(1)</a> and friends.
796 </p>
797 </dd>
798 <dt>
799 --no-ext-diff
800 </dt>
801 <dd>
803 Disallow external diff drivers.
804 </p>
805 </dd>
806 <dt>
807 --ignore-submodules
808 </dt>
809 <dd>
811 Ignore changes to submodules in the diff generation.
812 </p>
813 </dd>
814 <dt>
815 --src-prefix=&lt;prefix&gt;
816 </dt>
817 <dd>
819 Show the given source prefix instead of "a/".
820 </p>
821 </dd>
822 <dt>
823 --dst-prefix=&lt;prefix&gt;
824 </dt>
825 <dd>
827 Show the given destination prefix instead of "b/".
828 </p>
829 </dd>
830 <dt>
831 --no-prefix
832 </dt>
833 <dd>
835 Do not show any source or destination prefix.
836 </p>
837 </dd>
838 </dl></div>
839 <div class="para"><p>For more detailed explanation on these common options, see also
840 <a href="gitdiffcore.html">gitdiffcore(7)</a>.</p></div>
841 <div class="vlist"><dl>
842 <dt>
843 -&lt;n&gt;
844 </dt>
845 <dd>
847 Limits the number of commits to show.
848 </p>
849 </dd>
850 <dt>
851 &lt;since&gt;..&lt;until&gt;
852 </dt>
853 <dd>
855 Show only commits between the named two commits. When
856 either &lt;since&gt; or &lt;until&gt; is omitted, it defaults to
857 <tt>HEAD</tt>, i.e. the tip of the current branch.
858 For a more complete list of ways to spell &lt;since&gt;
859 and &lt;until&gt;, see "SPECIFYING REVISIONS" section in
860 <a href="git-rev-parse.html">git-rev-parse(1)</a>.
861 </p>
862 </dd>
863 <dt>
864 --decorate[=short|full]
865 </dt>
866 <dd>
868 Print out the ref names of any commits that are shown. If <em>short</em> is
869 specified, the ref name prefixes <em>refs/heads/</em>, <em>refs/tags/</em> and
870 <em>refs/remotes/</em> will not be printed. If <em>full</em> is specified, the
871 full ref name (including prefix) will be printed. The default option
872 is <em>short</em>.
873 </p>
874 </dd>
875 <dt>
876 --source
877 </dt>
878 <dd>
880 Print out the ref name given on the command line by which each
881 commit was reached.
882 </p>
883 </dd>
884 <dt>
885 --full-diff
886 </dt>
887 <dd>
889 Without this flag, "git log -p &lt;path&gt;&#8230;" shows commits that
890 touch the specified paths, and diffs about the same specified
891 paths. With this, the full diff is shown for commits that touch
892 the specified paths; this means that "&lt;path&gt;&#8230;" limits only
893 commits, and doesn't limit diff for those commits.
894 </p>
895 </dd>
896 <dt>
897 --follow
898 </dt>
899 <dd>
901 Continue listing the history of a file beyond renames.
902 </p>
903 </dd>
904 <dt>
905 --log-size
906 </dt>
907 <dd>
909 Before the log message print out its size in bytes. Intended
910 mainly for porcelain tools consumption. If git is unable to
911 produce a valid value size is set to zero.
912 Note that only message is considered, if also a diff is shown
913 its size is not included.
914 </p>
915 </dd>
916 <dt>
917 [--] &lt;path&gt;&#8230;
918 </dt>
919 <dd>
921 Show only commits that affect any of the specified paths. To
922 prevent confusion with options and branch names, paths may need
923 to be prefixed with "-- " to separate them from options or
924 refnames.
925 </p>
926 </dd>
927 </dl></div>
928 <h3 id="_commit_formatting">Commit Formatting</h3><div style="clear:left"></div>
929 <div class="vlist"><dl>
930 <dt>
931 --pretty[=<em>&lt;format&gt;</em>]
932 </dt>
933 <dt>
934 --format[=<em>&lt;format&gt;</em>]
935 </dt>
936 <dd>
938 Pretty-print the contents of the commit logs in a given format,
939 where <em>&lt;format&gt;</em> can be one of <em>oneline</em>, <em>short</em>, <em>medium</em>,
940 <em>full</em>, <em>fuller</em>, <em>email</em>, <em>raw</em> and <em>format:&lt;string&gt;</em>.
941 When omitted, the format defaults to <em>medium</em>.
942 </p>
943 <div class="para"><p>Note: you can specify the default pretty format in the repository
944 configuration (see <a href="git-config.html">git-config(1)</a>).</p></div>
945 </dd>
946 <dt>
947 --abbrev-commit
948 </dt>
949 <dd>
951 Instead of showing the full 40-byte hexadecimal commit object
952 name, show only a partial prefix. Non default number of
953 digits can be specified with "--abbrev=&lt;n&gt;" (which also modifies
954 diff output, if it is displayed).
955 </p>
956 <div class="para"><p>This should make "--pretty=oneline" a whole lot more readable for
957 people using 80-column terminals.</p></div>
958 </dd>
959 <dt>
960 --oneline
961 </dt>
962 <dd>
964 This is a shorthand for "--pretty=oneline --abbrev-commit"
965 used together.
966 </p>
967 </dd>
968 <dt>
969 --encoding[=&lt;encoding&gt;]
970 </dt>
971 <dd>
973 The commit objects record the encoding used for the log message
974 in their encoding header; this option can be used to tell the
975 command to re-code the commit log message in the encoding
976 preferred by the user. For non plumbing commands this
977 defaults to UTF-8.
978 </p>
979 </dd>
980 <dt>
981 --relative-date
982 </dt>
983 <dd>
985 Synonym for <tt>--date=relative</tt>.
986 </p>
987 </dd>
988 <dt>
989 --date={relative,local,default,iso,rfc,short,raw}
990 </dt>
991 <dd>
993 Only takes effect for dates shown in human-readable format, such
994 as when using "--pretty". <tt>log.date</tt> config variable sets a default
995 value for log command's --date option.
996 </p>
997 <div class="para"><p><tt>--date=relative</tt> shows dates relative to the current time,
998 e.g. "2 hours ago".</p></div>
999 <div class="para"><p><tt>--date=local</tt> shows timestamps in user's local timezone.</p></div>
1000 <div class="para"><p><tt>--date=iso</tt> (or <tt>--date=iso8601</tt>) shows timestamps in ISO 8601 format.</p></div>
1001 <div class="para"><p><tt>--date=rfc</tt> (or <tt>--date=rfc2822</tt>) shows timestamps in RFC 2822
1002 format, often found in E-mail messages.</p></div>
1003 <div class="para"><p><tt>--date=short</tt> shows only date but not time, in <tt>YYYY-MM-DD</tt> format.</p></div>
1004 <div class="para"><p><tt>--date=raw</tt> shows the date in the internal raw git format <tt>%s %z</tt> format.</p></div>
1005 <div class="para"><p><tt>--date=default</tt> shows timestamps in the original timezone
1006 (either committer's or author's).</p></div>
1007 </dd>
1008 <dt>
1009 --parents
1010 </dt>
1011 <dd>
1013 Print the parents of the commit. Also enables parent
1014 rewriting, see <em>History Simplification</em> below.
1015 </p>
1016 </dd>
1017 <dt>
1018 --children
1019 </dt>
1020 <dd>
1022 Print the children of the commit. Also enables parent
1023 rewriting, see <em>History Simplification</em> below.
1024 </p>
1025 </dd>
1026 <dt>
1027 --left-right
1028 </dt>
1029 <dd>
1031 Mark which side of a symmetric diff a commit is reachable from.
1032 Commits from the left side are prefixed with <tt>&lt;</tt> and those from
1033 the right with <tt>&gt;</tt>. If combined with <tt>--boundary</tt>, those
1034 commits are prefixed with <tt>-</tt>.
1035 </p>
1036 <div class="para"><p>For example, if you have this topology:</p></div>
1037 <div class="listingblock">
1038 <div class="content">
1039 <pre><tt> y---b---b branch B
1040 / \ /
1042 / / \
1043 o---x---a---a branch A</tt></pre>
1044 </div></div>
1045 <div class="para"><p>you would get an output like this:</p></div>
1046 <div class="listingblock">
1047 <div class="content">
1048 <pre><tt> $ git rev-list --left-right --boundary --pretty=oneline A...B
1050 &gt;bbbbbbb... 3rd on b
1051 &gt;bbbbbbb... 2nd on b
1052 &lt;aaaaaaa... 3rd on a
1053 &lt;aaaaaaa... 2nd on a
1054 -yyyyyyy... 1st on b
1055 -xxxxxxx... 1st on a</tt></pre>
1056 </div></div>
1057 </dd>
1058 <dt>
1059 --graph
1060 </dt>
1061 <dd>
1063 Draw a text-based graphical representation of the commit history
1064 on the left hand side of the output. This may cause extra lines
1065 to be printed in between commits, in order for the graph history
1066 to be drawn properly.
1067 </p>
1068 <div class="para"><p>This implies the <em>--topo-order</em> option by default, but the
1069 <em>--date-order</em> option may also be specified.</p></div>
1070 </dd>
1071 </dl></div>
1072 <h3 id="_diff_formatting">Diff Formatting</h3><div style="clear:left"></div>
1073 <div class="para"><p>Below are listed options that control the formatting of diff output.
1074 Some of them are specific to <a href="git-rev-list.html">git-rev-list(1)</a>, however other diff
1075 options may be given. See <a href="git-diff-files.html">git-diff-files(1)</a> for more options.</p></div>
1076 <div class="vlist"><dl>
1077 <dt>
1079 </dt>
1080 <dd>
1082 This flag changes the way a merge commit is displayed. It shows
1083 the differences from each of the parents to the merge result
1084 simultaneously instead of showing pairwise diff between a parent
1085 and the result one at a time. Furthermore, it lists only files
1086 which were modified from all parents.
1087 </p>
1088 </dd>
1089 <dt>
1090 --cc
1091 </dt>
1092 <dd>
1094 This flag implies the <em>-c</em> options and further compresses the
1095 patch output by omitting uninteresting hunks whose contents in
1096 the parents have only two variants and the merge result picks
1097 one of them without modification.
1098 </p>
1099 </dd>
1100 <dt>
1102 </dt>
1103 <dd>
1105 Show recursive diffs.
1106 </p>
1107 </dd>
1108 <dt>
1110 </dt>
1111 <dd>
1113 Show the tree objects in the diff output. This implies <em>-r</em>.
1114 </p>
1115 </dd>
1116 </dl></div>
1117 <h3 id="_commit_limiting">Commit Limiting</h3><div style="clear:left"></div>
1118 <div class="para"><p>Besides specifying a range of commits that should be listed using the
1119 special notations explained in the description, additional commit
1120 limiting may be applied.</p></div>
1121 <div class="vlist"><dl>
1122 <dt>
1123 -n <em>number</em>
1124 </dt>
1125 <dt>
1126 --max-count=&lt;number&gt;
1127 </dt>
1128 <dd>
1130 Limit the number of commits output.
1131 </p>
1132 </dd>
1133 <dt>
1134 --skip=&lt;number&gt;
1135 </dt>
1136 <dd>
1138 Skip <em>number</em> commits before starting to show the commit output.
1139 </p>
1140 </dd>
1141 <dt>
1142 --since=&lt;date&gt;
1143 </dt>
1144 <dt>
1145 --after=&lt;date&gt;
1146 </dt>
1147 <dd>
1149 Show commits more recent than a specific date.
1150 </p>
1151 </dd>
1152 <dt>
1153 --until=&lt;date&gt;
1154 </dt>
1155 <dt>
1156 --before=&lt;date&gt;
1157 </dt>
1158 <dd>
1160 Show commits older than a specific date.
1161 </p>
1162 </dd>
1163 <dt>
1164 --author=&lt;pattern&gt;
1165 </dt>
1166 <dt>
1167 --committer=&lt;pattern&gt;
1168 </dt>
1169 <dd>
1171 Limit the commits output to ones with author/committer
1172 header lines that match the specified pattern (regular expression).
1173 </p>
1174 </dd>
1175 <dt>
1176 --grep=&lt;pattern&gt;
1177 </dt>
1178 <dd>
1180 Limit the commits output to ones with log message that
1181 matches the specified pattern (regular expression).
1182 </p>
1183 </dd>
1184 <dt>
1185 --all-match
1186 </dt>
1187 <dd>
1189 Limit the commits output to ones that match all given --grep,
1190 --author and --committer instead of ones that match at least one.
1191 </p>
1192 </dd>
1193 <dt>
1195 </dt>
1196 <dt>
1197 --regexp-ignore-case
1198 </dt>
1199 <dd>
1201 Match the regexp limiting patterns without regard to letters case.
1202 </p>
1203 </dd>
1204 <dt>
1206 </dt>
1207 <dt>
1208 --extended-regexp
1209 </dt>
1210 <dd>
1212 Consider the limiting patterns to be extended regular expressions
1213 instead of the default basic regular expressions.
1214 </p>
1215 </dd>
1216 <dt>
1218 </dt>
1219 <dt>
1220 --fixed-strings
1221 </dt>
1222 <dd>
1224 Consider the limiting patterns to be fixed strings (don't interpret
1225 pattern as a regular expression).
1226 </p>
1227 </dd>
1228 <dt>
1229 --remove-empty
1230 </dt>
1231 <dd>
1233 Stop when a given path disappears from the tree.
1234 </p>
1235 </dd>
1236 <dt>
1237 --merges
1238 </dt>
1239 <dd>
1241 Print only merge commits.
1242 </p>
1243 </dd>
1244 <dt>
1245 --no-merges
1246 </dt>
1247 <dd>
1249 Do not print commits with more than one parent.
1250 </p>
1251 </dd>
1252 <dt>
1253 --first-parent
1254 </dt>
1255 <dd>
1257 Follow only the first parent commit upon seeing a merge
1258 commit. This option can give a better overview when
1259 viewing the evolution of a particular topic branch,
1260 because merges into a topic branch tend to be only about
1261 adjusting to updated upstream from time to time, and
1262 this option allows you to ignore the individual commits
1263 brought in to your history by such a merge.
1264 </p>
1265 </dd>
1266 <dt>
1267 --not
1268 </dt>
1269 <dd>
1271 Reverses the meaning of the <em>&#94;</em> prefix (or lack thereof)
1272 for all following revision specifiers, up to the next <em>--not</em>.
1273 </p>
1274 </dd>
1275 <dt>
1276 --all
1277 </dt>
1278 <dd>
1280 Pretend as if all the refs in <tt>$GIT_DIR/refs/</tt> are listed on the
1281 command line as <em>&lt;commit&gt;</em>.
1282 </p>
1283 </dd>
1284 <dt>
1285 --branches
1286 </dt>
1287 <dd>
1289 Pretend as if all the refs in <tt>$GIT_DIR/refs/heads</tt> are listed
1290 on the command line as <em>&lt;commit&gt;</em>.
1291 </p>
1292 </dd>
1293 <dt>
1294 --tags
1295 </dt>
1296 <dd>
1298 Pretend as if all the refs in <tt>$GIT_DIR/refs/tags</tt> are listed
1299 on the command line as <em>&lt;commit&gt;</em>.
1300 </p>
1301 </dd>
1302 <dt>
1303 --remotes
1304 </dt>
1305 <dd>
1307 Pretend as if all the refs in <tt>$GIT_DIR/refs/remotes</tt> are listed
1308 on the command line as <em>&lt;commit&gt;</em>.
1309 </p>
1310 </dd>
1311 <dt>
1312 --bisect
1313 </dt>
1314 <dd>
1316 Pretend as if the bad bisection ref <tt>$GIT_DIR/refs/bisect/bad</tt>
1317 was listed and as if it was followed by <tt>--not</tt> and the good
1318 bisection refs <tt>$GIT_DIR/refs/bisect/good-*</tt> on the command
1319 line.
1320 </p>
1321 </dd>
1322 <dt>
1323 --stdin
1324 </dt>
1325 <dd>
1327 In addition to the <em>&lt;commit&gt;</em> listed on the command
1328 line, read them from the standard input. If a <em>--</em> separator is
1329 seen, stop reading commits and start reading paths to limit the
1330 result.
1331 </p>
1332 </dd>
1333 <dt>
1334 --cherry-pick
1335 </dt>
1336 <dd>
1338 Omit any commit that introduces the same change as
1339 another commit on the "other side" when the set of
1340 commits are limited with symmetric difference.<br />
1341 For example, if you have two branches, <tt>A</tt> and <tt>B</tt>, a usual way
1342 to list all commits on only one side of them is with
1343 <tt>--left-right</tt>, like the example above in the description of
1344 that option. It however shows the commits that were cherry-picked
1345 from the other branch (for example, "3rd on b" may be cherry-picked
1346 from branch A). With this option, such pairs of commits are
1347 excluded from the output.
1348 </p>
1349 </dd>
1350 <dt>
1352 </dt>
1353 <dt>
1354 --walk-reflogs
1355 </dt>
1356 <dd>
1358 Instead of walking the commit ancestry chain, walk
1359 reflog entries from the most recent one to older ones.
1360 When this option is used you cannot specify commits to
1361 exclude (that is, <em>&#94;commit</em>, <em>commit1..commit2</em>,
1362 nor <em>commit1&#8230;commit2</em> notations cannot be used).<br />
1363 With <em>--pretty</em> format other than oneline (for obvious reasons),
1364 this causes the output to have two extra lines of information
1365 taken from the reflog. By default, <em>commit@{Nth}</em> notation is
1366 used in the output. When the starting commit is specified as
1367 <em>commit@{now}</em>, output also uses <em>commit@{timestamp}</em> notation
1368 instead. Under <em>--pretty=oneline</em>, the commit message is
1369 prefixed with this information on the same line.
1370 This option cannot be combined with <em>--reverse</em>.
1371 See also <a href="git-reflog.html">git-reflog(1)</a>.
1372 </p>
1373 </dd>
1374 <dt>
1375 --merge
1376 </dt>
1377 <dd>
1379 After a failed merge, show refs that touch files having a
1380 conflict and don't exist on all heads to merge.
1381 </p>
1382 </dd>
1383 <dt>
1384 --boundary
1385 </dt>
1386 <dd>
1388 Output uninteresting commits at the boundary, which are usually
1389 not shown.
1390 </p>
1391 </dd>
1392 </dl></div>
1393 <h3 id="_history_simplification">History Simplification</h3><div style="clear:left"></div>
1394 <div class="para"><p>Sometimes you are only interested in parts of the history, for example the
1395 commits modifying a particular &lt;path&gt;. But there are two parts of
1396 <em>History Simplification</em>, one part is selecting the commits and the other
1397 is how to do it, as there are various strategies to simplify the history.</p></div>
1398 <div class="para"><p>The following options select the commits to be shown:</p></div>
1399 <div class="vlist"><dl>
1400 <dt>
1401 &lt;paths&gt;
1402 </dt>
1403 <dd>
1405 Commits modifying the given &lt;paths&gt; are selected.
1406 </p>
1407 </dd>
1408 <dt>
1409 --simplify-by-decoration
1410 </dt>
1411 <dd>
1413 Commits that are referred by some branch or tag are selected.
1414 </p>
1415 </dd>
1416 </dl></div>
1417 <div class="para"><p>Note that extra commits can be shown to give a meaningful history.</p></div>
1418 <div class="para"><p>The following options affect the way the simplification is performed:</p></div>
1419 <div class="vlist"><dl>
1420 <dt>
1421 Default mode
1422 </dt>
1423 <dd>
1425 Simplifies the history to the simplest history explaining the
1426 final state of the tree. Simplest because it prunes some side
1427 branches if the end result is the same (i.e. merging branches
1428 with the same content)
1429 </p>
1430 </dd>
1431 <dt>
1432 --full-history
1433 </dt>
1434 <dd>
1436 As the default mode but does not prune some history.
1437 </p>
1438 </dd>
1439 <dt>
1440 --dense
1441 </dt>
1442 <dd>
1444 Only the selected commits are shown, plus some to have a
1445 meaningful history.
1446 </p>
1447 </dd>
1448 <dt>
1449 --sparse
1450 </dt>
1451 <dd>
1453 All commits in the simplified history are shown.
1454 </p>
1455 </dd>
1456 <dt>
1457 --simplify-merges
1458 </dt>
1459 <dd>
1461 Additional option to <em>--full-history</em> to remove some needless
1462 merges from the resulting history, as there are no selected
1463 commits contributing to this merge.
1464 </p>
1465 </dd>
1466 </dl></div>
1467 <div class="para"><p>A more detailed explanation follows.</p></div>
1468 <div class="para"><p>Suppose you specified <tt>foo</tt> as the &lt;paths&gt;. We shall call commits
1469 that modify <tt>foo</tt> !TREESAME, and the rest TREESAME. (In a diff
1470 filtered for <tt>foo</tt>, they look different and equal, respectively.)</p></div>
1471 <div class="para"><p>In the following, we will always refer to the same example history to
1472 illustrate the differences between simplification settings. We assume
1473 that you are filtering for a file <tt>foo</tt> in this commit graph:</p></div>
1474 <div class="listingblock">
1475 <div class="content">
1476 <pre><tt> .-A---M---N---O---P
1477 / / / / /
1478 I B C D E
1479 \ / / / /
1480 `-------------'</tt></pre>
1481 </div></div>
1482 <div class="para"><p>The horizontal line of history A--P is taken to be the first parent of
1483 each merge. The commits are:</p></div>
1484 <div class="ilist"><ul>
1485 <li>
1487 <tt>I</tt> is the initial commit, in which <tt>foo</tt> exists with contents
1488 "asdf", and a file <tt>quux</tt> exists with contents "quux". Initial
1489 commits are compared to an empty tree, so <tt>I</tt> is !TREESAME.
1490 </p>
1491 </li>
1492 <li>
1494 In <tt>A</tt>, <tt>foo</tt> contains just "foo".
1495 </p>
1496 </li>
1497 <li>
1499 <tt>B</tt> contains the same change as <tt>A</tt>. Its merge <tt>M</tt> is trivial and
1500 hence TREESAME to all parents.
1501 </p>
1502 </li>
1503 <li>
1505 <tt>C</tt> does not change <tt>foo</tt>, but its merge <tt>N</tt> changes it to "foobar",
1506 so it is not TREESAME to any parent.
1507 </p>
1508 </li>
1509 <li>
1511 <tt>D</tt> sets <tt>foo</tt> to "baz". Its merge <tt>O</tt> combines the strings from
1512 <tt>N</tt> and <tt>D</tt> to "foobarbaz"; i.e., it is not TREESAME to any parent.
1513 </p>
1514 </li>
1515 <li>
1517 <tt>E</tt> changes <tt>quux</tt> to "xyzzy", and its merge <tt>P</tt> combines the
1518 strings to "quux xyzzy". Despite appearing interesting, <tt>P</tt> is
1519 TREESAME to all parents.
1520 </p>
1521 </li>
1522 </ul></div>
1523 <div class="para"><p><em>rev-list</em> walks backwards through history, including or excluding
1524 commits based on whether <em>--full-history</em> and/or parent rewriting
1525 (via <em>--parents</em> or <em>--children</em>) are used. The following settings
1526 are available.</p></div>
1527 <div class="vlist"><dl>
1528 <dt>
1529 Default mode
1530 </dt>
1531 <dd>
1533 Commits are included if they are not TREESAME to any parent
1534 (though this can be changed, see <em>--sparse</em> below). If the
1535 commit was a merge, and it was TREESAME to one parent, follow
1536 only that parent. (Even if there are several TREESAME
1537 parents, follow only one of them.) Otherwise, follow all
1538 parents.
1539 </p>
1540 <div class="para"><p>This results in:</p></div>
1541 <div class="listingblock">
1542 <div class="content">
1543 <pre><tt> .-A---N---O
1545 I---------D</tt></pre>
1546 </div></div>
1547 <div class="para"><p>Note how the rule to only follow the TREESAME parent, if one is
1548 available, removed <tt>B</tt> from consideration entirely. <tt>C</tt> was
1549 considered via <tt>N</tt>, but is TREESAME. Root commits are compared to an
1550 empty tree, so <tt>I</tt> is !TREESAME.</p></div>
1551 <div class="para"><p>Parent/child relations are only visible with --parents, but that does
1552 not affect the commits selected in default mode, so we have shown the
1553 parent lines.</p></div>
1554 </dd>
1555 <dt>
1556 --full-history without parent rewriting
1557 </dt>
1558 <dd>
1560 This mode differs from the default in one point: always follow
1561 all parents of a merge, even if it is TREESAME to one of them.
1562 Even if more than one side of the merge has commits that are
1563 included, this does not imply that the merge itself is! In
1564 the example, we get
1565 </p>
1566 <div class="listingblock">
1567 <div class="content">
1568 <pre><tt> I A B N D O</tt></pre>
1569 </div></div>
1570 <div class="para"><p><tt>P</tt> and <tt>M</tt> were excluded because they are TREESAME to a parent. <tt>E</tt>,
1571 <tt>C</tt> and <tt>B</tt> were all walked, but only <tt>B</tt> was !TREESAME, so the others
1572 do not appear.</p></div>
1573 <div class="para"><p>Note that without parent rewriting, it is not really possible to talk
1574 about the parent/child relationships between the commits, so we show
1575 them disconnected.</p></div>
1576 </dd>
1577 <dt>
1578 --full-history with parent rewriting
1579 </dt>
1580 <dd>
1582 Ordinary commits are only included if they are !TREESAME
1583 (though this can be changed, see <em>--sparse</em> below).
1584 </p>
1585 <div class="para"><p>Merges are always included. However, their parent list is rewritten:
1586 Along each parent, prune away commits that are not included
1587 themselves. This results in</p></div>
1588 <div class="listingblock">
1589 <div class="content">
1590 <pre><tt> .-A---M---N---O---P
1591 / / / / /
1592 I B / D /
1593 \ / / / /
1594 `-------------'</tt></pre>
1595 </div></div>
1596 <div class="para"><p>Compare to <em>--full-history</em> without rewriting above. Note that <tt>E</tt>
1597 was pruned away because it is TREESAME, but the parent list of P was
1598 rewritten to contain <tt>E</tt>'s parent <tt>I</tt>. The same happened for <tt>C</tt> and
1599 <tt>N</tt>. Note also that <tt>P</tt> was included despite being TREESAME.</p></div>
1600 </dd>
1601 </dl></div>
1602 <div class="para"><p>In addition to the above settings, you can change whether TREESAME
1603 affects inclusion:</p></div>
1604 <div class="vlist"><dl>
1605 <dt>
1606 --dense
1607 </dt>
1608 <dd>
1610 Commits that are walked are included if they are not TREESAME
1611 to any parent.
1612 </p>
1613 </dd>
1614 <dt>
1615 --sparse
1616 </dt>
1617 <dd>
1619 All commits that are walked are included.
1620 </p>
1621 <div class="para"><p>Note that without <em>--full-history</em>, this still simplifies merges: if
1622 one of the parents is TREESAME, we follow only that one, so the other
1623 sides of the merge are never walked.</p></div>
1624 </dd>
1625 </dl></div>
1626 <div class="para"><p>Finally, there is a fourth simplification mode available:</p></div>
1627 <div class="vlist"><dl>
1628 <dt>
1629 --simplify-merges
1630 </dt>
1631 <dd>
1633 First, build a history graph in the same way that
1634 <em>--full-history</em> with parent rewriting does (see above).
1635 </p>
1636 <div class="para"><p>Then simplify each commit <tt>C</tt> to its replacement <tt>C'</tt> in the final
1637 history according to the following rules:</p></div>
1638 <div class="ilist"><ul>
1639 <li>
1641 Set <tt>C'</tt> to <tt>C</tt>.<br />
1642 </p>
1643 </li>
1644 <li>
1646 Replace each parent <tt>P</tt> of <tt>C'</tt> with its simplification <tt>P'</tt>. In
1647 the process, drop parents that are ancestors of other parents, and
1648 remove duplicates.<br />
1649 </p>
1650 </li>
1651 <li>
1653 If after this parent rewriting, <tt>C'</tt> is a root or merge commit (has
1654 zero or &gt;1 parents), a boundary commit, or !TREESAME, it remains.
1655 Otherwise, it is replaced with its only parent.
1656 </p>
1657 </li>
1658 </ul></div>
1659 <div class="para"><p>The effect of this is best shown by way of comparing to
1660 <em>--full-history</em> with parent rewriting. The example turns into:</p></div>
1661 <div class="listingblock">
1662 <div class="content">
1663 <pre><tt> .-A---M---N---O
1664 / / /
1665 I B D
1666 \ / /
1667 `---------'</tt></pre>
1668 </div></div>
1669 <div class="para"><p>Note the major differences in <tt>N</tt> and <tt>P</tt> over <em>--full-history</em>:</p></div>
1670 <div class="ilist"><ul>
1671 <li>
1673 <tt>N</tt>'s parent list had <tt>I</tt> removed, because it is an ancestor of the
1674 other parent <tt>M</tt>. Still, <tt>N</tt> remained because it is !TREESAME.<br />
1675 </p>
1676 </li>
1677 <li>
1679 <tt>P</tt>'s parent list similarly had <tt>I</tt> removed. <tt>P</tt> was then
1680 removed completely, because it had one parent and is TREESAME.
1681 </p>
1682 </li>
1683 </ul></div>
1684 </dd>
1685 </dl></div>
1686 <div class="para"><p>The <em>--simplify-by-decoration</em> option allows you to view only the
1687 big picture of the topology of the history, by omitting commits
1688 that are not referenced by tags. Commits are marked as !TREESAME
1689 (in other words, kept after history simplification rules described
1690 above) if (1) they are referenced by tags, or (2) they change the
1691 contents of the paths given on the command line. All other
1692 commits are marked as TREESAME (subject to be simplified away).</p></div>
1693 <h3 id="_commit_ordering">Commit Ordering</h3><div style="clear:left"></div>
1694 <div class="para"><p>By default, the commits are shown in reverse chronological order.</p></div>
1695 <div class="vlist"><dl>
1696 <dt>
1697 --topo-order
1698 </dt>
1699 <dd>
1701 This option makes them appear in topological order (i.e.
1702 descendant commits are shown before their parents).
1703 </p>
1704 </dd>
1705 <dt>
1706 --date-order
1707 </dt>
1708 <dd>
1710 This option is similar to <em>--topo-order</em> in the sense that no
1711 parent comes before all of its children, but otherwise things
1712 are still ordered in the commit timestamp order.
1713 </p>
1714 </dd>
1715 <dt>
1716 --reverse
1717 </dt>
1718 <dd>
1720 Output the commits in reverse order.
1721 Cannot be combined with <em>--walk-reflogs</em>.
1722 </p>
1723 </dd>
1724 </dl></div>
1725 <h3 id="_object_traversal">Object Traversal</h3><div style="clear:left"></div>
1726 <div class="para"><p>These options are mostly targeted for packing of git repositories.</p></div>
1727 <div class="vlist"><dl>
1728 <dt>
1729 --objects
1730 </dt>
1731 <dd>
1733 Print the object IDs of any object referenced by the listed
1734 commits. <em>--objects foo ^bar</em> thus means "send me
1735 all object IDs which I need to download if I have the commit
1736 object <em>bar</em>, but not <em>foo</em>".
1737 </p>
1738 </dd>
1739 <dt>
1740 --objects-edge
1741 </dt>
1742 <dd>
1744 Similar to <em>--objects</em>, but also print the IDs of excluded
1745 commits prefixed with a "-" character. This is used by
1746 <a href="git-pack-objects.html">git-pack-objects(1)</a> to build "thin" pack, which records
1747 objects in deltified form based on objects contained in these
1748 excluded commits to reduce network traffic.
1749 </p>
1750 </dd>
1751 <dt>
1752 --unpacked
1753 </dt>
1754 <dd>
1756 Only useful with <em>--objects</em>; print the object IDs that are not
1757 in packs.
1758 </p>
1759 </dd>
1760 <dt>
1761 --no-walk
1762 </dt>
1763 <dd>
1765 Only show the given revs, but do not traverse their ancestors.
1766 </p>
1767 </dd>
1768 <dt>
1769 --do-walk
1770 </dt>
1771 <dd>
1773 Overrides a previous --no-walk.
1774 </p>
1775 </dd>
1776 </dl></div>
1777 </div>
1778 <h2 id="_pretty_formats">PRETTY FORMATS</h2>
1779 <div class="sectionbody">
1780 <div class="para"><p>If the commit is a merge, and if the pretty-format
1781 is not <em>oneline</em>, <em>email</em> or <em>raw</em>, an additional line is
1782 inserted before the <em>Author:</em> line. This line begins with
1783 "Merge: " and the sha1s of ancestral commits are printed,
1784 separated by spaces. Note that the listed commits may not
1785 necessarily be the list of the <strong>direct</strong> parent commits if you
1786 have limited your view of history: for example, if you are
1787 only interested in changes related to a certain directory or
1788 file.</p></div>
1789 <div class="para"><p>Here are some additional details for each format:</p></div>
1790 <div class="ilist"><ul>
1791 <li>
1793 <em>oneline</em>
1794 </p>
1795 <div class="literalblock">
1796 <div class="content">
1797 <pre><tt>&lt;sha1&gt; &lt;title line&gt;</tt></pre>
1798 </div></div>
1799 <div class="para"><p>This is designed to be as compact as possible.</p></div>
1800 </li>
1801 <li>
1803 <em>short</em>
1804 </p>
1805 <div class="literalblock">
1806 <div class="content">
1807 <pre><tt>commit &lt;sha1&gt;
1808 Author: &lt;author&gt;</tt></pre>
1809 </div></div>
1810 <div class="literalblock">
1811 <div class="content">
1812 <pre><tt>&lt;title line&gt;</tt></pre>
1813 </div></div>
1814 </li>
1815 <li>
1817 <em>medium</em>
1818 </p>
1819 <div class="literalblock">
1820 <div class="content">
1821 <pre><tt>commit &lt;sha1&gt;
1822 Author: &lt;author&gt;
1823 Date: &lt;author date&gt;</tt></pre>
1824 </div></div>
1825 <div class="literalblock">
1826 <div class="content">
1827 <pre><tt>&lt;title line&gt;</tt></pre>
1828 </div></div>
1829 <div class="literalblock">
1830 <div class="content">
1831 <pre><tt>&lt;full commit message&gt;</tt></pre>
1832 </div></div>
1833 </li>
1834 <li>
1836 <em>full</em>
1837 </p>
1838 <div class="literalblock">
1839 <div class="content">
1840 <pre><tt>commit &lt;sha1&gt;
1841 Author: &lt;author&gt;
1842 Commit: &lt;committer&gt;</tt></pre>
1843 </div></div>
1844 <div class="literalblock">
1845 <div class="content">
1846 <pre><tt>&lt;title line&gt;</tt></pre>
1847 </div></div>
1848 <div class="literalblock">
1849 <div class="content">
1850 <pre><tt>&lt;full commit message&gt;</tt></pre>
1851 </div></div>
1852 </li>
1853 <li>
1855 <em>fuller</em>
1856 </p>
1857 <div class="literalblock">
1858 <div class="content">
1859 <pre><tt>commit &lt;sha1&gt;
1860 Author: &lt;author&gt;
1861 AuthorDate: &lt;author date&gt;
1862 Commit: &lt;committer&gt;
1863 CommitDate: &lt;committer date&gt;</tt></pre>
1864 </div></div>
1865 <div class="literalblock">
1866 <div class="content">
1867 <pre><tt>&lt;title line&gt;</tt></pre>
1868 </div></div>
1869 <div class="literalblock">
1870 <div class="content">
1871 <pre><tt>&lt;full commit message&gt;</tt></pre>
1872 </div></div>
1873 </li>
1874 <li>
1876 <em>email</em>
1877 </p>
1878 <div class="literalblock">
1879 <div class="content">
1880 <pre><tt>From &lt;sha1&gt; &lt;date&gt;
1881 From: &lt;author&gt;
1882 Date: &lt;author date&gt;
1883 Subject: [PATCH] &lt;title line&gt;</tt></pre>
1884 </div></div>
1885 <div class="literalblock">
1886 <div class="content">
1887 <pre><tt>&lt;full commit message&gt;</tt></pre>
1888 </div></div>
1889 </li>
1890 <li>
1892 <em>raw</em>
1893 </p>
1894 <div class="para"><p>The <em>raw</em> format shows the entire commit exactly as
1895 stored in the commit object. Notably, the SHA1s are
1896 displayed in full, regardless of whether --abbrev or
1897 --no-abbrev are used, and <em>parents</em> information show the
1898 true parent commits, without taking grafts nor history
1899 simplification into account.</p></div>
1900 </li>
1901 <li>
1903 <em>format:</em>
1904 </p>
1905 <div class="para"><p>The <em>format:</em> format allows you to specify which information
1906 you want to show. It works a little bit like printf format,
1907 with the notable exception that you get a newline with <em>%n</em>
1908 instead of <em>\n</em>.</p></div>
1909 <div class="para"><p>E.g, <em>format:"The author of %h was %an, %ar%nThe title was &gt;&gt;%s&lt;&lt;%n"</em>
1910 would show something like this:</p></div>
1911 <div class="listingblock">
1912 <div class="content">
1913 <pre><tt>The author of fe6e0ee was Junio C Hamano, 23 hours ago
1914 The title was &gt;&gt;t4119: test autocomputing -p&lt;n&gt; for traditional diff input.&lt;&lt;
1915 </tt></pre>
1916 </div></div>
1917 <div class="para"><p>The placeholders are:</p></div>
1918 <div class="ilist"><ul>
1919 <li>
1921 <em>%H</em>: commit hash
1922 </p>
1923 </li>
1924 <li>
1926 <em>%h</em>: abbreviated commit hash
1927 </p>
1928 </li>
1929 <li>
1931 <em>%T</em>: tree hash
1932 </p>
1933 </li>
1934 <li>
1936 <em>%t</em>: abbreviated tree hash
1937 </p>
1938 </li>
1939 <li>
1941 <em>%P</em>: parent hashes
1942 </p>
1943 </li>
1944 <li>
1946 <em>%p</em>: abbreviated parent hashes
1947 </p>
1948 </li>
1949 <li>
1951 <em>%an</em>: author name
1952 </p>
1953 </li>
1954 <li>
1956 <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>)
1957 </p>
1958 </li>
1959 <li>
1961 <em>%ae</em>: author email
1962 </p>
1963 </li>
1964 <li>
1966 <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>)
1967 </p>
1968 </li>
1969 <li>
1971 <em>%ad</em>: author date (format respects --date= option)
1972 </p>
1973 </li>
1974 <li>
1976 <em>%aD</em>: author date, RFC2822 style
1977 </p>
1978 </li>
1979 <li>
1981 <em>%ar</em>: author date, relative
1982 </p>
1983 </li>
1984 <li>
1986 <em>%at</em>: author date, UNIX timestamp
1987 </p>
1988 </li>
1989 <li>
1991 <em>%ai</em>: author date, ISO 8601 format
1992 </p>
1993 </li>
1994 <li>
1996 <em>%cn</em>: committer name
1997 </p>
1998 </li>
1999 <li>
2001 <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>)
2002 </p>
2003 </li>
2004 <li>
2006 <em>%ce</em>: committer email
2007 </p>
2008 </li>
2009 <li>
2011 <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>)
2012 </p>
2013 </li>
2014 <li>
2016 <em>%cd</em>: committer date
2017 </p>
2018 </li>
2019 <li>
2021 <em>%cD</em>: committer date, RFC2822 style
2022 </p>
2023 </li>
2024 <li>
2026 <em>%cr</em>: committer date, relative
2027 </p>
2028 </li>
2029 <li>
2031 <em>%ct</em>: committer date, UNIX timestamp
2032 </p>
2033 </li>
2034 <li>
2036 <em>%ci</em>: committer date, ISO 8601 format
2037 </p>
2038 </li>
2039 <li>
2041 <em>%d</em>: ref names, like the --decorate option of <a href="git-log.html">git-log(1)</a>
2042 </p>
2043 </li>
2044 <li>
2046 <em>%e</em>: encoding
2047 </p>
2048 </li>
2049 <li>
2051 <em>%s</em>: subject
2052 </p>
2053 </li>
2054 <li>
2056 <em>%f</em>: sanitized subject line, suitable for a filename
2057 </p>
2058 </li>
2059 <li>
2061 <em>%b</em>: body
2062 </p>
2063 </li>
2064 <li>
2066 <em>%N</em>: commit notes
2067 </p>
2068 </li>
2069 <li>
2071 <em>%gD</em>: reflog selector, e.g., <tt>refs/stash@{1}</tt>
2072 </p>
2073 </li>
2074 <li>
2076 <em>%gd</em>: shortened reflog selector, e.g., <tt>stash@{1}</tt>
2077 </p>
2078 </li>
2079 <li>
2081 <em>%gs</em>: reflog subject
2082 </p>
2083 </li>
2084 <li>
2086 <em>%Cred</em>: switch color to red
2087 </p>
2088 </li>
2089 <li>
2091 <em>%Cgreen</em>: switch color to green
2092 </p>
2093 </li>
2094 <li>
2096 <em>%Cblue</em>: switch color to blue
2097 </p>
2098 </li>
2099 <li>
2101 <em>%Creset</em>: reset color
2102 </p>
2103 </li>
2104 <li>
2106 <em>%C(&#8230;)</em>: color specification, as described in color.branch.* config option
2107 </p>
2108 </li>
2109 <li>
2111 <em>%m</em>: left, right or boundary mark
2112 </p>
2113 </li>
2114 <li>
2116 <em>%n</em>: newline
2117 </p>
2118 </li>
2119 <li>
2121 <em>%%</em>: a raw <em>%</em>
2122 </p>
2123 </li>
2124 <li>
2126 <em>%x00</em>: print a byte from a hex code
2127 </p>
2128 </li>
2129 <li>
2131 <em>%w([&lt;w&gt;[,&lt;i1&gt;[,&lt;i2&gt;]]])</em>: switch line wrapping, like the -w option of
2132 <a href="git-shortlog.html">git-shortlog(1)</a>.
2133 </p>
2134 </li>
2135 </ul></div>
2136 </li>
2137 </ul></div>
2138 <div class="admonitionblock">
2139 <table><tr>
2140 <td class="icon">
2141 <div class="title">Note</div>
2142 </td>
2143 <td class="content">Some placeholders may depend on other options given to the
2144 revision traversal engine. For example, the <tt>%g*</tt> reflog options will
2145 insert an empty string unless we are traversing reflog entries (e.g., by
2146 <tt>git log -g</tt>). The <tt>%d</tt> placeholder will use the "short" decoration
2147 format if <tt>--decorate</tt> was not already provided on the command line.</td>
2148 </tr></table>
2149 </div>
2150 <div class="para"><p>If you add a <tt>&#43;</tt> (plus sign) after <em>%</em> of a placeholder, a line-feed
2151 is inserted immediately before the expansion if and only if the
2152 placeholder expands to a non-empty string.</p></div>
2153 <div class="para"><p>If you add a <tt>-</tt> (minus sign) after <em>%</em> of a placeholder, line-feeds that
2154 immediately precede the expansion are deleted if and only if the
2155 placeholder expands to an empty string.</p></div>
2156 <div class="ilist"><ul>
2157 <li>
2159 <em>tformat:</em>
2160 </p>
2161 <div class="para"><p>The <em>tformat:</em> format works exactly like <em>format:</em>, except that it
2162 provides "terminator" semantics instead of "separator" semantics. In
2163 other words, each commit has the message terminator character (usually a
2164 newline) appended, rather than a separator placed between entries.
2165 This means that the final entry of a single-line format will be properly
2166 terminated with a new line, just as the "oneline" format does.
2167 For example:</p></div>
2168 <div class="listingblock">
2169 <div class="content">
2170 <pre><tt>$ git log -2 --pretty=format:%h 4da45bef \
2171 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
2172 4da45be
2173 7134973 -- NO NEWLINE
2175 $ git log -2 --pretty=tformat:%h 4da45bef \
2176 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
2177 4da45be
2178 7134973</tt></pre>
2179 </div></div>
2180 <div class="para"><p>In addition, any unrecognized string that has a <tt>%</tt> in it is interpreted
2181 as if it has <tt>tformat:</tt> in front of it. For example, these two are
2182 equivalent:</p></div>
2183 <div class="listingblock">
2184 <div class="content">
2185 <pre><tt>$ git log -2 --pretty=tformat:%h 4da45bef
2186 $ git log -2 --pretty=%h 4da45bef</tt></pre>
2187 </div></div>
2188 </li>
2189 </ul></div>
2190 </div>
2191 <h2 id="_generating_patches_with_p">Generating patches with -p</h2>
2192 <div class="sectionbody">
2193 <div class="para"><p>When "git-diff-index", "git-diff-tree", or "git-diff-files" are run
2194 with a <em>-p</em> option, "git diff" without the <em>--raw</em> option, or
2195 "git log" with the "-p" option, they
2196 do not produce the output described above; instead they produce a
2197 patch file. You can customize the creation of such patches via the
2198 GIT_EXTERNAL_DIFF and the GIT_DIFF_OPTS environment variables.</p></div>
2199 <div class="para"><p>What the -p option produces is slightly different from the traditional
2200 diff format.</p></div>
2201 <div class="olist"><ol>
2202 <li>
2204 It is preceded with a "git diff" header, that looks like
2205 this:
2206 </p>
2207 <div class="literalblock">
2208 <div class="content">
2209 <pre><tt>diff --git a/file1 b/file2</tt></pre>
2210 </div></div>
2211 <div class="para"><p>The <tt>a/</tt> and <tt>b/</tt> filenames are the same unless rename/copy is
2212 involved. Especially, even for a creation or a deletion,
2213 <tt>/dev/null</tt> is _not_ used in place of <tt>a/</tt> or <tt>b/</tt> filenames.</p></div>
2214 <div class="para"><p>When rename/copy is involved, <tt>file1</tt> and <tt>file2</tt> show the
2215 name of the source file of the rename/copy and the name of
2216 the file that rename/copy produces, respectively.</p></div>
2217 </li>
2218 <li>
2220 It is followed by one or more extended header lines:
2221 </p>
2222 <div class="literalblock">
2223 <div class="content">
2224 <pre><tt>old mode &lt;mode&gt;
2225 new mode &lt;mode&gt;
2226 deleted file mode &lt;mode&gt;
2227 new file mode &lt;mode&gt;
2228 copy from &lt;path&gt;
2229 copy to &lt;path&gt;
2230 rename from &lt;path&gt;
2231 rename to &lt;path&gt;
2232 similarity index &lt;number&gt;
2233 dissimilarity index &lt;number&gt;
2234 index &lt;hash&gt;..&lt;hash&gt; &lt;mode&gt;</tt></pre>
2235 </div></div>
2236 </li>
2237 <li>
2239 TAB, LF, double quote and backslash characters in pathnames
2240 are represented as <tt>\t</tt>, <tt>\n</tt>, <tt>\"</tt> and <tt>\\</tt>, respectively.
2241 If there is need for such substitution then the whole
2242 pathname is put in double quotes.
2243 </p>
2244 </li>
2245 </ol></div>
2246 <div class="para"><p>The similarity index is the percentage of unchanged lines, and
2247 the dissimilarity index is the percentage of changed lines. It
2248 is a rounded down integer, followed by a percent sign. The
2249 similarity index value of 100% is thus reserved for two equal
2250 files, while 100% dissimilarity means that no line from the old
2251 file made it into the new one.</p></div>
2252 </div>
2253 <h2 id="_combined_diff_format">combined diff format</h2>
2254 <div class="sectionbody">
2255 <div class="para"><p>"git-diff-tree", "git-diff-files" and "git-diff" can take <em>-c</em> or
2256 <em>--cc</em> option to produce <em>combined diff</em>. For showing a merge commit
2257 with "git log -p", this is the default format.
2258 A <em>combined diff</em> format looks like this:</p></div>
2259 <div class="listingblock">
2260 <div class="content">
2261 <pre><tt>diff --combined describe.c
2262 index fabadb8,cc95eb0..4866510
2263 --- a/describe.c
2264 +++ b/describe.c
2265 @@@ -98,20 -98,12 +98,20 @@@
2266 return (a_date &gt; b_date) ? -1 : (a_date == b_date) ? 0 : 1;
2269 - static void describe(char *arg)
2270 -static void describe(struct commit *cmit, int last_one)
2271 ++static void describe(char *arg, int last_one)
2273 + unsigned char sha1[20];
2274 + struct commit *cmit;
2275 struct commit_list *list;
2276 static int initialized = 0;
2277 struct commit_name *n;
2279 + if (get_sha1(arg, sha1) &lt; 0)
2280 + usage(describe_usage);
2281 + cmit = lookup_commit_reference(sha1);
2282 + if (!cmit)
2283 + usage(describe_usage);
2285 if (!initialized) {
2286 initialized = 1;
2287 for_each_ref(get_name);</tt></pre>
2288 </div></div>
2289 <div class="olist"><ol>
2290 <li>
2292 It is preceded with a "git diff" header, that looks like
2293 this (when <em>-c</em> option is used):
2294 </p>
2295 <div class="literalblock">
2296 <div class="content">
2297 <pre><tt>diff --combined file</tt></pre>
2298 </div></div>
2299 <div class="para"><p>or like this (when <em>--cc</em> option is used):</p></div>
2300 <div class="literalblock">
2301 <div class="content">
2302 <pre><tt>diff --cc file</tt></pre>
2303 </div></div>
2304 </li>
2305 <li>
2307 It is followed by one or more extended header lines
2308 (this example shows a merge with two parents):
2309 </p>
2310 <div class="literalblock">
2311 <div class="content">
2312 <pre><tt>index &lt;hash&gt;,&lt;hash&gt;..&lt;hash&gt;
2313 mode &lt;mode&gt;,&lt;mode&gt;..&lt;mode&gt;
2314 new file mode &lt;mode&gt;
2315 deleted file mode &lt;mode&gt;,&lt;mode&gt;</tt></pre>
2316 </div></div>
2317 <div class="para"><p>The <tt>mode &lt;mode&gt;,&lt;mode&gt;..&lt;mode&gt;</tt> line appears only if at least one of
2318 the &lt;mode&gt; is different from the rest. Extended headers with
2319 information about detected contents movement (renames and
2320 copying detection) are designed to work with diff of two
2321 &lt;tree-ish&gt; and are not used by combined diff format.</p></div>
2322 </li>
2323 <li>
2325 It is followed by two-line from-file/to-file header
2326 </p>
2327 <div class="literalblock">
2328 <div class="content">
2329 <pre><tt>--- a/file
2330 +++ b/file</tt></pre>
2331 </div></div>
2332 <div class="para"><p>Similar to two-line header for traditional <em>unified</em> diff
2333 format, <tt>/dev/null</tt> is used to signal created or deleted
2334 files.</p></div>
2335 </li>
2336 <li>
2338 Chunk header format is modified to prevent people from
2339 accidentally feeding it to <tt>patch -p1</tt>. Combined diff format
2340 was created for review of merge commit changes, and was not
2341 meant for apply. The change is similar to the change in the
2342 extended <em>index</em> header:
2343 </p>
2344 <div class="literalblock">
2345 <div class="content">
2346 <pre><tt>@@@ &lt;from-file-range&gt; &lt;from-file-range&gt; &lt;to-file-range&gt; @@@</tt></pre>
2347 </div></div>
2348 <div class="para"><p>There are (number of parents + 1) <tt>@</tt> characters in the chunk
2349 header for combined diff format.</p></div>
2350 </li>
2351 </ol></div>
2352 <div class="para"><p>Unlike the traditional <em>unified</em> diff format, which shows two
2353 files A and B with a single column that has <tt>-</tt> (minus &#8212;
2354 appears in A but removed in B), <tt>+</tt> (plus &#8212; missing in A but
2355 added to B), or <tt>" "</tt> (space &#8212; unchanged) prefix, this format
2356 compares two or more files file1, file2,&#8230; with one file X, and
2357 shows how X differs from each of fileN. One column for each of
2358 fileN is prepended to the output line to note how X's line is
2359 different from it.</p></div>
2360 <div class="para"><p>A <tt>-</tt> character in the column N means that the line appears in
2361 fileN but it does not appear in the result. A <tt>+</tt> character
2362 in the column N means that the line appears in the result,
2363 and fileN does not have that line (in other words, the line was
2364 added, from the point of view of that parent).</p></div>
2365 <div class="para"><p>In the above example output, the function signature was changed
2366 from both files (hence two <tt>-</tt> removals from both file1 and
2367 file2, plus <tt>++</tt> to mean one line that was added does not appear
2368 in either file1 nor file2). Also eight other lines are the same
2369 from file1 but do not appear in file2 (hence prefixed with <tt>&#43;</tt>).</p></div>
2370 <div class="para"><p>When shown by <tt>git diff-tree -c</tt>, it compares the parents of a
2371 merge commit with the merge result (i.e. file1..fileN are the
2372 parents). When shown by <tt>git diff-files -c</tt>, it compares the
2373 two unresolved merge parents with the working tree file
2374 (i.e. file1 is stage 2 aka "our version", file2 is stage 3 aka
2375 "their version").</p></div>
2376 </div>
2377 <h2 id="_examples">Examples</h2>
2378 <div class="sectionbody">
2379 <div class="vlist"><dl>
2380 <dt>
2381 git log --no-merges
2382 </dt>
2383 <dd>
2385 Show the whole commit history, but skip any merges
2386 </p>
2387 </dd>
2388 <dt>
2389 git log v2.6.12.. include/scsi drivers/scsi
2390 </dt>
2391 <dd>
2393 Show all commits since version <em>v2.6.12</em> that changed any file
2394 in the include/scsi or drivers/scsi subdirectories
2395 </p>
2396 </dd>
2397 <dt>
2398 git log --since="2 weeks ago" -- gitk
2399 </dt>
2400 <dd>
2402 Show the changes during the last two weeks to the file <em>gitk</em>.
2403 The "--" is necessary to avoid confusion with the <strong>branch</strong> named
2404 <em>gitk</em>
2405 </p>
2406 </dd>
2407 <dt>
2408 git log --name-status release..test
2409 </dt>
2410 <dd>
2412 Show the commits that are in the "test" branch but not yet
2413 in the "release" branch, along with the list of paths
2414 each commit modifies.
2415 </p>
2416 </dd>
2417 <dt>
2418 git log --follow builtin-rev-list.c
2419 </dt>
2420 <dd>
2422 Shows the commits that changed builtin-rev-list.c, including
2423 those commits that occurred before the file was given its
2424 present name.
2425 </p>
2426 </dd>
2427 </dl></div>
2428 </div>
2429 <h2 id="_discussion">Discussion</h2>
2430 <div class="sectionbody">
2431 <div class="para"><p>At the core level, git is character encoding agnostic.</p></div>
2432 <div class="ilist"><ul>
2433 <li>
2435 The pathnames recorded in the index and in the tree objects
2436 are treated as uninterpreted sequences of non-NUL bytes.
2437 What readdir(2) returns are what are recorded and compared
2438 with the data git keeps track of, which in turn are expected
2439 to be what lstat(2) and creat(2) accepts. There is no such
2440 thing as pathname encoding translation.
2441 </p>
2442 </li>
2443 <li>
2445 The contents of the blob objects are uninterpreted sequences
2446 of bytes. There is no encoding translation at the core
2447 level.
2448 </p>
2449 </li>
2450 <li>
2452 The commit log messages are uninterpreted sequences of non-NUL
2453 bytes.
2454 </p>
2455 </li>
2456 </ul></div>
2457 <div class="para"><p>Although we encourage that the commit log messages are encoded
2458 in UTF-8, both the core and git Porcelain are designed not to
2459 force UTF-8 on projects. If all participants of a particular
2460 project find it more convenient to use legacy encodings, git
2461 does not forbid it. However, there are a few things to keep in
2462 mind.</p></div>
2463 <div class="olist"><ol>
2464 <li>
2466 <em>git commit</em> and <em>git commit-tree</em> issues
2467 a warning if the commit log message given to it does not look
2468 like a valid UTF-8 string, unless you explicitly say your
2469 project uses a legacy encoding. The way to say this is to
2470 have i18n.commitencoding in <tt>.git/config</tt> file, like this:
2471 </p>
2472 <div class="listingblock">
2473 <div class="content">
2474 <pre><tt>[i18n]
2475 commitencoding = ISO-8859-1</tt></pre>
2476 </div></div>
2477 <div class="para"><p>Commit objects created with the above setting record the value
2478 of <tt>i18n.commitencoding</tt> in its <tt>encoding</tt> header. This is to
2479 help other people who look at them later. Lack of this header
2480 implies that the commit log message is encoded in UTF-8.</p></div>
2481 </li>
2482 <li>
2484 <em>git log</em>, <em>git show</em>, <em>git blame</em> and friends look at the
2485 <tt>encoding</tt> header of a commit object, and try to re-code the
2486 log message into UTF-8 unless otherwise specified. You can
2487 specify the desired output encoding with
2488 <tt>i18n.logoutputencoding</tt> in <tt>.git/config</tt> file, like this:
2489 </p>
2490 <div class="listingblock">
2491 <div class="content">
2492 <pre><tt>[i18n]
2493 logoutputencoding = ISO-8859-1</tt></pre>
2494 </div></div>
2495 <div class="para"><p>If you do not have this configuration variable, the value of
2496 <tt>i18n.commitencoding</tt> is used instead.</p></div>
2497 </li>
2498 </ol></div>
2499 <div class="para"><p>Note that we deliberately chose not to re-code the commit log
2500 message when a commit is made to force UTF-8 at the commit
2501 object level, because re-coding to UTF-8 is not necessarily a
2502 reversible operation.</p></div>
2503 </div>
2504 <h2 id="_author">Author</h2>
2505 <div class="sectionbody">
2506 <div class="para"><p>Written by Linus Torvalds &lt;torvalds@osdl.org&gt;</p></div>
2507 </div>
2508 <h2 id="_documentation">Documentation</h2>
2509 <div class="sectionbody">
2510 <div class="para"><p>Documentation by David Greaves, Junio C Hamano and the git-list &lt;git@vger.kernel.org&gt;.</p></div>
2511 </div>
2512 <h2 id="_git">GIT</h2>
2513 <div class="sectionbody">
2514 <div class="para"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
2515 </div>
2516 <div id="footer">
2517 <div id="footer-text">
2518 Last updated 2010-01-21 17:44:31 UTC
2519 </div>
2520 </div>
2521 </body>
2522 </html>