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

Git-tag does not use latest tag when multiple tags on same commit #2417

Open
asikeero opened this issue Dec 21, 2023 · 0 comments
Open

Git-tag does not use latest tag when multiple tags on same commit #2417

asikeero opened this issue Dec 21, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@asikeero
Copy link

Describe the bug

When creating a release with auto shipit and using the git-tag plugin, if there are multiple tags associated with the latest release, then the oldest one of those is used.

To Reproduce

I made a minimal repo showing the issue. This repo has one commit, and a release created from that commit. There are two tags on that commit, tags v1.0.0 and v2.0.0 of which v2.0.0 is newer. The release is tagged v2.0.0.

git  clone https://github.com/asikeero/auto-tag-bug.git
cd auto-tag-bug
auto shipit --dry-run

Output, note the Would have published line:

✔  success   Calculated version bump: patch
ℹ  info      Potential Changelog Addition:

ℹ  info      Would have published: v1.0.1
ℹ  info      Current "Latest Release" on Github: v2.0.0
ℹ  info      Using release notes:

ℹ  info      Would have created a release on GitHub for version: 2.0.1
●  note      The above version would only get released if ran with "shipit" or a custom script that bumps the version using the "version" command

Expected behavior

I would expect the latest tag to be used when calculating the version bump. Auto uses the latest release, but when fetching tags on that release, it selects the first (or oldest) one if there are multiple. Another solution might be that auto would be able to use the tag which is associated with the latest release.

I believe the problem is this line which fetches the latest tag with

git describe --tags --abbrev=0

This will return the oldest tag on a commit, and not the latest.

Environment information:
I am running auto 11.0.4 installed as a binary on MacOS.

@asikeero asikeero added the bug Something isn't working label Dec 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant