2 .\" Title: git-rev-list
3 .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author]
4 .\" Generator: DocBook XSL Stylesheets v1.79.2 <http://docbook.sf.net/>
7 .\" Source: Git 2.47.0.336.g6ea2d9d271
10 .TH "GIT\-REV\-LIST" "1" "2024-11-25" "Git 2\&.47\&.0\&.336\&.g6ea2d9" "Git Manual"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
25 .\" disable justification (adjust text to left margin only)
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
31 git-rev-list \- Lists commit objects in reverse chronological order
35 \fIgit rev\-list\fR [<options>] <commit>\&...\: [\-\-] [<path>\&...\:]
39 List commits that are reachable by following the \fBparent\fR links from the given commit(s), but exclude commits that are reachable from the one(s) given with a \fI^\fR in front of them\&. The output is given in reverse chronological order by default\&.
41 You can think of this as a set operation\&. Commits reachable from any of the commits given on the command line form a set, and then commits reachable from any of the ones given with \fI^\fR in front are subtracted from that set\&. The remaining commits are what comes out in the command\(cqs output\&. Various other options and paths parameters can be used to further limit the result\&.
43 Thus, the following command:
49 $ git rev\-list foo bar ^baz
55 means "list all the commits which are reachable from \fIfoo\fR or \fIbar\fR, but not from \fIbaz\fR"\&.
57 A special notation "\fI<commit1>\fR\&.\&.\fI<commit2>\fR" can be used as a short\-hand for "^\fI<commit1>\fR \fI<commit2>\fR"\&. For example, either of the following may be used interchangeably:
63 $ git rev\-list origin\&.\&.HEAD
64 $ git rev\-list HEAD ^origin
70 Another special notation is "\fI<commit1>\fR\&...\:\fI<commit2>\fR" which is useful for merges\&. The resulting set of commits is the symmetric difference between the two operands\&. The following two commands are equivalent:
76 $ git rev\-list A B \-\-not $(git merge\-base \-\-all A B)
77 $ git rev\-list A\&.\&.\&.B
83 \fIrev\-list\fR is an essential Git command, since it provides the ability to build and traverse commit ancestry graphs\&. For this reason, it has a lot of different options that enable it to be used by commands as different as \fIgit bisect\fR and \fIgit repack\fR\&.
87 Besides specifying a range of commits that should be listed using the special notations explained in the description, additional commit limiting may be applied\&.
89 Using more options generally further limits the output (e\&.g\&. \fB\-\-since=\fR\fI<date1>\fR limits to commits newer than \fI<date1>\fR, and using it with \fB\-\-grep=\fR\fI<pattern>\fR further limits to commits whose log message has a line that matches \fI<pattern>\fR), unless otherwise noted\&.
91 Note that these are applied before commit ordering and formatting options, such as \fB\-\-reverse\fR\&.
93 \-<number>, \-n <number>, \-\-max\-count=<number>
95 Limit the number of commits to output\&.
102 commits before starting to show the commit output\&.
105 \-\-since=<date>, \-\-after=<date>
107 Show commits more recent than a specific date\&.
110 \-\-since\-as\-filter=<date>
112 Show all commits more recent than a specific date\&. This visits all commits in the range, rather than stopping at the first commit which is older than a specific date\&.
115 \-\-until=<date>, \-\-before=<date>
117 Show commits older than a specific date\&.
120 \-\-max\-age=<timestamp>, \-\-min\-age=<timestamp>
122 Limit the commits output to specified time range\&.
125 \-\-author=<pattern>, \-\-committer=<pattern>
127 Limit the commits output to ones with author/committer header lines that match the specified pattern (regular expression)\&. With more than one
128 \fB\-\-author=\fR\fI<pattern>\fR, commits whose author matches any of the given patterns are chosen (similarly for multiple
129 \fB\-\-committer=\fR\fI<pattern>\fR)\&.
132 \-\-grep\-reflog=<pattern>
134 Limit the commits output to ones with reflog entries that match the specified pattern (regular expression)\&. With more than one
135 \fB\-\-grep\-reflog\fR, commits whose reflog message matches any of the given patterns are chosen\&. It is an error to use this option unless
136 \fB\-\-walk\-reflogs\fR
142 Limit the commits output to ones with a log message that matches the specified pattern (regular expression)\&. With more than one
143 \fB\-\-grep=\fR\fI<pattern>\fR, commits whose message matches any of the given patterns are chosen (but see
144 \fB\-\-all\-match\fR)\&.
149 Limit the commits output to ones that match all given
150 \fB\-\-grep\fR, instead of ones that match at least one\&.
155 Limit the commits output to ones with a log message that do not match the pattern specified with
156 \fB\-\-grep=\fR\fI<pattern>\fR\&.
159 \-i, \-\-regexp\-ignore\-case
161 Match the regular expression limiting patterns without regard to letter case\&.
166 Consider the limiting patterns to be basic regular expressions; this is the default\&.
169 \-E, \-\-extended\-regexp
171 Consider the limiting patterns to be extended regular expressions instead of the default basic regular expressions\&.
174 \-F, \-\-fixed\-strings
176 Consider the limiting patterns to be fixed strings (don\(cqt interpret pattern as a regular expression)\&.
179 \-P, \-\-perl\-regexp
181 Consider the limiting patterns to be Perl\-compatible regular expressions\&.
183 Support for these types of regular expressions is an optional compile\-time dependency\&. If Git wasn\(cqt compiled with support for them providing this option will cause it to die\&.
188 Stop when a given path disappears from the tree\&.
193 Print only merge commits\&. This is exactly the same as
194 \fB\-\-min\-parents=2\fR\&.
199 Do not print commits with more than one parent\&. This is exactly the same as
200 \fB\-\-max\-parents=1\fR\&.
203 \-\-min\-parents=<number>, \-\-max\-parents=<number>, \-\-no\-min\-parents, \-\-no\-max\-parents
205 Show only commits which have at least (or at most) that many parent commits\&. In particular,
206 \fB\-\-max\-parents=1\fR
208 \fB\-\-no\-merges\fR,
209 \fB\-\-min\-parents=2\fR
212 \fB\-\-max\-parents=0\fR
213 gives all root commits and
214 \fB\-\-min\-parents=3\fR
215 all octopus merges\&.
217 \fB\-\-no\-min\-parents\fR
219 \fB\-\-no\-max\-parents\fR
220 reset these limits (to no limit) again\&. Equivalent forms are
221 \fB\-\-min\-parents=0\fR
222 (any commit has 0 or more parents) and
223 \fB\-\-max\-parents=\-1\fR
224 (negative numbers denote no upper limit)\&.
229 When finding commits to include, follow only the first parent commit upon seeing a merge commit\&. This option can give a better overview when viewing the evolution of a particular topic branch, because merges into a topic branch tend to be only about adjusting to updated upstream from time to time, and this option allows you to ignore the individual commits brought in to your history by such a merge\&.
232 \-\-exclude\-first\-parent\-only
234 When finding commits to exclude (with a
235 \fI^\fR), follow only the first parent commit upon seeing a merge commit\&. This can be used to find the set of changes in a topic branch from the point where it diverged from the remote branch, given that arbitrary merges can be valid topic branch changes\&.
240 Reverses the meaning of the
242 prefix (or lack thereof) for all following revision specifiers, up to the next
243 \fB\-\-not\fR\&. When used on the command line before \-\-stdin, the revisions passed through stdin will not be affected by it\&. Conversely, when passed via standard input, the revisions passed on the command line will not be affected by it\&.
248 Pretend as if all the refs in
249 \fBrefs/\fR, along with
250 \fBHEAD\fR, are listed on the command line as
254 \-\-branches[=<pattern>]
256 Pretend as if all the refs in
258 are listed on the command line as
261 is given, limit branches to ones matching given shell glob\&. If pattern lacks
266 at the end is implied\&.
271 Pretend as if all the refs in
273 are listed on the command line as
276 is given, limit tags to ones matching given shell glob\&. If pattern lacks
281 at the end is implied\&.
284 \-\-remotes[=<pattern>]
286 Pretend as if all the refs in
288 are listed on the command line as
291 is given, limit remote\-tracking branches to ones matching given shell glob\&. If pattern lacks
296 at the end is implied\&.
299 \-\-glob=<glob\-pattern>
301 Pretend as if all the refs matching shell glob
302 \fI<glob\-pattern>\fR
303 are listed on the command line as
304 \fI<commit>\fR\&. Leading
305 \fIrefs/\fR, is automatically prepended if missing\&. If pattern lacks
310 at the end is implied\&.
313 \-\-exclude=<glob\-pattern>
315 Do not include refs matching
316 \fI<glob\-pattern>\fR
321 \fB\-\-remotes\fR, or
323 would otherwise consider\&. Repetitions of this option accumulate exclusion patterns up to the next
327 \fB\-\-remotes\fR, or
329 option (other options or arguments do not clear accumulated patterns)\&.
331 The patterns given should not begin with
338 \fB\-\-remotes\fR, respectively, and they must begin with
343 \fB\-\-all\fR\&. If a trailing
345 is intended, it must be given explicitly\&.
348 \-\-exclude\-hidden=[fetch|receive|uploadpack]
350 Do not include refs that would be hidden by
352 \fBgit\-receive\-pack\fR
354 \fBgit\-upload\-pack\fR
355 by consulting the appropriate
356 \fBfetch\&.hideRefs\fR,
357 \fBreceive\&.hideRefs\fR
359 \fBuploadpack\&.hideRefs\fR
360 configuration along with
361 \fBtransfer\&.hideRefs\fR
363 \fBgit-config\fR(1))\&. This option affects the next pseudo\-ref option
367 and is cleared after processing them\&.
372 Pretend as if all objects mentioned by reflogs are listed on the command line as
378 Pretend as if all objects mentioned as ref tips of alternate repositories were listed on the command line\&. An alternate repository is any repository whose object directory is specified in
379 \fBobjects/info/alternates\fR\&. The set of included objects may be modified by
380 \fBcore\&.alternateRefsCommand\fR, etc\&. See
381 \fBgit-config\fR(1)\&.
386 By default, all working trees will be examined by the following options when there are more than one (see
387 \fBgit-worktree\fR(1)):
391 \fB\-\-indexed\-objects\fR\&. This option forces them to examine the current working tree only\&.
396 Upon seeing an invalid object name in the input, pretend as if the bad input was not given\&.
401 In addition to getting arguments from the command line, read them from standard input as well\&. This accepts commits and pseudo\-options like
404 \fB\-\-glob=\fR\&. When a
406 separator is seen, the following input is treated as paths and used to limit the result\&. Flags like
408 which are read via standard input are only respected for arguments passed in the same way and will not influence any subsequent command line arguments\&.
413 Don\(cqt print anything to standard output\&. This form is primarily meant to allow the caller to test the exit status to see if a range of objects is fully connected (or not)\&. It is faster than redirecting stdout to
415 as the output does not have to be formatted\&.
418 \-\-disk\-usage, \-\-disk\-usage=human
420 Suppress normal output; instead, print the sum of the bytes used for on\-disk storage by the selected commits or objects\&. This is equivalent to piping the output into
423 \fB\-\-batch\-check=\fR\*(Aq%(\fBobjectsize:disk\fR)\*(Aq, except that it runs much faster (especially with
424 \fB\-\-use\-bitmap\-index\fR)\&. See the
427 \fBgit-cat-file\fR(1)
428 for the limitations of what "on\-disk storage" means\&. With the optional value
429 \fBhuman\fR, on\-disk storage size is shown in human\-readable string(e\&.g\&. 12\&.24 Kib, 3\&.50 Mib)\&.
435 \fB\-\-cherry\-pick\fR
436 (see below) but mark equivalent commits with
438 rather than omitting them, and inequivalent ones with
444 Omit any commit that introduces the same change as another commit on the
446 when the set of commits are limited with symmetric difference\&.
448 For example, if you have two branches,
451 \fBB\fR, a usual way to list all commits on only one side of them is with
452 \fB\-\-left\-right\fR
453 (see the example below in the description of the
454 \fB\-\-left\-right\fR
455 option)\&. However, it shows the commits that were cherry\-picked from the other branch (for example,
457 may be cherry\-picked from branch A)\&. With this option, such pairs of commits are excluded from the output\&.
460 \-\-left\-only, \-\-right\-only
462 List only commits on the respective side of a symmetric difference, i\&.e\&. only those which would be marked < resp\&. > by
463 \fB\-\-left\-right\fR\&.
466 \fB\-\-cherry\-pick\fR
467 \fB\-\-right\-only\fR
468 \fBA\fR\fB\&.\&.\&.\fR\fBB\fR
469 omits those commits from
473 or are patch\-equivalent to a commit in
474 \fBA\fR\&. In other words, this lists the
480 \fBB\fR\&. More precisely,
481 \fB\-\-cherry\-pick\fR
482 \fB\-\-right\-only\fR
484 gives the exact list\&.
490 \fB\-\-right\-only\fR
491 \fB\-\-cherry\-mark\fR
492 \fB\-\-no\-merges\fR; useful to limit the output to the commits on our side and mark those that have been applied to the other side of a forked history with
496 \fBupstream\fR\fB\&.\&.\&.\fR\fBmybranch\fR, similar to
503 \-g, \-\-walk\-reflogs
505 Instead of walking the commit ancestry chain, walk reflog entries from the most recent one to older ones\&. When this option is used you cannot specify commits to exclude (that is,
507 \fIcommit1\&.\&.commit2\fR, and
508 \fIcommit1\&.\&.\&.commit2\fR
509 notations cannot be used)\&.
517 (for obvious reasons), this causes the output to have two extra lines of information taken from the reflog\&. The reflog designator in the output may be shown as
518 \fBref@\fR{\fI<Nth>\fR} (where
520 is the reverse\-chronological index in the reflog) or as
521 \fBref@\fR{\fI<timestamp>\fR} (with the
523 for that entry), depending on a few rules:
533 If the starting point is specified as
534 \fBref@\fR{\fI<Nth>\fR}, show the index format\&.
545 If the starting point was specified as
546 \fBref@\fR{now}, show the timestamp format\&.
557 If neither was used, but
559 was given on the command line, show the timestamp in the format requested by
571 Otherwise, show the index format\&.
575 \fB\-\-pretty=oneline\fR, the commit message is prefixed with this information on the same line\&. This option cannot be combined with
576 \fB\-\-reverse\fR\&. See also
577 \fBgit-reflog\fR(1)\&.
580 \fB\-\-pretty=reference\fR, this information will not be shown at all\&.
585 Show commits touching conflicted paths in the range
586 \fBHEAD\fR\fB\&.\&.\&.\fR\fI<other>\fR, where
588 is the first existing pseudoref in
590 \fBCHERRY_PICK_HEAD\fR,
593 \fBREBASE_HEAD\fR\&. Only works when the index has unmerged entries\&. This option can be used to show relevant commits when resolving conflicts from a 3\-way merge\&.
598 Output excluded boundary commits\&. Boundary commits are prefixed with
602 \-\-use\-bitmap\-index
604 Try to speed up the traversal using the pack bitmap index (if one is available)\&. Note that when traversing with
605 \fB\-\-objects\fR, trees and blobs will not have their associated path printed\&.
608 \-\-progress=<header>
610 Show progress reports on stderr as objects are considered\&. The
612 text will be printed with each progress update\&.
614 .SS "History Simplification"
616 Sometimes you are only interested in parts of the history, for example the commits modifying a particular <path>\&. But there are two parts of \fIHistory Simplification\fR, one part is selecting the commits and the other is how to do it, as there are various strategies to simplify the history\&.
618 The following options select the commits to be shown:
622 Commits modifying the given <paths> are selected\&.
625 \-\-simplify\-by\-decoration
627 Commits that are referred by some branch or tag are selected\&.
630 Note that extra commits can be shown to give a meaningful history\&.
632 The following options affect the way the simplification is performed:
636 Simplifies the history to the simplest history explaining the final state of the tree\&. Simplest because it prunes some side branches if the end result is the same (i\&.e\&. merging branches with the same content)
641 Include all commits from the default mode, but also any merge commits that are not TREESAME to the first parent but are TREESAME to a later parent\&. This mode is helpful for showing the merge commits that "first introduced" a change to a branch\&.
646 Same as the default mode, but does not prune some history\&.
651 Only the selected commits are shown, plus some to have a meaningful history\&.
656 All commits in the simplified history are shown\&.
662 \fB\-\-full\-history\fR
663 to remove some needless merges from the resulting history, as there are no selected commits contributing to this merge\&.
666 \-\-ancestry\-path[=<commit>]
668 When given a range of commits to display (e\&.g\&.
669 \fIcommit1\&.\&.commit2\fR
671 \fIcommit2 ^commit1\fR), only display commits in that range that are ancestors of <commit>, descendants of <commit>, or <commit> itself\&. If no commit is specified, use
673 (the excluded part of the range) as <commit>\&. Can be passed multiple times; if so, a commit is included if it is any of the commits given or if it is an ancestor or descendant of one of them\&.
676 A more detailed explanation follows\&.
678 Suppose you specified \fBfoo\fR as the <paths>\&. We shall call commits that modify \fBfoo\fR !TREESAME, and the rest TREESAME\&. (In a diff filtered for \fBfoo\fR, they look different and equal, respectively\&.)
680 In the following, we will always refer to the same example history to illustrate the differences between simplification settings\&. We assume that you are filtering for a file \fBfoo\fR in this commit graph:
686 \&.\-A\-\-\-M\-\-\-N\-\-\-O\-\-\-P\-\-\-Q
690 `\-\-\-\-\-\-\-\-\-\-\-\-\-\*(Aq X
696 The horizontal line of history A\-\-\-Q is taken to be the first parent of each merge\&. The commits are:
707 is the initial commit, in which
710 \(lqasdf\(rq, and a file
713 \(lqquux\(rq\&. Initial commits are compared to an empty tree, so
742 contains the same change as
745 is trivial and hence TREESAME to all parents\&.
758 \fBfoo\fR, but its merge
761 \(lqfoobar\(rq, so it is not TREESAME to any parent\&.
776 \(lqbaz\(rq\&. Its merge
778 combines the strings from
783 \(lqfoobarbaz\(rq; i\&.e\&., it is not TREESAME to any parent\&.
798 \(lqxyzzy\(rq, and its merge
800 combines the strings to
801 \(lqquux xyzzy\(rq\&.
817 is an independent root commit that added a new file
835 \fBrev\-list\fR walks backwards through history, including or excluding commits based on whether \fB\-\-full\-history\fR and/or parent rewriting (via \fB\-\-parents\fR or \fB\-\-children\fR) are used\&. The following settings are available\&.
839 Commits are included if they are not TREESAME to any parent (though this can be changed, see
841 below)\&. If the commit was a merge, and it was TREESAME to one parent, follow only that parent\&. (Even if there are several TREESAME parents, follow only one of them\&.) Otherwise, follow all parents\&.
857 Note how the rule to only follow the TREESAME parent, if one is available, removed
859 from consideration entirely\&.
862 \fBN\fR, but is TREESAME\&. Root commits are compared to an empty tree, so
866 Parent/child relations are only visible with
867 \fB\-\-parents\fR, but that does not affect the commits selected in default mode, so we have shown the parent lines\&.
870 \-\-full\-history without parent rewriting
872 This mode differs from the default in one point: always follow all parents of a merge, even if it is TREESAME to one of them\&. Even if more than one side of the merge has commits that are included, this does not imply that the merge itself is! In the example, we get
885 was excluded because it is TREESAME to both parents\&.
890 were all walked, but only
892 was !TREESAME, so the others do not appear\&.
894 Note that without parent rewriting, it is not really possible to talk about the parent/child relationships between the commits, so we show them disconnected\&.
897 \-\-full\-history with parent rewriting
899 Ordinary commits are only included if they are !TREESAME (though this can be changed, see
903 Merges are always included\&. However, their parent list is rewritten: Along each parent, prune away commits that are not included themselves\&. This results in
909 \&.\-A\-\-\-M\-\-\-N\-\-\-O\-\-\-P\-\-\-Q
913 `\-\-\-\-\-\-\-\-\-\-\-\-\-\*(Aq
920 \fB\-\-full\-history\fR
921 without rewriting above\&. Note that
923 was pruned away because it is TREESAME, but the parent list of P was rewritten to contain
925 \fBI\fR\&. The same happened for
935 In addition to the above settings, you can change whether TREESAME affects inclusion:
939 Commits that are walked are included if they are not TREESAME to any parent\&.
944 All commits that are walked are included\&.
947 \fB\-\-full\-history\fR, this still simplifies merges: if one of the parents is TREESAME, we follow only that one, so the other sides of the merge are never walked\&.
952 First, build a history graph in the same way that
953 \fB\-\-full\-history\fR
954 with parent rewriting does (see above)\&.
956 Then simplify each commit
959 \fBC\fR\*(Aq in the final history according to the following rules:
985 \fBC\fR\*(Aq with its simplification
986 \fBP\fR\*(Aq\&. In the process, drop parents that are ancestors of other parents or that are root commits TREESAME to an empty tree, and remove duplicates, but take care to never drop all parents that we are TREESAME to\&.
997 If after this parent rewriting,
998 \fBC\fR\*(Aq is a root or merge commit (has zero or >1 parents), a boundary commit, or !TREESAME, it remains\&. Otherwise, it is replaced with its only parent\&.
1001 The effect of this is best shown by way of comparing to
1002 \fB\-\-full\-history\fR
1003 with parent rewriting\&. The example turns into:
1009 \&.\-A\-\-\-M\-\-\-N\-\-\-O
1013 `\-\-\-\-\-\-\-\-\-\*(Aq
1019 Note the major differences in
1024 \fB\-\-full\-history\fR:
1028 \h'-04'\(bu\h'+03'\c
1034 \fBN\fR\*(Aqs parent list had
1036 removed, because it is an ancestor of the other parent
1039 remained because it is !TREESAME\&.
1044 \h'-04'\(bu\h'+03'\c
1050 \fBP\fR\*(Aqs parent list similarly had
1054 was then removed completely, because it had one parent and is TREESAME\&.
1059 \h'-04'\(bu\h'+03'\c
1065 \fBQ\fR\*(Aqs parent list had
1070 was then removed, because it was a TREESAME root\&.
1072 was then removed completely, because it had one parent and is TREESAME\&.
1076 There is another simplification mode available:
1078 \-\-ancestry\-path[=<commit>]
1080 Limit the displayed commits to those which are an ancestor of <commit>, or which are a descendant of <commit>, or are <commit> itself\&.
1082 As an example use case, consider the following commit history:
1088 D\-\-\-E\-\-\-\-\-\-\-F
1090 B\-\-\-C\-\-\-G\-\-\-H\-\-\-I\-\-\-J
1092 A\-\-\-\-\-\-\-K\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-L\-\-M
1100 computes the set of commits that are ancestors of
1101 \fBM\fR, but excludes the ones that are ancestors of
1102 \fBD\fR\&. This is useful to see what happened to the history leading to
1105 \fBD\fR, in the sense that
1106 \(lqwhat does \fBM\fR have that did not exist in \fBD\fR\(rq\&. The result in this example would be all the commits, except
1112 itself, of course)\&.
1114 When we want to find out what commits in
1116 are contaminated with the bug introduced by
1118 and need fixing, however, we might want to view only the subset of
1120 that are actually descendants of
1121 \fBD\fR, i\&.e\&. excluding
1124 \fBK\fR\&. This is exactly what the
1125 \fB\-\-ancestry\-path\fR
1126 option does\&. Applied to the
1128 range, it results in:
1136 G\-\-\-H\-\-\-I\-\-\-J
1145 \fB\-\-ancestry\-path=D\fR
1147 \fB\-\-ancestry\-path\fR
1148 which means the same thing when applied to the
1150 range but is just more explicit\&.
1152 If we instead are interested in a given topic within this range, and all commits affected by that topic, we may only want to view the subset of
1153 \fBD\fR\fB\&.\&.\fR\fBM\fR
1154 which contain that topic in their ancestry path\&. So, using
1155 \fB\-\-ancestry\-path=H\fR
1156 \fBD\fR\fB\&.\&.\fR\fBM\fR
1157 for example would result in:
1165 G\-\-\-H\-\-\-I\-\-\-J
1174 \fB\-\-ancestry\-path=K\fR
1175 \fBD\fR\fB\&.\&.\fR\fBM\fR
1182 K\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-L\-\-M
1189 Before discussing another option, \fB\-\-show\-pulls\fR, we need to create a new example history\&.
1191 A common problem users face when looking at simplified history is that a commit they know changed a file somehow does not appear in the file\(cqs simplified history\&. Let\(cqs demonstrate a new example and show how options such as \fB\-\-full\-history\fR and \fB\-\-simplify\-merges\fR works in that case:
1197 \&.\-A\-\-\-M\-\-\-\-\-C\-\-N\-\-\-O\-\-\-P
1199 I B \e R\-\*(Aq`\-Z\*(Aq /
1202 `\-\-\-X\-\-\*(Aq `\-\-\-Y\-\-\*(Aq
1208 For this example, suppose \fBI\fR created \fBfile\&.txt\fR which was modified by \fBA\fR, \fBB\fR, and \fBX\fR in different ways\&. The single\-parent commits \fBC\fR, \fBZ\fR, and \fBY\fR do not change \fBfile\&.txt\fR\&. The merge commit \fBM\fR was created by resolving the merge conflict to include both changes from \fBA\fR and \fBB\fR and hence is not TREESAME to either\&. The merge commit \fBR\fR, however, was created by ignoring the contents of \fBfile\&.txt\fR at \fBM\fR and taking only the contents of \fBfile\&.txt\fR at \fBX\fR\&. Hence, \fBR\fR is TREESAME to \fBX\fR but not \fBM\fR\&. Finally, the natural merge resolution to create \fBN\fR is to take the contents of \fBfile\&.txt\fR at \fBR\fR, so \fBN\fR is TREESAME to \fBR\fR but not \fBC\fR\&. The merge commits \fBO\fR and \fBP\fR are TREESAME to their first parents, but not to their second parents, \fBZ\fR and \fBY\fR respectively\&.
1210 When using the default mode, \fBN\fR and \fBR\fR both have a TREESAME parent, so those edges are walked and the others are ignored\&. The resulting history graph is:
1222 When using \fB\-\-full\-history\fR, Git walks every edge\&. This will discover the commits \fBA\fR and \fBB\fR and the merge \fBM\fR, but also will reveal the merge commits \fBO\fR and \fBP\fR\&. With parent rewriting, the resulting graph is:
1228 \&.\-A\-\-\-M\-\-\-\-\-\-\-\-N\-\-\-O\-\-\-P
1230 I B \e R\-\*(Aq`\-\-\*(Aq /
1233 `\-\-\-X\-\-\*(Aq `\-\-\-\-\-\-\*(Aq
1239 Here, the merge commits \fBO\fR and \fBP\fR contribute extra noise, as they did not actually contribute a change to \fBfile\&.txt\fR\&. They only merged a topic that was based on an older version of \fBfile\&.txt\fR\&. This is a common issue in repositories using a workflow where many contributors work in parallel and merge their topic branches along a single trunk: many unrelated merges appear in the \fB\-\-full\-history\fR results\&.
1241 When using the \fB\-\-simplify\-merges\fR option, the commits \fBO\fR and \fBP\fR disappear from the results\&. This is because the rewritten second parents of \fBO\fR and \fBP\fR are reachable from their first parents\&. Those edges are removed and then the commits look like single\-parent commits that are TREESAME to their parent\&. This also happens to the commit \fBN\fR, resulting in a history view as follows:
1247 \&.\-A\-\-\-M\-\-\&.
1258 In this view, we see all of the important single\-parent changes from \fBA\fR, \fBB\fR, and \fBX\fR\&. We also see the carefully\-resolved merge \fBM\fR and the not\-so\-carefully\-resolved merge \fBR\fR\&. This is usually enough information to determine why the commits \fBA\fR and \fBB\fR "disappeared" from history in the default view\&. However, there are a few issues with this approach\&.
1260 The first issue is performance\&. Unlike any previous option, the \fB\-\-simplify\-merges\fR option requires walking the entire commit history before returning a single result\&. This can make the option difficult to use for very large repositories\&.
1262 The second issue is one of auditing\&. When many contributors are working on the same repository, it is important which merge commits introduced a change into an important branch\&. The problematic merge \fBR\fR above is not likely to be the merge commit that was used to merge into an important branch\&. Instead, the merge \fBN\fR was used to merge \fBR\fR and \fBX\fR into the important branch\&. This commit may have information about why the change \fBX\fR came to override the changes from \fBA\fR and \fBB\fR in its commit message\&.
1266 In addition to the commits shown in the default history, show each merge commit that is not TREESAME to its first parent but is TREESAME to a later parent\&.
1268 When a merge commit is included by
1269 \fB\-\-show\-pulls\fR, the merge is treated as if it "pulled" the change from another branch\&. When using
1270 \fB\-\-show\-pulls\fR
1271 on this example (and no other options) the resulting graph is:
1277 I\-\-\-X\-\-\-R\-\-\-N
1283 Here, the merge commits
1287 are included because they pulled the commits
1291 into the base branch, respectively\&. These merges are the reason the commits
1295 do not appear in the default history\&.
1298 \fB\-\-show\-pulls\fR
1300 \fB\-\-simplify\-merges\fR, the graph includes all of the necessary information:
1306 \&.\-A\-\-\-M\-\-\&. N
1320 \fBR\fR, the edge from
1324 was simplified away\&. However,
1326 still appears in the history as an important commit because it "pulled" the change
1328 into the main branch\&.
1331 The \fB\-\-simplify\-by\-decoration\fR option allows you to view only the big picture of the topology of the history, by omitting commits that are not referenced by tags\&. Commits are marked as !TREESAME (in other words, kept after history simplification rules described above) if (1) they are referenced by tags, or (2) they change the contents of the paths given on the command line\&. All other commits are marked as TREESAME (subject to be simplified away)\&.
1332 .SS "Bisection Helpers"
1336 Limit output to the one commit object which is roughly halfway between included and excluded commits\&. Note that the bad bisection ref
1337 \fBrefs/bisect/bad\fR
1338 is added to the included commits (if it exists) and the good bisection refs
1339 \fBrefs/bisect/good\-\fR* are added to the excluded commits (if they exist)\&. Thus, supposing there are no refs in
1340 \fBrefs/bisect/\fR, if
1346 $ git rev\-list \-\-bisect foo ^bar ^baz
1353 \fImidpoint\fR, the output of the two commands
1359 $ git rev\-list foo ^midpoint
1360 $ git rev\-list midpoint ^bar ^baz
1366 would be of roughly the same length\&. Finding the change which introduces a regression is thus reduced to a binary search: repeatedly generate and test new \*(Aqmidpoint\(cqs until the commit chain is of length one\&.
1371 This calculates the same as
1372 \fB\-\-bisect\fR, except that refs in
1374 are not used, and except that this outputs text ready to be eval\(cqed by the shell\&. These lines will assign the name of the midpoint revision to the variable
1375 \fBbisect_rev\fR, and the expected number of commits to be tested after
1378 \fBbisect_nr\fR, the expected number of commits to be tested if
1380 turns out to be good to
1381 \fBbisect_good\fR, the expected number of commits to be tested if
1383 turns out to be bad to
1384 \fBbisect_bad\fR, and the number of commits we are bisecting right now to
1390 This outputs all the commit objects between the included and excluded commits, ordered by their distance to the included and excluded commits\&. Refs in
1392 are not used\&. The farthest from them is displayed first\&. (This is the only one displayed by
1393 \fB\-\-bisect\fR\&.)
1395 This is useful because it makes it easy to choose a good commit to test when you want to avoid to test some of them for some reason (they may not compile for example)\&.
1397 This option can be used along with
1398 \fB\-\-bisect\-vars\fR, in this case, after all the sorted commit objects, there will be the same text as if
1399 \fB\-\-bisect\-vars\fR
1400 had been used alone\&.
1402 .SS "Commit Ordering"
1404 By default, the commits are shown in reverse chronological order\&.
1408 Show no parents before all of its children are shown, but otherwise show commits in the commit timestamp order\&.
1411 \-\-author\-date\-order
1413 Show no parents before all of its children are shown, but otherwise show commits in the author timestamp order\&.
1418 Show no parents before all of its children are shown, and avoid showing commits on multiple lines of history intermixed\&.
1420 For example, in a commit history like this:
1426 \-\-\-1\-\-\-\-2\-\-\-\-4\-\-\-\-7
1428 3\-\-\-\-5\-\-\-\-6\-\-\-\-8\-\-\-
1434 where the numbers denote the order of commit timestamps,
1438 \fB\-\-date\-order\fR
1439 show the commits in the timestamp order: 8 7 6 5 4 3 2 1\&.
1442 \fB\-\-topo\-order\fR, they would show 8 6 5 3 7 4 2 1 (or 8 7 4 2 6 5 3 1); some older commits are shown before newer ones in order to avoid showing the commits from two parallel development track mixed together\&.
1447 Output the commits chosen to be shown (see Commit Limiting section above) in reverse order\&. Cannot be combined with
1448 \fB\-\-walk\-reflogs\fR\&.
1450 .SS "Object Traversal"
1452 These options are mostly targeted for packing of Git repositories\&.
1456 Print the object IDs of any object referenced by the listed commits\&.
1461 \(lqsend me all object IDs which I need to download if I have the commit object \fIbar\fR but not \fIfoo\fR\(rq\&. See also
1462 \fB\-\-object\-names\fR
1466 \-\-in\-commit\-order
1468 Print tree and blob ids in order of the commits\&. The tree and blob ids are printed after they are first referenced by a commit\&.
1474 \fB\-\-objects\fR, but also print the IDs of excluded commits prefixed with a
1476 character\&. This is used by
1477 \fBgit-pack-objects\fR(1)
1480 pack, which records objects in deltified form based on objects contained in these excluded commits to reduce network traffic\&.
1483 \-\-objects\-edge\-aggressive
1486 \fB\-\-objects\-edge\fR, but it tries harder to find excluded commits at the cost of increased time\&. This is used instead of
1487 \fB\-\-objects\-edge\fR
1490 packs for shallow repositories\&.
1493 \-\-indexed\-objects
1495 Pretend as if all trees and blobs used by the index are listed on the command line\&. Note that you probably want to use
1496 \fB\-\-objects\fR, too\&.
1502 \fB\-\-objects\fR; print the object IDs that are not in packs\&.
1508 \fB\-\-objects\fR; print the names of the object IDs that are found\&. This is the default behavior\&. Note that the "name" of each object is ambiguous, and mostly intended as a hint for packing objects\&. In particular: no distinction is made between the names of tags, trees, and blobs; path names may be modified to remove newlines; and if an object would appear multiple times with different names, only one name is shown\&.
1511 \-\-no\-object\-names
1514 \fB\-\-objects\fR; does not print the names of the object IDs that are found\&. This inverts
1515 \fB\-\-object\-names\fR\&. This flag allows the output to be more easily parsed by commands such as
1516 \fBgit-cat-file\fR(1)\&.
1519 \-\-filter=<filter\-spec>
1521 Only useful with one of the
1522 \fB\-\-objects\fR*; omits objects (usually blobs) from the list of printed objects\&. The
1523 \fI<filter\-spec>\fR
1524 may be one of the following:
1527 \fI\-\-filter=blob:none\fR
1531 \fI\-\-filter=blob:limit=<n>[kmg]\fR
1532 omits blobs of size at least n bytes or units\&. n may be zero\&. The suffixes k, m, and g can be used to name units in KiB, MiB, or GiB\&. For example,
1535 \fIblob:limit=1024\fR\&.
1538 \fI\-\-filter=object:type=(tag|commit|tree|blob)\fR
1539 omits all objects which are not of the requested type\&.
1542 \fI\-\-filter=sparse:oid=<blob\-ish>\fR
1543 uses a sparse\-checkout specification contained in the blob (or blob\-expression)
1545 to omit blobs that would not be required for a sparse checkout on the requested refs\&.
1548 \fI\-\-filter=tree:<depth>\fR
1549 omits all blobs and trees whose depth from the root tree is >= <depth> (minimum depth if an object is located at multiple depths in the commits traversed)\&. <depth>=0 will not include any trees or blobs unless included explicitly in the command\-line (or standard input when \-\-stdin is used)\&. <depth>=1 will include only the tree and blobs which are referenced directly by a commit reachable from <commit> or an explicitly\-given object\&. <depth>=2 is like <depth>=1 while also including trees and blobs one more level removed from an explicitly\-given commit or tree\&.
1552 \fI\-\-filter=sparse:path=<path>\fR
1553 that wants to read from an arbitrary path on the filesystem has been dropped for security reasons\&.
1557 flags can be specified to combine filters\&. Only objects which are accepted by every filter are included\&.
1560 \fI\-\-filter=combine:<filter1>+<filter2>+\&...\:<filterN>\fR
1561 can also be used to combined several filters, but this is harder than just repeating the
1563 flag and is usually not necessary\&. Filters are joined by
1565 and individual filters are %\-encoded (i\&.e\&. URL\-encoded)\&. Besides the
1569 characters, the following characters are reserved and also must be encoded:
1570 \fB~\fR!@#$^&*()[]{}\e;",<>?\*(Aq` as well as all characters with ASCII code <=
1571 \fB0x20\fR, which includes space and newline\&.
1573 Other arbitrary characters can also be encoded\&. For instance,
1574 \fIcombine:tree:3+blob:none\fR
1576 \fIcombine:tree%3A3+blob%3Anone\fR
1582 Turn off any previous
1587 \-\-filter\-provided\-objects
1589 Filter the list of explicitly provided objects, which would otherwise always be printed even if they did not match any of the filters\&. Only useful with
1590 \fB\-\-filter=\fR\&.
1593 \-\-filter\-print\-omitted
1596 \fB\-\-filter=\fR; prints a list of the objects omitted by the filter\&. Object IDs are prefixed with a
1601 \-\-missing=<missing\-action>
1603 A debug option to help with future "partial clone" development\&. This option specifies how missing objects are handled\&.
1606 \fI\-\-missing=error\fR
1607 requests that rev\-list stop with an error if a missing object is encountered\&. This is the default action\&.
1610 \fI\-\-missing=allow\-any\fR
1611 will allow object traversal to continue if a missing object is encountered\&. Missing objects will silently be omitted from the results\&.
1614 \fI\-\-missing=allow\-promisor\fR
1616 \fIallow\-any\fR, but will only allow object traversal to continue for EXPECTED promisor missing objects\&. Unexpected missing objects will raise an error\&.
1619 \fI\-\-missing=print\fR
1621 \fIallow\-any\fR, but will also print a list of the missing objects\&. Object IDs are prefixed with a
1625 If some tips passed to the traversal are missing, they will be considered as missing too, and the traversal will ignore them\&. In case we cannot get their Object ID though, an error will be raised\&.
1628 \-\-exclude\-promisor\-objects
1630 (For internal use only\&.) Prefilter object traversal at promisor boundary\&. This is used with partial clone\&. This is stronger than
1631 \fB\-\-missing=allow\-promisor\fR
1632 because it limits the traversal, rather than just silencing errors about missing objects\&.
1635 \-\-no\-walk[=(sorted|unsorted)]
1637 Only show the given commits, but do not traverse their ancestors\&. This has no effect if a range is specified\&. If the argument
1639 is given, the commits are shown in the order they were given on the command line\&. Otherwise (if
1641 or no argument was given), the commits are shown in reverse chronological order by commit time\&. Cannot be combined with
1647 Overrides a previous
1648 \fB\-\-no\-walk\fR\&.
1650 .SS "Commit Formatting"
1652 Using these options, \fBgit-rev-list\fR(1) will act similar to the more specialized family of commit log tools: \fBgit-log\fR(1), \fBgit-show\fR(1), and \fBgit-whatchanged\fR(1)
1654 \-\-pretty[=<format>], \-\-format=<format>
1656 Pretty\-print the contents of the commit logs in a given format, where
1667 \fIformat:<string>\fR
1669 \fItformat:<string>\fR\&. When
1671 is none of the above, and has
1673 in it, it acts as if
1674 \fI\-\-pretty=tformat:<format>\fR
1677 See the "PRETTY FORMATS" section for some additional details for each format\&. When
1679 part is omitted, it defaults to
1682 Note: you can specify the default pretty format in the repository configuration (see
1683 \fBgit-config\fR(1))\&.
1688 Instead of showing the full 40\-byte hexadecimal commit object name, show a prefix that names the object uniquely\&. "\-\-abbrev=<n>" (which also modifies diff output, if it is displayed) option can be used to specify the minimum length of the prefix\&.
1690 This should make "\-\-pretty=oneline" a whole lot more readable for people using 80\-column terminals\&.
1693 \-\-no\-abbrev\-commit
1695 Show the full 40\-byte hexadecimal commit object name\&. This negates
1696 \fB\-\-abbrev\-commit\fR, either explicit or implied by other options such as "\-\-oneline"\&. It also overrides the
1697 \fBlog\&.abbrevCommit\fR
1703 This is a shorthand for "\-\-pretty=oneline \-\-abbrev\-commit" used together\&.
1706 \-\-encoding=<encoding>
1708 Commit objects record the character encoding used for the log message in their encoding header; this option can be used to tell the command to re\-code the commit log message in the encoding preferred by the user\&. For non plumbing commands this defaults to UTF\-8\&. Note that if an object claims to be encoded in
1710 and we are outputting in
1711 \fBX\fR, we will output the object verbatim; this means that invalid sequences in the original commit may be copied to the output\&. Likewise, if iconv(3) fails to convert the commit, we will quietly output the original object verbatim\&.
1714 \-\-expand\-tabs=<n>, \-\-expand\-tabs, \-\-no\-expand\-tabs
1716 Perform a tab expansion (replace each tab with enough spaces to fill to the next display column that is a multiple of
1717 \fI<n>\fR) in the log message before showing it in the output\&.
1718 \fB\-\-expand\-tabs\fR
1719 is a short\-hand for
1720 \fB\-\-expand\-tabs=8\fR, and
1721 \fB\-\-no\-expand\-tabs\fR
1722 is a short\-hand for
1723 \fB\-\-expand\-tabs=0\fR, which disables tab expansion\&.
1725 By default, tabs are expanded in pretty formats that indent the log message by 4 spaces (i\&.e\&.
1726 \fImedium\fR, which is the default,
1733 Check the validity of a signed commit object by passing the signature to
1736 and show the output\&.
1742 \fB\-\-date=relative\fR\&.
1747 Only takes effect for dates shown in human\-readable format, such as when using
1750 config variable sets a default value for the log command\(cqs
1752 option\&. By default, dates are shown in the original time zone (either committer\(cqs or author\(cqs)\&. If
1754 is appended to the format (e\&.g\&.,
1755 \fBiso\-local\fR), the user\(cqs local time zone is used instead\&.
1757 \fB\-\-date=relative\fR
1758 shows dates relative to the current time, e\&.g\&.
1759 \(lq2 hours ago\(rq\&. The
1761 option has no effect for
1762 \fB\-\-date=relative\fR\&.
1764 \fB\-\-date=local\fR
1766 \fB\-\-date=default\-local\fR\&.
1770 \fB\-\-date=iso8601\fR) shows timestamps in a ISO 8601\-like format\&. The differences to the strict ISO 8601 format are:
1774 \h'-04'\(bu\h'+03'\c
1780 a space instead of the
1787 \h'-04'\(bu\h'+03'\c
1793 a space between time and time zone
1798 \h'-04'\(bu\h'+03'\c
1804 no colon between hours and minutes of the time zone
1807 \fB\-\-date=iso\-strict\fR
1809 \fB\-\-date=iso8601\-strict\fR) shows timestamps in strict ISO 8601 format\&.
1813 \fB\-\-date=rfc2822\fR) shows timestamps in RFC 2822 format, often found in email messages\&.
1815 \fB\-\-date=short\fR
1816 shows only the date, but not the time, in
1821 shows the date as seconds since the epoch (1970\-01\-01 00:00:00 UTC), followed by a space, and then the timezone as an offset from UTC (a
1825 with four digits; the first two are hours, and the second two are minutes)\&. I\&.e\&., as if the timestamp were formatted with
1826 \fBstrftime\fR("%s %z"))\&. Note that the
1828 option does not affect the seconds\-since\-epoch value (which is always measured in UTC), but does switch the accompanying timezone value\&.
1830 \fB\-\-date=human\fR
1831 shows the timezone if the timezone does not match the current time\-zone, and doesn\(cqt print the whole date if that matches (ie skip printing year for dates that are "this year", but also skip the whole date itself if it\(cqs in the last few days and we can just say what weekday it was)\&. For older dates the hour and minute is also omitted\&.
1834 shows the date as a Unix epoch timestamp (seconds since 1970)\&. As with
1835 \fB\-\-raw\fR, this is always in UTC and therefore
1839 \fB\-\-date=format:\&.\&.\fR\&. feeds the format \&.\&.\&. to your system
1840 \fBstrftime\fR, except for %s, %z, and %Z, which are handled internally\&. Use
1841 \fB\-\-date=format:\fR%c to show the date in your system locale\(cqs preferred format\&. See the
1843 manual for a complete list of format placeholders\&. When using
1844 \fB\-local\fR, the correct syntax is
1845 \fB\-\-date=format\-local:\&.\&.\fR\&.\&.
1847 \fB\-\-date=default\fR
1848 is the default format, and is based on ctime(3) output\&. It shows a single line with three\-letter day of the week, three\-letter month, day\-of\-month, hour\-minute\-seconds in "HH:MM:SS" format, followed by 4\-digit year, plus timezone information, unless the local time zone is used, e\&.g\&.
1859 Print the contents of the commit in raw\-format; each record is separated with a NUL character\&.
1862 \-\-no\-commit\-header
1864 Suppress the header line containing "commit" and the object ID printed before the specified format\&. This has no effect on the built\-in formats; only custom formats are affected\&.
1869 Overrides a previous
1870 \fB\-\-no\-commit\-header\fR\&.
1875 Print also the parents of the commit (in the form "commit parent\&...\:")\&. Also enables parent rewriting, see
1876 \fIHistory Simplification\fR
1882 Print also the children of the commit (in the form "commit child\&...\:")\&. Also enables parent rewriting, see
1883 \fIHistory Simplification\fR
1889 Print the raw commit timestamp\&.
1894 Mark which side of a symmetric difference a commit is reachable from\&. Commits from the left side are prefixed with < and those from the right with >\&. If combined with
1895 \fB\-\-boundary\fR, those commits are prefixed with
1898 For example, if you have this topology:
1904 y\-\-\-b\-\-\-b branch B
1908 o\-\-\-x\-\-\-a\-\-\-a branch A
1914 you would get an output like this:
1920 $ git rev\-list \-\-left\-right \-\-boundary \-\-pretty=oneline A\&.\&.\&.B
1922 >bbbbbbb\&.\&.\&. 3rd on b
1923 >bbbbbbb\&.\&.\&. 2nd on b
1924 <aaaaaaa\&.\&.\&. 3rd on a
1925 <aaaaaaa\&.\&.\&. 2nd on a
1926 \-yyyyyyy\&.\&.\&. 1st on b
1927 \-xxxxxxx\&.\&.\&. 1st on a
1936 Draw a text\-based graphical representation of the commit history on the left hand side of the output\&. This may cause extra lines to be printed in between commits, in order for the graph history to be drawn properly\&. Cannot be combined with
1937 \fB\-\-no\-walk\fR\&.
1939 This enables parent rewriting, see
1940 \fIHistory Simplification\fR
1944 \fB\-\-topo\-order\fR
1945 option by default, but the
1946 \fB\-\-date\-order\fR
1947 option may also be specified\&.
1950 \-\-show\-linear\-break[=<barrier>]
1952 When \-\-graph is not used, all history branches are flattened which can make it hard to see that the two consecutive commits do not belong to a linear branch\&. This option puts a barrier in between them in that case\&. If
1954 is specified, it is the string that will be shown instead of the default one\&.
1959 Print a number stating how many commits would have been listed, and suppress all other output\&. When used together with
1960 \fB\-\-left\-right\fR, instead print the counts for left and right commits, separated by a tab\&. When used together with
1961 \fB\-\-cherry\-mark\fR, omit patch equivalent commits from these counts and print the count for equivalent commits separated by a tab\&.
1963 .SH "PRETTY FORMATS"
1965 If the commit is a merge, and if the pretty\-format is not \fIoneline\fR, \fIemail\fR or \fIraw\fR, an additional line is inserted before the \fIAuthor:\fR line\&. This line begins with "Merge: " and the hashes of ancestral commits are printed, separated by spaces\&. Note that the listed commits may not necessarily be the list of the \fBdirect\fR parent commits if you have limited your view of history: for example, if you are only interested in changes related to a certain directory or file\&.
1967 There are several built\-in formats, and you can define additional formats by setting a pretty\&.<name> config option to either another format name, or a \fIformat:\fR string, as described below (see \fBgit-config\fR(1))\&. Here are the details of the built\-in formats:
1971 \h'-04'\(bu\h'+03'\c
1983 <hash> <title\-line>
1989 This is designed to be as compact as possible\&.
1994 \h'-04'\(bu\h'+03'\c
2026 \h'-04'\(bu\h'+03'\c
2040 Date: <author\-date>
2060 <full\-commit\-message>
2069 \h'-04'\(bu\h'+03'\c
2103 <full\-commit\-message>
2112 \h'-04'\(bu\h'+03'\c
2126 AuthorDate: <author\-date>
2128 CommitDate: <committer\-date>
2148 <full\-commit\-message>
2157 \h'-04'\(bu\h'+03'\c
2169 <abbrev\-hash> (<title\-line>, <short\-author\-date>)
2175 This format is used to refer to another commit in a commit message and is the same as
2176 \fB\-\-pretty=\fR\*(Aqformat:%C(\fBauto\fR)%h (%s, %ad)\*(Aq\&. By default, the date is formatted with
2177 \fB\-\-date=short\fR
2180 option is explicitly specified\&. As with any
2182 with format placeholders, its output is not affected by other options like
2185 \fB\-\-walk\-reflogs\fR\&.
2190 \h'-04'\(bu\h'+03'\c
2204 Date: <author\-date>
2205 Subject: [PATCH] <title\-line>
2215 <full\-commit\-message>
2224 \h'-04'\(bu\h'+03'\c
2233 \fIemail\fR, but lines in the commit message starting with "From " (preceded by zero or more ">") are quoted with ">" so they aren\(cqt confused as starting a new commit\&.
2238 \h'-04'\(bu\h'+03'\c
2248 format shows the entire commit exactly as stored in the commit object\&. Notably, the hashes are displayed in full, regardless of whether \-\-abbrev or \-\-no\-abbrev are used, and
2250 information show the true parent commits, without taking grafts or history simplification into account\&. Note that this format affects the way commits are displayed, but not the way the diff is shown e\&.g\&. with
2253 \fB\-\-raw\fR\&. To get full object names in a raw diff format, use
2254 \fB\-\-no\-abbrev\fR\&.
2259 \h'-04'\(bu\h'+03'\c
2265 \fIformat:<format\-string>\fR
2268 \fIformat:<format\-string>\fR
2269 format allows you to specify which information you want to show\&. It works a little bit like printf format, with the notable exception that you get a newline with
2275 \fIformat:"The author of %h was %an, %ar%nThe title was >>%s<<%n"\fR
2276 would show something like this:
2282 The author of fe6e0ee was Junio C Hamano, 23 hours ago
2283 The title was >>t4119: test autocomputing \-p<n> for traditional diff input\&.<<
2289 The placeholders are:
2293 \h'-04'\(bu\h'+03'\c
2299 Placeholders that expand to a single literal character:
2315 followed by two hexadecimal digits is replaced with a byte with the hexadecimal digits\*(Aq value (we will call this "literal formatting code" in the rest of this document)\&.
2321 \h'-04'\(bu\h'+03'\c
2327 Placeholders that affect formatting of later placeholders:
2336 switch color to green
2341 switch color to blue
2351 color specification, as described under Values in the "CONFIGURATION FILE" section of
2352 \fBgit-config\fR(1)\&. By default, colors are shown only when enabled for log output (by
2354 \fBcolor\&.ui\fR, or
2355 \fB\-\-color\fR, and respecting the
2357 settings of the former if we are going to a terminal)\&. %C(\fBauto,\fR\fB\&.\&.\&.\fR) is accepted as a historical synonym for the default (e\&.g\&., %C(\fBauto,red\fR))\&. Specifying %C(\fBalways,\fR\fB\&.\&.\&.\fR) will show the colors even when color is not otherwise enabled (though consider just using
2358 \fB\-\-color=always\fR
2359 to enable color for the whole output, including this format and anything else git might color)\&.
2361 alone (i\&.e\&. %C(\fBauto\fR)) will turn on auto coloring on the next placeholders until the color is switched again\&.
2366 left (<), right (>) or boundary (\fB\-\fR) mark
2369 \fI%w([<w>[,<i1>[,<i2>]]])\fR
2371 switch line wrapping, like the \-w option of
2372 \fBgit-shortlog\fR(1)\&.
2375 \fI%<( <N> [,trunc|ltrunc|mtrunc])\fR
2377 make the next placeholder take at least N column widths, padding spaces on the right if necessary\&. Optionally truncate (with ellipsis
2378 \fI\&.\&.\fR) at the left (ltrunc)
2379 \fB\&.\&.\fR\fBft\fR, the middle (mtrunc)
2380 \fBmi\fR\fB\&.\&.\fR\fBle\fR, or the end (trunc)
2381 \fBrig\&.\&.\fR, if the output is longer than N columns\&. Note 1: that truncating only works correctly with N >= 2\&. Note 2: spaces around the N and M (see below) values are optional\&. Note 3: Emojis and other wide characters will take two display columns, which may over\-run column boundaries\&. Note 4: decomposed character combining marks may be misplaced at padding boundaries\&.
2386 make the next placeholder take at least until Mth display column, padding spaces on the right if necessary\&. Use negative M values for column positions measured from the right hand edge of the terminal window\&.
2389 \fI%>( <N> )\fR, \fI%>|( <M> )\fR
2394 respectively, but padding spaces on the left
2397 \fI%>>( <N> )\fR, \fI%>>|( <M> )\fR
2402 respectively, except that if the next placeholder takes more spaces than given and there are spaces on its left, use those spaces
2405 \fI%><( <N> )\fR, \fI%><|( <M> )\fR
2410 respectively, but padding both sides (i\&.e\&. the text is centered)
2416 \h'-04'\(bu\h'+03'\c
2422 Placeholders that expand to information extracted from the commit:
2431 abbreviated commit hash
2441 abbreviated tree hash
2451 abbreviated parent hashes
2461 author name (respecting \&.mailmap, see
2462 \fBgit-shortlog\fR(1)
2474 author email (respecting \&.mailmap, see
2475 \fBgit-shortlog\fR(1)
2482 author email local\-part (the part before the
2489 author local\-part (see
2490 \fI%al\fR) respecting \&.mailmap, see
2491 \fBgit-shortlog\fR(1)
2498 author date (format respects \-\-date= option)
2503 author date, RFC2822 style
2508 author date, relative
2513 author date, UNIX timestamp
2518 author date, ISO 8601\-like format
2523 author date, strict ISO 8601 format
2528 author date, short format (\fBYYYY\-MM\-DD\fR)
2533 author date, human style (like the
2534 \fB\-\-date=human\fR
2536 \fBgit-rev-list\fR(1))
2546 committer name (respecting \&.mailmap, see
2547 \fBgit-shortlog\fR(1)
2559 committer email (respecting \&.mailmap, see
2560 \fBgit-shortlog\fR(1)
2567 committer email local\-part (the part before the
2574 committer local\-part (see
2575 \fI%cl\fR) respecting \&.mailmap, see
2576 \fBgit-shortlog\fR(1)
2583 committer date (format respects \-\-date= option)
2588 committer date, RFC2822 style
2593 committer date, relative
2598 committer date, UNIX timestamp
2603 committer date, ISO 8601\-like format
2608 committer date, strict ISO 8601 format
2613 committer date, short format (\fBYYYY\-MM\-DD\fR)
2618 committer date, human style (like the
2619 \fB\-\-date=human\fR
2621 \fBgit-rev-list\fR(1))
2626 ref names, like the \-\-decorate option of
2632 ref names without the " (", ")" wrapping\&.
2635 \fI%(decorate[:<options>])\fR
2637 ref names with custom decorations\&. The
2639 string may be followed by a colon and zero or more comma\-separated options\&. Option values may contain literal formatting codes\&. These must be used for commas (%x2C) and closing parentheses (%x29), due to their role in the option syntax\&.
2643 \h'-04'\(bu\h'+03'\c
2649 \fIprefix=<value>\fR: Shown before the list of ref names\&. Defaults to "\ \&("\&.
2654 \h'-04'\(bu\h'+03'\c
2660 \fIsuffix=<value>\fR: Shown after the list of ref names\&. Defaults to ")"\&.
2665 \h'-04'\(bu\h'+03'\c
2671 \fIseparator=<value>\fR: Shown between ref names\&. Defaults to "\fB,\fR\ \&"\&.
2676 \h'-04'\(bu\h'+03'\c
2682 \fIpointer=<value>\fR: Shown between HEAD and the branch it points to, if any\&. Defaults to "\ \&\fB\-\fR>\ \&"\&.
2687 \h'-04'\(bu\h'+03'\c
2693 \fItag=<value>\fR: Shown before tag names\&. Defaults to "\fBtag:\fR\ \&"\&.
2698 For example, to produce decorations with no wrapping or tag annotations, and spaces as separators:
2700 + %(\fBdecorate:prefix=,suffix=,tag=,separator=\fR
2703 \fI%(describe[:<options>])\fR
2705 human\-readable name, like
2706 \fBgit-describe\fR(1); empty string for undescribable commits\&. The
2708 string may be followed by a colon and zero or more comma\-separated options\&. Descriptions can be inconsistent when tags are added or removed at the same time\&.
2712 \h'-04'\(bu\h'+03'\c
2718 \fItags[=<bool\-value>]\fR: Instead of only considering annotated tags, consider lightweight tags as well\&.
2723 \h'-04'\(bu\h'+03'\c
2729 \fIabbrev=<number>\fR: Instead of using the default number of hexadecimal digits (which will vary according to the number of objects in the repository with a default of 7) of the abbreviated object name, use <number> digits, or as many digits as needed to form a unique object name\&.
2734 \h'-04'\(bu\h'+03'\c
2740 \fImatch=<pattern>\fR: Only consider tags matching the given
2741 \fBglob\fR(\fB7\fR) pattern, excluding the "refs/tags/" prefix\&.
2746 \h'-04'\(bu\h'+03'\c
2752 \fIexclude=<pattern>\fR: Do not consider tags matching the given
2753 \fBglob\fR(\fB7\fR) pattern, excluding the "refs/tags/" prefix\&.
2759 ref name given on the command line by which the commit was reached (like
2762 \fB\-\-source\fR), only works with
2779 sanitized subject line, suitable for a filename
2789 raw body (unwrapped subject and body)
2794 raw verification message from GPG for a signed commit
2799 show "G" for a good (valid) signature, "B" for a bad signature, "U" for a good signature with unknown validity, "X" for a good signature that has expired, "Y" for a good signature made by an expired key, "R" for a good signature made by a revoked key, "E" if the signature cannot be checked (e\&.g\&. missing key) and "N" for no signature
2804 show the name of the signer for a signed commit
2809 show the key used to sign a signed commit
2814 show the fingerprint of the key used to sign a signed commit
2819 show the fingerprint of the primary key whose subkey was used to sign a signed commit
2824 show the trust level for the key used to sign a signed commit
2829 reflog selector, e\&.g\&.,
2830 \fBrefs/stash@\fR{1} or
2833 \fBago\fR}; the format follows the rules described for the
2835 option\&. The portion before the
2837 is the refname as given on the command line (so
2841 \fBrefs/heads/master\fR
2843 \fBrefs/heads/master@\fR{0})\&.
2848 shortened reflog selector; same as %gD, but the refname portion is shortened for human readability (so
2849 \fBrefs/heads/master\fR
2856 reflog identity name
2861 reflog identity name (respecting \&.mailmap, see
2862 \fBgit-shortlog\fR(1)
2869 reflog identity email
2874 reflog identity email (respecting \&.mailmap, see
2875 \fBgit-shortlog\fR(1)
2885 \fI%(trailers[:<options>])\fR
2887 display the trailers of the body as interpreted by
2888 \fBgit-interpret-trailers\fR(1)\&. The
2890 string may be followed by a colon and zero or more comma\-separated options\&. If any option is provided multiple times, the last occurrence wins\&.
2894 \h'-04'\(bu\h'+03'\c
2900 \fIkey=<key>\fR: only show trailers with specified <key>\&. Matching is done case\-insensitively and trailing colon is optional\&. If option is given multiple times trailer lines matching any of the keys are shown\&. This option automatically enables the
2902 option so that non\-trailer lines in the trailer block are hidden\&. If that is not desired it can be disabled with
2903 \fBonly=false\fR\&. E\&.g\&., %(\fBtrailers:key=Reviewed\-by\fR) shows trailer lines with key
2904 \fBReviewed\-by\fR\&.
2909 \h'-04'\(bu\h'+03'\c
2915 \fIonly[=<bool>]\fR: select whether non\-trailer lines from the trailer block should be included\&.
2920 \h'-04'\(bu\h'+03'\c
2926 \fIseparator=<sep>\fR: specify the separator inserted between trailer lines\&. Defaults to a line feed character\&. The string <sep> may contain the literal formatting codes described above\&. To use comma as separator one must use %x2C as it would otherwise be parsed as next option\&. E\&.g\&., %(\fBtrailers:key=Ticket,separator=\fR%x2C ) shows all trailer lines whose key is "Ticket" separated by a comma and a space\&.
2931 \h'-04'\(bu\h'+03'\c
2937 \fIunfold[=<bool>]\fR: make it behave as if interpret\-trailer\(cqs
2939 option was given\&. E\&.g\&., %(\fBtrailers:only,unfold=true\fR) unfolds and shows all trailer lines\&.
2944 \h'-04'\(bu\h'+03'\c
2950 \fIkeyonly[=<bool>]\fR: only show the key part of the trailer\&.
2955 \h'-04'\(bu\h'+03'\c
2961 \fIvalueonly[=<bool>]\fR: only show the value part of the trailer\&.
2966 \h'-04'\(bu\h'+03'\c
2972 \fIkey_value_separator=<sep>\fR: specify the separator inserted between the key and value of each trailer\&. Defaults to ": "\&. Otherwise it shares the same semantics as
2973 \fIseparator=<sep>\fR
2983 .nr an-no-space-flag 1
2991 Some placeholders may depend on other options given to the revision traversal engine\&. For example, the %g* reflog options will insert an empty string unless we are traversing reflog entries (e\&.g\&., by \fBgit\fR \fBlog\fR \fB\-g\fR)\&. The %d and %D placeholders will use the "short" decoration format if \fB\-\-decorate\fR was not already provided on the command line\&.
2995 The boolean options accept an optional value [\fB=\fR\fI<bool\-value>\fR]\&. The values \fBtrue\fR, \fBfalse\fR, \fBon\fR, \fBoff\fR etc\&. are all accepted\&. See the "boolean" sub\-section in "EXAMPLES" in \fBgit-config\fR(1)\&. If a boolean option is given with no value, it\(cqs enabled\&.
2997 If you add a \fB+\fR (plus sign) after \fI%\fR of a placeholder, a line\-feed is inserted immediately before the expansion if and only if the placeholder expands to a non\-empty string\&.
2999 If you add a \fB\-\fR (minus sign) after \fI%\fR of a placeholder, all consecutive line\-feeds immediately preceding the expansion are deleted if and only if the placeholder expands to an empty string\&.
3001 If you add a ` ` (space) after \fI%\fR of a placeholder, a space is inserted immediately before the expansion if and only if the placeholder expands to a non\-empty string\&.
3005 \h'-04'\(bu\h'+03'\c
3015 format works exactly like
3016 \fIformat:\fR, except that it provides "terminator" semantics instead of "separator" semantics\&. In other words, each commit has the message terminator character (usually a newline) appended, rather than a separator placed between entries\&. This means that the final entry of a single\-line format will be properly terminated with a new line, just as the "oneline" format does\&. For example:
3022 $ git log \-2 \-\-pretty=format:%h 4da45bef \e
3023 | perl \-pe \*(Aq$_ \&.= " \-\- NO NEWLINE\en" unless /\en/\*(Aq
3025 7134973 \-\- NO NEWLINE
3027 $ git log \-2 \-\-pretty=tformat:%h 4da45bef \e
3028 | perl \-pe \*(Aq$_ \&.= " \-\- NO NEWLINE\en" unless /\en/\*(Aq
3036 In addition, any unrecognized string that has a % in it is interpreted as if it has
3038 in front of it\&. For example, these two are equivalent:
3044 $ git log \-2 \-\-pretty=tformat:%h 4da45bef
3045 $ git log \-2 \-\-pretty=%h 4da45bef
3055 \h'-04'\(bu\h'+03'\c
3061 Print the list of commits reachable from the current branch\&.
3076 \h'-04'\(bu\h'+03'\c
3082 Print the list of commits on this branch, but not present in the upstream branch\&.
3088 git rev\-list @{upstream}\&.\&.HEAD
3097 \h'-04'\(bu\h'+03'\c
3103 Format commits with their author and commit message (see also the porcelain
3104 \fBgit-log\fR(1))\&.
3110 git rev\-list \-\-format=medium HEAD
3119 \h'-04'\(bu\h'+03'\c
3125 Format commits along with their diffs (see also the porcelain
3126 \fBgit-log\fR(1), which can do this in a single process)\&.
3132 git rev\-list HEAD |
3133 git diff\-tree \-\-stdin \-\-format=medium \-p
3142 \h'-04'\(bu\h'+03'\c
3148 Print the list of commits on the current branch that touched any file in the
3156 git rev\-list HEAD \-\- Documentation/
3165 \h'-04'\(bu\h'+03'\c
3171 Print the list of commits authored by you in the past year, on any branch, tag, or other ref\&.
3177 git rev\-list \-\-author=you@example\&.com \-\-since=1\&.year\&.ago \-\-all
3186 \h'-04'\(bu\h'+03'\c
3192 Print the list of objects reachable from the current branch (i\&.e\&., all commits and the blobs and trees they contain)\&.
3198 git rev\-list \-\-objects HEAD
3207 \h'-04'\(bu\h'+03'\c
3213 Compare the disk size of all reachable objects, versus those reachable from reflogs, versus the total packed size\&. This can tell you whether running
3217 might reduce the repository size (by dropping unreachable objects), and whether expiring reflogs might help\&.
3224 git rev\-list \-\-disk\-usage \-\-objects \-\-all
3226 git rev\-list \-\-disk\-usage \-\-objects \-\-all \-\-reflog
3227 # total disk size used
3228 du \-c \&.git/objects/pack/*\&.pack \&.git/objects/??/*
3229 # alternative to du: add up "size" and "size\-pack" fields
3230 git count\-objects \-v
3239 \h'-04'\(bu\h'+03'\c
3245 Report the disk size of each branch, not including objects used by the current branch\&. This can find outliers that are contributing to a bloated repository size (e\&.g\&., because somebody accidentally committed large build artifacts)\&.
3251 git for\-each\-ref \-\-format=\*(Aq%(refname)\*(Aq |
3254 size=$(git rev\-list \-\-disk\-usage \-\-objects HEAD\&.\&.$branch)
3255 echo "$size $branch"
3266 \h'-04'\(bu\h'+03'\c
3272 Compare the on\-disk size of branches in one group of refs, excluding another\&. If you co\-mingle objects from multiple remotes in a single repository, this can show which remotes are contributing to the repository size (taking the size of
3280 git rev\-list \-\-disk\-usage \-\-objects \-\-remotes=$suspect \-\-not \-\-remotes=origin
3288 Part of the \fBgit\fR(1) suite