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
prune: Add JSON support and separate code #3140
Conversation
rebased after #3148 was merged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was wondering how the JSON should look like to make it easier to extend it to a streaming output as with the backup command in the future. The most important part is probably to add a message type and a comment that this may change in the future.
restic prune --json
still prints a lot of non-JSON text.
4e8b88d
to
3017a59
Compare
@MichaelEischer I included your proposals and also rebased as #3139 is merged now. The
Yes, so far |
Unfortunately, it is not possible to let |
rebased. |
#3009 won't be able to let |
Actually I was thinking of something like the last commit I added. IMO this works and doesn't break anything except removing the output for some command that don't support I also rebased to current master. |
Ok, it breaks I'll add some more checks for |
0fc4139
to
5070eee
Compare
I've rebased to PR to fix the merge conflicts. |
Thanks for your great work so far! |
@aawsome has this been implemented somewhere else or why was it closed? |
What does this PR change? What problem does it solve?
Separates the pruning code in three functions:
In a next step, unit tests can be added for all three parts (not included here)
This PR conflicts with #2881 - I'll fix this depending on what PR is tackled first.
Was the change discussed in an issue or in the forum before?
Refactoring the code: discussion with @fd0
Also closes #3129
Checklist
changelog/unreleased/
that describes the changes for our users (template here)gofmt
on the code in all commits