diff options
author | Taylor Blau <me@ttaylorr.com> | 2022-10-24 21:55:39 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-10-25 00:48:05 +0300 |
commit | 3dc95e09e1355ebde472bd5be37aa7b29ef774d3 (patch) | |
tree | 3f9eabadf001c1bf6d1946c6b6df6d48984b8b4b /Documentation | |
parent | b017d3dae9fe5a5b636b8f7a5235cee2b1b90332 (diff) |
shortlog: support arbitrary commit format `--group`s
In addition to generating a shortlog based on committer, author, or the
identity in one or more specified trailers, it can be useful to generate
a shortlog based on an arbitrary commit format.
This can be used, for example, to generate a distribution of commit
activity over time, like so:
$ git shortlog --group='%cd' --date='format:%Y-%m' -s v2.37.0..
117 2022-06
274 2022-07
324 2022-08
263 2022-09
7 2022-10
Arbitrary commit formats can be used. In fact, `git shortlog`'s default
behavior (to count by commit authors) can be emulated as follows:
$ git shortlog --group='%aN <%aE>' ...
and future patches will make the default behavior (as well as
`--committer`, and `--group=trailer:<trailer>`) special cases of the
more flexible `--group` option.
Note also that the SHORTLOG_GROUP_FORMAT enum value is used only to
designate that `--group:<format>` is in use when in stdin mode to
declare that the combination is invalid.
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/git-shortlog.txt | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Documentation/git-shortlog.txt b/Documentation/git-shortlog.txt index 9ed9d6a9e7..7d0277d033 100644 --- a/Documentation/git-shortlog.txt +++ b/Documentation/git-shortlog.txt @@ -50,7 +50,7 @@ OPTIONS --date=<format>:: Show dates formatted according to the given date string. (See the `--date` option in the "Commit Formatting" section of - linkgit:git-log[1]). + linkgit:git-log[1]). Useful with `--group=format:<format>`. --group=<type>:: Group commits based on `<type>`. If no `--group` option is @@ -64,6 +64,9 @@ OPTIONS example, if your project uses `Reviewed-by` trailers, you might want to see who has been reviewing with `git shortlog -ns --group=trailer:reviewed-by`. + - `format:<format>`, any string accepted by the `--format` option of + 'git log'. (See the "PRETTY FORMATS" section of + linkgit:git-log[1].) + Note that commits that do not include the trailer will not be counted. Likewise, commits with multiple trailers (e.g., multiple signoffs) may |