For a given contributor, how can one (across all branches of a git repo) see LOC +/- over the previous 24 hours across all commits?
In other words, how can git be converted into a LOC accountability tool?
You could use
git log --numstat --pretty="%H" --author="<some author name>" --since="one day" | awk 'NF==3 {plus+=$1; minus+=$2} END {printf("+%d, -%d\n", plus, minus)}'
This uses numstats from all commits made by a given author last day (--since="one day"
limits the result to last 24 hours, could be combined with --until
and changed to absolute dates) and awk for summing the stats and printing the result.
(from https://stackoverflow.com/a/2528129/1157272, but with another limiting)