recreate: remove dead compression plumbing, document what -C applies to - #10303
Merged
ThomasWaldmann merged 1 commit intoSep 2, 2026
Merged
Conversation
The compression argument passed to ArchiveRecreater was stored as self.compression and never read anywhere. -C actually works via the with_repository decorator setting repo_objs.compressor, which is used for everything recreate newly writes. Document in the -C help text and in the epilog that only newly written data (re-chunked file content, new archive metadata) is affected, while reused chunks keep their existing compression (recompressing those is the job of borg repo-compress). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #10303 +/- ##
==========================================
+ Coverage 87.65% 87.67% +0.01%
==========================================
Files 103 103
Lines 18702 18711 +9
Branches 2877 2880 +3
==========================================
+ Hits 16393 16404 +11
+ Misses 1609 1606 -3
- Partials 700 701 +1 ☔ View full report in Codecov by Harness. |
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.
Problem
The
compression=argument passed toArchiveRecreaterwas stored asself.compressionand never read anywhere — dead plumbing.-Cactually takes effect via thewith_repositorydecorator settingrepo_objs.compressor, which is used for everything recreate newly writes.Also, the
-Chelp text did not mention its actual scope: reused (not re-chunked) data chunks keep their existing compression; only newly written data (re-chunked file content, new archive metadata) is compressed with the given spec.Changes
compressionparameter/attribute fromArchiveRecreater(and the now-unusedCompressionSpecimport inarchive.py); leave a comment at the call site pointing at the decorator mechanism.-Cin the option help text and in theborg recreateepilog, pointing toborg repo-compressfor recompressing existing repository objects.No behavior change.
🤖 Generated with Claude Code