Answering "in which revision was this branch created?"

View: New views
8 Messages — Rating Filter:   Alert me  

Answering "in which revision was this branch created?"

by Julian Foad :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

A "quick win" enhancement?


REQUIREMENT

A user or admin at SubConf told me he often wanted to know when a branch
had been created. We have:

  svn log -q --stop-on-copy

which gives the correct answer, but on a long-lived branch this can take
a long time - minutes - to complete, which is frustrating and makes the
question practically unavailable to most scripts. It is with heavy use
of branching that this question becomes commonly asked.

I have to admit I don't know this particular user's use case - context -
of wanting to know the branch point. I do know there are several things
it is helpful for.


ANALYSIS

If Subversion had a primary concept of "a branch", we would want to know
when "this branch" was created:

  (1) In which revision was the branch 'B' created?

As Subversion's concept of a branch is a node that has been copied, we
can ask the question as:

  (2) In which revision was the branch root directory 'B' most recently
created by copying?

When we support True Renames, we will want to ignore any moves or
renames of the branch since it was created. Until then, we could
implement this question instead:

  (3) In which revision did this node's line of history last come to its
current (repository) path? In other words, in which revision was this
node most recently added or copied (to here) or moved (to here)?

Now that we are thinking about a question that applies to any node, not
necessarily a branch, we might sometimes want to ask a variant of that
question. Imagine a file BAR that has been copied from file FOO at some
time, but we don't know whether that was before or after the branch B
was created. We could ask:

  (4) In which revision was B/BAR most recently added or copied (to
here) or moved (to here), ignoring any branching (copying) of its parent
directories?

But I think question (4) fits less well with Subversion's concepts than
(3).


UI DESIGN (COMMAND-LINE)

Eventually we might have a set of branching commands, and then the
branch-aware version of this query should fit in with them. Until then,
I don't want to see a new subcommand like

  svn in-which-revision-was-this-branch-created

but we need to look for a UI space for this (and several other queries
that 'svn' ought to support).

It feels to me that the query version (3) fits well in the "svn info"
output. In the example below (which is on a file rather than a branch),
the last line of "svn info" output is new:

[[[
$ svn log -vq --stop-on-copy ~/public_html/upload.sh
------------------------------------------------------------------------
r5 | julianfoad | 2009-06-26 17:28:30 +0100 (Fri, 26 Jun 2009)
Changed paths:
   D /public_html/rsync-this.sh
   A /public_html/upload.sh (from /public_html/rsync-this.sh:2)
------------------------------------------------------------------------

$ svn info ~/public_html/upload.sh
Path: /home/julianfoad/public_html/upload.sh
Name: upload.sh
URL: file:///home/julianfoad/vcs/green/public_html/upload.sh
Repository Root: file:///home/julianfoad/vcs/green
Repository UUID: 0e873508-286d-0410-b431-0fc449f9f81d
Revision: 5
Node Kind: file
Schedule: normal
Last Changed Author: julianfoad
Last Changed Rev: 5
Last Changed Date: 2009-06-26 17:28:30 +0100 (Fri, 26 Jun 2009)
Text Last Updated: 2009-06-25 11:45:23 +0100 (Thu, 25 Jun 2009)
Checksum: 55d960df51a56fd911784159c7657559
At This Repos Path Since Revision: 5
]]]

or "Came Here In Revision: 5"?

Thoughts?

- Julian

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2413786

Re: Answering "in which revision was this branch created?"

by Branko Čibej-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Julian Foad wrote:

> A "quick win" enhancement?
>
>
> REQUIREMENT
>
> A user or admin at SubConf told me he often wanted to know when a branch
> had been created. We have:
>
>   svn log -q --stop-on-copy
>
> which gives the correct answer, but on a long-lived branch this can take
> a long time - minutes - to complete, which is frustrating and makes the
> question practically unavailable to most scripts. It is with heavy use
> of branching that this question becomes commonly asked.
>
> I have to admit I don't know this particular user's use case - context -
> of wanting to know the branch point. I do know there are several things
> it is helpful for.
>
>
> ANALYSIS
>
> If Subversion had a primary concept of "a branch", we would want to know
> when "this branch" was created:
>
>   (1) In which revision was the branch 'B' created?
>
> As Subversion's concept of a branch is a node that has been copied, we
> can ask the question as:
>
>   (2) In which revision was the branch root directory 'B' most recently
> created by copying?
>
> When we support True Renames, we will want to ignore any moves or
> renames of the branch since it was created. Until then, we could
> implement this question instead:
>
>   (3) In which revision did this node's line of history last come to its
> current (repository) path? In other words, in which revision was this
> node most recently added or copied (to here) or moved (to here)?
>
> Now that we are thinking about a question that applies to any node, not
> necessarily a branch, we might sometimes want to ask a variant of that
> question. Imagine a file BAR that has been copied from file FOO at some
> time, but we don't know whether that was before or after the branch B
> was created. We could ask:
>
>   (4) In which revision was B/BAR most recently added or copied (to
> here) or moved (to here), ignoring any branching (copying) of its parent
> directories?
>
> But I think question (4) fits less well with Subversion's concepts than
> (3).
>
>
> UI DESIGN (COMMAND-LINE)
>
> Eventually we might have a set of branching commands, and then the
> branch-aware version of this query should fit in with them. Until then,
> I don't want to see a new subcommand like
>
>   svn in-which-revision-was-this-branch-created
>
> but we need to look for a UI space for this (and several other queries
> that 'svn' ought to support).
>
> It feels to me that the query version (3) fits well in the "svn info"
> output. In the example below (which is on a file rather than a branch),
> the last line of "svn info" output is new:
>
> [[[
> $ svn log -vq --stop-on-copy ~/public_html/upload.sh
> ------------------------------------------------------------------------
> r5 | julianfoad | 2009-06-26 17:28:30 +0100 (Fri, 26 Jun 2009)
> Changed paths:
>    D /public_html/rsync-this.sh
>    A /public_html/upload.sh (from /public_html/rsync-this.sh:2)
> ------------------------------------------------------------------------
>
> $ svn info ~/public_html/upload.sh
> Path: /home/julianfoad/public_html/upload.sh
> Name: upload.sh
> URL: file:///home/julianfoad/vcs/green/public_html/upload.sh
> Repository Root: file:///home/julianfoad/vcs/green
> Repository UUID: 0e873508-286d-0410-b431-0fc449f9f81d
> Revision: 5
> Node Kind: file
> Schedule: normal
> Last Changed Author: julianfoad
> Last Changed Rev: 5
> Last Changed Date: 2009-06-26 17:28:30 +0100 (Fri, 26 Jun 2009)
> Text Last Updated: 2009-06-25 11:45:23 +0100 (Thu, 25 Jun 2009)
> Checksum: 55d960df51a56fd911784159c7657559
> At This Repos Path Since Revision: 5
> ]]]
>
> or "Came Here In Revision: 5"?
>
> Thoughts?
>  

When I started reading your mail, extending "svn info" immediately came
to mind. But maybe writing this info by default is not a good idea; it
might cause problems for wrapper scripts and such. But "svn info
--branch" would be nice; you could add things like "Root revision" or
Branch revision", and "Branched from", etc.

An API that lets one easily retreive such information will be a boon to
GUI clients that like to paint pretty pictures of trees and branches.

-- Brane


> - Julian
>
> ------------------------------------------------------
> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2413786
>

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2413830

RE: Answering "in which revision was this branch created?"

by Bert Huijben-6 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

svn log --stop-on-copy -r 1:HEAD --limit 1 -q URL

Gives the answer directly.

Bert

----- Oorspronkelijk bericht -----
Van: Julian Foad <julianfoad@...>
Verzonden: maandag 2 november 2009 12:32
Aan: dev@...
Onderwerp: Answering "in which revision was this branch created?"

A "quick win" enhancement?


REQUIREMENT

A user or admin at SubConf told me he often wanted to know when a branch
had been created. We have:

  svn log -q --stop-on-copy

which gives the correct answer, but on a long-lived branch this can take
a long time - minutes - to complete, which is frustrating and makes the
question practically unavailable to most scripts. It is with heavy use
of branching that this question becomes commonly asked.

I have to admit I don't know this particular user's use case - context -
of wanting to know the branch point. I do know there are several things
it is helpful for.


ANALYSIS

If Subversion had a primary concept of "a branch", we would want to know
when "this branch" was created:

  (1) In which revision was the branch 'B' created?

As Subversion's concept of a branch is a node that has been copied, we
can ask the question as:

  (2) In which revision was the branch root directory 'B' most recently
created by copying?

When we support True Renames, we will want to ignore any moves or
renames of the branch since it was created. Until then, we could
implement this question instead:

  (3) In which revision did this node's line of history last come to its
current (repository) path? In other words, in which revision was this
node most recently added or copied (to here) or moved (to here)?

Now that we are thinking about a question that applies to any node, not
necessarily a branch, we might sometimes want to ask a variant of that
question. Imagine a file BAR that has been copied from file FOO at some
time, but we don't know whether that was before or after the branch B
was created. We could ask:

  (4) In which revision was B/BAR most recently added or copied (to
here) or moved (to here), ignoring any branching (copying) of its parent
directories?

But I think question (4) fits less well with Subversion's concepts than
(3).


UI DESIGN (COMMAND-LINE)

Eventually we might have a set of branching commands, and then the
branch-aware version of this query should fit in with them. Until then,
I don't want to see a new subcommand like

  svn in-which-revision-was-this-branch-created

but we need to look for a UI space for this (and several other queries
that 'svn' ought to support).

It feels to me that the query version (3) fits well in the "svn info"
output. In the example below (which is on a file rather than a branch),
the last line of "svn info" output is new:

