sbt / sbt/sbt-git

sbt-git v2.0.1: version number from "git describe" is not correct

Open
#237 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Scala
Stars
355
Forks
104
Avg merge
1d 4h
Merged PRs (30d)
4

Description

We have a Play application that has been using sbt-git for a pretty long time. We are using this configuration:

ThisBuild / git.baseVersion := "0.0.0"
ThisBuild / git.useGitDescribe := true

With plugin v1.0.0, this has generated the expected version output for years (e.g. 2.4.5-35-gef0caf4-SNAPSHOT or similar).

After updating to v2.0.1, I found that the version number was no longer populated as expected. Instead, I would always get something like this:

0.0.0-a7b866ec1300a9c63a2a27a26938f34fdcdcb391-SNAPSHOT

It appears that the version number itself is not being populated at all, and the full commit identifier is used. It does not follow the format from "git describe" at all.

For the time being, I am instead using v2.0.0, which works as expected. I'm unsure if this is a bug, or if v2.0.1 requires additional configuration?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the reported output using sbt-git v2.0.1 with git.baseVersion set to 0.0.0 and git.useGitDescribe enabled, then compare the behavior with v2.0.0. Trace how the plugin handles git describe and verify that the resulting version follows the git describe format rather than using the full commit identifier.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, scala
Domain
build-system, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.