Rule on comparing different number of dot separated identifiers #34

Closed
opened 2026-02-17 11:04:05 -06:00 by GiteaMirror · 1 comment
Owner

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!

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!
Author
Owner

@NerdyDuck commented on GitHub (Aug 11, 2012):

I'm sorry, I somehow missed https://github.com/mojombo/semver/issues/6 . Please ignore this issue.

@NerdyDuck commented on GitHub (Aug 11, 2012): I'm sorry, I somehow missed https://github.com/mojombo/semver/issues/6 . Please ignore this issue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/semver#34