Skip to content

Instantly share code, notes, and snippets.

@jonathan-irvin
Forked from preslavrachev/commit_lengths.sh
Created September 6, 2018 20:42
Show Gist options
  • Save jonathan-irvin/5c52af0020a6b739baf5864d97fe7a53 to your computer and use it in GitHub Desktop.
Save jonathan-irvin/5c52af0020a6b739baf5864d97fe7a53 to your computer and use it in GitHub Desktop.
cd /path/to/repo
#displays the raw lengths
git shortlog | grep -e '^ ' | sed 's/[[:space:]]\+\(.*\)$/\1/' | awk '{print length($0)}'
#or a text-based historgam
git shortlog | grep -e '^ ' | sed 's/[[:space:]]\+\(.*\)$/\1/' | awk '{lens[length($0)]++;} END {for (len in lens) print len, lens[len] }' | sort -n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment