You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by pl...@lanminds.com on 2002/11/26 15:40:00 UTC

branches and tags question

Hi all,

I have basic revision control question, which is basically, what is 
the difference between a branch and a tag?

It is my understanding that fundamentally:

	- a tag is intended to never change, and is like a snapshot
	  in time of the repository in a certain state.

	- a branch starts off similar to a tag, but evolves in a 
	  separate manner so that after the initial creation, there
	  are differences between the branch repo and the trunk repo.

Is that correct?  If so, how do I create a 'tag', but then insure 
that it never changes?  I understand that I can:

	svn cp http://path/to/repo/trunk http://path/to/repo/tag/tag-name

However, that does not prevent me, or anyone else, from accidently checking out
http://path/to/repo/tag/tag-name, making changes, and then 
re-committing it.

Do I manually set the unix-level file permissions on the repository 
structure to read only after the creation or is there an svn mechanism 
to do this?

Thanks,
-- 

Seeya,
Paul
--
	It may look like I'm just sitting here doing nothing,
   but I'm really actively waiting for all my problems to go away.

	 If you're not having fun, you're not doing it right!



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

Re: branches and tags question

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
pll@lanminds.com wrote:

>Do I manually set the unix-level file permissions on the repository 
>structure to read only after the creation or is there an svn mechanism 
>to do this?
>

you either trust your developers to follow the convention and not commit 
in a tag directory (and if someone does, you can always revert that 
change, i mean this is version control after all, you've got the old 
version in the repository), or if you are paranoid you can use a 
pre-commit hook to control the ability to modify a tag.  there are some 
examples of how to do this in our tools directory in the subversion 
source tree.

-garrett



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

Re: branches and tags question

Posted by Michael Wood <mw...@its.uct.ac.za>.
On Tue, Nov 26, 2002 at 09:49:39AM -0600, Ben Collins-Sussman wrote:
> pll@lanminds.com writes:
> 
> > Is that correct?  If so, how do I create a 'tag', but then insure 
> > that it never changes?  I understand that I can:
[snip]
> Take a look a doc/book/book/ch04.xml.  I just finished rewriting the
> chapter about branches and tags.  Here's a relevant excerpt:
> 
[snip]
>   If you are administering a repository, there are two approaches you
>   can take to managing tags. The first approach is "hands off": as a
>   matter of project policy, decide where your tags will live, and make
>   sure all users know to how treat the directories they copy in
               ... know how to treat ...
>   there. (That is, make sure they know not to commit to them.) The
[snip]

-- 
Michael Wood <mw...@its.uct.ac.za>

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

Re: branches and tags question

Posted by Blair Zajac <bl...@orcaware.com>.
Blair Zajac wrote:
> 
> solo turn wrote:
> >
> > a pre commit hook for access control?
> >
> > up to now, it thought apache is doing the access control ... via the
> > httpd.conf file. you set your tag read only and you are done?
> >
> > the pre commit hook seems to be for the really paranoid ones ;))
> 
> Justin had a good email about this.  It turns out it's really
> hard to put together regex's matching requests to particular
> locations in the Subversion repository.  I don't have the URL
> to it, but there's a note in the issue database about this.
> 
> In the end, using the pre-commit hook is the easy way to go.
> 
> Blair

Oops, attributed the email message to the wrong person.  Sander said
it.

Here are the links to look at:

http://subversion.tigris.org/issues/show_bug.cgi?id=775
http://subversion.tigris.org/servlets/ReadMsg?list=dev&msgNo=10466

Blair

-- 
Blair Zajac <bl...@orcaware.com>
Plots of your system's performance plots - http://www.orcaware.com/orca/

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

Re: branches and tags question

Posted by Blair Zajac <bl...@orcaware.com>.
solo turn wrote:
> 
> a pre commit hook for access control?
> 
> up to now, it thought apache is doing the access control ... via the
> httpd.conf file. you set your tag read only and you are done?
> 
> the pre commit hook seems to be for the really paranoid ones ;))

Justin had a good email about this.  It turns out it's really
hard to put together regex's matching requests to particular
locations in the Subversion repository.  I don't have the URL
to it, but there's a note in the issue database about this.

In the end, using the pre-commit hook is the easy way to go.

Blair

-- 
Blair Zajac <bl...@orcaware.com>
Plots of your system's performance plots - http://www.orcaware.com/orca/

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

Re: branches and tags question

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
solo turn wrote:

>a pre commit hook for access control?
>
>up to now, it thought apache is doing the access control ... via the
>httpd.conf file. you set your tag read only and you are done?
>
>the pre commit hook seems to be for the really paranoid ones ;))
>  
>

no.  apache's access control can't deal with different grades of access 
to different directories within your repository.  you need (i believe) a 
pre commit hook to do that.

apache just controls read or write access to the repository as a whole.

-garrett



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

Re: branches and tags question

Posted by solo turn <so...@yahoo.com>.
a pre commit hook for access control?

up to now, it thought apache is doing the access control ... via the
httpd.conf file. you set your tag read only and you are done?

the pre commit hook seems to be for the really paranoid ones ;))

--- Ben Collins-Sussman <su...@collab.net> wrote:
> pll@lanminds.com writes:
> 
> > Is that correct?  If so, how do I create a 'tag', but then insure
> 
> > that it never changes?  I understand that I can:
> > 
> > 	svn cp http://path/to/repo/trunk
> http://path/to/repo/tag/tag-name
> > 
> > However, that does not prevent me, or anyone else, from
> accidently
> > checking out http://path/to/repo/tag/tag-name, making changes,
> and
> > then re-committing it.
> > 
> > Do I manually set the unix-level file permissions on the
> repository 
> > structure to read only after the creation or is there an svn
> mechanism 
> > to do this?
> 
> Take a look a doc/book/book/ch04.xml.  I just finished rewriting
> the
> chapter about branches and tags.  Here's a relevant excerpt:
> 
>   "But wait a moment: isn't this tag-creation procedure the same
>   procedure we used to create a branch? Yes, in fact, it is. The
>   shocking truth is that in Subversion, there's no difference
> between
>   a tag and a branch. Tags and branches are both just ordinary
>   directories that are created by copying. As we mentioned earlier,
>   the only reason a copied directory is a "tag" is because humans
> have
>   decided to treat it that way: as long as nobody ever commits to
> the
>   directory, it forever remains a snapshot. If people start
> committing
>   to it, it becomes a branch.
> 
>   If you are administering a repository, there are two approaches
> you
>   can take to managing tags. The first approach is "hands off": as
> a
>   matter of project policy, decide where your tags will live, and
> make
>   sure all users know to how treat the directories they copy in
>   there. (That is, make sure they know not to commit to them.) The
>   second approach is more paranoid: you can use one of the
>   access-control scripts provided with Subversion to prevent anyone
>   from doing anything but creating new copies in the tags-area. The
>   paranoid approach, however, isn't usually necessary. If a user
>   accidentally commits a change to a tag-directory, you can simply
>   undo the change as discussed in the previous section. This is
>   version control, after all!"
> 
> If you're paranoid, install a pre-commit hook script to prevent a
> commit to a tag.  Look at
> tools/hook-scripts/commit-access-control.pl
> or svnperms.py.
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.org
> 


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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

Re: branches and tags question

Posted by Ben Collins-Sussman <su...@collab.net>.
pll@lanminds.com writes:

> Is that correct?  If so, how do I create a 'tag', but then insure 
> that it never changes?  I understand that I can:
> 
> 	svn cp http://path/to/repo/trunk http://path/to/repo/tag/tag-name
> 
> However, that does not prevent me, or anyone else, from accidently
> checking out http://path/to/repo/tag/tag-name, making changes, and
> then re-committing it.
> 
> Do I manually set the unix-level file permissions on the repository 
> structure to read only after the creation or is there an svn mechanism 
> to do this?

Take a look a doc/book/book/ch04.xml.  I just finished rewriting the
chapter about branches and tags.  Here's a relevant excerpt:

  "But wait a moment: isn't this tag-creation procedure the same
  procedure we used to create a branch? Yes, in fact, it is. The
  shocking truth is that in Subversion, there's no difference between
  a tag and a branch. Tags and branches are both just ordinary
  directories that are created by copying. As we mentioned earlier,
  the only reason a copied directory is a "tag" is because humans have
  decided to treat it that way: as long as nobody ever commits to the
  directory, it forever remains a snapshot. If people start committing
  to it, it becomes a branch.

  If you are administering a repository, there are two approaches you
  can take to managing tags. The first approach is "hands off": as a
  matter of project policy, decide where your tags will live, and make
  sure all users know to how treat the directories they copy in
  there. (That is, make sure they know not to commit to them.) The
  second approach is more paranoid: you can use one of the
  access-control scripts provided with Subversion to prevent anyone
  from doing anything but creating new copies in the tags-area. The
  paranoid approach, however, isn't usually necessary. If a user
  accidentally commits a change to a tag-directory, you can simply
  undo the change as discussed in the previous section. This is
  version control, after all!"

If you're paranoid, install a pre-commit hook script to prevent a
commit to a tag.  Look at tools/hook-scripts/commit-access-control.pl
or svnperms.py.


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