[[[
$ svn log -vq --stop-on-copy ~/public_html/upload.sh
------------------------------------------------------------------------
r5 | julianfoad | 2009-06-26 17:28:30 +0100 (Fri, 26 Jun 2009)
Changed paths:
   D /public_html/rsync-this.sh
   A /public_html/upload.sh (from /public_html/rsync-this.sh:2)
------------------------------------------------------------------------

$ svn info ~/public_html/upload.sh
Path: /home/julianfoad/public_html/upload.sh
Name: upload.sh
URL: file:///home/julianfoad/vcs/green/public_html/upload.sh
Repository Root: file:///home/julianfoad/vcs/green
Repository UUID: 0e873508-286d-0410-b431-0fc449f9f81d
Revision: 5
Node Kind: file
Schedule: normal
Last Changed Author: julianfoad
Last Changed Rev: 5
Last Changed Date: 2009-06-26 17:28:30 +0100 (Fri, 26 Jun 2009)
Text Last Updated: 2009-06-25 11:45:23 +0100 (Thu, 25 Jun 2009)
Checksum: 55d960df51a56fd911784159c7657559
At This Repos Path Since Revision: 5
]]]

or "Came Here In Revision: 5"?

Thoughts?

- Julian

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2413786

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2413881

RE: Answering "in which revision was this branch created?"

by Julian Foad :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Bert Huijben wrote:
> svn log --stop-on-copy -r 1:HEAD --limit 1 -q URL
>
> Gives the answer directly.

Wow.

/me tries it.

Wow.

It really does. Who'd have thought it? What a weird user interface.

- Julian

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2413890

Re: Answering "in which revision was this branch created?"

by Branko Čibej-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Bert Huijben wrote:
> svn log --stop-on-copy -r 1:HEAD --limit 1 -q URL
>
> Gives the answer directly.
>  

Oh, very concise. :)

Still, an API for this kind of stuff wouldn't hurt. But I guess it's not
that important since there is a workaround, eh.

-- Brane

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2413947

Re: Answering "in which revision was this branch created?"

by Mark Phippard-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, Nov 2, 2009 at 10:08 AM, Branko Cibej <brane@...> wrote:
> When I started reading your mail, extending "svn info" immediately came
> to mind. But maybe writing this info by default is not a good idea; it
> might cause problems for wrapper scripts and such. But "svn info
> --branch" would be nice; you could add things like "Root revision" or
> Branch revision", and "Branched from", etc.
>
> An API that lets one easily retreive such information will be a boon to
> GUI clients that like to paint pretty pictures of trees and branches.

For GUI clients, it is more about seeing where something was copied
to, which we just do not currently have any good way of providing.

Ultimately, for a given node, I'd like to see its complete history in
the repository, including the changes that happened on all the paths
it was copied to, as well as the revisions in which it was copied.

--
Thanks

Mark Phippard
http://markphip.blogspot.com/

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2413950

RE: Answering "in which revision was this branch created?"

by Bert Huijben-6 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> -----Original Message-----
> From: Julian Foad [mailto:julianfoad@...]
> Sent: maandag 2 november 2009 18:21
> To: Bert Huijben
> Cc: dev@...
> Subject: RE: Answering "in which revision was this branch created?"
>
> Bert Huijben wrote:
> > svn log --stop-on-copy -r 1:HEAD --limit 1 -q URL
> >
> > Gives the answer directly.
>
> Wow.
>
> /me tries it.
>
> Wow.
>
> It really does. Who'd have thought it? What a weird user interface.

I agree that its weird, but in some cases it is very useful that 'svn log'
can reverse its answers.

But 1:HEAD to retrieve just the portion of the history after the copy is
just weird^2.

        Bert

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2414074

Re: Answering "in which revision was this branch created?"

by David Glasser-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, Nov 3, 2009 at 2:08 AM, Bert Huijben <rhuijben@...> wrote:

>> -----Original Message-----
>> From: Julian Foad [mailto:julianfoad@...]
>> Sent: maandag 2 november 2009 18:21
>> To: Bert Huijben
>> Cc: dev@...
>> Subject: RE: Answering "in which revision was this branch created?"
>>
>> Bert Huijben wrote:
>> > svn log --stop-on-copy -r 1:HEAD --limit 1 -q URL
>> >
>> > Gives the answer directly.
>>
>> Wow.
>>
>> /me tries it.
>>
>> Wow.
>>
>> It really does. Who'd have thought it? What a weird user interface.
>
> I agree that its weird, but in some cases it is very useful that 'svn log'
> can reverse its answers.
>
> But 1:HEAD to retrieve just the portion of the history after the copy is
> just weird^2.

Probably still less efficient than an fs_closest_copy-based query, I'd guess.

--dave


--
glasser@... | langtonlabs.org | flickr.com/photos/glasser/

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2414254