I am using the Git Plugin of Jenkins ans use Douglas Creager’s get_git_version script. This uses git describe to get some sensible version for python modules. Usually this creates something like 0.1-11-g80fe130, but on jenkins I get:
+ git describe
fatal: No names found, cannot describe anything.
I have configured the plugin not to come up with its own tags through ‘skip internal tags’.
Doing an extra checkout of the master branch like in this question about pushing from jenkins doesn’t help.
Regarding tags (as described in “Git Tip of the Week: Tags“)
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:
No tags pushed, means Jenkins doesn’t get those tags when updating its own clone, means the
git describecannot work properly.