Skip to content

Added info output to prune command#9271

Merged
ThomasWaldmann merged 4 commits intoborgbackup:1.4-maintfrom
Konmous04:add-prune-stats
Jan 31, 2026
Merged

Added info output to prune command#9271
ThomasWaldmann merged 4 commits intoborgbackup:1.4-maintfrom
Konmous04:add-prune-stats

Conversation

@Konmous04
Copy link

@Konmous04 Konmous04 commented Jan 25, 2026

Fixes #9262.

-v / --info displays archive counts (total, kept, pruned).

@codecov
Copy link

codecov bot commented Jan 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.61%. Comparing base (3630eaa) to head (1414631).
⚠️ Report is 4 commits behind head on 1.4-maint.

Additional details and impacted files
@@              Coverage Diff              @@
##           1.4-maint    #9271      +/-   ##
=============================================
+ Coverage      80.57%   80.61%   +0.03%     
=============================================
  Files             38       38              
  Lines          11256    11260       +4     
  Branches        1771     1771              
=============================================
+ Hits            9070     9077       +7     
+ Misses          1616     1615       -1     
+ Partials         570      568       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@ThomasWaldmann ThomasWaldmann left a comment

Choose a reason for hiding this comment

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

Thanks for the PR, some feedback...

@Konmous04
Copy link
Author

I updated the code according to your suggestions. The stats are now displayed via logger info before the deletion loop.

@ThomasWaldmann
Copy link
Member

BTW, did you practically test it how the output looks like when mixing -v / --list / --stats / --progress in different combinations?

--list and --progress are expected to not look good when used together, but the other combinations should look ok.

@ThomasWaldmann ThomasWaldmann changed the title Added stats to prune command Added info output to prune command Jan 31, 2026
@Konmous04
Copy link
Author

I have updated the code according to your feedback:

Replaced list comprehensions with set operations (len(set(...) - set(...))) for better performance.

Restored the original if args.stats: block at the end that I had accidentally removed.

Verified that the output looks correct when combining -v with --list, --stats, and --progress.

@Konmous04
Copy link
Author

Removed the redundant logger line

@ThomasWaldmann ThomasWaldmann merged commit 260500f into borgbackup:1.4-maint Jan 31, 2026
13 of 14 checks passed
@ThomasWaldmann
Copy link
Member

Thanks @Konmous04!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants