Debian Codegraph @

refresh-authors

raw
1 #!/usr/bin/perl
2 use strict;
3 use Git::Wrapper;
4 use List::MoreUtils qw(uniq);
5
6 my $git = Git::Wrapper->new('./');
7
8 sub git_log_grep {
9 my $string = shift;
10 return map { s/^\s*$string\s*//; $_ }
11 grep { /$string/ }
12 $git->RUN('log', {grep => $string});
13 }
14
15 my @authors = $git->RUN('log', {pretty => "format:%aN <%aE>"});
16 my @signed_authors = git_log_grep('Signed-off-by:');
17 my @co_authors = git_log_grep('Co-authored-by:');
18
19 foreach (@signed_authors, @co_authors) {
20 eval {
21 my @_co_authors = $git->RUN('check-mailmap', $_);
22 push @authors, @_co_authors;
23 };
24 }
25
26 print join("\n", uniq sort @authors);