Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a git attribute to only show the tag name, without suffixes #184

Closed
marcospereira opened this issue Oct 20, 2023 · 3 comments · Fixed by #183
Closed

Add a git attribute to only show the tag name, without suffixes #184

marcospereira opened this issue Oct 20, 2023 · 3 comments · Fixed by #183
Labels
enhancement New feature or request solved The issue has been satisfactorily solved

Comments

@marcospereira
Copy link
Contributor

The current git.tag attribute shows the full description of the tag, with a suffix including the number of additional commits on top of the tagged object and the abbreviated object name of the most recent commit. The current output would be:

3.1.2-beta5-17-g7c2d387

Where -17-g7c2d387 is the suffix.

While this is useful in some cases, having only the tag name with no suffix is useful when showing the latest release. The abbreviated tag name would be:

3.1.2-beta5

And this can later be used when linking to code in that tag:

See the [setup](https://github.com/fralau/mkdocs_macros_plugin/blob/{{ git.short_tag }}/setup.py) code.

To the release itself:

See the [release notes for the latest release](https://github.com/fralau/mkdocs_macros_plugin/releases/tag/{{ git.short_tag }}).

Or, depending on the tag name, even adding code snippets such as:

Add it as a requirement:

    extras_require={
        'test': ["some-package>={{ git.short_tag }}],
    }
@github-actions
Copy link

Welcome to this project and thank you!' first issue

@fralau
Copy link
Owner

fralau commented Oct 20, 2023

From a first examination, it makes sense.

Where would you use that statement?

    extras_require={
        'test': ["some-package>={{ git.short_tag }}],
    }

@fralau fralau added the enhancement New feature or request label Oct 20, 2023
@marcospereira
Copy link
Contributor Author

Where would you use that statement?

In a markdown doc that describes how to use a dependency. I copied from this project itself. But think about this doc here:

https://jte.gg/#getting-started

The markdown source would be:

<dependency>
    <groupId>gg.jte</groupId>
    <artifactId>jte</artifactId>
    <version>{{ git.short_tag }}</version>
</dependency>

@fralau fralau added the solved The issue has been satisfactorily solved label Oct 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request solved The issue has been satisfactorily solved
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants