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

4 messages from 2011-08-17 to 2011-08-17. Participants: viresh kumar, Ramkumar Ramachandra, vireshk, Matthieu Moy.
Thread: https://gitlist.dev/t/28137

## viresh kumar, 2011-08-17 06:11

Subject: Issue: Mails sent twice if patch is mentioned twice while sending mail.
Message-ID: <4E4B5B9D.1070901@st.com>
URL: https://gitlist.dev/e/4E4B5B9D.1070901%40st.com

```
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, 2011-08-17 08:52

Subject: Re: Issue: Mails sent twice if patch is mentioned twice while sending mail.
Message-ID: <CALkWK0nv=NrCzxfePL50GiJya+DbqdOmSMjPVEa-Sf1Qm5oAvg@mail.gmail.com>
URL: https://gitlist.dev/e/CALkWK0nv%3DNrCzxfePL50GiJya%2BDbqdOmSMjPVEa-Sf1Qm5oAvg%40mail.gmail.com
In-Reply-To: <4E4B5B9D.1070901@st.com>

```
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, 2011-08-17 09:16

Subject: Re: Issue: Mails sent twice if patch is mentioned twice while sending mail.
Message-ID: <4E4B86F1.2010802@st.com>
URL: https://gitlist.dev/e/4E4B86F1.2010802%40st.com
In-Reply-To: <CALkWK0nv=NrCzxfePL50GiJya+DbqdOmSMjPVEa-Sf1Qm5oAvg@mail.gmail.com>

```
On 8/17/2011 2:22 PM, Ramkumar Ramachandra wrote:
> 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, 2011-08-17 09:58

Subject: Re: Issue: Mails sent twice if patch is mentioned twice while sending mail.
Message-ID: <vpq62lwjr52.fsf@bauges.imag.fr>
URL: https://gitlist.dev/e/vpq62lwjr52.fsf%40bauges.imag.fr
In-Reply-To: <4E4B86F1.2010802@st.com>

```
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/

```
