threads / patch / 5872

patchUnderstand the meaning of commas in git-send-email

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

## tl;dr

2 messages between Oct 10, 2006 and Oct 10, 2006. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

Matthew Wilcox· Oct 10, 2006, 14:59 UTC · lore

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 <matthew@wil.cx>

--- /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

Show changes to diff +9 −7
@@ -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;
Junio C Hamano· Oct 10, 2006, 17:44 UTC · re: Matthew Wilcox · lore

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

Matthew Wilcox <matthew@wil.cx> writes:
Show 5 quoted lines
> 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 <matthew@wil.cx>

I am not sure. The input addresses this part of the code deals with are of human readable form

	Matthew Wilcox <matthew@wil.cx>
        matthew@wil.cx (Matthew Wilcox)
and the loop is extracting the part inside <> pair.

I have a mild suspicion that your patch may need to understand quoting to handle somebody else's name safely and correctly.

	junkio@cox.net (Junio C Hamano, aka gitster)

← back to recent threads