Skip to content

recreate: remove dead compression plumbing, document what -C applies to - #10303

Merged
ThomasWaldmann merged 1 commit into
borgbackup:masterfrom
ThomasWaldmann:recreate-compression-cleanup
Sep 2, 2026
Merged

recreate: remove dead compression plumbing, document what -C applies to#10303
ThomasWaldmann merged 1 commit into
borgbackup:masterfrom
ThomasWaldmann:recreate-compression-cleanup

Conversation

@ThomasWaldmann

Copy link
Copy Markdown
Member

Problem

The compression= argument passed to ArchiveRecreater was stored as self.compression and never read anywhere — dead plumbing. -C actually takes effect via the with_repository decorator setting repo_objs.compressor, which is used for everything recreate newly writes.

Also, the -C help 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

  • Remove the unused compression parameter/attribute from ArchiveRecreater (and the now-unused CompressionSpec import in archive.py); leave a comment at the call site pointing at the decorator mechanism.
  • Document the actual scope of -C in the option help text and in the borg recreate epilog, pointing to borg repo-compress for recompressing existing repository objects.

No behavior change.

🤖 Generated with Claude Code

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

codecov Bot commented Sep 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.67%. Comparing base (0adbb7a) to head (8d9e044).
⚠️ Report is 28 commits behind head on master.
✅ All tests successful. No failed tests found.

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.
📢 Have feedback on the report? Share it here.

@ThomasWaldmann
ThomasWaldmann merged commit c6f5696 into borgbackup:master Sep 2, 2026
41 of 43 checks passed
@ThomasWaldmann
ThomasWaldmann deleted the recreate-compression-cleanup branch September 2, 2026 12:41
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