Created
September 24, 2012 12:56
-
-
Save kra3/3775813 to your computer and use it in GitHub Desktop.
Script to find per user contributions from an Subversion (svn) repository.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ svn ls -R | egrep -v -e "\/$" | xargs svn blame | awk '{print $2}' | sort | uniq -c | sort -r | |
| $ echo "Now let's bisect the above one liner" | |
| $ svn ls -R # will list all files in svn repo recursively | |
| $ svn ls -R | egrep -v -e "\/$" # get files & directories one line at a time | |
| $ svn ls -R | egrep -v -e "\/$" | xargs svn blame # do a svn blame on each file (print file content with rev & author info) | |
| $ svn ls -R | egrep -v -e "\/$" | xargs svn blame | awk '{print $2}' # get second column which contains svn user name | |
| $ svn ls -R | egrep -v -e "\/$" | xargs svn blame | awk '{print $2}' | sort # sort out put (will be based on svn username) | |
| $ svn ls -R | egrep -v -e "\/$" | xargs svn blame | awk '{print $2}' | sort | uniq -c # get uniq lines with counts (no of lines contributed by user) | |
| $ svn ls -R | egrep -v -e "\/$" | xargs svn blame | awk '{print $2}' | sort | uniq -c | sort -r # sort in reverse order (so user who contributed most comes first) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
That should be
sort -rn, otherwise9380will sort before '8'.