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

Error when some tag in local repo: "Unable to find commits until some tag: Did not find any commits until some tag" #61

Closed
abnuk opened this issue Jan 17, 2013 · 32 comments · Fixed by #290

Comments

@abnuk
Copy link

abnuk commented Jan 17, 2013

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"

@ktoso
Copy link
Collaborator

ktoso commented Jan 24, 2013

Hey, please add more details :)
What commit are you on, how does the commit DAG look like?

@ktoso
Copy link
Collaborator

ktoso commented Jan 31, 2013

1st ping, please add more details :)

@ghost ghost assigned ktoso Jan 31, 2013
@abnuk
Copy link
Author

abnuk commented Feb 1, 2013

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.

@ktoso
Copy link
Collaborator

ktoso commented Feb 1, 2013

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 :)

@ktoso ktoso closed this as completed Feb 1, 2013
@ktoso ktoso reopened this Feb 1, 2013
@abnuk
Copy link
Author

abnuk commented Feb 1, 2013

scr
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.

@ktoso
Copy link
Collaborator

ktoso commented Feb 2, 2013

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! :-)

@stevenschlansker
Copy link

I am having the same problem. It is worth noting that when I deleted all tags in the local repository the problem went away.

@vanSabben
Copy link

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.

@pluppens
Copy link

pluppens commented May 7, 2013

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.

@ktoso
Copy link
Collaborator

ktoso commented May 7, 2013

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 :)

@pluppens
Copy link

pluppens commented May 7, 2013

@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.

@ktoso
Copy link
Collaborator

ktoso commented May 7, 2013

The plugin should at least not crash I think - warnings in the logs may be enough here I think :)

@pluppens
Copy link

pluppens commented May 7, 2013

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.

@vanSabben
Copy link

Thank you! This is a workable workaround.

@valentijnscholten
Copy link

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.

@jkolash
Copy link

jkolash commented Aug 26, 2013

I'm encountering this issue as well, is this issue actively being worked on?

@philwebb
Copy link

philwebb commented Nov 7, 2013

This will work if you don't mind not including the description output:

<configuration>
    <gitDescribe>
        <skip>true</skip>
    </gitDescribe>
</configuration>

@ggriffin
Copy link

Was this resolved in v2.1.8 via #84 ?
Moving from v2.1.7 to v2.1.8 resolved the same or similar issue for me.

@juan-palacios
Copy link

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.

@mdern
Copy link

mdern commented Dec 23, 2014

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.

@TheSnoozer
Copy link
Collaborator

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

@TheSnoozer
Copy link
Collaborator

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,

sijie pushed a commit to twitter-archive/bookkeeper that referenced this issue May 20, 2015
heuermh added a commit to bigdatagenomics/adam that referenced this issue Aug 27, 2015
@vbauer
Copy link

vbauer commented Nov 22, 2015

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).

@TheSnoozer
Copy link
Collaborator

Hi @vbauer could you post your configuration of the plugin?
Does the suggested workarounds do not help here?

Thanks,

@vbauer
Copy link

vbauer commented Nov 23, 2015

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.

@mdern
Copy link

mdern commented Nov 23, 2015

This is not vbauer's email.

Sent from my Verizon Wireless 4G LTE smartphone

-------- Original message --------
From: TheSnoozer notifications@github.com
Date: 11/22/2015 2:26 PM (GMT-08:00)
To: ktoso/maven-git-commit-id-plugin maven-git-commit-id-plugin@noreply.github.com
Cc: mdern mdern@yahoo.com
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.

@vbauer
Copy link

vbauer commented Nov 23, 2015

I've just tried to use version 2.2.0 and it works fine (sorry, I haven't seen it before).

@TheSnoozer
Copy link
Collaborator

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 :-)

@gaetanlebrun
Copy link

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>

@TheSnoozer
Copy link
Collaborator

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....

@ggb667
Copy link

ggb667 commented Feb 24, 2023

git tag -l | xargs git tag -d
Will delete the tags and fix the problem.

@TheSnoozer
Copy link
Collaborator

I don't think deleting tags in your repository is the "fix". It's likely either a problem or a problem with what you ask from git, or potentially even still a problem in the plugin.

As outlined above -- totential ways of avoiding the issue

  1. use the native git implementation
<useNativeGit>true</useNativeGit>
  1. always describe:
<gitDescribe>
    <skip>false</skip>
    <always>true</always>
</gitDescribe>

if that doesn't solve it please open a new ticket ideally with a repository where this issue can be reproduced.

rschlussel added a commit to rschlussel/airbase that referenced this issue Apr 17, 2024
This fixes an issue with git describe when the repo has no tags. Build
could fail with the error "Unable to find commits until some tag".

see: git-commit-id/git-commit-id-maven-plugin#61
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet