开发者

Source control: what version numbering should be used for branches?

If a branch is created in source control, what version number should be used if there is a release of the branched code?

eg. If the last version number was v1.2.8 and a branch is created, what should the next versi开发者_运维百科on numbers of the branch and the main trunk be?


It depends what the branch is for (what development effort it isolate, as described in "When should you branch")

For instance, for a fix which doesn't add any new feature, it could be v1.2.9.
But actually the version number policies are :

  • very diverse (see this list for instance)
  • can be a bit crazy at time
  • not to be mixed with internal technical revision number
  • can be doubled by a commercial naming strategy

The important thing to remember is that a label like vx.y.z can be generated on any branch. It simply marks a stable point in the development life-cycle.


In our project we follow the single release branch strategy: release will be always performed on release branch. There can be several development/feature/bug-fixing branches, but we never release the product from those branches. They will first be merged into release branch and release from release branch.

On non-release branch, SNAPSHOT version is always used (we use Maven) and the version name is the branch name . For example on a branch which names featureX, the version is featureX-SNAPSHOT. On release branch numeric version is used. Version number will be stepped in new release. In this way, we won't be bothered what version number to use in a non-release branch.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