maven-git-versioning-extension icon indicating copy to clipboard operation
maven-git-versioning-extension copied to clipboard

Add an option to not have full depth when no tag matches the expression and config to limit the depth

Open mrozanc opened this issue 1 year ago • 1 comments
trafficstars

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.

mrozanc avatar Sep 22 '24 01:09 mrozanc

Added a fix for distance as it seemed incorrect for scenarios walking through many parents:

image Test here: https://github.com/mrozanc/maven-git-versioning-extension/blob/4731084a84cd288df698b14c704b7e08f7cf1cb7/src/test/java/me/qoomon/gitversioning/commons/GitUtilTest.java#L239-L277

mrozanc avatar Sep 22 '24 16:09 mrozanc