7 my $git = Git::Wrapper->new('/home/chrisc/git/koha');
9 $git->checkout("origin/master");
14 while ( my $line = <STDIN> ) {
16 my @row = split( /,/, $line );
17 $orgs{ $row[0] } = $row[1];
20 my @log_objects = $git->log( { 'use-mailmap' => 1 }, "v3.18.00..HEAD" );
21 foreach my $log (@log_objects) {
22 if ( !$authors{ $log->author } ) {
23 my $authhash = { 'count' => 1, 'signoffs' => 0 };
24 $authors{ $log->author } = $authhash;
27 $authors{ $log->author }->{'count'}++;
29 my $message = $log->message;
30 while ( $message =~ /Signed-off-by: (.*?)\n/g ) {
31 if ( !$authors{$1} ) {
32 my $authhash = { 'count' => 0, 'signoffs' => 1 };
33 $authors{$1} = $authhash;
36 $authors{$1}->{'signoffs'}++;
44 foreach my $author ( keys %authors ) {
47 # print "$author:\t" . $authors{$author}->{'count'} . "\n";
48 foreach my $org ( keys %orgs ) {
49 if ( $author =~ /$org/ ) {
50 if ( !$orgcounts{ $orgs{$org} } ) {
52 'count' => $authors{$author}->{'count'},
53 'signoffs' => $authors{$author}->{'signoffs'}
56 $orgcounts{ $orgs{$org} } = $orghash;
59 $orgcounts{ $orgs{$org} }->{'count'} +=
60 $authors{$author}->{'count'};
61 $orgcounts{ $orgs{$org} }->{'signoffs'} +=
62 $authors{$author}->{'signoffs'};
69 warn "no match $author\n";
70 if ( !$orgcounts{$author} ) {
72 'count' => $authors{$author}->{'count'},
73 'signoffs' => $authors{$author}->{'signoffs'}
75 $orgcounts{$author} = $orghash;
78 $orgcounts{$author}->{'count'} +=
79 $authors{$author}->{'count'};
80 $orgcounts{$author}->{'signoffs'} +=
81 $authors{$author}->{'signoffs'};
88 my $json = JSON->new->allow_nonref;
89 $json = $json->canonical(1);
91 my $json_text = $json->encode(\%orgcounts );