Skip to content

Instantly share code, notes, and snippets.

@stvnwrgs
Last active December 28, 2015 23:29
Show Gist options
  • Save stvnwrgs/7579026 to your computer and use it in GitHub Desktop.
Save stvnwrgs/7579026 to your computer and use it in GitHub Desktop.
Get Information for contributed users of a repo
/**
* Show inserts and delets by users in a repo
*
*
**/
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;}'
/**
* Show inserts and delets by users in a repo after a special date
*
*
**/
perl -e '
$date = "2013-03-20";
printf "____________________\n";
printf "Stats since $date for this git Repo:\n \n";
foreach(`git shortlog -s -n`){'\
'($c,$a)=$_=~/^\s*(\d+)\s*(.+?)\s*$/;$p=$m=0;'\
'foreach(`git log --after={$date} --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;}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment