threads / discuss / 28137

Issue: Mails sent twice if patch is mentioned twice while sending mail.

Subject: Issue: Mails sent twice if patch is mentioned twice while sending mail.

## tl;dr

4 messages between Aug 17, 2011 and Aug 17, 2011.

replies: 3people: 3as markdown or json

viresh kumar· Aug 17, 2011, 06:11 UTC · lore
Hello,

I found something which look wrong to me, but may not be wrong. Suppose if we do:

git send-email --to=abc@xyz.com 0001-xyz.patch 0001-xyz.patch

What should be the desired behavior of this command, Should we get mail only once or twice?

Currently we are getting it twice.
-- 
viresh
Ramkumar Ramachandra· Aug 17, 2011, 08:52 UTC · re: viresh kumar · lore

Re: Issue: Mails sent twice if patch is mentioned twice while sending mail.

Hi Viresh,
Viresh kumar writes:
> git send-email --to=abc@xyz.com 0001-xyz.patch 0001-xyz.patch
>
> What should be the desired behavior of this command, Should we get
> mail only once or twice?

I'd expect it to send out two emails. Why should 'git send-email' check the supplied command-line arguments for duplicates? I can't think of a usecase for it. It's a simple Perl script that mails out the mbox files specified on the command-line. Could you tell us your usecase? If it's a shell script that calls 'git send-email' with duplicate arguments, I think you should fix the shell script, not 'git send-email'.

Thanks.
-- Ram
vireshk· Aug 17, 2011, 09:16 UTC · re: Ramkumar Ramachandra · lore

Re: Issue: Mails sent twice if patch is mentioned twice while sending mail.

On 8/17/2011 2:22 PM, Ramkumar Ramachandra wrote:
Show 14 quoted lines
> Viresh kumar writes:
>> git send-email --to=abc@xyz.com 0001-xyz.patch 0001-xyz.patch
>>
>> What should be the desired behavior of this command, Should we get
>> mail only once or twice?
> 
> I'd expect it to send out two emails.  Why should 'git send-email'
> check the supplied command-line arguments for duplicates?  I can't
> think of a usecase for it. It's a simple Perl script that mails out
> the mbox files specified on the command-line.  Could you tell us your
> usecase?  If it's a shell script that calls 'git send-email' with
> duplicate arguments, I think you should fix the shell script, not 'git
> send-email'.
> 
Hi Ram,

Actually i did this by mistake once and thought git send-email should have taken care of this. I may be wrong, but it was just an thought.

-- viresh

Matthieu Moy· Aug 17, 2011, 09:58 UTC · re: vireshk · lore

Re: Issue: Mails sent twice if patch is mentioned twice while sending mail.

vireshk <viresh.kumar@st.com> writes:
> Hi Ram,
>
> Actually i did this by mistake once and thought git send-email should
> have taken care of this. I may be wrong, but it was just an thought.

git send-email could probably issue a warning if the same patch is mentionned twice, but I don't think it's sane to try to silently autocorrect user's mistake.

If users get used to "git send-email 1.patch 1.patch" sending the email only once, then what should be the expected behavior of

  git send-email 1.patch ./1.patch
  git send-email 1.patch symlink-to-1.patch
?

The nice thing with a warning is that you can't really blame the tool for not issuing a warning, while it can be harmfull to have an autocorrection fail in a real user-senario.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

← back to recent threads