diff options
author | Jeff King <peff@peff.net> | 2020-09-27 04:39:59 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-09-27 12:21:05 -0700 |
commit | 92338c450bc41e8e3da31a10d2ab73844e8b0634 (patch) | |
tree | 4efb1599c7d62617ea6a77bb413b2a9046f571c7 /t/t4201-shortlog.sh | |
parent | shortlog: change "author" variables to "ident" (diff) | |
download | tgif-92338c450bc41e8e3da31a10d2ab73844e8b0634.tar.xz |
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>
Diffstat (limited to 't/t4201-shortlog.sh')
-rwxr-xr-x | t/t4201-shortlog.sh | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/t/t4201-shortlog.sh b/t/t4201-shortlog.sh index d3a7ce6bbb..65e4468746 100755 --- a/t/t4201-shortlog.sh +++ b/t/t4201-shortlog.sh @@ -215,4 +215,9 @@ test_expect_success 'shortlog --committer (external)' ' test_cmp expect actual ' +test_expect_success '--group=committer is the same as --committer' ' + git shortlog -ns --group=committer HEAD >actual && + test_cmp expect actual +' + test_done |