[GH-ISSUE #368] Comparing semver to non-semver #1141

Closed
opened 2026-04-16 10:24:20 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @SteveL-MSFT on GitHub (May 5, 2017).
Original GitHub issue: https://github.com/semver/semver/issues/368

We've converted to using semver in http://github.com/powershell/powershell, however, for compatibility reasons we have situations where we have to compare our semver against a non-conforming version. For example, check if 6.0.0 is greater than 3.0 as older tools built on older versions of PowerShell only expect major.minor. To do this comarison, we would like to convert 3.0 to 3.0.0 where we assume the patch version is 0. Is this acceptable from a semver standpoint where we moved from major.minor to semver?

Originally created by @SteveL-MSFT on GitHub (May 5, 2017). Original GitHub issue: https://github.com/semver/semver/issues/368 We've converted to using semver in http://github.com/powershell/powershell, however, for compatibility reasons we have situations where we have to compare our semver against a non-conforming version. For example, check if 6.0.0 is greater than 3.0 as older tools built on older versions of PowerShell only expect major.minor. To do this comarison, we would like to convert 3.0 to 3.0.0 where we assume the patch version is 0. Is this acceptable from a semver standpoint where we moved from major.minor to semver?
Author
Owner

@haacked commented on GitHub (May 5, 2017):

Yes.

Semver itself doesn't have anything g to say about this.
But the general idea is you want to translate non-semver versions to Semver and a reasonable approach is that the non-specified versions would be 0. This is an implementation detail of your specific platform. All semver tells you is how to compare versions after you've done the translation.

<!-- gh-comment-id:299350151 --> @haacked commented on GitHub (May 5, 2017): Yes. Semver itself doesn't have anything g to say about this. But the general idea is you want to translate non-semver versions to Semver and a reasonable approach is that the non-specified versions would be 0. This is an implementation detail of your specific platform. All semver tells you is how to compare versions after you've done the translation.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/semver#1141