You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by "Hanley, James" <jh...@redcom.com> on 2006/09/20 15:58:26 UTC

svn grep -r2:5 "a_word" filename1 filename2 folder3

A while back, there was a request for the ability to grep through the
source tree of subversion.

http://subversion.tigris.org/servlets/ReadMsg?listName=users&msgNo=6804

The response mentions using blame, but specifically I would like to
search for (for example) some structure that existed at one point that
was removed and what version it was removed from.

The problem is that using svn blame seems to only produce the up-to-date
snapshot of a given version.  What I want is the last version the string
was seen in.

If there is a way of doing this without regressing through every version
of a file, I would like to know, and if there is currently no way of
doing this, I believe it would be a valuable feature to Subversion.
-Jim

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

Re: svn grep -r2:5 "a_word" filename1 filename2 folder3

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On 9/25/06, Hanley, James <jh...@redcom.com> wrote:

> If, as you mention, there could be a tweak to the the blame to provide
> information for removed lines of text, then perhaps just including the
> lines removed and indicating the version they were removed in would
> suffice -- although I tried as a test an svn blame on one of our heavily
> versioned files (com/something/res/lang_toks.properties) which every one
> is adding to and it spun the apache server for a good 5 minutes before
> spitting back a svn blame... not sure if adding this tweak would worsen
> that time by an order of magnitude but I could definitely could see it
> might with adding an svn grep depending on the implimentation.

The only difference would be that the deltas needed to assemble the
revisions of the file are sent over the wire and the search through
them would be run on the client instead of the server.  Other than
that the operation is identical.  You're still reconstituting all the
revisions of the file to search through, it's going to be expensive no
matter what.

Of course the main advantage of using the same underlying
implementation as blame (the svn_ra_get_file_revs call, for the
curious) is that it exists today, so you don't have to wait until a
server that supports your hypothetical new operation shows up, you
could implement the functionality right now.

-garrett

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

Re: svn grep -r2:5 "a_word" filename1 filename2 folder3

Posted by "Hanley, James" <jh...@redcom.com>.
On Mon, 2006-09-25 at 09:59, Garrett Rooney wrote:
> On 9/20/06, Hanley, James <jh...@redcom.com> wrote:
> > I posted this earlier to the users list, and wanted to get some further
> > input from this list.
> 
> Personally, I'm hesitant to add commands that do lots of work server
> side, such as reg-ex matching over large amounts of data.  I'm also
> hesitant to add commands that result in downloading potentially huge
> amounts of data, so I'd worry a lot about recursive greps on directory
> trees.  The infrastructure to implement a historical grep on a file is
> already there though, the underlying functionality used to implement
> 'svn blame' could fairly easily be used to implement something like
> that, if anyone was interested enough to try.
> 
> -garrett

Not sure if this is possible, but if the worry is bogging down the
server with requests, then is it possible to allow the admin make that
call by adding a new method, where in the apache config the admin could
use limit.. this would I assume require some coordination with webdav.

Strictly speaking it is not needed on the server, but my argument for
doing it on the server is that it has to transfer all the revisions to
the client anyway..  If the client could keep a cache of the revision
history, then communication to the server would not be needed.

I also don't really need to have a full reg ex processor on the server,
but if the functionality is there I would use it.

If, as you mention, there could be a tweak to the the blame to provide
information for removed lines of text, then perhaps just including the
lines removed and indicating the version they were removed in would
suffice -- although I tried as a test an svn blame on one of our heavily
versioned files (com/something/res/lang_toks.properties) which every one
is adding to and it spun the apache server for a good 5 minutes before
spitting back a svn blame... not sure if adding this tweak would worsen
that time by an order of magnitude but I could definitely could see it
might with adding an svn grep depending on the implimentation.

I would still like to see this feature however it is implemented.
-Jim


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

Re: svn grep -r2:5 "a_word" filename1 filename2 folder3

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On 9/20/06, Hanley, James <jh...@redcom.com> wrote:
> I posted this earlier to the users list, and wanted to get some further
> input from this list.

Personally, I'm hesitant to add commands that do lots of work server
side, such as regex maching over large amounts of data.  I'm also
hesitant to add commands that result in downloading potentially huge
amounts of data, so I'd worry a lot about recursive greps on directory
trees.  The infrastructure to implement a historical grep on a file is
already there though, the underlying functionality used to implement
'svn blame' could fairly easily be used to implement something like
that, if anyone was interested enough to try.

-garrett

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

Re: svn grep -r2:5 "a_word" filename1 filename2 folder3

Posted by "Hanley, James" <jh...@redcom.com>.
I posted this earlier to the users list, and wanted to get some further
input from this list.

On Wed, 2006-09-20 at 11:58, Hanley, James wrote:
> A while back, there was a request for the ability to grep through the
> source tree of subversion.
> 
> http://subversion.tigris.org/servlets/ReadMsg?listName=users&msgNo=6804
> 
> The response mentions using blame, but specifically I would like to
> search for (for example) some structure that existed at one point that
> was removed and what version it was removed from.
> 
> The problem is that using svn blame seems to only produce the up-to-date
> snapshot of a given version.  What I want is the last version the string
> was seen in.
> 
> If there is a way of doing this without regressing through every version
> of a file, I would like to know, and if there is currently no way of
> doing this, I believe it would be a valuable feature to Subversion.
> -Jim

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