Created
May 31, 2017 16:52
-
-
Save jsonberry/bd2ec81aa6dcdb07e8e863cbfbfe315e to your computer and use it in GitHub Desktop.
Get some git project stats!
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
#author @StevenIrby | |
function git-stats() { | |
git log --shortstat --author="$(git config user.name)" | grep -E "fil(e|es) changed" | awk '{files+=$1; inserted+=$4; deleted+=$6; delta+=$4-$6; ratio=deleted/inserted} END {printf "Commit stats:\n- Files changed (total).. %s\n- Lines added (total).... %s\n- Lines deleted (total).. %s\n- Total lines (delta).... %s\n- Add./Del. ratio (1:n).. 1 : %s\n", files, inserted, deleted, delta, ratio }' - | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
๐