mirror of
https://github.com/semver/semver.git
synced 2026-07-11 06:53:03 -05:00
[GH-ISSUE #5] Segment comparison misses certain scenarios #870
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @serialseb on GitHub (Dec 12, 2011).
Original GitHub issue: https://github.com/semver/semver/issues/5
Suggesting a clarification that ought to be in the text provided the below is accurate:
From reading the specification, when it comes to build or pre, there is no word on how to compare variable segment numbers.
Specifically, what ought to be the result of
1.0.0+buildcompared to1.0.0+build.1and1.0.0-precompared to1.0.0-pre.beta.As the specification implies that when build is present it takes precedence over absence of build, and normal takes precendence over pre, I assume the following result:
The examples however show that 1) is not correct, and should be
build < build.1. The text ought to be clarified if that's indeed the desired outcome of builds.@richardwhiuk commented on GitHub (Dec 26, 2011):
As I understand the following is the case:
1.0.0-pre < 1.0.0-pre.beta < 1.0.0+build < 1.0.0+build.1
In other words, a pre-release version is always less than a none pre-release version (as marked by the dash) and presence is always less than something being there.
The quote currently reads:
This should probably be appended with:
Or similar words to that effect.
@lathanh commented on GitHub (Jan 13, 2012):
Also, it would be helpful for the example to illustrate that a pre-release has higher precedence than a non-pre-release of a lower normal version. This can accomplished with the following insertion (in bold):
@GordonSchmidt commented on GitHub (Dec 6, 2012):
I have a totally different comparison problem.
The specification says, in pre-releases and builds numeric values are lower than string values - but there is no definition, what should be interpreted as numeric value. Maybe there already is a specification somewhere - then it should be linked. For example are the last parts of these versions numeric or strings: 1.2.3-e0f985a, 1.2.3+45.6-7, 1.2.3-0x1f?
@haacked commented on GitHub (Dec 6, 2012):
Numeric values refer to the colloquial definition of a base 10 numbering system (aka
0-9). It's not referring to any other base systems.@haacked commented on GitHub (Dec 20, 2012):
@serialseb or @richardwhiuk, mind submitting a PR that closes this issue and contains your suggested text? You can do it through the web UI by editing the
semver.mdfile. It'll automatically fork the repo and create a pull request.@haacked commented on GitHub (Mar 13, 2013):
We're planning to change the meaning of build metadata to be purely metadata which does not affect the version.
Thus:
1.0.0+build.1=1.0.0+buildas far as the public API is concerned. No precedence can be determined.1.0.0-alpha<1.0.0-alpha.1correct me if I'm wrong, but I believe this case is already clear in the spec.