blob: 7d0277d033d60227cee0b24a4c8747dfa892f4e7 [file] [log] [blame]
Junio C Hamano3f971fc2005-08-14 17:24:36 -07001git-shortlog(1)
2===============
Junio C Hamano3f971fc2005-08-14 17:24:36 -07003
4NAME
5----
Thomas Rast0b444cd2010-01-10 00:33:00 +01006git-shortlog - Summarize 'git log' output
Junio C Hamano3f971fc2005-08-14 17:24:36 -07007
Junio C Hamano3f971fc2005-08-14 17:24:36 -07008SYNOPSIS
9--------
Frank Lichtenheld0ad64fd2007-04-19 00:10:22 +020010[verse]
Jean-Noël Avila133db542021-11-06 19:48:52 +010011'git shortlog' [<options>] [<revision-range>] [[--] <path>...]
Martin Ågrena8210322018-03-10 12:52:10 +010012git log --pretty=short | 'git shortlog' [<options>]
Junio C Hamano3f971fc2005-08-14 17:24:36 -070013
14DESCRIPTION
15-----------
Thomas Rast0b444cd2010-01-10 00:33:00 +010016Summarizes 'git log' output in a format suitable for inclusion
Jeremy White52ffe992012-09-13 17:27:09 -050017in release announcements. Each commit will be grouped by author and title.
Junio C Hamano3f971fc2005-08-14 17:24:36 -070018
Jonas Fonseca74237d62006-06-07 20:32:33 +020019Additionally, "[PATCH]" will be stripped from the commit description.
20
Jonathan Nieder02646fe2010-05-03 21:57:10 -050021If no revisions are passed on the command line and either standard input
22is not a terminal or there is no current branch, 'git shortlog' will
23output a summary of the log read from standard input, without
24reference to the current repository.
25
Nicolas Pitre4e27fb02006-10-06 15:39:09 -040026OPTIONS
27-------
28
Stephan Beyer32402402008-06-08 03:36:09 +020029-n::
30--numbered::
Nicolas Pitre4e27fb02006-10-06 15:39:09 -040031 Sort output according to the number of commits per author instead
32 of author alphabetic order.
33
Stephan Beyer32402402008-06-08 03:36:09 +020034-s::
35--summary::
René Scharfe23bfbb82007-01-17 16:32:41 +010036 Suppress commit description and provide a commit count summary only.
Nicolas Pitre4e27fb02006-10-06 15:39:09 -040037
Stephan Beyer32402402008-06-08 03:36:09 +020038-e::
39--email::
Jeff King6508bb72007-12-11 07:33:12 -050040 Show the email address of each author.
41
Štěpán Němecefc39d62010-10-08 19:31:18 +020042--format[=<format>]::
Jonathan Nieder60037242010-05-03 21:59:55 -050043 Instead of the commit subject, use some other information to
44 describe each commit. '<format>' can be any string accepted
Jeff King6cf378f2012-04-26 04:51:57 -040045 by the `--format` option of 'git log', such as '* [%h] %s'.
Jonathan Nieder60037242010-05-03 21:59:55 -050046 (See the "PRETTY FORMATS" section of linkgit:git-log[1].)
47
48 Each pretty-printed commit will be rewrapped before it is shown.
49
Jeff King251554c2022-10-24 14:55:30 -040050--date=<format>::
51 Show dates formatted according to the given date string. (See
52 the `--date` option in the "Commit Formatting" section of
Taylor Blau3dc95e02022-10-24 14:55:39 -040053 linkgit:git-log[1]). Useful with `--group=format:<format>`.
Jeff King251554c2022-10-24 14:55:30 -040054
Jeff King92338c42020-09-27 04:39:59 -040055--group=<type>::
56 Group commits based on `<type>`. If no `--group` option is
57 specified, the default is `author`. `<type>` is one of:
58+
Jeff King63d24fa2020-09-27 04:40:15 -040059--
Jeff King92338c42020-09-27 04:39:59 -040060 - `author`, commits are grouped by author
61 - `committer`, commits are grouped by committer (the same as `-c`)
Jeff King47beb372020-09-27 04:40:04 -040062 - `trailer:<field>`, the `<field>` is interpreted as a case-insensitive
63 commit message trailer (see linkgit:git-interpret-trailers[1]). For
64 example, if your project uses `Reviewed-by` trailers, you might want
65 to see who has been reviewing with
66 `git shortlog -ns --group=trailer:reviewed-by`.
Taylor Blau3dc95e02022-10-24 14:55:39 -040067 - `format:<format>`, any string accepted by the `--format` option of
68 'git log'. (See the "PRETTY FORMATS" section of
69 linkgit:git-log[1].)
Jeff King47beb372020-09-27 04:40:04 -040070+
71Note that commits that do not include the trailer will not be counted.
72Likewise, commits with multiple trailers (e.g., multiple signoffs) may
Jeff Kingf17b0b92020-09-27 04:40:07 -040073be counted more than once (but only once per unique trailer value in
74that commit).
Jeff King47beb372020-09-27 04:40:04 -040075+
Jeff King56d5dde2020-09-27 04:40:11 -040076Shortlog will attempt to parse each trailer value as a `name <email>`
77identity. If successful, the mailmap is applied and the email is omitted
78unless the `--email` option is specified. If the value cannot be parsed
79as an identity, it will be taken literally and completely.
Jeff King63d24fa2020-09-27 04:40:15 -040080--
81+
82If `--group` is specified multiple times, commits are counted under each
83value (but again, only once per unique value in that commit). For
84example, `git shortlog --group=author --group=trailer:co-authored-by`
85counts both authors and co-authors.
Jeff King92338c42020-09-27 04:39:59 -040086
Jeff King03f40822016-12-16 08:51:41 -050087-c::
88--committer::
Jeff King92338c42020-09-27 04:39:59 -040089 This is an alias for `--group=committer`.
Jeff King03f40822016-12-16 08:51:41 -050090
Junio C Hamano55ef8a42008-04-12 15:38:20 -070091-w[<width>[,<indent1>[,<indent2>]]]::
92 Linewrap the output by wrapping each line at `width`. The first
93 line of each entry is indented by `indent1` spaces, and the second
94 and subsequent lines are indented by `indent2` spaces. `width`,
95 `indent1`, and `indent2` default to 76, 6 and 9 respectively.
John Keeping0e82bd02013-01-09 20:16:45 +000096+
97If width is `0` (zero) then indent the lines of the output without wrapping
98them.
Junio C Hamano55ef8a42008-04-12 15:38:20 -070099
Jean-Noël Avila133db542021-11-06 19:48:52 +0100100<revision-range>::
Ramkumar Ramachandra46b2a462013-04-22 11:00:30 +0530101 Show only commits in the specified revision range. When no
Jean-Noël Avila133db542021-11-06 19:48:52 +0100102 <revision-range> is specified, it defaults to `HEAD` (i.e. the
Ramkumar Ramachandra46b2a462013-04-22 11:00:30 +0530103 whole history leading to the current commit). `origin..HEAD`
104 specifies all the commits reachable from the current commit
105 (i.e. `HEAD`), but not from `origin`. For a complete list of
Jean-Noël Avila133db542021-11-06 19:48:52 +0100106 ways to spell <revision-range>, see the "Specifying Ranges"
Ramkumar Ramachandra46b2a462013-04-22 11:00:30 +0530107 section of linkgit:gitrevisions[7].
108
Martin Ågren933c7582018-04-17 21:15:27 +0200109[--] <path>...::
Ramkumar Ramachandra46b2a462013-04-22 11:00:30 +0530110 Consider only commits that are enough to explain how the files
111 that match the specified paths came to be.
112+
Martin Ågren69550472018-04-17 21:15:28 +0200113Paths may need to be prefixed with `--` to separate them from
Ramkumar Ramachandra46b2a462013-04-22 11:00:30 +0530114options or the revision range, when confusion arises.
Frank Lichtenheld0ad64fd2007-04-19 00:10:22 +0200115
Pratyush Yadav461caf32019-11-09 00:56:27 +0530116:git-shortlog: 1
117include::rev-list-options.txt[]
118
Marius Storm-Olsen7d48e9e2009-02-08 15:34:31 +0100119MAPPING AUTHORS
120---------------
Adeodato Simó3a882d92008-12-27 19:23:30 +0100121
Ævar Arnfjörð Bjarmason42957af2021-01-12 21:17:45 +0100122See linkgit:gitmailmap[5].
Marius Storm-Olsen0925ce42009-02-08 15:34:29 +0100123
Jeff Kinga38cb982021-02-10 15:34:33 -0500124Note that if `git shortlog` is run outside of a repository (to process
125log contents on standard input), it will look for a `.mailmap` file in
126the current directory.
127
Junio C Hamano3f971fc2005-08-14 17:24:36 -0700128GIT
129---
Christian Couder9e1f0a82008-06-06 09:07:32 +0200130Part of the linkgit:git[1] suite