views:

168

answers:

2

I'd like to be able to see someone's total lines of code contributed to our application. Say the app is 10k lines of code, I'd like to see the breakdown of how many LOC each developer has committed to the repository. Is there anything for SubVersion to get this kind of info?

+2  A: 

svn blame can get you started, by prepending the committer's name to each line of source code.

Their example output was

$ svn blame http://svn.red-bean.com/repos/test/readme.txt
     3      sally This is a README file.
     5      harry You should read this.

So you could do something like

cat ./*blamed | awk '{print $2}' | sort | uniq -c

on a file formed like

$ cat b.txt
3 Mark asdf
3 Mark asdf
3 Bill fdas
4 Bill fdas
5 Fred fdfd

to get output like

$ cat b.txt | awk '{print $2}' | sort | uniq -c
      2 Bill
      1 Fred
      2 Mark

... but there's probably a cleaner way to do it than that.

Mark Rushakoff
Is that only for a single file though? I'd like something for a whole project.
swilliams
The page says `svn blame` works for "the specified files", so I assume you can specify as many files as you'd like. I don't have svn here so I can't test it out.
Mark Rushakoff
+2  A: 

There is MPY SVN STATS and also StatSVN if I remember correctly that should do what you want and much more.

I don't think it can be done with tortoisesvn all the tools that I know are command line tools and I fear some of them linux tools.

Janusz
As long as I can run the commandline tools via cygwin, it wouldn't be a problem. I'll take another gander at StatsSVN though.
swilliams
Looks like StatSVN (just 2 s's) did what I needed. Thanks!
swilliams