Difference between revisions of "Svn-results.pl"

From Organic Design wiki
(New page: #!/usr/bin/perl # Generate report of n...)
 
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
#!/usr/bin/perl
+
{{svn|tools|svn-results.pl}}
# Generate report of number of SVN committers by month
+
[[Category:PERL]]
#{{perl}}
 
use Date::Parse;
 
 
 
$csv = '/var/www/svn-report.txt';
 
%data = ();
 
 
 
open CSV,'<',$csv;
 
while (<CSV>) {
 
($revision,$date,$user,$core) = split ',';
 
if ($date =~ /... (...) .. ..:..:.. (....)/ && $user) {
 
@m = strptime("$1 $2");
 
$m = $m[4]+1;
 
if ($m < 10) { $m = "0$m" }
 
$data{"$2/$m"}{$user}{0+$core}++
 
}
 
}
 
close CSV;
 
 
 
print "$revision revisions read into hash\n";
 
 
 
for $date (sort { $a cmp $b } keys %data) {
 
 
 
@users = keys %{ $data{$date} };
 
$n = 1+$#users;
 
$ncore = 0;
 
$t = 0;
 
$tcore = 0;
 
for (@users) {
 
if ($c = $data{$date}{$_}{1}) {
 
$ncore++;
 
$tcore += $c;
 
}
 
$t += $c + $data{$date}{$_}{0};
 
}
 
 
print "$date (users: $n,$ncore) (commits: $t,$tcore)\n";
 
}
 

Latest revision as of 12:47, 8 December 2011

Info.svg This code is in our Git repository here.

Note: If there is no information in this page about this code and it's a MediaWiki extension, there may be something at mediawiki.org.