Skip to content

Handle tags that do not follow semantic versioning #75

@pete0emerson

Description

@pete0emerson

Your documentation indeed points out that tags need to follow SemVer:

Note that fetch assumes git tags are specified according to Semantic Versioning principles.

However, git tags that are not semantically versioned are valid tags, and if one exists in the source repository, the tool breaks, even if you are not requesting a --tag.

I suggest that tags should not be required to be semantically versioned unless a Tag Contraint Expression is specified.

This would allow the tool to work in repositories where non-SemVar tags exist.

To replicate:

fetch $ git rev-parse HEAD
83ed55048791ec5385d4143a78798e2a6c82b9f8
fetch $ ./fetch --repo=https://github.com/pete0emerson/demo --branch=main demo
Downloading latest commit from branch "main" of https://github.com/pete0emerson/demo ...
Extracting files from <repo>/ to demo ...
Download and file extraction complete.
demo $ git tag banana
demo $ git push --tags
Total 0 (delta 0), reused 0 (delta 0)
To https://github.com/pete0emerson/demo.git
 * [new tag]         banana -> banana
fetch $ ./fetch --repo=https://github.com/pete0emerson/demo --branch=main demo
ERROR: Error occurred while computing latest tag that satisfies version contraint expression: -1 - Malformed version: banana

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions