hourly max fix and set LC_ALL=C

Cette révision appartient à :
Zane C. B-H 2019-07-15 06:19:11 -05:00
Parent bebab2bfbf
révision b7938c3931
3 fichiers modifiés avec 11 ajouts et 7 suppressions

Voir le fichier

@ -1,5 +1,10 @@
Revision history for Git-PunchCard
0.0.1 2019-07-15/06:20
- Set LC_ALL=C when calling git.
- Properly set hourly max for the day.
- Add hourly max at the bottom of the output.
0.0.0 2019-07-15/04:45
- Initial release.

Voir le fichier

@ -23,7 +23,7 @@ If no directory is specified, the current one is used.
}
sub version{
print "punchcard-git v. 0.0.0\n";
print "punchcard-git v. 0.0.1\n";
}
my @colors=(
@ -142,7 +142,6 @@ foreach my $day ( @days ){
foreach my $hour ( @hours ){
my $color_to_use=13*($card->{$day}{$hour}/$card->{max});
if ( $color_to_use > 13 ){ $color_to_use=13; }
push( @line, color($colors[$color_to_use]).$card->{$day}{$hour}.color('WHITE') );
}
@ -153,7 +152,7 @@ foreach my $day ( @days ){
$table->load( @data );
print $table."\nTotal: ".$card->{total}."\n";
print $table."\nTotal: ".$card->{total}."\nHourly Max=".$card->{max}."\n";
=head1 NAME

Voir le fichier

@ -12,11 +12,11 @@ Git::PunchCard - Gathers info for making punchcard style graphs for git.
=head1 VERSION
Version 0.0.0
Version 0.0.1
=cut
our $VERSION = '0.0.0';
our $VERSION = '0.0.1';
=head1 SYNOPSIS
@ -332,7 +332,7 @@ sub dir {
chdir( $dir );
my $output=`git log --pretty=format:"%ad" --date=local --date=format:'%a %H'`;
my $output=`env LC_ALL=C git log --pretty=format:"%ad" --date=local --date=format:'%a %H'`;
if ( $? != 0){
$self->{error}=1;
$self->{errorString}='"--pretty=format:\"%ad\" --date=local --date=format:\'%a %H\'" exited with a non-zero value';
@ -358,7 +358,7 @@ sub dir {
$self->{card}{max}=$self->{card}{$day}{$hour};
}
if ( $self->{card}{$day}{$hour} > $self->{card}{$day}{max}){
$self->{card}{max}=$self->{card}{$day}{$hour};
$self->{card}{$day}{max}=$self->{card}{$day}{$hour};
}
}
}