You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by John Barstow <Jo...@gfsg.co.nz> on 2002/10/16 20:12:24 UTC

branches and tags [post v1.0]

So, on the train this morning I was thinking about branching, and the thread
on import syntax crystallized my thoughts.

I think we could hit the 80% mark on branching with some very simple
assumptions.

Assuming a dir structure of:
/reposRoot/main/projectA
/reposRoot/branches/branch_Name/projectA
/reposRoot/tags/tag_Name/projectA

I can branch and tag with the following commands:
svn cp /reposRoot/main /reposRoot/branches/branchName
svn cp /reposRoot/main /reposRoot/tags/tagName

Now, this isn't very sophisticated, but can easily be aliased to:
svn branch branchName --auto-switch-to-new-branch
svn tag tagName

Which is good for most smaller projects, including mine.  Since it's just
syntatic sugar for 'svn cp', people with more sophisticated needs can
continue to use the cp command.

The only caveat I can see is that you would have to add a switch to create
the root subdirectories, and the branch and tag commands would have to do a
sanity check to avoid messing up alternate layouts.  Future enhancements
could be added to make these more sophisticated and efficient (maybe
involving directory properties, for instance).

Does this make sense?  Or am I just suffering from early-morning caffeine
deficiency?

John C Barstow

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

subcommand-specific options not considered harmful

Posted by Karl Fogel <kf...@newton.ch.collab.net>.
Peter Davis <pe...@pdavis.cx> writes:
> mkdir is the most obvious application, but since 
> subcommand-specific options are a Bad Thing, well, hopefully I have solved 
> that problem :)

I'd like to dispel this myth once and for all:

We didn't decide not to have subcommand-specific options.

What we decided was never to have the same option mean unrelated
things for different subcommands, or mean different things in global
context vs in a particular subcommand context (since we don't have
global vs local options).  

The idea is to avoid lossage like CVS's various `-d' options.

It's perfectly okay to have an option that applies only to one
subcommand.  By implication, however, you usually don't want to use up
a short option letter on such a rarely-used option, so

   $ svn mkdir --parents

is fine, but

   $ svn mkdir -p

probably is not.

This is not a comment any any specific proposal of Peter Davis's, I'm
just trying set the record straight about subcommands and options.

-K

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

Re: branches and tags [post v1.0]

Posted by Peter Davis <pe...@pdavis.cx>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wednesday 16 October 2002 13:12, John Barstow wrote:
> The only caveat I can see is that you would have to add a switch to create
> the root subdirectories,


Again, I think a "-p" "--parents" option should apply to all of mkdir, mv, cp, 
import, export, co ... any command which takes a "destination" argument that 
is a directory or URL.

Does anyone else agree?  mkdir is the most obvious application, but since 
subcommand-specific options are a Bad Thing, well, hopefully I have solved 
that problem :)

- -- 
Peter Davis
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9rcphhDAgUT1yirARAp5yAKCVdeoGbQ88DwKso2ppOxRDcXQ4bQCfVUF5
+xsOjqNtln/Oa3GhPcsmQjI=
=5G/W
-----END PGP SIGNATURE-----


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

Re: branches and tags [post v1.0]

Posted by Karl Fogel <kf...@newton.ch.collab.net>.
John Barstow <Jo...@gfsg.co.nz> writes:
> I can branch and tag with the following commands:
> svn cp /reposRoot/main /reposRoot/branches/branchName
> svn cp /reposRoot/main /reposRoot/tags/tagName
> 
> Now, this isn't very sophisticated, but can easily be aliased to:
> svn branch branchName --auto-switch-to-new-branch
> svn tag tagName

I'm very much against encoding a particular repository layout directly
into the client.  I think it would be much better simply to provide
'svn cp' and then see what strategies emerge in the wild.  If we favor
certain layouts at the interface level, we'll be discouraging
experimentation that really needs to happen.

Please, let's just give people 'svn cp' and leave it at that.

-Karl

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

Re: branches and tags [post v1.0]

