How many lines of code modified during a time peri

2020-02-19 07:54发布

I have been tasked with figuring out how many lines of code I've written this year. Not very exciting for a number of reasons, but it seems like it could make a nice SO question.

So in your favorite version control tool, how do you tell how many lines of code have been modified? In my particular answer blank lines and comments happen to count to simplify the time allotted to determining the answer, but feel free to elaborate.

In my particular case I'm using svn, so I'm going to get rid of all the --- and other misc output that svn log and svn diff output.

8条回答
老娘就宠你
2楼-- · 2020-02-19 08:48

If you are stuck on cvs:

cvs annotate > annotate.txt
rem remove the portion before the name
sed "s/^[0-9. (]*//" annotate.txt > annotate2.txt
rem remove the portion after the name
sed "s/[ ].*$//" annotate2.txt > annotate3.txt
sort annotate3.txt > annotate4.txt
uniq -c annotate4.txt > annotate5.txt

http://jamesjava.blogspot.com/2007/01/who-has-changed-most-lines-in-cvs.html

查看更多
可以哭但决不认输i
3楼-- · 2020-02-19 08:52

The simplest solution:

svn diff -x --ignore-eol-style -x -w http://svn/tags/releases/1.0 http://svn/tags/releases/2.0/ |diffstat

this is very rudimentary and does not exclude blank line inserts and so on, but perhaps it's good enough?

查看更多
登录 后发表回答