Subversion - should anyone evolve from the trunk?

When using Subversion, should developers work from the outside, or if the trunk is only used for merging with each individual branch of the developer and is viewed by the continuous integration service?

+44
version-control branch svn
Aug 11 '09 at 17:24
source share
17 answers

There are two main strategies:

  • unstable trunk - the connecting line always contains the last code, branches are made for release
  • stable trunk code is developed in branches and checked in the trunk only with full verification, and releases are performed from the trunk

which you use, to a certain extent, depends on personal preferences. But along with this, individual developers should use branches for their own experimental development.

As usual, there is no definite answer!

+63
Aug 11 '09 at 17:33
source share

Depending on how vast the changes are. It is common practice that the trunk should always be compiled, but this does not necessarily mean that developers cannot work on the trunk for small changes / corrections - after all, this is one of the reasons for having a working copy; you can make sure that something compiles before you commit it.

Big changes or additions to functions almost always have to be removed to the branch until they are ready for integration, so as not to interfere with other developments.

+15
Aug 11 '09 at 17:27
source share

There are several methods for working with version control systems for parallel development. There is nothing wrong with what you offer above, but there are advantages and disadvantages associated with each. I worked in both directions.

Deploying branches and cutting branches is great, but if you need to do emergency production, you have to fix the release branch and release it again - that means building a branch on your CI system.

Working in branches and maintaining the main trunk (monitoring using a continuous integration system) is also excellent, but can lead to conflicts with developers from different industries who are making changes.

See also the following site:

http://www.cmcrossroads.com/bradapp/acme/branching/

It discusses a number of branching patterns for concurrent development, including:

  • S1. Highway
  • S2. Concurrent Maintenance / Development
  • S3. Overlapping releases
  • S4. Dock station
  • S5. Phased integration lines
  • S6. Change distribution queues
  • S7. 3rd party code line
  • S8. Internal / external lines
+10
Aug 11 '09 at 17:43
source share

I think it really depends on the scale of your operation. Perhaps up to 5-10 developers, everyone who performs the trick should be fine. But of course, everyone should remember that the trunk must always be compiled. If they are working on major changes that will not compile for a while, then they should go to the branch.

+9
Aug 11 '09 at 17:29
source share

Using Subversion is a common practice for everyone to work from the trunk. If a particular developer is working on a large or “experimental” function, it may be wise to create a separate branch for this work, which can later be merged back into the trunk.

Although the method that you are describing, with each developer having their own branch, is closer to Git than Subversion. If you prefer to work, I would recommend using Git instead.

With Git, there is no need to use any kind of continuous integration server to view individual branches. Instead, each developer has their own branch, which they can simply merge back into the main branch whenever they want.

+9
Aug 11 '09 at 17:31
source share

I almost always worked on teams that developed on the trunk - it works great. I'm not saying that this is a better idea or something else, just not something worth confronting if you are going to fire you.

However, our system is always fascinating and often uses CI. Every developer should know the update / rebuild / retest / commit cycle (not that it is reliable, but it works quite well).

Hmph, it hurts me when I think about how many of our software products work "Good enough."

+3
Aug 11 '09 at 5:30 p.m.
source share

There must be an argument that developers will have to work on the trunk.

If you allow them to separate, some will be tempted to maintain these branches indefinitely and cross-synchronize with the body at regular intervals. This will inevitably lead to complex merge operations, and this, in turn, will lead to errors.

Forcing everyone to the chest, they should stay pretty close to the head, so the risk of mistakes will be introduced with bad mergers. In addition, since everyone has updated code, they are more likely to notice errors when they crawl, and patches will be fixed faster.

Of course, sometimes a large function needs to be set separately, but in those cases, a specially approved exception can be made.

+2
Aug 11 '09 at 17:47
source share

Our luggage rack is intended only for merging and correction of errors of urgency. When we have a new project, we expand the trunk, develop by industry, rearrange from the trunk, if any other branch has been merged into the trunk, and when we are ready to test, we expand the branch. When the test is in order, we merge with the trunk and enter the beta version. Before the merger, we make the version on the trunk to avoid problems.

