From patchwork Wed Jun 7 23:02:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Taylor Blau X-Patchwork-Id: 13271445 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7A7E5C7EE23 for ; Wed, 7 Jun 2023 23:02:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232149AbjFGXCT (ORCPT ); Wed, 7 Jun 2023 19:02:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230424AbjFGXCR (ORCPT ); Wed, 7 Jun 2023 19:02:17 -0400 Received: from mail-yw1-x112e.google.com (mail-yw1-x112e.google.com [IPv6:2607:f8b0:4864:20::112e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 373F51FDF for ; Wed, 7 Jun 2023 16:02:16 -0700 (PDT) Received: by mail-yw1-x112e.google.com with SMTP id 00721157ae682-565ba53f434so88366867b3.3 for ; Wed, 07 Jun 2023 16:02:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ttaylorr-com.20221208.gappssmtp.com; s=20221208; t=1686178935; x=1688770935; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=mJsxXj/8PnDgEzdnbn/jHRrCfBggVONqaE79r5ojXjw=; b=sGLhKForDmOC/eWOceLTapoHPnoQMm4ZVvQ2ZvBjUjYF7HhEyzO3ok5LXgs+c4Clfn XGHnR22o3NPbSXvh7eEc1mLUWN4vcdoWipMOV2wDng2mGTyVhcJJ5Zty6xe6Sjz3L+m1 7547Hec0q0s6HmweLqCJE3o/lOqLoByM96qgkppig7Q172h6Qx3Wh+ariwhV/NwdOTOb pywD94zQj+z3XzRXRG/59trBZObrsSwGAGJfSxZZy91yAdqL+Z+J5tzlZpG4X6SjVXI0 XPTHZJcrPTL9A2EEKSLOZKnDwGJFLxyT90GvyFmhRvwofJjWFF3FpGcivIdNLd55R3bV TUiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686178935; x=1688770935; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=mJsxXj/8PnDgEzdnbn/jHRrCfBggVONqaE79r5ojXjw=; b=hpiJz67C5Ag+mc1Xb0l2FWM1U8VOFDQERY2cgHgFysNlVs0z/hWdO8t7EPECXqP117 WwlEGk7mfY5qkjA+fdrcGd6kBNFYO+4fSsGb5YI+lC7bvyTw/8hTNWkvdg8Gl5otHwxO yh0AnIMlSQkgX8QqcWZZ602q+xTsci9UlmBsaZRoReydxBGWkMUkXoWPXG5lG7yF46DR F3nMtMgiw2s6D1xJ+x8knDrn61Dc0kxYB3nIt/2tzN3Zi/qjA6h2cIjVaCkHPAe4rejn CK7yZyNhBXRa1MVqYRKlDOUM8waP1G8LzlNUk6QWWEtDUu0GgJBGrR9Wc4YKZfu5q+RG 9z0g== X-Gm-Message-State: AC+VfDzPEy0bLU+IJYi+CzMTP+pKJQVy7EIEH7/w+vcVfw3ADTLgHW+H qK1CwPLqSrahhjukrqxaD+zusfK4bIWhTk6sW99aTyTT X-Google-Smtp-Source: ACHHUZ6LPE+9nI72fRSHRs98TJfTnH15EZbhMF27dtPbzFw6I/Uv5sbd0Mt9GVb9yl3T+uw2ofS0Uw== X-Received: by 2002:a81:53c4:0:b0:561:18c6:528c with SMTP id h187-20020a8153c4000000b0056118c6528cmr8647666ywb.30.1686178934816; Wed, 07 Jun 2023 16:02:14 -0700 (PDT) Received: from localhost (104-178-186-189.lightspeed.milwwi.sbcglobal.net. [104.178.186.189]) by smtp.gmail.com with ESMTPSA id m12-20020a819c0c000000b0055a416529bbsm9058ywa.24.2023.06.07.16.02.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jun 2023 16:02:14 -0700 (PDT) Date: Wed, 7 Jun 2023 19:02:11 -0400 From: Taylor Blau To: git@vger.kernel.org Cc: Derrick Stolee , Victoria Dye , Jeff King , Junio C Hamano Subject: [PATCH 1/2] shortlog: introduce `--group-filter` to restrict output Message-ID: <5cec04b65d350ca8b482ca14260ef118341e4039.1686178917.git.me@ttaylorr.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Sometimes it is useful to ask, "how many commits have I authored or been mentioned in via the Co-authored-by trailer"? `git shortlog` is a reasonable tool for this, and the answer can easily be obtained by running: $ git shortlog -ns --group=author --group=trailer:Co-authored-by and reading off the corresponding value from its output. But what if you want to know which commits contribute to the above count? You can drop the `-s` option and parse through the results, but you'll have to skip past everything you don't want (and stop reading after matching everything you do want). That is a script-able task, but it is cumbersome, and potentially very slow, if there is a large amount of output that does not match the given query. Instead, this patch introduces `--group-filter` in order to restrict the output of `git shortlog` to only matching group(s). Items match if they are in a group which is strictly equal to one of the specified filters. This means that you could easily view the hashes of all commits you either wrote or co-authored with something like: $ git shortlog -n --group=author --group=trailer:Co-authored-by \ --group-filter="$(git config user.name)" When filtering just by trailers, it is tempting to want to introduce a new grep mode for matching a given trailer, like `--author=` for matching the author header. But this would not be suitable for the above, since we want commits which match either the author or the Co-authored-by trailer, not ones which match both. An alternative approach might be to implement trailer filtering as above in revision.c, and show commits matching either the `--author` value or some hypothetical `--trailer` filter. That would give shortlog fewer commits, which may improve its performance. But it would restrict the interpretation of these options to be an OR (i.e. show commits matching either the `--author` or `--trailer` field). In fact, this is already not possible to do, since the `--author` and `--committer` options are documented as: > Limit the commits output to ones with author/committer header lines > that match the specified pattern So introducing another option which changes the behavior of existing ones is a non-starter. Instead, `git shortlog` will process more commits than necessary. But this is a marginal cost, since implementing the hypothetical revision options from above as an OR would mean that revision.c has to process every commit anyway. Signed-off-by: Taylor Blau --- Documentation/git-shortlog.txt | 5 ++++ builtin/shortlog.c | 20 ++++++++++++- shortlog.h | 2 ++ t/t4201-shortlog.sh | 54 ++++++++++++++++++++++++++++++++++ 4 files changed, 80 insertions(+), 1 deletion(-) diff --git a/Documentation/git-shortlog.txt b/Documentation/git-shortlog.txt index 7d0277d033..dab6d09648 100644 --- a/Documentation/git-shortlog.txt +++ b/Documentation/git-shortlog.txt @@ -97,6 +97,11 @@ counts both authors and co-authors. If width is `0` (zero) then indent the lines of the output without wrapping them. +--group-filter=:: + Only show output from the given group. If given more than once, + show output from any of the previously specified groups. May be + cleared with `--no-group-filter`. + :: Show only commits in the specified revision range. When no is specified, it defaults to `HEAD` (i.e. the diff --git a/builtin/shortlog.c b/builtin/shortlog.c index 46f4e0832a..679db22c57 100644 --- a/builtin/shortlog.c +++ b/builtin/shortlog.c @@ -365,6 +365,7 @@ void shortlog_init(struct shortlog *log) log->trailers.strdup_strings = 1; log->trailers.cmp = strcasecmp; log->format.strdup_strings = 1; + log->group_filter.strdup_strings = 1; } void shortlog_finish_setup(struct shortlog *log) @@ -377,6 +378,7 @@ void shortlog_finish_setup(struct shortlog *log) log->email ? "%cN <%cE>" : "%cN"); string_list_sort(&log->trailers); + string_list_sort(&log->group_filter); } int cmd_shortlog(int argc, const char **argv, const char *prefix) @@ -400,6 +402,8 @@ int cmd_shortlog(int argc, const char **argv, const char *prefix) &parse_wrap_args), OPT_CALLBACK(0, "group", &log, N_("field"), N_("group by field"), parse_group_option), + OPT_STRING_LIST(0, "group-filter", &log.group_filter, + N_("group"), N_("only show matching groups")), OPT_END(), }; @@ -476,6 +480,13 @@ static void add_wrapped_shortlog_msg(struct strbuf *sb, const char *s, strbuf_addch(sb, '\n'); } +static int want_shortlog_group(struct shortlog *log, const char *group) +{ + if (!log->group_filter.nr) + return 1; + return string_list_has_string(&log->group_filter, group); +} + void shortlog_output(struct shortlog *log) { size_t i, j; @@ -486,6 +497,9 @@ void shortlog_output(struct shortlog *log) log->summary ? compare_by_counter : compare_by_list); for (i = 0; i < log->list.nr; i++) { const struct string_list_item *item = &log->list.items[i]; + if (!want_shortlog_group(log, item->string)) + goto next; + if (log->summary) { fprintf(log->file, "%6d\t%s\n", (int)UTIL_TO_INT(item), item->string); @@ -505,11 +519,15 @@ void shortlog_output(struct shortlog *log) fprintf(log->file, " %s\n", msg); } putc('\n', log->file); + } + +next: + if (!log->summary) { + struct string_list *onelines = item->util; onelines->strdup_strings = 1; string_list_clear(onelines, 0); free(onelines); } - log->list.items[i].util = NULL; } diff --git a/shortlog.h b/shortlog.h index 28d04f951a..8ebee0e2d6 100644 --- a/shortlog.h +++ b/shortlog.h @@ -18,6 +18,8 @@ struct shortlog { int abbrev; struct date_mode date_mode; + struct string_list group_filter; + enum { SHORTLOG_GROUP_AUTHOR = (1 << 0), SHORTLOG_GROUP_COMMITTER = (1 << 1), diff --git a/t/t4201-shortlog.sh b/t/t4201-shortlog.sh index 8e4effebdb..0695c42ca8 100755 --- a/t/t4201-shortlog.sh +++ b/t/t4201-shortlog.sh @@ -346,6 +346,60 @@ test_expect_success 'shortlog can match multiple groups' ' test_cmp expect actual ' +test_expect_success '--group-filter shows only matching groups (single groups)' ' + cat >expect <<-\EOF && + 1 A U Thor + EOF + git shortlog -ns \ + --group=trailer:another-trailer \ + --group-filter="A U Thor" \ + -2 HEAD >actual && + test_cmp expect actual +' + +test_expect_success '--group-filter shows only matching groups (multiple groups)' ' + cat >expect <<-\EOF && + 2 A U Thor + EOF + git shortlog -ns \ + --group=author \ + --group=trailer:some-trailer \ + --group=trailer:another-trailer \ + --group-filter="A U Thor" \ + -2 HEAD >actual && + test_cmp expect actual +' + +test_expect_success '--group-filter can be specified more than once' ' + cat >expect <<-\EOF && + 2 User B + 1 User A + EOF + git shortlog -ns \ + --group=author \ + --group=trailer:some-trailer \ + --group=trailer:another-trailer \ + --group-filter="User A" \ + --group-filter="User B" \ + -2 HEAD >actual && + test_cmp expect actual +' + +test_expect_success '--no-group-filter reset group filters' ' + cat >expect <<-\EOF && + 2 A U Thor + 2 User B + 1 User A + EOF + git shortlog -ns \ + --group=author \ + --group=trailer:some-trailer \ + --group=trailer:another-trailer \ + --group-filter="A U Thor" --no-group-filter \ + -2 HEAD >actual && + test_cmp expect actual +' + test_expect_success 'shortlog can match multiple format groups' ' GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME" \ git commit --allow-empty -m "identical names" && From patchwork Wed Jun 7 23:02:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Taylor Blau X-Patchwork-Id: 13271446 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7F88CC7EE23 for ; Wed, 7 Jun 2023 23:02:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233070AbjFGXC0 (ORCPT ); Wed, 7 Jun 2023 19:02:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58930 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232505AbjFGXCZ (ORCPT ); Wed, 7 Jun 2023 19:02:25 -0400 Received: from mail-ot1-x32f.google.com (mail-ot1-x32f.google.com [IPv6:2607:f8b0:4864:20::32f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5673E1FEA for ; Wed, 7 Jun 2023 16:02:22 -0700 (PDT) Received: by mail-ot1-x32f.google.com with SMTP id 46e09a7af769-6b162127472so3684918a34.0 for ; Wed, 07 Jun 2023 16:02:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ttaylorr-com.20221208.gappssmtp.com; s=20221208; t=1686178940; x=1688770940; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=XdSUjfb12ZWJ7TVasbJqnGF4IrrXWVIaZoyRPRUCVz4=; b=td/Wx1Z1YCqjSRuxc98eZBoR7BHdxOjh/gWbsaRnJjgf3f1IYaxwi8Fxfx5eINDOiK lkZMCOa6z8qM32XeqyIhPoALqgdhRqVDhy59XkXMNSeEVcaV1TBouC7g8kxGWcZ209za g/4k33CFOa5pRS0c5bt5YnVuPtX5aWlQyV72a3qJwiDUEfw3sXDjmzIY6Kuf83cjaryW TZfSxCNyNJI9CSQp2px20mtdAnKBjbheop3RjstVzwgBIuiNVSYfP6Es6PvNn+K5AHzQ qPghY9j4GJyNqZBk/c4n1J55yZKGWeYoAyWYSE0dtTGrs3uwhj3xk3hp6difW9bBtwOA UKzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686178940; x=1688770940; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=XdSUjfb12ZWJ7TVasbJqnGF4IrrXWVIaZoyRPRUCVz4=; b=CjC50P6g58alvShJwpXDhbXtE86feWRKYYFGPpZG5dNsSRJfwc+iuElaOi8lyrzNRR fTZYFzk8r65dS8+IvkG2burzqdy9pQqXDEBefQuUBHIQT8jq+i1+sykmbDJhBcuoRzfV 0BKvraJZxVMmyDMAdL8kk5MMah+iOWu/645+FW/CVHqbfcbDpIdvgli7G6R4qVnNuYW1 7pqBPPaL+aqiWxFJS/KJFIHzHNkHsard9YXERouXj8PFcctr/2YQziRCMxGJ5IyRq2YV 3rvSKN26kXtyUQQfVteRT/dKNmGqoiYDlklnm3Z+63b6GsKiwB/516rHxf9/Rn4KCcQY WWcA== X-Gm-Message-State: AC+VfDzwBL1xoujeNmyOmEChE+C8QT76Vfyzp3YtRrljgHmWExrPBbpn DEtz6QVn0LPTYvP8baodguumfWM6m4UXBWFBG2oxI3mf X-Google-Smtp-Source: ACHHUZ5ir723WrjKCVBu51ABE+bzGKP3eIoqC42nu03cvdIbvxTPPNh+f7lx31kwt3pyLOzy0N3oAA== X-Received: by 2002:a05:6830:1bd6:b0:6b2:a874:693c with SMTP id v22-20020a0568301bd600b006b2a874693cmr2482837ota.12.1686178939847; Wed, 07 Jun 2023 16:02:19 -0700 (PDT) Received: from localhost (104-178-186-189.lightspeed.milwwi.sbcglobal.net. [104.178.186.189]) by smtp.gmail.com with ESMTPSA id e72-20020a25694b000000b00bb131cd635bsm226355ybc.8.2023.06.07.16.02.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jun 2023 16:02:19 -0700 (PDT) Date: Wed, 7 Jun 2023 19:02:16 -0400 From: Taylor Blau To: git@vger.kernel.org Cc: Derrick Stolee , Victoria Dye , Jeff King , Junio C Hamano Subject: [PATCH 2/2] shortlog: introduce `--email-only` to only show emails Message-ID: <44179d28fa7676965a28734e20584d54b44e051b.1686178917.git.me@ttaylorr.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org When a shortlog caller wants to group output by, say, author email, they can easily express this with: $ git shortlog --group=format:%ae and restrict output to specific email(s) with the new `--group-filter` option introduced by the previous commit. But they are not able to apply the same treatment to identities that appear in trailers. Doing: $ git shortlog -e --group=format:%ae --group=trailer:Co-authored-by will produce funky results, interspersing proper emails with full "Name " identities from the Co-authored-by trailer (or anything else that might appear there), like: 461 me@ttaylorr.com 11 Taylor Blau So if the caller wants to restrict output to a set of matching email addresses (say, "me@ttaylorr.com"), they cannot do it with a `--group-filter`, since it would discard the group "Taylor Blau ". Introduce a new `--email-only` option, which extracts the email component of an identity from all shortlog groups, including trailers. It behaves similarly to the `-e` option, but replaces its output with just the email component, instead of adding it on to the end. Now, `shortlog` callers can perform: $ git shortlog -s --group=author --group=trailer:Co-authored-by \ --email-only --group-filter="" 472 to obtain the output they want. Signed-off-by: Taylor Blau --- Documentation/git-shortlog.txt | 5 +++++ builtin/shortlog.c | 33 ++++++++++++++++++++++++--------- shortlog.h | 1 + t/t4201-shortlog.sh | 28 ++++++++++++++++++++++++++++ 4 files changed, 58 insertions(+), 9 deletions(-) diff --git a/Documentation/git-shortlog.txt b/Documentation/git-shortlog.txt index dab6d09648..160c11aead 100644 --- a/Documentation/git-shortlog.txt +++ b/Documentation/git-shortlog.txt @@ -39,6 +39,11 @@ OPTIONS --email:: Show the email address of each author. +--email-only:: + Show only the email address of each author, or committer. If + using a different kind of group (e.g. trailers, custom format, + etc.), only values which contain name/email-pairs will be shown. + --format[=]:: Instead of the commit subject, use some other information to describe each commit. '' can be any string accepted diff --git a/builtin/shortlog.c b/builtin/shortlog.c index 679db22c57..bbe01a376f 100644 --- a/builtin/shortlog.c +++ b/builtin/shortlog.c @@ -108,9 +108,13 @@ static int parse_ident(struct shortlog *log, maillen = ident.mail_end - ident.mail_begin; map_user(&log->mailmap, &mailbuf, &maillen, &namebuf, &namelen); - strbuf_add(out, namebuf, namelen); - if (log->email) - strbuf_addf(out, " <%.*s>", (int)maillen, mailbuf); + if (log->email_only) { + strbuf_addf(out, "<%.*s>", (int)maillen, mailbuf); + } else { + strbuf_add(out, namebuf, namelen); + if (log->email) + strbuf_addf(out, " <%.*s>", (int)maillen, mailbuf); + } return 0; } @@ -198,6 +202,8 @@ static void insert_records_from_trailers(struct shortlog *log, strbuf_reset(&ident); if (!parse_ident(log, &ident, value)) value = ident.buf; + else if (log->email_only) + continue; if (!strset_add(dups, value)) continue; @@ -370,12 +376,19 @@ void shortlog_init(struct shortlog *log) void shortlog_finish_setup(struct shortlog *log) { - if (log->groups & SHORTLOG_GROUP_AUTHOR) - string_list_append(&log->format, - log->email ? "%aN <%aE>" : "%aN"); - if (log->groups & SHORTLOG_GROUP_COMMITTER) - string_list_append(&log->format, - log->email ? "%cN <%cE>" : "%cN"); + if (log->email_only) { + if (log->groups & SHORTLOG_GROUP_AUTHOR) + string_list_append(&log->format, "<%aE>"); + if (log->groups & SHORTLOG_GROUP_COMMITTER) + string_list_append(&log->format, "<%cE>"); + } else { + if (log->groups & SHORTLOG_GROUP_AUTHOR) + string_list_append(&log->format, + log->email ? "%aN <%aE>" : "%aN"); + if (log->groups & SHORTLOG_GROUP_COMMITTER) + string_list_append(&log->format, + log->email ? "%cN <%cE>" : "%cN"); + } string_list_sort(&log->trailers); string_list_sort(&log->group_filter); @@ -397,6 +410,8 @@ int cmd_shortlog(int argc, const char **argv, const char *prefix) N_("suppress commit descriptions, only provides commit count")), OPT_BOOL('e', "email", &log.email, N_("show the email address of each author")), + OPT_BOOL(0, "email-only", &log.email_only, + N_("only show the email address of each author")), OPT_CALLBACK_F('w', NULL, &log, N_("[,[,]]"), N_("linewrap output"), PARSE_OPT_OPTARG, &parse_wrap_args), diff --git a/shortlog.h b/shortlog.h index 8ebee0e2d6..3fb28639c3 100644 --- a/shortlog.h +++ b/shortlog.h @@ -30,6 +30,7 @@ struct shortlog { struct string_list format; int email; + int email_only; struct string_list mailmap; FILE *file; }; diff --git a/t/t4201-shortlog.sh b/t/t4201-shortlog.sh index 0695c42ca8..d747a402ff 100755 --- a/t/t4201-shortlog.sh +++ b/t/t4201-shortlog.sh @@ -400,6 +400,34 @@ test_expect_success '--no-group-filter reset group filters' ' test_cmp expect actual ' +test_expect_success '--email-only shows emails from author' ' + cat >expect <<-\EOF && + 2 + EOF + git shortlog -ns --group=author --email-only -2 HEAD >actual && + test_cmp expect actual +' + +test_expect_success '--email-only shows emails from committer' ' + cat >expect <<-\EOF && + 2 + EOF + git shortlog -ns --group=committer --email-only -2 HEAD >actual && + test_cmp expect actual +' + +test_expect_success '--email-only shows emails from trailers with idents' ' + cat >expect <<-\EOF && + 1 + 1 + EOF + # at this point, HEAD~3 has a trailer "Repeated-trailer: Foo", + # which is not shown here since it cannot be parsed as an ident + git shortlog -ns --group=trailer:some-trailer --email-only -3 \ + HEAD >actual && + test_cmp expect actual +' + test_expect_success 'shortlog can match multiple format groups' ' GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME" \ git commit --allow-empty -m "identical names" &&