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 foreach ( $log->message =~ /Signed-off-by: (.*)/ ) {
30 if ( !$authors{$1} ) {
31 my $authhash = { 'count' => 0, 'signoffs' => 1 };
32 $authors{$1} = $authhash;
35 $authors{$1}->{'signoffs'}++;
43 foreach my $author ( keys %authors ) {
46 # print "$author:\t" . $authors{$author}->{'count'} . "\n";
47 foreach my $org ( keys %orgs ) {
48 if ( $author =~ /$org/ ) {
49 if ( !$orgcounts{ $orgs{$org} } ) {
51 'count' => $authors{$author}->{'count'},
52 'signoffs' => $authors{$author}->{'signoffs'}
55 $orgcounts{ $orgs{$org} } = $orghash;
58 $orgcounts{ $orgs{$org} }->{'count'} +=
59 $authors{$author}->{'count'};
60 $orgcounts{ $orgs{$org} }->{'signoffs'} +=
61 $authors{$author}->{'signoffs'};
68 warn "no match $author\n";
69 if ( !$orgcounts{$author} ) {
71 'count' => $authors{$author}->{'count'},
72 'signoffs' => $authors{$author}->{'signoffs'}
74 $orgcounts{$author} = $orghash;
77 $orgcounts{$author}->{'count'} +=
78 $authors{$author}->{'count'};
79 $orgcounts{$author}->{'signoffs'} +=
80 $authors{$author}->{'signoffs'};
87 my $json = JSON->new->allow_nonref;
88 $json = $json->canonical(1);
90 my $json_text = $json->encode(\%orgcounts );