Skip to content

Instantly share code, notes, and snippets.

@nikgalushko
Created August 12, 2020 06:44
Show Gist options
  • Save nikgalushko/f15a645c438c38c313cfad3618454328 to your computer and use it in GitHub Desktop.
Save nikgalushko/f15a645c438c38c313cfad3618454328 to your computer and use it in GitHub Desktop.

Revisions

  1. nikgalushko created this gist Aug 12, 2020.
    11 changes: 11 additions & 0 deletions git-stats.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    for name in $(git log --pretty="%ae%n%cn" | sort | uniq); do
    git log \
    --author "$name" \
    --pretty=tformat: --numstat |
    awk -v name="$name" '{
    add += $1; subs += $2; loc += $1 - $2
    } END {
    if (loc != 0)
    printf "[%s] Lines: +\033[32m%s\033[0m -\033[31m%s\033[0m; Total: %s\n", name, add, subs, loc
    }'
    done