You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Klaus Ganser <kg...@gmail.com> on 2010/11/10 19:22:58 UTC
History of a fixed path across all objects
Hello,
I originally asked this question on stackoverflow:
http://stackoverflow.com/questions/4140377/svn-log-of-a-fixed-path-across-copies-and-moves
Nobody seems to have a good solution to getting the history of a
specific path across all objects that ever lived in that path. I've
been trying to stitch together the results of multiple queries using
`svn log --stop-on-copy`, but this is like throwing darts in the dark;
a particular path may not exist for certain revision spans, and I need
to hop over these when I issue an `svn log` request with a peg
revision. This would be slightly more reasonable if when I requested
a peg revision in which the path did not exist I received an error
message telling me something like this:
svn: File not found: revision 1234, path '/branches/qa'
svn: Path does not exist between 1233 and 1235
instead of what I get currently:
svn: File not found: revision 1234, path '/branches/qa'
Ideally, however, there should be a way for me to tell svn that I want
the history of the *path* and not the object at that path at a
particular revision. I'm mailing this list now for some advice.
Thanks,
Klaus
Re: History of a fixed path across all objects
Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Klaus Ganser wrote on Thu, Nov 11, 2010 at 13:09:51 -0800:
> It would be nice for this feature to see the light of day.
For this, we'll need a design that makes it possible to answer the
query efficiently.
Feel free to submit one; our documentation is in the text files
subversion/libsvn_fs_base/notes/** and subversion/libsvn_fs_fs/structure
(I'm not sure that's exhaustive).
Daniel
(also, we were contributed an SQL backend a while ago, but nothing
happened with that and I don't know how well it'll help your use case)
> -Klaus
Re: History of a fixed path across all objects
Posted by Klaus Ganser <kg...@gmail.com>.
On Thu, Nov 11, 2010 at 5:17 AM, Johan Corveleyn <jc...@gmail.com> wrote:
> So, as far as I'm concerned, I think you can file this as a new
> feature request in the issue tracker (maybe first search for any
> similar outstanding requests).
Filed the bug here:
http://subversion.tigris.org/issues/show_bug.cgi?id=3749
It was promptly marked as a duplicate of this bug from 8 years ago:
http://subversion.tigris.org/issues/show_bug.cgi?id=928
It would be nice for this feature to see the light of day.
-Klaus
Re: History of a fixed path across all objects
Posted by Johan Corveleyn <jc...@gmail.com>.
On Wed, Nov 10, 2010 at 9:53 PM, Feldhacker, Chris
<Fe...@principal.com> wrote:
> -----Original Message-----
> From: Klaus Ganser [mailto:kganser@gmail.com]
> Sent: Wednesday, November 10, 2010 2:43 PM
> To: Feldhacker, Chris
> Cc: users@subversion.apache.org
> Subject: Re: History of a fixed path across all objects
>
>>> On Wed, Nov 10, 2010 at 12:19 PM, Feldhacker, Chris <Fe...@principal.com> wrote:
>>> I think you want the "--ignore-ancestry" option:
>
>> svn log does not support that option.
>
>
> Ah, my bad. The "ignore ancestry" option can be used when merging to handle delete-recreate scenarios (it treats the resources as the same), but SVN is not (yet!?) smart enough to be able to use the "ignore ancestry" option when viewing the log...
>
> Good question. Sounds like a good feature request...
Yes, I agree. I think this is a valid use case (would also be useful
for finding out when a particular file was deleted, for which you now
also have some "bisecting" to do). And even if it's slow (as slow as a
user searching it by hand), it would still be useful.
So, as far as I'm concerned, I think you can file this as a new
feature request in the issue tracker (maybe first search for any
similar outstanding requests).
Cheers,
--
Johan
RE: History of a fixed path across all objects
Posted by "Feldhacker, Chris" <Fe...@principal.com>.
-----Original Message-----
From: Klaus Ganser [mailto:kganser@gmail.com]
Sent: Wednesday, November 10, 2010 2:43 PM
To: Feldhacker, Chris
Cc: users@subversion.apache.org
Subject: Re: History of a fixed path across all objects
>> On Wed, Nov 10, 2010 at 12:19 PM, Feldhacker, Chris <Fe...@principal.com> wrote:
>> I think you want the "--ignore-ancestry" option:
> svn log does not support that option.
Ah, my bad. The "ignore ancestry" option can be used when merging to handle delete-recreate scenarios (it treats the resources as the same), but SVN is not (yet!?) smart enough to be able to use the "ignore ancestry" option when viewing the log...
Good question. Sounds like a good feature request...
-----Message Disclaimer-----
This e-mail message is intended only for the use of the individual or
entity to which it is addressed, and may contain information that is
privileged, confidential and exempt from disclosure under applicable law.
If you are not the intended recipient, any dissemination, distribution or
copying of this communication is strictly prohibited. If you have
received this communication in error, please notify us immediately by
reply email to Connect@principal.com and delete or destroy all copies of
the original message and attachments thereto. Email sent to or from the
Principal Financial Group or any of its member companies may be retained
as required by law or regulation.
Nothing in this message is intended to constitute an Electronic signature
for purposes of the Uniform Electronic Transactions Act (UETA) or the
Electronic Signatures in Global and National Commerce Act ("E-Sign")
unless a specific statement to the contrary is included in this message.
While this communication may be used to promote or market a transaction
or an idea that is discussed in the publication, it is intended to provide
general information about the subject matter covered and is provided with
the understanding that The Principal is not rendering legal, accounting,
or tax advice. It is not a marketed opinion and may not be used to avoid
penalties under the Internal Revenue Code. You should consult with
appropriate counsel or other advisors on all matters pertaining to legal,
tax, or accounting obligations and requirements.
Re: History of a fixed path across all objects
Posted by Klaus Ganser <kg...@gmail.com>.
On Wed, Nov 10, 2010 at 12:19 PM, Feldhacker, Chris
<Fe...@principal.com> wrote:
> I think you want the "--ignore-ancestry" option:
svn log does not support that option.
RE: History of a fixed path across all objects
Posted by "Feldhacker, Chris" <Fe...@principal.com>.
I think you want the "--ignore-ancestry" option:
http://svnbook.red-bean.com/nightly/en/svn.ref.svn.html#svn.ref.svn.sw
-----Original Message-----
From: Klaus Ganser [mailto:kganser@gmail.com]
Sent: Wednesday, November 10, 2010 1:37 PM
To: David Weintraub
Cc: users@subversion.apache.org
Subject: Re: History of a fixed path across all objects
On Wed, Nov 10, 2010 at 11:32 AM, David Weintraub <qa...@gmail.com> wrote:
> You want the entire history of a file called "bar.java" in the path
> /foo/bar/barfoo from revision #1 to the current revision -- even
> though it isn't the same bar.java at that location?
>
> Is this correct?
Yes, that is correct.
-----Message Disclaimer-----
This e-mail message is intended only for the use of the individual or
entity to which it is addressed, and may contain information that is
privileged, confidential and exempt from disclosure under applicable law.
If you are not the intended recipient, any dissemination, distribution or
copying of this communication is strictly prohibited. If you have
received this communication in error, please notify us immediately by
reply email to Connect@principal.com and delete or destroy all copies of
the original message and attachments thereto. Email sent to or from the
Principal Financial Group or any of its member companies may be retained
as required by law or regulation.
Nothing in this message is intended to constitute an Electronic signature
for purposes of the Uniform Electronic Transactions Act (UETA) or the
Electronic Signatures in Global and National Commerce Act ("E-Sign")
unless a specific statement to the contrary is included in this message.
While this communication may be used to promote or market a transaction
or an idea that is discussed in the publication, it is intended to provide
general information about the subject matter covered and is provided with
the understanding that The Principal is not rendering legal, accounting,
or tax advice. It is not a marketed opinion and may not be used to avoid
penalties under the Internal Revenue Code. You should consult with
appropriate counsel or other advisors on all matters pertaining to legal,
tax, or accounting obligations and requirements.
Re: History of a fixed path across all objects
Posted by Klaus Ganser <kg...@gmail.com>.
On Wed, Nov 10, 2010 at 11:32 AM, David Weintraub <qa...@gmail.com> wrote:
> You want the entire history of a file called "bar.java" in the path
> /foo/bar/barfoo from revision #1 to the current revision -- even
> though it isn't the same bar.java at that location?
>
> Is this correct?
Yes, that is correct.
Re: History of a fixed path across all objects
Posted by David Weintraub <qa...@gmail.com>.
So, exactly what are you asking for?
I have a file /foo/bar/barfoo/bar.java.
You want the entire history of a file called "bar.java" in the path
/foo/bar/barfoo from revision #1 to the current revision -- even
though it isn't the same bar.java at that location?
Is this correct?
--
David Weintraub
qazwart@gmail.com
Re: History of a fixed path across all objects
Posted by Les Mikesell <le...@gmail.com>.
On 11/10/2010 2:05 PM, Klaus Ganser wrote:
> On Wed, Nov 10, 2010 at 11:48 AM, Les Mikesell<le...@gmail.com> wrote:
>> If something is deleted and recreated there is no history connecting them
>> even if those things have the same name, so what you are asking for doesn't
>> really exist. Maybe you could 'svn log -v' a parent or the top level of the
>> repo and parse out the deletes/adds you want to see.
>
> Running `svn log` on the top level of the repository is one of the
> solutions proposed to my stackoverflow question. However, this is
> extremely inefficient for large repositories with long histories. You
> can imagine implementing a visualization tool that lets you zero-in on
> a specific path and see what has lived there at any point between
> revision 1 and HEAD. It would be absurd if the command to generate a
> view of this one path took as long as the command to view the history
> of the entire repository. I'm saying that this is a valid use-case
> that the svn cli does not currently satisfy, but one which it could
> easily satisfy because it stores all the necessary information. As a
> client, this should be as easy for me as something like this:
>
> `svn log -v --path ...`
>
> where the --path option would tell svn to stick to that path, not to
> the pegged revision currently at that path.
Given that svn only stores history of something for the time it exists,
maybe there is a better way to use it for your purpose than deleting and
recreating things you want it to track. From svn's perspective there is
no history and the fact that the old thing and the new thing have the
same name is just coincidental. If you want to maintain a history,
maybe you could move the thing instead of deleting and when you move it
back the object's history will traverse the move.
Without a history to follow, svn can only look everywhere for adds and
deletes (I think...) which can't be very efficient.
--
Les Miksell
lesmikesell@gmail.com
Re: History of a fixed path across all objects
Posted by Klaus Ganser <kg...@gmail.com>.
On Wed, Nov 10, 2010 at 12:09 PM, Ryan Schmidt
<su...@ryandesign.com> wrote:
> Are you sure? I think what the others are trying to tell you is that the repository does not store this information, so there is not a way that any client could return this information to you without doing an exhaustive search.
I know that it has enough information to do this because I have enough
information to do the same thing with what the svn client currently
gives me - in a very inefficient way - by simply polling a specific
path at all revisions between 1 and HEAD. I would hope that
internally svn would be implemented in such a way to efficiently
traverse any gaps in the path's existence, but even barring that, that
fact that a single command like `svn log -v --path ...` would
eliminate the network/IO overhead in accomplishing this task makes it
worthwhile. I believe that this is a use case that should be
satisfied by svn natively, and not something that would require me to
build an extension to it with its own history.
Re: History of a fixed path across all objects
Posted by Ryan Schmidt <su...@ryandesign.com>.
On Nov 10, 2010, at 14:05, Klaus Ganser wrote:
> It would be absurd if the command to generate a
> view of this one path took as long as the command to view the history
> of the entire repository. I'm saying that this is a valid use-case
> that the svn cli does not currently satisfy, but one which it could
> easily satisfy because it stores all the necessary information.
Are you sure? I think what the others are trying to tell you is that the repository does not store this information, so there is not a way that any client could return this information to you without doing an exhaustive search.
Alternately, you could construct a database that you maintain parallel to the repository, containing any information you would need to answer whatever queries you find important. You would keep this database updated in a post-commit hook, for example.
Re: History of a fixed path across all objects
Posted by Klaus Ganser <kg...@gmail.com>.
On Wed, Nov 10, 2010 at 11:48 AM, Les Mikesell <le...@gmail.com> wrote:
> If something is deleted and recreated there is no history connecting them
> even if those things have the same name, so what you are asking for doesn't
> really exist. Maybe you could 'svn log -v' a parent or the top level of the
> repo and parse out the deletes/adds you want to see.
Running `svn log` on the top level of the repository is one of the
solutions proposed to my stackoverflow question. However, this is
extremely inefficient for large repositories with long histories. You
can imagine implementing a visualization tool that lets you zero-in on
a specific path and see what has lived there at any point between
revision 1 and HEAD. It would be absurd if the command to generate a
view of this one path took as long as the command to view the history
of the entire repository. I'm saying that this is a valid use-case
that the svn cli does not currently satisfy, but one which it could
easily satisfy because it stores all the necessary information. As a
client, this should be as easy for me as something like this:
`svn log -v --path ...`
where the --path option would tell svn to stick to that path, not to
the pegged revision currently at that path.
-Klaus
Re: History of a fixed path across all objects
Posted by Les Mikesell <le...@gmail.com>.
On 11/10/2010 1:22 PM, Klaus Ganser wrote:
> Hello,
>
> I originally asked this question on stackoverflow:
>
> http://stackoverflow.com/questions/4140377/svn-log-of-a-fixed-path-across-copies-and-moves
>
> Nobody seems to have a good solution to getting the history of a
> specific path across all objects that ever lived in that path. I've
> been trying to stitch together the results of multiple queries using
> `svn log --stop-on-copy`, but this is like throwing darts in the dark;
> a particular path may not exist for certain revision spans, and I need
> to hop over these when I issue an `svn log` request with a peg
> revision. This would be slightly more reasonable if when I requested
> a peg revision in which the path did not exist I received an error
> message telling me something like this:
>
> svn: File not found: revision 1234, path '/branches/qa'
> svn: Path does not exist between 1233 and 1235
>
> instead of what I get currently:
>
> svn: File not found: revision 1234, path '/branches/qa'
>
> Ideally, however, there should be a way for me to tell svn that I want
> the history of the *path* and not the object at that path at a
> particular revision. I'm mailing this list now for some advice.
If something is deleted and recreated there is no history connecting
them even if those things have the same name, so what you are asking for
doesn't really exist. Maybe you could 'svn log -v' a parent or the top
level of the repo and parse out the deletes/adds you want to see.
--
Les Mikesell
lesmikesell@gmail.com