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

Re: [RFC/PATCH] git-send-email: Remember sources of Cc addresses

From
Jeff King <peff@peff.net>
Date
May 4, 2011, 21:35 UTC
Message-ID
<20110504213535.GB27779@sigill.intra.peff.net>
In-Reply-To
<1304525528-24757-1-git-send-email-jnareb@gmail.com>
On Wed, May 04, 2011 at 06:12:08PM +0200, Jakub Narebski wrote:
Show 16 quoted lines
> > Sure. Since you are actually doing SMTP, you have much more flexibility
> > in knowing what errors happen. Look in git-send-email.perl's
> > send_message, around line 1118. We use the Mail::SMTP module, but we
> > just feed it the whole recipient list and barf if any of them is
> > rejected. You could probably remember which recipients are "important"
> > (i.e., given on the command line) and which were pulled automatically
> > from the commit information, and then feed each recipient individually.
> > If important ones fail, abort the message. If an unimportant one fails,
> > send the message anyway, but remember the bad address and report the
> > error at the end.
> [...]
> This is an RFC patch preparing the way, so to speak, by remembering
> where each Cc address came from.  We could in the future treat
> $cc{'body'} / all_cc('body') differently from the rest of all_cc().
> 
> Is the approach taken here sane?

Yeah, from my cursory read, it looks like a good step forward, and I didn't see any obvious bugs.

You'll need still more refactoring in send_message to treat them differently at the SMTP level. We collapse all of the addresses down to a single list via unique_email_list (and we obviously want to keep this unique-ifying step), but that final list will have to remember where each address came from.

Show 7 quoted lines
> +sub all_cc {
> +	my @keys = @_;
> +	@keys = qw(initial from cc body cc-cmd) unless @keys;
> +	return map { ref($_) ? @$_ : () } @cc{@keys};
> +
> +	#return map { ref($_) ? @$_ : () } values %cc;
> +}
Nit: debugging cruft. :)
-Peff
Previous: Jakub NarebskiNext: Jakub Narebski
Message 6 of 9 in “RFC: git send-email and error handling”
  1. Paul GortmakerApr 14, 2011
  2. Jeff KingApr 14, 2011
  3. Paul GortmakerApr 15, 2011
  4. Jeff KingApr 15, 2011
  5. git-send-email: Remember sources of Cc addressesJakub Narebski, May 4, 2011
  6. Jeff KingMay 4, 2011
  7. 2/2 git-send-email: Do not require that addresses added from body be validJakub Narebski, May 5, 2011
  8. 3/2 git-send-email: Warn about rejected automatically added recipientsJakub Narebski, May 6, 2011
  9. Jakub NarebskiMay 7, 2011

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.