tags:

views:

290

answers:

5

We are using Subversion. We would like to

1. search across all commit messages ?
2. monitor the commits on certain important files ?
3. identify files that are never/rarely used ?
4. identify files that are most frequently changed ?         
5. identify files that most developers have accessed ?
6. identify files that have been committed together many number of times ?

The usage of these data could be to weed out messages like these, to refactor code and clean up the project of unused files.

Please suggest tools to achieve the same..

EDIT: We run SVN on Windows 2003.

+1  A: 

What platform are you using? On linux, a quick shell script using sed should do the trick.

Adam Liss
We use SVN on windows. Can you indicate how to use sed to get these info?
Vijay Dev
+1  A: 

In .NET land, there is the SharpSvn library that you could use. To achieve what you want, you would need to suck down all the log messages and parse them yourself, though.

Peter Mounce
+5  A: 

StatSVN should be able to do the majority of that for you. You'll need to set up a scheduled task to run it over your repository, however, or you can integrate it into an Ant build if you happen to use that.

Some of the more complex tasks, such as number 6 in your list, will probably require a custom solution, however. Alternatively, as StatSVN is open source, you could make the required changes to that and submit them back to the project.

alastairs
+2  A: 

Another tool worth looking at is ViewVC. The latest version has the option to maintain a commit database. This allows you to search across all commit messages and to see a list of changes to either a file or a files in a directory filtered by user, time or regular expression. It also supports RSS feeds which would enable some form of notification to individual files.

For 3, 4 and 5 on your list StatSVN which is mentioned in the other answers should be able to do this. For a commercial solution there is FishEye from Atlassian.

On our repository we use a combination of ViewVC and StatSVN, the former used for repository browsing and searching commit messages with the latter for looking at statistics.

David Dibben
+1  A: 

You can do alot of it with the Subversion command line client and some scripting (Ruby or Python), but don't expect people here to write the code for you. The implementation details will depend on things like how often you want to run the stats and how large your repo is.

When processing data from the Subversion command line client you may find it easier to use the --xml option (accepted by the "log" and "info" commands) which outputs the data in XML-format.

1. search across all commit messages ?

Run "svn log -v --xml" and run a text-search on the resulting XML (or parts of it). You can specify which set of commit messages you want to search.

2. monitor the commits on certain important files ?

This is implemented with commit-triggers. See the Subversion server documentation.

3. identify files that are never/rarely used ?
4. identify files that are most frequently changed ?         
5. identify files that most developers have accessed ?
6. identify files that have been committed together many number of times ?

These can all be implemented using the output from "svn log --xml" and post-processing of the resulting XML data.

JesperE