git-cl icon indicating copy to clipboard operation
git-cl copied to clipboard

pre release out of order

Open RyanHedges opened this issue 3 years ago • 3 comments

I just ran this on a repo that hasn't been using git cl yet. While poking around with the git cl full -p and I noticed the that sorting of pre released tags doesn't appear to be correct.

In the below example I'd expect to see v0.1.0-rc.3 to be above rc.2 and rc.1. We can see in the output that rc.1 was done on 8/8 and the other on 8/9

This isn't a deal breaker for my intended workflow, but thought I'd share it.

Running git cl full -p produces...

# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

Generated by [Git Changelog](https://github.com/uptech/git-cl), an open source project brought to you by [UpTech Works, LLC](https://upte.ch). A consultancy that partners with companies to help **build**, **launch**, and **refine** their products.


## [Unreleased] - now


## [v0.3.0-rc.1] - 2022-10-20


## [v0.2.0-rc.1] - 2022-10-17


## [v0.1.0] - 2022-08-15


## [v0.1.0-rc.1] - 2022-08-08


## [v0.1.0-rc.2] - 2022-08-09


## [v0.1.0-rc.3] - 2022-08-09

[Unreleased]: https://bitbucket.org/uptech/fake-repo/branches/compare/b1c592f%0D038a55b
[v0.3.0-rc.1]: https://bitbucket.org/uptech/fake-repo/branches/compare/038a55b%0D63f193f
[v0.2.0-rc.1]: https://bitbucket.org/uptech/fake-repo/branches/compare/63f193f%0D642cf9c
[v0.1.0]: https://bitbucket.org/uptech/fake-repo/branches/compare/642cf9c%0D4ed5558
[v0.1.0-rc.1]: https://bitbucket.org/uptech/fake-repo/branches/compare/b811756%0Dd34f2a8
[v0.1.0-rc.2]: https://bitbucket.org/uptech/fake-repo/branches/compare/9c624d0%0Db811756
[v0.1.0-rc.3]: https://bitbucket.org/uptech/fake-repo/branches/compare/4ed5558%0D9c624d0

I'd expect an output like...

# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

Generated by [Git Changelog](https://github.com/uptech/git-cl), an open source project brought to you by [UpTech Works, LLC](https://upte.ch). A consultancy that partners with companies to help **build**, **launch**, and **refine** their products.


## [Unreleased] - now


## [v0.3.0-rc.1] - 2022-10-20


## [v0.2.0-rc.1] - 2022-10-17


## [v0.1.0] - 2022-08-15


## [v0.1.0-rc.3] - 2022-08-09


## [v0.1.0-rc.2] - 2022-08-09


## [v0.1.0-rc.1] - 2022-08-08

[Unreleased]: https://bitbucket.org/uptech/fake-repo/branches/compare/b1c592f%0D038a55b
[v0.3.0-rc.1]: https://bitbucket.org/uptech/fake-repo/branches/compare/038a55b%0D63f193f
[v0.2.0-rc.1]: https://bitbucket.org/uptech/fake-repo/branches/compare/63f193f%0D642cf9c
[v0.1.0]: https://bitbucket.org/uptech/fake-repo/branches/compare/642cf9c%0D4ed5558
[v0.1.0-rc.3]: https://bitbucket.org/uptech/fake-repo/branches/compare/4ed5558%0D9c624d0
[v0.1.0-rc.2]: https://bitbucket.org/uptech/fake-repo/branches/compare/9c624d0%0Db811756
[v0.1.0-rc.1]: https://bitbucket.org/uptech/fake-repo/branches/compare/b811756%0Dd34f2a8

RyanHedges avatar Nov 14 '22 20:11 RyanHedges

Hmm, will have to dig into this.

I know that when I am using the v0.1.0-23 pre-release pattern it does work. I have to look to see how the ordering is implemented.

drewdeponte avatar Nov 15 '22 03:11 drewdeponte

Hmm, thinking about this some more, still not having looking into it. I think it is ordered based on the order it runs into the versions in from the git tree traversal. But maybe I am wrong.

drewdeponte avatar Nov 15 '22 16:11 drewdeponte

Not th git tree, but bit bucket's view into the main branch... Screen Shot 2022-11-14 at 11 59 37 AM

and the output with my formatted git log... l = log --graph --abbrev-commit --date=relative --pretty=format:\"%C(yellow)%h%Creset -%C(red)%d%Creset %s %Cgreen(%ar) %C(bold blue)<%an>%Creset\" --topo-order Screen Shot 2022-11-15 at 8 56 18 AM

RyanHedges avatar Nov 15 '22 16:11 RyanHedges