[GH-ISSUE #176] Spec doesn't indicate whether pre-release labels and build metadata are case sensitive #6108

Closed
opened 2026-06-17 04:36:56 -05:00 by GiteaMirror · 24 comments
Owner

Originally created by @jeffhandley on GitHub (Feb 3, 2014).
Original GitHub issue: https://github.com/semver/semver/issues/176

Let's hope they aren't. But can we get some clarification as to whether or not they are meant to be?

Originally created by @jeffhandley on GitHub (Feb 3, 2014). Original GitHub issue: https://github.com/semver/semver/issues/176 Let's hope they aren't. But can we get some clarification as to whether or not they are meant to be?
Author
Owner

@zafarkhaja commented on GitHub (Feb 3, 2014):

The specification states that the alphanumeric identifiers must be compared lexically in ASCII sort order, which kind of implies that 'A' and 'a' are not the same, they have different numeric codes.

<!-- gh-comment-id:33937683 --> @zafarkhaja commented on GitHub (Feb 3, 2014): The specification states that the alphanumeric identifiers must be compared lexically in ASCII sort order, which kind of implies that `'A'` and `'a'` are not the same, they have different numeric codes.
Author
Owner

@reiz commented on GitHub (Feb 3, 2014):

I agree with @jeffhandley. Case insensitive would be better. Specially if you want to use semver strings in URLs, case sensitive can lead to confusion. That would basically mean that this here

/1.0.0-alpha

I another page then this

/1.0.0-Alpha

That's why I think case insensitive is the way to go.

<!-- gh-comment-id:33938694 --> @reiz commented on GitHub (Feb 3, 2014): I agree with @jeffhandley. Case insensitive would be better. Specially if you want to use semver strings in URLs, case sensitive can lead to confusion. That would basically mean that this here ``` /1.0.0-alpha ``` I another page then this ``` /1.0.0-Alpha ``` That's why I think case insensitive is the way to go.
Author
Owner

@haacked commented on GitHub (Feb 3, 2014):

I can't see any reason why it should be case sensitive. Submit a PR?

<!-- gh-comment-id:33977591 --> @haacked commented on GitHub (Feb 3, 2014): I can't see any reason why it should be case sensitive. Submit a PR?
Author
Owner

@jeffhandley commented on GitHub (Feb 3, 2014):

Cool; will do. Should we bump the spec to 2.0.1 as part of the change?

<!-- gh-comment-id:33993567 --> @jeffhandley commented on GitHub (Feb 3, 2014): Cool; will do. Should we bump the spec to 2.0.1 as part of the change?
Author
Owner

@haacked commented on GitHub (Feb 3, 2014):

Seems reasonable.

On Mon, Feb 3, 2014 at 12:00 PM, Jeff Handley notifications@github.comwrote:

Cool; will do. Should we bump the spec to 2.0.1 as part of the change?


Reply to this email directly or view it on GitHubhttps://github.com/mojombo/semver/issues/176#issuecomment-33993567
.

<!-- gh-comment-id:33998927 --> @haacked commented on GitHub (Feb 3, 2014): Seems reasonable. On Mon, Feb 3, 2014 at 12:00 PM, Jeff Handley notifications@github.comwrote: > Cool; will do. Should we bump the spec to 2.0.1 as part of the change? > > — > Reply to this email directly or view it on GitHubhttps://github.com/mojombo/semver/issues/176#issuecomment-33993567 > .
Author
Owner

@reiz commented on GitHub (Feb 4, 2014):

+1

<!-- gh-comment-id:34047424 --> @reiz commented on GitHub (Feb 4, 2014): +1
Author
Owner

@StephenCleary commented on GitHub (Jun 19, 2014):

I interpret the current (2.0.0) spec as clearly prescribing case-sensitivity. So wouldn't case-insensitivity be a backwards-incompatible change?

<!-- gh-comment-id:46516687 --> @StephenCleary commented on GitHub (Jun 19, 2014): I interpret the current (2.0.0) spec as clearly prescribing case-sensitivity. So wouldn't case-insensitivity be a backwards-incompatible change?
Author
Owner

@FichteFoll commented on GitHub (Jun 19, 2014):

Yeah, I think so. Should probably be bumped to 2.1.0

<!-- gh-comment-id:46550038 --> @FichteFoll commented on GitHub (Jun 19, 2014): Yeah, I think so. Should probably be bumped to 2.1.0
Author
Owner

@tedivm commented on GitHub (Jul 2, 2014):

Bumping to 2.1.0 would break semantic versioning ;-)

8 Major version X (X.y.z | X > 0) MUST be incremented if any backwards incompatible changes are introduced to the public API. It MAY include minor and patch level changes. Patch and minor version MUST be reset to 0 when major version is incremented.

