Autogenerated manpages for v2.43.0-76-g1a87c
[git-manpages.git] / man1 / git-rev-list.1
blob43c914ba5195ddfe4f5260d6e260e14fbd8729bd
1 '\" t
2 .\"     Title: git-rev-list
3 .\"    Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author]
4 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
5 .\"      Date: 2023-12-09
6 .\"    Manual: Git Manual
7 .\"    Source: Git 2.43.0.76.g1a87c842ec
8 .\"  Language: English
9 .\"
10 .TH "GIT\-REV\-LIST" "1" "2023\-12\-09" "Git 2\&.43\&.0\&.76\&.g1a87c84" "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 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18 .ie \n(.g .ds Aq \(aq
19 .el       .ds Aq '
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
24 .nh
25 .\" disable justification (adjust text to left margin only)
26 .ad l
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
30 .SH "NAME"
31 git-rev-list \- Lists commit objects in reverse chronological order
32 .SH "SYNOPSIS"
33 .sp
34 .nf
35 \fIgit rev\-list\fR [<options>] <commit>\&... [\-\-] [<path>\&...]
36 .fi
37 .sp
38 .SH "DESCRIPTION"
39 .sp
40 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 .sp
42 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 .sp
44 Thus, the following command:
45 .sp
46 .if n \{\
47 .RS 4
48 .\}
49 .nf
50 $ git rev\-list foo bar ^baz
51 .fi
52 .if n \{\
53 .RE
54 .\}
55 .sp
56 .sp
57 means "list all the commits which are reachable from \fIfoo\fR or \fIbar\fR, but not from \fIbaz\fR"\&.
58 .sp
59 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:
60 .sp
61 .if n \{\
62 .RS 4
63 .\}
64 .nf
65 $ git rev\-list origin\&.\&.HEAD
66 $ git rev\-list HEAD ^origin
67 .fi
68 .if n \{\
69 .RE
70 .\}
71 .sp
72 .sp
73 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:
74 .sp
75 .if n \{\
76 .RS 4
77 .\}
78 .nf
79 $ git rev\-list A B \-\-not $(git merge\-base \-\-all A B)
80 $ git rev\-list A\&.\&.\&.B
81 .fi
82 .if n \{\
83 .RE
84 .\}
85 .sp
86 .sp
87 \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\&.
88 .SH "OPTIONS"
89 .SS "Commit Limiting"
90 .sp
91 Besides specifying a range of commits that should be listed using the special notations explained in the description, additional commit limiting may be applied\&.
92 .sp
93 Using more options generally further limits the output (e\&.g\&. \fB\-\-since=<date1>\fR limits to commits newer than \fB<date1>\fR, and using it with \fB\-\-grep=<pattern>\fR further limits to commits whose log message has a line that matches \fB<pattern>\fR), unless otherwise noted\&.
94 .sp
95 Note that these are applied before commit ordering and formatting options, such as \fB\-\-reverse\fR\&.
96 .PP
97 \-<number>, \-n <number>, \-\-max\-count=<number>
98 .RS 4
99 Limit the number of commits to output\&.
102 \-\-skip=<number>
103 .RS 4
104 Skip
105 \fInumber\fR
106 commits before starting to show the commit output\&.
109 \-\-since=<date>, \-\-after=<date>
110 .RS 4
111 Show commits more recent than a specific date\&.
114 \-\-since\-as\-filter=<date>
115 .RS 4
116 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\&.
119 \-\-until=<date>, \-\-before=<date>
120 .RS 4
121 Show commits older than a specific date\&.
124 \-\-max\-age=<timestamp>, \-\-min\-age=<timestamp>
125 .RS 4
126 Limit the commits output to specified time range\&.
129 \-\-author=<pattern>, \-\-committer=<pattern>
130 .RS 4
131 Limit the commits output to ones with author/committer header lines that match the specified pattern (regular expression)\&. With more than one
132 \fB\-\-author=<pattern>\fR, commits whose author matches any of the given patterns are chosen (similarly for multiple
133 \fB\-\-committer=<pattern>\fR)\&.
136 \-\-grep\-reflog=<pattern>
137 .RS 4
138 Limit the commits output to ones with reflog entries that match the specified pattern (regular expression)\&. With more than one
139 \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
140 \fB\-\-walk\-reflogs\fR
141 is in use\&.
144 \-\-grep=<pattern>
145 .RS 4
146 Limit the commits output to ones with a log message that matches the specified pattern (regular expression)\&. With more than one
147 \fB\-\-grep=<pattern>\fR, commits whose message matches any of the given patterns are chosen (but see
148 \fB\-\-all\-match\fR)\&.
151 \-\-all\-match
152 .RS 4
153 Limit the commits output to ones that match all given
154 \fB\-\-grep\fR, instead of ones that match at least one\&.
157 \-\-invert\-grep
158 .RS 4
159 Limit the commits output to ones with a log message that do not match the pattern specified with
160 \fB\-\-grep=<pattern>\fR\&.
163 \-i, \-\-regexp\-ignore\-case
164 .RS 4
165 Match the regular expression limiting patterns without regard to letter case\&.
168 \-\-basic\-regexp
169 .RS 4
170 Consider the limiting patterns to be basic regular expressions; this is the default\&.
173 \-E, \-\-extended\-regexp
174 .RS 4
175 Consider the limiting patterns to be extended regular expressions instead of the default basic regular expressions\&.
178 \-F, \-\-fixed\-strings
179 .RS 4
180 Consider the limiting patterns to be fixed strings (don\(cqt interpret pattern as a regular expression)\&.
183 \-P, \-\-perl\-regexp
184 .RS 4
185 Consider the limiting patterns to be Perl\-compatible regular expressions\&.
187 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\&.
190 \-\-remove\-empty
191 .RS 4
192 Stop when a given path disappears from the tree\&.
195 \-\-merges
196 .RS 4
197 Print only merge commits\&. This is exactly the same as
198 \fB\-\-min\-parents=2\fR\&.
201 \-\-no\-merges
202 .RS 4
203 Do not print commits with more than one parent\&. This is exactly the same as
204 \fB\-\-max\-parents=1\fR\&.
207 \-\-min\-parents=<number>, \-\-max\-parents=<number>, \-\-no\-min\-parents, \-\-no\-max\-parents
208 .RS 4
209 Show only commits which have at least (or at most) that many parent commits\&. In particular,
210 \fB\-\-max\-parents=1\fR
211 is the same as
212 \fB\-\-no\-merges\fR,
213 \fB\-\-min\-parents=2\fR
214 is the same as
215 \fB\-\-merges\fR\&.
216 \fB\-\-max\-parents=0\fR
217 gives all root commits and
218 \fB\-\-min\-parents=3\fR
219 all octopus merges\&.
221 \fB\-\-no\-min\-parents\fR
223 \fB\-\-no\-max\-parents\fR
224 reset these limits (to no limit) again\&. Equivalent forms are
225 \fB\-\-min\-parents=0\fR
226 (any commit has 0 or more parents) and
227 \fB\-\-max\-parents=\-1\fR
228 (negative numbers denote no upper limit)\&.
231 \-\-first\-parent
232 .RS 4
233 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\&.
236 \-\-exclude\-first\-parent\-only
237 .RS 4
238 When finding commits to exclude (with a
239 \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\&.
242 \-\-not
243 .RS 4
244 Reverses the meaning of the
245 \fI^\fR
246 prefix (or lack thereof) for all following revision specifiers, up to the next
247 \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\&.
250 \-\-all
251 .RS 4
252 Pretend as if all the refs in
253 \fBrefs/\fR, along with
254 \fBHEAD\fR, are listed on the command line as
255 \fI<commit>\fR\&.
258 \-\-branches[=<pattern>]
259 .RS 4
260 Pretend as if all the refs in
261 \fBrefs/heads\fR
262 are listed on the command line as
263 \fI<commit>\fR\&. If
264 \fI<pattern>\fR
265 is given, limit branches to ones matching given shell glob\&. If pattern lacks
266 \fI?\fR,
267 \fI*\fR, or
268 \fI[\fR,
269 \fI/*\fR
270 at the end is implied\&.
273 \-\-tags[=<pattern>]
274 .RS 4
275 Pretend as if all the refs in
276 \fBrefs/tags\fR
277 are listed on the command line as
278 \fI<commit>\fR\&. If
279 \fI<pattern>\fR
280 is given, limit tags to ones matching given shell glob\&. If pattern lacks
281 \fI?\fR,
282 \fI*\fR, or
283 \fI[\fR,
284 \fI/*\fR
285 at the end is implied\&.
288 \-\-remotes[=<pattern>]
289 .RS 4
290 Pretend as if all the refs in
291 \fBrefs/remotes\fR
292 are listed on the command line as
293 \fI<commit>\fR\&. If
294 \fI<pattern>\fR
295 is given, limit remote\-tracking branches to ones matching given shell glob\&. If pattern lacks
296 \fI?\fR,
297 \fI*\fR, or
298 \fI[\fR,
299 \fI/*\fR
300 at the end is implied\&.
303 \-\-glob=<glob\-pattern>
304 .RS 4
305 Pretend as if all the refs matching shell glob
306 \fI<glob\-pattern>\fR
307 are listed on the command line as
308 \fI<commit>\fR\&. Leading
309 \fIrefs/\fR, is automatically prepended if missing\&. If pattern lacks
310 \fI?\fR,
311 \fI*\fR, or
312 \fI[\fR,
313 \fI/*\fR
314 at the end is implied\&.
317 \-\-exclude=<glob\-pattern>
318 .RS 4
319 Do not include refs matching
320 \fI<glob\-pattern>\fR
321 that the next
322 \fB\-\-all\fR,
323 \fB\-\-branches\fR,
324 \fB\-\-tags\fR,
325 \fB\-\-remotes\fR, or
326 \fB\-\-glob\fR
327 would otherwise consider\&. Repetitions of this option accumulate exclusion patterns up to the next
328 \fB\-\-all\fR,
329 \fB\-\-branches\fR,
330 \fB\-\-tags\fR,
331 \fB\-\-remotes\fR, or
332 \fB\-\-glob\fR
333 option (other options or arguments do not clear accumulated patterns)\&.
335 The patterns given should not begin with
336 \fBrefs/heads\fR,
337 \fBrefs/tags\fR, or
338 \fBrefs/remotes\fR
339 when applied to
340 \fB\-\-branches\fR,
341 \fB\-\-tags\fR, or
342 \fB\-\-remotes\fR, respectively, and they must begin with
343 \fBrefs/\fR
344 when applied to
345 \fB\-\-glob\fR
347 \fB\-\-all\fR\&. If a trailing
348 \fI/*\fR
349 is intended, it must be given explicitly\&.
352 \-\-exclude\-hidden=[fetch|receive|uploadpack]
353 .RS 4
354 Do not include refs that would be hidden by
355 \fBgit\-fetch\fR,
356 \fBgit\-receive\-pack\fR
358 \fBgit\-upload\-pack\fR
359 by consulting the appropriate
360 \fBfetch\&.hideRefs\fR,
361 \fBreceive\&.hideRefs\fR
363 \fBuploadpack\&.hideRefs\fR
364 configuration along with
365 \fBtransfer\&.hideRefs\fR
366 (see
367 \fBgit-config\fR(1))\&. This option affects the next pseudo\-ref option
368 \fB\-\-all\fR
370 \fB\-\-glob\fR
371 and is cleared after processing them\&.
374 \-\-reflog
375 .RS 4
376 Pretend as if all objects mentioned by reflogs are listed on the command line as
377 \fB<commit>\fR\&.
380 \-\-alternate\-refs
381 .RS 4
382 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
383 \fBobjects/info/alternates\fR\&. The set of included objects may be modified by
384 \fBcore\&.alternateRefsCommand\fR, etc\&. See
385 \fBgit-config\fR(1)\&.
388 \-\-single\-worktree
389 .RS 4
390 By default, all working trees will be examined by the following options when there are more than one (see
391 \fBgit-worktree\fR(1)):
392 \fB\-\-all\fR,
393 \fB\-\-reflog\fR
395 \fB\-\-indexed\-objects\fR\&. This option forces them to examine the current working tree only\&.
398 \-\-ignore\-missing
399 .RS 4
400 Upon seeing an invalid object name in the input, pretend as if the bad input was not given\&.
403 \-\-stdin
404 .RS 4
405 In addition to getting arguments from the command line, read them from standard input as well\&. This accepts commits and pseudo\-options like
406 \fB\-\-all\fR
408 \fB\-\-glob=\fR\&. When a
409 \fB\-\-\fR
410 separator is seen, the following input is treated as paths and used to limit the result\&. Flags like
411 \fB\-\-not\fR
412 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\&.
415 \-\-quiet
416 .RS 4
417 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
418 \fB/dev/null\fR
419 as the output does not have to be formatted\&.
422 \-\-disk\-usage, \-\-disk\-usage=human
423 .RS 4
424 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
425 \fBgit cat\-file \-\-batch\-check=\*(Aq%(objectsize:disk)\*(Aq\fR, except that it runs much faster (especially with
426 \fB\-\-use\-bitmap\-index\fR)\&. See the
427 \fBCAVEATS\fR
428 section in
429 \fBgit-cat-file\fR(1)
430 for the limitations of what "on\-disk storage" means\&. With the optional value
431 \fBhuman\fR, on\-disk storage size is shown in human\-readable string(e\&.g\&. 12\&.24 Kib, 3\&.50 Mib)\&.
434 \-\-cherry\-mark
435 .RS 4
436 Like
437 \fB\-\-cherry\-pick\fR
438 (see below) but mark equivalent commits with
439 \fB=\fR
440 rather than omitting them, and inequivalent ones with
441 \fB+\fR\&.
444 \-\-cherry\-pick
445 .RS 4
446 Omit any commit that introduces the same change as another commit on the \(lqother side\(rq when the set of commits are limited with symmetric difference\&.
448 For example, if you have two branches,
449 \fBA\fR
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, \(lq3rd on b\(rq may be cherry\-picked from branch A)\&. With this option, such pairs of commits are excluded from the output\&.
458 \-\-left\-only, \-\-right\-only
459 .RS 4
460 List only commits on the respective side of a symmetric difference, i\&.e\&. only those which would be marked
461 \fB<\fR
462 resp\&.
463 \fB>\fR
465 \fB\-\-left\-right\fR\&.
467 For example,
468 \fB\-\-cherry\-pick \-\-right\-only A\&.\&.\&.B\fR
469 omits those commits from
470 \fBB\fR
471 which are in
472 \fBA\fR
473 or are patch\-equivalent to a commit in
474 \fBA\fR\&. In other words, this lists the
475 \fB+\fR
476 commits from
477 \fBgit cherry A B\fR\&. More precisely,
478 \fB\-\-cherry\-pick \-\-right\-only \-\-no\-merges\fR
479 gives the exact list\&.
482 \-\-cherry
483 .RS 4
484 A synonym for
485 \fB\-\-right\-only \-\-cherry\-mark \-\-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
486 \fBgit log \-\-cherry upstream\&.\&.\&.mybranch\fR, similar to
487 \fBgit cherry upstream mybranch\fR\&.
490 \-g, \-\-walk\-reflogs
491 .RS 4
492 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,
493 \fI^commit\fR,
494 \fIcommit1\&.\&.commit2\fR, and
495 \fIcommit1\&.\&.\&.commit2\fR
496 notations cannot be used)\&.
498 With
499 \fB\-\-pretty\fR
500 format other than
501 \fBoneline\fR
503 \fBreference\fR
504 (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
505 \fBref@{Nth}\fR
506 (where
507 \fBNth\fR
508 is the reverse\-chronological index in the reflog) or as
509 \fBref@{timestamp}\fR
510 (with the timestamp for that entry), depending on a few rules:
512 .RS 4
513 .ie n \{\
514 \h'-04' 1.\h'+01'\c
516 .el \{\
517 .sp -1
518 .IP "  1." 4.2
520 If the starting point is specified as
521 \fBref@{Nth}\fR, show the index format\&.
524 .RS 4
525 .ie n \{\
526 \h'-04' 2.\h'+01'\c
528 .el \{\
529 .sp -1
530 .IP "  2." 4.2
532 If the starting point was specified as
533 \fBref@{now}\fR, show the timestamp format\&.
536 .RS 4
537 .ie n \{\
538 \h'-04' 3.\h'+01'\c
540 .el \{\
541 .sp -1
542 .IP "  3." 4.2
544 If neither was used, but
545 \fB\-\-date\fR
546 was given on the command line, show the timestamp in the format requested by
547 \fB\-\-date\fR\&.
550 .RS 4
551 .ie n \{\
552 \h'-04' 4.\h'+01'\c
554 .el \{\
555 .sp -1
556 .IP "  4." 4.2
558 Otherwise, show the index format\&.
561 Under
562 \fB\-\-pretty=oneline\fR, the commit message is prefixed with this information on the same line\&. This option cannot be combined with
563 \fB\-\-reverse\fR\&. See also
564 \fBgit-reflog\fR(1)\&.
566 Under
567 \fB\-\-pretty=reference\fR, this information will not be shown at all\&.
570 \-\-merge
571 .RS 4
572 After a failed merge, show refs that touch files having a conflict and don\(cqt exist on all heads to merge\&.
575 \-\-boundary
576 .RS 4
577 Output excluded boundary commits\&. Boundary commits are prefixed with
578 \fB\-\fR\&.
581 \-\-use\-bitmap\-index
582 .RS 4
583 Try to speed up the traversal using the pack bitmap index (if one is available)\&. Note that when traversing with
584 \fB\-\-objects\fR, trees and blobs will not have their associated path printed\&.
587 \-\-progress=<header>
588 .RS 4
589 Show progress reports on stderr as objects are considered\&. The
590 \fB<header>\fR
591 text will be printed with each progress update\&.
593 .SS "History Simplification"
595 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\&.
597 The following options select the commits to be shown:
599 <paths>
600 .RS 4
601 Commits modifying the given <paths> are selected\&.
604 \-\-simplify\-by\-decoration
605 .RS 4
606 Commits that are referred by some branch or tag are selected\&.
609 Note that extra commits can be shown to give a meaningful history\&.
611 The following options affect the way the simplification is performed:
613 Default mode
614 .RS 4
615 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)
618 \-\-show\-pulls
619 .RS 4
620 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\&.
623 \-\-full\-history
624 .RS 4
625 Same as the default mode, but does not prune some history\&.
628 \-\-dense
629 .RS 4
630 Only the selected commits are shown, plus some to have a meaningful history\&.
633 \-\-sparse
634 .RS 4
635 All commits in the simplified history are shown\&.
638 \-\-simplify\-merges
639 .RS 4
640 Additional option to
641 \fB\-\-full\-history\fR
642 to remove some needless merges from the resulting history, as there are no selected commits contributing to this merge\&.
645 \-\-ancestry\-path[=<commit>]
646 .RS 4
647 When given a range of commits to display (e\&.g\&.
648 \fIcommit1\&.\&.commit2\fR
650 \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
651 \fIcommit1\fR
652 (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\&.
655 A more detailed explanation follows\&.
657 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\&.)
659 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:
661 .if n \{\
662 .RS 4
665           \&.\-A\-\-\-M\-\-\-N\-\-\-O\-\-\-P\-\-\-Q
666          /     /   /   /   /   /
667         I     B   C   D   E   Y
668          \e   /   /   /   /   /
669           `\-\-\-\-\-\-\-\-\-\-\-\-\-\*(Aq   X
671 .if n \{\
676 The horizontal line of history A\-\-\-Q is taken to be the first parent of each merge\&. The commits are:
678 .RS 4
679 .ie n \{\
680 \h'-04'\(bu\h'+03'\c
682 .el \{\
683 .sp -1
684 .IP \(bu 2.3
686 \fBI\fR
687 is the initial commit, in which
688 \fBfoo\fR
689 exists with contents \(lqasdf\(rq, and a file
690 \fBquux\fR
691 exists with contents \(lqquux\(rq\&. Initial commits are compared to an empty tree, so
692 \fBI\fR
693 is !TREESAME\&.
696 .RS 4
697 .ie n \{\
698 \h'-04'\(bu\h'+03'\c
700 .el \{\
701 .sp -1
702 .IP \(bu 2.3
705 \fBA\fR,
706 \fBfoo\fR
707 contains just \(lqfoo\(rq\&.
710 .RS 4
711 .ie n \{\
712 \h'-04'\(bu\h'+03'\c
714 .el \{\
715 .sp -1
716 .IP \(bu 2.3
718 \fBB\fR
719 contains the same change as
720 \fBA\fR\&. Its merge
721 \fBM\fR
722 is trivial and hence TREESAME to all parents\&.
725 .RS 4
726 .ie n \{\
727 \h'-04'\(bu\h'+03'\c
729 .el \{\
730 .sp -1
731 .IP \(bu 2.3
733 \fBC\fR
734 does not change
735 \fBfoo\fR, but its merge
736 \fBN\fR
737 changes it to \(lqfoobar\(rq, so it is not TREESAME to any parent\&.
740 .RS 4
741 .ie n \{\
742 \h'-04'\(bu\h'+03'\c
744 .el \{\
745 .sp -1
746 .IP \(bu 2.3
748 \fBD\fR
749 sets
750 \fBfoo\fR
751 to \(lqbaz\(rq\&. Its merge
752 \fBO\fR
753 combines the strings from
754 \fBN\fR
756 \fBD\fR
757 to \(lqfoobarbaz\(rq; i\&.e\&., it is not TREESAME to any parent\&.
760 .RS 4
761 .ie n \{\
762 \h'-04'\(bu\h'+03'\c
764 .el \{\
765 .sp -1
766 .IP \(bu 2.3
768 \fBE\fR
769 changes
770 \fBquux\fR
771 to \(lqxyzzy\(rq, and its merge
772 \fBP\fR
773 combines the strings to \(lqquux xyzzy\(rq\&.
774 \fBP\fR
775 is TREESAME to
776 \fBO\fR, but not to
777 \fBE\fR\&.
780 .RS 4
781 .ie n \{\
782 \h'-04'\(bu\h'+03'\c
784 .el \{\
785 .sp -1
786 .IP \(bu 2.3
788 \fBX\fR
789 is an independent root commit that added a new file
790 \fBside\fR, and
791 \fBY\fR
792 modified it\&.
793 \fBY\fR
794 is TREESAME to
795 \fBX\fR\&. Its merge
796 \fBQ\fR
797 added
798 \fBside\fR
800 \fBP\fR, and
801 \fBQ\fR
802 is TREESAME to
803 \fBP\fR, but not to
804 \fBY\fR\&.
807 \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\&.
809 Default mode
810 .RS 4
811 Commits are included if they are not TREESAME to any parent (though this can be changed, see
812 \fB\-\-sparse\fR
813 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\&.
815 This results in:
817 .if n \{\
818 .RS 4
821           \&.\-A\-\-\-N\-\-\-O
822          /     /   /
823         I\-\-\-\-\-\-\-\-\-D
825 .if n \{\
829 Note how the rule to only follow the TREESAME parent, if one is available, removed
830 \fBB\fR
831 from consideration entirely\&.
832 \fBC\fR
833 was considered via
834 \fBN\fR, but is TREESAME\&. Root commits are compared to an empty tree, so
835 \fBI\fR
836 is !TREESAME\&.
838 Parent/child relations are only visible with
839 \fB\-\-parents\fR, but that does not affect the commits selected in default mode, so we have shown the parent lines\&.
842 \-\-full\-history without parent rewriting
843 .RS 4
844 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
846 .if n \{\
847 .RS 4
850         I  A  B  N  D  O  P  Q
852 .if n \{\
856 \fBM\fR
857 was excluded because it is TREESAME to both parents\&.
858 \fBE\fR,
859 \fBC\fR
861 \fBB\fR
862 were all walked, but only
863 \fBB\fR
864 was !TREESAME, so the others do not appear\&.
866 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\&.
869 \-\-full\-history with parent rewriting
870 .RS 4
871 Ordinary commits are only included if they are !TREESAME (though this can be changed, see
872 \fB\-\-sparse\fR
873 below)\&.
875 Merges are always included\&. However, their parent list is rewritten: Along each parent, prune away commits that are not included themselves\&. This results in
877 .if n \{\
878 .RS 4
881           \&.\-A\-\-\-M\-\-\-N\-\-\-O\-\-\-P\-\-\-Q
882          /     /   /   /   /
883         I     B   /   D   /
884          \e   /   /   /   /
885           `\-\-\-\-\-\-\-\-\-\-\-\-\-\*(Aq
887 .if n \{\
891 Compare to
892 \fB\-\-full\-history\fR
893 without rewriting above\&. Note that
894 \fBE\fR
895 was pruned away because it is TREESAME, but the parent list of P was rewritten to contain
896 \fBE\fR\*(Aqs parent
897 \fBI\fR\&. The same happened for
898 \fBC\fR
900 \fBN\fR, and
901 \fBX\fR,
902 \fBY\fR
904 \fBQ\fR\&.
907 In addition to the above settings, you can change whether TREESAME affects inclusion:
909 \-\-dense
910 .RS 4
911 Commits that are walked are included if they are not TREESAME to any parent\&.
914 \-\-sparse
915 .RS 4
916 All commits that are walked are included\&.
918 Note that without
919 \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\&.
922 \-\-simplify\-merges
923 .RS 4
924 First, build a history graph in the same way that
925 \fB\-\-full\-history\fR
926 with parent rewriting does (see above)\&.
928 Then simplify each commit
929 \fBC\fR
930 to its replacement
931 \fBC\*(Aq\fR
932 in the final history according to the following rules:
934 .RS 4
935 .ie n \{\
936 \h'-04'\(bu\h'+03'\c
938 .el \{\
939 .sp -1
940 .IP \(bu 2.3
943 \fBC\*(Aq\fR
945 \fBC\fR\&.
948 .RS 4
949 .ie n \{\
950 \h'-04'\(bu\h'+03'\c
952 .el \{\
953 .sp -1
954 .IP \(bu 2.3
956 Replace each parent
957 \fBP\fR
959 \fBC\*(Aq\fR
960 with its simplification
961 \fBP\*(Aq\fR\&. 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\&.
964 .RS 4
965 .ie n \{\
966 \h'-04'\(bu\h'+03'\c
968 .el \{\
969 .sp -1
970 .IP \(bu 2.3
972 If after this parent rewriting,
973 \fBC\*(Aq\fR
974 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\&.
977 The effect of this is best shown by way of comparing to
978 \fB\-\-full\-history\fR
979 with parent rewriting\&. The example turns into:
981 .if n \{\
982 .RS 4
985           \&.\-A\-\-\-M\-\-\-N\-\-\-O
986          /     /       /
987         I     B       D
988          \e   /       /
989           `\-\-\-\-\-\-\-\-\-\*(Aq
991 .if n \{\
995 Note the major differences in
996 \fBN\fR,
997 \fBP\fR, and
998 \fBQ\fR
999 over
1000 \fB\-\-full\-history\fR:
1002 .RS 4
1003 .ie n \{\
1004 \h'-04'\(bu\h'+03'\c
1006 .el \{\
1007 .sp -1
1008 .IP \(bu 2.3
1010 \fBN\fR\*(Aqs parent list had
1011 \fBI\fR
1012 removed, because it is an ancestor of the other parent
1013 \fBM\fR\&. Still,
1014 \fBN\fR
1015 remained because it is !TREESAME\&.
1018 .RS 4
1019 .ie n \{\
1020 \h'-04'\(bu\h'+03'\c
1022 .el \{\
1023 .sp -1
1024 .IP \(bu 2.3
1026 \fBP\fR\*(Aqs parent list similarly had
1027 \fBI\fR
1028 removed\&.
1029 \fBP\fR
1030 was then removed completely, because it had one parent and is TREESAME\&.
1033 .RS 4
1034 .ie n \{\
1035 \h'-04'\(bu\h'+03'\c
1037 .el \{\
1038 .sp -1
1039 .IP \(bu 2.3
1041 \fBQ\fR\*(Aqs parent list had
1042 \fBY\fR
1043 simplified to
1044 \fBX\fR\&.
1045 \fBX\fR
1046 was then removed, because it was a TREESAME root\&.
1047 \fBQ\fR
1048 was then removed completely, because it had one parent and is TREESAME\&.
1052 There is another simplification mode available:
1054 \-\-ancestry\-path[=<commit>]
1055 .RS 4
1056 Limit the displayed commits to those which are an ancestor of <commit>, or which are a descendant of <commit>, or are <commit> itself\&.
1058 As an example use case, consider the following commit history:
1060 .if n \{\
1061 .RS 4
1064             D\-\-\-E\-\-\-\-\-\-\-F
1065            /     \e       \e
1066           B\-\-\-C\-\-\-G\-\-\-H\-\-\-I\-\-\-J
1067          /                     \e
1068         A\-\-\-\-\-\-\-K\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-L\-\-M
1070 .if n \{\
1074 A regular
1075 \fID\&.\&.M\fR
1076 computes the set of commits that are ancestors of
1077 \fBM\fR, but excludes the ones that are ancestors of
1078 \fBD\fR\&. This is useful to see what happened to the history leading to
1079 \fBM\fR
1080 since
1081 \fBD\fR, in the sense that \(lqwhat does
1082 \fBM\fR
1083 have that did not exist in
1084 \fBD\fR\(rq\&. The result in this example would be all the commits, except
1085 \fBA\fR
1087 \fBB\fR
1088 (and
1089 \fBD\fR
1090 itself, of course)\&.
1092 When we want to find out what commits in
1093 \fBM\fR
1094 are contaminated with the bug introduced by
1095 \fBD\fR
1096 and need fixing, however, we might want to view only the subset of
1097 \fID\&.\&.M\fR
1098 that are actually descendants of
1099 \fBD\fR, i\&.e\&. excluding
1100 \fBC\fR
1102 \fBK\fR\&. This is exactly what the
1103 \fB\-\-ancestry\-path\fR
1104 option does\&. Applied to the
1105 \fID\&.\&.M\fR
1106 range, it results in:
1108 .if n \{\
1109 .RS 4
1112                 E\-\-\-\-\-\-\-F
1113                  \e       \e
1114                   G\-\-\-H\-\-\-I\-\-\-J
1115                                \e
1116                                 L\-\-M
1118 .if n \{\
1122 We can also use
1123 \fB\-\-ancestry\-path=D\fR
1124 instead of
1125 \fB\-\-ancestry\-path\fR
1126 which means the same thing when applied to the
1127 \fID\&.\&.M\fR
1128 range but is just more explicit\&.
1130 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
1131 \fBD\&.\&.M\fR
1132 which contain that topic in their ancestry path\&. So, using
1133 \fB\-\-ancestry\-path=H D\&.\&.M\fR
1134 for example would result in:
1136 .if n \{\
1137 .RS 4
1140                 E
1141                  \e
1142                   G\-\-\-H\-\-\-I\-\-\-J
1143                                \e
1144                                 L\-\-M
1146 .if n \{\
1150 Whereas
1151 \fB\-\-ancestry\-path=K D\&.\&.M\fR
1152 would result in
1154 .if n \{\
1155 .RS 4
1158                 K\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-L\-\-M
1160 .if n \{\
1166 Before discussing another option, \fB\-\-show\-pulls\fR, we need to create a new example history\&.
1168 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:
1170 .if n \{\
1171 .RS 4
1174           \&.\-A\-\-\-M\-\-\-\-\-C\-\-N\-\-\-O\-\-\-P
1175          /     / \e  \e  \e/   /   /
1176         I     B   \e  R\-\*(Aq`\-Z\*(Aq   /
1177          \e   /     \e/         /
1178           \e /      /\e        /
1179            `\-\-\-X\-\-\*(Aq  `\-\-\-Y\-\-\*(Aq
1181 .if n \{\
1186 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\&.
1188 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:
1190 .if n \{\
1191 .RS 4
1194         I\-\-\-X
1196 .if n \{\
1201 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:
1203 .if n \{\
1204 .RS 4
1207           \&.\-A\-\-\-M\-\-\-\-\-\-\-\-N\-\-\-O\-\-\-P
1208          /     / \e  \e  \e/   /   /
1209         I     B   \e  R\-\*(Aq`\-\-\*(Aq   /
1210          \e   /     \e/         /
1211           \e /      /\e        /
1212            `\-\-\-X\-\-\*(Aq  `\-\-\-\-\-\-\*(Aq
1214 .if n \{\
1219 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\&.
1221 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:
1223 .if n \{\
1224 .RS 4
1227           \&.\-A\-\-\-M\-\-\&.
1228          /     /    \e
1229         I     B      R
1230          \e   /      /
1231           \e /      /
1232            `\-\-\-X\-\-\*(Aq
1234 .if n \{\
1239 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\&.
1241 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\&.
1243 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\&.
1245 \-\-show\-pulls
1246 .RS 4
1247 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\&.
1249 When a merge commit is included by
1250 \fB\-\-show\-pulls\fR, the merge is treated as if it "pulled" the change from another branch\&. When using
1251 \fB\-\-show\-pulls\fR
1252 on this example (and no other options) the resulting graph is:
1254 .if n \{\
1255 .RS 4
1258         I\-\-\-X\-\-\-R\-\-\-N
1260 .if n \{\
1264 Here, the merge commits
1265 \fBR\fR
1267 \fBN\fR
1268 are included because they pulled the commits
1269 \fBX\fR
1271 \fBR\fR
1272 into the base branch, respectively\&. These merges are the reason the commits
1273 \fBA\fR
1275 \fBB\fR
1276 do not appear in the default history\&.
1278 When
1279 \fB\-\-show\-pulls\fR
1280 is paired with
1281 \fB\-\-simplify\-merges\fR, the graph includes all of the necessary information:
1283 .if n \{\
1284 .RS 4
1287           \&.\-A\-\-\-M\-\-\&.   N
1288          /     /    \e /
1289         I     B      R
1290          \e   /      /
1291           \e /      /
1292            `\-\-\-X\-\-\*(Aq
1294 .if n \{\
1298 Notice that since
1299 \fBM\fR
1300 is reachable from
1301 \fBR\fR, the edge from
1302 \fBN\fR
1304 \fBM\fR
1305 was simplified away\&. However,
1306 \fBN\fR
1307 still appears in the history as an important commit because it "pulled" the change
1308 \fBR\fR
1309 into the main branch\&.
1312 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)\&.
1313 .SS "Bisection Helpers"
1315 \-\-bisect
1316 .RS 4
1317 Limit output to the one commit object which is roughly halfway between included and excluded commits\&. Note that the bad bisection ref
1318 \fBrefs/bisect/bad\fR
1319 is added to the included commits (if it exists) and the good bisection refs
1320 \fBrefs/bisect/good\-*\fR
1321 are added to the excluded commits (if they exist)\&. Thus, supposing there are no refs in
1322 \fBrefs/bisect/\fR, if
1324 .if n \{\
1325 .RS 4
1328         $ git rev\-list \-\-bisect foo ^bar ^baz
1330 .if n \{\
1334 outputs
1335 \fImidpoint\fR, the output of the two commands
1337 .if n \{\
1338 .RS 4
1341         $ git rev\-list foo ^midpoint
1342         $ git rev\-list midpoint ^bar ^baz
1344 .if n \{\
1348 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\&.
1351 \-\-bisect\-vars
1352 .RS 4
1353 This calculates the same as
1354 \fB\-\-bisect\fR, except that refs in
1355 \fBrefs/bisect/\fR
1356 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
1357 \fBbisect_rev\fR, and the expected number of commits to be tested after
1358 \fBbisect_rev\fR
1359 is tested to
1360 \fBbisect_nr\fR, the expected number of commits to be tested if
1361 \fBbisect_rev\fR
1362 turns out to be good to
1363 \fBbisect_good\fR, the expected number of commits to be tested if
1364 \fBbisect_rev\fR
1365 turns out to be bad to
1366 \fBbisect_bad\fR, and the number of commits we are bisecting right now to
1367 \fBbisect_all\fR\&.
1370 \-\-bisect\-all
1371 .RS 4
1372 This outputs all the commit objects between the included and excluded commits, ordered by their distance to the included and excluded commits\&. Refs in
1373 \fBrefs/bisect/\fR
1374 are not used\&. The farthest from them is displayed first\&. (This is the only one displayed by
1375 \fB\-\-bisect\fR\&.)
1377 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)\&.
1379 This option can be used along with
1380 \fB\-\-bisect\-vars\fR, in this case, after all the sorted commit objects, there will be the same text as if
1381 \fB\-\-bisect\-vars\fR
1382 had been used alone\&.
1384 .SS "Commit Ordering"
1386 By default, the commits are shown in reverse chronological order\&.
1388 \-\-date\-order
1389 .RS 4
1390 Show no parents before all of its children are shown, but otherwise show commits in the commit timestamp order\&.
1393 \-\-author\-date\-order
1394 .RS 4
1395 Show no parents before all of its children are shown, but otherwise show commits in the author timestamp order\&.
1398 \-\-topo\-order
1399 .RS 4
1400 Show no parents before all of its children are shown, and avoid showing commits on multiple lines of history intermixed\&.
1402 For example, in a commit history like this:
1404 .if n \{\
1405 .RS 4
1408     \-\-\-1\-\-\-\-2\-\-\-\-4\-\-\-\-7
1409         \e              \e
1410          3\-\-\-\-5\-\-\-\-6\-\-\-\-8\-\-\-
1412 .if n \{\
1416 where the numbers denote the order of commit timestamps,
1417 \fBgit rev\-list\fR
1418 and friends with
1419 \fB\-\-date\-order\fR
1420 show the commits in the timestamp order: 8 7 6 5 4 3 2 1\&.
1422 With
1423 \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\&.
1426 \-\-reverse
1427 .RS 4
1428 Output the commits chosen to be shown (see Commit Limiting section above) in reverse order\&. Cannot be combined with
1429 \fB\-\-walk\-reflogs\fR\&.
1431 .SS "Object Traversal"
1433 These options are mostly targeted for packing of Git repositories\&.
1435 \-\-objects
1436 .RS 4
1437 Print the object IDs of any object referenced by the listed commits\&.
1438 \fB\-\-objects foo ^bar\fR
1439 thus means \(lqsend me all object IDs which I need to download if I have the commit object
1440 \fIbar\fR
1441 but not
1442 \fIfoo\fR\(rq\&. See also
1443 \fB\-\-object\-names\fR
1444 below\&.
1447 \-\-in\-commit\-order
1448 .RS 4
1449 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\&.
1452 \-\-objects\-edge
1453 .RS 4
1454 Similar to
1455 \fB\-\-objects\fR, but also print the IDs of excluded commits prefixed with a \(lq\-\(rq character\&. This is used by
1456 \fBgit-pack-objects\fR(1)
1457 to build a \(lqthin\(rq pack, which records objects in deltified form based on objects contained in these excluded commits to reduce network traffic\&.
1460 \-\-objects\-edge\-aggressive
1461 .RS 4
1462 Similar to
1463 \fB\-\-objects\-edge\fR, but it tries harder to find excluded commits at the cost of increased time\&. This is used instead of
1464 \fB\-\-objects\-edge\fR
1465 to build \(lqthin\(rq packs for shallow repositories\&.
1468 \-\-indexed\-objects
1469 .RS 4
1470 Pretend as if all trees and blobs used by the index are listed on the command line\&. Note that you probably want to use
1471 \fB\-\-objects\fR, too\&.
1474 \-\-unpacked
1475 .RS 4
1476 Only useful with
1477 \fB\-\-objects\fR; print the object IDs that are not in packs\&.
1480 \-\-object\-names
1481 .RS 4
1482 Only useful with
1483 \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\&.
1486 \-\-no\-object\-names
1487 .RS 4
1488 Only useful with
1489 \fB\-\-objects\fR; does not print the names of the object IDs that are found\&. This inverts
1490 \fB\-\-object\-names\fR\&. This flag allows the output to be more easily parsed by commands such as
1491 \fBgit-cat-file\fR(1)\&.
1494 \-\-filter=<filter\-spec>
1495 .RS 4
1496 Only useful with one of the
1497 \fB\-\-objects*\fR; omits objects (usually blobs) from the list of printed objects\&. The
1498 \fI<filter\-spec>\fR
1499 may be one of the following:
1501 The form
1502 \fI\-\-filter=blob:none\fR
1503 omits all blobs\&.
1505 The form
1506 \fI\-\-filter=blob:limit=<n>[kmg]\fR
1507 omits blobs larger than 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,
1508 \fIblob:limit=1k\fR
1509 is the same as
1510 \fIblob:limit=1024\fR\&.
1512 The form
1513 \fI\-\-filter=object:type=(tag|commit|tree|blob)\fR
1514 omits all objects which are not of the requested type\&.
1516 The form
1517 \fI\-\-filter=sparse:oid=<blob\-ish>\fR
1518 uses a sparse\-checkout specification contained in the blob (or blob\-expression)
1519 \fI<blob\-ish>\fR
1520 to omit blobs that would not be required for a sparse checkout on the requested refs\&.
1522 The form
1523 \fI\-\-filter=tree:<depth>\fR
1524 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\&.
1526 Note that the form
1527 \fI\-\-filter=sparse:path=<path>\fR
1528 that wants to read from an arbitrary path on the filesystem has been dropped for security reasons\&.
1530 Multiple
1531 \fI\-\-filter=\fR
1532 flags can be specified to combine filters\&. Only objects which are accepted by every filter are included\&.
1534 The form
1535 \fI\-\-filter=combine:<filter1>+<filter2>+\&...<filterN>\fR
1536 can also be used to combined several filters, but this is harder than just repeating the
1537 \fI\-\-filter\fR
1538 flag and is usually not necessary\&. Filters are joined by
1539 \fI+\fR
1540 and individual filters are %\-encoded (i\&.e\&. URL\-encoded)\&. Besides the
1541 \fI+\fR
1543 \fI%\fR
1544 characters, the following characters are reserved and also must be encoded:
1545 \fB~!@#$^&*()[]{}\e;",<>?\fR\fB\*(Aq`\fR
1546 as well as all characters with ASCII code <=
1547 \fB0x20\fR, which includes space and newline\&.
1549 Other arbitrary characters can also be encoded\&. For instance,
1550 \fIcombine:tree:3+blob:none\fR
1552 \fIcombine:tree%3A3+blob%3Anone\fR
1553 are equivalent\&.
1556 \-\-no\-filter
1557 .RS 4
1558 Turn off any previous
1559 \fB\-\-filter=\fR
1560 argument\&.
1563 \-\-filter\-provided\-objects
1564 .RS 4
1565 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
1566 \fB\-\-filter=\fR\&.
1569 \-\-filter\-print\-omitted
1570 .RS 4
1571 Only useful with
1572 \fB\-\-filter=\fR; prints a list of the objects omitted by the filter\&. Object IDs are prefixed with a \(lq~\(rq character\&.
1575 \-\-missing=<missing\-action>
1576 .RS 4
1577 A debug option to help with future "partial clone" development\&. This option specifies how missing objects are handled\&.
1579 The form
1580 \fI\-\-missing=error\fR
1581 requests that rev\-list stop with an error if a missing object is encountered\&. This is the default action\&.
1583 The form
1584 \fI\-\-missing=allow\-any\fR
1585 will allow object traversal to continue if a missing object is encountered\&. Missing objects will silently be omitted from the results\&.
1587 The form
1588 \fI\-\-missing=allow\-promisor\fR
1589 is like
1590 \fIallow\-any\fR, but will only allow object traversal to continue for EXPECTED promisor missing objects\&. Unexpected missing objects will raise an error\&.
1592 The form
1593 \fI\-\-missing=print\fR
1594 is like
1595 \fIallow\-any\fR, but will also print a list of the missing objects\&. Object IDs are prefixed with a \(lq?\(rq character\&.
1598 \-\-exclude\-promisor\-objects
1599 .RS 4
1600 (For internal use only\&.) Prefilter object traversal at promisor boundary\&. This is used with partial clone\&. This is stronger than
1601 \fB\-\-missing=allow\-promisor\fR
1602 because it limits the traversal, rather than just silencing errors about missing objects\&.
1605 \-\-no\-walk[=(sorted|unsorted)]
1606 .RS 4
1607 Only show the given commits, but do not traverse their ancestors\&. This has no effect if a range is specified\&. If the argument
1608 \fBunsorted\fR
1609 is given, the commits are shown in the order they were given on the command line\&. Otherwise (if
1610 \fBsorted\fR
1611 or no argument was given), the commits are shown in reverse chronological order by commit time\&. Cannot be combined with
1612 \fB\-\-graph\fR\&.
1615 \-\-do\-walk
1616 .RS 4
1617 Overrides a previous
1618 \fB\-\-no\-walk\fR\&.
1620 .SS "Commit Formatting"
1622 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)
1624 \-\-pretty[=<format>], \-\-format=<format>
1625 .RS 4
1626 Pretty\-print the contents of the commit logs in a given format, where
1627 \fI<format>\fR
1628 can be one of
1629 \fIoneline\fR,
1630 \fIshort\fR,
1631 \fImedium\fR,
1632 \fIfull\fR,
1633 \fIfuller\fR,
1634 \fIreference\fR,
1635 \fIemail\fR,
1636 \fIraw\fR,
1637 \fIformat:<string>\fR
1639 \fItformat:<string>\fR\&. When
1640 \fI<format>\fR
1641 is none of the above, and has
1642 \fI%placeholder\fR
1643 in it, it acts as if
1644 \fI\-\-pretty=tformat:<format>\fR
1645 were given\&.
1647 See the "PRETTY FORMATS" section for some additional details for each format\&. When
1648 \fI=<format>\fR
1649 part is omitted, it defaults to
1650 \fImedium\fR\&.
1652 Note: you can specify the default pretty format in the repository configuration (see
1653 \fBgit-config\fR(1))\&.
1656 \-\-abbrev\-commit
1657 .RS 4
1658 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\&.
1660 This should make "\-\-pretty=oneline" a whole lot more readable for people using 80\-column terminals\&.
1663 \-\-no\-abbrev\-commit
1664 .RS 4
1665 Show the full 40\-byte hexadecimal commit object name\&. This negates
1666 \fB\-\-abbrev\-commit\fR, either explicit or implied by other options such as "\-\-oneline"\&. It also overrides the
1667 \fBlog\&.abbrevCommit\fR
1668 variable\&.
1671 \-\-oneline
1672 .RS 4
1673 This is a shorthand for "\-\-pretty=oneline \-\-abbrev\-commit" used together\&.
1676 \-\-encoding=<encoding>
1677 .RS 4
1678 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
1679 \fBX\fR
1680 and we are outputting in
1681 \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\&.
1684 \-\-expand\-tabs=<n>, \-\-expand\-tabs, \-\-no\-expand\-tabs
1685 .RS 4
1686 Perform a tab expansion (replace each tab with enough spaces to fill to the next display column that is a multiple of
1687 \fI<n>\fR) in the log message before showing it in the output\&.
1688 \fB\-\-expand\-tabs\fR
1689 is a short\-hand for
1690 \fB\-\-expand\-tabs=8\fR, and
1691 \fB\-\-no\-expand\-tabs\fR
1692 is a short\-hand for
1693 \fB\-\-expand\-tabs=0\fR, which disables tab expansion\&.
1695 By default, tabs are expanded in pretty formats that indent the log message by 4 spaces (i\&.e\&.
1696 \fImedium\fR, which is the default,
1697 \fIfull\fR, and
1698 \fIfuller\fR)\&.
1701 \-\-show\-signature
1702 .RS 4
1703 Check the validity of a signed commit object by passing the signature to
1704 \fBgpg \-\-verify\fR
1705 and show the output\&.
1708 \-\-relative\-date
1709 .RS 4
1710 Synonym for
1711 \fB\-\-date=relative\fR\&.
1714 \-\-date=<format>
1715 .RS 4
1716 Only takes effect for dates shown in human\-readable format, such as when using
1717 \fB\-\-pretty\fR\&.
1718 \fBlog\&.date\fR
1719 config variable sets a default value for the log command\(cqs
1720 \fB\-\-date\fR
1721 option\&. By default, dates are shown in the original time zone (either committer\(cqs or author\(cqs)\&. If
1722 \fB\-local\fR
1723 is appended to the format (e\&.g\&.,
1724 \fBiso\-local\fR), the user\(cqs local time zone is used instead\&.
1726 \fB\-\-date=relative\fR
1727 shows dates relative to the current time, e\&.g\&. \(lq2 hours ago\(rq\&. The
1728 \fB\-local\fR
1729 option has no effect for
1730 \fB\-\-date=relative\fR\&.
1732 \fB\-\-date=local\fR
1733 is an alias for
1734 \fB\-\-date=default\-local\fR\&.
1736 \fB\-\-date=iso\fR
1738 \fB\-\-date=iso8601\fR) shows timestamps in a ISO 8601\-like format\&. The differences to the strict ISO 8601 format are:
1740 .RS 4
1741 .ie n \{\
1742 \h'-04'\(bu\h'+03'\c
1744 .el \{\
1745 .sp -1
1746 .IP \(bu 2.3
1748 a space instead of the
1749 \fBT\fR
1750 date/time delimiter
1753 .RS 4
1754 .ie n \{\
1755 \h'-04'\(bu\h'+03'\c
1757 .el \{\
1758 .sp -1
1759 .IP \(bu 2.3
1761 a space between time and time zone
1764 .RS 4
1765 .ie n \{\
1766 \h'-04'\(bu\h'+03'\c
1768 .el \{\
1769 .sp -1
1770 .IP \(bu 2.3
1772 no colon between hours and minutes of the time zone
1775 \fB\-\-date=iso\-strict\fR
1777 \fB\-\-date=iso8601\-strict\fR) shows timestamps in strict ISO 8601 format\&.
1779 \fB\-\-date=rfc\fR
1781 \fB\-\-date=rfc2822\fR) shows timestamps in RFC 2822 format, often found in email messages\&.
1783 \fB\-\-date=short\fR
1784 shows only the date, but not the time, in
1785 \fBYYYY\-MM\-DD\fR
1786 format\&.
1788 \fB\-\-date=raw\fR
1789 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
1790 \fB+\fR
1792 \fB\-\fR
1793 with four digits; the first two are hours, and the second two are minutes)\&. I\&.e\&., as if the timestamp were formatted with
1794 \fBstrftime("%s %z")\fR)\&. Note that the
1795 \fB\-local\fR
1796 option does not affect the seconds\-since\-epoch value (which is always measured in UTC), but does switch the accompanying timezone value\&.
1798 \fB\-\-date=human\fR
1799 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\&.
1801 \fB\-\-date=unix\fR
1802 shows the date as a Unix epoch timestamp (seconds since 1970)\&. As with
1803 \fB\-\-raw\fR, this is always in UTC and therefore
1804 \fB\-local\fR
1805 has no effect\&.
1807 \fB\-\-date=format:\&.\&.\&.\fR
1808 feeds the format
1809 \fB\&.\&.\&.\fR
1810 to your system
1811 \fBstrftime\fR, except for %s, %z, and %Z, which are handled internally\&. Use
1812 \fB\-\-date=format:%c\fR
1813 to show the date in your system locale\(cqs preferred format\&. See the
1814 \fBstrftime\fR
1815 manual for a complete list of format placeholders\&. When using
1816 \fB\-local\fR, the correct syntax is
1817 \fB\-\-date=format\-local:\&.\&.\&.\fR\&.
1819 \fB\-\-date=default\fR
1820 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\&.
1821 \fBThu Jan 1 00:00:00 1970 +0000\fR\&.
1824 \-\-header
1825 .RS 4
1826 Print the contents of the commit in raw\-format; each record is separated with a NUL character\&.
1829 \-\-no\-commit\-header
1830 .RS 4
1831 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\&.
1834 \-\-commit\-header
1835 .RS 4
1836 Overrides a previous
1837 \fB\-\-no\-commit\-header\fR\&.
1840 \-\-parents
1841 .RS 4
1842 Print also the parents of the commit (in the form "commit parent\&...")\&. Also enables parent rewriting, see
1843 \fIHistory Simplification\fR
1844 above\&.
1847 \-\-children
1848 .RS 4
1849 Print also the children of the commit (in the form "commit child\&...")\&. Also enables parent rewriting, see
1850 \fIHistory Simplification\fR
1851 above\&.
1854 \-\-timestamp
1855 .RS 4
1856 Print the raw commit timestamp\&.
1859 \-\-left\-right
1860 .RS 4
1861 Mark which side of a symmetric difference a commit is reachable from\&. Commits from the left side are prefixed with
1862 \fB<\fR
1863 and those from the right with
1864 \fB>\fR\&. If combined with
1865 \fB\-\-boundary\fR, those commits are prefixed with
1866 \fB\-\fR\&.
1868 For example, if you have this topology:
1870 .if n \{\
1871 .RS 4
1874              y\-\-\-b\-\-\-b  branch B
1875             / \e /
1876            /   \&.
1877           /   / \e
1878          o\-\-\-x\-\-\-a\-\-\-a  branch A
1880 .if n \{\
1884 you would get an output like this:
1886 .if n \{\
1887 .RS 4
1890         $ git rev\-list \-\-left\-right \-\-boundary \-\-pretty=oneline A\&.\&.\&.B
1892         >bbbbbbb\&.\&.\&. 3rd on b
1893         >bbbbbbb\&.\&.\&. 2nd on b
1894         <aaaaaaa\&.\&.\&. 3rd on a
1895         <aaaaaaa\&.\&.\&. 2nd on a
1896         \-yyyyyyy\&.\&.\&. 1st on b
1897         \-xxxxxxx\&.\&.\&. 1st on a
1899 .if n \{\
1905 \-\-graph
1906 .RS 4
1907 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
1908 \fB\-\-no\-walk\fR\&.
1910 This enables parent rewriting, see
1911 \fIHistory Simplification\fR
1912 above\&.
1914 This implies the
1915 \fB\-\-topo\-order\fR
1916 option by default, but the
1917 \fB\-\-date\-order\fR
1918 option may also be specified\&.
1921 \-\-show\-linear\-break[=<barrier>]
1922 .RS 4
1923 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
1924 \fB<barrier>\fR
1925 is specified, it is the string that will be shown instead of the default one\&.
1928 \-\-count
1929 .RS 4
1930 Print a number stating how many commits would have been listed, and suppress all other output\&. When used together with
1931 \fB\-\-left\-right\fR, instead print the counts for left and right commits, separated by a tab\&. When used together with
1932 \fB\-\-cherry\-mark\fR, omit patch equivalent commits from these counts and print the count for equivalent commits separated by a tab\&.
1934 .SH "PRETTY FORMATS"
1936 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\&.
1938 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:
1940 .RS 4
1941 .ie n \{\
1942 \h'-04'\(bu\h'+03'\c
1944 .el \{\
1945 .sp -1
1946 .IP \(bu 2.3
1948 \fIoneline\fR
1950 .if n \{\
1951 .RS 4
1954 <hash> <title\-line>
1956 .if n \{\
1960 This is designed to be as compact as possible\&.
1963 .RS 4
1964 .ie n \{\
1965 \h'-04'\(bu\h'+03'\c
1967 .el \{\
1968 .sp -1
1969 .IP \(bu 2.3
1971 \fIshort\fR
1973 .if n \{\
1974 .RS 4
1977 commit <hash>
1978 Author: <author>
1980 .if n \{\
1984 .if n \{\
1985 .RS 4
1988 <title\-line>
1990 .if n \{\
1995 .RS 4
1996 .ie n \{\
1997 \h'-04'\(bu\h'+03'\c
1999 .el \{\
2000 .sp -1
2001 .IP \(bu 2.3
2003 \fImedium\fR
2005 .if n \{\
2006 .RS 4
2009 commit <hash>
2010 Author: <author>
2011 Date:   <author\-date>
2013 .if n \{\
2017 .if n \{\
2018 .RS 4
2021 <title\-line>
2023 .if n \{\
2027 .if n \{\
2028 .RS 4
2031 <full\-commit\-message>
2033 .if n \{\
2038 .RS 4
2039 .ie n \{\
2040 \h'-04'\(bu\h'+03'\c
2042 .el \{\
2043 .sp -1
2044 .IP \(bu 2.3
2046 \fIfull\fR
2048 .if n \{\
2049 .RS 4
2052 commit <hash>
2053 Author: <author>
2054 Commit: <committer>
2056 .if n \{\
2060 .if n \{\
2061 .RS 4
2064 <title\-line>
2066 .if n \{\
2070 .if n \{\
2071 .RS 4
2074 <full\-commit\-message>
2076 .if n \{\
2081 .RS 4
2082 .ie n \{\
2083 \h'-04'\(bu\h'+03'\c
2085 .el \{\
2086 .sp -1
2087 .IP \(bu 2.3
2089 \fIfuller\fR
2091 .if n \{\
2092 .RS 4
2095 commit <hash>
2096 Author:     <author>
2097 AuthorDate: <author\-date>
2098 Commit:     <committer>
2099 CommitDate: <committer\-date>
2101 .if n \{\
2105 .if n \{\
2106 .RS 4
2109 <title\-line>
2111 .if n \{\
2115 .if n \{\
2116 .RS 4
2119 <full\-commit\-message>
2121 .if n \{\
2126 .RS 4
2127 .ie n \{\
2128 \h'-04'\(bu\h'+03'\c
2130 .el \{\
2131 .sp -1
2132 .IP \(bu 2.3
2134 \fIreference\fR
2136 .if n \{\
2137 .RS 4
2140 <abbrev\-hash> (<title\-line>, <short\-author\-date>)
2142 .if n \{\
2146 This format is used to refer to another commit in a commit message and is the same as
2147 \fB\-\-pretty=\*(Aqformat:%C(auto)%h (%s, %ad)\*(Aq\fR\&. By default, the date is formatted with
2148 \fB\-\-date=short\fR
2149 unless another
2150 \fB\-\-date\fR
2151 option is explicitly specified\&. As with any
2152 \fBformat:\fR
2153 with format placeholders, its output is not affected by other options like
2154 \fB\-\-decorate\fR
2156 \fB\-\-walk\-reflogs\fR\&.
2159 .RS 4
2160 .ie n \{\
2161 \h'-04'\(bu\h'+03'\c
2163 .el \{\
2164 .sp -1
2165 .IP \(bu 2.3
2167 \fIemail\fR
2169 .if n \{\
2170 .RS 4
2173 From <hash> <date>
2174 From: <author>
2175 Date: <author\-date>
2176 Subject: [PATCH] <title\-line>
2178 .if n \{\
2182 .if n \{\
2183 .RS 4
2186 <full\-commit\-message>
2188 .if n \{\
2193 .RS 4
2194 .ie n \{\
2195 \h'-04'\(bu\h'+03'\c
2197 .el \{\
2198 .sp -1
2199 .IP \(bu 2.3
2201 \fImboxrd\fR
2203 Like
2204 \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\&.
2207 .RS 4
2208 .ie n \{\
2209 \h'-04'\(bu\h'+03'\c
2211 .el \{\
2212 .sp -1
2213 .IP \(bu 2.3
2215 \fIraw\fR
2218 \fIraw\fR
2219 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
2220 \fIparents\fR
2221 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
2222 \fBgit log \-\-raw\fR\&. To get full object names in a raw diff format, use
2223 \fB\-\-no\-abbrev\fR\&.
2226 .RS 4
2227 .ie n \{\
2228 \h'-04'\(bu\h'+03'\c
2230 .el \{\
2231 .sp -1
2232 .IP \(bu 2.3
2234 \fIformat:<format\-string>\fR
2237 \fIformat:<format\-string>\fR
2238 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
2239 \fI%n\fR
2240 instead of
2241 \fI\en\fR\&.
2243 E\&.g,
2244 \fIformat:"The author of %h was %an, %ar%nThe title was >>%s<<%n"\fR
2245 would show something like this:
2247 .if n \{\
2248 .RS 4
2251 The author of fe6e0ee was Junio C Hamano, 23 hours ago
2252 The title was >>t4119: test autocomputing \-p<n> for traditional diff input\&.<<
2254 .if n \{\
2258 The placeholders are:
2260 .RS 4
2261 .ie n \{\
2262 \h'-04'\(bu\h'+03'\c
2264 .el \{\
2265 .sp -1
2266 .IP \(bu 2.3
2268 Placeholders that expand to a single literal character:
2270 \fI%n\fR
2271 .RS 4
2272 newline
2275 \fI%%\fR
2276 .RS 4
2277 a raw
2278 \fI%\fR
2281 \fI%x00\fR
2282 .RS 4
2283 \fI%x\fR
2284 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)\&.
2288 .RS 4
2289 .ie n \{\
2290 \h'-04'\(bu\h'+03'\c
2292 .el \{\
2293 .sp -1
2294 .IP \(bu 2.3
2296 Placeholders that affect formatting of later placeholders:
2298 \fI%Cred\fR
2299 .RS 4
2300 switch color to red
2303 \fI%Cgreen\fR
2304 .RS 4
2305 switch color to green
2308 \fI%Cblue\fR
2309 .RS 4
2310 switch color to blue
2313 \fI%Creset\fR
2314 .RS 4
2315 reset color
2318 \fI%C(\&...)\fR
2319 .RS 4
2320 color specification, as described under Values in the "CONFIGURATION FILE" section of
2321 \fBgit-config\fR(1)\&. By default, colors are shown only when enabled for log output (by
2322 \fBcolor\&.diff\fR,
2323 \fBcolor\&.ui\fR, or
2324 \fB\-\-color\fR, and respecting the
2325 \fBauto\fR
2326 settings of the former if we are going to a terminal)\&.
2327 \fB%C(auto,\&.\&.\&.)\fR
2328 is accepted as a historical synonym for the default (e\&.g\&.,
2329 \fB%C(auto,red)\fR)\&. Specifying
2330 \fB%C(always,\&.\&.\&.)\fR
2331 will show the colors even when color is not otherwise enabled (though consider just using
2332 \fB\-\-color=always\fR
2333 to enable color for the whole output, including this format and anything else git might color)\&.
2334 \fBauto\fR
2335 alone (i\&.e\&.
2336 \fB%C(auto)\fR) will turn on auto coloring on the next placeholders until the color is switched again\&.
2339 \fI%m\fR
2340 .RS 4
2341 left (\fB<\fR), right (\fB>\fR) or boundary (\fB\-\fR) mark
2344 \fI%w([<w>[,<i1>[,<i2>]]])\fR
2345 .RS 4
2346 switch line wrapping, like the \-w option of
2347 \fBgit-shortlog\fR(1)\&.
2350 \fI%<( <N> [,trunc|ltrunc|mtrunc])\fR
2351 .RS 4
2352 make the next placeholder take at least N column widths, padding spaces on the right if necessary\&. Optionally truncate (with ellipsis
2353 \fI\&.\&.\fR) at the left (ltrunc)
2354 \fB\&.\&.ft\fR, the middle (mtrunc)
2355 \fBmi\&.\&.le\fR, or the end (trunc)
2356 \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\&.
2359 \fI%<|( <M> )\fR
2360 .RS 4
2361 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\&.
2364 \fI%>( <N> )\fR, \fI%>|( <M> )\fR
2365 .RS 4
2366 similar to
2367 \fI%<( <N> )\fR,
2368 \fI%<|( <M> )\fR
2369 respectively, but padding spaces on the left
2372 \fI%>>( <N> )\fR, \fI%>>|( <M> )\fR
2373 .RS 4
2374 similar to
2375 \fI%>( <N> )\fR,
2376 \fI%>|( <M> )\fR
2377 respectively, except that if the next placeholder takes more spaces than given and there are spaces on its left, use those spaces
2380 \fI%><( <N> )\fR, \fI%><|( <M> )\fR
2381 .RS 4
2382 similar to
2383 \fI%<( <N> )\fR,
2384 \fI%<|( <M> )\fR
2385 respectively, but padding both sides (i\&.e\&. the text is centered)
2389 .RS 4
2390 .ie n \{\
2391 \h'-04'\(bu\h'+03'\c
2393 .el \{\
2394 .sp -1
2395 .IP \(bu 2.3
2397 Placeholders that expand to information extracted from the commit:
2399 \fI%H\fR
2400 .RS 4
2401 commit hash
2404 \fI%h\fR
2405 .RS 4
2406 abbreviated commit hash
2409 \fI%T\fR
2410 .RS 4
2411 tree hash
2414 \fI%t\fR
2415 .RS 4
2416 abbreviated tree hash
2419 \fI%P\fR
2420 .RS 4
2421 parent hashes
2424 \fI%p\fR
2425 .RS 4
2426 abbreviated parent hashes
2429 \fI%an\fR
2430 .RS 4
2431 author name
2434 \fI%aN\fR
2435 .RS 4
2436 author name (respecting \&.mailmap, see
2437 \fBgit-shortlog\fR(1)
2439 \fBgit-blame\fR(1))
2442 \fI%ae\fR
2443 .RS 4
2444 author email
2447 \fI%aE\fR
2448 .RS 4
2449 author email (respecting \&.mailmap, see
2450 \fBgit-shortlog\fR(1)
2452 \fBgit-blame\fR(1))
2455 \fI%al\fR
2456 .RS 4
2457 author email local\-part (the part before the
2458 \fI@\fR
2459 sign)
2462 \fI%aL\fR
2463 .RS 4
2464 author local\-part (see
2465 \fI%al\fR) respecting \&.mailmap, see
2466 \fBgit-shortlog\fR(1)
2468 \fBgit-blame\fR(1))
2471 \fI%ad\fR
2472 .RS 4
2473 author date (format respects \-\-date= option)
2476 \fI%aD\fR
2477 .RS 4
2478 author date, RFC2822 style
2481 \fI%ar\fR
2482 .RS 4
2483 author date, relative
2486 \fI%at\fR
2487 .RS 4
2488 author date, UNIX timestamp
2491 \fI%ai\fR
2492 .RS 4
2493 author date, ISO 8601\-like format
2496 \fI%aI\fR
2497 .RS 4
2498 author date, strict ISO 8601 format
2501 \fI%as\fR
2502 .RS 4
2503 author date, short format (\fBYYYY\-MM\-DD\fR)
2506 \fI%ah\fR
2507 .RS 4
2508 author date, human style (like the
2509 \fB\-\-date=human\fR
2510 option of
2511 \fBgit-rev-list\fR(1))
2514 \fI%cn\fR
2515 .RS 4
2516 committer name
2519 \fI%cN\fR
2520 .RS 4
2521 committer name (respecting \&.mailmap, see
2522 \fBgit-shortlog\fR(1)
2524 \fBgit-blame\fR(1))
2527 \fI%ce\fR
2528 .RS 4
2529 committer email
2532 \fI%cE\fR
2533 .RS 4
2534 committer email (respecting \&.mailmap, see
2535 \fBgit-shortlog\fR(1)
2537 \fBgit-blame\fR(1))
2540 \fI%cl\fR
2541 .RS 4
2542 committer email local\-part (the part before the
2543 \fI@\fR
2544 sign)
2547 \fI%cL\fR
2548 .RS 4
2549 committer local\-part (see
2550 \fI%cl\fR) respecting \&.mailmap, see
2551 \fBgit-shortlog\fR(1)
2553 \fBgit-blame\fR(1))
2556 \fI%cd\fR
2557 .RS 4
2558 committer date (format respects \-\-date= option)
2561 \fI%cD\fR
2562 .RS 4
2563 committer date, RFC2822 style
2566 \fI%cr\fR
2567 .RS 4
2568 committer date, relative
2571 \fI%ct\fR
2572 .RS 4
2573 committer date, UNIX timestamp
2576 \fI%ci\fR
2577 .RS 4
2578 committer date, ISO 8601\-like format
2581 \fI%cI\fR
2582 .RS 4
2583 committer date, strict ISO 8601 format
2586 \fI%cs\fR
2587 .RS 4
2588 committer date, short format (\fBYYYY\-MM\-DD\fR)
2591 \fI%ch\fR
2592 .RS 4
2593 committer date, human style (like the
2594 \fB\-\-date=human\fR
2595 option of
2596 \fBgit-rev-list\fR(1))
2599 \fI%d\fR
2600 .RS 4
2601 ref names, like the \-\-decorate option of
2602 \fBgit-log\fR(1)
2605 \fI%D\fR
2606 .RS 4
2607 ref names without the " (", ")" wrapping\&.
2610 \fI%(decorate[:<options>])\fR
2611 .RS 4
2612 ref names with custom decorations\&. The
2613 \fBdecorate\fR
2614 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 (\fB%x2C\fR) and closing parentheses (\fB%x29\fR), due to their role in the option syntax\&.
2616 .RS 4
2617 .ie n \{\
2618 \h'-04'\(bu\h'+03'\c
2620 .el \{\
2621 .sp -1
2622 .IP \(bu 2.3
2624 \fIprefix=<value>\fR: Shown before the list of ref names\&. Defaults to "\ \&\fB(\fR"\&.
2627 .RS 4
2628 .ie n \{\
2629 \h'-04'\(bu\h'+03'\c
2631 .el \{\
2632 .sp -1
2633 .IP \(bu 2.3
2635 \fIsuffix=<value>\fR: Shown after the list of ref names\&. Defaults to "\fB)\fR"\&.
2638 .RS 4
2639 .ie n \{\
2640 \h'-04'\(bu\h'+03'\c
2642 .el \{\
2643 .sp -1
2644 .IP \(bu 2.3
2646 \fIseparator=<value>\fR: Shown between ref names\&. Defaults to "\fB,\fR\ \&"\&.
2649 .RS 4
2650 .ie n \{\
2651 \h'-04'\(bu\h'+03'\c
2653 .el \{\
2654 .sp -1
2655 .IP \(bu 2.3
2657 \fIpointer=<value>\fR: Shown between HEAD and the branch it points to, if any\&. Defaults to "\ \&\fB\->\fR\ \&"\&.
2660 .RS 4
2661 .ie n \{\
2662 \h'-04'\(bu\h'+03'\c
2664 .el \{\
2665 .sp -1
2666 .IP \(bu 2.3
2668 \fItag=<value>\fR: Shown before tag names\&. Defaults to "\fBtag:\fR\ \&"\&.
2671 For example, to produce decorations with no wrapping or tag annotations, and spaces as separators:
2673 \fB%(decorate:prefix=,suffix=,tag=,separator= )\fR
2676 \fI%(describe[:<options>])\fR
2677 .RS 4
2678 human\-readable name, like
2679 \fBgit-describe\fR(1); empty string for undescribable commits\&. The
2680 \fBdescribe\fR
2681 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\&.
2683 .RS 4
2684 .ie n \{\
2685 \h'-04'\(bu\h'+03'\c
2687 .el \{\
2688 .sp -1
2689 .IP \(bu 2.3
2691 \fItags[=<bool\-value>]\fR: Instead of only considering annotated tags, consider lightweight tags as well\&.
2694 .RS 4
2695 .ie n \{\
2696 \h'-04'\(bu\h'+03'\c
2698 .el \{\
2699 .sp -1
2700 .IP \(bu 2.3
2702 \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\&.
2705 .RS 4
2706 .ie n \{\
2707 \h'-04'\(bu\h'+03'\c
2709 .el \{\
2710 .sp -1
2711 .IP \(bu 2.3
2713 \fImatch=<pattern>\fR: Only consider tags matching the given
2714 \fBglob(7)\fR
2715 pattern, excluding the "refs/tags/" prefix\&.
2718 .RS 4
2719 .ie n \{\
2720 \h'-04'\(bu\h'+03'\c
2722 .el \{\
2723 .sp -1
2724 .IP \(bu 2.3
2726 \fIexclude=<pattern>\fR: Do not consider tags matching the given
2727 \fBglob(7)\fR
2728 pattern, excluding the "refs/tags/" prefix\&.
2732 \fI%S\fR
2733 .RS 4
2734 ref name given on the command line by which the commit was reached (like
2735 \fBgit log \-\-source\fR), only works with
2736 \fBgit log\fR
2739 \fI%e\fR
2740 .RS 4
2741 encoding
2744 \fI%s\fR
2745 .RS 4
2746 subject
2749 \fI%f\fR
2750 .RS 4
2751 sanitized subject line, suitable for a filename
2754 \fI%b\fR
2755 .RS 4
2756 body
2759 \fI%B\fR
2760 .RS 4
2761 raw body (unwrapped subject and body)
2764 \fI%GG\fR
2765 .RS 4
2766 raw verification message from GPG for a signed commit
2769 \fI%G?\fR
2770 .RS 4
2771 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
2774 \fI%GS\fR
2775 .RS 4
2776 show the name of the signer for a signed commit
2779 \fI%GK\fR
2780 .RS 4
2781 show the key used to sign a signed commit
2784 \fI%GF\fR
2785 .RS 4
2786 show the fingerprint of the key used to sign a signed commit
2789 \fI%GP\fR
2790 .RS 4
2791 show the fingerprint of the primary key whose subkey was used to sign a signed commit
2794 \fI%GT\fR
2795 .RS 4
2796 show the trust level for the key used to sign a signed commit
2799 \fI%gD\fR
2800 .RS 4
2801 reflog selector, e\&.g\&.,
2802 \fBrefs/stash@{1}\fR
2804 \fBrefs/stash@{2 minutes ago}\fR; the format follows the rules described for the
2805 \fB\-g\fR
2806 option\&. The portion before the
2807 \fB@\fR
2808 is the refname as given on the command line (so
2809 \fBgit log \-g refs/heads/master\fR
2810 would yield
2811 \fBrefs/heads/master@{0}\fR)\&.
2814 \fI%gd\fR
2815 .RS 4
2816 shortened reflog selector; same as
2817 \fB%gD\fR, but the refname portion is shortened for human readability (so
2818 \fBrefs/heads/master\fR
2819 becomes just
2820 \fBmaster\fR)\&.
2823 \fI%gn\fR
2824 .RS 4
2825 reflog identity name
2828 \fI%gN\fR
2829 .RS 4
2830 reflog identity name (respecting \&.mailmap, see
2831 \fBgit-shortlog\fR(1)
2833 \fBgit-blame\fR(1))
2836 \fI%ge\fR
2837 .RS 4
2838 reflog identity email
2841 \fI%gE\fR
2842 .RS 4
2843 reflog identity email (respecting \&.mailmap, see
2844 \fBgit-shortlog\fR(1)
2846 \fBgit-blame\fR(1))
2849 \fI%gs\fR
2850 .RS 4
2851 reflog subject
2854 \fI%(trailers[:<options>])\fR
2855 .RS 4
2856 display the trailers of the body as interpreted by
2857 \fBgit-interpret-trailers\fR(1)\&. The
2858 \fBtrailers\fR
2859 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\&.
2861 .RS 4
2862 .ie n \{\
2863 \h'-04'\(bu\h'+03'\c
2865 .el \{\
2866 .sp -1
2867 .IP \(bu 2.3
2869 \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
2870 \fBonly\fR
2871 option so that non\-trailer lines in the trailer block are hidden\&. If that is not desired it can be disabled with
2872 \fBonly=false\fR\&. E\&.g\&.,
2873 \fB%(trailers:key=Reviewed\-by)\fR
2874 shows trailer lines with key
2875 \fBReviewed\-by\fR\&.
2878 .RS 4
2879 .ie n \{\
2880 \h'-04'\(bu\h'+03'\c
2882 .el \{\
2883 .sp -1
2884 .IP \(bu 2.3
2886 \fIonly[=<bool>]\fR: select whether non\-trailer lines from the trailer block should be included\&.
2889 .RS 4
2890 .ie n \{\
2891 \h'-04'\(bu\h'+03'\c
2893 .el \{\
2894 .sp -1
2895 .IP \(bu 2.3
2897 \fIseparator=<sep>\fR: specify a separator inserted between trailer lines\&. When this option is not given each trailer line is terminated with a line feed character\&. The string <sep> may contain the literal formatting codes described above\&. To use comma as separator one must use
2898 \fB%x2C\fR
2899 as it would otherwise be parsed as next option\&. E\&.g\&.,
2900 \fB%(trailers:key=Ticket,separator=%x2C )\fR
2901 shows all trailer lines whose key is "Ticket" separated by a comma and a space\&.
2904 .RS 4
2905 .ie n \{\
2906 \h'-04'\(bu\h'+03'\c
2908 .el \{\
2909 .sp -1
2910 .IP \(bu 2.3
2912 \fIunfold[=<bool>]\fR: make it behave as if interpret\-trailer\(cqs
2913 \fB\-\-unfold\fR
2914 option was given\&. E\&.g\&.,
2915 \fB%(trailers:only,unfold=true)\fR
2916 unfolds and shows all trailer lines\&.
2919 .RS 4
2920 .ie n \{\
2921 \h'-04'\(bu\h'+03'\c
2923 .el \{\
2924 .sp -1
2925 .IP \(bu 2.3
2927 \fIkeyonly[=<bool>]\fR: only show the key part of the trailer\&.
2930 .RS 4
2931 .ie n \{\
2932 \h'-04'\(bu\h'+03'\c
2934 .el \{\
2935 .sp -1
2936 .IP \(bu 2.3
2938 \fIvalueonly[=<bool>]\fR: only show the value part of the trailer\&.
2941 .RS 4
2942 .ie n \{\
2943 \h'-04'\(bu\h'+03'\c
2945 .el \{\
2946 .sp -1
2947 .IP \(bu 2.3
2949 \fIkey_value_separator=<sep>\fR: specify a separator inserted between trailer lines\&. When this option is not given each trailer key\-value pair is separated by ": "\&. Otherwise it shares the same semantics as
2950 \fIseparator=<sep>\fR
2951 above\&.
2956 .if n \{\
2959 .RS 4
2960 .it 1 an-trap
2961 .nr an-no-space-flag 1
2962 .nr an-break-flag 1
2964 .ps +1
2965 \fBNote\fR
2966 .ps -1
2969 Some placeholders may depend on other options given to the revision traversal engine\&. For example, the \fB%g*\fR reflog options will insert an empty string unless we are traversing reflog entries (e\&.g\&., by \fBgit log \-g\fR)\&. The \fB%d\fR and \fB%D\fR placeholders will use the "short" decoration format if \fB\-\-decorate\fR was not already provided on the command line\&.
2970 .sp .5v
2973 The boolean options accept an optional value \fB[=<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\&.
2975 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\&.
2977 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\&.
2979 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\&.
2981 .RS 4
2982 .ie n \{\
2983 \h'-04'\(bu\h'+03'\c
2985 .el \{\
2986 .sp -1
2987 .IP \(bu 2.3
2989 \fItformat:\fR
2992 \fItformat:\fR
2993 format works exactly like
2994 \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:
2996 .if n \{\
2997 .RS 4
3000 $ git log \-2 \-\-pretty=format:%h 4da45bef \e
3001   | perl \-pe \*(Aq$_ \&.= " \-\- NO NEWLINE\en" unless /\en/\*(Aq
3002 4da45be
3003 7134973 \-\- NO NEWLINE
3005 $ git log \-2 \-\-pretty=tformat:%h 4da45bef \e
3006   | perl \-pe \*(Aq$_ \&.= " \-\- NO NEWLINE\en" unless /\en/\*(Aq
3007 4da45be
3008 7134973
3010 .if n \{\
3014 In addition, any unrecognized string that has a
3015 \fB%\fR
3016 in it is interpreted as if it has
3017 \fBtformat:\fR
3018 in front of it\&. For example, these two are equivalent:
3020 .if n \{\
3021 .RS 4
3024 $ git log \-2 \-\-pretty=tformat:%h 4da45bef
3025 $ git log \-2 \-\-pretty=%h 4da45bef
3027 .if n \{\
3032 .SH "EXAMPLES"
3034 .RS 4
3035 .ie n \{\
3036 \h'-04'\(bu\h'+03'\c
3038 .el \{\
3039 .sp -1
3040 .IP \(bu 2.3
3042 Print the list of commits reachable from the current branch\&.
3044 .if n \{\
3045 .RS 4
3048 git rev\-list HEAD
3050 .if n \{\
3056 .RS 4
3057 .ie n \{\
3058 \h'-04'\(bu\h'+03'\c
3060 .el \{\
3061 .sp -1
3062 .IP \(bu 2.3
3064 Print the list of commits on this branch, but not present in the upstream branch\&.
3066 .if n \{\
3067 .RS 4
3070 git rev\-list @{upstream}\&.\&.HEAD
3072 .if n \{\
3078 .RS 4
3079 .ie n \{\
3080 \h'-04'\(bu\h'+03'\c
3082 .el \{\
3083 .sp -1
3084 .IP \(bu 2.3
3086 Format commits with their author and commit message (see also the porcelain
3087 \fBgit-log\fR(1))\&.
3089 .if n \{\
3090 .RS 4
3093 git rev\-list \-\-format=medium HEAD
3095 .if n \{\
3101 .RS 4
3102 .ie n \{\
3103 \h'-04'\(bu\h'+03'\c
3105 .el \{\
3106 .sp -1
3107 .IP \(bu 2.3
3109 Format commits along with their diffs (see also the porcelain
3110 \fBgit-log\fR(1), which can do this in a single process)\&.
3112 .if n \{\
3113 .RS 4
3116 git rev\-list HEAD |
3117 git diff\-tree \-\-stdin \-\-format=medium \-p
3119 .if n \{\
3125 .RS 4
3126 .ie n \{\
3127 \h'-04'\(bu\h'+03'\c
3129 .el \{\
3130 .sp -1
3131 .IP \(bu 2.3
3133 Print the list of commits on the current branch that touched any file in the
3134 \fBDocumentation\fR
3135 directory\&.
3137 .if n \{\
3138 .RS 4
3141 git rev\-list HEAD \-\- Documentation/
3143 .if n \{\
3149 .RS 4
3150 .ie n \{\
3151 \h'-04'\(bu\h'+03'\c
3153 .el \{\
3154 .sp -1
3155 .IP \(bu 2.3
3157 Print the list of commits authored by you in the past year, on any branch, tag, or other ref\&.
3159 .if n \{\
3160 .RS 4
3163 git rev\-list \-\-author=you@example\&.com \-\-since=1\&.year\&.ago \-\-all
3165 .if n \{\
3171 .RS 4
3172 .ie n \{\
3173 \h'-04'\(bu\h'+03'\c
3175 .el \{\
3176 .sp -1
3177 .IP \(bu 2.3
3179 Print the list of objects reachable from the current branch (i\&.e\&., all commits and the blobs and trees they contain)\&.
3181 .if n \{\
3182 .RS 4
3185 git rev\-list \-\-objects HEAD
3187 .if n \{\
3193 .RS 4
3194 .ie n \{\
3195 \h'-04'\(bu\h'+03'\c
3197 .el \{\
3198 .sp -1
3199 .IP \(bu 2.3
3201 Compare the disk size of all reachable objects, versus those reachable from reflogs, versus the total packed size\&. This can tell you whether running
3202 \fBgit repack \-ad\fR
3203 might reduce the repository size (by dropping unreachable objects), and whether expiring reflogs might help\&.
3205 .if n \{\
3206 .RS 4
3209 # reachable objects
3210 git rev\-list \-\-disk\-usage \-\-objects \-\-all
3211 # plus reflogs
3212 git rev\-list \-\-disk\-usage \-\-objects \-\-all \-\-reflog
3213 # total disk size used
3214 du \-c \&.git/objects/pack/*\&.pack \&.git/objects/??/*
3215 # alternative to du: add up "size" and "size\-pack" fields
3216 git count\-objects \-v
3218 .if n \{\
3224 .RS 4
3225 .ie n \{\
3226 \h'-04'\(bu\h'+03'\c
3228 .el \{\
3229 .sp -1
3230 .IP \(bu 2.3
3232 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)\&.
3234 .if n \{\
3235 .RS 4
3238 git for\-each\-ref \-\-format=\*(Aq%(refname)\*(Aq |
3239 while read branch
3241         size=$(git rev\-list \-\-disk\-usage \-\-objects HEAD\&.\&.$branch)
3242         echo "$size $branch"
3243 done |
3244 sort \-n
3246 .if n \{\
3252 .RS 4
3253 .ie n \{\
3254 \h'-04'\(bu\h'+03'\c
3256 .el \{\
3257 .sp -1
3258 .IP \(bu 2.3
3260 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
3261 \fBorigin\fR
3262 as a baseline)\&.
3264 .if n \{\
3265 .RS 4
3268 git rev\-list \-\-disk\-usage \-\-objects \-\-remotes=$suspect \-\-not \-\-remotes=origin
3270 .if n \{\
3275 .SH "GIT"
3277 Part of the \fBgit\fR(1) suite