issue 4179: sort output of restic ls -l by size, atime, ctime, mtime, time(=mtime), extension#5182
Conversation
MichaelEischer
left a comment
There was a problem hiding this comment.
Thanks for working on this feature and the other PRs (I'll slowly dig through those).
I've left a few comments below. Please also add a basic test. You can look at TestRunLsNcdu for inspiration.
changelog/unreleased/issue-4179
Outdated
| @@ -0,0 +1,6 @@ | |||
| ls: create ability to sort output of restic ls -l by one of the following list | |||
There was a problem hiding this comment.
The first line of a changelog must follow the structure describe here. (And be at most 80 characters long)
There was a problem hiding this comment.
4 basic tests added. I had to expand backup-data to get some useful filenames with extensions. Ran all tests with the modified backup-data structure.
|
Regards testing: you have touched a sore point. Is there anywhere a document or a set of documents which describes the restic testing machinery? Thanks |
MichaelEischer
left a comment
There was a problem hiding this comment.
I have a few more nits. Can you add a short note about the new sort mode to doc/045_working_with_repos.rst?
I'll refactor the code a bit after merging, but it's harder to explain what I have in mind than making those changes.
|
#5232 will bump the minimum go version to 1.22, this should fix the failing test in Go 1.21. |
Enhancement: create ability to sort output of restic ls -l by name, size, atime, ctime, mtime, time(=mtime), X(=extension), extension restic#4179
ls: create ability to sort output of restic ls -l by one of the following list name, size, atime, ctime, mtime, time(=mtime), extension. Reverse sorting has been implemtented as well.
Implemented all the changes that Michael Escher recommended. As soon as I understand the workings of the test machinery, I will add testing code.
Extended standard backup-data by 3 files with extension names.
Incorporated the changes recommended by Michael.
Add a short node of hoe to use the --sort and --reverse options.
Corrected lint errors.
ba0e981 to
fac3df5
Compare
|
I've rebased the PR (to have Go 1.22 as minimum version), and made a few cleanups. |
|
Thanks for keeping up with all the review comments :-) . I've opened #5235 in case you're interested in the refactorings I had in mind. |
Enhancement: create ability to sort output of restic ls -l by name, size, atime, ctime, mtime, time(=mtime), X(=extension), extension
#4179
What does this PR change? What problem does it solve?
Ability to sort output of restic ls -l by name, size, atime, ctime, mtime, time(=mtime)
Add 2 local parameters to sort command: --sort and --reverse, so that the output can be sorted by one of the above named possibilities.
Was the change previously discussed in an issue or on the forum?
#4179
closes #4179
Checklist
changelog/unreleased/that describes the changes for our users (see template).