Problem with plus sign + in semantic version - use web safe underscore _ instead. #220

Closed
opened 2026-02-17 11:35:56 -06:00 by GiteaMirror · 7 comments
Owner

Originally created by @mkboel on GitHub (May 3, 2016).

Example: "0.2.0+Metadata" is web unsafe, and is translated to "0.2.0 Metadata" by many web tools.

Many tools use web related url's to refer to versions, but the plus sign + is translated to a space. You should allow a web safe character as delimiter between version and metadata info. Safe characters could be hyphen, underscore, or tilde.

I suggest sematic versioning use underscore _ as an valid metadata delimiter.

Example "0.2.0_Metadata"

Originally created by @mkboel on GitHub (May 3, 2016). Example: "0.2.0+Metadata" is web unsafe, and is translated to "0.2.0 Metadata" by many web tools. Many tools use web related url's to refer to versions, but the plus sign + is translated to a space. You should allow a web safe character as delimiter between version and metadata info. Safe characters could be hyphen, underscore, or tilde. I suggest sematic versioning use underscore _ as an valid metadata delimiter. Example "0.2.0_Metadata"
Author
Owner

@FichteFoll commented on GitHub (May 3, 2016):

The solution is to use %2B in urls, as any url-escaping function does.

@FichteFoll commented on GitHub (May 3, 2016): The solution is to use `%2B` in urls, as any url-escaping function does.
Author
Owner

@crazedsanity commented on GitHub (May 3, 2016):

I agree with @FichteFoll. It might not seem fair, but going down this road (changing the format to accomodate URL-friendly characters) would pave the way for things like "removing the periods, because those have to be escaped in regular expressions" (which is just a fact of life).

@mkboel, you could create an "extension" of SemVer that swaps + for _.

@crazedsanity commented on GitHub (May 3, 2016): I agree with @FichteFoll. It might not seem fair, but going down this road (changing the format to accomodate URL-friendly characters) would pave the way for things like "removing the periods, because those have to be escaped in regular expressions" (which is just a fact of life). @mkboel, you could create an "extension" of SemVer that swaps `+` for `_`.
Author
Owner

@benmarten commented on GitHub (May 4, 2017):

We are seeing issues with the plus sign with CocoaPods and with Gradle. It leads to unpredictable builds because they interpret plus sign as anything.
2.0.0-SNAPSHOT+1493919587 would lead to any snapshot 2.0.0-SNAPSHOT*
we replaced it with a dot a such: 2.0.0-SNAPSHOT.1493919587

@benmarten commented on GitHub (May 4, 2017): We are seeing issues with the plus sign with CocoaPods and with Gradle. It leads to unpredictable builds because they interpret plus sign as anything. `2.0.0-SNAPSHOT+1493919587` would lead to any snapshot `2.0.0-SNAPSHOT*` we replaced it with a dot a such: `2.0.0-SNAPSHOT.1493919587`
Author
Owner

@efunkenbusch commented on GitHub (Aug 14, 2018):

2.0.0-SNAPSHOT+1493919587 would lead to any snapshot 2.0.0-SNAPSHOT*

@benmarten And that would be correct. Metadata is not taken into account at all in precedence, and thus two versions that differ only by metadata would be considered identical.

@efunkenbusch commented on GitHub (Aug 14, 2018): > 2.0.0-SNAPSHOT+1493919587 would lead to any snapshot 2.0.0-SNAPSHOT* @benmarten And that would be correct. Metadata is not taken into account at all in precedence, and thus two versions that differ only by metadata would be considered identical.
Author
Owner

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

@mkboel, unless you have further questions/comments or intend to issue PR, please close this issue at your earliest possible convenience.

@jwdonahue commented on GitHub (Oct 8, 2018): @mkboel, unless you have further questions/comments or intend to issue PR, please close this issue at your earliest possible convenience.
Author
Owner

@mkboel commented on GitHub (Apr 15, 2020):

My solution was to stop using the plus sign. And hereby stop using correct
semver. Works like a charm anyway...

tir. d. 14. apr. 2020 19.34 skrev Pavel Erokhin notifications@github.com:

And what to do with it? How to avoid this when using Gradle? 😵😕


You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
https://github.com/semver/semver/issues/306#issuecomment-613578661, or
unsubscribe
https://github.com/notifications/unsubscribe-auth/AB3OEX2A5CB4BPXDJPOIMADRMSNCRANCNFSM4CCYC2XQ
.

@mkboel commented on GitHub (Apr 15, 2020): My solution was to stop using the plus sign. And hereby stop using correct semver. Works like a charm anyway... tir. d. 14. apr. 2020 19.34 skrev Pavel Erokhin <notifications@github.com>: > And what to do with it? How to avoid this when using Gradle? 😵😕 > > — > You are receiving this because you modified the open/close state. > Reply to this email directly, view it on GitHub > <https://github.com/semver/semver/issues/306#issuecomment-613578661>, or > unsubscribe > <https://github.com/notifications/unsubscribe-auth/AB3OEX2A5CB4BPXDJPOIMADRMSNCRANCNFSM4CCYC2XQ> > . >
Author
Owner

@MairwunNx commented on GitHub (Apr 15, 2020):

@mkboel thanks

@MairwunNx commented on GitHub (Apr 15, 2020): @mkboel thanks
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/semver#220