Prints total line count contribution per user for an SVN repository

svn ls -R | egrep -v -e "\/$" | xargs svn blame | awk '{print $2}' | sort | uniq -c | sort -r
I'm working in a group project currently and annoyed at the lack of output by my teammates. Wanting hard metrics of how awesome I am and how awesome they aren't, I wrote this command up. It will print a full repository listing of all files, remove the directories which confuse blame, run svn blame on each individual file, and tally the resulting line counts. It seems quite slow, depending on your repository location, because blame must hit the server for each individual file. You can remove the -R on the first part to print out the tallies for just the current directory.
Sample Output
   2038 askedrelic
    433 john
    263 ryan
    186 alice
    167 bob

16
2009-07-29 02:10:45

2 Alternatives + Submit Alt

What Others Think

i wholeheartedly agree and thank you for this post.
josue · 481 weeks and 4 days ago
Thanks. Great contribution.
linuxrawkstar · 481 weeks and 3 days ago
nice!
bwoodacre · 481 weeks and 3 days ago
SWEET.
dorkusprime · 444 weeks and 2 days ago
sort -r should have been sort -nr (so that it sorts numerically, and not alphabetically!)
abdc · 364 weeks and 3 days ago
is there any way to limit this to show line count per day?
cmcguff · 351 weeks and 4 days ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: