-
Notifications
You must be signed in to change notification settings - Fork 85
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
Add an option to not have full depth when no tag matches the expression and config to limit the depth #336
base: master
Are you sure you want to change the base?
Conversation
In case we have a more specific tag pattern to search on a branch, and this pattern does not match any tag in the branch, it's preferable to have a limit to the describe search for performance reasons.
fbdf016
to
b9bd821
Compare
As the implementation was a counter, when visiting many parents without resetting the counter, the returned distance was not correct. Using the DepthWalk.RevWalk has two benefits: - it can limit the depths - it allows accessing the depth of the current commit instead of trying to do it with custom code
Added a fix for distance as it seemed incorrect for scenarios walking through many parents:
|
- Tags at same depth: no logic implemented to specify which one is selected, so I put one more commit in the test to have different depths. - Version from label=0 plus distance=0 (single commit, no tag), not sure why the test was expecting "1" as a version.
@@ -93,6 +93,10 @@ You can configure the version and properties adjustments for specific branches a | |||
- has to be a **full match pattern** e.g. `v(.+)`, default is `.*` | |||
- `<describeTagFirstParent>` Enable(`true`) or disable(`false`) following only the first parent in a merge commit | |||
- default is `true` | |||
- `<describeTagMaxDepth>` An integer that describes the maximum number of commits to scan in search of a tag matching |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This description is no longer accurate I need to fix it: it's the max distance with the ref commit and not a number of commits.
Hello, I'm very interested by your extension and I like the way we can configure it, however I see some use cases I'd need to resolve, so I propose a few pull requests with feature I could use for my pipelines.
This first one is to get the describe distance only if a matching tag was found. This way if I don't have a matching tag I have a 0 value I can work with to start a new version.
This is implemented by checking if the tag was found and proposing an additional distance value called
distanceOrZero
.This is the 1st feature of 3 I need in a scenario where I want to set my RC versions on a release branch. The goal is to have a specific that acts as a marker at the start of the release branch and to use that as an expression to start incrementing RCs.