Skip to contentSkip to conversation

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

DISCUSSION viresh kumar 3 participants 4 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

Hello,

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

git send-email [email protected] 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.

Signature · 1 line
viresh
#1 lore raw

Hi Viresh,

Quoted 4 lines · Viresh kumar

git send-email [email protected] 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

author
#2 lore raw
Quoted 6 lines · Ramkumar Ramachandra
Quoted 4 lines · Viresh kumar

git send-email [email protected] 0001-xyz.patch 0001-xyz.patch

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

Quoted 8 lines

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

#3 lore raw
Quoted 4 lines · vireshk

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.

Signature · 2 lines
Matthieu Moy
http://www-verimag.imag.fr/~moy/