Giter Site home page Giter Site logo

Comments (8)

olafurpg avatar olafurpg commented on May 22, 2024 3

Yes, I'll be there! Sounds like a good bugfix for the SC Spree 😄

from sbt-dynver.

dwijnand avatar dwijnand commented on May 22, 2024

Interesting - I thought I'd checked this case, but clearly not, sorry.

You at Scala World, Olaf? Could see to fix it then (me/you/together).

from sbt-dynver.

samudurand avatar samudurand commented on May 22, 2024

Is there any progress on that issue ? Ideally we would like to have this fantastic plugin to choose the most recent tag. Or just the most recent version (v0.0.6 instead of v0.0.5 for instance) by simple string comparison maybe ?

from sbt-dynver.

dwijnand avatar dwijnand commented on May 22, 2024

I've not had a chance to look at this. Contributions welcome if they catch your fancy.

from sbt-dynver.

samudurand avatar samudurand commented on May 22, 2024

Might, do, any hint on where to look for the change to make @dwijnand @olafurpg ? I currently don't have the time for digging into the whole code without any starting point. Otherwhise it will have to wait

from sbt-dynver.

dwijnand avatar dwijnand commented on May 22, 2024

Everything comes from one invocation of git describe: https://github.com/dwijnand/sbt-dynver/blob/v2.0.0/src/main/scala/sbtdynver/DynVerPlugin.scala#L121

Ideally there would be a flag for that that deals with this edge-case.

For testing (e.g to TDD your way to a solution) you could look to create a test similar to https://github.com/dwijnand/sbt-dynver/blob/v2.0.0/src/test/scala/sbtdynver/GH007.scala.

from sbt-dynver.

dwijnand avatar dwijnand commented on May 22, 2024

Hey @olafurpg,

I tried to reproduce this, but couldn't:

$ git init
Initialized empty Git repository in /s/t-git-multi-tag/.git/
$ echo 1 > f.txt
$ git add f.txt
$ git commit -m1
[master (root-commit) 6eda7fa] 1
 1 file changed, 1 insertion(+)
 create mode 100644 f.txt

$ git tag -a -s v2.0.0-RC3 -m 'Version 2.0.0-RC3'
$ git describe --tags --abbrev=8 --match v[0-9]* --always --dirty=+20180104-1200
v2.0.0-RC3

$ git tag -a -s v2.0.0 -m 'Version 2.0.0'
$ git describe --tags --abbrev=8 --match v[0-9]* --always --dirty=+20180104-1200
v2.0.0

Then I found this in the "SEARCH STRATEGY" section of git describe:

Annotated tags will always be preferred over lightweight tags, and tags with newer dates will always be preferred over tags with older dates.

(https://www.kernel.org/pub/software/scm/git/docs/git-describe.html#_search_strategy)

Initially I thought that the problem was that my reproduction wasn't faithfully reproducing the tag dates.

Instead it looks like the issue is that the v2.0.0 tag of Scalameta is a lightweight tag, while v2.0.0-RC3 is a proper annotated tag:

$ git show v2.0.0-RC3
tag v2.0.0-RC3
Tagger: Ólafur Páll Geirsson <[email protected]>
Date:   Wed Sep 6 11:49:04 2017 +0200

See #1109

commit 15a0187501dc8e5a6fe06d0e002ce1d3340968dc (tag: v2.0.0-RC3)
Merge: de1f4f2d5 10a2c60b0
Author: Ólafur Páll Geirsson <[email protected]>
Date:   Wed Sep 6 11:46:47 2017 +0200

    Merge pull request #1113 from olafurpg/ci-publish

    Fix CI publish infrastructure

$ git show v2.0.0
commit fa0dc78783b5cb26b17ee32eec5536d36915c82e (tag: v2.0.0)
Merge: 15a018750 c89ad57d7
Author: Ólafur Páll Geirsson <[email protected]>
Date:   Mon Sep 11 19:53:06 2017 +0200

    Merge pull request #1118 from olafurpg/master

    Redirect changelog files to GitHub releases.

I assume the tag was created with the GitHub Releases UI.

By default git describe never considers lightweight tags, we actually opt-ed into lightweight tags specifically for GitHub's Releases UI (see #14) by adding the --tags flag. Generally (IMHO) the difference isn't known by git users.

Unfortunately it doesn't look like there is a flag to make git describe ignore the annotated vs lightweight tag difference and only consider the dates. And even then I'm not 100% sure if that would be a good idea.

Running out of ideas I'm going to close this, but please comment if you have any ideas or thoughts.

from sbt-dynver.

olafurpg avatar olafurpg commented on May 22, 2024

Interesting. Thanks for digging into this @dwijnand I did indeed publish v2.0.0 from the GitHub release UI and iirc I tagged v2.0.0-RC3 locally. I didn't know about lightweight vs. annotated tags.

Totally fine to close this issue then 👍

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.