2 .\" Title: git-shortlog
3 .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author]
4 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
7 .\" Source: Git 2.44.0.rc1.17.g3e0d3cd5c7
10 .TH "GIT\-SHORTLOG" "1" "2024\-02\-15" "Git 2\&.44\&.0\&.rc1\&.17\&.g3" "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>]
41 Summarizes \fIgit log\fR output in a format suitable for inclusion in release announcements\&. Each commit will be grouped by author and title\&.
43 Additionally, "[PATCH]" will be stripped from the commit description\&.
45 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\&.
50 Sort output according to the number of commits per author instead of author alphabetic order\&.
55 Suppress commit description and provide a commit count summary only\&.
60 Show the email address of each author\&.
65 Instead of the commit subject, use some other information to describe each commit\&.
67 can be any string accepted by the
70 \fIgit log\fR, such as
71 \fI* [%h] %s\fR\&. (See the "PRETTY FORMATS" section of
78 Each pretty\-printed commit will be rewrapped before it is shown\&.
87 Show dates formatted according to the given date string\&. (See the
89 option in the "Commit Formatting" section of
90 \fBgit-log\fR(1))\&. Useful with
91 \fB\-\-group=format:<format>\fR\&.
96 Group commits based on
99 option is specified, the default is
112 \fBauthor\fR, commits are grouped by author
123 \fBcommitter\fR, commits are grouped by committer (the same as
135 \fBtrailer:<field>\fR, the
137 is interpreted as a case\-insensitive commit message trailer (see
138 \fBgit-interpret-trailers\fR(1))\&. For example, if your project uses
140 trailers, you might want to see who has been reviewing with
141 \fBgit shortlog \-ns \-\-group=trailer:reviewed\-by\fR\&.
152 \fBformat:<format>\fR, any string accepted by the
155 \fIgit log\fR\&. (See the "PRETTY FORMATS" section of
158 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)\&.
160 Shortlog will attempt to parse each trailer value as a
162 identity\&. If successful, the mailmap is applied and the email is omitted unless the
164 option is specified\&. If the value cannot be parsed as an identity, it will be taken literally and completely\&.
169 is specified multiple times, commits are counted under each value (but again, only once per unique value in that commit)\&. For example,
170 \fBgit shortlog \-\-group=author \-\-group=trailer:co\-authored\-by\fR
171 counts both authors and co\-authors\&.
177 \fB\-\-group=committer\fR\&.
180 \-w[<width>[,<indent1>[,<indent2>]]]
182 Linewrap the output by wrapping each line at
183 \fBwidth\fR\&. The first line of each entry is indented by
185 spaces, and the second and subsequent lines are indented by
191 default to 76, 6 and 9 respectively\&.
195 (zero) then indent the lines of the output without wrapping them\&.
200 Show only commits in the specified revision range\&. When no <revision\-range> is specified, it defaults to
202 (i\&.e\&. the whole history leading to the current commit)\&.
203 \fBorigin\&.\&.HEAD\fR
204 specifies all the commits reachable from the current commit (i\&.e\&.
205 \fBHEAD\fR), but not from
206 \fBorigin\fR\&. For a complete list of ways to spell <revision\-range>, see the "Specifying Ranges" section of
207 \fBgitrevisions\fR(7)\&.
212 Consider only commits that are enough to explain how the files that match the specified paths came to be\&.
214 Paths may need to be prefixed with
216 to separate them from options or the revision range, when confusion arises\&.
218 .SS "Commit Limiting"
220 Besides specifying a range of commits that should be listed using the special notations explained in the description, additional commit limiting may be applied\&.
222 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\&.
224 Note that these are applied before commit ordering and formatting options, such as \fB\-\-reverse\fR\&.
226 \-<number>, \-n <number>, \-\-max\-count=<number>
228 Limit the number of commits to output\&.
235 commits before starting to show the commit output\&.
238 \-\-since=<date>, \-\-after=<date>
240 Show commits more recent than a specific date\&.
243 \-\-since\-as\-filter=<date>
245 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\&.
248 \-\-until=<date>, \-\-before=<date>
250 Show commits older than a specific date\&.
253 \-\-author=<pattern>, \-\-committer=<pattern>
255 Limit the commits output to ones with author/committer header lines that match the specified pattern (regular expression)\&. With more than one
256 \fB\-\-author=<pattern>\fR, commits whose author matches any of the given patterns are chosen (similarly for multiple
257 \fB\-\-committer=<pattern>\fR)\&.
260 \-\-grep\-reflog=<pattern>
262 Limit the commits output to ones with reflog entries that match the specified pattern (regular expression)\&. With more than one
263 \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
264 \fB\-\-walk\-reflogs\fR
270 Limit the commits output to ones with a log message that matches the specified pattern (regular expression)\&. With more than one
271 \fB\-\-grep=<pattern>\fR, commits whose message matches any of the given patterns are chosen (but see
272 \fB\-\-all\-match\fR)\&.
276 is in effect, the message from the notes is matched as if it were part of the log message\&.
281 Limit the commits output to ones that match all given
282 \fB\-\-grep\fR, instead of ones that match at least one\&.
287 Limit the commits output to ones with a log message that do not match the pattern specified with
288 \fB\-\-grep=<pattern>\fR\&.
291 \-i, \-\-regexp\-ignore\-case
293 Match the regular expression limiting patterns without regard to letter case\&.
298 Consider the limiting patterns to be basic regular expressions; this is the default\&.
301 \-E, \-\-extended\-regexp
303 Consider the limiting patterns to be extended regular expressions instead of the default basic regular expressions\&.
306 \-F, \-\-fixed\-strings
308 Consider the limiting patterns to be fixed strings (don\(cqt interpret pattern as a regular expression)\&.
311 \-P, \-\-perl\-regexp
313 Consider the limiting patterns to be Perl\-compatible regular expressions\&.
315 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\&.
320 Stop when a given path disappears from the tree\&.
325 Print only merge commits\&. This is exactly the same as
326 \fB\-\-min\-parents=2\fR\&.
331 Do not print commits with more than one parent\&. This is exactly the same as
332 \fB\-\-max\-parents=1\fR\&.
335 \-\-min\-parents=<number>, \-\-max\-parents=<number>, \-\-no\-min\-parents, \-\-no\-max\-parents
337 Show only commits which have at least (or at most) that many parent commits\&. In particular,
338 \fB\-\-max\-parents=1\fR
340 \fB\-\-no\-merges\fR,
341 \fB\-\-min\-parents=2\fR
344 \fB\-\-max\-parents=0\fR
345 gives all root commits and
346 \fB\-\-min\-parents=3\fR
347 all octopus merges\&.
349 \fB\-\-no\-min\-parents\fR
351 \fB\-\-no\-max\-parents\fR
352 reset these limits (to no limit) again\&. Equivalent forms are
353 \fB\-\-min\-parents=0\fR
354 (any commit has 0 or more parents) and
355 \fB\-\-max\-parents=\-1\fR
356 (negative numbers denote no upper limit)\&.
361 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\&.
364 \-\-exclude\-first\-parent\-only
366 When finding commits to exclude (with a
367 \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\&.
372 Reverses the meaning of the
374 prefix (or lack thereof) for all following revision specifiers, up to the next
375 \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\&.
380 Pretend as if all the refs in
381 \fBrefs/\fR, along with
382 \fBHEAD\fR, are listed on the command line as
386 \-\-branches[=<pattern>]
388 Pretend as if all the refs in
390 are listed on the command line as
393 is given, limit branches to ones matching given shell glob\&. If pattern lacks
398 at the end is implied\&.
403 Pretend as if all the refs in
405 are listed on the command line as
408 is given, limit tags to ones matching given shell glob\&. If pattern lacks
413 at the end is implied\&.
416 \-\-remotes[=<pattern>]
418 Pretend as if all the refs in
420 are listed on the command line as
423 is given, limit remote\-tracking branches to ones matching given shell glob\&. If pattern lacks
428 at the end is implied\&.
431 \-\-glob=<glob\-pattern>
433 Pretend as if all the refs matching shell glob
434 \fI<glob\-pattern>\fR
435 are listed on the command line as
436 \fI<commit>\fR\&. Leading
437 \fIrefs/\fR, is automatically prepended if missing\&. If pattern lacks
442 at the end is implied\&.
445 \-\-exclude=<glob\-pattern>
447 Do not include refs matching
448 \fI<glob\-pattern>\fR
453 \fB\-\-remotes\fR, or
455 would otherwise consider\&. Repetitions of this option accumulate exclusion patterns up to the next
459 \fB\-\-remotes\fR, or
461 option (other options or arguments do not clear accumulated patterns)\&.
463 The patterns given should not begin with
470 \fB\-\-remotes\fR, respectively, and they must begin with
475 \fB\-\-all\fR\&. If a trailing
477 is intended, it must be given explicitly\&.
480 \-\-exclude\-hidden=[fetch|receive|uploadpack]
482 Do not include refs that would be hidden by
484 \fBgit\-receive\-pack\fR
486 \fBgit\-upload\-pack\fR
487 by consulting the appropriate
488 \fBfetch\&.hideRefs\fR,
489 \fBreceive\&.hideRefs\fR
491 \fBuploadpack\&.hideRefs\fR
492 configuration along with
493 \fBtransfer\&.hideRefs\fR
495 \fBgit-config\fR(1))\&. This option affects the next pseudo\-ref option
499 and is cleared after processing them\&.
504 Pretend as if all objects mentioned by reflogs are listed on the command line as
510 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
511 \fBobjects/info/alternates\fR\&. The set of included objects may be modified by
512 \fBcore\&.alternateRefsCommand\fR, etc\&. See
513 \fBgit-config\fR(1)\&.
518 By default, all working trees will be examined by the following options when there are more than one (see
519 \fBgit-worktree\fR(1)):
523 \fB\-\-indexed\-objects\fR\&. This option forces them to examine the current working tree only\&.
528 Upon seeing an invalid object name in the input, pretend as if the bad input was not given\&.
533 Pretend as if the bad bisection ref
534 \fBrefs/bisect/bad\fR
535 was listed and as if it was followed by
537 and the good bisection refs
538 \fBrefs/bisect/good\-*\fR
539 on the command line\&.
544 In addition to getting arguments from the command line, read them from standard input as well\&. This accepts commits and pseudo\-options like
547 \fB\-\-glob=\fR\&. When a
549 separator is seen, the following input is treated as paths and used to limit the result\&. Flags like
551 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\&.
557 \fB\-\-cherry\-pick\fR
558 (see below) but mark equivalent commits with
560 rather than omitting them, and inequivalent ones with
566 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\&.
568 For example, if you have two branches,
571 \fBB\fR, a usual way to list all commits on only one side of them is with
572 \fB\-\-left\-right\fR
573 (see the example below in the description of the
574 \fB\-\-left\-right\fR
575 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\&.
578 \-\-left\-only, \-\-right\-only
580 List only commits on the respective side of a symmetric difference, i\&.e\&. only those which would be marked
585 \fB\-\-left\-right\fR\&.
588 \fB\-\-cherry\-pick \-\-right\-only A\&.\&.\&.B\fR
589 omits those commits from
593 or are patch\-equivalent to a commit in
594 \fBA\fR\&. In other words, this lists the
597 \fBgit cherry A B\fR\&. More precisely,
598 \fB\-\-cherry\-pick \-\-right\-only \-\-no\-merges\fR
599 gives the exact list\&.
605 \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
606 \fBgit log \-\-cherry upstream\&.\&.\&.mybranch\fR, similar to
607 \fBgit cherry upstream mybranch\fR\&.
610 \-g, \-\-walk\-reflogs
612 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,
614 \fIcommit1\&.\&.commit2\fR, and
615 \fIcommit1\&.\&.\&.commit2\fR
616 notations cannot be used)\&.
624 (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
628 is the reverse\-chronological index in the reflog) or as
629 \fBref@{timestamp}\fR
630 (with the timestamp for that entry), depending on a few rules:
640 If the starting point is specified as
641 \fBref@{Nth}\fR, show the index format\&.
652 If the starting point was specified as
653 \fBref@{now}\fR, show the timestamp format\&.
664 If neither was used, but
666 was given on the command line, show the timestamp in the format requested by
678 Otherwise, show the index format\&.
682 \fB\-\-pretty=oneline\fR, the commit message is prefixed with this information on the same line\&. This option cannot be combined with
683 \fB\-\-reverse\fR\&. See also
684 \fBgit-reflog\fR(1)\&.
687 \fB\-\-pretty=reference\fR, this information will not be shown at all\&.
692 After a failed merge, show refs that touch files having a conflict and don\(cqt exist on all heads to merge\&.
697 Output excluded boundary commits\&. Boundary commits are prefixed with
700 .SS "History Simplification"
702 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\&.
704 The following options select the commits to be shown:
708 Commits modifying the given <paths> are selected\&.
711 \-\-simplify\-by\-decoration
713 Commits that are referred by some branch or tag are selected\&.
716 Note that extra commits can be shown to give a meaningful history\&.
718 The following options affect the way the simplification is performed:
722 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)
727 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\&.
732 Same as the default mode, but does not prune some history\&.
737 Only the selected commits are shown, plus some to have a meaningful history\&.
742 All commits in the simplified history are shown\&.
748 \fB\-\-full\-history\fR
749 to remove some needless merges from the resulting history, as there are no selected commits contributing to this merge\&.
752 \-\-ancestry\-path[=<commit>]
754 When given a range of commits to display (e\&.g\&.
755 \fIcommit1\&.\&.commit2\fR
757 \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
759 (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\&.
762 A more detailed explanation follows\&.
764 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\&.)
766 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:
772 \&.\-A\-\-\-M\-\-\-N\-\-\-O\-\-\-P\-\-\-Q
776 `\-\-\-\-\-\-\-\-\-\-\-\-\-\*(Aq X
783 The horizontal line of history A\-\-\-Q is taken to be the first parent of each merge\&. The commits are:
794 is the initial commit, in which
796 exists with contents \(lqasdf\(rq, and a file
798 exists with contents \(lqquux\(rq\&. Initial commits are compared to an empty tree, so
814 contains just \(lqfoo\(rq\&.
826 contains the same change as
829 is trivial and hence TREESAME to all parents\&.
842 \fBfoo\fR, but its merge
844 changes it to \(lqfoobar\(rq, so it is not TREESAME to any parent\&.
858 to \(lqbaz\(rq\&. Its merge
860 combines the strings from
864 to \(lqfoobarbaz\(rq; i\&.e\&., it is not TREESAME to any parent\&.
878 to \(lqxyzzy\(rq, and its merge
880 combines the strings to \(lqquux xyzzy\(rq\&.
896 is an independent root commit that added a new file
914 \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\&.
918 Commits are included if they are not TREESAME to any parent (though this can be changed, see
920 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\&.
936 Note how the rule to only follow the TREESAME parent, if one is available, removed
938 from consideration entirely\&.
941 \fBN\fR, but is TREESAME\&. Root commits are compared to an empty tree, so
945 Parent/child relations are only visible with
946 \fB\-\-parents\fR, but that does not affect the commits selected in default mode, so we have shown the parent lines\&.
949 \-\-full\-history without parent rewriting
951 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
964 was excluded because it is TREESAME to both parents\&.
969 were all walked, but only
971 was !TREESAME, so the others do not appear\&.
973 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\&.
976 \-\-full\-history with parent rewriting
978 Ordinary commits are only included if they are !TREESAME (though this can be changed, see
982 Merges are always included\&. However, their parent list is rewritten: Along each parent, prune away commits that are not included themselves\&. This results in
988 \&.\-A\-\-\-M\-\-\-N\-\-\-O\-\-\-P\-\-\-Q
992 `\-\-\-\-\-\-\-\-\-\-\-\-\-\*(Aq
999 \fB\-\-full\-history\fR
1000 without rewriting above\&. Note that
1002 was pruned away because it is TREESAME, but the parent list of P was rewritten to contain
1003 \fBE\fR\*(Aqs parent
1004 \fBI\fR\&. The same happened for
1014 In addition to the above settings, you can change whether TREESAME affects inclusion:
1018 Commits that are walked are included if they are not TREESAME to any parent\&.
1023 All commits that are walked are included\&.
1026 \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\&.
1029 \-\-simplify\-merges
1031 First, build a history graph in the same way that
1032 \fB\-\-full\-history\fR
1033 with parent rewriting does (see above)\&.
1035 Then simplify each commit
1039 in the final history according to the following rules:
1043 \h'-04'\(bu\h'+03'\c
1057 \h'-04'\(bu\h'+03'\c
1067 with its simplification
1068 \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\&.
1073 \h'-04'\(bu\h'+03'\c
1079 If after this parent rewriting,
1081 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\&.
1084 The effect of this is best shown by way of comparing to
1085 \fB\-\-full\-history\fR
1086 with parent rewriting\&. The example turns into:
1092 \&.\-A\-\-\-M\-\-\-N\-\-\-O
1096 `\-\-\-\-\-\-\-\-\-\*(Aq
1102 Note the major differences in
1107 \fB\-\-full\-history\fR:
1111 \h'-04'\(bu\h'+03'\c
1117 \fBN\fR\*(Aqs parent list had
1119 removed, because it is an ancestor of the other parent
1122 remained because it is !TREESAME\&.
1127 \h'-04'\(bu\h'+03'\c
1133 \fBP\fR\*(Aqs parent list similarly had
1137 was then removed completely, because it had one parent and is TREESAME\&.
1142 \h'-04'\(bu\h'+03'\c
1148 \fBQ\fR\*(Aqs parent list had
1153 was then removed, because it was a TREESAME root\&.
1155 was then removed completely, because it had one parent and is TREESAME\&.
1159 There is another simplification mode available:
1161 \-\-ancestry\-path[=<commit>]
1163 Limit the displayed commits to those which are an ancestor of <commit>, or which are a descendant of <commit>, or are <commit> itself\&.
1165 As an example use case, consider the following commit history:
1171 D\-\-\-E\-\-\-\-\-\-\-F
1173 B\-\-\-C\-\-\-G\-\-\-H\-\-\-I\-\-\-J
1175 A\-\-\-\-\-\-\-K\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-L\-\-M
1183 computes the set of commits that are ancestors of
1184 \fBM\fR, but excludes the ones that are ancestors of
1185 \fBD\fR\&. This is useful to see what happened to the history leading to
1188 \fBD\fR, in the sense that \(lqwhat does
1190 have that did not exist in
1191 \fBD\fR\(rq\&. The result in this example would be all the commits, except
1197 itself, of course)\&.
1199 When we want to find out what commits in
1201 are contaminated with the bug introduced by
1203 and need fixing, however, we might want to view only the subset of
1205 that are actually descendants of
1206 \fBD\fR, i\&.e\&. excluding
1209 \fBK\fR\&. This is exactly what the
1210 \fB\-\-ancestry\-path\fR
1211 option does\&. Applied to the
1213 range, it results in:
1221 G\-\-\-H\-\-\-I\-\-\-J
1230 \fB\-\-ancestry\-path=D\fR
1232 \fB\-\-ancestry\-path\fR
1233 which means the same thing when applied to the
1235 range but is just more explicit\&.
1237 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
1239 which contain that topic in their ancestry path\&. So, using
1240 \fB\-\-ancestry\-path=H D\&.\&.M\fR
1241 for example would result in:
1249 G\-\-\-H\-\-\-I\-\-\-J
1258 \fB\-\-ancestry\-path=K D\&.\&.M\fR
1265 K\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-L\-\-M
1273 Before discussing another option, \fB\-\-show\-pulls\fR, we need to create a new example history\&.
1275 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:
1281 \&.\-A\-\-\-M\-\-\-\-\-C\-\-N\-\-\-O\-\-\-P
1283 I B \e R\-\*(Aq`\-Z\*(Aq /
1286 `\-\-\-X\-\-\*(Aq `\-\-\-Y\-\-\*(Aq
1293 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\&.
1295 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:
1308 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:
1314 \&.\-A\-\-\-M\-\-\-\-\-\-\-\-N\-\-\-O\-\-\-P
1316 I B \e R\-\*(Aq`\-\-\*(Aq /
1319 `\-\-\-X\-\-\*(Aq `\-\-\-\-\-\-\*(Aq
1326 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\&.
1328 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:
1334 \&.\-A\-\-\-M\-\-\&.
1346 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\&.
1348 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\&.
1350 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\&.
1354 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\&.
1356 When a merge commit is included by
1357 \fB\-\-show\-pulls\fR, the merge is treated as if it "pulled" the change from another branch\&. When using
1358 \fB\-\-show\-pulls\fR
1359 on this example (and no other options) the resulting graph is:
1365 I\-\-\-X\-\-\-R\-\-\-N
1371 Here, the merge commits
1375 are included because they pulled the commits
1379 into the base branch, respectively\&. These merges are the reason the commits
1383 do not appear in the default history\&.
1386 \fB\-\-show\-pulls\fR
1388 \fB\-\-simplify\-merges\fR, the graph includes all of the necessary information:
1394 \&.\-A\-\-\-M\-\-\&. N
1408 \fBR\fR, the edge from
1412 was simplified away\&. However,
1414 still appears in the history as an important commit because it "pulled" the change
1416 into the main branch\&.
1419 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)\&.
1420 .SH "MAPPING AUTHORS"
1422 See \fBgitmailmap\fR(5)\&.
1424 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\&.
1427 Part of the \fBgit\fR(1) suite