I'm seeking opinions here. The following may be considered either an SVN-specific question, or a more general version control question.
If the sources of a project are to be branched at a point corresponding to a release, perhaps for maintenance work, is it preferable to:
(a) branch from the tag, or
(b) branch from the node (e.g. on the trunk) that the tag copies?
What are the pros and cons of these two approaches? Does it matter at all?
Thanks.
The best way to work with git tags is to create a new branch from the existing tag. It can be done using git checkout command.
Go to View, Branches, right click and choose New Branch. * Enter a name for the branch specification. If the release 2a needs to be branched from label r0.
I'd suggest (b) since that will allow you to easily handing merging back to trunk using svn's merge tracking (assuming you have svn 1.5+ on the server and client side). If you used technique (a), you'd have to manage the merges yourself - which isn't bad assuming you don't do multiple merges from the same branch. Given that you are considering creating a branch from a tag, which usual for patching,, you'll probably end up needing to merge more than once to your trunk line to get those patches back in trunk.
Tags are a preferred way to take "snapshots" in time or to mark milestones of a particular code line (be it trunk or a branch) just for the purposes of quickly building a specific milestone from source that's been tagged as a milestone or for easily diff'ing between milestones. Other than that, all work is done between trunk and branches. As was already noted, you can easily find the revision/source a tag was copied from easily using svn log
. For instance svn log --stop-on-copy -v tags/yourtag
will put the latest copied revision at the tail of output. This allows you to create a branch from the revision an active code line from which the tag was created.
In my opinion, I would go the (a) route if I intend to add and patch the main project at a later date and go (b) If I intend to develop something parallel.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With