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

Optimize sorting in the GitHelper.previousReleases #172

Merged
merged 4 commits into from
Feb 19, 2022

Conversation

danicheg
Copy link
Member

Let's save a few nanoseconds on the loading of the project. Though it's only the hypothesis that sorting using git is faster. But I can bet it's so.

@armanbilge
Copy link
Member

Hmm. I ran this in terminal and I'm not sure it's the right order. Shouldn't the v0.4.0 milestones come before it?

$ git tag --no-contains HEAD --sort=-v:refname
v0.4.5
v0.4.4
v0.4.3
v0.4.2
v0.4.1
v0.4.0-M5
v0.4.0-M4
v0.4.0-M3
v0.4.0-M2
v0.4.0-M1
v0.4.0

Co-authored-by: Arman Bilge <armanbilge@gmail.com>
@danicheg
Copy link
Member Author

Well, then we should try something like

git -c 'versionsort.suffix=-' tag --no-contains HEAD --sort=-v:refname

output is

v0.4.3
v0.4.2
v0.4.1
v0.4.0
v0.4.0-M5
v0.4.0-M4
v0.4.0-M3
v0.4.0-M2
v0.4.0-M1
v0.3.2
v0.3.1
v0.3
v0.2
v0.1

@armanbilge
Copy link
Member

That looks good!

Copy link
Member

@armanbilge armanbilge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice, thank you! This is also a partial fix for #14.

@armanbilge armanbilge merged commit 64e2733 into typelevel:series/0.4 Feb 19, 2022
@danicheg danicheg deleted the micro-opt branch February 19, 2022 22:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants