# [PATCH 1/1] get_maintainer.pl: add --cc option to produce comma separated list of emails

4 messages from 2026-03-19 to 2026-03-19. Participants: Jim Cromie, Joe Perches, jim.cromie@gmail.com.
Thread: https://gitlist.dev/t/65304

## Jim Cromie, 2026-03-19 16:06

Subject: [PATCH 1/1] get_maintainer.pl: add --cc option to produce comma separated list of emails
Message-ID: <20260319160633.1149562-1-jim.cromie@gmail.com>
URL: https://gitlist.dev/e/20260319160633.1149562-1-jim.cromie%40gmail.com

```
This new option works as follows:

  git send-email --cc=$(scripts/get_maintainer.pl -cc 0*.patch) 0*.patch

A complementary patch has been sent to git@vger.kernel.org, allowing:

  git send-email --cc=scripts/get_maintainer.pl 0*.patch

send-email recognizes that its single arg is executable, and runs it
in a subshell with --cc @ARGV, eliminating the chance that the user
forgets options and arguments.

It also does the same for --to and --bcc, in case get_maintainer can
usefully distinguish who should get the to's from the cc's.

cc: git@vger.kernel.org
Signed-off-by: Jim Cromie <jim.cromie@gmail.com>
---
 scripts/get_maintainer.pl | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl
index 4414194bedcf..6c9ca793fd6e 100755
--- a/scripts/get_maintainer.pl
+++ b/scripts/get_maintainer.pl
@@ -48,6 +48,7 @@ my $email_remove_duplicates = 1;
 my $email_use_mailmap = 1;
 my $output_multiline = 1;
 my $output_separator = ", ";
+my $output_cc = 0;
 my $output_roles = 0;
 my $output_rolestats = 1;
 my $output_substatus = undef;
@@ -265,6 +266,7 @@ if (!GetOptions(
 		'moderated!' => \$email_moderated_list,
 		's!' => \$email_subscriber_list,
 		'multiline!' => \$output_multiline,
+		'cc!' => \$output_cc,
 		'roles!' => \$output_roles,
 		'rolestats!' => \$output_rolestats,
 		'separator=s' => \$output_separator,
@@ -320,6 +322,15 @@ if (!defined $output_substatus) {
     $output_substatus = $email && $output_roles && -t STDOUT;
 }
 
+if ($output_cc) {
+    $email_usename = 0;
+    $output_multiline = 0;
+    $output_separator = ",";
+    $output_rolestats = 0;
+    $output_roles = 0;
+    $output_substatus = 0;
+}
+
 if ($sections || $letters ne "") {
     $sections = 1;
     $email = 0;
@@ -1096,6 +1107,7 @@ MAINTAINER field selection options:
   --bug => print bug reporting info if any
 
 Output type options:
+  --cc => print comma separated list of all emails
   --separator [, ] => separator for multiple entries on 1 line
     using --separator also sets --nomultiline if --separator is not [, ]
   --multiline => print 1 entry per line
-- 
2.53.0


```

## Joe Perches, 2026-03-19 16:13

Subject: Re: [PATCH 1/1] get_maintainer.pl: add --cc option to produce comma separated list of emails
Message-ID: <b69406326eceb27f5973bc0ba55366438845a003.camel@perches.com>
URL: https://gitlist.dev/e/b69406326eceb27f5973bc0ba55366438845a003.camel%40perches.com
In-Reply-To: <20260319160633.1149562-1-jim.cromie@gmail.com>

```
On Thu, 2026-03-19 at 10:06 -0600, Jim Cromie wrote:
> ˋˋˋ
> This new option works as follows:
> 
>   git send-email --cc=$(scripts/get_maintainer.pl -cc 0*.patch) 0*.patch
> 
> A complementary patch has been sent to [git@vger.kernel.org](mailto:git@vger.kernel.org), allowing:
> 
>   git send-email --cc=scripts/get_maintainer.pl 0*.patch

I think this is not particularly useful.
Just use a script.

```

