-
-
Notifications
You must be signed in to change notification settings - Fork 657
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
--reverse does not reverse in the case of a tie #863
Comments
I found the problem: turns out that sometimes files are sorted two times. So the sort is stable which means it doesn’t change the order of equal elements. In your case:
In most case, you wouldn’t notice it since the element would be sorted then reversed, but in this case the sort does nothing, so it’s noticeable. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Exa version v0.10.1 [+git], NixOS.
If two items are the same in the sort order,
--reverse
will not reverse their order. The easiest demonstration is to create three files at the same timeand sort by newest
This is "directory order" (
ls -U
) so it may be different from this example. If we try to reverse this order...we still get the directory order! think this behaviour is surprising, and can be particularity vexacious when there are only some ties.
In
ls
(GNU, busybox, and toybox at least) the tie appears to be broken by filename:and
to me this is sensible behaviour, but in any case I think the
--reverse
flag should always produce the opposite order of files within a directory to the same command without the--reverse
flag.The text was updated successfully, but these errors were encountered: