Created
July 14, 2026 15:10
-
-
Save quidmonkey/c8a485a0af43977453360595b1d1bd24 to your computer and use it in GitHub Desktop.
Who is winning?
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
| # display git authors, commits, added lines, deleted lines | |
| function who_is_winning { | |
| git log --format='author %aN' --numstat | awk ' | |
| /^author / { author = substr($0, 8); commits[author]++; next } | |
| NF == 3 { add[author] += $1; del[author] += $2 } | |
| END { | |
| printf "%-30s %8s %10s %10s\n", "Author", "Commits", "Added", "Deleted" | |
| for (n in commits) printf "%-30s %8d %10d %10d\n", n, commits[n], add[n], del[n] | "sort -rn -k1.31" | |
| }' | |
| } | |
| alias whoiswinning="who_is_winning" | |
| # short version that displays git authors and commits | |
| # alias whoiswinning="git shortlog -s -n" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment