Skip to content

Display current git tag if any #6

@pzehner

Description

@pzehner

Hello, thanks for this nice package!

You can associate a tag to a commit with git tag <tag name>, which is useful to set human-readable document version (when distributing it). I don't think such tags are currently used by this package. It would be nice if, when the current commit is associated to a Git tag, this tag could be displayed instead of the commit hash.

By instance, on commit #012345 associated with tag 0.1.0, \gitVer would give "0.1.0", \versionBox would give "Manuscript version: 0.1.0 - 2022-08-29 13:41", and the PDF metadata would be "Version 0.1.0".

Git tag can be extracted with git describe --tags --always for the current commit. If the current commit comes after a previous commit associated with a tag, <tag>-<number of commits since the tag>-<current commit hash> is returned. If the project has no Git tag, the current commit hash is returned.

This behavior could be the default, and would be disabled with a package option noGitTag.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions