info-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Utility for full content search of cvs history


From: Todd Denniston
Subject: Re: Utility for full content search of cvs history
Date: Fri, 12 Aug 2005 13:35:53 -0500

colon111 wrote:
> 
> Not quite.  It would be nice to do keyword searches on the commit
> comments, but that's not what I'm looking for now.
> 
> I want to perform a keyword search where the search space is the
> _contents_ of all revisions of all files in the repository.
> 
> For example, I've checked out a file that doesn't compile because of an
> unknown symbol.  I'd like to search my cvs repository for that symbol.
> I'd like to know every revision of every file in the repository that
> contains that revision.  So I search for "updateTimestamp", and the
> search tells me that this keyword was found in TimestampLog.java, 1.4,
> 1.5, and 1.6.  The current revision of TimestampLog.java is 1.7, so now
> I see where the symbol was originally defined, when it was created, and
> in what revision it was removed.
> 
AGGG...
That's what I suspected you wanted, and it is fairly tough problem.
If you could make some assumptions about it always being the case of
something did exist and has been removed, you might be able to make it
easier.

The way to kludge such a search would be on the order of:
cd $REPOSITORY
find . -type f -name "*,v" |xargs grep -Hn "search string"
and read the ,v files looking for the rcs information, or run several `cvs
annotate` or `cvs diff` commands on the appropriate files.

say the grep finds updateTimestamp in TimestampLog.java
the next steps would look something like
#cvs log TimestampLog.java |grep head
1.7
#cvs annotate -r1.7 |grep updateTimestamp
#cvs annotate -r1.5 |grep updateTimestamp
updateTimestamp used
#cvs annotate -r1.3 |grep updateTimestamp
#cvs annotate -r1.4 |grep updateTimestamp
updateTimestamp used original


ugly but works.
-- 
Todd Denniston
Crane Division, Naval Surface Warfare Center (NSWC Crane) 
Harnessing the Power of Technology for the Warfighter




reply via email to

[Prev in Thread] Current Thread [Next in Thread]