<!-- gh-comment-id:47745071 --> @tedivm commented on GitHub (Jul 2, 2014): Bumping to 2.1.0 would break semantic versioning ;-) > 8 Major version X (X.y.z | X > 0) MUST be incremented if any backwards incompatible changes are introduced to the public API. It MAY include minor and patch level changes. Patch and minor version MUST be reset to 0 when major version is incremented.
Author
Owner

@crazedsanity commented on GitHub (Jul 2, 2014):

It could be a major or a minor change, really. The determination of major vs. minor version bump would be whether enforcing case insensitivity would actually cause an incompatibility. Honestly, I don't think it would. While there are file systems that store files that differ only in case, files of that nature are usually created in error.

<!-- gh-comment-id:47816139 --> @crazedsanity commented on GitHub (Jul 2, 2014): It could be a major or a minor change, really. The determination of major vs. minor version bump would be whether enforcing case insensitivity would actually cause an incompatibility. Honestly, I don't think it would. While there are file systems that store files that differ only in case, files of that nature are usually created in error.
Author
Owner

@crazedsanity commented on GitHub (Jul 2, 2014):

Therefore, I would suggest that this would bump SemVer to 2.1.0, assuming there are no other changes that would break backwards-compatibility.

<!-- gh-comment-id:47816254 --> @crazedsanity commented on GitHub (Jul 2, 2014): Therefore, I would suggest that this would bump SemVer to 2.1.0, assuming there are no other changes that would break backwards-compatibility.
Author
Owner

@haacked commented on GitHub (Jul 2, 2014):

Agreed. The intent was case insensitivity. I doubt this breaks anyone in
practice.

<!-- gh-comment-id:47818037 --> @haacked commented on GitHub (Jul 2, 2014): Agreed. The intent was case insensitivity. I doubt this breaks anyone in practice.
Author
Owner

@dwijnand commented on GitHub (Jul 2, 2014):

I agree (fwiw) that the intent was case insensitivity, therefore this isn't a breaking change but a bugfix only, but wouldn't that mean that the version should be bumped to 2.0.1?

<!-- gh-comment-id:47835662 --> @dwijnand commented on GitHub (Jul 2, 2014): I agree (fwiw) that the intent was case insensitivity, therefore this isn't a breaking change but a bugfix only, but wouldn't that mean that the version should be bumped to 2.0.1?
Author
Owner

@tedivm commented on GitHub (Jul 3, 2014):

The intent doesn't matter, what matters was published and worked off of. People who built version comparisons according to the current standard, which says that alphanumeric includes both upper and lower cases and that they should be sorted "lexically"- which is a word that has meaning, and that meaning includes Capital Letters occurring before Lower Case Letters (seriously, look it up).

My thought is that if the standard explicitly states one thing, and changing that thing requires people to rewrite their version comparators to say in line with the standard, then it's a backwards compatible break. Since it's a BC break, then the existing standard says the Major field needs to be incremented.

Maybe for v3 people can go with "natural sort" over "lexical sort", which in this context makes a lot more sense.

<!-- gh-comment-id:47856445 --> @tedivm commented on GitHub (Jul 3, 2014): The intent doesn't matter, what matters was published and worked off of. People who built version comparisons according to the current standard, which says that alphanumeric includes both upper and lower cases and that they should be sorted "lexically"- which is a word that has meaning, and that meaning includes Capital Letters occurring before Lower Case Letters (seriously, look it up). My thought is that if the standard explicitly states one thing, and changing that thing requires people to rewrite their version comparators to say in line with the standard, then it's a backwards compatible break. Since it's a BC break, then the existing standard says the Major field needs to be incremented. Maybe for v3 people can go with "natural sort" over "lexical sort", which in this context makes a lot more sense.
Author
Owner

@haacked commented on GitHub (Jul 3, 2014):

We have an open PR #177. Let's discuss there instead of here.

<!-- gh-comment-id:47858797 --> @haacked commented on GitHub (Jul 3, 2014): We have an open PR #177. Let's discuss there instead of here.
Author
Owner

@haacked commented on GitHub (Jan 31, 2017):

A stable spec is important and I don't think this is important enough to warrant a change. As @isaacs pointed out in #177 there's an easy workaround for NuGet to both comply with the spec and keep its current behavior.

<!-- gh-comment-id:276496345 --> @haacked commented on GitHub (Jan 31, 2017): A stable spec is important and I don't think this is important enough to warrant a change. As @isaacs pointed out in #177 there's an easy workaround for NuGet to both comply with the spec and keep its current behavior.
Author
Owner

@jwdonahue commented on GitHub (Dec 5, 2017):

@jeffhandley, it seems that it was decided not to take the changes on this issue and to continue with lexicographical sort ordering, meaning case-sensitive. Unless you intend to pursue this further, can you please close this issue?

<!-- gh-comment-id:349476302 --> @jwdonahue commented on GitHub (Dec 5, 2017): @jeffhandley, it seems that it was decided not to take the changes on this issue and to continue with lexicographical sort ordering, meaning case-sensitive. Unless you intend to pursue this further, can you please close this issue?
Author
Owner

@dwijnand commented on GitHub (Mar 15, 2018):

imo the issue is still valid because it still "doesn't indicate whether pre-release labels and build metadata are case sensitive".

<!-- gh-comment-id:373430082 --> @dwijnand commented on GitHub (Mar 15, 2018): imo the issue is still valid because it still "doesn't indicate whether pre-release labels and build metadata are case sensitive".
Author
Owner

@jwdonahue commented on GitHub (Mar 24, 2018):

@dwijnand, back in 2014 when this issue was opened, that may have been true, but in the current version, it is quite clear in clause #11 that the major, minor, patch and prerelease tags are to be used for sorting and that the prerelease tag is to be "compared lexically in ASCII sort order". If you do not understand what that means, you probably have no use for the standard.

The American Standard Code for Information Interchange (ASCII) was designed for sorting and efficient exchange of text over low bandwidth communications channels.

@Haacked, this issue should be closed. All related issues have been closed as well.

<!-- gh-comment-id:375913683 --> @jwdonahue commented on GitHub (Mar 24, 2018): @dwijnand, back in 2014 when this issue was opened, that may have been true, but in the current version, it is quite clear in [clause #11](https://semver.org/#spec-item-11) that the major, minor, patch and prerelease tags are to be used for sorting and that the prerelease tag is to be "compared lexically in ASCII sort order". If you do not understand what that means, you probably have no use for the standard. The [American Standard Code for Information Interchange (ASCII)](https://en.wikipedia.org/wiki/ASCII) was designed for sorting and efficient exchange of text over low bandwidth communications channels. @Haacked, this issue should be closed. All related issues have been closed as well.
Author
Owner

@dwijnand commented on GitHub (Mar 24, 2018):

@jwdonahue I just re-read the comments and if you look nothing has changed in the wording since 2014:

compared lexically in ASCII sort order

(in https://github.com/semver/semver/issues/176#issuecomment-33937683)

having re-read I agree with you that that's quite clear in terms of case sensitivity. this issue can be closed.

<!-- gh-comment-id:375930864 --> @dwijnand commented on GitHub (Mar 24, 2018): @jwdonahue I just re-read the comments and if you look nothing has changed in the wording since 2014: > compared lexically in ASCII sort order (in https://github.com/semver/semver/issues/176#issuecomment-33937683) having re-read I agree with you that that's quite clear in terms of case sensitivity. this issue can be closed.
Author
Owner

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

I do agree that case insensitive would probably have been the better choice. I am working on a way to specify the exact semantics of any version string, including SemVer, but life keeps intervening. See VersionMeta.org. VersionSchema is a work in progress, contact me if you have any interest.

<!-- gh-comment-id:375935930 --> @jwdonahue commented on GitHub (Mar 25, 2018): I do agree that case insensitive would probably have been the better choice. I am working on a way to specify the exact semantics of any version string, including SemVer, but life keeps intervening. See [VersionMeta.org](https://versionmeta.org/). VersionSchema is a work in progress, contact me if you have any interest.
Author
Owner

@jwdonahue commented on GitHub (Oct 8, 2018):

@jeffhandley, can you please close this issue at your earliest possible convenience? The current spec clearly states ASCII sort order, which implies case sensitivity. Changing it at this time would be a breaking change in the spec since many of the most popular packaging tools are already case sensitive. The related PR #276 was closed almost a year ago.

Thank you.

<!-- gh-comment-id:427712326 --> @jwdonahue commented on GitHub (Oct 8, 2018): @jeffhandley, can you please close this issue at your earliest possible convenience? The current spec clearly states ASCII sort order, which implies case sensitivity. Changing it at this time would be a breaking change in the spec since many of the most popular packaging tools are already case sensitive. The related PR #276 was closed almost a year ago. Thank you.
Author
Owner

@isaacs commented on GitHub (Oct 8, 2018):

Where this conversation landed is that "ASCII sort order" implies case sensitivity, and that's how it's been implemented. Since the PR was closed with this conclusion, I also recommend closing this. If we're going to re-open the conversation, it should be with a specific use case we intend to address where case-sensitivity is causing problems.

<!-- gh-comment-id:427903401 --> @isaacs commented on GitHub (Oct 8, 2018): Where this conversation landed is that "ASCII sort order" implies case sensitivity, and that's how it's been implemented. Since the PR was closed with this conclusion, I also recommend closing this. If we're going to re-open the conversation, it should be with a specific use case we intend to address where case-sensitivity is causing problems.
Author
Owner

@jeffhandley commented on GitHub (Oct 9, 2018):

Thank you all for reviving the discussion to ensure it landed in a good place. I am happy to close this.

<!-- gh-comment-id:428020840 --> @jeffhandley commented on GitHub (Oct 9, 2018): Thank you all for reviving the discussion to ensure it landed in a good place. I am happy to close this.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/semver#6108