summaryrefslogtreecommitdiff
path: root/t/t4201-shortlog.sh
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2020-09-27 08:40:04 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-09-27 19:21:05 (GMT)
commit47beb37bc60b690e83b19aa7ff646255fb643ad9 (patch)
tree1bc2159210728f20bd67ac51e01ae2e4f12b5340 /t/t4201-shortlog.sh
parentf0939a0eb157cb23cd300d32ee0bff2f82aa5959 (diff)
downloadgit-47beb37bc60b690e83b19aa7ff646255fb643ad9.zip
git-47beb37bc60b690e83b19aa7ff646255fb643ad9.tar.gz
git-47beb37bc60b690e83b19aa7ff646255fb643ad9.tar.bz2
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-xt/t4201-shortlog.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/t/t4201-shortlog.sh b/t/t4201-shortlog.sh
index 65e4468..e97d891 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