Skip to content

Instantly share code, notes, and snippets.

@jsonberry
Created May 31, 2017 16:52
Show Gist options
  • Save jsonberry/bd2ec81aa6dcdb07e8e863cbfbfe315e to your computer and use it in GitHub Desktop.
Save jsonberry/bd2ec81aa6dcdb07e8e863cbfbfe315e to your computer and use it in GitHub Desktop.
Get some git project stats!
#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 }' -
}
@stevenirby
Copy link

๐Ÿ‘

@KegDemon
Copy link

๐Ÿ‘

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment