Created
May 27, 2014 18:32
-
-
Save waffle2k/4ed9a1e707cc408e05b6 to your computer and use it in GitHub Desktop.
Find out how much work you or your workmates have done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
my $author = `git config user.email`; | |
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){ | |
chomp; | |
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