gradle-git-version icon indicating copy to clipboard operation
gradle-git-version copied to clipboard

submodule support

Open gintautassulskus opened this issue 7 years ago • 2 comments

At the moment, versionDetails() fails when run against a submodule:

org.eclipse.jgit.api.errors.RefNotFoundException: Ref HEAD can not be resolved

Caused by: java.lang.NullPointerException
        at com.palantir.gradle.gitversion.VersionDetails.descriptionIsPlainTag(VersionDetails.java:81)
        at com.palantir.gradle.gitversion.VersionDetails.getLastTag(VersionDetails.java:94)
        at build_7orv6hikjrwy1ujlilpcudjcn.run(<path_to_submodule...>/build.gradle:13)
        at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:90)
        ... 102 more

To remarks: First, VersionDetails.descriptionIsPlainTag():81 should check if null is not coming from description(). The null return value can occur if the repository is empty.

Second, if I am not mistaken, JGit handles submodules differently from git repositories.

gintautassulskus avatar Nov 05 '18 11:11 gintautassulskus

Would love to see this fixed.

damccull avatar Feb 08 '22 18:02 damccull

Would love to see this fixed.

It is already fixed in #500 but Palantir refuses to process the PR in any way. I have a feeling that they need this bug for one of their backdoors.

Also, we should probably not trust a spyware manufacturer with providing build tools...

ilka-schulz avatar Feb 09 '22 15:02 ilka-schulz