Skip to content

Instantly share code, notes, and snippets.

@quidmonkey
Created July 14, 2026 15:10
Show Gist options
  • Select an option

  • Save quidmonkey/c8a485a0af43977453360595b1d1bd24 to your computer and use it in GitHub Desktop.

Select an option

Save quidmonkey/c8a485a0af43977453360595b1d1bd24 to your computer and use it in GitHub Desktop.
Who is winning?
# 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