Re: [PATCH] send-email: new 'add-envelope' option

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH] send-email: new 'add-envelope' option

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:47:45

Felipe Contreras [off-list ref] writes:
I thought a bit more about this, and in the end what we really want is
to add the sender envelope. The most typical case would be to use the
'from' address, but we should be able to override it (we do both by
using --envelope-sender).

So here are other options.

a) --add-envelope: add the sender envelope, by default it would be the
'from' address, but could be overridden by --envelope-sender.
I do not think the latter half of this description makes much sense, as
the existing --envelope-sender=<this-address> alone already says "add this
envelope sender".

It is unfortunate that we cannot sanely have an option that takes an
optional string argument from the command line.  Ideally, if we can
specify --envelope-sender without any argument, we could make it to mean
"pretend as if the 'from' address is given to this option", but that would
make the command line pasing ambiguous, so we would need an extra option
like this one.  "--envelope-sender=from" might be a more intuitive way to
say this, though.
b) --envelope-sender="" or "auto": this would require minimal changes
but looks a bita strange.
An explicit empty string does look very strange, but I do not think a
magic word like "auto" (or "from") that cannot sanely be your envelope
sender address is a bad idea.
Any thoughts?
It is much easier to work on the configuration front, by the way, and I
expect people who regularly interact with multiple projects to appreciate
this feature would configure their send-email once and forget about it, so
the command line clunkiness might not be such a big issue.

A user who works with more than one projects with different identity known
to each project would use $HOME/.gitconfig and send-email configuration
identity feature to set "sendemail.<identity>.from" and friends in there,
while setting sendemail.identity configuration in .git/config for each
project, so being able to say "use whatever 'from' as the envelope sender"
once in $HOME/.gitconfig would be convenient.

So I could have in $HOME/.gitconfig:

        [sendemail]
		; used as a boolean to say "use from"
                envelopesender
        [sendemail.git]
                from = Junio C Hamano [off-list ref]
                to = git mailing list [off-list ref]
        [sendemail.frotz]
                from = Junio C Hamano [off-list ref]
                to = frotz mailing list [off-list ref]

and then in my {git,frotz}.git/.git/config would have

        [sendemail]                     [sendemail]
                identity = git                  identity = frotz

respectively.  Without your patch, in $HOME/.gitconfig, I wouldn't have
the global sendemail.envelopesender but have separate individual
configuration variables sendemail.{git,frotz}.envelopesender defined.

Re: [PATCH] send-email: new 'add-envelope' option

From: Felipe Contreras <hidden>
Date: 2016-06-15 22:47:45

On Mon, Nov 23, 2009 at 1:54 AM, Junio C Hamano [off-list ref] wrote:
Felipe Contreras [off-list ref] writes:
quoted
a) --add-envelope: add the sender envelope, by default it would be the
'from' address, but could be overridden by --envelope-sender.
I do not think the latter half of this description makes much sense, as
the existing --envelope-sender=<this-address> alone already says "add this
envelope sender".
--envelope-sender=foo@bar.com would imply --add-envelope.
It is unfortunate that we cannot sanely have an option that takes an
optional string argument from the command line.  Ideally, if we can
specify --envelope-sender without any argument, we could make it to mean
"pretend as if the 'from' address is given to this option", but that would
make the command line pasing ambiguous, so we would need an extra option
like this one.  "--envelope-sender=from" might be a more intuitive way to
say this, though.
I agree, but --envelope-sender=from looks a bit strange to me.
quoted
b) --envelope-sender="" or "auto": this would require minimal changes
but looks a bita strange.
An explicit empty string does look very strange, but I do not think a
magic word like "auto" (or "from") that cannot sanely be your envelope
sender address is a bad idea.
I think "auto" is the least worst option right now.
quoted
Any thoughts?
It is much easier to work on the configuration front, by the way, and I
expect people who regularly interact with multiple projects to appreciate
this feature would configure their send-email once and forget about it, so
the command line clunkiness might not be such a big issue.

A user who works with more than one projects with different identity known
to each project would use $HOME/.gitconfig and send-email configuration
identity feature to set "sendemail.<identity>.from" and friends in there,
while setting sendemail.identity configuration in .git/config for each
project, so being able to say "use whatever 'from' as the envelope sender"
once in $HOME/.gitconfig would be convenient.

So I could have in $HOME/.gitconfig:

       [sendemail]
               ; used as a boolean to say "use from"
               envelopesender
       [sendemail.git]
               from = Junio C Hamano [off-list ref]
               to = git mailing list [off-list ref]
       [sendemail.frotz]
               from = Junio C Hamano [off-list ref]
               to = frotz mailing list [off-list ref]

and then in my {git,frotz}.git/.git/config would have

       [sendemail]                     [sendemail]
               identity = git                  identity = frotz

respectively.  Without your patch, in $HOME/.gitconfig, I wouldn't have
the global sendemail.envelopesender but have separate individual
configuration variables sendemail.{git,frotz}.envelopesender defined.
I also thought about having an identity (profile) for sendmail; it
would be very useful to specify the smtp server, aliases file, and
from address that multiple repositories can share and can be easily
changed (working for my company vs working for myself).

However, even in this case I would like to have a global option to add
the sender automatically from the 'from' address.

-- 
Felipe Contreras
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help