Skip to content

Instantly share code, notes, and snippets.

@dctrwatson
Created November 18, 2013 20:38
Show Gist options
  • Save dctrwatson/7534890 to your computer and use it in GitHub Desktop.
Save dctrwatson/7534890 to your computer and use it in GitHub Desktop.
Git stats commands
# Top longest messaages
git log --format='%h%x00%an%x00%s%x00%B%x1e' | gawk 'BEGIN { FS="\0" ; RS="\x1e\n" }{ print length($4), $1, "-", $2, "|", $3 }' | sort -rn | head
# Top average messages
git log --format='%ae%x00%B%x1e' | gawk 'BEGIN { FS="\0" ; RS="\x1e\n" ; }{ sums[$1] += length($2) } END { for (i in sums) printf("%s %s\n", sums[i], i) }' | sort -rn | head
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment