@Lady interesting challenge! this prints the average age of the lines in $filename
, in days:
git blame --line-porcelain "$filename" | grep '^author-time ' | awk '{ mean += ($2 - mean) / NR } END { print (systime() - mean) / 86400 }'
excluding blank lines is a little trickier but the --line-porcelain
output does have enough information to do it
@jamey `systime()` isn’t POSIX but i imagine that’s doable to replace? awk probably is the easiest solution here huh
@Lady that's a delightful option too! I just take way too much pleasure in metaprogramming things that weren't meant to be metaprogrammed. 😅 and yeah, I assumed you were asking due to being on one of the BSD-ish platforms, which is a totally reasonable constraint