Browse Source

hourly max fix and set LC_ALL=C

tags/0.0.1
Zane C. B-H 1 month 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 @@
1 1
 Revision history for Git-PunchCard
2 2
 
3
+0.0.1	 2019-07-15/06:20
4
+		 - Set LC_ALL=C when calling git.
5
+		 - Properly set hourly max for the day.
6
+		 - Add hourly max at the bottom of the output.
7
+
3 8
 0.0.0    2019-07-15/04:45
4 9
 		 - Initial release.
5 10
 

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

@@ -23,7 +23,7 @@ If no directory is specified, the current one is used.
23 23
 }
24 24
 
25 25
 sub version{
26
-	print "punchcard-git v. 0.0.0\n";
26
+	print "punchcard-git v. 0.0.1\n";
27 27
 }
28 28
 
29 29
 my @colors=(
@@ -142,7 +142,6 @@ foreach my $day ( @days ){
142 142
 
143 143
 	foreach my $hour ( @hours ){
144 144
 		my $color_to_use=13*($card->{$day}{$hour}/$card->{max});
145
-		if ( $color_to_use > 13 ){ $color_to_use=13; }
146 145
 		push( @line, color($colors[$color_to_use]).$card->{$day}{$hour}.color('WHITE') );
147 146
 	}
148 147
 
@@ -153,7 +152,7 @@ foreach my $day ( @days ){
153 152
 
154 153
 $table->load( @data );
155 154
 
156
-print $table."\nTotal: ".$card->{total}."\n";
155
+print $table."\nTotal: ".$card->{total}."\nHourly Max=".$card->{max}."\n";
157 156
 
158 157
 =head1 NAME
159 158
 

+ 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.
12 12
 
13 13
 =head1 VERSION
14 14
 
15
-Version 0.0.0
15
+Version 0.0.1
16 16
 
17 17
 =cut
18 18
 
19
-our $VERSION = '0.0.0';
19
+our $VERSION = '0.0.1';
20 20
 
21 21
 
22 22
 =head1 SYNOPSIS
@@ -332,7 +332,7 @@ sub dir {
332 332
 
333 333
 	chdir( $dir );
334 334
 
335
-	my $output=`git log --pretty=format:"%ad" --date=local --date=format:'%a %H'`;
335
+	my $output=`env LC_ALL=C git log --pretty=format:"%ad" --date=local --date=format:'%a %H'`;
336 336
 	if ( $? != 0){
337 337
 		$self->{error}=1;
338 338
 		$self->{errorString}='"--pretty=format:\"%ad\" --date=local --date=format:\'%a %H\'" exited with a non-zero value';
@@ -358,7 +358,7 @@ sub dir {
358 358
 				$self->{card}{max}=$self->{card}{$day}{$hour};
359 359
 			}
360 360
 			if ( $self->{card}{$day}{$hour} > $self->{card}{$day}{max}){
361
-				$self->{card}{max}=$self->{card}{$day}{$hour};
361
+				$self->{card}{$day}{max}=$self->{card}{$day}{$hour};
362 362
 			}
363 363
 		}
364 364
 	}

Loading…
Cancel
Save