After beta testing, we released prod.

+2
Aug 11 '09 at 17:49
source share

Now I am working on version 3.0 of our product and verify that my code changes in the trunk. The release continues for several more weeks.

An employee is experimenting with some features that can do it in 4.0, but definitely not in 3.0. She checks her stuff on a separate branch. It would be wrong to check this material in the trunk.

Another employee corrects errors in version 2.5 that we have already sent to the client. He checks them in branch 2.5 for obvious reasons.

So, to answer the title of the question (if everyone will develop from the trunk, my answer is no. HTH

PS about the merger. We could selectively combine some things from branch 2.5 into the trunk later, but not from trunk to branch. Merging between the host and branch 4.0 can go both ways.

+2
Aug 11 '09 at 18:03
source share

As Neil Butterworth said , it depends; There are several valid methods.

However, I personally would recommend having a stable trunk and doing all the basic development on temporary branches. (T.E. Only small independent changes that will be fully implemented with a single commit must go directly to the trunk.) To avoid longer branches extending too far from the main line, (auto) combine everything that enters the trunk, to all branch development, at least daily. Oh, and everything should be reviewed by CI - not only the trunk, but all development branches too. Especially with Hudson, this is fast and there is very little overhead.

If you are interested in how we have applied this, there is more detailed information . (I would love to repeat too much ... :)

I would recommend this approach, even if it is only one team working on a codebase, and even if everyone is working on the same function / change. What for? Good, because, in my experience (if things like release schedules, requirements, etc.) are not foreseen in your environment, it definitely pays off to constantly keep your trunk in unlockable form.

+2
Aug 11 '09 at 18:20
source share

I have developers who create project branches or change request / error branches from the outside, and then merge back, so yes, I have developers working from the trunk, but what happens in the merge branches is controlled through some management tool or assembly process.

I think this is pretty well covered by this question.

+1
Aug 11 '09 at 17:29
source share

Yes, it must be your working copy for release. All your branches must be previous versions of your code.

+1
Aug 11 '09 at 18:21
source share

It totally depends on your release schedule. If all the work that is currently being checked periodically is intended to be released immediately, all of them can be checked in one area, for example, a tube. If some kind of work, which will be restrained while another, incomplete work, is to be the first to exit, the first code that comes out can be transferred to the trunk, and the next code in it is its own branch OR vice versa.

You should find that merging and updating branches can be a problem when errors sometimes occur. Therefore, naturally, an attempt to minimize this makes sense. The general idea of ​​source control is that everyone can work in one place.

Often, when you get larger teams, the release schedule is organized by subgroups and their projects, and they have their own branches.

+1
Aug 11 '09 at 18:30
source share

Yes.
it makes no sense to make your latest branch your latest version. Then your trunk will become obsolete from your branches.

+1
Aug 11 '09 at 20:20
source share

I think that if you are agile and release in small steps for several weeks, you should develop in the trunk. Thus, you have the latter in the trunk, it is constantly being created, maybe it will break, but it will be fixed soon, and when you are ready for release, mark it and release it. Thus, the headache does not merge with the branches.

I think I would also like to add that if you develop in branches, you cannot be agile. Industry development only works in a waterfall.

+1
Sep 05 '12 at 18:17
source share

I think the tools you use are also a big factor.

  • If you use Subversion, an intermittent trunk is likely to work best for you.
  • If you use GIT, a stable trunk will be much simpler than Subversion.
+1
Apr 01 '14 at
source share

At my company, we adopted a stable model for the development of the trunk with the code being developed and were fully tested on the branches before combining with the trunk. But I find this practice quite complicated because it takes months to validate validation to fully test feature branches. Thus, we end up delaying these branches for several months before we can merge them back into the trunk.

The flip side of this will be the use of unstable trunk design with all the changes that go into the trunk all the time, but then our validation team starts complaining that they don’t have confidence in the code, because all the changes are always there and there is no isolation.

None of these approaches seem to be truly optimal. Is there a better approach for a team where validation can take a very long time?

+1
May 16 '17 at 18:08
source share



All Articles