Git Statistics, Bash-Style

Some one-liner Git statistics

Commit Ranking, by Author, by Commit Count

git shortlog  -ns

Project Commits, by Day of Week

for i in Mon Tue Wed Thu Fri Sat Sun; do
    echo $( echo " $i: "; git shortlog  -n --format='%ad %s'| grep "$i " | wc -l);
done

Project Commits, by Day of Week, Since Some Date

Useful to see a difference when the dev team changes, for example. If you want to count commits before a date, replace --since with --until.

for i in Mon Tue Wed Thu Fri Sat Sun; do
    echo $( echo " $i: "; git shortlog  -n --format='%ad %s' --since='2011-06-31'| grep "$i " | wc -l);
done

Project Commits, by Hour of Day

for i in `seq -w 0 23`; do
    echo $( echo " $i:"; git shortlog  -n --format='%ad %s' | grep " $i:" | wc -l);
done

Project Commits, by Hour of Day, Since Some Date

Here you can replace --since with --until.

for i in `seq -w 0 23`; do
    echo $( echo " $i:"; git shortlog  -n --format='%ad %s' --until='2011-06-31' | grep " $i:" | wc -l);
done

Reference: [jazzy coding]

[jazzy coding]: https://phreaknerd.wordpress.com/2012/03/27/git-statistic-bash-one-liners/