X-Git-Url: https://git.llucax.com/z.facultad/75.42/plaqui.git/blobdiff_plain/385eb8bbf0b2376f62e175a2d1ea2b929db84929..cfeb614a5aed24ab733bd5f7a38f1ffa8d20693d:/log_trace.pl diff --git a/log_trace.pl b/log_trace.pl index 428893b..003517c 100755 --- a/log_trace.pl +++ b/log_trace.pl @@ -6,27 +6,33 @@ # # The PlaQui Development Team -#open("log.txt", LOG); -#@lines = ; -#close(LOG); +my %hash, %users, %commits, %lines_count, $texto. $max; + +if (shift eq "-d") { + $texto = `svn log > ChangeLog`; +} +$texto = `egrep "rev [0-9]+" ChangeLog`; -#$texto = `svn log | grep rev | grep lines`; -$texto = `cat log.txt | grep rev | grep lines`; @lines = split(/\n/, $texto); -my %hash, %users; +$max = -1; foreach $line (@lines) { @datos = split(/ /, $line); $hash{$datos[5]}++; $users{$datos[5]}{$datos[3]}++; + $commits{$datos[3]}++; + $lines_count{$datos[3]} += $datos[13]; + if ($hash{$datos[5]} > $max) { + $max = $hash{$datos[5]}; + } } print "PlaQui - Grafica de Progreso SVN\n"; print "--------------------------------\n\n"; -print "Fecha Commits\n"; +print "Fecha\t\tCommits\n"; foreach $date (sort keys %hash) { - print "$date "; + print "$date\t"; $win = ""; $win_pts = -1; @@ -35,22 +41,29 @@ foreach $date (sort keys %hash) { $win = $name; $win_pts = $users{$date}{$name}; } else { - if ($users{$date}{$name} = $win_pts) { + if ($users{$date}{$name} == $win_pts) { $win = $win."|".$name; } } } - #Imprimo el Ganador - - for($i=0; $i<$hash{$date}; $i++) { - print "*"; + for($i=0; $i<$max/2; $i++) { + if ($i < $hash{$date}/2) { + print "*"; + } else { + print " "; + } } - print "($win)"; + print " ($win)"; print "\n"; } print "\n"; -print "( ) = Máximo Commiteador del Día\n"; -print "* == 1 Commit\n"; +print "Cantidad de commits por usuario:\n"; +foreach $user (sort keys %commits) { + print "\t$user\t$commits{$user}\t($lines_count{$user} lineas)\n"; +} +print "\n"; +print "( ) = Máximo/s Commiteador/es del Día | "; +print "* == 2 Commit\n";