[code]
git log --pretty=format:'%s' | sort | uniq -c | sort -n
[/code]

Works a little more safely and reliably