sbt / sbt/sbt-git

Is it possible to use `git.useGitDescribe` with parameters?

Open
#155 0 comments 3 reactions 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

I would like to omit the distance and sha from the version number and just use SNAPSHOT when distance exists.

This is possible with git

$ git describe --abbrev=0
0.6.0
$ git describe
0.6.0-2-gcb7e6ae

--abbrev=0 also nicely handles the case where the version tag might contain some prerelease suffix
e.g.

$ git describe --abbrev=0
0.6.0-rc2
$ git describe
0.6.0-rc2-2-gcb7e6ae

I can use a custom git.gitTagToVersionNumber and manipulate the version but this is tricky if tags follow semver and are checked vs this regex https://regex101.com/r/gG8cK7/1

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

Start by tracing the git.useGitDescribe setting and the git.gitTagToVersionNumber customization described in the issue. Check how git describe output is currently converted to a version, then verify that parameterized describe behavior preserves prerelease tags and produces SNAPSHOT when a distance exists.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.