-
-
Notifications
You must be signed in to change notification settings - Fork 214
Version tags don't get sorted topologically? #1080
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
Comments
Thanks for opening your first issue at git-cliff! Be sure to follow the issue template! ⛰️ |
Hello, thanks for reporting and detailed debugging steps! 👋🏼
You might be right... We are not sorting the tags topologically but the commits: git-cliff/git-cliff-core/src/repo.rs Lines 122 to 123 in 9babe06
Thus I was hoping that the tags will be sorted too, since they are associated with a commit. For the tags, I just do a time based sorting if git-cliff/git-cliff-core/src/repo.rs Lines 427 to 429 in 9babe06
Relatedly, there is an issue for disabling topological order for commits: #804 TBH it's been numerous cases got affected by this so I would really appreciate some other eyes on these sorting issues. Would you be possibly interested in debugging this with the references I provided and confirming the behavior/bug? |
@orhun Thanks very much for checking this issue (and confirming I'm possibly not crazy 😆). Unfortunately I know nothing about Rust so I'm not really capable of debugging directly, but I did have a look at the sources you provided. Not sure how helpful my comments will be, but here's some in any case. Based on what I can understand, I am guessing that this line returns the tags in the same order as git-cliff/git-cliff-core/src/repo.rs Line 385 in 9babe06
You then use these tags to compute the "unreleased" case above: git-cliff/git-cliff/src/lib.rs Line 171 in 9babe06
So I suspect that the solution is to explicitly sort these tags topologically. I guess the easiest way might be to sort the tags either during or based on the results of the topological ordering of the commits? Sorry that I can't be of much help. In any case, git-cliff is fantastic in general, and I'm getting good usage out of it. Thanks for all your work on it! |
Hey again @dpad - that sounds correct to me. We probably need to manually/explicitly sort the tags as you've pointed out. I might get to implementing that in the following weeks if it's urgent for your use case. Just LMK! |
@orhun Thanks for looking into it, no rush from my end though :) |
Is there an existing issue for this?
Description of the bug
Sorry if this is just a mistake, I'm not sure if I'm just misunderstanding things or if there is some weird behaviour with the "topo_order" option...
Basically, I have 3 commits tagged with version numbers like "v0.1.0", "v0.9.0", "v0.10.0" respectively. Topologically, the latest version (on the HEAD commit) is v0.10.0. However, running
git-cliff --topo-order --latest
will print out the "v0.9.0" changelog, andgit-cliff --topo-order --unreleased
will print out the "v0.10.0" changelog. Removing the--topo-order
argument produces the expected result.Steps To Reproduce
Generating the full changelog seems to have the tags in the correct order:
Expected behavior
Screenshots / Logs
No response
Software information
Additional context
Based on the behaviour above, it seems to me like the tags don't actually get sorted topologically when using
--topo-order
.If you change the last tag from
v0.10.0
tov0.9.1
instead, you get the same results both with and without--topo-order
. So, I suspect there's some issue when thev0.10.0
tag gets sorted alphabetically before thev0.9.0
tag. (In other words, it looks like--topo-order
is actually doing an alphabetical order, not a topological one??)Am I just misunderstanding the purpose of
--topo-order
or--latest
/--unreleased
, or is there something weird going on here?The text was updated successfully, but these errors were encountered: