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

index is out of range 0..-1 error when git tags do not have count and hash #27

Open
rigdent opened this issue Sep 9, 2022 · 2 comments

Comments

@rigdent
Copy link

rigdent commented Sep 9, 2022

Hello,

I'm getting the following error on version 3.0.0

Caused by: java.lang.IndexOutOfBoundsException: index is out of range 0..-1 (index = 0)
        at com.cinnober.gradle.semver_git.SemverGitPlugin.getGitVersion(SemverGitPlugin.groovy:48)

on my repo because my git tag looks like

➜  ✗ git describe --tags --dirty --abbrev=7
v1.1.0

So there's no count or hash, so the regex match doesn't yield any results for count and hash.
What's the best course of action? This was on a RHEL 7 box.

Also, parseVersion also fails for v-prefixed versions like above. Is that intentional? Are tags without the v prefix recommended?

Thanks

@deepy
Copy link
Member

deepy commented Sep 9, 2022

The latest version of master contains support for v-prefix versions but as I've changed jobs I don't have the ability to push a new release to the plugin portal

If you got some way of reproducing the index is out of range issue then I think it's a fairly easy fix

@TalissonBento
Copy link

happened with me also, has someone solved that?

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