1GIT-SHORTLOG(1) Git Manual GIT-SHORTLOG(1)
2
3
4
6 git-shortlog - Summarize 'git log' output
7
9 git shortlog [<options>] [<revision-range>] [[--] <path>...]
10 git log --pretty=short | git shortlog [<options>]
11
13 Summarizes git log output in a format suitable for inclusion in release
14 announcements. Each commit will be grouped by author and title.
15
16 Additionally, "[PATCH]" will be stripped from the commit description.
17
18 If no revisions are passed on the command line and either standard
19 input is not a terminal or there is no current branch, git shortlog
20 will output a summary of the log read from standard input, without
21 reference to the current repository.
22
24 -n, --numbered
25 Sort output according to the number of commits per author instead
26 of author alphabetic order.
27
28 -s, --summary
29 Suppress commit description and provide a commit count summary
30 only.
31
32 -e, --email
33 Show the email address of each author.
34
35 --format[=<format>]
36 Instead of the commit subject, use some other information to
37 describe each commit. <format> can be any string accepted by the
38 --format option of git log, such as * [%h] %s. (See the "PRETTY
39 FORMATS" section of git-log(1).)
40
41 Each pretty-printed commit will be rewrapped before it is shown.
42
43 --date=<format>
44 Show dates formatted according to the given date string. (See the
45 --date option in the "Commit Formatting" section of git-log(1)).
46 Useful with --group=format:<format>.
47
48 --group=<type>
49 Group commits based on <type>. If no --group option is specified,
50 the default is author. <type> is one of:
51
52 • author, commits are grouped by author
53
54 • committer, commits are grouped by committer (the same as -c)
55
56 • trailer:<field>, the <field> is interpreted as a
57 case-insensitive commit message trailer (see git-interpret-
58 trailers(1)). For example, if your project uses Reviewed-by
59 trailers, you might want to see who has been reviewing with git
60 shortlog -ns --group=trailer:reviewed-by.
61
62 • format:<format>, any string accepted by the --format option of
63 git log. (See the "PRETTY FORMATS" section of git-log(1).)
64
65 Note that commits that do not include the trailer will not be
66 counted. Likewise, commits with multiple trailers (e.g.,
67 multiple signoffs) may be counted more than once (but only once
68 per unique trailer value in that commit).
69
70 Shortlog will attempt to parse each trailer value as a name
71 <email> identity. If successful, the mailmap is applied and the
72 email is omitted unless the --email option is specified. If the
73 value cannot be parsed as an identity, it will be taken
74 literally and completely.
75
76 If --group is specified multiple times, commits are counted under
77 each value (but again, only once per unique value in that commit).
78 For example, git shortlog --group=author
79 --group=trailer:co-authored-by counts both authors and co-authors.
80
81 -c, --committer
82 This is an alias for --group=committer.
83
84 -w[<width>[,<indent1>[,<indent2>]]]
85 Linewrap the output by wrapping each line at width. The first line
86 of each entry is indented by indent1 spaces, and the second and
87 subsequent lines are indented by indent2 spaces. width, indent1,
88 and indent2 default to 76, 6 and 9 respectively.
89
90 If width is 0 (zero) then indent the lines of the output without
91 wrapping them.
92
93 <revision-range>
94 Show only commits in the specified revision range. When no
95 <revision-range> is specified, it defaults to HEAD (i.e. the whole
96 history leading to the current commit). origin..HEAD specifies all
97 the commits reachable from the current commit (i.e. HEAD), but not
98 from origin. For a complete list of ways to spell <revision-range>,
99 see the "Specifying Ranges" section of gitrevisions(7).
100
101 [--] <path>...
102 Consider only commits that are enough to explain how the files that
103 match the specified paths came to be.
104
105 Paths may need to be prefixed with -- to separate them from options
106 or the revision range, when confusion arises.
107
108 Commit Limiting
109 Besides specifying a range of commits that should be listed using the
110 special notations explained in the description, additional commit
111 limiting may be applied.
112
113 Using more options generally further limits the output (e.g.
114 --since=<date1> limits to commits newer than <date1>, and using it with
115 --grep=<pattern> further limits to commits whose log message has a line
116 that matches <pattern>), unless otherwise noted.
117
118 Note that these are applied before commit ordering and formatting
119 options, such as --reverse.
120
121 -<number>, -n <number>, --max-count=<number>
122 Limit the number of commits to output.
123
124 --skip=<number>
125 Skip number commits before starting to show the commit output.
126
127 --since=<date>, --after=<date>
128 Show commits more recent than a specific date.
129
130 --since-as-filter=<date>
131 Show all commits more recent than a specific date. This visits all
132 commits in the range, rather than stopping at the first commit
133 which is older than a specific date.
134
135 --until=<date>, --before=<date>
136 Show commits older than a specific date.
137
138 --author=<pattern>, --committer=<pattern>
139 Limit the commits output to ones with author/committer header lines
140 that match the specified pattern (regular expression). With more
141 than one --author=<pattern>, commits whose author matches any of
142 the given patterns are chosen (similarly for multiple
143 --committer=<pattern>).
144
145 --grep-reflog=<pattern>
146 Limit the commits output to ones with reflog entries that match the
147 specified pattern (regular expression). With more than one
148 --grep-reflog, commits whose reflog message matches any of the
149 given patterns are chosen. It is an error to use this option unless
150 --walk-reflogs is in use.
151
152 --grep=<pattern>
153 Limit the commits output to ones with a log message that matches
154 the specified pattern (regular expression). With more than one
155 --grep=<pattern>, commits whose message matches any of the given
156 patterns are chosen (but see --all-match).
157
158 When --notes is in effect, the message from the notes is matched as
159 if it were part of the log message.
160
161 --all-match
162 Limit the commits output to ones that match all given --grep,
163 instead of ones that match at least one.
164
165 --invert-grep
166 Limit the commits output to ones with a log message that do not
167 match the pattern specified with --grep=<pattern>.
168
169 -i, --regexp-ignore-case
170 Match the regular expression limiting patterns without regard to
171 letter case.
172
173 --basic-regexp
174 Consider the limiting patterns to be basic regular expressions;
175 this is the default.
176
177 -E, --extended-regexp
178 Consider the limiting patterns to be extended regular expressions
179 instead of the default basic regular expressions.
180
181 -F, --fixed-strings
182 Consider the limiting patterns to be fixed strings (don’t interpret
183 pattern as a regular expression).
184
185 -P, --perl-regexp
186 Consider the limiting patterns to be Perl-compatible regular
187 expressions.
188
189 Support for these types of regular expressions is an optional
190 compile-time dependency. If Git wasn’t compiled with support for
191 them providing this option will cause it to die.
192
193 --remove-empty
194 Stop when a given path disappears from the tree.
195
196 --merges
197 Print only merge commits. This is exactly the same as
198 --min-parents=2.
199
200 --no-merges
201 Do not print commits with more than one parent. This is exactly the
202 same as --max-parents=1.
203
204 --min-parents=<number>, --max-parents=<number>, --no-min-parents,
205 --no-max-parents
206 Show only commits which have at least (or at most) that many parent
207 commits. In particular, --max-parents=1 is the same as --no-merges,
208 --min-parents=2 is the same as --merges. --max-parents=0 gives all
209 root commits and --min-parents=3 all octopus merges.
210
211 --no-min-parents and --no-max-parents reset these limits (to no
212 limit) again. Equivalent forms are --min-parents=0 (any commit has
213 0 or more parents) and --max-parents=-1 (negative numbers denote no
214 upper limit).
215
216 --first-parent
217 When finding commits to include, follow only the first parent
218 commit upon seeing a merge commit. This option can give a better
219 overview when viewing the evolution of a particular topic branch,
220 because merges into a topic branch tend to be only about adjusting
221 to updated upstream from time to time, and this option allows you
222 to ignore the individual commits brought in to your history by such
223 a merge.
224
225 --exclude-first-parent-only
226 When finding commits to exclude (with a ^), follow only the first
227 parent commit upon seeing a merge commit. This can be used to find
228 the set of changes in a topic branch from the point where it
229 diverged from the remote branch, given that arbitrary merges can be
230 valid topic branch changes.
231
232 --not
233 Reverses the meaning of the ^ prefix (or lack thereof) for all
234 following revision specifiers, up to the next --not. When used on
235 the command line before --stdin, the revisions passed through stdin
236 will not be affected by it. Conversely, when passed via standard
237 input, the revisions passed on the command line will not be
238 affected by it.
239
240 --all
241 Pretend as if all the refs in refs/, along with HEAD, are listed on
242 the command line as <commit>.
243
244 --branches[=<pattern>]
245 Pretend as if all the refs in refs/heads are listed on the command
246 line as <commit>. If <pattern> is given, limit branches to ones
247 matching given shell glob. If pattern lacks ?, *, or [, /* at the
248 end is implied.
249
250 --tags[=<pattern>]
251 Pretend as if all the refs in refs/tags are listed on the command
252 line as <commit>. If <pattern> is given, limit tags to ones
253 matching given shell glob. If pattern lacks ?, *, or [, /* at the
254 end is implied.
255
256 --remotes[=<pattern>]
257 Pretend as if all the refs in refs/remotes are listed on the
258 command line as <commit>. If <pattern> is given, limit
259 remote-tracking branches to ones matching given shell glob. If
260 pattern lacks ?, *, or [, /* at the end is implied.
261
262 --glob=<glob-pattern>
263 Pretend as if all the refs matching shell glob <glob-pattern> are
264 listed on the command line as <commit>. Leading refs/, is
265 automatically prepended if missing. If pattern lacks ?, *, or [, /*
266 at the end is implied.
267
268 --exclude=<glob-pattern>
269 Do not include refs matching <glob-pattern> that the next --all,
270 --branches, --tags, --remotes, or --glob would otherwise consider.
271 Repetitions of this option accumulate exclusion patterns up to the
272 next --all, --branches, --tags, --remotes, or --glob option (other
273 options or arguments do not clear accumulated patterns).
274
275 The patterns given should not begin with refs/heads, refs/tags, or
276 refs/remotes when applied to --branches, --tags, or --remotes,
277 respectively, and they must begin with refs/ when applied to --glob
278 or --all. If a trailing /* is intended, it must be given
279 explicitly.
280
281 --exclude-hidden=[fetch|receive|uploadpack]
282 Do not include refs that would be hidden by git-fetch,
283 git-receive-pack or git-upload-pack by consulting the appropriate
284 fetch.hideRefs, receive.hideRefs or uploadpack.hideRefs
285 configuration along with transfer.hideRefs (see git-config(1)).
286 This option affects the next pseudo-ref option --all or --glob and
287 is cleared after processing them.
288
289 --reflog
290 Pretend as if all objects mentioned by reflogs are listed on the
291 command line as <commit>.
292
293 --alternate-refs
294 Pretend as if all objects mentioned as ref tips of alternate
295 repositories were listed on the command line. An alternate
296 repository is any repository whose object directory is specified in
297 objects/info/alternates. The set of included objects may be
298 modified by core.alternateRefsCommand, etc. See git-config(1).
299
300 --single-worktree
301 By default, all working trees will be examined by the following
302 options when there are more than one (see git-worktree(1)): --all,
303 --reflog and --indexed-objects. This option forces them to examine
304 the current working tree only.
305
306 --ignore-missing
307 Upon seeing an invalid object name in the input, pretend as if the
308 bad input was not given.
309
310 --bisect
311 Pretend as if the bad bisection ref refs/bisect/bad was listed and
312 as if it was followed by --not and the good bisection refs
313 refs/bisect/good-* on the command line.
314
315 --stdin
316 In addition to getting arguments from the command line, read them
317 from standard input as well. This accepts commits and
318 pseudo-options like --all and --glob=. When a -- separator is seen,
319 the following input is treated as paths and used to limit the
320 result. Flags like --not which are read via standard input are only
321 respected for arguments passed in the same way and will not
322 influence any subsequent command line arguments.
323
324 --cherry-mark
325 Like --cherry-pick (see below) but mark equivalent commits with =
326 rather than omitting them, and inequivalent ones with +.
327
328 --cherry-pick
329 Omit any commit that introduces the same change as another commit
330 on the “other side” when the set of commits are limited with
331 symmetric difference.
332
333 For example, if you have two branches, A and B, a usual way to list
334 all commits on only one side of them is with --left-right (see the
335 example below in the description of the --left-right option).
336 However, it shows the commits that were cherry-picked from the
337 other branch (for example, “3rd on b” may be cherry-picked from
338 branch A). With this option, such pairs of commits are excluded
339 from the output.
340
341 --left-only, --right-only
342 List only commits on the respective side of a symmetric difference,
343 i.e. only those which would be marked < resp. > by --left-right.
344
345 For example, --cherry-pick --right-only A...B omits those commits
346 from B which are in A or are patch-equivalent to a commit in A. In
347 other words, this lists the + commits from git cherry A B. More
348 precisely, --cherry-pick --right-only --no-merges gives the exact
349 list.
350
351 --cherry
352 A synonym for --right-only --cherry-mark --no-merges; useful to
353 limit the output to the commits on our side and mark those that
354 have been applied to the other side of a forked history with git
355 log --cherry upstream...mybranch, similar to git cherry upstream
356 mybranch.
357
358 -g, --walk-reflogs
359 Instead of walking the commit ancestry chain, walk reflog entries
360 from the most recent one to older ones. When this option is used
361 you cannot specify commits to exclude (that is, ^commit,
362 commit1..commit2, and commit1...commit2 notations cannot be used).
363
364 With --pretty format other than oneline and reference (for obvious
365 reasons), this causes the output to have two extra lines of
366 information taken from the reflog. The reflog designator in the
367 output may be shown as ref@{Nth} (where Nth is the
368 reverse-chronological index in the reflog) or as ref@{timestamp}
369 (with the timestamp for that entry), depending on a few rules:
370
371 1. If the starting point is specified as ref@{Nth}, show the index
372 format.
373
374 2. If the starting point was specified as ref@{now}, show the
375 timestamp format.
376
377 3. If neither was used, but --date was given on the command line,
378 show the timestamp in the format requested by --date.
379
380 4. Otherwise, show the index format.
381
382 Under --pretty=oneline, the commit message is prefixed with this
383 information on the same line. This option cannot be combined with
384 --reverse. See also git-reflog(1).
385
386 Under --pretty=reference, this information will not be shown at
387 all.
388
389 --merge
390 After a failed merge, show refs that touch files having a conflict
391 and don’t exist on all heads to merge.
392
393 --boundary
394 Output excluded boundary commits. Boundary commits are prefixed
395 with -.
396
397 History Simplification
398 Sometimes you are only interested in parts of the history, for example
399 the commits modifying a particular <path>. But there are two parts of
400 History Simplification, one part is selecting the commits and the other
401 is how to do it, as there are various strategies to simplify the
402 history.
403
404 The following options select the commits to be shown:
405
406 <paths>
407 Commits modifying the given <paths> are selected.
408
409 --simplify-by-decoration
410 Commits that are referred by some branch or tag are selected.
411
412 Note that extra commits can be shown to give a meaningful history.
413
414 The following options affect the way the simplification is performed:
415
416 Default mode
417 Simplifies the history to the simplest history explaining the final
418 state of the tree. Simplest because it prunes some side branches if
419 the end result is the same (i.e. merging branches with the same
420 content)
421
422 --show-pulls
423 Include all commits from the default mode, but also any merge
424 commits that are not TREESAME to the first parent but are TREESAME
425 to a later parent. This mode is helpful for showing the merge
426 commits that "first introduced" a change to a branch.
427
428 --full-history
429 Same as the default mode, but does not prune some history.
430
431 --dense
432 Only the selected commits are shown, plus some to have a meaningful
433 history.
434
435 --sparse
436 All commits in the simplified history are shown.
437
438 --simplify-merges
439 Additional option to --full-history to remove some needless merges
440 from the resulting history, as there are no selected commits
441 contributing to this merge.
442
443 --ancestry-path[=<commit>]
444 When given a range of commits to display (e.g. commit1..commit2 or
445 commit2 ^commit1), only display commits in that range that are
446 ancestors of <commit>, descendants of <commit>, or <commit> itself.
447 If no commit is specified, use commit1 (the excluded part of the
448 range) as <commit>. Can be passed multiple times; if so, a commit
449 is included if it is any of the commits given or if it is an
450 ancestor or descendant of one of them.
451
452 A more detailed explanation follows.
453
454 Suppose you specified foo as the <paths>. We shall call commits that
455 modify foo !TREESAME, and the rest TREESAME. (In a diff filtered for
456 foo, they look different and equal, respectively.)
457
458 In the following, we will always refer to the same example history to
459 illustrate the differences between simplification settings. We assume
460 that you are filtering for a file foo in this commit graph:
461
462 .-A---M---N---O---P---Q
463 / / / / / /
464 I B C D E Y
465 \ / / / / /
466 `-------------' X
467
468 The horizontal line of history A---Q is taken to be the first parent of
469 each merge. The commits are:
470
471 • I is the initial commit, in which foo exists with contents “asdf”,
472 and a file quux exists with contents “quux”. Initial commits are
473 compared to an empty tree, so I is !TREESAME.
474
475 • In A, foo contains just “foo”.
476
477 • B contains the same change as A. Its merge M is trivial and hence
478 TREESAME to all parents.
479
480 • C does not change foo, but its merge N changes it to “foobar”, so
481 it is not TREESAME to any parent.
482
483 • D sets foo to “baz”. Its merge O combines the strings from N and D
484 to “foobarbaz”; i.e., it is not TREESAME to any parent.
485
486 • E changes quux to “xyzzy”, and its merge P combines the strings to
487 “quux xyzzy”. P is TREESAME to O, but not to E.
488
489 • X is an independent root commit that added a new file side, and Y
490 modified it. Y is TREESAME to X. Its merge Q added side to P, and
491 Q is TREESAME to P, but not to Y.
492
493 rev-list walks backwards through history, including or excluding
494 commits based on whether --full-history and/or parent rewriting (via
495 --parents or --children) are used. The following settings are
496 available.
497
498 Default mode
499 Commits are included if they are not TREESAME to any parent (though
500 this can be changed, see --sparse below). If the commit was a
501 merge, and it was TREESAME to one parent, follow only that parent.
502 (Even if there are several TREESAME parents, follow only one of
503 them.) Otherwise, follow all parents.
504
505 This results in:
506
507 .-A---N---O
508 / / /
509 I---------D
510
511 Note how the rule to only follow the TREESAME parent, if one is
512 available, removed B from consideration entirely. C was considered
513 via N, but is TREESAME. Root commits are compared to an empty tree,
514 so I is !TREESAME.
515
516 Parent/child relations are only visible with --parents, but that
517 does not affect the commits selected in default mode, so we have
518 shown the parent lines.
519
520 --full-history without parent rewriting
521 This mode differs from the default in one point: always follow all
522 parents of a merge, even if it is TREESAME to one of them. Even if
523 more than one side of the merge has commits that are included, this
524 does not imply that the merge itself is! In the example, we get
525
526 I A B N D O P Q
527
528 M was excluded because it is TREESAME to both parents. E, C and B
529 were all walked, but only B was !TREESAME, so the others do not
530 appear.
531
532 Note that without parent rewriting, it is not really possible to
533 talk about the parent/child relationships between the commits, so
534 we show them disconnected.
535
536 --full-history with parent rewriting
537 Ordinary commits are only included if they are !TREESAME (though
538 this can be changed, see --sparse below).
539
540 Merges are always included. However, their parent list is
541 rewritten: Along each parent, prune away commits that are not
542 included themselves. This results in
543
544 .-A---M---N---O---P---Q
545 / / / / /
546 I B / D /
547 \ / / / /
548 `-------------'
549
550 Compare to --full-history without rewriting above. Note that E was
551 pruned away because it is TREESAME, but the parent list of P was
552 rewritten to contain E's parent I. The same happened for C and N,
553 and X, Y and Q.
554
555 In addition to the above settings, you can change whether TREESAME
556 affects inclusion:
557
558 --dense
559 Commits that are walked are included if they are not TREESAME to
560 any parent.
561
562 --sparse
563 All commits that are walked are included.
564
565 Note that without --full-history, this still simplifies merges: if
566 one of the parents is TREESAME, we follow only that one, so the
567 other sides of the merge are never walked.
568
569 --simplify-merges
570 First, build a history graph in the same way that --full-history
571 with parent rewriting does (see above).
572
573 Then simplify each commit C to its replacement C' in the final
574 history according to the following rules:
575
576 • Set C' to C.
577
578 • Replace each parent P of C' with its simplification P'. In the
579 process, drop parents that are ancestors of other parents or
580 that are root commits TREESAME to an empty tree, and remove
581 duplicates, but take care to never drop all parents that we are
582 TREESAME to.
583
584 • If after this parent rewriting, C' is a root or merge commit
585 (has zero or >1 parents), a boundary commit, or !TREESAME, it
586 remains. Otherwise, it is replaced with its only parent.
587
588 The effect of this is best shown by way of comparing to
589 --full-history with parent rewriting. The example turns into:
590
591 .-A---M---N---O
592 / / /
593 I B D
594 \ / /
595 `---------'
596
597 Note the major differences in N, P, and Q over --full-history:
598
599 • N's parent list had I removed, because it is an ancestor of the
600 other parent M. Still, N remained because it is !TREESAME.
601
602 • P's parent list similarly had I removed. P was then removed
603 completely, because it had one parent and is TREESAME.
604
605 • Q's parent list had Y simplified to X. X was then removed,
606 because it was a TREESAME root. Q was then removed completely,
607 because it had one parent and is TREESAME.
608
609 There is another simplification mode available:
610
611 --ancestry-path[=<commit>]
612 Limit the displayed commits to those which are an ancestor of
613 <commit>, or which are a descendant of <commit>, or are <commit>
614 itself.
615
616 As an example use case, consider the following commit history:
617
618 D---E-------F
619 / \ \
620 B---C---G---H---I---J
621 / \
622 A-------K---------------L--M
623
624 A regular D..M computes the set of commits that are ancestors of M,
625 but excludes the ones that are ancestors of D. This is useful to
626 see what happened to the history leading to M since D, in the sense
627 that “what does M have that did not exist in D”. The result in this
628 example would be all the commits, except A and B (and D itself, of
629 course).
630
631 When we want to find out what commits in M are contaminated with
632 the bug introduced by D and need fixing, however, we might want to
633 view only the subset of D..M that are actually descendants of D,
634 i.e. excluding C and K. This is exactly what the --ancestry-path
635 option does. Applied to the D..M range, it results in:
636
637 E-------F
638 \ \
639 G---H---I---J
640 \
641 L--M
642
643 We can also use --ancestry-path=D instead of --ancestry-path which
644 means the same thing when applied to the D..M range but is just
645 more explicit.
646
647 If we instead are interested in a given topic within this range,
648 and all commits affected by that topic, we may only want to view
649 the subset of D..M which contain that topic in their ancestry path.
650 So, using --ancestry-path=H D..M for example would result in:
651
652 E
653 \
654 G---H---I---J
655 \
656 L--M
657
658 Whereas --ancestry-path=K D..M would result in
659
660 K---------------L--M
661
662 Before discussing another option, --show-pulls, we need to create a new
663 example history.
664
665 A common problem users face when looking at simplified history is that
666 a commit they know changed a file somehow does not appear in the file’s
667 simplified history. Let’s demonstrate a new example and show how
668 options such as --full-history and --simplify-merges works in that
669 case:
670
671 .-A---M-----C--N---O---P
672 / / \ \ \/ / /
673 I B \ R-'`-Z' /
674 \ / \/ /
675 \ / /\ /
676 `---X--' `---Y--'
677
678 For this example, suppose I created file.txt which was modified by A,
679 B, and X in different ways. The single-parent commits C, Z, and Y do
680 not change file.txt. The merge commit M was created by resolving the
681 merge conflict to include both changes from A and B and hence is not
682 TREESAME to either. The merge commit R, however, was created by
683 ignoring the contents of file.txt at M and taking only the contents of
684 file.txt at X. Hence, R is TREESAME to X but not M. Finally, the
685 natural merge resolution to create N is to take the contents of
686 file.txt at R, so N is TREESAME to R but not C. The merge commits O and
687 P are TREESAME to their first parents, but not to their second parents,
688 Z and Y respectively.
689
690 When using the default mode, N and R both have a TREESAME parent, so
691 those edges are walked and the others are ignored. The resulting
692 history graph is:
693
694 I---X
695
696 When using --full-history, Git walks every edge. This will discover the
697 commits A and B and the merge M, but also will reveal the merge commits
698 O and P. With parent rewriting, the resulting graph is:
699
700 .-A---M--------N---O---P
701 / / \ \ \/ / /
702 I B \ R-'`--' /
703 \ / \/ /
704 \ / /\ /
705 `---X--' `------'
706
707 Here, the merge commits O and P contribute extra noise, as they did not
708 actually contribute a change to file.txt. They only merged a topic that
709 was based on an older version of file.txt. This is a common issue in
710 repositories using a workflow where many contributors work in parallel
711 and merge their topic branches along a single trunk: many unrelated
712 merges appear in the --full-history results.
713
714 When using the --simplify-merges option, the commits O and P disappear
715 from the results. This is because the rewritten second parents of O and
716 P are reachable from their first parents. Those edges are removed and
717 then the commits look like single-parent commits that are TREESAME to
718 their parent. This also happens to the commit N, resulting in a history
719 view as follows:
720
721 .-A---M--.
722 / / \
723 I B R
724 \ / /
725 \ / /
726 `---X--'
727
728 In this view, we see all of the important single-parent changes from A,
729 B, and X. We also see the carefully-resolved merge M and the
730 not-so-carefully-resolved merge R. This is usually enough information
731 to determine why the commits A and B "disappeared" from history in the
732 default view. However, there are a few issues with this approach.
733
734 The first issue is performance. Unlike any previous option, the
735 --simplify-merges option requires walking the entire commit history
736 before returning a single result. This can make the option difficult to
737 use for very large repositories.
738
739 The second issue is one of auditing. When many contributors are working
740 on the same repository, it is important which merge commits introduced
741 a change into an important branch. The problematic merge R above is not
742 likely to be the merge commit that was used to merge into an important
743 branch. Instead, the merge N was used to merge R and X into the
744 important branch. This commit may have information about why the change
745 X came to override the changes from A and B in its commit message.
746
747 --show-pulls
748 In addition to the commits shown in the default history, show each
749 merge commit that is not TREESAME to its first parent but is
750 TREESAME to a later parent.
751
752 When a merge commit is included by --show-pulls, the merge is
753 treated as if it "pulled" the change from another branch. When
754 using --show-pulls on this example (and no other options) the
755 resulting graph is:
756
757 I---X---R---N
758
759 Here, the merge commits R and N are included because they pulled
760 the commits X and R into the base branch, respectively. These
761 merges are the reason the commits A and B do not appear in the
762 default history.
763
764 When --show-pulls is paired with --simplify-merges, the graph
765 includes all of the necessary information:
766
767 .-A---M--. N
768 / / \ /
769 I B R
770 \ / /
771 \ / /
772 `---X--'
773
774 Notice that since M is reachable from R, the edge from N to M was
775 simplified away. However, N still appears in the history as an
776 important commit because it "pulled" the change R into the main
777 branch.
778
779 The --simplify-by-decoration option allows you to view only the big
780 picture of the topology of the history, by omitting commits that are
781 not referenced by tags. Commits are marked as !TREESAME (in other
782 words, kept after history simplification rules described above) if (1)
783 they are referenced by tags, or (2) they change the contents of the
784 paths given on the command line. All other commits are marked as
785 TREESAME (subject to be simplified away).
786
788 See gitmailmap(5).
789
790 Note that if git shortlog is run outside of a repository (to process
791 log contents on standard input), it will look for a .mailmap file in
792 the current directory.
793
795 Part of the git(1) suite
796
797
798
799Git 2.43.0 11/20/2023 GIT-SHORTLOG(1)