Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
658 views
in Technique[技术] by (71.8m points)

version control - What do you use the svn tags directory for anyways?

Ok so we all know the standard SVN set-up of

trunk
branches
tags

And I realize that the recommendation is that tags should have "special" commits in it. I've never really used the tags directory however and I don't see why I ever would.

My understanding is that tags would contain things like "Version1Release, Version2Release, ThatTimeWeUpgradedEverthing" etc. But here's the thing, if you are going in and need to make a change to the Version1Release then it should be a branch, and if tags are supposed to be never-changing then whats the point of making a copy in source-control anyways? Just make a note revision 712 was our version 1 release.

I guess my confusion is that it seems like tags are versions that are never supposed to change. But source control is all about keeping a history of changing files. I know this is a minor organizational argument, but I'm curious what people think.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Just make a note revision 712 was our version 1 release.

This works well enough for developers on the team, perhaps (assuming you have a document store to make such notes in), but asking anyone not intimately familiar with the repository to "just remember" gets pretty unreasonable pretty quickly.

For example, say your repository is available over the 'net. A user might choose to check out and build a copy for their preferred, but obscure, flavor of *nix and want to grab a release which is a couple of versions back, before you added a feature they don't like. Tags make this kind of thing easy.

Tags are also excellent as a "trigger point". In my own repositories, committing a tag automatically launches (via post-commit hook) a script which builds, packages, and posts it to our web site.

In the end, tags are cheap copies. If you ever want to "snapshot" your build in a way which represents that the snapshot won't ever change, tag it. It isn't like it costs you much. :-)

Edit:

To address the "implemented as branches" idea — they aren't. Really. In fact, Subversion doesn't implement branching or tagging at all. Those are entirely user-created ideas, both of which happen to use the same command, svn copy. However, you'd also use that command to copy a file within the trunk; there's nothing special about it. And there's nothing inherently special about branches or tags, either. They're just ordinary directories which we've decided to treat specially (and may even enforce that via hooks) to ease project administration.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...