-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Enable lenient parsing of Git version tags #3649
Enable lenient parsing of Git version tags #3649
Conversation
@swift-ci please smoke test |
Thanks, @colincornaby! Would you mind also adding a note to the |
f194df2
to
841d40a
Compare
I added a note to the changelog and squashed it into the existing commit. Let me know if you have any feedback or edits! |
- Git version tags will now be parsed leniently, allowing for tags like 2.0 to be treated equivelently to 2.0.0. - Previous behavior was that a tag without a v-prefix would be preferred over one with a v-prefix. This behavior was maintained. - A tag with more version components is preferred. 2.0.0 will be preferred over 2.0. Enable lenient parsing of Git version tags - Git version tags will now be parsed leniently, allowing for tags like 2.0 to be treated equivelently to 2.0.0. - Previous behavior was that a tag without a v-prefix would be preferred over one with a v-prefix. This behavior was maintained. - A tag with more version components is preferred. 2.0.0 will be preferred over 2.0. Enable lenient parsing of Git version tags - Git version tags will now be parsed leniently, allowing for tags like 2.0 to be treated equivelently to 2.0.0. - Previous behavior was that a tag without a v-prefix would be preferred over one with a v-prefix. This behavior was maintained. - A tag with more version components is preferred. 2.0.0 will be preferred over 2.0. Enable lenient parsing of Git version tags - Git version tags will now be parsed leniently, allowing for tags like 2.0 to be treated equivelently to 2.0.0. - Previous behavior was that a tag without a v-prefix would be preferred over one with a v-prefix. This behavior was maintained. - A tag with more version components is preferred. 2.0.0 will be preferred over 2.0.
841d40a
to
aada8a7
Compare
@swift-ci please smoke test |
Thanks; looks great to me! |
Thanks everyone! |
thank you @colincornaby <3 |
Motivation:
While implementing SPM manifests in existing Git repos, I found many were using two component tags where the patch version was 0. The intention behind this change is to better support that Git tagging pattern without retraining existing teams, or causing SPM integration to be disruptive to existing tagging practices.
Modifications:
Lenient parsing was added to swift-tools-support-core at swiftlang/swift-tools-support-core#212. The tag based initializer for Version was altered to use this new lenient initializer.
It’s possible for two tags with the same meaning but different literal strings to be present in the same repository. This case did exist previously. Tags like v2.0.0 and 2.0.0 could conflict, and a decision about which tag to use would be required.
Result:
Git tags with two version components will now be supported and parsed as if there was a patch version of .0 appended to the end.