Browse Source

hourly max fix and set LC_ALL=C

tags/0.0.1
Zane C. B-H 5 months ago
parent
commit
b7938c3931
3 changed files with 11 additions and 7 deletions
  1. +5
    -0
      Git-PunchCard/Changes
  2. +2
    -3
      Git-PunchCard/bin/punchcard-git
  3. +4
    -4
      Git-PunchCard/lib/Git/PunchCard.pm

+ 5
- 0
Git-PunchCard/Changes View File

@@ -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.


+ 2
- 3
Git-PunchCard/bin/punchcard-git View File

@@ -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


+ 4
- 4
Git-PunchCard/lib/Git/PunchCard.pm View File

@@ -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};
}
}
}

Loading…
Cancel
Save