diff options
author | Yves Orton <demerphq@gmail.com> | 2022-08-20 19:20:30 +0200 |
---|---|---|
committer | Yves Orton <demerphq@gmail.com> | 2022-08-21 12:09:05 +0200 |
commit | 015aea7e08074957eba04c7e3dd19f3a1c1c3738 (patch) | |
tree | 301f5a52daa1749f9f9dafbcd87f50013f5ae51d | |
parent | aee9eb4a33a77fc77f2e27dbf4d0513cac83a531 (diff) | |
download | perl-015aea7e08074957eba04c7e3dd19f3a1c1c3738.tar.gz |
updateAUTHORS.p[lm] - add testing for dupe names and emails in AUTHORS
And remove the duplicate for "vividsnow" that this found.
-rw-r--r-- | .mailmap | 2 | ||||
-rw-r--r-- | AUTHORS | 1 | ||||
-rwxr-xr-x | Porting/updateAUTHORS.pl | 3 | ||||
-rw-r--r-- | Porting/updateAUTHORS.pm | 43 |
4 files changed, 40 insertions, 9 deletions
@@ -890,7 +890,7 @@ Vadim Konovalov <vkonovalov@lucent.com> Vadim Konovalov <vadim.konovalov@alcatel Victor Efimov <victor@vsespb.ru> Victor <victor@vsespb.ru> Ville Skyttä <scop@cs132170.pp.htv.fi> <ville.skytta@iki.fi> Vincent Pit <perl@profvince.com> Vincent Pit <vince@profvince.com> -vividsnow <@vividsnow> vividsnow <vividsnow@gmail.com> +vividsnow <vividsnow@gmail.com> vividsnow <@vividsnow> W. Geoffrey Rommel <grommel@sears.com> grommel@sears.com <grommel@sears.com> Walter Briscoe <w.briscoe@ponl.com> W.BRISCOE@ponl.com <w.briscoe@ponl.com> William Middleton <wmiddlet@adobe.com> Bill Middleton <wmiddlet@adobe.com> @@ -1397,7 +1397,6 @@ Vincent Pit <perl@profvince.com> Vishal Bhatia <vishal@deja.com> Vitali Peil <vitali.peil@uni-bielefeld.de> vividsnow <vividsnow@gmail.com> -vividsnow @vividsnow Vlad Harchev <hvv@hippo.ru> Vladimir Alexiev <vladimir@cs.ualberta.ca> Vladimir Marek <vlmarek@volny.cz> diff --git a/Porting/updateAUTHORS.pl b/Porting/updateAUTHORS.pl index 074703d5c3..a77df204c6 100755 --- a/Porting/updateAUTHORS.pl +++ b/Porting/updateAUTHORS.pl @@ -126,6 +126,9 @@ sub main { ok(!$changes, "Is $file_type '$file' up to date?") or diag $self->_diff_diag($file); } + my $dupe_info= $self->dupe_info(); + ok(!$dupe_info, "No dupes in AUTHORS") + or diag $dupe_info; ok( !$self->{missing_author}{$_}, diff --git a/Porting/updateAUTHORS.pm b/Porting/updateAUTHORS.pm index 3cbf6e3f4c..2b35809425 100644 --- a/Porting/updateAUTHORS.pm +++ b/Porting/updateAUTHORS.pm @@ -56,7 +56,7 @@ sub _make_name_author_info { my $name= $commit_info->{$name_key}; my $line= $author_info->{"email2line"}{$email} - // $author_info->{"name2line"}{$name}; + // $author_info->{"name2line"}{ lc($name) }; $line //= sprintf "%-31s<%s>", $commit_info->{$name_key}, $commit_info->{$email_key}; @@ -295,6 +295,21 @@ sub read_commit_log { return $author_info; } +sub dupe_info { + my ($self)= @_; + my $msg= ""; + foreach my $type (sort keys %{ $self->{dupe} || {} }) { + $msg .= "Duplicate \u$type in $self->{authors_file}:\n"; + foreach my $key (sort keys %{ $self->{dupe}{$type} }) { + $msg .= " \u$type '$key'\n"; + foreach my $line (sort keys %{ $self->{dupe}{$type}{$key} }) { + $msg .= " $line\n"; + } + } + } + return $msg; +} + sub read_authors_file { my ($self)= @_; my $authors_file= $self->{authors_file}; @@ -349,15 +364,29 @@ sub read_authors_file { $line =~ s/\s+\z//; $author_info{"lines"}{$line}++; - $author_info{"email2line"}{$email}= $line - if $email and $email ne "unknown"; - $author_info{"name2line"}{$name}= $line - if $name and $name ne "unknown"; - $author_info{"email2name"}{ lc($email) }= $name + if ($email and $email ne "unknown") { + if (my $other= $author_info{"email2line"}{$email}) { + $self->{dupe}{email}{$email}{$other}= 1; + $self->{dupe}{email}{$email}{$line}= 1; + } + else { + $author_info{"email2line"}{$email}= $line; + } + } + if ($name and $name ne "unknown") { + if (my $other= $author_info{"name2line"}{ lc($name) }) { + $self->{dupe}{name}{$name}{$other}= 1; + $self->{dupe}{name}{$name}{$line}= 1; + } + else { + $author_info{"name2line"}{ lc($name) }= $line; + } + } + $author_info{"email2name"}{$email} //= $name if $email and $name and $email ne "unknown"; - $author_info{"name2email"}{$name}= $email + $author_info{"name2email"}{$name} //= $email if $name and $name ne "unknown"; $author_info{"clean_full"}{ __fold_trim_ws($line) }= $line; } |