-
Notifications
You must be signed in to change notification settings - Fork 343
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cargo: Change prerelease versions to end in ".1-pre" instead of ".0" #2258
base: main
Are you sure you want to change the base?
Conversation
So, the prerelease version is "0.9.1-pre" instead of "0.9.0". The main goal is to make it easier to tell from "jj version" output whether it describes a released version or a prerelease. According to https://semver.org/#spec-item-9, if taken as a semver, this would be ordered after "v0.9.0" and before "v0.9.1" (if we need to have a patch release). If "v0.9.1" was released, we could move on to "v0.9.2-pre". Cargo docs imply that they follow this spec closely: https://doc.rust-lang.org/cargo/reference/resolver.html#semver-compatibility ### Weirder consequences "v0.9.1-pre.1" would follow "v0.9.1-pre" if we wanted to publish two such versions to crate.io for some reason (I don't suggest we do this). In theory, these are sorted alphabetically, so `v0.9.1-beta < v0.9.1-pre < v0.9.1-rc1`. This is confusing, so we should never have `.1-alpha` or `.1-beta` (nor probably `.1-rc1`) versions. I propose that if we ever have alpha or beta versions, they should always be `.0` versions.
In the end, with #2034, I am thinking of making
The part after One could also argue for |
If we made released versions not include the hash, would that be sufficient? |
I think having a "-pre" in there makes it clearer that it's a prerelease, regardless of whether there's a commit hash next to it. Less importantly, we'd also then need to have some other way to say "there should be a hash here, but we couldn't figure out what it should be". I thought this was a cute idea, but I don't think it's terribly important if you don't like it. |
I think what I don't like about it is that we need to bump the version twice for each release (from 0.x.y-pre to 0.x.y and then to 0.x.(y+1)-pre, IIUC). That sounds like Apache Maven's SNAPSHOT versions, btw (not sure if Maven is still in use). So it's just a little bit of extra work when we cut a release.
Yes, and I also think not having "-pre" or a hash makes it clearer that it's a released version. So if you agree, we can start by removing the hash for released versions. |
I can't think of a good way to do that without also bumping the version twice for each release. If that's too tedious, perhaps both the "-pre" and the hash removal for releases should wait until we have better release automation. I don't think this is at all urgent. The alternative I thought about would be to make something like To solve that problem, we'd need to put the information about whether something is a release or a prerelease into the Finally, we could ignore that problem and have Do you have a better idea? I could look into whether there's a way for |
I was thinking we could make |
It's an interesting idea. This reminded me to file #2295 that I recently ran into. I'm not sure whether it's critical to fix that before using tags for choosing how to print I also just realized binaries built with
Yeah, it'd be a bit of a mess I'm afraid. |
So, the prerelease version is "0.9.1-pre" instead of "0.9.0".
The main goal is to make it easier to tell from "jj version" output whether it
describes a released version or a prerelease.
According to https://semver.org/#spec-item-9, if taken as a semver, this would
be ordered after "v0.9.0" and before "v0.9.1" (if we need to have a patch
release). If "v0.9.1" was released, we could move on to "v0.9.2-pre".
Cargo docs imply that they follow this spec closely:
https://doc.rust-lang.org/cargo/reference/resolver.html#semver-compatibility
Weirder consequences
"v0.9.1-pre.1" would follow "v0.9.1-pre" if we wanted to publish two
such versions to crate.io for some reason (I don't suggest we do this).
In theory, these are sorted alphabetically, so
v0.9.1-beta < v0.9.1-pre < v0.9.1-rc1
.This is confusing, so we should never have
.1-alpha
or.1-beta
(nor probably
.1-rc1
) versions. I propose that if we ever have alpha or betaversions, they should always be
.0
versions.Checklist
If applicable:
CHANGELOG.md