shortlog: add grouping option
commit92338c450bc41e8e3da31a10d2ab73844e8b0634
authorJeff King <peff@peff.net>
Sun, 27 Sep 2020 08:39:59 +0000 (27 04:39 -0400)
committerJunio C Hamano <gitster@pobox.com>
Sun, 27 Sep 2020 19:21:05 +0000 (27 12:21 -0700)
tree4efb1599c7d62617ea6a77bb413b2a9046f571c7
parent45d93eb82403a35d248d17dd0ea7dc3d690b1323
shortlog: add grouping option

In preparation for adding more grouping types, let's refactor the
committer/author grouping code and add a user-facing option that binds
them together. In particular:

  - the main option is now "--group", to make it clear
    that the various group types are mutually exclusive. The
    "--committer" option is an alias for "--group=committer".

  - we keep an enum rather than a binary flag, to prepare
    for more values

  - we prefer switch statements to ternary assignment, since
    other group types will need more custom code

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-shortlog.txt
builtin/shortlog.c
shortlog.h
t/t4201-shortlog.sh