-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
Files are not sorted alphabetically #31374
Comments
It's related to this function:
Golang considers |
I am assuming that means strictly comparing numbers ("0", "1", "2", etc.) will not have this problem, but when the numbers are mixed with text the problem surfaces. If that is the case it could be because internally I did check unicode and ASCII tables to see if 0 would be position after 9 but so far nothing, the only place I found where that happens is on the numeric row of the keyboard layouts. I also did a simple test with an online terminal and I got a different result than the one linked in your issue collate version 0.16.0 to 0.7.0 So I am not sure why it is giving different results between the web terminal and local install. UPDATE: I actually forgot to include However, when I don't use |
So |
Yep, just realized it and retested again and got the same results as yours, I updated my previous entry to mention that. |
Before Golang fixes their bug, let's try this: Fix natural sort #31384 |
Backport #31384 by wxiaoguang Fix #31374 Co-authored-by: wxiaoguang <[email protected]>
Description
Currently trying to have a folder with files that are sorted alphabetically, but the web interface does not sort it correctly.
I already tried uploading each version by alphabetical order individually, I also modified each file in temporal order in case the modified time might be influencing the order, but nothing works, it always keeps the same incorrect order.
Items from 1 to 9 are always sorted correctly, but anything with the 0 is positioned after 9 instead of before 1.
I cannot find any way to fix this, so I am filing it as a bug.
I am able to reproduce this problem on the demo site as well: https://gitea.com/ParticleCore/sortorder
Attached follows screenshots of the problem on the private repo and demo site
Screenshots
Private

Demo

Gitea Version
1.22.0
Can you reproduce the bug on the Gitea demo site?
Yes
Operating System
No response
Browser Version
Firefox Stable latest
The text was updated successfully, but these errors were encountered: