Skip to content

Instantly share code, notes, and snippets.

@peabnuts123
Last active August 14, 2018 21:07
Show Gist options
  • Save peabnuts123/ffa6f20dc0589e8f9e70f315af140a0a to your computer and use it in GitHub Desktop.
Save peabnuts123/ffa6f20dc0589e8f9e70f315af140a0a to your computer and use it in GitHub Desktop.
Git commit breakdown by author
#!/bin/bash
IFS=$'\n';
output="$(echo "`for author in $(git log | grep "Author:" | awk '{for (i=2; i<NF; i++) printf $i " "; print $NF}' | sort | uniq); do
echo "${author}:|$(git log --pretty=oneline --author=${author} | wc -l | xargs echo) commits";
done`" | sort -n -k2 -r -t '|' | column -t -s '|')";
echo "${output}";
echo "$(git log --pretty=oneline | wc -l) commits total";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment