Enhancement: calls to SnapshotFilter.FindLatest() can be simplified#5688
Merged
Conversation
added a new file doc/view_repository.rst which contains a descrption of the `restic list`command.
This reverts commit ab5c259. By mistake I was in the wrong branch
is too complex. Since all the fields of the Snapshotfilter are copied to a new filter, there is nothing gained in doing so. The other field `TimestampLimit` cannot be referenced from the command line - and only `restic backup` uses this field. JUst remove the copying of all these fields and use the original Filter instead.
Contributor
Author
|
Ignore the first two commits - they are shadows of what I did wrong in git. But I don't know of how to get rid of them safely. |
MichaelEischer
approved these changes
Jan 31, 2026
MichaelEischer
left a comment
Member
There was a problem hiding this comment.
LGTM. I hope that it made sense at some point in the past 😅 . Thanks!
I'll just squash the commits of this PR. To get rid of the two extra commits there are basically two options either use rebase or just throw away the commits and recreate them:
# remove the two lines for the unwanted commits
# there are also lots of tools/helpers for interactive git rebase
git rebase --interactive HEAD~3
or
git reset HEAD~3
git add .
git commit
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR change? What problem does it solve?
This PR simplifies the code logic to call
opts.SnapshotFilter.FindLatest(). There is a unnecessary creation of a temp SnapshotFilter, when the original will do quite nicely. I saw this when reviewing PR #5686. It will also simplify the codefor new filter components, when all this new code can be hidden in
ìnternal/data/snapshot_find.go.Was the change previously discussed in an issue or on the forum?
No.
Checklist
- [ ] I have added tests for all code changes.- [ ] I have added documentation for relevant changes (in the manual).- [ ] There's a new file inchangelog/unreleased/that describes the changes for our users (see template).