[PATCH 0 of 3] Improve email address parsing

Marti Raudsepp marti at juffo.org
Thu Nov 5 01:28:17 CST 2009


On Thu, Nov 5, 2009 at 12:23 AM, Matt Mackall <mpm at selenic.com> wrote:
> Can't say I'm excited by this. We've already got a perfectly good,
> clean, safe, and easy to parse way to pass multiple arguments and I
> don't think "mail programs do it differently" is a good argument for us
> to do it differently in exactly one place.

Maybe I should explain where I'm coming from.

I don't even consider multiple emails to be "multiple arguments" to
the command. When I first used patchbomb, I assumed that --cc etc
arguments are passed verbatim as the Cc: header. Instead of telling
"hg, send email to recipient A and recipient B", I thought it meant
"hg, tell the mail server that X is the recipient"

In this mode, everything would have worked perfectly with commas. This
doesn't sound like an unreasonable assumption to me, given that hg is
supposed to be a simple tool, and the mail server ("smart host" as
they call it) is the one that actually cares about addresses. Even the
fact that hg is parsing addresses at all came as a surprise to me.

The other reason is that I can just take an existing email thread and
copy the Cc: headers into the --cc argument instead of having to
manually tinker with splitting them up.

I had also used 'git send-email' before which did exactly what I expected.

So, IMHO, if hg email doesn't accept multiple addresses in a single
argument, there is a reason to at least warn the user, instead of
silently doing the wrong thing.

However, I see no point to nagging if we can so easily just do the
right thing, especially if we already have this function for parsing
configuration options.

I just don't see purism as a convincing argument against this behavior.

Regards,
Marti


More information about the Mercurial-devel mailing list