| 1 | git-shortlog(1) |
| 2 | =============== |
| 3 | |
| 4 | NAME |
| 5 | ---- |
| 6 | git-shortlog - Summarize `git log` output |
| 7 | |
| 8 | SYNOPSIS |
| 9 | -------- |
| 10 | [synopsis] |
| 11 | git shortlog [<options>] [<revision-range>] [[--] <path>...] |
| 12 | git log --pretty=short | git shortlog [<options>] |
| 13 | |
| 14 | DESCRIPTION |
| 15 | ----------- |
| 16 | Summarizes `git log` output in a format suitable for inclusion |
| 17 | in release announcements. Each commit will be grouped by author and title. |
| 18 | |
| 19 | Additionally, "[PATCH]" will be stripped from the commit description. |
| 20 | |
| 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 | |
| 26 | OPTIONS |
| 27 | ------- |
| 28 | |
| 29 | `-n`:: |
| 30 | `--numbered`:: |
| 31 | Sort output according to the number of commits per author instead |
| 32 | of author alphabetic order. |
| 33 | |
| 34 | `-s`:: |
| 35 | `--summary`:: |
| 36 | Suppress commit description and provide a commit count summary only. |
| 37 | |
| 38 | `-e`:: |
| 39 | `--email`:: |
| 40 | Show the email address of each author. |
| 41 | |
| 42 | `--format[=<format>]`:: |
| 43 | Instead of the commit subject, use some other information to |
| 44 | describe each commit. _<format>_ can be any string accepted |
| 45 | by the `--format` option of `git log`, such as '* [%h] %s'. |
| 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 | |
| 50 | `--date=<format>`:: |
| 51 | Show dates formatted according to the given date string. (See |
| 52 | the `--date` option in the 'Commit Formatting' section of |
| 53 | linkgit:git-log[1]). Useful with `--group=format:<format>`. |
| 54 | |
| 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 | + |
| 59 | -- |
| 60 | - `author`, commits are grouped by author |
| 61 | - `committer`, commits are grouped by committer (the same as `-c`) |
| 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`. |
| 67 | + |
| 68 | Note that commits that do not include the trailer will not be counted. |
| 69 | Likewise, commits with multiple trailers (e.g., multiple signoffs) may |
| 70 | be counted more than once (but only once per unique trailer value in |
| 71 | that commit). |
| 72 | + |
| 73 | Shortlog will attempt to parse each trailer value as a `name <email>` |
| 74 | identity. If successful, the mailmap is applied and the email is omitted |
| 75 | unless the `--email` option is specified. If the value cannot be parsed |
| 76 | as an identity, it will be taken literally and completely. |
| 77 | |
| 78 | - `format:<format>`, any string accepted by the `--format` option of |
| 79 | `git log`. (See the 'PRETTY FORMATS' section of |
| 80 | linkgit:git-log[1].) |
| 81 | -- |
| 82 | + |
| 83 | If `--group` is specified multiple times, commits are counted under each |
| 84 | value (but again, only once per unique value in that commit). For |
| 85 | example, `git shortlog --group=author --group=trailer:co-authored-by` |
| 86 | counts both authors and co-authors. |
| 87 | |
| 88 | `-c`:: |
| 89 | `--committer`:: |
| 90 | This is an alias for `--group=committer`. |
| 91 | |
| 92 | `-w[<width>[,<indent1>[,<indent2>]]]`:: |
| 93 | Linewrap the output by wrapping each line at `width`. The first |
| 94 | line of each entry is indented by `indent1` spaces, and the second |
| 95 | and subsequent lines are indented by `indent2` spaces. `width`, |
| 96 | `indent1`, and `indent2` default to 76, 6 and 9 respectively. |
| 97 | + |
| 98 | If width is `0` (zero) then indent the lines of the output without wrapping |
| 99 | them. |
| 100 | |
| 101 | `<revision-range>`:: |
| 102 | Show only commits in the specified revision range. When no |
| 103 | _<revision-range>_ is specified, it defaults to `HEAD` (i.e. the |
| 104 | whole history leading to the current commit). `origin..HEAD` |
| 105 | specifies all the commits reachable from the current commit |
| 106 | (i.e. `HEAD`), but not from `origin`. For a complete list of |
| 107 | ways to spell _<revision-range>_, see the 'Specifying Ranges' |
| 108 | section of linkgit:gitrevisions[7]. |
| 109 | |
| 110 | `[--] <path>...`:: |
| 111 | Consider only commits that are enough to explain how the files |
| 112 | that match the specified paths came to be. |
| 113 | + |
| 114 | Paths may need to be prefixed with `--` to separate them from |
| 115 | options or the revision range, when confusion arises. |
| 116 | |
| 117 | :git-shortlog: 1 |
| 118 | include::rev-list-options.adoc[] |
| 119 | |
| 120 | MAPPING AUTHORS |
| 121 | --------------- |
| 122 | |
| 123 | See linkgit:gitmailmap[5]. |
| 124 | |
| 125 | Note that if `git shortlog` is run outside of a repository (to process |
| 126 | log contents on standard input), it will look for a `.mailmap` file in |
| 127 | the current directory. |
| 128 | |
| 129 | GIT |
| 130 | --- |
| 131 | Part of the linkgit:git[1] suite |