Is there a way to perform a full text search of a subversion repository, including all the history?
For example, I\'ve written a feature that I used somewhere, but t
I have been looking for something similar. The best I have come up with is OpenGrok. I have not tried to implement it yet, but sounds promising.
I just ran into this problem and
svnadmin dump <repo location> |grep -i <search term>
did the job for me. Returned the revision of the first occurrence and quoted the line I was looking for.
I'm using a small shellscript, but this only works for a single file. You can ofcourse combine this with find to include more files.
#!/bin/bash
for REV in `svn log $1 | grep ^r[0-9] | awk '{print $1}'`; do
svn cat $1 -r $REV | grep -q $2
if [ $? -eq 0 ]; then
echo "$REV"
fi
done
If you really want to search everything, use the svnadmin dump
command and grep through that.
svn log -v [repository] > somefile.log
for diff you can use the --diff
option
svn log -v --diff [repository] > somefile.log
then use vim or nano or whatever you like using, and do a search for what you're looking for. You'll find it pretty quickly.
It's not a fancy script or anything automated. But it works.
git svn clone <svn url>
git log -G<some regex>
The best way that I've found to do this is with less:
svn log --verbose | less
Once less comes up with output, you can hit /
to search, like VIM.
Edit:
According to the author, he wants to search more than just the messages and the file names. In which case you will be required to ghetto-hack it together with something like:
svn diff -r0:HEAD | less
You can also substitute grep
or something else to do the searching for you. If you want to use this on a sub-directory of the repository, you will need to use svn log
to discern the first revision in which that directory existed, and use that revision instead of 0
.