Skip to content

Commit cc90750

Browse files
moygitster
authored andcommitted
send-email: don't use Mail::Address, even if available
Using Mail::Address made sense when we didn't have a proper parser. We now have a reasonable address parser, and using Mail::Address _if available_ causes much more trouble than it gives benefits: * Developers typically test one version, not both. * Users may not be aware that installing Mail::Address will change the behavior. They may complain about the behavior in one case without knowing that Mail::Address is involved. * Having this optional Mail::Address makes it tempting to anwser "please install Mail::Address" to users instead of fixing our own code. We've reached the stage where bugs in our parser should be fixed, not worked around. Signed-off-by: Matthieu Moy <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent cb2922f commit cc90750

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

git-send-email.perl

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,6 @@ sub format_2822_time {
155155
}
156156

157157
my $have_email_valid = eval { require Email::Valid; 1 };
158-
my $have_mail_address = eval { require Mail::Address; 1 };
159158
my $smtp;
160159
my $auth;
161160
my $num_sent = 0;
@@ -490,11 +489,7 @@ sub read_config {
490489
($repocommitter) = Git::ident_person(@repo, 'committer');
491490

492491
sub parse_address_line {
493-
if ($have_mail_address) {
494-
return map { $_->format } Mail::Address->parse($_[0]);
495-
} else {
496-
return Git::parse_mailboxes($_[0]);
497-
}
492+
return Git::parse_mailboxes($_[0]);
498493
}
499494

500495
sub split_addrs {

0 commit comments

Comments
 (0)