From 21802cd32805b19fa32e8e3594ee3914733d53d3 Mon Sep 17 00:00:00 2001 From: Stephen Boyd Date: Wed, 29 Sep 2010 00:26:44 -0700 Subject: send-email: Use To: headers in patch files It's a minor annoyance when you take the painstaking time to setup To: headers for each patch in a large series, and then go out to send the series with git-send-email and watch git ignore the To: headers in the patch files. Therefore, always add To: headers from a patch file to the To: headers for that message. Keep the prompt for the blanket To: header so as to not break scripts (and user expectations). This means even if a patch has a To: header, git will prompt for the To: address. Otherwise, we'll need to introduce interface breakage to either request the header for each patch missing a To: header or default the header to whatever To: address is found first (be it in a patch or from user input). Both of these options don't seem very obvious/useful. Reported-by: Viresh Kumar Signed-off-by: Stephen Boyd Tested-by: Viresh Kumar Signed-off-by: Junio C Hamano --- git-send-email.perl | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'git-send-email.perl') diff --git a/git-send-email.perl b/git-send-email.perl index e1f29a72a..d6028ec7b 100755 --- a/git-send-email.perl +++ b/git-send-email.perl @@ -1176,6 +1176,13 @@ foreach my $t (@files) { $1, $_) unless $quiet; push @cc, $1; } + elsif (/^To:\s+(.*)$/) { + foreach my $addr (parse_address_line($1)) { + printf("(mbox) Adding to: %s from line '%s'\n", + $addr, $_) unless $quiet; + push @to, sanitize_address($addr); + } + } elsif (/^Cc:\s+(.*)$/) { foreach my $addr (parse_address_line($1)) { if (unquote_rfc2047($addr) eq $sender) { -- cgit v1.2.1