Junio C Hamano | 3f971fc | 2005-08-14 17:24:36 -0700 | [diff] [blame] | 1 | git-shortlog(1) |
| 2 | =============== |
Junio C Hamano | 3f971fc | 2005-08-14 17:24:36 -0700 | [diff] [blame] | 3 | |
| 4 | NAME |
| 5 | ---- |
Thomas Rast | 0b444cd | 2010-01-10 00:33:00 +0100 | [diff] [blame] | 6 | git-shortlog - Summarize 'git log' output |
Junio C Hamano | 3f971fc | 2005-08-14 17:24:36 -0700 | [diff] [blame] | 7 | |
Junio C Hamano | 3f971fc | 2005-08-14 17:24:36 -0700 | [diff] [blame] | 8 | SYNOPSIS |
| 9 | -------- |
Frank Lichtenheld | 0ad64fd | 2007-04-19 00:10:22 +0200 | [diff] [blame] | 10 | [verse] |
Jean-Noël Avila | 133db54 | 2021-11-06 19:48:52 +0100 | [diff] [blame] | 11 | 'git shortlog' [<options>] [<revision-range>] [[--] <path>...] |
Martin Ågren | a821032 | 2018-03-10 12:52:10 +0100 | [diff] [blame] | 12 | git log --pretty=short | 'git shortlog' [<options>] |
Junio C Hamano | 3f971fc | 2005-08-14 17:24:36 -0700 | [diff] [blame] | 13 | |
| 14 | DESCRIPTION |
| 15 | ----------- |
Thomas Rast | 0b444cd | 2010-01-10 00:33:00 +0100 | [diff] [blame] | 16 | Summarizes 'git log' output in a format suitable for inclusion |
Jeremy White | 52ffe99 | 2012-09-13 17:27:09 -0500 | [diff] [blame] | 17 | in release announcements. Each commit will be grouped by author and title. |
Junio C Hamano | 3f971fc | 2005-08-14 17:24:36 -0700 | [diff] [blame] | 18 | |
Jonas Fonseca | 74237d6 | 2006-06-07 20:32:33 +0200 | [diff] [blame] | 19 | Additionally, "[PATCH]" will be stripped from the commit description. |
| 20 | |
Jonathan Nieder | 02646fe | 2010-05-03 21:57:10 -0500 | [diff] [blame] | 21 | If no revisions are passed on the command line and either standard input |
| 22 | is not a terminal or there is no current branch, 'git shortlog' will |
| 23 | output a summary of the log read from standard input, without |
| 24 | reference to the current repository. |
| 25 | |
Nicolas Pitre | 4e27fb0 | 2006-10-06 15:39:09 -0400 | [diff] [blame] | 26 | OPTIONS |
| 27 | ------- |
| 28 | |
Stephan Beyer | 3240240 | 2008-06-08 03:36:09 +0200 | [diff] [blame] | 29 | -n:: |
| 30 | --numbered:: |
Nicolas Pitre | 4e27fb0 | 2006-10-06 15:39:09 -0400 | [diff] [blame] | 31 | Sort output according to the number of commits per author instead |
| 32 | of author alphabetic order. |
| 33 | |
Stephan Beyer | 3240240 | 2008-06-08 03:36:09 +0200 | [diff] [blame] | 34 | -s:: |
| 35 | --summary:: |
René Scharfe | 23bfbb8 | 2007-01-17 16:32:41 +0100 | [diff] [blame] | 36 | Suppress commit description and provide a commit count summary only. |
Nicolas Pitre | 4e27fb0 | 2006-10-06 15:39:09 -0400 | [diff] [blame] | 37 | |
Stephan Beyer | 3240240 | 2008-06-08 03:36:09 +0200 | [diff] [blame] | 38 | -e:: |
| 39 | --email:: |
Jeff King | 6508bb7 | 2007-12-11 07:33:12 -0500 | [diff] [blame] | 40 | Show the email address of each author. |
| 41 | |
Štěpán Němec | efc39d6 | 2010-10-08 19:31:18 +0200 | [diff] [blame] | 42 | --format[=<format>]:: |
Jonathan Nieder | 6003724 | 2010-05-03 21:59:55 -0500 | [diff] [blame] | 43 | Instead of the commit subject, use some other information to |
| 44 | describe each commit. '<format>' can be any string accepted |
Jeff King | 6cf378f | 2012-04-26 04:51:57 -0400 | [diff] [blame] | 45 | by the `--format` option of 'git log', such as '* [%h] %s'. |
Jonathan Nieder | 6003724 | 2010-05-03 21:59:55 -0500 | [diff] [blame] | 46 | (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 King | 251554c | 2022-10-24 14:55:30 -0400 | [diff] [blame] | 50 | --date=<format>:: |
| 51 | Show dates formatted according to the given date string. (See |
| 52 | the `--date` option in the "Commit Formatting" section of |
Taylor Blau | 3dc95e0 | 2022-10-24 14:55:39 -0400 | [diff] [blame] | 53 | linkgit:git-log[1]). Useful with `--group=format:<format>`. |
Jeff King | 251554c | 2022-10-24 14:55:30 -0400 | [diff] [blame] | 54 | |
Jeff King | 92338c4 | 2020-09-27 04:39:59 -0400 | [diff] [blame] | 55 | --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 King | 63d24fa | 2020-09-27 04:40:15 -0400 | [diff] [blame] | 59 | -- |
Jeff King | 92338c4 | 2020-09-27 04:39:59 -0400 | [diff] [blame] | 60 | - `author`, commits are grouped by author |
| 61 | - `committer`, commits are grouped by committer (the same as `-c`) |
Jeff King | 47beb37 | 2020-09-27 04:40:04 -0400 | [diff] [blame] | 62 | - `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 Blau | 3dc95e0 | 2022-10-24 14:55:39 -0400 | [diff] [blame] | 67 | - `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 King | 47beb37 | 2020-09-27 04:40:04 -0400 | [diff] [blame] | 70 | + |
| 71 | Note that commits that do not include the trailer will not be counted. |
| 72 | Likewise, commits with multiple trailers (e.g., multiple signoffs) may |
Jeff King | f17b0b9 | 2020-09-27 04:40:07 -0400 | [diff] [blame] | 73 | be counted more than once (but only once per unique trailer value in |
| 74 | that commit). |
Jeff King | 47beb37 | 2020-09-27 04:40:04 -0400 | [diff] [blame] | 75 | + |
Jeff King | 56d5dde | 2020-09-27 04:40:11 -0400 | [diff] [blame] | 76 | Shortlog will attempt to parse each trailer value as a `name <email>` |
| 77 | identity. If successful, the mailmap is applied and the email is omitted |
| 78 | unless the `--email` option is specified. If the value cannot be parsed |
| 79 | as an identity, it will be taken literally and completely. |
Jeff King | 63d24fa | 2020-09-27 04:40:15 -0400 | [diff] [blame] | 80 | -- |
| 81 | + |
| 82 | If `--group` is specified multiple times, commits are counted under each |
| 83 | value (but again, only once per unique value in that commit). For |
| 84 | example, `git shortlog --group=author --group=trailer:co-authored-by` |
| 85 | counts both authors and co-authors. |
Jeff King | 92338c4 | 2020-09-27 04:39:59 -0400 | [diff] [blame] | 86 | |
Jeff King | 03f4082 | 2016-12-16 08:51:41 -0500 | [diff] [blame] | 87 | -c:: |
| 88 | --committer:: |
Jeff King | 92338c4 | 2020-09-27 04:39:59 -0400 | [diff] [blame] | 89 | This is an alias for `--group=committer`. |
Jeff King | 03f4082 | 2016-12-16 08:51:41 -0500 | [diff] [blame] | 90 | |
Junio C Hamano | 55ef8a4 | 2008-04-12 15:38:20 -0700 | [diff] [blame] | 91 | -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 Keeping | 0e82bd0 | 2013-01-09 20:16:45 +0000 | [diff] [blame] | 96 | + |
| 97 | If width is `0` (zero) then indent the lines of the output without wrapping |
| 98 | them. |
Junio C Hamano | 55ef8a4 | 2008-04-12 15:38:20 -0700 | [diff] [blame] | 99 | |
Jean-Noël Avila | 133db54 | 2021-11-06 19:48:52 +0100 | [diff] [blame] | 100 | <revision-range>:: |
Ramkumar Ramachandra | 46b2a46 | 2013-04-22 11:00:30 +0530 | [diff] [blame] | 101 | Show only commits in the specified revision range. When no |
Jean-Noël Avila | 133db54 | 2021-11-06 19:48:52 +0100 | [diff] [blame] | 102 | <revision-range> is specified, it defaults to `HEAD` (i.e. the |
Ramkumar Ramachandra | 46b2a46 | 2013-04-22 11:00:30 +0530 | [diff] [blame] | 103 | 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 Avila | 133db54 | 2021-11-06 19:48:52 +0100 | [diff] [blame] | 106 | ways to spell <revision-range>, see the "Specifying Ranges" |
Ramkumar Ramachandra | 46b2a46 | 2013-04-22 11:00:30 +0530 | [diff] [blame] | 107 | section of linkgit:gitrevisions[7]. |
| 108 | |
Martin Ågren | 933c758 | 2018-04-17 21:15:27 +0200 | [diff] [blame] | 109 | [--] <path>...:: |
Ramkumar Ramachandra | 46b2a46 | 2013-04-22 11:00:30 +0530 | [diff] [blame] | 110 | Consider only commits that are enough to explain how the files |
| 111 | that match the specified paths came to be. |
| 112 | + |
Martin Ågren | 6955047 | 2018-04-17 21:15:28 +0200 | [diff] [blame] | 113 | Paths may need to be prefixed with `--` to separate them from |
Ramkumar Ramachandra | 46b2a46 | 2013-04-22 11:00:30 +0530 | [diff] [blame] | 114 | options or the revision range, when confusion arises. |
Frank Lichtenheld | 0ad64fd | 2007-04-19 00:10:22 +0200 | [diff] [blame] | 115 | |
Pratyush Yadav | 461caf3 | 2019-11-09 00:56:27 +0530 | [diff] [blame] | 116 | :git-shortlog: 1 |
| 117 | include::rev-list-options.txt[] |
| 118 | |
Marius Storm-Olsen | 7d48e9e | 2009-02-08 15:34:31 +0100 | [diff] [blame] | 119 | MAPPING AUTHORS |
| 120 | --------------- |
Adeodato Simó | 3a882d9 | 2008-12-27 19:23:30 +0100 | [diff] [blame] | 121 | |
Ævar Arnfjörð Bjarmason | 42957af | 2021-01-12 21:17:45 +0100 | [diff] [blame] | 122 | See linkgit:gitmailmap[5]. |
Marius Storm-Olsen | 0925ce4 | 2009-02-08 15:34:29 +0100 | [diff] [blame] | 123 | |
Jeff King | a38cb98 | 2021-02-10 15:34:33 -0500 | [diff] [blame] | 124 | Note that if `git shortlog` is run outside of a repository (to process |
| 125 | log contents on standard input), it will look for a `.mailmap` file in |
| 126 | the current directory. |
| 127 | |
Junio C Hamano | 3f971fc | 2005-08-14 17:24:36 -0700 | [diff] [blame] | 128 | GIT |
| 129 | --- |
Christian Couder | 9e1f0a8 | 2008-06-06 09:07:32 +0200 | [diff] [blame] | 130 | Part of the linkgit:git[1] suite |