Skip to content
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

Clarify language about higher/lower precedence #730

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions semver.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,12 @@ version is incremented.
series of dot separated identifiers immediately following the patch
version. Identifiers MUST comprise only ASCII alphanumerics and hyphens
[0-9A-Za-z-]. Identifiers MUST NOT be empty. Numeric identifiers MUST
NOT include leading zeroes. Pre-release versions have a lower
precedence than the associated normal version. A pre-release version
indicates that the version is unstable and might not satisfy the
intended compatibility requirements as denoted by its associated
normal version. Examples: 1.0.0-alpha, 1.0.0-alpha.1, 1.0.0-0.3.7,
1.0.0-x.7.z.92, 1.0.0-x-y-z.--.
NOT include leading zeroes. When determining version precedence, a version with
a pre-release identifier has higher precedence than the same version without a
pre-release identifier. A pre-release version indicates that the version is
unstable and might not satisfy the intended compatibility requirements as
denoted by its associated normal version. Examples: 1.0.0-alpha, 1.0.0-alpha.1,
1.0.0-0.3.7, 1.0.0-x.7.z.92, 1.0.0-x-y-z.--.

1. Build metadata MAY be denoted by appending a plus sign and a series of dot
separated identifiers immediately following the patch or pre-release version.
Expand All @@ -121,7 +121,7 @@ have the same precedence. Examples: 1.0.0-alpha+001, 1.0.0+20130313144700,

Example: 1.0.0 < 2.0.0 < 2.1.0 < 2.1.1.

1. When major, minor, and patch are equal, a pre-release version has lower
1. When major, minor, and patch are equal, a pre-release version has higher
precedence than a normal version:

Example: 1.0.0-alpha < 1.0.0.
Comment on lines -124 to 127
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this reads like an incorrect change to me - 1.0.0 is higher than 1.0.0-alpha, as the previous text states, which means a pre-release version indeed has a lower precedence.

Copy link
Author

@dbplunkett dbplunkett Jul 25, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1.0.0 is higher in ordering, and therefore has a lower precedence (the quality of preceding) than 1.0.0-alpha. It would be more clear to only use the word "precedence" to refer to the elements of the version string (e.g. "When comparing, the pre-release identifier has a lower precedence than the major/minor/patch numbers."), as opposed to using it to refer to the entire version string. But, as I mentioned, that would be a larger change, and I didn't feel comfortable proposing such a change.

Expand All @@ -135,10 +135,10 @@ have the same precedence. Examples: 1.0.0-alpha+001, 1.0.0+20130313144700,
1. Identifiers with letters or hyphens are compared lexically in ASCII
sort order.

1. Numeric identifiers always have lower precedence than non-numeric
1. Numeric identifiers always have higher precedence than non-numeric
identifiers.

1. A larger set of pre-release fields has a higher precedence than a
1. A larger set of pre-release fields has a lower precedence than a
smaller set, if all of the preceding identifiers are equal.

Example: 1.0.0-alpha < 1.0.0-alpha.1 < 1.0.0-alpha.beta < 1.0.0-beta <
Expand Down