You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Fred Trotter <fr...@gmail.com> on 2006/04/05 22:51:23 UTC

Re: Fwd: svn Line Count metrics, counting line changes

I wanted to let everyone know the end result of this little quest. The
script from ViewVC worked perfectly, and with SVK as well as SVN. That means
that I was able to import projects from SVN and CVS and then use ViewVC to
generate stats for all of them.

I wrote several PHP scripts that generate graphs and statistics from the
ViewVC data. I will release these under the GPL for whomever would like
them, but ultimately I think that it would be more lucid if they were
recoded in python and merged with the ViewVC project. Still you can download
the code and read the how-to by going to...

http://ehr.gplmedicine.org

and looking under "review tools"...

Thanks for the help


The svndbadmin tool that comes with ViewVC (and is used for populating a
> Bonsai-like database of commit metadata) performs calculations of this
> sort
> by running 'diff' on each modified file in a revision (against its prior
> state), grepping for the line-count headers in that diff output, and doing
> arithmetic stuffs with it.  This tool is written to be run as a
> post-commit
> tool, at which time it populates the Bonsai-ish database with the info
> that
> one recent commit.
>
> Here's a link to the ViewVC view of that tool's source code:
>
> http://viewvc.tigris.org/source/browse/viewvc/trunk/bin/svndbadmin?rev=1288&view=markup
>
> --
> C. Michael Pilato <cm...@collab.net>
> CollabNet   <>   www.collab.net   <>   Distributed Development On Demand
>
>
>


--
Fred Trotter
SynSeer, Consultant
http://www.fredtrotter.com
http://www.synseer.com

Re: Fwd: svn Line Count metrics, counting line changes

Posted by Mattias EngdegÄrd <ma...@virtutech.se>.
"Fred Trotter" <fr...@gmail.com> writes:

>I wanted to let everyone know the end result of this little quest. The
>script from ViewVC worked perfectly, and with SVK as well as SVN. That mean=
>s
>that I was able to import projects from SVN and CVS and then use ViewVC to
>generate stats for all of them.

That is good to hear. I needed the +- line counts in order to show them in
a revision log browser, so I calculated them from the output of svn diff.
Removed directories don't show up (issue 2524), so I had to cat them
recursively in order to count the lines that were removed. This takes some
time, but is only run once (as a post-commit script), and saved in a
revision property.

If anyone wants my script, send me a mail. It does not need direct
repository access, in contrast to the ViewVC script (unless I misread it
entirely).


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Fwd: svn Line Count metrics, counting line changes

Posted by "C. Michael Pilato" <cm...@collab.net>.
[Forwarding to dev@viewvc.tigris.org so that group is aware of your work.]

Fred Trotter wrote:
> 
> I wanted to let everyone know the end result of this little quest. The
> script from ViewVC worked perfectly, and with SVK as well as SVN. That
> means that I was able to import projects from SVN and CVS and then use
> ViewVC to generate stats for all of them.
> 
> I wrote several PHP scripts that generate graphs and statistics from the
> ViewVC data. I will release these under the GPL for whomever would like
> them, but ultimately I think that it would be more lucid if they were
> recoded in python and merged with the ViewVC project. Still you can
> download the code and read the how-to by going to...
> 
> http://ehr.gplmedicine.org
> 
> and looking under "review tools"...
> 
> Thanks for the help
> 
> 
>     The svndbadmin tool that comes with ViewVC (and is used for populating a
>     Bonsai-like database of commit metadata) performs calculations of
>     this sort
>     by running 'diff' on each modified file in a revision (against its prior
>     state), grepping for the line-count headers in that diff output, and
>     doing
>     arithmetic stuffs with it.  This tool is written to be run as a
>     post-commit
>     tool, at which time it populates the Bonsai-ish database with the
>     info that
>     one recent commit.
> 
>     Here's a link to the ViewVC view of that tool's source code:
>     http://viewvc.tigris.org/source/browse/viewvc/trunk/bin/svndbadmin?rev=1288&view=markup
>     <http://viewvc.tigris.org/source/browse/viewvc/trunk/bin/svndbadmin?rev=1288&view=markup>
> 
>     --
>     C. Michael Pilato <cmpilato@collab.net <ma...@collab.net>>
>     CollabNet   <>   www.collab.net <http://www.collab.net>   <>  
>     Distributed Development On Demand
> 
> 
> 
> 
> 
> -- 
> Fred Trotter
> SynSeer, Consultant
> http://www.fredtrotter.com
> http://www.synseer.com


-- 
C. Michael Pilato <cm...@collab.net>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org