login
Header Space

 
 

[PATCH] make git-send-email.perl handle email addresses with no names when Email::Valid is present

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Junio C Hamano <gitster@...>
Cc: <git@...>
Date: Friday, July 13, 2007 - 12:17 am

When using git-send-email.perl on a changeset that has:
	Cc: <stable@kernel.org>
in the body of the description, and the Email::Valid perl module is
installed on the system, the email address will be deemed "invalid" for
some reason (Email::Valid isn't smart enough to handle this?) and
complain and not send the address the email.

Anyway, this tiny patch fixes this problem for me.  Note, my perl-foo is
quite week, so this could probably be easily done in one line for those
with better reg-ex skills.


Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -410,6 +410,9 @@ sub extract_valid_address {
 	return $address if ($address =~ /^($local_part_regexp)$/);
 
 	if ($have_email_valid) {
+		if ($address =~ s/^<//) {
+			$address =~ s/>$//;
+		}
 		return scalar Email::Valid->address($address);
 	} else {
 		# less robust/correct than the monster regexp in Email::Valid,
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] make git-send-email.perl handle email addresses with..., Greg KH, (Fri Jul 13, 12:17 am)
speck-geostationary