From 7f950bc4a97a9eac6714573faf5928ad88d0eb4b Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Tue, 30 May 2023 12:57:55 +1000 Subject: [PATCH] git.kak: Use gawk's strftime instead of shelling out to date `date -d` is not posix, strftime neither, but at least we only rely on one non-posix tool and avoid forking. Should help a bit for #4847 --- rc/tools/git.kak | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/rc/tools/git.kak b/rc/tools/git.kak index 04ae23a1..18796e4e 100644 --- a/rc/tools/git.kak +++ b/rc/tools/git.kak @@ -150,11 +150,7 @@ define-command -params 1.. \ count=$4 } /^author / { authors[sha]=substr($0,8) } - /^author-time ([0-9]*)/ { - cmd = "date -d @" $2 " +\"%F %T\"" - cmd | getline dates[sha] - close(cmd) - } + /^author-time ([0-9]*)/ { dates[sha]=strftime("%F %T", $2) } END { send_flags(1); }' ) > /dev/null 2>&1 < /dev/null & }