replace perl in example date parsing
authorMischa POSLAWSKY <perl@shiar.org>
Mon, 9 Sep 2019 16:57:40 +0000 (18:57 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Mon, 9 Sep 2019 22:37:53 +0000 (00:37 +0200)
Time::Piece was released with perl v5.8.9 but may not be installed on
restricted systems.  Hardcoding the number of days is less flexible but
"only" relies on a GNU date supporting -d.

Furthermore, git only supports date formatting since version 2.6.0,
so prefer an equivalent cut similar to earlier year selection.

barcat

diff --git a/barcat b/barcat
index 2a7bdbf2c08ee9b7edfeea8d8fb36e83248ae553..c2f41aa97c9365debb63be1ebdfd8d3b5003d19d 100755 (executable)
--- a/barcat
+++ b/barcat
@@ -391,9 +391,8 @@ Or the top 3 most frequent authors with statistics over all:
 
 Activity of the last days:
 
-    git log --pretty=%cd --date=format:%F --since=1month |
-    perl -MTime::Piece -pE
-        'for ($t //= localtime; $t->ymd gt $_; $t -= 24*60*60) {say $t->ymd}' |
+    ( git log --pretty=%ci --since=30day | cut -b-10
+      seq 0 30 | xargs -i date +%F -d-{}day ) |
     sort | uniq -c | awk '$1--' | graph
 
 =head1 AUTHOR