title: semantic versioning, bug-fix-releases of previous versions and precedence in tree structure
body: <p>We use <a href="http://semver.org" rel="nofollow noreferrer">semantic versioning</a>. Suppose we have some software release with a version number of e.g. <code>2.1.1</code>. Because of an API change the next release has version number <code>3.0.0</code>. Now let us suppose that a bug is found which occurs both in version <code>2.1.1</code> and version <code>3.0.0</code>. Since some customers still use <code>2.1.1</code> and we do not want to force them to upgrade to a version <code>3.0.1</code> or later we provide a maintainance (bug fix) release for version <code>2.1.1</code>. A straight forward version number for this release could be <code>2.1.2</code>. Though no such example is given in the <a href="http://semver.org/#spec-item-11" rel="nofollow noreferrer">defintion of precedence</a> I would conclude that the rules imply <code>2.1.2</code> &lt; <code>3.0.0</code> - 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:</p>
  
  <pre><code>  |
  2.1.1        (1)
    |\
    | \
    | 2.1.2    (3)
    |
  3.0.0        (2)
    |
  </code></pre>
  
  <p>To reflect that tree structure and avoid confusion I would prefer a version number scheme like the following:</p>
  
  <pre><code>  |
  2.1.1        (1)
    |\
    | \
    | 2.1.1+m  (3)
    |
  3.0.0        (2)
    |
  </code></pre>
  
  <p>(<code>+m</code> for maintainance release). According to the definition of precedence in semantic versioning this would still imply <code>2.1.1+m</code> &lt; <code>3.0.0</code>, but for our customers we could add a rule that for <code>x1.y1.z1</code> &lt; <code>x2.y2.z2</code> any version <code>x1.y1.z1+m*</code> is not comparable to <code>x2.y2.z2</code> (but <code>x1.y1.z1</code> &lt; <code>x2.y2.z2+m*</code> still holds). </p>
  
  <p>Are there any best practices for versioning a tree structure? Or did I get something wrong about semantic versioning?</p>