mirror of
https://github.com/semver/semver.git
synced 2026-07-11 05:12:48 -05:00
Rule on comparing different number of dot separated identifiers #34
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 @NerdyDuck on GitHub (Aug 10, 2012).
While implementing the Semantic Versioning rules as a class and an assembly attribute in .Net, I noticed that there is no explicit rule when comparing pre-release or build elements of two version strings that have a different number of dot separated identifiers.
An example:
v1 = 1.0.0-rc.1
v2 = 1.0.0-rc.1.20120810
Lexicographic order would suggest that v1 has precedence over v2 as it is shorter. Personally, I would recommend that v2 has precedence as it contains more information, and that's the way I implemented it in my project.
Any thoughts and comments are appreciated!
@NerdyDuck commented on GitHub (Aug 11, 2012):
I'm sorry, I somehow missed https://github.com/mojombo/semver/issues/6 . Please ignore this issue.