1
0
Fork 0

Now calculating exact days for all past days for gentasktime

master
Mike Gerwitz 2013-09-06 15:41:07 -04:00
parent 25e5f29371
commit 584854c33f
1 changed files with 9 additions and 13 deletions

View File

@ -19,23 +19,19 @@ domake \
&& \ && \
( (
echo -n '0 ' && gendate && tail -n1 taskstats.dat \ echo -n '0 ' && gendate && tail -n1 taskstats.dat \
&& git log --no-merges --pretty=format:'%ar %h' -- "$path" \ && git log --no-merges --pretty=format:'%at %h' -- "$path" \
| awk ' | awk '
BEGIN { BEGIN {
last="" last=0
now=systime()
} }
/(days|weeks) ago|^(1[5-9]|2[0-9]) hours ago/{ {
if ( $0 ~ /hours/ ) { # calculate the number of days ago this was
$1 = 1 ago = int( ( now - $1 ) / 86400 );
} if ( ago <= last ) next;
if ( $0 ~ /weeks/ ) { last = ago;
$1 = $1*7 print ago, $NF;
}
if ( $1 == last ) next;
if ( $1 < last ) next;
last = $1;
print $1, $NF;
} }
' \ ' \
| while read n h; do | while read n h; do