diff options
author | Jeff King <peff@peff.net> | 2020-09-27 04:40:04 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-09-27 12:21:05 -0700 |
commit | 47beb37bc60b690e83b19aa7ff646255fb643ad9 (patch) | |
tree | 1bc2159210728f20bd67ac51e01ae2e4f12b5340 /t/t4201-shortlog.sh | |
parent | trailer: add interface for iterating over commit trailers (diff) | |
download | tgif-47beb37bc60b690e83b19aa7ff646255fb643ad9.tar.xz |
shortlog: match commit trailers with --group
If a project uses commit trailers, this patch lets you use
shortlog to see who is performing each action. For example,
running:
git shortlog -ns --group=trailer:reviewed-by
in git.git shows who has reviewed. You can even use a custom
format to see things like who has helped whom:
git shortlog --format="...helped %an (%ad)" \
--group=trailer:helped-by
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 | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/t/t4201-shortlog.sh b/t/t4201-shortlog.sh index 65e4468746..e97d891a71 100755 --- a/t/t4201-shortlog.sh +++ b/t/t4201-shortlog.sh @@ -220,4 +220,18 @@ test_expect_success '--group=committer is the same as --committer' ' test_cmp expect actual ' +test_expect_success 'shortlog --group=trailer:signed-off-by' ' + git commit --allow-empty -m foo -s && + GIT_COMMITTER_NAME="SOB One" \ + GIT_COMMITTER_EMAIL=sob@example.com \ + git commit --allow-empty -m foo -s && + git commit --allow-empty --amend --no-edit -s && + cat >expect <<-\EOF && + 2 C O Mitter <committer@example.com> + 1 SOB One <sob@example.com> + EOF + git shortlog -ns --group=trailer:signed-off-by HEAD >actual && + test_cmp expect actual +' + test_done |