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

Recognize hashes if they are preceded by . or _ #3260

Merged
merged 2 commits into from
Jan 6, 2024

Conversation

fthomas
Copy link
Member

@fthomas fthomas commented Jan 5, 2024

This allows hashes to also be separated with a . and _ from the preceding component.

Here is for example what Version.Component.parse("1.0.0+1320.38b57aa") returned before this change and what it returns now:

before:
Numeric(1), Separator(.), Numeric(0), Separator(.), Numeric(0), Separator(+),
Numeric(1320), Separator(.), Numeric(38), Alpha(b), Numeric(57), Alpha(aa)

now:
Numeric(1), Separator(.), Numeric(0), Separator(.), Numeric(0), Separator(+),
Numeric(1320), Separator(.), Hash(38b57aa))

Recognizing hashes was added in #1549 but that PR gives no explanation why they only could preceded by - and +.

Closes #3124

This allows hashes to also be separated with a `.` and `_` from the
preceding component.

Here is for example what `Version.Component.parse("1.0.0+1320.38b57aa")`
returned before this change and what it returns now:
```
before:
Numeric(1), Separator(.), Numeric(0), Separator(.), Numeric(0), Separator(+),
Numeric(1320), Separator(.), Numeric(38), Alpha(b), Numeric(57), Alpha(aa)

now:
Numeric(1), Separator(.), Numeric(0), Separator(.), Numeric(0), Separator(+),
Numeric(1320), Separator(.), Hash(38b57aa))
```

Btw, recognizing hashes was added in #1549 but that PR gives no
explanation why they only could preceded by `-` and `+`.

Closes #3124
@fthomas fthomas added the bug Something isn't working label Jan 5, 2024
@fthomas fthomas added this to the 0.29.0 milestone Jan 5, 2024
Copy link

codecov bot commented Jan 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (5ee9474) 91.19% compared to head (c4cc5ab) 91.18%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3260      +/-   ##
==========================================
- Coverage   91.19%   91.18%   -0.01%     
==========================================
  Files         167      167              
  Lines        3406     3405       -1     
  Branches      316      306      -10     
==========================================
- Hits         3106     3105       -1     
  Misses        300      300              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@mzuehlke mzuehlke left a comment

Choose a reason for hiding this comment

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

LGTM

@fthomas fthomas changed the title Recognize hashes if they are separated with . and _ Recognize hashes if they are preceded by . or _ Jan 6, 2024
@fthomas fthomas merged commit 600d2a3 into main Jan 6, 2024
@fthomas fthomas deleted the topic/detect-more-hashes branch January 6, 2024 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cat:version-selection
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Version.Component.parse parses githash as separate components
3 participants