git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 22, 2009, 23:54 UTC
Message-ID
<7v7htice04.fsf@alter.siamese.dyndns.org>
In-Reply-To
<94a0d4530911220437l5386b36ds4ef06dc66cc11bcc@mail.gmail.com>
Felipe Contreras <felipe.contreras@gmail.com> writes:
Show 9 quoted lines
> 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 <gitster@pobox.com>
                to = git mailing list <git@vger.kernel.org>
        [sendemail.frotz]
                from = Junio C Hamano <frotzster@example.xz>
                to = frotz mailing list <frotz@example.xz>
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.

Previous: Felipe ContrerasNext: Felipe Contreras
Message 10 of 11 in “send-email: new 'add-envelope' option”
  1. send-email: new 'add-envelope' optionFelipe Contreras, Nov 21, 2009
  2. Jeff KingNov 21, 2009
  3. Felipe ContrerasNov 21, 2009
  4. Junio C HamanoNov 22, 2009
  5. Felipe ContrerasNov 22, 2009
  6. Junio C HamanoNov 22, 2009
  7. Junio C HamanoNov 22, 2009
  8. Felipe ContrerasNov 23, 2009
  9. Felipe ContrerasNov 22, 2009
  10. Junio C HamanoNov 22, 2009
  11. Felipe ContrerasNov 24, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.