Skip to content

gitVersion() is failing due to the --match pattern not including quotes #839

@kihaki

Description

@kihaki

What happened?

Looks like gitVersion() is failing due to the --match pattern not including quotes

What did you want to happen?

Calling gitVersion() should print the correct version when providing no pattern

Looking through the source code I have found that gitVersion() basically is a call to git describe --tags --always --first-parent --abbrev=7 --match=* HEAD which fails with the following error when run directly: no matches found: --match=* and resulting in an unknown version.

It seems that the correct command would be git describe --tags --always --first-parent --abbrev=7 --match='*' HEAD (notice the '' for the match), which gives the correct tag to work with.

It seems kind of weird to me that this would not have been noticed already, so maybe I am using the API wrongly?

My git version is 2.43.0

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