]> Sergey Matveev's repositories - public-inbox.git/commitdiff
import: filter out [<>] from user names
authorEric Wong <e@80x24.org>
Tue, 12 Apr 2016 21:16:38 +0000 (21:16 +0000)
committerEric Wong <e@80x24.org>
Tue, 12 Apr 2016 21:16:38 +0000 (21:16 +0000)
It confuses the git ident parser and may not be a great
idea to fix in git since it could break interopability
with older versions.

lib/PublicInbox/Import.pm

index 5bae69df4d349f1e40a898df0bf3972684eff588..7073c3d96d70742be0477278d9c8250609f2dd20 100644 (file)
@@ -139,6 +139,12 @@ sub add {
        my $mid = mid_mime($mime);
        my $path = mid2path($mid);
 
+       # git gets confused with:
+       #  "'A U Thor <u@example.com>' via foo" <foo@example.com>
+       # ref:
+       # <CAD0k6qSUYANxbjjbE4jTW4EeVwOYgBD=bXkSu=akiYC_CB7Ffw@mail.gmail.com>
+       $name =~ s/<([^>]+)>/($1)/g;
+
        my ($r, $w) = $self->gfi_start;
        my $tip = $self->{tip};
        if ($tip ne '') {