threads / bug / 12535

[ISSUE] git send-email sends wrong patches and non-provided CC (probably bug)

Subject: [ISSUE] git send-email sends wrong patches and non-provided CC (probably bug)

## tl;dr

4 messages between Mar 6, 2008 and Mar 8, 2008.

replies: 3people: 2as markdown or json

Imran M Yousuf· Mar 6, 2008, 09:11 UTC · lore
Hi,

Firstly sorry to gitster as he probably has received 10 redundant emails from me of my own patch, which I sent for test purpose before sending to the mailing list. In this process actually I found 2 issues:

1. git send-email sends CC to gitster though his email is not mentioned.
2. I wanted to send patches from a folder containing 3 patches
generated with 'git format-patch -n -o /output/dir/ -M -B origin'
command. When I use git send-email it rather sends 5 email; 3 for
PATCH 3/3 with same subject but different body. I later generated them
without -n option and sent to the mailing list and that was sent
correctly. Unfortunately gitster has 13 emails of the same content out
of 10 are outcomes of the bug. I am providing their message id so that
he can have a look at them:
Message-Id: <1204793490-20160-5-git-send-email-imyousuf@gmail.com>
Message-Id: <1204788919-23615-3-git-send-email-imyousuf@gmail.com>

If someone else wants to have a look at the problem I can also email it to him :).

-- 
Imran M Yousuf
Entrepreneur & Software Engineer
Smart IT Engineering
Dhaka, Bangladesh
Email: imran@smartitengineering.com
Mobile: +880-1711402557
Junio C Hamano· Mar 6, 2008, 10:19 UTC · re: Imran M Yousuf · lore

Re: [ISSUE] git send-email sends wrong patches and non-provided CC (probably bug)

"Imran M Yousuf" <imyousuf@gmail.com> writes:
> 1. git send-email sends CC to gitster though his email is not mentioned.
Check your config first.
Imran M Yousuf· Mar 6, 2008, 11:19 UTC · re: Junio C Hamano · lore

Re: [ISSUE] git send-email sends wrong patches and non-provided CC (probably bug)

On Thu, Mar 6, 2008 at 4:19 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 5 quoted lines
> "Imran M Yousuf" <imyousuf@gmail.com> writes:
>
>  > 1. git send-email sends CC to gitster though his email is not mentioned.
>
>  Check your config first.

Can someone help me where I can find it in the config? because I surely did not make any change to config of GIT project. I would be grateful for the help.

Best regards,
Imran
>
-- 
Imran M Yousuf
Entrepreneur & Software Engineer
Smart IT Engineering
Dhaka, Bangladesh
Email: imran@smartitengineering.com
Mobile: +880-1711402557
Junio C Hamano· Mar 8, 2008, 05:14 UTC · re: Imran M Yousuf · lore

Re: [ISSUE] git send-email sends wrong patches and non-provided CC (probably bug)

"Imran M Yousuf" <imyousuf@gmail.com> writes:
Show 10 quoted lines
> On Thu, Mar 6, 2008 at 4:19 PM, Junio C Hamano <gitster@pobox.com> wrote:
>> "Imran M Yousuf" <imyousuf@gmail.com> writes:
>>
>>  > 1. git send-email sends CC to gitster though his email is not mentioned.
>>
>>  Check your config first.
>
> Can someone help me where I can find it in the config? because I
> surely did not make any change to config of GIT project. I would be
> grateful for the help.
In $HOME/.gitconfig and $GIT_DIR/config, sendemail.{to,cccmd,bcc} .

Running "git send-email --dry-run $your_command_line_args $files" may tell you where the recipients list are picked up from. IIRC, the command picks up addresses on Signed-off-by: lines too, which needs to be explicitly squelched with --suppress-cc=all and/or friends.

One irritating pitfall is that --suppress-cc=<cccmd,cc,self,author,sob> takes lower precedence than others; especially, even the command line --suppress-cc=all is countermanded by configured sendemail.suppressfrom and sendemail.signedoffcc.

Even if we ignore this "the command line should trump configured values" irritation, I think there is a bug here.

    # If explicit old-style ones are specified, they trump --suppress-cc.
    $suppress_cc{'self'} = $suppress_from if defined $suppress_from;
    $suppress_cc{'sob'} = $signed_off_cc if defined $signed_off_cc;

$signed_off_cc asks for cc, so I think the second line should invert its logic.

-- >8 -- send-email: --no-signed-off-cc should suppress 'sob' cc

The logic to countermand suppression of Cc to the signers with a more explicit --signed-off-by option done in 6564828 (git-send-email: Generalize auto-cc recipient mechanism) suffers from a double-negation error.

A --signed-off-cc option, when false, should actively suppress CC: to be generated out of S-o-b lines, and it should refrain from suppressing when it is true.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 git-send-email.perl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/git-send-email.perl b/git-send-email.perl
index 29b1105..b3bd922 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -317,7 +317,7 @@ if ($suppress_cc{'all'}) {
 
 # If explicit old-style ones are specified, they trump --suppress-cc.
 $suppress_cc{'self'} = $suppress_from if defined $suppress_from;
-$suppress_cc{'sob'} = $signed_off_cc if defined $signed_off_cc;
+$suppress_cc{'sob'} = !$signed_off_cc if defined $signed_off_cc;
 
 # Debugging, print out the suppressions.
 if (0) {

← back to recent threads