scnr.net

It's not possible? Says who?

Quick & Dirty git statistics (commits, insertions, deletions)

with one comment

Need to know who made how many commits and how many changes in your source tree?

Here’s a quick and dirty way to generate such statistics:

perl -e 'foreach(`git shortlog -s -n`){'\
'($c,$a)=$_=~/^\s*(\d+)\s*(.+?)\s*$/;$p=$m=0;'\
'foreach(`git log --author="$a" --pretty=tformat: --numstat -C`)'\
'{($pp,$mm)=$_=~/^\s*(\d+)\s+(\d+)/;$p+=$pp;$m+=$mm;}'\
'printf "%5dc %8d+ %8d- %s\n",$c,$p,$m,$a;}'

result:

   72c    26183+     2506- Bob Byte
   20c     1270+      104- Jim Vim

Written by johnLate

January 31st, 2012 at 8:30 pm

Posted in Uncategorized

One Response to 'Quick & Dirty git statistics (commits, insertions, deletions)'

Subscribe to comments with RSS or TrackBack to 'Quick & Dirty git statistics (commits, insertions, deletions)'.

  1. Thanks a lot. Very nice thing.

    Jason Liao

    3 Dec 12 at 18:13

Leave a Reply