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