Jenkins Git Plugin: Git Describe Cannot Describe Anything
Solution 1:
Regarding tags (as described in "Git Tip of the Week: Tags")
If no annotated tags are found then it will print
fatal: No names found, cannot describe anything
. To allow describe to use non-annotated tags, run withgit describe --tags
. It’s also possible to get it to describe against a branch usinggit describe --all
, although this only makes sense if the branch is known remotely.
So it is possible that your current repo against which the Git Plugin is doing a simple git describe doesn't contain any annotated tag (which explains why a checkout of a tip of a branch doesn't solve the issue: this isn't about a DETACHED HEAD situation)
You need to clone the repo, including the tags.
Actually, the OP Jasper Van Den Bosch reports:
I wasn't pushing the tags correctly
No tags pushed, means Jenkins doesn't get those tags when updating its own clone, means the git describe
cannot work properly.
Solution 2:
git describe
doesn't work until you have a tag (preferable an annotated tag) in the history before what is currently checked out.
/tmp/repo$ git describe
fatal: No names found, cannot describe anything.
/tmp/repo$ git tag foo
/tmp/repo$ git describe
fatal: No annotated tags can describe'14d827c72b2f277a5cd3e65e7b0e0502edc58fa3'.
However, there were unannotated tags: try --tags./tmp/repo$ git tag -a 'annotated-tag'-m 'whatever'/tmp/repo$ git describe
annotated-tag
Post a Comment for "Jenkins Git Plugin: Git Describe Cannot Describe Anything"