Subject: [PATCH] Understand the meaning of commas in git-send-email

From: Matthew Wilcox <[email-masked]>
Date: Tue, 10 Oct 2006 08:59:36 -0600

I made the mistake of adding one Cc: line with two email addresses on
it, instead of two Cc: lines with one email address each.  Extending
git-send-email to parse that case turns out to not be too much work.

Signed-off-by: Matthew Wilcox <[email-masked]>

--- /usr/bin/git-send-email	2006-07-29 09:52:13.000000000 -0600
+++ ./git-send-email.perl	2006-10-10 08:46:13.000000000 -0600
@@ -537,13 +542,15 @@
 	my @emails;
 
 	foreach my $entry (@_) {
-		if (my $clean = extract_valid_address($entry)) {
-			$seen{$clean} ||= 0;
-			next if $seen{$clean}++;
-			push @emails, $entry;
-		} else {
-			print STDERR "W: unable to extract a valid address",
-					" from: $entry\n";
+		foreach my $addr (split(/, */, $entry)) {
+			if (my $clean = extract_valid_address($addr)) {
+				$seen{$clean} ||= 0;
+				next if $seen{$clean}++;
+				push @emails, $addr;
+			} else {
+				print STDERR "W: unable to extract a valid",
+					" address from: $entry\n";
+			}
 		}
 	}
 	return @emails;