Skip to content

walker: Remove ignoreTrees functionality#4615

Merged
MichaelEischer merged 2 commits intorestic:masterfrom
MichaelEischer:fix-find-empty-dirs
Jan 19, 2024
Merged

walker: Remove ignoreTrees functionality#4615
MichaelEischer merged 2 commits intorestic:masterfrom
MichaelEischer:fix-find-empty-dirs

Conversation

@MichaelEischer
Copy link
Copy Markdown
Member

@MichaelEischer MichaelEischer commented Jan 6, 2024

What does this PR change? What problem does it solve?

It was only used in two places:

  • stats: apparently as a minor performance optimization, which is unlikely to be important
  • find: filtered directories would be ignored. However, this optimization missed that it is possible that two directories have the exact same content. Such directories would be incorrectly ignored too. Example:
mkdir test test/a test/b
restic backup test
restic find latest /test/b
-> incorrectly does not return anything

Thus, remove the functionality as it's apparently too complex to use correctly.

Was the change previously discussed in an issue or on the forum?

Discovered while reviewing #4550.

Checklist

  • I have read the contribution guidelines.
  • I have enabled maintainer edits.
  • I have added tests for all code changes.
  • [ ] I have added documentation for relevant changes (in the manual).
  • There's a new file in changelog/unreleased/ that describes the changes for our users (see template).
  • I have run gofmt on the code in all commits.
  • All commit messages are formatted in the same style as the other commits in the repo.
  • I'm done! This pull request is ready for review.

@MichaelEischer MichaelEischer force-pushed the fix-find-empty-dirs branch 2 times, most recently from 73f130d to de47bbd Compare January 6, 2024 13:12
Copy link
Copy Markdown
Member Author

@MichaelEischer MichaelEischer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

It was only used in two places:
- stats: apparently as a minor performance optimization, which is
  unlikely to be important
- find: filtered directories would be ignored. However, this
  optimization missed that it is possible that two directories have the
  exact same content. Such directories would be incorrectly ignored too.
  Example:
```
mkdir test test/a test/b
restic backup test
restic find latest test/b
-> incorrectly does not return anything
```

Thus, remove the functionality as it's apparently too complex to use
correctly.
@MichaelEischer MichaelEischer merged commit 5f49eec into restic:master Jan 19, 2024
@MichaelEischer MichaelEischer deleted the fix-find-empty-dirs branch January 19, 2024 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant