1 <?xml version="1.0" encoding="UTF-8"?>
\r
2 <!DOCTYPE sect2 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
\r
4 <sect2 lang="en" id="git-rev-list(1)">
\r
5 <title>git-rev-list(1)</title>
\r
7 <primary>git-rev-list(1)</primary>
\r
9 <simplesect id="git-rev-list(1)__name">
\r
11 <simpara>git-rev-list - Lists commit objects in reverse chronological order</simpara>
\r
13 <simplesect id="git-rev-list(1)__synopsis">
\r
14 <title>SYNOPSIS</title>
\r
16 <literallayout><emphasis>git rev-list</emphasis> [ --max-count=<number> ]
\r
17 [ --skip=<number> ]
\r
18 [ --max-age=<timestamp> ]
\r
19 [ --min-age=<timestamp> ]
\r
23 [ --min-parents=<number> ]
\r
24 [ --no-min-parents ]
\r
25 [ --max-parents=<number> ]
\r
26 [ --no-max-parents ]
\r
32 [ --branches[=<pattern>] ]
\r
33 [ --tags[=<pattern>] ]
\r
34 [ --remotes[=<pattern>] ]
\r
35 [ --glob=<glob-pattern> ]
\r
36 [ --ignore-missing ]
\r
47 [ --encoding=<encoding> ]
\r
48 [ --(author|committer|grep)=<pattern> ]
\r
49 [ --regexp-ignore-case | -i ]
\r
50 [ --extended-regexp | -E ]
\r
51 [ --fixed-strings | -F ]
\r
52 [ --date=<format>]
\r
53 [ [ --objects | --objects-edge | --objects-edge-aggressive ]
\r
55 [ --pretty | --header ]
\r
62 [ --no-walk ] [ --do-walk ]
\r
64 [ --use-bitmap-index ]
\r
65 <commit>… [ -- <paths>… ]</literallayout>
\r
68 <simplesect id="git-rev-list(1)__description">
\r
69 <title>DESCRIPTION</title>
\r
70 <simpara>List commits that are reachable by following the <emphasis>parent</emphasis> links from the
\r
71 given commit(s), but exclude commits that are reachable from the one(s)
\r
72 given with a <emphasis>^</emphasis> in front of them. The output is given in reverse
\r
73 chronological order by default.</simpara>
\r
74 <simpara>You can think of this as a set operation. Commits given on the command
\r
75 line form a set of commits that are reachable from any of them, and then
\r
76 commits reachable from any of the ones given with <emphasis>^</emphasis> in front are
\r
77 subtracted from that set. The remaining commits are what comes out in the
\r
78 command's output. Various other options and paths parameters can be used
\r
79 to further limit the result.</simpara>
\r
80 <simpara>Thus, the following command:</simpara>
\r
81 <screen> $ git rev-list foo bar ^baz</screen>
\r
82 <simpara>means "list all the commits which are reachable from <emphasis>foo</emphasis> or <emphasis>bar</emphasis>, but
\r
83 not from <emphasis>baz</emphasis>".</simpara>
\r
84 <simpara>A special notation "<emphasis><commit1></emphasis>..<emphasis><commit2></emphasis>" can be used as a
\r
85 short-hand for "^'<commit1>' <emphasis><commit2></emphasis>". For example, either of
\r
86 the following may be used interchangeably:</simpara>
\r
87 <screen> $ git rev-list origin..HEAD
\r
88 $ git rev-list HEAD ^origin</screen>
\r
89 <simpara>Another special notation is "<emphasis><commit1></emphasis>…<emphasis><commit2></emphasis>" which is useful
\r
90 for merges. The resulting set of commits is the symmetric difference
\r
91 between the two operands. The following two commands are equivalent:</simpara>
\r
92 <screen> $ git rev-list A B --not $(git merge-base --all A B)
\r
93 $ git rev-list A...B</screen>
\r
94 <simpara><emphasis>rev-list</emphasis> is a very essential Git command, since it
\r
95 provides the ability to build and traverse commit ancestry graphs. For
\r
96 this reason, it has a lot of different options that enables it to be
\r
97 used by commands as different as <emphasis>git bisect</emphasis> and
\r
98 <emphasis>git repack</emphasis>.</simpara>
\r
100 <simplesect id="git-rev-list(1)__options">
\r
101 <title>OPTIONS</title>
\r
102 <section id="git-rev-list(1)__commit_limiting">
\r
103 <title>Commit Limiting</title>
\r
104 <simpara>Besides specifying a range of commits that should be listed using the
\r
105 special notations explained in the description, additional commit
\r
106 limiting may be applied.</simpara>
\r
107 <simpara>Using more options generally further limits the output (e.g.
\r
108 <emphasis>--since=<date1></emphasis> limits to commits newer than <emphasis><date1></emphasis>, and using it
\r
109 with <emphasis>--grep=<pattern></emphasis> further limits to commits whose log message
\r
110 has a line that matches <emphasis><pattern></emphasis>), unless otherwise noted.</simpara>
\r
111 <simpara>Note that these are applied before commit
\r
112 ordering and formatting options, such as <emphasis>--reverse</emphasis>.</simpara>
\r
122 --max-count=<number>
\r
126 Limit the number of commits to output.
\r
132 --skip=<number>
\r
136 Skip <emphasis>number</emphasis> commits before starting to show the commit output.
\r
142 --since=<date>
\r
145 --after=<date>
\r
149 Show commits more recent than a specific date.
\r
155 --until=<date>
\r
158 --before=<date>
\r
162 Show commits older than a specific date.
\r
168 --max-age=<timestamp>
\r
171 --min-age=<timestamp>
\r
175 Limit the commits output to specified time range.
\r
181 --author=<pattern>
\r
184 --committer=<pattern>
\r
188 Limit the commits output to ones with author/committer
\r
189 header lines that match the specified pattern (regular
\r
190 expression). With more than one <emphasis>--author=<pattern></emphasis>,
\r
191 commits whose author matches any of the given patterns are
\r
192 chosen (similarly for multiple <emphasis>--committer=<pattern></emphasis>).
\r
198 --grep-reflog=<pattern>
\r
202 Limit the commits output to ones with reflog entries that
\r
203 match the specified pattern (regular expression). With
\r
204 more than one <emphasis>--grep-reflog</emphasis>, commits whose reflog message
\r
205 matches any of the given patterns are chosen. It is an
\r
206 error to use this option unless <emphasis>--walk-reflogs</emphasis> is in use.
\r
212 --grep=<pattern>
\r
216 Limit the commits output to ones with log message that
\r
217 matches the specified pattern (regular expression). With
\r
218 more than one <emphasis>--grep=<pattern></emphasis>, commits whose message
\r
219 matches any of the given patterns are chosen (but see
\r
220 <emphasis>--all-match</emphasis>).
\r
230 Limit the commits output to ones that match all given <emphasis>--grep</emphasis>,
\r
231 instead of ones that match at least one.
\r
241 Limit the commits output to ones with log message that do not
\r
242 match the pattern specified with <emphasis>--grep=<pattern></emphasis>.
\r
251 --regexp-ignore-case
\r
255 Match the regular expression limiting patterns without regard to letter
\r
266 Consider the limiting patterns to be basic regular expressions;
\r
267 this is the default.
\r
280 Consider the limiting patterns to be extended regular expressions
\r
281 instead of the default basic regular expressions.
\r
294 Consider the limiting patterns to be fixed strings (don't interpret
\r
295 pattern as a regular expression).
\r
305 Consider the limiting patterns to be Perl-compatible regular expressions.
\r
306 Requires libpcre to be compiled in.
\r
316 Stop when a given path disappears from the tree.
\r
326 Print only merge commits. This is exactly the same as <emphasis>--min-parents=2</emphasis>.
\r
336 Do not print commits with more than one parent. This is
\r
337 exactly the same as <emphasis>--max-parents=1</emphasis>.
\r
343 --min-parents=<number>
\r
346 --max-parents=<number>
\r
356 Show only commits which have at least (or at most) that many parent
\r
357 commits. In particular, <emphasis>--max-parents=1</emphasis> is the same as <emphasis>--no-merges</emphasis>,
\r
358 <emphasis>--min-parents=2</emphasis> is the same as <emphasis>--merges</emphasis>. <emphasis>--max-parents=0</emphasis>
\r
359 gives all root commits and <emphasis>--min-parents=3</emphasis> all octopus merges.
\r
361 <simpara><emphasis>--no-min-parents</emphasis> and <emphasis>--no-max-parents</emphasis> reset these limits (to no limit)
\r
362 again. Equivalent forms are <emphasis>--min-parents=0</emphasis> (any commit has 0 or more
\r
363 parents) and <emphasis>--max-parents=-1</emphasis> (negative numbers denote no upper limit).</simpara>
\r
372 Follow only the first parent commit upon seeing a merge
\r
373 commit. This option can give a better overview when
\r
374 viewing the evolution of a particular topic branch,
\r
375 because merges into a topic branch tend to be only about
\r
376 adjusting to updated upstream from time to time, and
\r
377 this option allows you to ignore the individual commits
\r
378 brought in to your history by such a merge. Cannot be
\r
379 combined with --bisect.
\r
389 Reverses the meaning of the <emphasis>^</emphasis> prefix (or lack thereof)
\r
390 for all following revision specifiers, up to the next <emphasis>--not</emphasis>.
\r
400 Pretend as if all the refs in <emphasis>refs/</emphasis> are listed on the
\r
401 command line as <emphasis><commit></emphasis>.
\r
407 --branches[=<pattern>]
\r
411 Pretend as if all the refs in <emphasis>refs/heads</emphasis> are listed
\r
412 on the command line as <emphasis><commit></emphasis>. If <emphasis><pattern></emphasis> is given, limit
\r
413 branches to ones matching given shell glob. If pattern lacks <emphasis>?</emphasis>,
\r
414 <emphasis>*</emphasis>, or <emphasis>[</emphasis>, <emphasis>/*</emphasis> at the end is implied.
\r
420 --tags[=<pattern>]
\r
424 Pretend as if all the refs in <emphasis>refs/tags</emphasis> are listed
\r
425 on the command line as <emphasis><commit></emphasis>. If <emphasis><pattern></emphasis> is given, limit
\r
426 tags to ones matching given shell glob. If pattern lacks <emphasis>?</emphasis>, <emphasis>*</emphasis>,
\r
427 or <emphasis>[</emphasis>, <emphasis>/*</emphasis> at the end is implied.
\r
433 --remotes[=<pattern>]
\r
437 Pretend as if all the refs in <emphasis>refs/remotes</emphasis> are listed
\r
438 on the command line as <emphasis><commit></emphasis>. If <emphasis><pattern></emphasis> is given, limit
\r
439 remote-tracking branches to ones matching given shell glob.
\r
440 If pattern lacks <emphasis>?</emphasis>, <emphasis>*</emphasis>, or <emphasis>[</emphasis>, <emphasis>/*</emphasis> at the end is implied.
\r
446 --glob=<glob-pattern>
\r
450 Pretend as if all the refs matching shell glob <emphasis><glob-pattern></emphasis>
\r
451 are listed on the command line as <emphasis><commit></emphasis>. Leading <emphasis>refs/</emphasis>,
\r
452 is automatically prepended if missing. If pattern lacks <emphasis>?</emphasis>, <emphasis>*</emphasis>,
\r
453 or <emphasis>[</emphasis>, <emphasis>/*</emphasis> at the end is implied.
\r
459 --exclude=<glob-pattern>
\r
463 Do not include refs matching <emphasis><glob-pattern></emphasis> that the next <emphasis>--all</emphasis>,
\r
464 <emphasis>--branches</emphasis>, <emphasis>--tags</emphasis>, <emphasis>--remotes</emphasis>, or <emphasis>--glob</emphasis> would otherwise
\r
465 consider. Repetitions of this option accumulate exclusion patterns
\r
466 up to the next <emphasis>--all</emphasis>, <emphasis>--branches</emphasis>, <emphasis>--tags</emphasis>, <emphasis>--remotes</emphasis>, or
\r
467 <emphasis>--glob</emphasis> option (other options or arguments do not clear
\r
468 accumulated patterns).
\r
470 <simpara>The patterns given should not begin with <emphasis>refs/heads</emphasis>, <emphasis>refs/tags</emphasis>, or
\r
471 <emphasis>refs/remotes</emphasis> when applied to <emphasis>--branches</emphasis>, <emphasis>--tags</emphasis>, or <emphasis>--remotes</emphasis>,
\r
472 respectively, and they must begin with <emphasis>refs/</emphasis> when applied to <emphasis>--glob</emphasis>
\r
473 or <emphasis>--all</emphasis>. If a trailing <emphasis>/*</emphasis> is intended, it must be given
\r
474 explicitly.</simpara>
\r
483 Pretend as if all objects mentioned by reflogs are listed on the
\r
484 command line as <emphasis><commit></emphasis>.
\r
494 Upon seeing an invalid object name in the input, pretend as if
\r
495 the bad input was not given.
\r
505 In addition to the <emphasis><commit></emphasis> listed on the command
\r
506 line, read them from the standard input. If a <emphasis>--</emphasis> separator is
\r
507 seen, stop reading commits and start reading paths to limit the
\r
518 Don't print anything to standard output. This form
\r
519 is primarily meant to allow the caller to
\r
520 test the exit status to see if a range of objects is fully
\r
521 connected (or not). It is faster than redirecting stdout
\r
522 to <emphasis>/dev/null</emphasis> as the output does not have to be formatted.
\r
532 Like <emphasis>--cherry-pick</emphasis> (see below) but mark equivalent commits
\r
533 with <emphasis>=</emphasis> rather than omitting them, and inequivalent ones with <emphasis>+</emphasis>.
\r
543 Omit any commit that introduces the same change as
\r
544 another commit on the other side when the set of
\r
545 commits are limited with symmetric difference.
\r
547 <simpara>For example, if you have two branches, <emphasis>A</emphasis> and <emphasis>B</emphasis>, a usual way
\r
548 to list all commits on only one side of them is with
\r
549 <emphasis>--left-right</emphasis> (see the example below in the description of
\r
550 the <emphasis>--left-right</emphasis> option). However, it shows the commits that were
\r
551 cherry-picked from the other branch (for example, 3rd on b may be
\r
552 cherry-picked from branch A). With this option, such pairs of commits are
\r
553 excluded from the output.</simpara>
\r
565 List only commits on the respective side of a symmetric range,
\r
566 i.e. only those which would be marked <emphasis><</emphasis> resp. <emphasis>></emphasis> by
\r
567 <emphasis>--left-right</emphasis>.
\r
569 <simpara>For example, <emphasis>--cherry-pick --right-only A...B</emphasis> omits those
\r
570 commits from <emphasis>B</emphasis> which are in <emphasis>A</emphasis> or are patch-equivalent to a commit in
\r
571 <emphasis>A</emphasis>. In other words, this lists the <emphasis>+</emphasis> commits from <emphasis>git cherry A B</emphasis>.
\r
572 More precisely, <emphasis>--cherry-pick --right-only --no-merges</emphasis> gives the exact
\r
582 A synonym for <emphasis>--right-only --cherry-mark --no-merges</emphasis>; useful to
\r
583 limit the output to the commits on our side and mark those that
\r
584 have been applied to the other side of a forked history with
\r
585 <emphasis>git log --cherry upstream...mybranch</emphasis>, similar to
\r
586 <emphasis>git cherry upstream mybranch</emphasis>.
\r
599 Instead of walking the commit ancestry chain, walk
\r
600 reflog entries from the most recent one to older ones.
\r
601 When this option is used you cannot specify commits to
\r
602 exclude (that is, <emphasis>^commit</emphasis>, <emphasis>commit1..commit2</emphasis>,
\r
603 and <emphasis>commit1...commit2</emphasis> notations cannot be used).
\r
605 <simpara>With <emphasis>--pretty</emphasis> format other than <emphasis>oneline</emphasis> (for obvious reasons),
\r
606 this causes the output to have two extra lines of information
\r
607 taken from the reflog. By default, <emphasis>commit@{Nth}</emphasis> notation is
\r
608 used in the output. When the starting commit is specified as
\r
609 <emphasis>commit@{now}</emphasis>, output also uses <emphasis>commit@{timestamp}</emphasis> notation
\r
610 instead. Under <emphasis>--pretty=oneline</emphasis>, the commit message is
\r
611 prefixed with this information on the same line.
\r
612 This option cannot be combined with <emphasis>--reverse</emphasis>.
\r
613 See also <xref linkend="git-reflog(1)" />.</simpara>
\r
622 After a failed merge, show refs that touch files having a
\r
623 conflict and don't exist on all heads to merge.
\r
633 Output excluded boundary commits. Boundary commits are
\r
634 prefixed with <emphasis>-</emphasis>.
\r
644 Try to speed up the traversal using the pack bitmap index (if
\r
645 one is available). Note that when traversing with <emphasis>--objects</emphasis>,
\r
646 trees and blobs will not have their associated path printed.
\r
652 <section id="git-rev-list(1)__history_simplification">
\r
653 <title>History Simplification</title>
\r
654 <simpara>Sometimes you are only interested in parts of the history, for example the
\r
655 commits modifying a particular <path>. But there are two parts of
\r
656 <emphasis>History Simplification</emphasis>, one part is selecting the commits and the other
\r
657 is how to do it, as there are various strategies to simplify the history.</simpara>
\r
658 <simpara>The following options select the commits to be shown:</simpara>
\r
666 Commits modifying the given <paths> are selected.
\r
672 --simplify-by-decoration
\r
676 Commits that are referred by some branch or tag are selected.
\r
681 <simpara>Note that extra commits can be shown to give a meaningful history.</simpara>
\r
682 <simpara>The following options affect the way the simplification is performed:</simpara>
\r
690 Simplifies the history to the simplest history explaining the
\r
691 final state of the tree. Simplest because it prunes some side
\r
692 branches if the end result is the same (i.e. merging branches
\r
693 with the same content)
\r
703 Same as the default mode, but does not prune some history.
\r
713 Only the selected commits are shown, plus some to have a
\r
714 meaningful history.
\r
724 All commits in the simplified history are shown.
\r
734 Additional option to <emphasis>--full-history</emphasis> to remove some needless
\r
735 merges from the resulting history, as there are no selected
\r
736 commits contributing to this merge.
\r
746 When given a range of commits to display (e.g. <emphasis>commit1..commit2</emphasis>
\r
747 or <emphasis>commit2 ^commit1</emphasis>), only display commits that exist
\r
748 directly on the ancestry chain between the <emphasis>commit1</emphasis> and
\r
749 <emphasis>commit2</emphasis>, i.e. commits that are both descendants of <emphasis>commit1</emphasis>,
\r
750 and ancestors of <emphasis>commit2</emphasis>.
\r
755 <simpara>A more detailed explanation follows.</simpara>
\r
756 <simpara>Suppose you specified <emphasis>foo</emphasis> as the <paths>. We shall call commits
\r
757 that modify <emphasis>foo</emphasis> !TREESAME, and the rest TREESAME. (In a diff
\r
758 filtered for <emphasis>foo</emphasis>, they look different and equal, respectively.)</simpara>
\r
759 <simpara>In the following, we will always refer to the same example history to
\r
760 illustrate the differences between simplification settings. We assume
\r
761 that you are filtering for a file <emphasis>foo</emphasis> in this commit graph:</simpara>
\r
762 <screen> .-A---M---N---O---P---Q
\r
766 `-------------' X</screen>
\r
767 <simpara>The horizontal line of history A---Q is taken to be the first parent of
\r
768 each merge. The commits are:</simpara>
\r
772 <emphasis>I</emphasis> is the initial commit, in which <emphasis>foo</emphasis> exists with contents
\r
773 asdf, and a file <emphasis>quux</emphasis> exists with contents quux. Initial
\r
774 commits are compared to an empty tree, so <emphasis>I</emphasis> is !TREESAME.
\r
779 In <emphasis>A</emphasis>, <emphasis>foo</emphasis> contains just foo.
\r
784 <emphasis>B</emphasis> contains the same change as <emphasis>A</emphasis>. Its merge <emphasis>M</emphasis> is trivial and
\r
785 hence TREESAME to all parents.
\r
790 <emphasis>C</emphasis> does not change <emphasis>foo</emphasis>, but its merge <emphasis>N</emphasis> changes it to foobar,
\r
791 so it is not TREESAME to any parent.
\r
796 <emphasis>D</emphasis> sets <emphasis>foo</emphasis> to baz. Its merge <emphasis>O</emphasis> combines the strings from
\r
797 <emphasis>N</emphasis> and <emphasis>D</emphasis> to foobarbaz; i.e., it is not TREESAME to any parent.
\r
802 <emphasis>E</emphasis> changes <emphasis>quux</emphasis> to xyzzy, and its merge <emphasis>P</emphasis> combines the
\r
803 strings to quux xyzzy. <emphasis>P</emphasis> is TREESAME to <emphasis>O</emphasis>, but not to <emphasis>E</emphasis>.
\r
808 <emphasis>X</emphasis> is an independent root commit that added a new file <emphasis>side</emphasis>, and <emphasis>Y</emphasis>
\r
809 modified it. <emphasis>Y</emphasis> is TREESAME to <emphasis>X</emphasis>. Its merge <emphasis>Q</emphasis> added <emphasis>side</emphasis> to <emphasis>P</emphasis>, and
\r
810 <emphasis>Q</emphasis> is TREESAME to <emphasis>P</emphasis>, but not to <emphasis>Y</emphasis>.
\r
814 <simpara><emphasis>rev-list</emphasis> walks backwards through history, including or excluding
\r
815 commits based on whether <emphasis>--full-history</emphasis> and/or parent rewriting
\r
816 (via <emphasis>--parents</emphasis> or <emphasis>--children</emphasis>) are used. The following settings
\r
817 are available.</simpara>
\r
825 Commits are included if they are not TREESAME to any parent
\r
826 (though this can be changed, see <emphasis>--sparse</emphasis> below). If the
\r
827 commit was a merge, and it was TREESAME to one parent, follow
\r
828 only that parent. (Even if there are several TREESAME
\r
829 parents, follow only one of them.) Otherwise, follow all
\r
832 <simpara>This results in:</simpara>
\r
833 <screen> .-A---N---O
\r
835 I---------D</screen>
\r
836 <simpara>Note how the rule to only follow the TREESAME parent, if one is
\r
837 available, removed <emphasis>B</emphasis> from consideration entirely. <emphasis>C</emphasis> was
\r
838 considered via <emphasis>N</emphasis>, but is TREESAME. Root commits are compared to an
\r
839 empty tree, so <emphasis>I</emphasis> is !TREESAME.</simpara>
\r
840 <simpara>Parent/child relations are only visible with <emphasis>--parents</emphasis>, but that does
\r
841 not affect the commits selected in default mode, so we have shown the
\r
842 parent lines.</simpara>
\r
847 --full-history without parent rewriting
\r
851 This mode differs from the default in one point: always follow
\r
852 all parents of a merge, even if it is TREESAME to one of them.
\r
853 Even if more than one side of the merge has commits that are
\r
854 included, this does not imply that the merge itself is! In
\r
855 the example, we get
\r
857 <screen> I A B N D O P Q</screen>
\r
858 <simpara><emphasis>M</emphasis> was excluded because it is TREESAME to both parents. <emphasis>E</emphasis>,
\r
859 <emphasis>C</emphasis> and <emphasis>B</emphasis> were all walked, but only <emphasis>B</emphasis> was !TREESAME, so the others
\r
860 do not appear.</simpara>
\r
861 <simpara>Note that without parent rewriting, it is not really possible to talk
\r
862 about the parent/child relationships between the commits, so we show
\r
863 them disconnected.</simpara>
\r
868 --full-history with parent rewriting
\r
872 Ordinary commits are only included if they are !TREESAME
\r
873 (though this can be changed, see <emphasis>--sparse</emphasis> below).
\r
875 <simpara>Merges are always included. However, their parent list is rewritten:
\r
876 Along each parent, prune away commits that are not included
\r
877 themselves. This results in</simpara>
\r
878 <screen> .-A---M---N---O---P---Q
\r
882 `-------------'</screen>
\r
883 <simpara>Compare to <emphasis>--full-history</emphasis> without rewriting above. Note that <emphasis>E</emphasis>
\r
884 was pruned away because it is TREESAME, but the parent list of P was
\r
885 rewritten to contain <emphasis>E</emphasis>'s parent <emphasis>I</emphasis>. The same happened for <emphasis>C</emphasis> and
\r
886 <emphasis>N</emphasis>, and <emphasis>X</emphasis>, <emphasis>Y</emphasis> and <emphasis>Q</emphasis>.</simpara>
\r
890 <simpara>In addition to the above settings, you can change whether TREESAME
\r
891 affects inclusion:</simpara>
\r
899 Commits that are walked are included if they are not TREESAME
\r
910 All commits that are walked are included.
\r
912 <simpara>Note that without <emphasis>--full-history</emphasis>, this still simplifies merges: if
\r
913 one of the parents is TREESAME, we follow only that one, so the other
\r
914 sides of the merge are never walked.</simpara>
\r
923 First, build a history graph in the same way that
\r
924 <emphasis>--full-history</emphasis> with parent rewriting does (see above).
\r
926 <simpara>Then simplify each commit <emphasis>C</emphasis> to its replacement <emphasis>C'</emphasis> in the final
\r
927 history according to the following rules:</simpara>
\r
931 Set <emphasis>C'</emphasis> to <emphasis>C</emphasis>.
\r
936 Replace each parent <emphasis>P</emphasis> of <emphasis>C'</emphasis> with its simplification <emphasis>P'</emphasis>. In
\r
937 the process, drop parents that are ancestors of other parents or that are
\r
938 root commits TREESAME to an empty tree, and remove duplicates, but take care
\r
939 to never drop all parents that we are TREESAME to.
\r
944 If after this parent rewriting, <emphasis>C'</emphasis> is a root or merge commit (has
\r
945 zero or >1 parents), a boundary commit, or !TREESAME, it remains.
\r
946 Otherwise, it is replaced with its only parent.
\r
950 <simpara>The effect of this is best shown by way of comparing to
\r
951 <emphasis>--full-history</emphasis> with parent rewriting. The example turns into:</simpara>
\r
952 <screen> .-A---M---N---O
\r
956 `---------'</screen>
\r
957 <simpara>Note the major differences in <emphasis>N</emphasis>, <emphasis>P</emphasis>, and <emphasis>Q</emphasis> over <emphasis>--full-history</emphasis>:</simpara>
\r
961 <emphasis>N</emphasis>'s parent list had <emphasis>I</emphasis> removed, because it is an ancestor of the
\r
962 other parent <emphasis>M</emphasis>. Still, <emphasis>N</emphasis> remained because it is !TREESAME.
\r
967 <emphasis>P</emphasis>'s parent list similarly had <emphasis>I</emphasis> removed. <emphasis>P</emphasis> was then
\r
968 removed completely, because it had one parent and is TREESAME.
\r
973 <emphasis>Q</emphasis>'s parent list had <emphasis>Y</emphasis> simplified to <emphasis>X</emphasis>. <emphasis>X</emphasis> was then removed, because it
\r
974 was a TREESAME root. <emphasis>Q</emphasis> was then removed completely, because it had one
\r
975 parent and is TREESAME.
\r
982 <simpara>Finally, there is a fifth simplification mode available:</simpara>
\r
990 Limit the displayed commits to those directly on the ancestry
\r
991 chain between the from and to commits in the given commit
\r
992 range. I.e. only display commits that are ancestor of the to
\r
993 commit and descendants of the from commit.
\r
995 <simpara>As an example use case, consider the following commit history:</simpara>
\r
996 <screen> D---E-------F
\r
998 B---C---G---H---I---J
\r
1000 A-------K---------------L--M</screen>
\r
1001 <simpara>A regular <emphasis>D..M</emphasis> computes the set of commits that are ancestors of <emphasis>M</emphasis>,
\r
1002 but excludes the ones that are ancestors of <emphasis>D</emphasis>. This is useful to see
\r
1003 what happened to the history leading to <emphasis>M</emphasis> since <emphasis>D</emphasis>, in the sense
\r
1004 that what does <emphasis>M</emphasis> have that did not exist in <emphasis>D</emphasis>. The result in this
\r
1005 example would be all the commits, except <emphasis>A</emphasis> and <emphasis>B</emphasis> (and <emphasis>D</emphasis> itself,
\r
1006 of course).</simpara>
\r
1007 <simpara>When we want to find out what commits in <emphasis>M</emphasis> are contaminated with the
\r
1008 bug introduced by <emphasis>D</emphasis> and need fixing, however, we might want to view
\r
1009 only the subset of <emphasis>D..M</emphasis> that are actually descendants of <emphasis>D</emphasis>, i.e.
\r
1010 excluding <emphasis>C</emphasis> and <emphasis>K</emphasis>. This is exactly what the <emphasis>--ancestry-path</emphasis>
\r
1011 option does. Applied to the <emphasis>D..M</emphasis> range, it results in:</simpara>
\r
1012 <screen> E-------F
\r
1020 <simpara>The <emphasis>--simplify-by-decoration</emphasis> option allows you to view only the
\r
1021 big picture of the topology of the history, by omitting commits
\r
1022 that are not referenced by tags. Commits are marked as !TREESAME
\r
1023 (in other words, kept after history simplification rules described
\r
1024 above) if (1) they are referenced by tags, or (2) they change the
\r
1025 contents of the paths given on the command line. All other
\r
1026 commits are marked as TREESAME (subject to be simplified away).</simpara>
\r
1028 <section id="git-rev-list(1)__bisection_helpers">
\r
1029 <title>Bisection Helpers</title>
\r
1037 Limit output to the one commit object which is roughly halfway between
\r
1038 included and excluded commits. Note that the bad bisection ref
\r
1039 <emphasis>refs/bisect/bad</emphasis> is added to the included commits (if it
\r
1040 exists) and the good bisection refs <emphasis>refs/bisect/good-*</emphasis> are
\r
1041 added to the excluded commits (if they exist). Thus, supposing there
\r
1042 are no refs in <emphasis>refs/bisect/</emphasis>, if
\r
1044 <screen> $ git rev-list --bisect foo ^bar ^baz</screen>
\r
1045 <simpara>outputs <emphasis>midpoint</emphasis>, the output of the two commands</simpara>
\r
1046 <screen> $ git rev-list foo ^midpoint
\r
1047 $ git rev-list midpoint ^bar ^baz</screen>
\r
1048 <simpara>would be of roughly the same length. Finding the change which
\r
1049 introduces a regression is thus reduced to a binary search: repeatedly
\r
1050 generate and test new 'midpoint's until the commit chain is of length
\r
1051 one. Cannot be combined with --first-parent.</simpara>
\r
1060 This calculates the same as <emphasis>--bisect</emphasis>, except that refs in
\r
1061 <emphasis>refs/bisect/</emphasis> are not used, and except that this outputs
\r
1062 text ready to be eval'ed by the shell. These lines will assign the
\r
1063 name of the midpoint revision to the variable <emphasis>bisect_rev</emphasis>, and the
\r
1064 expected number of commits to be tested after <emphasis>bisect_rev</emphasis> is tested
\r
1065 to <emphasis>bisect_nr</emphasis>, the expected number of commits to be tested if
\r
1066 <emphasis>bisect_rev</emphasis> turns out to be good to <emphasis>bisect_good</emphasis>, the expected
\r
1067 number of commits to be tested if <emphasis>bisect_rev</emphasis> turns out to be bad to
\r
1068 <emphasis>bisect_bad</emphasis>, and the number of commits we are bisecting right now to
\r
1069 <emphasis>bisect_all</emphasis>.
\r
1079 This outputs all the commit objects between the included and excluded
\r
1080 commits, ordered by their distance to the included and excluded
\r
1081 commits. Refs in <emphasis>refs/bisect/</emphasis> are not used. The farthest
\r
1082 from them is displayed first. (This is the only one displayed by
\r
1083 <emphasis>--bisect</emphasis>.)
\r
1085 <simpara>This is useful because it makes it easy to choose a good commit to
\r
1086 test when you want to avoid to test some of them for some reason (they
\r
1087 may not compile for example).</simpara>
\r
1088 <simpara>This option can be used along with <emphasis>--bisect-vars</emphasis>, in this case,
\r
1089 after all the sorted commit objects, there will be the same text as if
\r
1090 <emphasis>--bisect-vars</emphasis> had been used alone.</simpara>
\r
1095 <section id="git-rev-list(1)__commit_ordering">
\r
1096 <title>Commit Ordering</title>
\r
1097 <simpara>By default, the commits are shown in reverse chronological order.</simpara>
\r
1105 Show no parents before all of its children are shown, but
\r
1106 otherwise show commits in the commit timestamp order.
\r
1112 --author-date-order
\r
1116 Show no parents before all of its children are shown, but
\r
1117 otherwise show commits in the author timestamp order.
\r
1127 Show no parents before all of its children are shown, and
\r
1128 avoid showing commits on multiple lines of history
\r
1131 <simpara>For example, in a commit history like this:</simpara>
\r
1132 <screen> ---1----2----4----7
\r
1134 3----5----6----8---</screen>
\r
1135 <simpara>where the numbers denote the order of commit timestamps, <emphasis>git
\r
1136 rev-list</emphasis> and friends with <emphasis>--date-order</emphasis> show the commits in the
\r
1137 timestamp order: 8 7 6 5 4 3 2 1.</simpara>
\r
1138 <simpara>With <emphasis>--topo-order</emphasis>, they would show 8 6 5 3 7 4 2 1 (or 8 7 4 2 6 5
\r
1139 3 1); some older commits are shown before newer ones in order to
\r
1140 avoid showing the commits from two parallel development track mixed
\r
1141 together.</simpara>
\r
1150 Output the commits in reverse order.
\r
1151 Cannot be combined with <emphasis>--walk-reflogs</emphasis>.
\r
1157 <section id="git-rev-list(1)__object_traversal">
\r
1158 <title>Object Traversal</title>
\r
1159 <simpara>These options are mostly targeted for packing of Git repositories.</simpara>
\r
1167 Print the object IDs of any object referenced by the listed
\r
1168 commits. <emphasis>--objects foo ^bar</emphasis> thus means send me
\r
1169 all object IDs which I need to download if I have the commit
\r
1170 object <emphasis>bar</emphasis> but not <emphasis>foo</emphasis>.
\r
1180 Similar to <emphasis>--objects</emphasis>, but also print the IDs of excluded
\r
1181 commits prefixed with a - character. This is used by
\r
1182 <xref linkend="git-pack-objects(1)" /> to build a thin pack, which records
\r
1183 objects in deltified form based on objects contained in these
\r
1184 excluded commits to reduce network traffic.
\r
1190 --objects-edge-aggressive
\r
1194 Similar to <emphasis>--objects-edge</emphasis>, but it tries harder to find excluded
\r
1195 commits at the cost of increased time. This is used instead of
\r
1196 <emphasis>--objects-edge</emphasis> to build thin packs for shallow repositories.
\r
1206 Pretend as if all trees and blobs used by the index are listed
\r
1207 on the command line. Note that you probably want to use
\r
1208 <emphasis>--objects</emphasis>, too.
\r
1218 Only useful with <emphasis>--objects</emphasis>; print the object IDs that are not
\r
1225 --no-walk[=(sorted|unsorted)]
\r
1229 Only show the given commits, but do not traverse their ancestors.
\r
1230 This has no effect if a range is specified. If the argument
\r
1231 <emphasis>unsorted</emphasis> is given, the commits are shown in the order they were
\r
1232 given on the command line. Otherwise (if <emphasis>sorted</emphasis> or no argument
\r
1233 was given), the commits are shown in reverse chronological order
\r
1235 Cannot be combined with <emphasis>--graph</emphasis>.
\r
1245 Overrides a previous <emphasis>--no-walk</emphasis>.
\r
1251 <section id="git-rev-list(1)__commit_formatting">
\r
1252 <title>Commit Formatting</title>
\r
1253 <simpara>Using these options, <xref linkend="git-rev-list(1)" /> will act similar to the
\r
1254 more specialized family of commit log tools: <xref linkend="git-log(1)" />,
\r
1255 <xref linkend="git-show(1)" />, and <xref linkend="git-whatchanged(1)" /></simpara>
\r
1259 --pretty[=<format>]
\r
1262 --format=<format>
\r
1266 Pretty-print the contents of the commit logs in a given format,
\r
1267 where <emphasis><format></emphasis> can be one of <emphasis>oneline</emphasis>, <emphasis>short</emphasis>, <emphasis>medium</emphasis>,
\r
1268 <emphasis>full</emphasis>, <emphasis>fuller</emphasis>, <emphasis>email</emphasis>, <emphasis>raw</emphasis>, <emphasis>format:<string></emphasis>
\r
1269 and <emphasis>tformat:<string></emphasis>. When <emphasis><format></emphasis> is none of the above,
\r
1270 and has <emphasis>%placeholder</emphasis> in it, it acts as if
\r
1271 <emphasis>--pretty=tformat:<format></emphasis> were given.
\r
1273 <simpara>See the "PRETTY FORMATS" section for some additional details for each
\r
1274 format. When <emphasis>=<format></emphasis> part is omitted, it defaults to <emphasis>medium</emphasis>.</simpara>
\r
1275 <simpara>Note: you can specify the default pretty format in the repository
\r
1276 configuration (see <xref linkend="git-config(1)" />).</simpara>
\r
1285 Instead of showing the full 40-byte hexadecimal commit object
\r
1286 name, show only a partial prefix. Non default number of
\r
1287 digits can be specified with "--abbrev=<n>" (which also modifies
\r
1288 diff output, if it is displayed).
\r
1290 <simpara>This should make "--pretty=oneline" a whole lot more readable for
\r
1291 people using 80-column terminals.</simpara>
\r
1296 --no-abbrev-commit
\r
1300 Show the full 40-byte hexadecimal commit object name. This negates
\r
1301 <emphasis>--abbrev-commit</emphasis> and those options which imply it such as
\r
1302 "--oneline". It also overrides the <emphasis>log.abbrevCommit</emphasis> variable.
\r
1312 This is a shorthand for "--pretty=oneline --abbrev-commit"
\r
1319 --encoding=<encoding>
\r
1323 The commit objects record the encoding used for the log message
\r
1324 in their encoding header; this option can be used to tell the
\r
1325 command to re-code the commit log message in the encoding
\r
1326 preferred by the user. For non plumbing commands this
\r
1327 defaults to UTF-8. Note that if an object claims to be encoded
\r
1328 in <emphasis>X</emphasis> and we are outputting in <emphasis>X</emphasis>, we will output the object
\r
1329 verbatim; this means that invalid sequences in the original
\r
1330 commit may be copied to the output.
\r
1336 --expand-tabs=<n>
\r
1346 Perform a tab expansion (replace each tab with enough spaces
\r
1347 to fill to the next display column that is multiple of <emphasis><n></emphasis>)
\r
1348 in the log message before showing it in the output.
\r
1349 <emphasis>--expand-tabs</emphasis> is a short-hand for <emphasis>--expand-tabs=8</emphasis>, and
\r
1350 <emphasis>--no-expand-tabs</emphasis> is a short-hand for <emphasis>--expand-tabs=0</emphasis>,
\r
1351 which disables tab expansion.
\r
1353 <simpara>By default, tabs are expanded in pretty formats that indent the log
\r
1354 message by 4 spaces (i.e. <emphasis>medium</emphasis>, which is the default, <emphasis>full</emphasis>,
\r
1355 and <emphasis>fuller</emphasis>).</simpara>
\r
1364 Check the validity of a signed commit object by passing the signature
\r
1365 to <emphasis>gpg --verify</emphasis> and show the output.
\r
1375 Synonym for <emphasis>--date=relative</emphasis>.
\r
1381 --date=<format>
\r
1385 Only takes effect for dates shown in human-readable format, such
\r
1386 as when using <emphasis>--pretty</emphasis>. <emphasis>log.date</emphasis> config variable sets a default
\r
1387 value for the log command's <emphasis>--date</emphasis> option. By default, dates
\r
1388 are shown in the original time zone (either committer's or
\r
1389 author's). If <emphasis>-local</emphasis> is appended to the format (e.g.,
\r
1390 <emphasis>iso-local</emphasis>), the user's local time zone is used instead.
\r
1392 <simpara><emphasis>--date=relative</emphasis> shows dates relative to the current time,
\r
1393 e.g. 2 hours ago. The <emphasis>-local</emphasis> option cannot be used with
\r
1394 <emphasis>--raw</emphasis> or <emphasis>--relative</emphasis>.</simpara>
\r
1395 <simpara><emphasis>--date=local</emphasis> is an alias for <emphasis>--date=default-local</emphasis>.</simpara>
\r
1396 <simpara><emphasis>--date=iso</emphasis> (or <emphasis>--date=iso8601</emphasis>) shows timestamps in a ISO 8601-like format.
\r
1397 The differences to the strict ISO 8601 format are:</simpara>
\r
1401 a space instead of the <emphasis>T</emphasis> date/time delimiter
\r
1406 a space between time and time zone
\r
1411 no colon between hours and minutes of the time zone
\r
1415 <simpara><emphasis>--date=iso-strict</emphasis> (or <emphasis>--date=iso8601-strict</emphasis>) shows timestamps in strict
\r
1416 ISO 8601 format.</simpara>
\r
1417 <simpara><emphasis>--date=rfc</emphasis> (or <emphasis>--date=rfc2822</emphasis>) shows timestamps in RFC 2822
\r
1418 format, often found in email messages.</simpara>
\r
1419 <simpara><emphasis>--date=short</emphasis> shows only the date, but not the time, in <emphasis>YYYY-MM-DD</emphasis> format.</simpara>
\r
1420 <simpara><emphasis>--date=raw</emphasis> shows the date in the internal raw Git format <emphasis>%s %z</emphasis> format.</simpara>
\r
1421 <simpara><emphasis>--date=format:...</emphasis> feeds the format <emphasis>...</emphasis> to your system <emphasis>strftime</emphasis>.
\r
1422 Use <emphasis>--date=format:%c</emphasis> to show the date in your system locale's
\r
1423 preferred format. See the <emphasis>strftime</emphasis> manual for a complete list of
\r
1424 format placeholders. When using <emphasis>-local</emphasis>, the correct syntax is
\r
1425 <emphasis>--date=format-local:...</emphasis>.</simpara>
\r
1426 <simpara><emphasis>--date=default</emphasis> is the default format, and is similar to
\r
1427 <emphasis>--date=rfc2822</emphasis>, with a few exceptions:</simpara>
\r
1431 there is no comma after the day-of-week
\r
1436 the time zone is omitted when the local time zone is used
\r
1448 Print the contents of the commit in raw-format; each record is
\r
1449 separated with a NUL character.
\r
1459 Print also the parents of the commit (in the form "commit parent…").
\r
1460 Also enables parent rewriting, see <emphasis>History Simplification</emphasis> below.
\r
1470 Print also the children of the commit (in the form "commit child…").
\r
1471 Also enables parent rewriting, see <emphasis>History Simplification</emphasis> below.
\r
1481 Print the raw commit timestamp.
\r
1491 Mark which side of a symmetric diff a commit is reachable from.
\r
1492 Commits from the left side are prefixed with <emphasis><</emphasis> and those from
\r
1493 the right with <emphasis>></emphasis>. If combined with <emphasis>--boundary</emphasis>, those
\r
1494 commits are prefixed with <emphasis>-</emphasis>.
\r
1496 <simpara>For example, if you have this topology:</simpara>
\r
1497 <screen> y---b---b branch B
\r
1501 o---x---a---a branch A</screen>
\r
1502 <simpara>you would get an output like this:</simpara>
\r
1503 <screen> $ git rev-list --left-right --boundary --pretty=oneline A...B
\r
1505 >bbbbbbb... 3rd on b
\r
1506 >bbbbbbb... 2nd on b
\r
1507 <aaaaaaa... 3rd on a
\r
1508 <aaaaaaa... 2nd on a
\r
1509 -yyyyyyy... 1st on b
\r
1510 -xxxxxxx... 1st on a</screen>
\r
1519 Draw a text-based graphical representation of the commit history
\r
1520 on the left hand side of the output. This may cause extra lines
\r
1521 to be printed in between commits, in order for the graph history
\r
1522 to be drawn properly.
\r
1523 Cannot be combined with <emphasis>--no-walk</emphasis>.
\r
1525 <simpara>This enables parent rewriting, see <emphasis>History Simplification</emphasis> below.</simpara>
\r
1526 <simpara>This implies the <emphasis>--topo-order</emphasis> option by default, but the
\r
1527 <emphasis>--date-order</emphasis> option may also be specified.</simpara>
\r
1532 --show-linear-break[=<barrier>]
\r
1536 When --graph is not used, all history branches are flattened
\r
1537 which can make it hard to see that the two consecutive commits
\r
1538 do not belong to a linear branch. This option puts a barrier
\r
1539 in between them in that case. If <emphasis><barrier></emphasis> is specified, it
\r
1540 is the string that will be shown instead of the default one.
\r
1550 Print a number stating how many commits would have been
\r
1551 listed, and suppress all other output. When used together
\r
1552 with <emphasis>--left-right</emphasis>, instead print the counts for left and
\r
1553 right commits, separated by a tab. When used together with
\r
1554 <emphasis>--cherry-mark</emphasis>, omit patch equivalent commits from these
\r
1555 counts and print the count for equivalent commits separated
\r
1563 <simplesect id="git-rev-list(1)__pretty_formats">
\r
1564 <title>PRETTY FORMATS</title>
\r
1565 <simpara>If the commit is a merge, and if the pretty-format
\r
1566 is not <emphasis>oneline</emphasis>, <emphasis>email</emphasis> or <emphasis>raw</emphasis>, an additional line is
\r
1567 inserted before the <emphasis>Author:</emphasis> line. This line begins with
\r
1568 "Merge: " and the sha1s of ancestral commits are printed,
\r
1569 separated by spaces. Note that the listed commits may not
\r
1570 necessarily be the list of the <emphasis role="strong">direct</emphasis> parent commits if you
\r
1571 have limited your view of history: for example, if you are
\r
1572 only interested in changes related to a certain directory or
\r
1574 <simpara>There are several built-in formats, and you can define
\r
1575 additional formats by setting a pretty.<name>
\r
1576 config option to either another format name, or a
\r
1577 <emphasis>format:</emphasis> string, as described below (see
\r
1578 <xref linkend="git-config(1)" />). Here are the details of the
\r
1579 built-in formats:</simpara>
\r
1583 <emphasis>oneline</emphasis>
\r
1585 <literallayout class="monospaced"><sha1> <title line></literallayout>
\r
1586 <simpara>This is designed to be as compact as possible.</simpara>
\r
1590 <emphasis>short</emphasis>
\r
1592 <literallayout class="monospaced">commit <sha1>
\r
1593 Author: <author></literallayout>
\r
1594 <literallayout class="monospaced"><title line></literallayout>
\r
1598 <emphasis>medium</emphasis>
\r
1600 <literallayout class="monospaced">commit <sha1>
\r
1601 Author: <author>
\r
1602 Date: <author date></literallayout>
\r
1603 <literallayout class="monospaced"><title line></literallayout>
\r
1604 <literallayout class="monospaced"><full commit message></literallayout>
\r
1608 <emphasis>full</emphasis>
\r
1610 <literallayout class="monospaced">commit <sha1>
\r
1611 Author: <author>
\r
1612 Commit: <committer></literallayout>
\r
1613 <literallayout class="monospaced"><title line></literallayout>
\r
1614 <literallayout class="monospaced"><full commit message></literallayout>
\r
1618 <emphasis>fuller</emphasis>
\r
1620 <literallayout class="monospaced">commit <sha1>
\r
1621 Author: <author>
\r
1622 AuthorDate: <author date>
\r
1623 Commit: <committer>
\r
1624 CommitDate: <committer date></literallayout>
\r
1625 <literallayout class="monospaced"><title line></literallayout>
\r
1626 <literallayout class="monospaced"><full commit message></literallayout>
\r
1630 <emphasis>email</emphasis>
\r
1632 <literallayout class="monospaced">From <sha1> <date>
\r
1633 From: <author>
\r
1634 Date: <author date>
\r
1635 Subject: [PATCH] <title line></literallayout>
\r
1636 <literallayout class="monospaced"><full commit message></literallayout>
\r
1640 <emphasis>raw</emphasis>
\r
1642 <simpara>The <emphasis>raw</emphasis> format shows the entire commit exactly as
\r
1643 stored in the commit object. Notably, the SHA-1s are
\r
1644 displayed in full, regardless of whether --abbrev or
\r
1645 --no-abbrev are used, and <emphasis>parents</emphasis> information show the
\r
1646 true parent commits, without taking grafts or history
\r
1647 simplification into account. Note that this format affects the way
\r
1648 commits are displayed, but not the way the diff is shown e.g. with
\r
1649 <emphasis>git log --raw</emphasis>. To get full object names in a raw diff format,
\r
1650 use <emphasis>--no-abbrev</emphasis>.</simpara>
\r
1654 <emphasis>format:<string></emphasis>
\r
1656 <simpara>The <emphasis>format:<string></emphasis> format allows you to specify which information
\r
1657 you want to show. It works a little bit like printf format,
\r
1658 with the notable exception that you get a newline with <emphasis>%n</emphasis>
\r
1659 instead of <emphasis>\n</emphasis>.</simpara>
\r
1660 <simpara>E.g, <emphasis>format:"The author of %h was %an, %ar%nThe title was >>%s<<%n"</emphasis>
\r
1661 would show something like this:</simpara>
\r
1662 <screen>The author of fe6e0ee was Junio C Hamano, 23 hours ago
\r
1663 The title was >>t4119: test autocomputing -p<n> for traditional diff input.<<</screen>
\r
1664 <simpara>The placeholders are:</simpara>
\r
1668 <emphasis>%H</emphasis>: commit hash
\r
1673 <emphasis>%h</emphasis>: abbreviated commit hash
\r
1678 <emphasis>%T</emphasis>: tree hash
\r
1683 <emphasis>%t</emphasis>: abbreviated tree hash
\r
1688 <emphasis>%P</emphasis>: parent hashes
\r
1693 <emphasis>%p</emphasis>: abbreviated parent hashes
\r
1698 <emphasis>%an</emphasis>: author name
\r
1703 <emphasis>%aN</emphasis>: author name (respecting .mailmap, see <xref linkend="git-shortlog(1)" />
\r
1704 or <xref linkend="git-blame(1)" />)
\r
1709 <emphasis>%ae</emphasis>: author email
\r
1714 <emphasis>%aE</emphasis>: author email (respecting .mailmap, see
\r
1715 <xref linkend="git-shortlog(1)" /> or <xref linkend="git-blame(1)" />)
\r
1720 <emphasis>%ad</emphasis>: author date (format respects --date= option)
\r
1725 <emphasis>%aD</emphasis>: author date, RFC2822 style
\r
1730 <emphasis>%ar</emphasis>: author date, relative
\r
1735 <emphasis>%at</emphasis>: author date, UNIX timestamp
\r
1740 <emphasis>%ai</emphasis>: author date, ISO 8601-like format
\r
1745 <emphasis>%aI</emphasis>: author date, strict ISO 8601 format
\r
1750 <emphasis>%cn</emphasis>: committer name
\r
1755 <emphasis>%cN</emphasis>: committer name (respecting .mailmap, see
\r
1756 <xref linkend="git-shortlog(1)" /> or <xref linkend="git-blame(1)" />)
\r
1761 <emphasis>%ce</emphasis>: committer email
\r
1766 <emphasis>%cE</emphasis>: committer email (respecting .mailmap, see
\r
1767 <xref linkend="git-shortlog(1)" /> or <xref linkend="git-blame(1)" />)
\r
1772 <emphasis>%cd</emphasis>: committer date (format respects --date= option)
\r
1777 <emphasis>%cD</emphasis>: committer date, RFC2822 style
\r
1782 <emphasis>%cr</emphasis>: committer date, relative
\r
1787 <emphasis>%ct</emphasis>: committer date, UNIX timestamp
\r
1792 <emphasis>%ci</emphasis>: committer date, ISO 8601-like format
\r
1797 <emphasis>%cI</emphasis>: committer date, strict ISO 8601 format
\r
1802 <emphasis>%d</emphasis>: ref names, like the --decorate option of <xref linkend="git-log(1)" />
\r
1807 <emphasis>%D</emphasis>: ref names without the " (", ")" wrapping.
\r
1812 <emphasis>%e</emphasis>: encoding
\r
1817 <emphasis>%s</emphasis>: subject
\r
1822 <emphasis>%f</emphasis>: sanitized subject line, suitable for a filename
\r
1827 <emphasis>%b</emphasis>: body
\r
1832 <emphasis>%B</emphasis>: raw body (unwrapped subject and body)
\r
1837 <emphasis>%GG</emphasis>: raw verification message from GPG for a signed commit
\r
1842 <emphasis>%G?</emphasis>: show "G" for a Good signature, "B" for a Bad signature, "U" for a good,
\r
1843 untrusted signature and "N" for no signature
\r
1848 <emphasis>%GS</emphasis>: show the name of the signer for a signed commit
\r
1853 <emphasis>%GK</emphasis>: show the key used to sign a signed commit
\r
1858 <emphasis>%gD</emphasis>: reflog selector, e.g., <emphasis>refs/stash@{1}</emphasis>
\r
1863 <emphasis>%gd</emphasis>: shortened reflog selector, e.g., <emphasis>stash@{1}</emphasis>
\r
1868 <emphasis>%gn</emphasis>: reflog identity name
\r
1873 <emphasis>%gN</emphasis>: reflog identity name (respecting .mailmap, see
\r
1874 <xref linkend="git-shortlog(1)" /> or <xref linkend="git-blame(1)" />)
\r
1879 <emphasis>%ge</emphasis>: reflog identity email
\r
1884 <emphasis>%gE</emphasis>: reflog identity email (respecting .mailmap, see
\r
1885 <xref linkend="git-shortlog(1)" /> or <xref linkend="git-blame(1)" />)
\r
1890 <emphasis>%gs</emphasis>: reflog subject
\r
1895 <emphasis>%Cred</emphasis>: switch color to red
\r
1900 <emphasis>%Cgreen</emphasis>: switch color to green
\r
1905 <emphasis>%Cblue</emphasis>: switch color to blue
\r
1910 <emphasis>%Creset</emphasis>: reset color
\r
1915 <emphasis>%C(…)</emphasis>: color specification, as described in color.branch.* config option;
\r
1916 adding <emphasis>auto,</emphasis> at the beginning will emit color only when colors are
\r
1917 enabled for log output (by <emphasis>color.diff</emphasis>, <emphasis>color.ui</emphasis>, or <emphasis>--color</emphasis>, and
\r
1918 respecting the <emphasis>auto</emphasis> settings of the former if we are going to a
\r
1919 terminal). <emphasis>auto</emphasis> alone (i.e. <emphasis>%C(auto)</emphasis>) will turn on auto coloring
\r
1920 on the next placeholders until the color is switched again.
\r
1925 <emphasis>%m</emphasis>: left, right or boundary mark
\r
1930 <emphasis>%n</emphasis>: newline
\r
1935 <emphasis>%%</emphasis>: a raw <emphasis>%</emphasis>
\r
1940 <emphasis>%x00</emphasis>: print a byte from a hex code
\r
1945 <emphasis>%w([<w>[,<i1>[,<i2>]]])</emphasis>: switch line wrapping, like the -w option of
\r
1946 <xref linkend="git-shortlog(1)" />.
\r
1951 <emphasis>%<(<N>[,trunc|ltrunc|mtrunc])</emphasis>: make the next placeholder take at
\r
1952 least N columns, padding spaces on the right if necessary.
\r
1953 Optionally truncate at the beginning (ltrunc), the middle (mtrunc)
\r
1954 or the end (trunc) if the output is longer than N columns.
\r
1955 Note that truncating only works correctly with N >= 2.
\r
1960 <emphasis>%<|(<N>)</emphasis>: make the next placeholder take at least until Nth
\r
1961 columns, padding spaces on the right if necessary
\r
1966 <emphasis>%>(<N>)</emphasis>, <emphasis>%>|(<N>)</emphasis>: similar to <emphasis>%<(<N>)</emphasis>, <emphasis>%<|(<N>)</emphasis>
\r
1967 respectively, but padding spaces on the left
\r
1972 <emphasis>%>>(<N>)</emphasis>, <emphasis>%>>|(<N>)</emphasis>: similar to <emphasis>%>(<N>)</emphasis>, <emphasis>%>|(<N>)</emphasis>
\r
1973 respectively, except that if the next placeholder takes more spaces
\r
1974 than given and there are spaces on its left, use those spaces
\r
1979 <emphasis>%><(<N>)</emphasis>, <emphasis>%><|(<N>)</emphasis>: similar to <emphasis>% <(<N>)</emphasis>, <emphasis>%<|(<N>)</emphasis>
\r
1980 respectively, but padding both sides (i.e. the text is centered)
\r
1986 <note><simpara>Some placeholders may depend on other options given to the
\r
1987 revision traversal engine. For example, the <emphasis>%g*</emphasis> reflog options will
\r
1988 insert an empty string unless we are traversing reflog entries (e.g., by
\r
1989 <emphasis>git log -g</emphasis>). The <emphasis>%d</emphasis> and <emphasis>%D</emphasis> placeholders will use the "short"
\r
1990 decoration format if <emphasis>--decorate</emphasis> was not already provided on the command
\r
1991 line.</simpara></note>
\r
1992 <simpara>If you add a <emphasis>+</emphasis> (plus sign) after <emphasis>%</emphasis> of a placeholder, a line-feed
\r
1993 is inserted immediately before the expansion if and only if the
\r
1994 placeholder expands to a non-empty string.</simpara>
\r
1995 <simpara>If you add a <emphasis>-</emphasis> (minus sign) after <emphasis>%</emphasis> of a placeholder, line-feeds that
\r
1996 immediately precede the expansion are deleted if and only if the
\r
1997 placeholder expands to an empty string.</simpara>
\r
1998 <simpara>If you add a ` ` (space) after <emphasis>%</emphasis> of a placeholder, a space
\r
1999 is inserted immediately before the expansion if and only if the
\r
2000 placeholder expands to a non-empty string.</simpara>
\r
2004 <emphasis>tformat:</emphasis>
\r
2006 <simpara>The <emphasis>tformat:</emphasis> format works exactly like <emphasis>format:</emphasis>, except that it
\r
2007 provides "terminator" semantics instead of "separator" semantics. In
\r
2008 other words, each commit has the message terminator character (usually a
\r
2009 newline) appended, rather than a separator placed between entries.
\r
2010 This means that the final entry of a single-line format will be properly
\r
2011 terminated with a new line, just as the "oneline" format does.
\r
2012 For example:</simpara>
\r
2013 <screen>$ git log -2 --pretty=format:%h 4da45bef \
\r
2014 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
\r
2016 7134973 -- NO NEWLINE
\r
2018 $ git log -2 --pretty=tformat:%h 4da45bef \
\r
2019 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
\r
2022 <simpara>In addition, any unrecognized string that has a <emphasis>%</emphasis> in it is interpreted
\r
2023 as if it has <emphasis>tformat:</emphasis> in front of it. For example, these two are
\r
2024 equivalent:</simpara>
\r
2025 <screen>$ git log -2 --pretty=tformat:%h 4da45bef
\r
2026 $ git log -2 --pretty=%h 4da45bef</screen>
\r
2030 <simplesect id="git-rev-list(1)__git">
\r
2031 <title>GIT</title>
\r
2032 <simpara>Part of the <xref linkend="git(1)" /> suite</simpara>
\r