Created
September 20, 2017 17:37
-
-
Save olof/7c5d49f7f92601a7f49d1db2554cd159 to your computer and use it in GitHub Desktop.
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
# Who has contributed the most to your repository? Both in terms of | |
# net additions, and total changes. (Just change $_->{loc_net} to | |
# $_->{loc_tot} at the end of the command. | |
(printf -- '---\nchanges:\n'; git log --stat --format=' - name: %aE' | grep -v -e \| -e ^$ | sed -re 's/[^,]+, / loc: /' -e 's/([0-9]+) insertions?\(\+\)/\1/' -e 's/(, )?([0-9]+) deletions?\(-\)/-\2/' ) | perl -MYAML -MData::Dumper -E '$db = Load(do { local $/; <> })->{changes}; @p = map { { loc_net => eval "$_->{loc}", loc_tot => eval($_->{loc} =~ s/-/+/r) , name => $_->{name} } } @$db; print Dump \@p' | perl -MYAML -E '$db = Load(do { local $/; <> }); my $h = {}; $h->{$_->{name}} += $_->{loc_net} for @$db; print Dump $h' | sort |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment