Created
February 16, 2018 08:48
-
-
Save hfs/e8265ed2df80e49280ac32a2840b8683 to your computer and use it in GitHub Desktop.
Git statistics for repository per author: Get number of changed files, inserted and deleted lines
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
#!/bin/sh | |
git log --shortstat | perl -ne 'chomp; $author = $1 if m/^Author: (.*)/; if (m/(\d+) files? changed, (\d+) insertions.* (\d+) deletions/){ $files{$author} += $1; $insertions{$author} += $2; $deletions{$author} += $3 }; END { foreach $author (sort { $files{$b} <=> $files{$a} } keys %files) {printf("%s: %d files, %d insertions(+), %d deletions(-)\n", $author, $files{$author}, $insertions{$author}, $deletions{$author})}}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment