-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
sort output by file last modified time #404
Comments
@wavexx This does seem mildly useful, but I don't know when I'll have the time to work on it.
While strictly true, this is an oversimplification. Namely, running a search in parallel requires buffering to avoid interleaving results. Sorting with parallelism requires something more than just a simple buffering scheme however, and it is rather difficult to do in the current setup (which parallelizes things at level of directory traversal). This is why the |
It should be possible to implement this in the |
Here is what I propose:
We'll likely therefore deprecate Thoughts? |
I like it. |
These flags each accept one of five choices: none, path, modified, accessed or created. The value indicates how the results are sorted. For --sort, results are sorted in ascending order where as for --sortr, results are sorted in descending order. Closes #404
These flags each accept one of five choices: none, path, modified, accessed or created. The value indicates how the results are sorted. For --sort, results are sorted in ascending order where as for --sortr, results are sorted in descending order. Closes #404
I'm throwing this here for consideration. When I'm searching through my source files, I often not only want to find all occurrences, but when multiple hits are involved, I also want to find the most recent modification (by mtime). It would be nice to be able to sort output files (with context), sorted by time and reverse time.
Afaik, none of the various searching tools allow to do this. Not easily at least.
To do it currently, I actually do two passes:
This is necessary as I obviously like to see the match context as well (otherwise I could stop at step 2). But having to find candidates first introduces extra overhead that cannot be avoided.
This requires buffering matches before showing the output, of course, but the search can be ran in parallel still.
The text was updated successfully, but these errors were encountered: