benjamincharity
8/9/2017 - 4:41 PM

Git alias function to show how many lines were authored by each contributor.

Git alias function to show how many lines were authored by each contributor.

[alias]
    linesperauthor = "!f() { \
        git ls-files | while read f; do git blame --line-porcelain $f | grep '^author '; done | sort -f | uniq -ic | sort -n; \
    }; f"


# usage:
# git linesperauthor

# output:
#    2 Binary file (standard input) matches
#    3 author Not Committed Yet
#  668 author Matt Sanders
# 1428 author Roger Dapp
# 8027 author Benjamin Charity