Skip to content

Conversation

@sdht0
Copy link

@sdht0 sdht0 commented Mar 14, 2025

Before this patch:

$ mkdir test1 test2 abc 01.city 02.apple
$ touch a.txt abc.txt abc.mp3 ab

$ eza                                       
01.city  02.apple  a.txt  ab  abc  abc.mp3  abc.txt  test1  test2

$ eza --sort=extension                      
ab  abc  test1  test2  02.apple  01.city  abc.mp3  a.txt  abc.txt

$ eza --sort=extension --group-directories-first
abc  test1  test2  02.apple  01.city  ab  abc.mp3  a.txt  abc.txt

Note how 01.city is sorted after 02.apple when sorting by extension.

After patch:

$ eza --sort=extension
01.city  02.apple  ab  abc  test1  test2  abc.mp3  a.txt  abc.txt

$ eza --sort=extension --group-directories-first
01.city  02.apple  abc  test1  test2  ab  abc.mp3  a.txt  abc.txt

Directories are treated exactly as if there are no . was found in the name.

Closes #821

Copy link
Contributor

@ariasuni ariasuni left a comment

Choose a reason for hiding this comment

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

Indeed, it makes a lot of sense to change the behavior this way!

ariasuni
ariasuni previously approved these changes Apr 18, 2025
@ariasuni
Copy link
Contributor

Hum now that I think of it, it would be great to have some tests for this behavior.

You can take 570b977, add it to this PR and see if it works in the CI.

@sdht0 sdht0 force-pushed the dir-sort-ext-fix branch from bcfef6e to ee78e49 Compare May 3, 2025 14:54
@sdht0 sdht0 requested a review from cafkafk as a code owner May 3, 2025 14:54
@sdht0
Copy link
Author

sdht0 commented May 3, 2025

Thanks. Looks like more tests need to be updated?

@ariasuni
Copy link
Contributor

Hum yeah, you would need to regen test (see here) and for that you need Nix. Otherwise, I or @cafkafk could regen the broken tests ourselves.

@sdht0
Copy link
Author

sdht0 commented May 14, 2025

Otherwise, I or @cafkafk could regen the broken tests ourselves.

Would appreciate it!

@ariasuni ariasuni force-pushed the dir-sort-ext-fix branch 4 times, most recently from ae526de to 077d6da Compare May 17, 2025 22:08
@ariasuni ariasuni requested review from a team and MartinFillon and removed request for a team May 18, 2025 22:35
MartinFillon
MartinFillon previously approved these changes May 19, 2025
Copy link
Contributor

@MartinFillon MartinFillon left a comment

Choose a reason for hiding this comment

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

lgtm

@MartinFillon
Copy link
Contributor

Hey thanks for the pr, this is indeed a slight issue !!

gierens
gierens previously approved these changes May 19, 2025
Copy link
Member

@gierens gierens left a comment

Choose a reason for hiding this comment

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

Nice catch! Thanks! ... Code, functionality and performance looks good to me!

@sdht0
Copy link
Author

sdht0 commented May 30, 2025

@cafkafk could you give this another look?

Would be nice to get this into a release and help me remove my local nix override.

@sdht0 sdht0 force-pushed the dir-sort-ext-fix branch from 077d6da to a8f6f36 Compare June 1, 2025 03:10
@sdht0 sdht0 force-pushed the dir-sort-ext-fix branch from a8f6f36 to f96bc8d Compare June 20, 2025 15:09
@sdht0
Copy link
Author

sdht0 commented Jun 20, 2025

Not sure what the next steps are to get this merged.

@ariasuni
Copy link
Contributor

Well, we’d have to wait for @cafkafk to be available to review that but idk when that’ll be 😭

@cafkafk cafkafk dismissed stale reviews from gierens and MartinFillon June 26, 2025 06:27

The merge-base changed after approval.

@sdht0 sdht0 force-pushed the dir-sort-ext-fix branch from f96bc8d to 788a8d9 Compare October 5, 2025 15:40
@sdht0
Copy link
Author

sdht0 commented Oct 5, 2025

Hi all. I seemed to have missed the latest comment by @cafkafk (no Github email?).

Anyway I have cherry picked my change to the latest main. I tried following the instructions to regenerate the tests. However, running powertest does not result in any change.

@ariasuni /@cafkafk: can you help regenerate the tests and get this finally merged?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Status: 🆕 New

Development

Successfully merging this pull request may close these issues.

feat: don't consider "extensions" for directories when sorting

4 participants