## jim.cromie@gmail.com, 2026-03-19 16:56

Subject: Re: [PATCH 1/1] get_maintainer.pl: add --cc option to produce comma separated list of emails
Message-ID: <CAJfuBxxbV1X3X0GdvBEEHB8gS9wQ8hHcKDGC7GrSkOPECgGV3A@mail.gmail.com>
URL: https://gitlist.dev/e/CAJfuBxxbV1X3X0GdvBEEHB8gS9wQ8hHcKDGC7GrSkOPECgGV3A%40mail.gmail.com
In-Reply-To: <b69406326eceb27f5973bc0ba55366438845a003.camel@perches.com>

```
On Thu, Mar 19, 2026 at 10:14 AM Joe Perches <joe@perches.com> wrote:
>
> On Thu, 2026-03-19 at 10:06 -0600, Jim Cromie wrote:
> > ˋˋˋ
> > This new option works as follows:
> >
> >   git send-email --cc=$(scripts/get_maintainer.pl -cc 0*.patch) 0*.patch
> >
> > A complementary patch has been sent to [git@vger.kernel.org](mailto:git@vger.kernel.org), allowing:
> >
> >   git send-email --cc=scripts/get_maintainer.pl 0*.patch
>
> I think this is not particularly useful.
> Just use a script.

   1. Efficiency (One-Shot vs. Per-Patch): Unlike --cc-cmd, which runs
once per patch file, this runs once for the entire series. For a large
series or
      a slow script (like get_maintainer.pl), this is a  performance
win and avoids redundant processing.
   2. Dry-Run Integrity: By integrating it into send-email, the script
execution is part of the command's own logic. This ensures that
--dry-run
      accurately reflects exactly what the script produced within the
context of the mailing operation.
   3. Argument Deduplication: It eliminates the "Double-entry" problem
where you have to pass the patch list twice (once to the subshell and
once to git
      send-email). This reduces the chance of a typo causing you to
send patches to the wrong set of maintainers if the lists get out of
sync.
   4. Configuration Synergy: You can now set sendemail.cc =
./scripts/get_maintainer.pl in your .git/config. A shell wrapper can't
easily override or
      augment the built-in recipient logic as cleanly as this does.

That last point seems a clear win.
Far less maintainer annoyance at not receiving the entire patchset.

```

## Joe Perches, 2026-03-19 17:08

Subject: Re: [PATCH 1/1] get_maintainer.pl: add --cc option to produce comma separated list of emails
Message-ID: <5d28fa8fda122093fcfcf6f948f67184c0c9018e.camel@perches.com>
URL: https://gitlist.dev/e/5d28fa8fda122093fcfcf6f948f67184c0c9018e.camel%40perches.com
In-Reply-To: <CAJfuBxxbV1X3X0GdvBEEHB8gS9wQ8hHcKDGC7GrSkOPECgGV3A@mail.gmail.com>

```
On Thu, 2026-03-19 at 10:56 -0600, jim.cromie@gmail.com wrote:
> On Thu, Mar 19, 2026 at 10:14 AM Joe Perches <[joe@perches.com](mailto:joe@perches.com)> wrote:
> > On Thu, 2026-03-19 at 10:06 -0600, Jim Cromie wrote:
> > > This new option works as follows:
> > >   git send-email --cc=$(scripts/get_maintainer.pl -cc 0*.patch) 0*.patch
> > I think this is not particularly useful.
> > Just use a script.

[1-3] remedied by script

>    4. Configuration Synergy: You can now set sendemail.cc =
> ./scripts/get_maintainer.pl in your .git/config. A shell wrapper can't
> easily override or
>       augment the built-in recipient logic as cleanly as this does.
> 
> That last point seems a clear win.
> Far less maintainer annoyance at not receiving the entire patchset.

That's not my experience.

This _will_ cc disinterested parties when there's a cover letter
for a large series.

```
