Reputation: 2523
I'm looking for something which would show how often commits to svn modify files. I want to be able to see which files change often and how often. Preferably also the "report" should be grouped by directory, to be able to see frequency of changes per project.
Which tool provides such ability?
(if that matters - I'm also using maven and the language ism mostly java)
Upvotes: 3
Views: 976
Reputation: 2624
There should not be $ in the line "while read $file" e.g it should be "while read file". Otherwise it works fine!
Upvotes: 0
Reputation: 107040
There's no standard tool to do this in Subversion. However, I can see one possible way of doing it, but it might take a while.
First, you need to generate a listing of all files in your repository. This should do it:
$ svn ls -R $REPO
Then you could use that as input and somehow generate a report from each file:
$ svn ls -R $REPO | while read $file
do
here be dragons
done
We need to get rid of files (now BASH and Kornshell specific):
$ svn ls -R $REPO | while read $file
do
[[ $file == */ ]] && continue
here be dragons
done
Then, we need to figure out how to count all of the changes. The svn log
should do it. If we count all lines that are composed of nothing but dashes, that should give us a count:
$ svn ls -R $REPO | while read $file
do
[[ $file == */ ]] && continue
count=$(svn log $REPO/$file | grep "^--*$" | wc -l)
echo "$REPO/$file: $count"
done
There are a few issues with this:
It's a beginning. You could limit the range of dates via the -r
parameter in the svn log
. You might not care if a file had a lot of revisions if most of those revisions came from two years ago. And, this is probably the limit of a shell script. The logic could be ported over to Python or Perl and more done there.
Upvotes: 2
Reputation: 76
Although there are SVN Internal commands to generate reports, I would advice to try using FishEye tool from Atlassian. Its a paid tool, but gives extensive details, on how many files commited by specific user, which file committed how many times and also gives reports in graphical format.
Upvotes: 1