Skip to content

ls: fix comparisons in version sorting and recursive mode#12108

Merged
cakebaker merged 2 commits into
uutils:mainfrom
Alonely0:ls-ver
May 1, 2026
Merged

ls: fix comparisons in version sorting and recursive mode#12108
cakebaker merged 2 commits into
uutils:mainfrom
Alonely0:ls-ver

Conversation

@Alonely0
Copy link
Copy Markdown
Contributor

@Alonely0 Alonely0 commented May 1, 2026

Version sorting was being fed the incorrect values, as it expected file names but got paths, breaking the special-casing logic. This at some point was actually the expected behavior, because we asserted it in the tests; when triaging the associated issue, I reproduced we were mismatched with GNU on my Ubuntu LTS machine, so I'm submitting the fix. Also fixes a similar sorting bug in --recursive, backported from 26db61c.

Fixes #12058.

Alonely0 added 2 commits May 1, 2026 12:13
Depending on the sorting it would not, so it could recurse back through `..`. Backported from another PR of mine.
Also fixes the fact that version sorting had incorrect edge cases due to wrong name passing.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 1, 2026

GNU testsuite comparison:

Congrats! The gnu test tests/seq/seq-epipe is no longer failing!
Note: The gnu test tests/cut/cut-huge-range is now being skipped but was previously passing.
Note: The gnu test tests/env/env-signal-handler was skipped on 'main' but is now failing.
Skip an intermittent issue tests/pr/bounded-memory (was skipped on 'main', now failing)

@Alonely0
Copy link
Copy Markdown
Contributor Author

Alonely0 commented May 1, 2026

It seems bindgen broke in OpenBSD (it seems related to indexmap dep?), but it's unrelated to the PR. If we see it in further CI runs we should look into it.

@cakebaker cakebaker changed the title Fix comparisons in version sorting and recursive mode ls: fix comparisons in version sorting and recursive mode May 1, 2026
@cakebaker cakebaker merged commit f774940 into uutils:main May 1, 2026
168 of 169 checks passed
@cakebaker
Copy link
Copy Markdown
Contributor

Thanks!

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.

ls: version-based sort puts parent directory in the wrong place

2 participants