Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 version numbers of the branch and the main trunk be?

like image 225
CJ7 Avatar asked Sep 10 '10 03:09

CJ7


People also ask

What is the difference between source control and version control?

Version control, also known as source control, is the practice of tracking and managing changes to software code. Version control systems are software tools that help software teams manage changes to source code over time.

How does version control work?

Version control enables multiple people to simultaneously work on a single project. Each person edits his or her own copy of the files and chooses when to share those changes with the rest of the team. Thus, temporary or partial edits by one person do not interfere with another person's work.

How does source control work?

Source control (or version control) is the practice of tracking and managing changes to code. Source control management (SCM) systems provide a running history of code development and help to resolve conflicts when merging contributions from multiple sources.


2 Answers

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.

like image 199
VonC Avatar answered Sep 24 '22 06:09

VonC


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.

like image 25
aleung Avatar answered Sep 26 '22 06:09

aleung