Skip to content

Instantly share code, notes, and snippets.

@davidmfoley
Created June 14, 2012 15:50
Show Gist options
  • Save davidmfoley/2931107 to your computer and use it in GitHub Desktop.
Save davidmfoley/2931107 to your computer and use it in GitHub Desktop.
summarize git commits and lines changed by author
git log --shortstat -C | awk '/Author:/ {author = $NF; if (!(author in lines)) {authors[length(authors)] = author; lines[author] = 0; commits[author] = 0} } /files changed/ {lines[author] += ($4 + $6); commits[author]++} END {for (i =0; i < length(authors); i++) {printf "%s lines in %s commits - %s\n", lines[authors[i]],commits[authors[i]], authors[i]}}' |sort -n -r
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment