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

Allow tag and base version customization, flex matching #129

Merged
merged 1 commit into from
Sep 24, 2020
Merged

Conversation

kzu
Copy link
Member

@kzu kzu commented Sep 24, 2020

Fixes #100, brings #72 in.

It didn't make a lot of sense to require the entire branch or tag to be semver2, from beginning to end. It's usually the case that branches are named like rel/vX.Y.Z, for example, and we were forcing such common naming conventions to customize GitInfo unnecessarily.

So to make it more flexible and powerful, we add two things with this commit:

  1. We no longer enfore version to match from beginning of string (^ removed from default regex). We still require the version to be the last part. However, if that still doesn't match the desired behavior, users can now override the default expression by just setting GitBaseVersionRegex which is now "public" and documented.

  2. We also allow the filter for tags to be specified, so that "weird" tags aren't considered for matching, and can easily be filtered out by providing, for example, a rel/v* expression for GitTagRegex).

Fixes #100, brings #72 in.

It didn't make a lot of sense to require the entire branch or tag to be semver2, from beginning to end. It's usually the case that branches are named like `rel/vX.Y.Z`, for example, and we were forcing such common naming conventions to customize GitInfo unnecessarily.

So to make it more flexible and powerful, we add two things with this commit:

1. We no longer enfore version to match from beginning of string (`^` removed from default regex). We still require the version to be the last part. However, if that still doesn't match the desired behavior, users can now override the default expression by just setting `GitBaseVersionRegex` which is now "public" and documented.

2. We also allow the filter for tags to be specified, so that "weird" tags aren't considered for matching, and can easily be filtered out by providing, for example, a `rel/v*` expression for `GitTagRegex)`.

Bump to 2.1 since it might be breaking for some consumers.
@kzu kzu merged commit ecbb6a0 into master Sep 24, 2020
@kzu kzu deleted the flex-regexes branch September 24, 2020 19:48
@devlooped devlooped locked and limited conversation to collaborators Sep 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Only consider version tags
1 participant