Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Find out how much work you or your workmates have done
use strict;
my $author = `git config`;
if ($ARGV[0] =~ /^\S+?\@\S+$/){
$author = shift;
my $since = join( " ", @ARGV );
$since = 'yeterday' if ( $since =~ /^\s*$/ );
chomp( $author );
die "No author set"
if $author =~ /^\s*$/;
my ($a,$d) = (0,0);
my @results = `git --no-pager log --pretty=oneline --shortstat --author $author --since '$since'`;
chomp for @results;
for (@results){
if ( /(\d+) insertions/ ){
$a += $1;
if ( /(\d+) deletions/ ){
$d += $1;
printf "Deleted %s and inserted %s lines\n", $d, $a;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment