[GH-ISSUE #473] Confirm semver spec for mixed alpha-numeric #1213

Closed
opened 2026-04-16 10:32:13 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @phil-davis on GitHub (Oct 29, 2018).
Original GitHub issue: https://github.com/semver/semver/issues/473

Looking at the spec:

"Precedence for two pre-release versions with the same major, minor, and patch version MUST be determined by comparing each dot separated identifier from left to right until a difference is found as follows: identifiers consisting of only digits are compared numerically and identifiers with letters or hyphens are compared lexically in ASCII sort order. Numeric identifiers always have lower precedence than non-numeric identifiers."

  1. For example, let's say you use some alpha-numeric strings in position 4. According to the spec, they will sort:
2.0.0-alpha1
2.0.0-alpha10
2.0.0-alpha11
2.0.0-alpha2
2.0.0-alpha3
...
2.0.0-alpha8
2.0.0-alpha9

and you will cause some people (who don't read the spec properly) to wonder why alpha releases alpha10 and alpha11 are followed by alpha2

  1. A more "recommended" way to "number" a set of "alpha" releases is to do:
2.0.0-alpha.1
2.0.0-alpha.2
2.0.0-alpha.3
...
2.0.0-alpha.8
2.0.0-alpha.9
2.0.0-alpha.10
2.0.0-alpha.11

in the style of the example in the spec.

Yes?

Originally created by @phil-davis on GitHub (Oct 29, 2018). Original GitHub issue: https://github.com/semver/semver/issues/473 Looking at the spec: "Precedence for two pre-release versions with the same major, minor, and patch version MUST be determined by comparing each dot separated identifier from left to right until a difference is found as follows: identifiers consisting of only digits are compared numerically and identifiers with letters or hyphens are compared lexically in ASCII sort order. Numeric identifiers always have lower precedence than non-numeric identifiers." 1) For example, let's say you use some alpha-numeric strings in position 4. According to the spec, they will sort: ``` 2.0.0-alpha1 2.0.0-alpha10 2.0.0-alpha11 2.0.0-alpha2 2.0.0-alpha3 ... 2.0.0-alpha8 2.0.0-alpha9 ``` and you will cause some people (who don't read the spec properly) to wonder why alpha releases ``alpha10`` and ``alpha11`` are followed by ``alpha2`` 2) A more "recommended" way to "number" a set of "alpha" releases is to do: ``` 2.0.0-alpha.1 2.0.0-alpha.2 2.0.0-alpha.3 ... 2.0.0-alpha.8 2.0.0-alpha.9 2.0.0-alpha.10 2.0.0-alpha.11 ``` in the style of the example in the spec. Yes?
Author
Owner

@jwdonahue commented on GitHub (Nov 25, 2018):

Yes, you have listed them in ascending order.

@phil-davis, unless you have further questions, please close this issue at your earliest possible convenience.

<!-- gh-comment-id:441408339 --> @jwdonahue commented on GitHub (Nov 25, 2018): Yes, you have listed them in ascending order. @phil-davis, unless you have further questions, please close this issue at your earliest possible convenience.
Author
Owner

@phil-davis commented on GitHub (Nov 25, 2018):

Thanks, I was just looking for confirmation of my reading of the spec - and that the example here might help make the situation clear for someone who finds this in future. Closing.

<!-- gh-comment-id:441411292 --> @phil-davis commented on GitHub (Nov 25, 2018): Thanks, I was just looking for confirmation of my reading of the spec - and that the example here might help make the situation clear for someone who finds this in future. Closing.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/semver#1213