When we have a tag in local repo the following exception is thrown:
"Unable to find commits until some tag: Did not find any commits until some tag"
Hey, please add more details :)
What commit are you on, how does the commit DAG look like?
1st ping, please add more details :)
No cześć :)
Sorry for the delay.
The message from Maven is like:
ERROR] Failed to execute goal pl.project13.maven:git-commit-id-plugin:2.1.4:revision (default) on project amfa-web: Execution default of goal pl.project13.maven:git-commit-id-plugin:2.1.4:revision failed: Unable to find commits until some tag: Did not find any commits until some tag -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal pl.project13.maven:git-commit-id-plugin:2.1.4:revision (default) on project amfa-web: Execution default of goal pl.project13.maven:git-commit-id-plugin:2.1.4:revision failed: Unable to find commits until some tag
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:225)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default of goal pl.project13.maven:git-commit-id-plugin:2.1.4:revision failed: Unable to find commits until some tag
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:110)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more
Caused by: java.lang.RuntimeException: Unable to find commits until some tag
at pl.project13.jgit.DescribeCommand.findCommitsUntilSomeTag(DescribeCommand.java:430)
at pl.project13.jgit.DescribeCommand.call(DescribeCommand.java:328)
at pl.project13.maven.git.GitCommitIdMojo.putGitDescribe(GitCommitIdMojo.java:418)
at pl.project13.maven.git.GitCommitIdMojo.maybePutGitDescribe(GitCommitIdMojo.java:411)
at pl.project13.maven.git.GitCommitIdMojo.loadGitData(GitCommitIdMojo.java:361)
at pl.project13.maven.git.GitCommitIdMojo.execute(GitCommitIdMojo.java:239)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
... 20 more
Caused by: java.lang.RuntimeException: Did not find any commits until some tag
at pl.project13.jgit.DescribeCommand.findCommitsUntilSomeTag(DescribeCommand.java:428)
... 26 more
I am on a "develop" branch and the problem occurs only when I fetch remote tags locally. If I remove them from local repo everything works fine.
Cześć :-)
Well' I'm more interested in the tree you're working on. A screenshot from gitk (just the tree) or log --tree would help me out here :)

You may find this one interesing. The tree is from about the time when it all started. What we did:
On branch master we prepared two releases with maven release plugin which created the tags and release commits.
The development on the develop branch was maintained parallerly. Maybe the problem is that we didn't merge release plugins into develop branch? I don't know.
That's a good example, thanks a lot :-)
I'm going to speak at jfokus this weed so probably won't be able to work on it, maybe next week though.
Thanks for the graph again! :-)
I am having the same problem. It is worth noting that when I deleted all tags in the local repository the problem went away.
Problem is introduced in version 2.1.0. (Version 2.1.3 en 2.1.4 contains also this problem.)
It is currently impossible to use this maven plugin in a git repo with tags.
For anyone else having problems with this: it is caused by not having a tag in your current branch (hence git describe being unable to describe your commit). The solution is to get at least one tag in your current branch (usually by simply adding a 0.0 or 0.1 tag in your initial commit). As soon as this is added, git describe will work properly, and this maven plugin will do the same.
Thanks for the description of the case guys! I'm currently fully enganged in organising http://geecon.org so the fix may take a bit time still... but I'll get it out there, promissed :)
@ktoso Honestly, I don't think this is a problem with your plugin. Rather, it comes from an error reported by git itself, and, in our cases, the lack of additional tags in the current branch. As soon as I added a tag in my current branch (making at least one tag available), everything worked fine.
The plugin should at least not crash I think - warnings in the logs may be enough here I think :)
I agree the error reporting could be improved, but I'm not sure if you're going to be able to do much, if the underlying git command itself is reporting an error. My 2 cents - I just wanted to make sure everyone else was aware of the workaround. Have fun at geecon & thanks for your plugin.
Thank you! This is a workable workaround.
The error from the git command is:
C:\Data\pangaea-nxg-dvluk.git>git describe
fatal: No annotated tags can describe '68a036d3235629132fd11736b53e3255d3845ed1'
However, there were unannotated tags: try --tags.
So to make the plugin more failsafe, maybe you could add '--tags' to the command?
C:\Data\pangaea-nxg-dvluk.git>git describe --tags
lsnl/lsnl-ROLL_2012-05-15-2267-g68a036d
The question however if this is desired, because you might end up with a very old/unrelated tag.
I'm encountering this issue as well, is this issue actively being worked on?
This will work if you don't mind not including the description output:
<configuration>
<gitDescribe>
<skip>true</skip>
</gitDescribe>
</configuration>
Was this resolved in v2.1.8 via https://github.com/ktoso/maven-git-commit-id-plugin/pull/84 ?
Moving from v2.1.7 to v2.1.8 resolved the same or similar issue for me.
My CI build uses shallow clones for performance reasons and the describe fails. I believe this is a bug in the plugin and it should be fixed. If Git does not provide any describe information then the plugin should, at most, display a warning. It should not make my build fail.
My builds initially got this error too. We added a tag as suggested above and the problem went away for a while. But then the issue came back. We too were using shallow clones. Unchecking the shallow clones in the git repository checkout fixed this issue the second time.
I think the git describe --always is also a good way for a workaround:
<gitDescribe>
<skip>false</skip>
<always>true</always>
</gitDescribe>
Results:
git describe
fatal: No annotated tags can describe '3eaea7d0db414e0f4e3fe8c3840c49cc7ea73b77'
versus:
git describe --always
3eaea7d
Hi, this issue is on the market for quite a long time and I wanted to check if there is any issue unresolved yet ar at least a workaround suggested.
I bumped into this mysqlf, but this is issue can also occour when using the native git binary (see my last comment).
To avoid this we either can use the git describe --always or the failOnUnableToExtractRepoInfoswitch.
So I'm not sure if this resolves everybodys issue or if there is still a bug inside the git-commit-id plugin.
Thanks,
I have the same problem with version 2.1.9:
[ERROR] Failed to execute goal pl.project13.maven:git-commit-id-plugin:2.1.5:revision (default) on project xss-taglib: Execution default of goal pl.project13.maven:git-commit-id-plugin:2.1.5:revision failed: Unable to find commits until some tag: Did not find any commits until some tag -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal pl.project13.maven:git-commit-id-plugin:2.1.5:revision (default) on project xss-taglib: Execution default of goal pl.project13.maven:git-commit-id-plugin:2.1.5:revision failed: Unable to find commits until some tag
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:224)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:862)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:197)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default of goal pl.project13.maven:git-commit-id-plugin:2.1.5:revision failed: Unable to find commits until some tag
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:145)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 20 more
Caused by: java.lang.RuntimeException: Unable to find commits until some tag
at pl.project13.jgit.DescribeCommand.findCommitsUntilSomeTag(DescribeCommand.java:430)
at pl.project13.jgit.DescribeCommand.call(DescribeCommand.java:328)
at pl.project13.maven.git.GitCommitIdMojo.putGitDescribe(GitCommitIdMojo.java:456)
at pl.project13.maven.git.GitCommitIdMojo.maybePutGitDescribe(GitCommitIdMojo.java:449)
at pl.project13.maven.git.GitCommitIdMojo.loadGitData(GitCommitIdMojo.java:395)
at pl.project13.maven.git.GitCommitIdMojo.execute(GitCommitIdMojo.java:269)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
... 21 more
Caused by: java.lang.RuntimeException: Did not find any commits until some tag
at pl.project13.jgit.DescribeCommand.findCommitsUntilSomeTag(DescribeCommand.java:428)
UPD: Strange.. I can't build project in terminal with bash, but it is possible to do it in Intellij IDEA (maybe it's my local problem).
Hi @vbauer could you post your configuration of the plugin?
Does the suggested workarounds do not help here?
Thanks,
Configuration of the plugin:
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
<version>${git-commit-id-plugin.version}</version>
<executions>
<execution>
<goals>
<goal>revision</goal>
</goals>
</execution>
</executions>
<configuration>
<prefix>git</prefix>
<verbose>true</verbose>
<dateFormat>yyyy-MM-dd-HH-mm-ss</dateFormat>
</configuration>
</plugin>
I haven't tried to use workaround, just wanted to provide some additional information. For now, I can build project in Intellij IDEA (instead of console) and it is fine for me.
This is not vbauer's email.
Sent from my Verizon Wireless 4G LTE smartphone
-------- Original message --------
From: TheSnoozer [email protected]
Date: 11/22/2015 2:26 PM (GMT-08:00)
To: ktoso/maven-git-commit-id-plugin [email protected]
Cc: mdern [email protected]
Subject: Re: [maven-git-commit-id-plugin] Error when some tag in local repo:
"Unable to find commits until some tag: Did not find any commits until some
tag" (#61)
Hi @vbauer could you post your configuration of the plugin?
Does the suggested workarounds do not help here?
Thanks,
—
Reply to this email directly or view it on GitHub.
I've just tried to use version 2.2.0 and it works fine (sorry, I haven't seen it before).
Thanks for the feedback :-)
I'll close this finally since it seems to work fine and there are multiple workarounds available :-)
@mdern, Everybody will receive an eMail who subscribed to this issue :-)
I've tried version 2.2.2 and in my in my case JGit is not able to honor git describe --always command.
I solved the issue by turning on the native git support feature:
<useNativeGit>true</useNativeGit>
Please do open a new issue for this and paste in a full config of your plugin.
Also it would help if you include what you expect and what you get....
Most helpful comment
My CI build uses shallow clones for performance reasons and the describe fails. I believe this is a bug in the plugin and it should be fixed. If Git does not provide any describe information then the plugin should, at most, display a warning. It should not make my build fail.