Skip to content

Wrong precedence of tags on same commit #1071

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

Closed
krumlo opened this issue Apr 17, 2024 · 1 comment
Closed

Wrong precedence of tags on same commit #1071

krumlo opened this issue Apr 17, 2024 · 1 comment

Comments

@krumlo
Copy link

krumlo commented Apr 17, 2024

Description

If I have a tag 1.2.3-rc1 on a commit, and all internal QA testing has passed, I want to be able to say that the same commit is now 1.2.3, without a specific bump commit. (I'd prefer to just push a tag to start release process, rather then merge a bump to main and sync with prod).

Steps to reproduce

  1. Put two tags (1.2.3-rc1 and 1.2.3) on the same commit
  2. Generate a changelog with --merge-prerelease

Current behavior

Commits gets grouped under 1.2.3-rc1.

Desired behavior

I would expect precedence of tags on same commit to be 1.2.3-rc1 < 1.2.3.

SemVer 1.0 specification does not seem to say anything about precedence for .dev versions, but I would expect them to be 1.2.3-rc1.dev1 < 1.2.3-rc1.dev2 < 1.2.3-rc1 < 1.2.3, but I'm not sure about that one.

Screenshots

No response

Environment

commitizen version 3.22.0
python version 3.8.10
os Ubuntu 20.04 on WSL

@krumlo
Copy link
Author

krumlo commented Apr 18, 2024

Seems like the problem is due to how git sorts normal tags, since they contain no date/time of the actual tag, just the commit it is attached to. If I use annotated tags it works as expected.

@woile woile closed this as completed Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants