Skip to content

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 by --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 by --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