threads / bug / 63949

[BUG] suppress-cc does not support multiple keywords

Subject: [BUG] suppress-cc does not support multiple keywords

## tl;dr

4 messages between Aug 13, 2025 and Aug 13, 2025.

replies: 3people: 3as markdown or json

Timur Tabi· Aug 13, 2025, 00:05 UTC · lore

I hope this isn't just some user error on my part, but whenever I use the --suppress-cc option, and I specify more than one keyword (e.g. --suppress-cc=author,self ), git complains that it doesn't recognize the keyword. It seems that it treats all of the comma-separated keywords as one big keyword with commas in it.

Here's the git-bugreport:

Thank you for filling out a Git bug report! Please answer the following questions to help us understand your issue.

What did you do before the bug happened? (Steps to reproduce your issue)
git send-email --suppress-cc=author,self ...
What did you expect to happen? (Expected behavior)
The command to succeed, excluding "author" and "self" from the automatic CC.
What happened instead? (Actual behavior)
Unknown --suppress-cc field: 'author,self'
What's different between what you expected and what actually happened?
The --suppress-cc command should accept multiple keywords.
Anything else you want to add:

I was able to work around the problem by specifying --suppress-cc multiple times, once for each keyword.

[System Info]
git version 2.50.1
cpu: x86_64
no commit associated with this build
sizeof-long: 8
sizeof-size_t: 8
shell-path: /bin/sh
libcurl: 8.5.0
zlib: 1.3
SHA-1: SHA1_DC
SHA-256: SHA256_BLK
uname: Linux 6.14.0-27-generic #27~24.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue Jul 2>
compiler info: gnuc: 13.3
libc info: glibc: 2.39
$SHELL (typically, interactive shell): /bin/bash
[Enabled Hooks]
Eric Sunshine· Aug 13, 2025, 06:34 UTC · re: Timur Tabi · lore

Re: [BUG] suppress-cc does not support multiple keywords

On Tue, Aug 12, 2025 at 8:06 PM Timur Tabi <timur@kernel.org> wrote:
Show 5 quoted lines
> I hope this isn't just some user error on my part, but whenever I use
> the --suppress-cc option, and I specify more than one keyword (e.g.
> --suppress-cc=author,self ), git complains that it doesn't recognize
> the keyword.  It seems that it treats all of the comma-separated
> keywords as one big keyword with commas in it.

It's probably a case of user error. As far as I can see, the documentation[*] does not in any way suggest that --suppress-cc accepts a comma-separated list of categories to suppress.

> I was able to work around the problem by specifying --suppress-cc
> multiple times, once for each keyword.

Indeed, consulting the source code, this behavior appears to be intentional. If there is any "bug", it's that the documentation does state that you can specify --suppress-cc multiple times (even though you obviously can).

[*]: https://git-scm.com/docs/git-send-email#Documentation/git-send-email.txt---suppress-cccategory
Junio C Hamano· Aug 13, 2025, 14:33 UTC · re: Eric Sunshine · lore

Re: [BUG] suppress-cc does not support multiple keywords

Eric Sunshine <sunshine@sunshineco.com> writes:
Show 5 quoted lines
> ... If there is any "bug", it's that the documentation does state
> that you can specify --suppress-cc multiple times (even though you
> obviously can).
>
> [*]: https://git-scm.com/docs/git-send-email#Documentation/git-send-email.txt---suppress-cccategory
"does state"?  or "does not state" or "does state that you cannot"?

I guess you meant the second one; some other options like --to explicitly say "multiple times", but many others, this one among them, does not.

The existing text
        --suppress-cc=<category>::
                Specify an additional category of recipients to suppress the
                auto-cc of:

does make it clear that <category> given to a single instance of this option is a single category ("AN additional category").

Perhaps a minimum fix would be something like this?
 Documentation/git-send-email.adoc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git c/Documentation/git-send-email.adoc w/Documentation/git-send-email.adoc
index 5335502d68..b959e39257 100644
--- c/Documentation/git-send-email.adoc
+++ w/Documentation/git-send-email.adoc
@@ -403,7 +403,9 @@ Automating
 - `all` will suppress all auto cc values.
 --
 +
-Default is the value of `sendemail.suppressCc` configuration value; if
+Can be given more than once to suppress multiple categories.
+Default is the value of `sendemail.suppressCc` configuration
+variable (which can be given multiple times, one category at a time); if
 that is unspecified, default to `self` if `--suppress-from` is
 specified, as well as `body` if `--no-signed-off-cc` is specified.
 
Eric Sunshine· Aug 13, 2025, 15:38 UTC · re: Junio C Hamano · lore

Re: [BUG] suppress-cc does not support multiple keywords

On Wed, Aug 13, 2025 at 10:33 AM Junio C Hamano <gitster@pobox.com> wrote:
Show 8 quoted lines
> Eric Sunshine <sunshine@sunshineco.com> writes:
> > ... If there is any "bug", it's that the documentation does state
> > that you can specify --suppress-cc multiple times (even though you
> > obviously can).
>
> "does state"?  or "does not state" or "does state that you cannot"?
>
> I guess you meant the second one

Indeed, I did mean the second one. Don't know how I dropped the word "not". Sorry for any confusion, and thanks for the correction.

Show 14 quoted lines
> The existing text
>         --suppress-cc=<category>::
>                 Specify an additional category of recipients to suppress the
>                 auto-cc of:
> does make it clear that <category> given to a single instance of
> this option is a single category ("AN additional category").
>
> Perhaps a minimum fix would be something like this?
>
> -Default is the value of `sendemail.suppressCc` configuration value; if
> +Can be given more than once to suppress multiple categories.
> +Default is the value of `sendemail.suppressCc` configuration
> +variable (which can be given multiple times, one category at a time); if
>  that is unspecified, default to `self` if `--suppress-from` is
Yes, I think that would be a welcome change.

← back to recent threads