2 .\" Title: git-shortlog
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.rc0
10 .TH "GIT\-SHORTLOG" "1" "2024-09-25" "Git 2\&.47\&.0\&.rc0" "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-shortlog \- Summarize \*(Aqgit log\*(Aq output
35 \fIgit shortlog\fR [<options>] [<revision\-range>] [[\-\-] <path>\&...\:]
36 git log \-\-pretty=short | \fIgit shortlog\fR [<options>]
40 Summarizes \fIgit log\fR output in a format suitable for inclusion in release announcements\&. Each commit will be grouped by author and title\&.
42 Additionally, "[PATCH]" will be stripped from the commit description\&.
44 If no revisions are passed on the command line and either standard input is not a terminal or there is no current branch, \fIgit shortlog\fR will output a summary of the log read from standard input, without reference to the current repository\&.
49 Sort output according to the number of commits per author instead of author alphabetic order\&.
54 Suppress commit description and provide a commit count summary only\&.
59 Show the email address of each author\&.
64 Instead of the commit subject, use some other information to describe each commit\&.
66 can be any string accepted by the
69 \fIgit log\fR, such as
70 \fI* [%h] %s\fR\&. (See the "PRETTY FORMATS" section of
77 Each pretty\-printed commit will be rewrapped before it is shown\&.
86 Show dates formatted according to the given date string\&. (See the
88 option in the "Commit Formatting" section of
89 \fBgit-log\fR(1))\&. Useful with
90 \fB\-\-group=format:<format>\fR\&.
95 Group commits based on
98 option is specified, the default is
111 \fBauthor\fR, commits are grouped by author
122 \fBcommitter\fR, commits are grouped by committer (the same as
134 \fBtrailer:<field>\fR, the
136 is interpreted as a case\-insensitive commit message trailer (see
137 \fBgit-interpret-trailers\fR(1))\&. For example, if your project uses
139 trailers, you might want to see who has been reviewing with
140 \fBgit shortlog \-ns \-\-group=trailer:reviewed\-by\fR\&.
151 \fBformat:<format>\fR, any string accepted by the
154 \fIgit log\fR\&. (See the "PRETTY FORMATS" section of
157 Note that commits that do not include the trailer will not be counted\&. Likewise, commits with multiple trailers (e\&.g\&., multiple signoffs) may be counted more than once (but only once per unique trailer value in that commit)\&.
159 Shortlog will attempt to parse each trailer value as a
161 identity\&. If successful, the mailmap is applied and the email is omitted unless the
163 option is specified\&. If the value cannot be parsed as an identity, it will be taken literally and completely\&.
168 is specified multiple times, commits are counted under each value (but again, only once per unique value in that commit)\&. For example,
169 \fBgit shortlog \-\-group=author \-\-group=trailer:co\-authored\-by\fR
170 counts both authors and co\-authors\&.
176 \fB\-\-group=committer\fR\&.
179 \-w[<width>[,<indent1>[,<indent2>]]]
181 Linewrap the output by wrapping each line at
182 \fBwidth\fR\&. The first line of each entry is indented by
184 spaces, and the second and subsequent lines are indented by
190 default to 76, 6 and 9 respectively\&.
194 (zero) then indent the lines of the output without wrapping them\&.
199 Show only commits in the specified revision range\&. When no <revision\-range> is specified, it defaults to
201 (i\&.e\&. the whole history leading to the current commit)\&.
202 \fBorigin\&.\&.HEAD\fR
203 specifies all the commits reachable from the current commit (i\&.e\&.
204 \fBHEAD\fR), but not from
205 \fBorigin\fR\&. For a complete list of ways to spell <revision\-range>, see the "Specifying Ranges" section of
206 \fBgitrevisions\fR(7)\&.
211 Consider only commits that are enough to explain how the files that match the specified paths came to be\&.
213 Paths may need to be prefixed with
215 to separate them from options or the revision range, when confusion arises\&.
217 .SS "Commit Limiting"
219 Besides specifying a range of commits that should be listed using the special notations explained in the description, additional commit limiting may be applied\&.
221 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\&.
223 Note that these are applied before commit ordering and formatting options, such as \fB\-\-reverse\fR\&.
225 \-<number>, \-n <number>, \-\-max\-count=<number>
227 Limit the number of commits to output\&.
234 commits before starting to show the commit output\&.
237 \-\-since=<date>, \-\-after=<date>
239 Show commits more recent than a specific date\&.
242 \-\-since\-as\-filter=<date>
244 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\&.
247 \-\-until=<date>, \-\-before=<date>
249 Show commits older than a specific date\&.
252 \-\-author=<pattern>, \-\-committer=<pattern>
254 Limit the commits output to ones with author/committer header lines that match the specified pattern (regular expression)\&. With more than one
255 \fB\-\-author=<pattern>\fR, commits whose author matches any of the given patterns are chosen (similarly for multiple
256 \fB\-\-committer=<pattern>\fR)\&.
259 \-\-grep\-reflog=<pattern>
261 Limit the commits output to ones with reflog entries that match the specified pattern (regular expression)\&. With more than one
262 \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
263 \fB\-\-walk\-reflogs\fR
269 Limit the commits output to ones with a log message that matches the specified pattern (regular expression)\&. With more than one
270 \fB\-\-grep=<pattern>\fR, commits whose message matches any of the given patterns are chosen (but see
271 \fB\-\-all\-match\fR)\&.
275 is in effect, the message from the notes is matched as if it were part of the log message\&.
280 Limit the commits output to ones that match all given
281 \fB\-\-grep\fR, instead of ones that match at least one\&.
286 Limit the commits output to ones with a log message that do not match the pattern specified with
287 \fB\-\-grep=<pattern>\fR\&.
290 \-i, \-\-regexp\-ignore\-case
292 Match the regular expression limiting patterns without regard to letter case\&.
297 Consider the limiting patterns to be basic regular expressions; this is the default\&.
300 \-E, \-\-extended\-regexp
302 Consider the limiting patterns to be extended regular expressions instead of the default basic regular expressions\&.
305 \-F, \-\-fixed\-strings
307 Consider the limiting patterns to be fixed strings (don\(cqt interpret pattern as a regular expression)\&.
310 \-P, \-\-perl\-regexp
312 Consider the limiting patterns to be Perl\-compatible regular expressions\&.
314 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\&.
319 Stop when a given path disappears from the tree\&.
324 Print only merge commits\&. This is exactly the same as
325 \fB\-\-min\-parents=2\fR\&.
330 Do not print commits with more than one parent\&. This is exactly the same as
331 \fB\-\-max\-parents=1\fR\&.
334 \-\-min\-parents=<number>, \-\-max\-parents=<number>, \-\-no\-min\-parents, \-\-no\-max\-parents
336 Show only commits which have at least (or at most) that many parent commits\&. In particular,
337 \fB\-\-max\-parents=1\fR
339 \fB\-\-no\-merges\fR,
340 \fB\-\-min\-parents=2\fR
343 \fB\-\-max\-parents=0\fR
344 gives all root commits and
345 \fB\-\-min\-parents=3\fR
346 all octopus merges\&.
348 \fB\-\-no\-min\-parents\fR
350 \fB\-\-no\-max\-parents\fR
351 reset these limits (to no limit) again\&. Equivalent forms are
352 \fB\-\-min\-parents=0\fR
353 (any commit has 0 or more parents) and
354 \fB\-\-max\-parents=\-1\fR
355 (negative numbers denote no upper limit)\&.
360 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\&.
363 \-\-exclude\-first\-parent\-only
365 When finding commits to exclude (with a
366 \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\&.
371 Reverses the meaning of the
373 prefix (or lack thereof) for all following revision specifiers, up to the next
374 \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\&.
379 Pretend as if all the refs in
380 \fBrefs/\fR, along with
381 \fBHEAD\fR, are listed on the command line as
385 \-\-branches[=<pattern>]
387 Pretend as if all the refs in
389 are listed on the command line as
392 is given, limit branches to ones matching given shell glob\&. If pattern lacks
397 at the end is implied\&.
402 Pretend as if all the refs in
404 are listed on the command line as
407 is given, limit tags to ones matching given shell glob\&. If pattern lacks
412 at the end is implied\&.
415 \-\-remotes[=<pattern>]
417 Pretend as if all the refs in
419 are listed on the command line as
422 is given, limit remote\-tracking branches to ones matching given shell glob\&. If pattern lacks
427 at the end is implied\&.
430 \-\-glob=<glob\-pattern>
432 Pretend as if all the refs matching shell glob
433 \fI<glob\-pattern>\fR
434 are listed on the command line as
435 \fI<commit>\fR\&. Leading
436 \fIrefs/\fR, is automatically prepended if missing\&. If pattern lacks
441 at the end is implied\&.
444 \-\-exclude=<glob\-pattern>
446 Do not include refs matching
447 \fI<glob\-pattern>\fR
452 \fB\-\-remotes\fR, or
454 would otherwise consider\&. Repetitions of this option accumulate exclusion patterns up to the next
458 \fB\-\-remotes\fR, or
460 option (other options or arguments do not clear accumulated patterns)\&.
462 The patterns given should not begin with
469 \fB\-\-remotes\fR, respectively, and they must begin with
474 \fB\-\-all\fR\&. If a trailing
476 is intended, it must be given explicitly\&.
479 \-\-exclude\-hidden=[fetch|receive|uploadpack]
481 Do not include refs that would be hidden by
483 \fBgit\-receive\-pack\fR
485 \fBgit\-upload\-pack\fR
486 by consulting the appropriate
487 \fBfetch\&.hideRefs\fR,
488 \fBreceive\&.hideRefs\fR
490 \fBuploadpack\&.hideRefs\fR
491 configuration along with
492 \fBtransfer\&.hideRefs\fR
494 \fBgit-config\fR(1))\&. This option affects the next pseudo\-ref option
498 and is cleared after processing them\&.
503 Pretend as if all objects mentioned by reflogs are listed on the command line as
509 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
510 \fBobjects/info/alternates\fR\&. The set of included objects may be modified by
511 \fBcore\&.alternateRefsCommand\fR, etc\&. See
512 \fBgit-config\fR(1)\&.
517 By default, all working trees will be examined by the following options when there are more than one (see
518 \fBgit-worktree\fR(1)):
522 \fB\-\-indexed\-objects\fR\&. This option forces them to examine the current working tree only\&.
527 Upon seeing an invalid object name in the input, pretend as if the bad input was not given\&.
532 Pretend as if the bad bisection ref
533 \fBrefs/bisect/bad\fR
534 was listed and as if it was followed by
536 and the good bisection refs
537 \fBrefs/bisect/good\-*\fR
538 on the command line\&.
543 In addition to getting arguments from the command line, read them from standard input as well\&. This accepts commits and pseudo\-options like
546 \fB\-\-glob=\fR\&. When a
548 separator is seen, the following input is treated as paths and used to limit the result\&. Flags like
550 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\&.
556 \fB\-\-cherry\-pick\fR
557 (see below) but mark equivalent commits with
559 rather than omitting them, and inequivalent ones with
565 Omit any commit that introduces the same change as another commit on the
567 when the set of commits are limited with symmetric difference\&.
569 For example, if you have two branches,
572 \fBB\fR, a usual way to list all commits on only one side of them is with
573 \fB\-\-left\-right\fR
574 (see the example below in the description of the
575 \fB\-\-left\-right\fR
576 option)\&. However, it shows the commits that were cherry\-picked from the other branch (for example,
578 may be cherry\-picked from branch A)\&. With this option, such pairs of commits are excluded from the output\&.
581 \-\-left\-only, \-\-right\-only
583 List only commits on the respective side of a symmetric difference, i\&.e\&. only those which would be marked
588 \fB\-\-left\-right\fR\&.
591 \fB\-\-cherry\-pick \-\-right\-only A\&.\&.\&.B\fR
592 omits those commits from
596 or are patch\-equivalent to a commit in
597 \fBA\fR\&. In other words, this lists the
600 \fBgit cherry A B\fR\&. More precisely,
601 \fB\-\-cherry\-pick \-\-right\-only \-\-no\-merges\fR
602 gives the exact list\&.
608 \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
609 \fBgit log \-\-cherry upstream\&.\&.\&.mybranch\fR, similar to
610 \fBgit cherry upstream mybranch\fR\&.
613 \-g, \-\-walk\-reflogs
615 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,
617 \fIcommit1\&.\&.commit2\fR, and
618 \fIcommit1\&.\&.\&.commit2\fR
619 notations cannot be used)\&.
627 (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
631 is the reverse\-chronological index in the reflog) or as
632 \fBref@{<timestamp>}\fR
635 for that entry), depending on a few rules:
645 If the starting point is specified as
646 \fBref@{<Nth>}\fR, show the index format\&.
657 If the starting point was specified as
658 \fBref@{now}\fR, show the timestamp format\&.
669 If neither was used, but
671 was given on the command line, show the timestamp in the format requested by
683 Otherwise, show the index format\&.
687 \fB\-\-pretty=oneline\fR, the commit message is prefixed with this information on the same line\&. This option cannot be combined with
688 \fB\-\-reverse\fR\&. See also
689 \fBgit-reflog\fR(1)\&.
692 \fB\-\-pretty=reference\fR, this information will not be shown at all\&.
697 Show commits touching conflicted paths in the range
698 \fBHEAD\&.\&.\&.<other>\fR, where
700 is the first existing pseudoref in
702 \fBCHERRY_PICK_HEAD\fR,
705 \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\&.
710 Output excluded boundary commits\&. Boundary commits are prefixed with
713 .SS "History Simplification"
715 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\&.
717 The following options select the commits to be shown:
721 Commits modifying the given <paths> are selected\&.
724 \-\-simplify\-by\-decoration
726 Commits that are referred by some branch or tag are selected\&.
729 Note that extra commits can be shown to give a meaningful history\&.
731 The following options affect the way the simplification is performed:
735 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)
740 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\&.
745 Same as the default mode, but does not prune some history\&.
750 Only the selected commits are shown, plus some to have a meaningful history\&.
755 All commits in the simplified history are shown\&.
761 \fB\-\-full\-history\fR
762 to remove some needless merges from the resulting history, as there are no selected commits contributing to this merge\&.
765 \-\-ancestry\-path[=<commit>]
767 When given a range of commits to display (e\&.g\&.
768 \fIcommit1\&.\&.commit2\fR
770 \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
772 (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\&.
775 A more detailed explanation follows\&.
777 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\&.)
779 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:
785 \&.\-A\-\-\-M\-\-\-N\-\-\-O\-\-\-P\-\-\-Q
789 `\-\-\-\-\-\-\-\-\-\-\-\-\-\*(Aq X
795 The horizontal line of history A\-\-\-Q is taken to be the first parent of each merge\&. The commits are:
806 is the initial commit, in which
809 \(lqasdf\(rq, and a file
812 \(lqquux\(rq\&. Initial commits are compared to an empty tree, so
841 contains the same change as
844 is trivial and hence TREESAME to all parents\&.
857 \fBfoo\fR, but its merge
860 \(lqfoobar\(rq, so it is not TREESAME to any parent\&.
875 \(lqbaz\(rq\&. Its merge
877 combines the strings from
882 \(lqfoobarbaz\(rq; i\&.e\&., it is not TREESAME to any parent\&.
897 \(lqxyzzy\(rq, and its merge
899 combines the strings to
900 \(lqquux xyzzy\(rq\&.
916 is an independent root commit that added a new file
934 \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\&.
938 Commits are included if they are not TREESAME to any parent (though this can be changed, see
940 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\&.
956 Note how the rule to only follow the TREESAME parent, if one is available, removed
958 from consideration entirely\&.
961 \fBN\fR, but is TREESAME\&. Root commits are compared to an empty tree, so
965 Parent/child relations are only visible with
966 \fB\-\-parents\fR, but that does not affect the commits selected in default mode, so we have shown the parent lines\&.
969 \-\-full\-history without parent rewriting
971 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
984 was excluded because it is TREESAME to both parents\&.
989 were all walked, but only
991 was !TREESAME, so the others do not appear\&.
993 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\&.
996 \-\-full\-history with parent rewriting
998 Ordinary commits are only included if they are !TREESAME (though this can be changed, see
1002 Merges are always included\&. However, their parent list is rewritten: Along each parent, prune away commits that are not included themselves\&. This results in
1008 \&.\-A\-\-\-M\-\-\-N\-\-\-O\-\-\-P\-\-\-Q
1012 `\-\-\-\-\-\-\-\-\-\-\-\-\-\*(Aq
1019 \fB\-\-full\-history\fR
1020 without rewriting above\&. Note that
1022 was pruned away because it is TREESAME, but the parent list of P was rewritten to contain
1023 \fBE\fR\*(Aqs parent
1024 \fBI\fR\&. The same happened for
1034 In addition to the above settings, you can change whether TREESAME affects inclusion:
1038 Commits that are walked are included if they are not TREESAME to any parent\&.
1043 All commits that are walked are included\&.
1046 \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\&.
1049 \-\-simplify\-merges
1051 First, build a history graph in the same way that
1052 \fB\-\-full\-history\fR
1053 with parent rewriting does (see above)\&.
1055 Then simplify each commit
1059 in the final history according to the following rules:
1063 \h'-04'\(bu\h'+03'\c
1077 \h'-04'\(bu\h'+03'\c
1087 with its simplification
1088 \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\&.
1093 \h'-04'\(bu\h'+03'\c
1099 If after this parent rewriting,
1101 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\&.
1104 The effect of this is best shown by way of comparing to
1105 \fB\-\-full\-history\fR
1106 with parent rewriting\&. The example turns into:
1112 \&.\-A\-\-\-M\-\-\-N\-\-\-O
1116 `\-\-\-\-\-\-\-\-\-\*(Aq
1122 Note the major differences in
1127 \fB\-\-full\-history\fR:
1131 \h'-04'\(bu\h'+03'\c
1137 \fBN\fR\*(Aqs parent list had
1139 removed, because it is an ancestor of the other parent
1142 remained because it is !TREESAME\&.
1147 \h'-04'\(bu\h'+03'\c
1153 \fBP\fR\*(Aqs parent list similarly had
1157 was then removed completely, because it had one parent and is TREESAME\&.
1162 \h'-04'\(bu\h'+03'\c
1168 \fBQ\fR\*(Aqs parent list had
1173 was then removed, because it was a TREESAME root\&.
1175 was then removed completely, because it had one parent and is TREESAME\&.
1179 There is another simplification mode available:
1181 \-\-ancestry\-path[=<commit>]
1183 Limit the displayed commits to those which are an ancestor of <commit>, or which are a descendant of <commit>, or are <commit> itself\&.
1185 As an example use case, consider the following commit history:
1191 D\-\-\-E\-\-\-\-\-\-\-F
1193 B\-\-\-C\-\-\-G\-\-\-H\-\-\-I\-\-\-J
1195 A\-\-\-\-\-\-\-K\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-L\-\-M
1203 computes the set of commits that are ancestors of
1204 \fBM\fR, but excludes the ones that are ancestors of
1205 \fBD\fR\&. This is useful to see what happened to the history leading to
1208 \fBD\fR, in the sense that
1209 \(lqwhat does \fBM\fR have that did not exist in \fBD\fR\(rq\&. The result in this example would be all the commits, except
1215 itself, of course)\&.
1217 When we want to find out what commits in
1219 are contaminated with the bug introduced by
1221 and need fixing, however, we might want to view only the subset of
1223 that are actually descendants of
1224 \fBD\fR, i\&.e\&. excluding
1227 \fBK\fR\&. This is exactly what the
1228 \fB\-\-ancestry\-path\fR
1229 option does\&. Applied to the
1231 range, it results in:
1239 G\-\-\-H\-\-\-I\-\-\-J
1248 \fB\-\-ancestry\-path=D\fR
1250 \fB\-\-ancestry\-path\fR
1251 which means the same thing when applied to the
1253 range but is just more explicit\&.
1255 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
1257 which contain that topic in their ancestry path\&. So, using
1258 \fB\-\-ancestry\-path=H D\&.\&.M\fR
1259 for example would result in:
1267 G\-\-\-H\-\-\-I\-\-\-J
1276 \fB\-\-ancestry\-path=K D\&.\&.M\fR
1283 K\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-L\-\-M
1290 Before discussing another option, \fB\-\-show\-pulls\fR, we need to create a new example history\&.
1292 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:
1298 \&.\-A\-\-\-M\-\-\-\-\-C\-\-N\-\-\-O\-\-\-P
1300 I B \e R\-\*(Aq`\-Z\*(Aq /
1303 `\-\-\-X\-\-\*(Aq `\-\-\-Y\-\-\*(Aq
1309 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\&.
1311 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:
1323 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:
1329 \&.\-A\-\-\-M\-\-\-\-\-\-\-\-N\-\-\-O\-\-\-P
1331 I B \e R\-\*(Aq`\-\-\*(Aq /
1334 `\-\-\-X\-\-\*(Aq `\-\-\-\-\-\-\*(Aq
1340 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\&.
1342 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:
1348 \&.\-A\-\-\-M\-\-\&.
1359 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\&.
1361 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\&.
1363 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\&.
1367 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\&.
1369 When a merge commit is included by
1370 \fB\-\-show\-pulls\fR, the merge is treated as if it "pulled" the change from another branch\&. When using
1371 \fB\-\-show\-pulls\fR
1372 on this example (and no other options) the resulting graph is:
1378 I\-\-\-X\-\-\-R\-\-\-N
1384 Here, the merge commits
1388 are included because they pulled the commits
1392 into the base branch, respectively\&. These merges are the reason the commits
1396 do not appear in the default history\&.
1399 \fB\-\-show\-pulls\fR
1401 \fB\-\-simplify\-merges\fR, the graph includes all of the necessary information:
1407 \&.\-A\-\-\-M\-\-\&. N
1421 \fBR\fR, the edge from
1425 was simplified away\&. However,
1427 still appears in the history as an important commit because it "pulled" the change
1429 into the main branch\&.
1432 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)\&.
1433 .SH "MAPPING AUTHORS"
1435 See \fBgitmailmap\fR(5)\&.
1437 Note that if \fBgit shortlog\fR is run outside of a repository (to process log contents on standard input), it will look for a \fB\&.mailmap\fR file in the current directory\&.
1440 Part of the \fBgit\fR(1) suite