Posted by Branko Čibej <br...@xbc.nu>.
Ben Collins-Sussman wrote:

>Karl Fogel <kf...@newton.ch.collab.net> writes:
>
>  
>
>>   /usr/local/share/subversion/layouts/slovenian/...
>>    
>>
>
>This is a great idea... as long as Branko writes the 'slovenian'
>layout!
>  
>
Already have. I'm using it at work. So there. :-)

-- 
Brane Čibej   <br...@xbc.nu>   http://www.xbc.nu/brane/


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

Re: branches and tags [post v1.0]

Posted by Ben Collins-Sussman <su...@collab.net>.
Karl Fogel <kf...@newton.ch.collab.net> writes:

>    /usr/local/share/subversion/layouts/slovenian/...

This is a great idea... as long as Branko writes the 'slovenian'
layout!


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

Re: branches and tags [post v1.0]

Posted by Karl Fogel <kf...@newton.ch.collab.net>.
Noel Yap <ya...@yahoo.com> writes:
> What you want can be easily solved with a wrapper.  In
> fact, since Subversion doesn't require any particular
> repository structure, and any practical use of
> Subversion will require some sort of structure, I'm
> sure many people will write the same sort of wrappers
> and hooks.  Maybe these can be contributed and placed
> into a contrib directory for others to reuse?

Heh!  I'm so glad you brought that up.

The real motivation behind my restructuring of svnadmin's option
parsing (see revision 3258) was a plan to eventually add "layout
templates".  That is, at Subversion install time, various directory
tree templates would be laid out in

   /usr/local/share/subversion/layouts/default/...
   /usr/local/share/subversion/layouts/asf/...
   /usr/local/share/subversion/layouts/slovenian/...

etc.  Currently, the only one we know is "default", it's the standard

    /README
    /trunk/
    /branches/
    /tags/

repository layout.  In other words, the template source would be this
nearly-empty directory tree:

   /usr/local/share/subversion/layouts/default/README
   /usr/local/share/subversion/layouts/default/trunk/
   /usr/local/share/subversion/layouts/default/branches/
   /usr/local/share/subversion/layouts/default/tags/

And to create a repository that looks like that, you'd just do

   $ svnadmin create /usr/local/repositories/main --layout=default

As people experiment and come up with other layouts that are tuned to
other situations, we'll just incorporate them into the distribution.
In other words, Subversion itself can serve as a central reference for
successful, time-tested repository layouts (hence the "asf" and
"slovenian" layouts... I don't know exactly what they'd look like, but
I'm sure they're excellent :-) ).

This isn't really necessary for 1.0, of course, but it's also easy to
code and it would be nice to have the structure in place early so
people have it available when creating their first repositories.  Not
sure if/when I'll get around to it.  Anyway, just wanted to mention it
here in case anyone had any thoughts.

-K

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

Re: branches and tags [post v1.0]

Posted by Noel Yap <ya...@yahoo.com>.
--- John Barstow <Jo...@gfsg.co.nz> wrote:
> So, on the train this morning I was thinking about
> branching, and the thread
> on import syntax crystallized my thoughts.
> 
> I think we could hit the 80% mark on branching with
> some very simple
> assumptions.
> 
> Assuming a dir structure of:
> /reposRoot/main/projectA
> /reposRoot/branches/branch_Name/projectA
> /reposRoot/tags/tag_Name/projectA

IMHO, Subversion shouldn't require/assume/promote any
one particular repository structure.  It currently
doesn't (it suggests two different repository
structures).  I'm working on a third (see the
ClearCase-like repository structure thread).  Someone
else has suggested another way.

What you want can be easily solved with a wrapper.  In
fact, since Subversion doesn't require any particular
repository structure, and any practical use of
Subversion will require some sort of structure, I'm
sure many people will write the same sort of wrappers
and hooks.  Maybe these can be contributed and placed
into a contrib directory for others to reuse?

MTC,
Noel

__________________________________________________
Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos & More
http://faith.yahoo.com

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