Skip to content

Selects wrong version if multiple lightweight tags point to the same commit #238

@ashleymercer

Description

@ashleymercer

I think this issue is essentially the same as #48 except in our case we might have multiple lightweight tags pointing to the same commit.

We have a build server which sometimes builds / tags the same commit multiple times (yes, this is a separate issue...) so we can end up with a git state that looks like:

 x <- HEAD, 0.1, 0.2
 |
 o

where 0.1 and 0.2 are lightweight tags. In this case sbt-dynver sometimes picks the "earlier" tag, which can then cause other problems for us.

I did some digging in the code: it looks like we use the output of git-describe in this line which, from what I can tell, is essentially unordered for lightweight tags since they don't contain any date information.

PS it looks like a similar issue was already fixed in sbt-git so we can take some inspiration from there for a fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions