Sort tag listing by alphanumeric values #7977

Closed
opened 2025-11-02 07:43:24 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @camlafit on GitHub (Oct 15, 2021).

Gitea Version

1.14.1

Operating System

linux

Browser Version

not relevant

Can you reproduce the bug on the Gitea demo site?

Yes

Description

For example on https://try.gitea.io/camlafit/ps_checkout# if we list tags on interface, listing doesn't follow semver list.
2.15.x is after 2.1.x but before 2.2.x but 15 > 2.

Thanks a lot

Screenshots

Capture d’écran de 2021-10-15 16-44-37

Originally created by @camlafit on GitHub (Oct 15, 2021). ### Gitea Version 1.14.1 ### Operating System linux ### Browser Version not relevant ### Can you reproduce the bug on the Gitea demo site? Yes ### Description For example on https://try.gitea.io/camlafit/ps_checkout# if we list tags on interface, listing doesn't follow semver list. 2.15.x is after 2.1.x but before 2.2.x but 15 > 2. Thanks a lot ### Screenshots ![Capture d’écran de 2021-10-15 16-44-37](https://user-images.githubusercontent.com/209915/137507253-58118c06-f1e5-41fb-b513-ff78dd8fb6fc.png)
Author
Owner

@camlafit commented on GitHub (Oct 15, 2021):

could be in part related to #5709

@camlafit commented on GitHub (Oct 15, 2021): could be in part related to #5709
Author
Owner

@silverwind commented on GitHub (Oct 16, 2021):

Probably won't help in case of go-git, but with regular git, the expected tag sorting order can be configured in git via argument --sort=version:refname since 2.0.0, see https://stackoverflow.com/a/22634649.

@silverwind commented on GitHub (Oct 16, 2021): Probably won't help in case of go-git, but with regular git, the expected tag sorting order can be configured in git via argument `--sort=version:refname` since 2.0.0, see https://stackoverflow.com/a/22634649.
Author
Owner

@camlafit commented on GitHub (Oct 16, 2021):

Hello

Yes locally I use this behavior but is not complete.
For example version with label as x.y.z-alpha, it's sorted after x.y.z and not before as defined by semver logic.

@camlafit commented on GitHub (Oct 16, 2021): Hello Yes locally I use this behavior but is not complete. For example version with label as x.y.z-alpha, it's sorted after x.y.z and not before as defined by semver logic.
Author
Owner

@silverwind commented on GitHub (Oct 16, 2021):

Yeah, I meant our code could probably do the same, at least in the git binary code path.

@silverwind commented on GitHub (Oct 16, 2021): Yeah, I meant our code could probably do the same, at least in the git binary code path.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#7977