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.46.0.rc0.75.g04f5a52757
10 .TH "GIT\-SHORTLOG" "1" "2024\-07\-16" "Git 2\&.46\&.0\&.rc0\&.75\&.g0" "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
632 for that entry), depending on a few rules:
642 If the starting point is specified as
643 \fBref@{<Nth>}\fR, show the index format\&.
654 If the starting point was specified as
655 \fBref@{now}\fR, show the timestamp format\&.
666 If neither was used, but
668 was given on the command line, show the timestamp in the format requested by
680 Otherwise, show the index format\&.
684 \fB\-\-pretty=oneline\fR, the commit message is prefixed with this information on the same line\&. This option cannot be combined with
685 \fB\-\-reverse\fR\&. See also
686 \fBgit-reflog\fR(1)\&.
689 \fB\-\-pretty=reference\fR, this information will not be shown at all\&.
694 Show commits touching conflicted paths in the range
695 \fBHEAD\&.\&.\&.<other>\fR, where
697 is the first existing pseudoref in
699 \fBCHERRY_PICK_HEAD\fR,
702 \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\&.
707 Output excluded boundary commits\&. Boundary commits are prefixed with
710 .SS "History Simplification"
712 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\&.
714 The following options select the commits to be shown:
718 Commits modifying the given <paths> are selected\&.
721 \-\-simplify\-by\-decoration
723 Commits that are referred by some branch or tag are selected\&.
726 Note that extra commits can be shown to give a meaningful history\&.
728 The following options affect the way the simplification is performed:
732 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)
737 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\&.
742 Same as the default mode, but does not prune some history\&.
747 Only the selected commits are shown, plus some to have a meaningful history\&.
752 All commits in the simplified history are shown\&.
758 \fB\-\-full\-history\fR
759 to remove some needless merges from the resulting history, as there are no selected commits contributing to this merge\&.
762 \-\-ancestry\-path[=<commit>]
764 When given a range of commits to display (e\&.g\&.
765 \fIcommit1\&.\&.commit2\fR
767 \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
769 (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\&.
772 A more detailed explanation follows\&.
774 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\&.)
776 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:
782 \&.\-A\-\-\-M\-\-\-N\-\-\-O\-\-\-P\-\-\-Q
786 `\-\-\-\-\-\-\-\-\-\-\-\-\-\*(Aq X
793 The horizontal line of history A\-\-\-Q is taken to be the first parent of each merge\&. The commits are:
804 is the initial commit, in which
806 exists with contents \(lqasdf\(rq, and a file
808 exists with contents \(lqquux\(rq\&. Initial commits are compared to an empty tree, so
824 contains just \(lqfoo\(rq\&.
836 contains the same change as
839 is trivial and hence TREESAME to all parents\&.
852 \fBfoo\fR, but its merge
854 changes it to \(lqfoobar\(rq, so it is not TREESAME to any parent\&.
868 to \(lqbaz\(rq\&. Its merge
870 combines the strings from
874 to \(lqfoobarbaz\(rq; i\&.e\&., it is not TREESAME to any parent\&.
888 to \(lqxyzzy\(rq, and its merge
890 combines the strings to \(lqquux xyzzy\(rq\&.
906 is an independent root commit that added a new file
924 \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\&.
928 Commits are included if they are not TREESAME to any parent (though this can be changed, see
930 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\&.
946 Note how the rule to only follow the TREESAME parent, if one is available, removed
948 from consideration entirely\&.
951 \fBN\fR, but is TREESAME\&. Root commits are compared to an empty tree, so
955 Parent/child relations are only visible with
956 \fB\-\-parents\fR, but that does not affect the commits selected in default mode, so we have shown the parent lines\&.
959 \-\-full\-history without parent rewriting
961 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
974 was excluded because it is TREESAME to both parents\&.
979 were all walked, but only
981 was !TREESAME, so the others do not appear\&.
983 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\&.
986 \-\-full\-history with parent rewriting
988 Ordinary commits are only included if they are !TREESAME (though this can be changed, see
992 Merges are always included\&. However, their parent list is rewritten: Along each parent, prune away commits that are not included themselves\&. This results in
998 \&.\-A\-\-\-M\-\-\-N\-\-\-O\-\-\-P\-\-\-Q
1002 `\-\-\-\-\-\-\-\-\-\-\-\-\-\*(Aq
1009 \fB\-\-full\-history\fR
1010 without rewriting above\&. Note that
1012 was pruned away because it is TREESAME, but the parent list of P was rewritten to contain
1013 \fBE\fR\*(Aqs parent
1014 \fBI\fR\&. The same happened for
1024 In addition to the above settings, you can change whether TREESAME affects inclusion:
1028 Commits that are walked are included if they are not TREESAME to any parent\&.
1033 All commits that are walked are included\&.
1036 \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\&.
1039 \-\-simplify\-merges
1041 First, build a history graph in the same way that
1042 \fB\-\-full\-history\fR
1043 with parent rewriting does (see above)\&.
1045 Then simplify each commit
1049 in the final history according to the following rules:
1053 \h'-04'\(bu\h'+03'\c
1067 \h'-04'\(bu\h'+03'\c
1077 with its simplification
1078 \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\&.
1083 \h'-04'\(bu\h'+03'\c
1089 If after this parent rewriting,
1091 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\&.
1094 The effect of this is best shown by way of comparing to
1095 \fB\-\-full\-history\fR
1096 with parent rewriting\&. The example turns into:
1102 \&.\-A\-\-\-M\-\-\-N\-\-\-O
1106 `\-\-\-\-\-\-\-\-\-\*(Aq
1112 Note the major differences in
1117 \fB\-\-full\-history\fR:
1121 \h'-04'\(bu\h'+03'\c
1127 \fBN\fR\*(Aqs parent list had
1129 removed, because it is an ancestor of the other parent
1132 remained because it is !TREESAME\&.
1137 \h'-04'\(bu\h'+03'\c
1143 \fBP\fR\*(Aqs parent list similarly had
1147 was then removed completely, because it had one parent and is TREESAME\&.
1152 \h'-04'\(bu\h'+03'\c
1158 \fBQ\fR\*(Aqs parent list had
1163 was then removed, because it was a TREESAME root\&.
1165 was then removed completely, because it had one parent and is TREESAME\&.
1169 There is another simplification mode available:
1171 \-\-ancestry\-path[=<commit>]
1173 Limit the displayed commits to those which are an ancestor of <commit>, or which are a descendant of <commit>, or are <commit> itself\&.
1175 As an example use case, consider the following commit history:
1181 D\-\-\-E\-\-\-\-\-\-\-F
1183 B\-\-\-C\-\-\-G\-\-\-H\-\-\-I\-\-\-J
1185 A\-\-\-\-\-\-\-K\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-L\-\-M
1193 computes the set of commits that are ancestors of
1194 \fBM\fR, but excludes the ones that are ancestors of
1195 \fBD\fR\&. This is useful to see what happened to the history leading to
1198 \fBD\fR, in the sense that \(lqwhat does
1200 have that did not exist in
1201 \fBD\fR\(rq\&. The result in this example would be all the commits, except
1207 itself, of course)\&.
1209 When we want to find out what commits in
1211 are contaminated with the bug introduced by
1213 and need fixing, however, we might want to view only the subset of
1215 that are actually descendants of
1216 \fBD\fR, i\&.e\&. excluding
1219 \fBK\fR\&. This is exactly what the
1220 \fB\-\-ancestry\-path\fR
1221 option does\&. Applied to the
1223 range, it results in:
1231 G\-\-\-H\-\-\-I\-\-\-J
1240 \fB\-\-ancestry\-path=D\fR
1242 \fB\-\-ancestry\-path\fR
1243 which means the same thing when applied to the
1245 range but is just more explicit\&.
1247 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
1249 which contain that topic in their ancestry path\&. So, using
1250 \fB\-\-ancestry\-path=H D\&.\&.M\fR
1251 for example would result in:
1259 G\-\-\-H\-\-\-I\-\-\-J
1268 \fB\-\-ancestry\-path=K D\&.\&.M\fR
1275 K\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-L\-\-M
1283 Before discussing another option, \fB\-\-show\-pulls\fR, we need to create a new example history\&.
1285 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:
1291 \&.\-A\-\-\-M\-\-\-\-\-C\-\-N\-\-\-O\-\-\-P
1293 I B \e R\-\*(Aq`\-Z\*(Aq /
1296 `\-\-\-X\-\-\*(Aq `\-\-\-Y\-\-\*(Aq
1303 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\&.
1305 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:
1318 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:
1324 \&.\-A\-\-\-M\-\-\-\-\-\-\-\-N\-\-\-O\-\-\-P
1326 I B \e R\-\*(Aq`\-\-\*(Aq /
1329 `\-\-\-X\-\-\*(Aq `\-\-\-\-\-\-\*(Aq
1336 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\&.
1338 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:
1344 \&.\-A\-\-\-M\-\-\&.
1356 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\&.
1358 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\&.
1360 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\&.
1364 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\&.
1366 When a merge commit is included by
1367 \fB\-\-show\-pulls\fR, the merge is treated as if it "pulled" the change from another branch\&. When using
1368 \fB\-\-show\-pulls\fR
1369 on this example (and no other options) the resulting graph is:
1375 I\-\-\-X\-\-\-R\-\-\-N
1381 Here, the merge commits
1385 are included because they pulled the commits
1389 into the base branch, respectively\&. These merges are the reason the commits
1393 do not appear in the default history\&.
1396 \fB\-\-show\-pulls\fR
1398 \fB\-\-simplify\-merges\fR, the graph includes all of the necessary information:
1404 \&.\-A\-\-\-M\-\-\&. N
1418 \fBR\fR, the edge from
1422 was simplified away\&. However,
1424 still appears in the history as an important commit because it "pulled" the change
1426 into the main branch\&.
1429 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)\&.
1430 .SH "MAPPING AUTHORS"
1432 See \fBgitmailmap\fR(5)\&.
1434 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\&.
1437 Part of the \fBgit\fR(1) suite