We use semantic versioning. Suppose we have some software release with a version number of e.g. 2.1.1
. Because of an API change the next release has version number 3.0.0
. Now let us suppose that a bug is found which occurs both in version 2.1.1
and version 3.0.0
. Since some customers still use 2.1.1
and we do not want to force them to upgrade to a version 3.0.1
or later we provide a maintainance (bug fix) release for version 2.1.1
. A straight forward version number for this release could be 2.1.2
. Though no such example is given in the defintion of precedence I would conclude that the rules imply 2.1.2
< 3.0.0
- meaning what? Version 2.1.2 was released after 3.0.0 and version 3.0.0 does not include all bug fixes of 2.1.2. Actually these two versions are not really orderable, the versions (and the corresponding source revisions) now have a tree structure:
|
2.1.1 (1)
|\
| \
| 2.1.2 (3)
|
3.0.0 (2)
|
To reflect that tree structure and avoid confusion I would prefer a version number scheme like the following:
|
2.1.1 (1)
|\
| \
| 2.1.1+m (3)
|
3.0.0 (2)
|
(+m
for maintainance release). According to the definition of precedence in semantic versioning this would still imply 2.1.1+m
< 3.0.0
, but for our customers we could add a rule that for x1.y1.z1
< x2.y2.z2
any version x1.y1.z1+m*
is not comparable to x2.y2.z2
(but x1.y1.z1
< x2.y2.z2+m*
still holds).
Are there any best practices for versioning a tree structure? Or did I get something wrong about semantic versioning?