Restore flags to include from file and exclude from file#4811
Conversation
|
@MichaelEischer please review this and let me know if I am on the right track. |
MichaelEischer
left a comment
There was a problem hiding this comment.
I'd prefer a different design. runRestore is already too long, so I'd like to extract the include/exclude pattern parsing code. Judging from a quick look at the exclude code used by the backup command (see cmd/restic/exclude.go), it should be possible to directly reuse the code for the exclude options. And it should be possible to adapt that pattern to add new include options. (Feel free to ask if you need more details to understand what I have in mind)
I wanted to propose this too. I will update this draft over the next weekend. |
5e33a19 to
1fda42b
Compare
…e excludes from a file feature for resticgh-4781
- added includePatternOptions similar to excludePatternOptions - followed similar approach to backup for selecting files for restore
addressing review comments
8b6b792 to
24a247a
Compare
MichaelEischer
left a comment
There was a problem hiding this comment.
I've found a few more issues. Currently restore --exclude-file ... does not work as hasExcludes is no longer correct. The same applies for include files.
|
Tests failing is unrelated. |
MichaelEischer
left a comment
There was a problem hiding this comment.
I have a few more comment, after that we should be ready to go.
doc: update exclude and include docs
MichaelEischer
left a comment
There was a problem hiding this comment.
LGTM. Thanks for the blazingly fast fixes!
What does this PR change? What problem does it solve?
Added
--exclude-file,--iexclude-file,include-fileandiinclude-fileto the restore command.Was the change previously discussed in an issue or on the forum?
Closes #4781
Checklist
changelog/unreleased/that describes the changes for our users (see template).gofmton the code in all commits.