Skip to content

Instantly share code, notes, and snippets.

@torsten
Created April 21, 2011 09:05
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save torsten/934025 to your computer and use it in GitHub Desktop.
Save torsten/934025 to your computer and use it in GitHub Desktop.
Prints a list of all committers in a subversion repository, sorted by number of commits.
#!/bin/bash
# Prints a list of all committers in a subversion repository,
# sorted by number of commits.
# Written by Torsten Becker <torsten.becker@gmail.com> in 2011
if [[ ! $1 ]]; then
echo "Usage: $0 SVN-REPO-URL"
exit 1
fi
tmpfile=/tmp/svn-stats-history.log
svn log "$1" > $tmpfile
cat $tmpfile | \
ruby -ne 'puts $1 if $_ =~ /^r\d+ \| ([\w.]+) \|/' | \
sort -u | \
xargs -n1 -x sh -c \
'cat '$tmpfile'|grep $0 |wc -l|ruby -ne "print \$_.strip";echo " $0"' | \
sort -rn
rm -f $tmpfile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment