Skip to content
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

sorting results by path properties #2365

Closed
nguyenvukhang opened this issue Nov 29, 2022 · 1 comment
Closed

sorting results by path properties #2365

nguyenvukhang opened this issue Nov 29, 2022 · 1 comment
Labels
duplicate An issue that is duplicative of another.

Comments

@nguyenvukhang
Copy link
Contributor

As outlined in #2243, results are incorrectly sorted by file stats (modified/created/accessed time).

One approach is to make the recursive directory traversal smarter. For example, when sorting by latest modified, the parent directory will be assigned the latest modified time of all its children, rather than the direct result of calling stat on it.

Another approach will be to sort the results after all search results have been matched and collected. This will likely collecting all results into memory, tagging each result with a key based on the sorting criteria, and sorting the results by this key.

@BurntSushi
Copy link
Owner

Let's try to keep this in one issue instead of creating many for the same problem. I moved this comment to here.

@BurntSushi BurntSushi added the duplicate An issue that is duplicative of another. label Nov 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate An issue that is duplicative of another.
Projects
None yet
Development

No branches or pull requests

2 participants