[GH-ISSUE #49] The Pre-Release Dash should not be in v1.0.0 #6029

Closed
opened 2026-06-17 04:25:58 -05:00 by GiteaMirror · 20 comments
Owner

Originally created by @theory on GitHub (Oct 15, 2012).
Original GitHub issue: https://github.com/semver/semver/issues/49

This change somehow made it into the 1.0.0 spec. That doesn't seem quite right. I should think that this commit would be considered the last in v1.0.0. Am I mistaken? Because otherwise there are three different versions to recognize:

  • v1.0.0 which disallows a dash between the patch version and the pre-release version.
  • v1.0.0 which requires a dash between the patch version and the pre-release version.
  • v2.0.0 which requires the dash and dotted integers.

This makes it difficult to write a parer to properly handle all the cases.

Originally created by @theory on GitHub (Oct 15, 2012). Original GitHub issue: https://github.com/semver/semver/issues/49 [This change](https://github.com/mojombo/semver/commit/05a00df02db3d4ba83e0caaff6b31c10c77f7d3d) somehow made it into the [1.0.0](http://semver.org/spec/v1.0.0.html) spec. That doesn't seem quite right. I should think that [this commit](https://github.com/mojombo/semver.org/commit/a16c419f09b5c5a26320317fcd331264daae16ef) would be considered the last in v1.0.0. Am I mistaken? Because otherwise there are three different versions to recognize: - v1.0.0 which disallows a dash between the patch version and the pre-release version. - v1.0.0 which requires a dash between the patch version and the pre-release version. - v2.0.0 which requires the dash and dotted integers. This makes it difficult to write a parer to properly handle all the cases.
Author
Owner

@haacked commented on GitHub (Oct 15, 2012):

Hi @theory, I'm not sure I understand the question. In your bulleted list you mention v1.0.0 twice. What specifically are you concerned about?

<!-- gh-comment-id:9465900 --> @haacked commented on GitHub (Oct 15, 2012): Hi @theory, I'm not sure I understand the question. In your bulleted list you mention v1.0.0 twice. What specifically are you concerned about?
Author
Owner

@theory commented on GitHub (Oct 15, 2012):

v1.0.0 was changed in this commit to require the dash. For a long time before that (years?), v1.0.0 required no dash (indeed, it forbade it). So it changed the spec without changing the version. I wrote a couple of parsers back before that commit and now folks are running into the fact that they forbid the dash even though the spec has since been changed to require the dash. This clouds the definition of v1.0.0, IMO.

I think that either 1.0.0 should not require the dash, or v1.1.0 should be released requiring the dash. I prefer the former, but given that the change was made 10 months ago, the latter might make more sense.

<!-- gh-comment-id:9466050 --> @theory commented on GitHub (Oct 15, 2012): v1.0.0 was changed in [this commit](https://github.com/mojombo/semver/commit/05a00df02db3d4ba83e0caaff6b31c10c77f7d3d) to require the dash. For a long time before that (years?), v1.0.0 required no dash (indeed, it forbade it). So it changed the spec without changing the version. I wrote a couple of parsers back before that commit and now folks are running into the fact that they forbid the dash even though the spec has since been changed to require the dash. This clouds the definition of v1.0.0, IMO. I think that either 1.0.0 should _not_ require the dash, or v1.1.0 should be released requiring the dash. I prefer the former, but given that the change was made 10 months ago, the latter might make more sense.
Author
Owner

@haacked commented on GitHub (Oct 15, 2012):

@theory That section only applies to "pre-release" versions. For example, if you want to denote that your version is an alpha release, you must use the dash. 1.0.0-alpha. But once your library is stable, you can remove the pre-release designation: 1.0.0. A stable release must not have a dash.

Does that make sense?

<!-- gh-comment-id:9466189 --> @haacked commented on GitHub (Oct 15, 2012): @theory That section only applies to "pre-release" versions. For example, if you want to denote that your version is an alpha release, you must use the dash. `1.0.0-alpha`. But once your library is stable, you can remove the pre-release designation: `1.0.0`. A stable release _must not_ have a dash. Does that make sense?
Author
Owner

@theory commented on GitHub (Oct 15, 2012):

Yeah, I understand that. The point is that the dash used to not be required before the prelease version, but that commit added that requirement -- without changing the version of the spec itself.

In other words, I wrote parsers against v1.0..0 of the spec, and the spec then changed so that my parsers now fail, even though the spec still claims to be v1.0.0.

<!-- gh-comment-id:9466249 --> @theory commented on GitHub (Oct 15, 2012): Yeah, I understand that. The point is that the dash used to not be required before the prelease version, but that commit added that requirement -- without changing the version of the spec itself. In other words, I wrote parsers against v1.0..0 of the spec, and the spec then changed so that my parsers now fail, even though the spec still claims to be v1.0.0.
Author
Owner

@haacked commented on GitHub (Oct 15, 2012):

Ah! I see! Well that unfortunately wasn't a stable version of 1.0.0. Unfortunately, it's not very clear by looking at just that file. As you can see in this later commit, the version of SemVer itself was made more clear: b8f12d78c6

So in summary: in the stable 1.0.0 the dash is required and that's never changed since 1.0.0 has been released. The changes the version spec happened in a pre-release version of SemVer. Sorry for the confusion!

<!-- gh-comment-id:9466471 --> @haacked commented on GitHub (Oct 15, 2012): Ah! I see! Well that unfortunately wasn't a stable version of 1.0.0. Unfortunately, it's not very clear by looking at just that file. As you can see in this later commit, the version of SemVer itself was made more clear: https://github.com/mojombo/semver/commit/b8f12d78c680367dcf2a77d98bf9299b61e69b62 So in summary: in the stable 1.0.0 the dash is required and that's never changed since 1.0.0 has been released. The changes the version spec happened in a pre-release version of SemVer. Sorry for the confusion!
Author
Owner

@theory commented on GitHub (Oct 15, 2012):

mojombo/semver@b8f12d7 Went from v1.0.0 to the lower version v1.0.0-rc~1. You can see that, because of that error, the spec was later changed to v2.0.0 in this commit. It had been published as v1.0.0 for a long time before the semver project was forked from semver.org.

<!-- gh-comment-id:9466558 --> @theory commented on GitHub (Oct 15, 2012): mojombo/semver@b8f12d7 Went from v1.0.0 to the _lower_ version v1.0.0-rc~1. You can see that, because of that error, the spec was later changed to v2.0.0 in [this commit](https://github.com/mojombo/semver/commit/24eda4f61d392b069aad317211cdd7389edf7a57). It had been published as v1.0.0 for a _long_ time before the semver project was forked from semver.org.
Author
Owner

@haacked commented on GitHub (Oct 15, 2012):

Maybe @mojombo can shed some light on this. My theory is that while the text of the file says 1.0.0, it wasn't actually 1.0.0. I know that's confusing, but it's not unlike saying that it's the beta draft of the 1.0.0 spec. You don't want to change the text of the spec for each pre-release version update. However, I would have expected something external to the spec would identify what version it actually was.

I vaguely remember there being some indicator because when we implemented the version scheme in NuGet, we knew it was an RC at the time and not the final spec. I don't recall how we knew other than I think we asked.

<!-- gh-comment-id:9466759 --> @haacked commented on GitHub (Oct 15, 2012): Maybe @mojombo can shed some light on this. My theory is that while the text of the file says 1.0.0, it wasn't actually 1.0.0. I know that's confusing, but it's not unlike saying that it's the beta draft of the 1.0.0 spec. You don't want to change the text of the spec for each pre-release version update. However, I would have expected something external to the spec would identify what version it actually was. I vaguely remember there being some indicator because when we implemented the version scheme in NuGet, we knew it was an RC at the time and not the final spec. I don't recall how we knew other than I think we asked.
Author
Owner

@theory commented on GitHub (Oct 16, 2012):

See @mojombo's comment here.

<!-- gh-comment-id:9466872 --> @theory commented on GitHub (Oct 16, 2012): See @mojombo's comment [here](https://github.com/mojombo/semver.org/issues/49).
Author
Owner

@haacked commented on GitHub (Oct 16, 2012):

Thanks! Well that does leave us in a conundrum. 1.0.0 stable has been out for some time now and I imagine even more software has been written that parses that variant of 1.0.0 than the version that disallows the dash.

I don't think it makes sense to try and change 1.0.0 at this point as that ship has sailed and only compounds the problem.

So are you proposing that 2.0 allow cases without the dash?

<!-- gh-comment-id:9467018 --> @haacked commented on GitHub (Oct 16, 2012): Thanks! Well that does leave us in a conundrum. 1.0.0 stable has been out for some time now and I imagine even more software has been written that parses that variant of 1.0.0 than the version that disallows the dash. I don't think it makes sense to try and change 1.0.0 at this point as that ship has sailed and only compounds the problem. So are you proposing that 2.0 allow cases without the dash?
Author
Owner

@theory commented on GitHub (Oct 16, 2012):

No, I like the dash. I wish I had noticed this ten months ago. I think what makes sense, really, is to revert 1.0.0 to disallow the dash, but release a 1.1.0 that requires it. That way, older parsers can say the adhere to v1.0.0, and those that read the spec in the last ten months can say they adhere to v1.1.0. (Though how we let people know such a thing has happened I'm not sure).

<!-- gh-comment-id:9467060 --> @theory commented on GitHub (Oct 16, 2012): No, I like the dash. I wish I had noticed this ten months ago. I think what makes sense, really, is to revert 1.0.0 to disallow the dash, but release a 1.1.0 that requires it. That way, older parsers can say the adhere to v1.0.0, and those that read the spec in the last ten months can say they adhere to v1.1.0. (Though how we let people know such a thing has happened I'm not sure).
Author
Owner

@haacked commented on GitHub (Oct 16, 2012):

Yeah, that is tricky. Hmmm, here's what I'm thinking.

For the sake of discussion, let's distinguish the initial 1.0.0 as ~1.0.0 to avoid confusion. And I'll use 1.0.0 to refer to the current 1.0.0.

As I understand it, some software implemented support for ~1.0.0. But given the amount of time that 1.0.0 has been out, I'd venture to guess much more software has implemented support for 1.0.0.

If we made the change you suggest so that 1.0.0 becomes 1.1.0 and ~1.0.0 becomes 1.0.0, this would "fix" a few parsers but would break nearly every other SemVer parser that claims to parse 1.0.0. They'd have to immediately claim to only support 1.1.0 (and above) and could not claim to support for 1.0.0. That seems like a lot to ask of everybody.

The alternative is to consider ~1.0.0 a bug in the spec that was corrected by 1.0.0. So it's fine for most software to only support 1.0.0. The few pieces of software that supported the ~1.0.0 syntax can continue doing so as an error correction mechanism.

In practice, this is pretty much the same thing as your plan, but with different labels. So other than making this change:

  • 1.0.0 becomes 1.1.0
  • ~1.0.0 becomes 1.0.0

I propose we do this:

  • 1.0.0 stays 1.0.0
  • ~1.0.0 is referred to as 1.0.0-beta

That way, all existing parsers can claim 1.0.0 support. And a select few can claim 1.0.0-beta support as well.

I know it's not pretty, but the only pretty solution would be to get a time machine and prevent this from happening. But if I had a time machine, I'd probably go back and give my younger self a sports almanac and forget to handle this. :)

What do you think?

<!-- gh-comment-id:9467390 --> @haacked commented on GitHub (Oct 16, 2012): Yeah, that _is_ tricky. Hmmm, here's what I'm thinking. For the sake of discussion, let's distinguish the initial `1.0.0` as `~1.0.0` to avoid confusion. And I'll use `1.0.0` to refer to the current `1.0.0`. As I understand it, some software implemented support for `~1.0.0`. But given the amount of time that `1.0.0` has been out, I'd venture to guess much more software has implemented support for `1.0.0`. If we made the change you suggest so that `1.0.0` becomes `1.1.0` and `~1.0.0` becomes `1.0.0`, this would "fix" a few parsers but would break nearly _every_ other SemVer parser that claims to parse `1.0.0`. They'd have to immediately claim to only support `1.1.0` (and above) and could not claim to support for `1.0.0`. That seems like a lot to ask of everybody. The alternative is to consider `~1.0.0` a bug in the spec that was corrected by `1.0.0`. So it's fine for most software to only support `1.0.0`. The few pieces of software that supported the `~1.0.0` syntax can continue doing so as an error correction mechanism. In practice, this is pretty much the same thing as your plan, but with different labels. So other than making this change: - `1.0.0` becomes `1.1.0` - `~1.0.0` becomes `1.0.0` I propose we do this: - `1.0.0` stays `1.0.0` - `~1.0.0` is referred to as `1.0.0-beta` That way, all existing parsers can claim `1.0.0` support. And a select few can claim `1.0.0-beta` support as well. I know it's not pretty, but the only pretty solution would be to get a time machine and prevent this from happening. But if I had a time machine, I'd probably go back and give my younger self a sports almanac and forget to handle this. :) What do you think?
Author
Owner

@theory commented on GitHub (Oct 16, 2012):

I could get on board with that, especially if the 1.0.0-beta you propose (1.0.0beta?) was published somewhere that older parsers could point at it, at least until they can be updated.

<!-- gh-comment-id:9467451 --> @theory commented on GitHub (Oct 16, 2012): I could get on board with that, especially if the 1.0.0-beta you propose (1.0.0beta?) was published somewhere that older parsers could point at it, at least until they can be updated.
Author
Owner

@haacked commented on GitHub (Oct 16, 2012):

Cool! I'll confer with @mojombo to figure out exactly how we should handle it. I assume we'd want to point this version to this commit (a16c419f09), right?

<!-- gh-comment-id:9468843 --> @haacked commented on GitHub (Oct 16, 2012): Cool! I'll confer with @mojombo to figure out exactly how we should handle it. I assume we'd want to point this version to this commit (https://github.com/mojombo/semver.org/commit/a16c419f09b5c5a26320317fcd331264daae16ef), right?
Author
Owner

@theory commented on GitHub (Oct 16, 2012):

Yeah, that looks right to me. Thanks.

<!-- gh-comment-id:9471994 --> @theory commented on GitHub (Oct 16, 2012): Yeah, that looks right to me. Thanks.
Author
Owner

@theory commented on GitHub (Oct 16, 2012):

BTW, thanks @Haacked, for getting back to me so promptly and engaging in a productive discussion. Much appreciated.

<!-- gh-comment-id:9496098 --> @theory commented on GitHub (Oct 16, 2012): BTW, thanks @Haacked, for getting back to me so promptly and engaging in a productive discussion. Much appreciated.
Author
Owner

@haacked commented on GitHub (Dec 6, 2012):

No problem! BTW, I'm still planning to do this. I've just been busy with so much other stuff going on. I haven't forgotten!

<!-- gh-comment-id:11093968 --> @haacked commented on GitHub (Dec 6, 2012): No problem! BTW, I'm still planning to do this. I've just been busy with so much other stuff going on. I haven't forgotten!
Author
Owner

@theory commented on GitHub (Dec 6, 2012):

In the meantime, I've released new versions of semver PostgreSQL extnesion and the SemVer Perl module to support the hyphen, though they both will parse SemVers without the hyphen.

<!-- gh-comment-id:11098182 --> @theory commented on GitHub (Dec 6, 2012): In the meantime, I've released new versions of [semver PostgreSQL extnesion](https://github.com/theory/pg-semver/) and the [SemVer Perl module](https://github.com/theory/semver/) to support the hyphen, though they both will parse SemVers without the hyphen.
Author
Owner

@haacked commented on GitHub (Mar 13, 2013):

Hi @theory I haven't forgotten about this. Just been real busy. BTW, I'm going to close this an open an issue at https://github.com/mojombo/semver.org where this really belongs.

Even better would be if you wouldn't mind submitting a PR of how you think the website should be updated. 😄 That'd make it easier to discuss and update the site.

<!-- gh-comment-id:14854172 --> @haacked commented on GitHub (Mar 13, 2013): Hi @theory I haven't forgotten about this. Just been real busy. BTW, I'm going to close this an open an issue at https://github.com/mojombo/semver.org where this really belongs. Even better would be if you wouldn't mind submitting a PR of how you think the website should be updated. :smile: That'd make it easier to discuss and update the site.
Author
Owner

@haacked commented on GitHub (Mar 13, 2013):

Opened https://github.com/mojombo/semver.org/issues/52 so I can close this.

<!-- gh-comment-id:14854537 --> @haacked commented on GitHub (Mar 13, 2013): Opened https://github.com/mojombo/semver.org/issues/52 so I can close this.
Author
Owner

@theory commented on GitHub (Jun 19, 2013):

Man, so confused. Just trying to get things straight:

  • mojombo/semver.org@a16c419f09, dated March 27, 2011, is the last v1.0.0 change on semver.org (maybe should be tagged v1.0.0-beta1?)
  • 38db63f218, dated June 8, 2011, is tagged v1.0.0-beta1, thanks to #49 (this issue).
  • 05a00df02d, dated June 19, 2011, adds the hyphen between the patch and prerelease versions
  • ec80195ed3, dated September 6, 2011, is tagged v1.0.0
  • b8f12d78c6, dated November 19, 2011, changes the version to v1.0.0-rc~1
  • ec092b73b3, dated November 24, 2011, changes the version to 1.0.0-rc.1, which looks more like the eventual 2.0.0 prerelease version format.
  • mojombo/semver.org@9906c3feba does the same for semver.og on November 26, 2011.
  • 24eda4f61d finally increments the version to 2.0.0-rc.1 on December 7, 2011, noting that 1.0.0 had already been released.
  • mojombo/semver.org@79343bf930 does the same for semver.org on Dec 22, 2011.

I was confused as to why the version was decreased in b8f12d78c6 from v1.0.0 to v1.0.0-rc~1 after the tagged v1.0.0, but 24eda4f61d makes it clear that was a mistake.

So I think all the tags are in the right places. This note is more to spell out where things changed, for my own reference and sanity.

<!-- gh-comment-id:19705479 --> @theory commented on GitHub (Jun 19, 2013): Man, so confused. Just trying to get things straight: - mojombo/semver.org@a16c419f09b5c5a26320317fcd331264daae16ef, dated March 27, 2011, is the last v1.0.0 change on semver.org (maybe should be tagged v1.0.0-beta1?) - 38db63f21848bfce2136977cf67856a31388dab4, dated June 8, 2011, is tagged v1.0.0-beta1, thanks to #49 (this issue). - 05a00df02db3d4ba83e0caaff6b31c10c77f7d3d, dated June 19, 2011, adds the hyphen between the patch and prerelease versions - ec80195ed310aab3ae1f1ce797b7ba88b4246d27, dated September 6, 2011, is tagged v1.0.0 - b8f12d78c680367dcf2a77d98bf9299b61e69b62, dated November 19, 2011, changes the version to v1.0.0-rc~1 - ec092b73b3359e81aeaa1f6ba7b1815885defdb2, dated November 24, 2011, changes the version to 1.0.0-rc.1, which looks more like the eventual 2.0.0 prerelease version format. - mojombo/semver.org@9906c3febaef4a5e4053eeac6c51b82d29a48a06 does the same for semver.og on November 26, 2011. - 24eda4f61d392b069aad317211cdd7389edf7a57 finally increments the version to 2.0.0-rc.1 on December 7, 2011, noting that 1.0.0 had already been released. - mojombo/semver.org@79343bf9304f210f9949de8d4a1fdf0e1662f32c does the same for semver.org on Dec 22, 2011. I was confused as to why the version was decreased in b8f12d78c680367dcf2a77d98bf9299b61e69b62 from v1.0.0 to v1.0.0-rc~1 _after_ the tagged v1.0.0, but 24eda4f61d392b069aad317211cdd7389edf7a57 makes it clear that was a mistake. So I think all the tags are in the right places. This note is more to spell out where things changed, for my own reference and sanity.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/semver#6029