Skip to content

Instantly share code, notes, and snippets.

@jdforsythe
Last active January 3, 2017 19:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jdforsythe/13f0ef11c830fde4ebe27fee31c50b80 to your computer and use it in GitHub Desktop.
Save jdforsythe/13f0ef11c830fde4ebe27fee31c50b80 to your computer and use it in GitHub Desktop.
Git Repo Statistics
#!/bin/bash
if [ ! -f .mailmap ]; then
echo "WARNING: File .mailmap not found. If you get multiples of names check:"
echo "https://git-scm.com/docs/git-shortlog#_mapping_authors"
echo ""
echo "--------------------"
echo ""
fi
# default to the entire history of the repo
if [ $# -lt 1 ]; then
git shortlog -s -n -e --all --no-merges
else
git shortlog -s -n -e --all --no-merges ${1}..
fi
#!/bin/bash
if [ ! -f .mailmap ]; then
echo "WARNING: File .mailmap not found. If you get multiples of names check:"
echo "https://git-scm.com/docs/git-blame#_mapping_authors"
echo ""
echo "--------------------"
echo ""
fi
git ls-tree -r -z --name-only HEAD -- . | xargs -0 -n1 git blame --line-porcelain HEAD | sed -n 's/^author //p' | sort | uniq -c | sort -nr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment