Giter Site home page Giter Site logo

Comments (1)

ashleymercer avatar ashleymercer commented on June 21, 2024 1

I think the fix is actually straightforward: make an extra call to list tags at the same commit, and perform some semver-sorting on them and pick the latest one. So we'd do something like:

> git describe --long --tags --abbrev=8 --match $TagPattern --always --dirty=+${timestamp(d)}
0.1

> git tag --list --points-at 0.1
0.1
0.2

We can now infer that the "correct" tag is 0.2, but use the commit distance and hash info from the original git describe (by definition this is still valid, since we only search for other tags which point to the same commit).

I think this covers all use cases:

  • for the above case (HEAD and multiple tags on the same commit) it works
  • if HEAD is ahead of the latest tag(s) it should still work - sbt-dynver will produce something like 0.2+1...
 x <- HEAD
 |
 x <- 0.1, 0.2
 |
 o
  • it should (I think) also work transparently with any mixture of annotated and lightweight tags, since again in each case we only consider a single commit (points-at) and pick the "highest" one

If you're happy with this, I'm happy to have a go at putting a PR together?

from sbt-dynver.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.