Skip to content

Instantly share code, notes, and snippets.

@torsten torsten/svn-stats.sh
Created Apr 21, 2011

Embed
What would you like to do?
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
You can’t perform that action at this time.