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

Support a Prefix v1.0.0 #644

Open
ChrTall opened this issue May 23, 2022 · 2 comments
Open

Support a Prefix v1.0.0 #644

ChrTall opened this issue May 23, 2022 · 2 comments

Comments

@ChrTall
Copy link

ChrTall commented May 23, 2022

What happened?

The Regex does not allow using a prefix like v1.0.0.

What did you want to happen?

I would like to prefix my releases with v1.0.0 and use 1.0.0 as the version.
Prefixing a release with v + semantic versioning is recommended by Gitlab.
Is there a way to override the regex, or could you consider adding the possibility to use v1.0.0 instead of [email protected] ?

@FeldrinH
Copy link

FeldrinH commented Jul 11, 2023

I would propose even more broadly that having a restriction at all on what the prefix can be is unnecessary. Why restrict how people name their git tags?

EDIT: Looking at the code and tests in this repo it seems the widely used prefix "v" for version tags has been very deliberately forbidden. If anybody knows why then I would be very interested in hearing the reasoning behind this decision.

@johnbatclari
Copy link

FWIW, I'm using this workaround for tags following the pattern name/v0.0.1:

// only populate the version from the git tag if it hasn't been set
if (project.version.toString() == "unspecified") {
    apply(plugin = "com.palantir.git-version")
    val gitVersion: groovy.lang.Closure<String> by extra
    val versionWithV = gitVersion(mapOf("prefix" to "${project.name}/"))
    // strip the leading v from the version
    version = versionWithV.replace("v", "")
}

...but it irks me every time I look at it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants