-
Notifications
You must be signed in to change notification settings - Fork 59
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
Allow release versions such as v1.2.3
and release-1.2.3
(as well as other patterns recognized by composer)
#37
Comments
Should this be something that is dealt with in nikolaposa/version? |
@ntzm yeah |
I opened an issue here: nikolaposa/version#12, looks like it won't be until 3.0 that it's considered |
This is pretty important, AFAIK |
Talked with @nikolaposa in person about this, and it will likely happen when he has time and willpower (PHP Serbia aftermath first) |
Support for btw Are there any other prefixes besides |
Maybe @alcohol can answer that |
I mean, if I'm going to introduce that change, I would like it to be something that is not only Composer-specific, but more general, hence the question. |
Composer does not strictly follow semver formatting. If you look at /~https://github.com/composer/semver (specifically, the tests) you'll see it is very similar but there are a few deviations for legacy reasons. I think the |
Version parsing was relaxed to supports both |
Still need a way to get the symbol name back though, as otherwise we cannot really run a |
Got it. Can you refer me to some relevant places in code base so I can become more familiar with entire flow and how/whether |
I think |
This is where we need to preserve the original tag name: /~https://github.com/Roave/BackwardCompatibilityCheck/blob/master/src/Command/AssertBackwardsCompatible.php#L229 |
Oh, I see the problem now. Versions retrieved from the repository are successfully parsed but their initial form is lost, so casting them back to string yields undesired result. I'll see what I can do. 🤔 But everything suggests that I'll have to relax my strict adherence to semver.org and the idea that prefix is not part of the version number. Encapsulating that behaviour in a new object as I suggested here would make |
It would also break (pseudo-code) I also noticed an edge case: we could have duplicate versions (already happened in doctrine) due to |
Something like this: nikolaposa/version@87ab652 could definitely solve the part with constructing and casting Version from/to string. But comparison problem would still remain as the |
Seems about right |
I'm not a huge fan of the idea of That way I could avoid making some serious BC breaks, as |
I was thinking about
If it's not equal, is it higher, is it lower? You can't really tell, because prefix does not carry any semantical meaning, unlike pre-release or build extensions for example that are compared lexically in ASCII sort order. |
They are equal, but don't have the same state, hence == doesn't work
…On Sat, Dec 28, 2019, 23:29 Nikola Poša ***@***.***> wrote:
I was thinking about v1.2.3 == 1.2.3 scenario. While it might be true
that those are not the same versions, I have no idea what reasoning is
valid in the case of other comparisons:
$v1 = Version::fromString('v1.2.3');
$v2 = Version::fromString('release-1.2.3');
var_dump($v1->isEqualTo($v2)); //false
var_dump($v1->isGreaterThan($v2)); //???
var_dump($v1->isLessThan($v2)); //???
If it's not equal, is it higher, is it lower? You can't really tell,
because prefix does not carry any semantical meaning, unlike pre-release or
build extensions for example that are compared lexically in ASCII sort
order.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#37?email_source=notifications&email_token=AABFVEHO6KEENUWNCYLRJRLQ27HLLA5CNFSM4E2WQWWKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHYTKTY#issuecomment-569455951>,
or unsubscribe
</~https://github.com/notifications/unsubscribe-auth/AABFVEDXNCEKGDQ5EGNWATDQ27HLLANCNFSM4E2WQWWA>
.
|
Ref: #35 (comment)
The text was updated successfully, but these errors were encountered: