Skip to content

Conversation

@Konmous04
Copy link

Fixes #9262

Added a --stats argument to the prune command to display archive counts (total, kept, pruned).

@codecov
Copy link

codecov bot commented Jan 25, 2026

Codecov Report

❌ Patch coverage is 0% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.53%. Comparing base (3630eaa) to head (c067e8a).
⚠️ Report is 3 commits behind head on 1.4-maint.

Files with missing lines Patch % Lines
src/borg/archiver.py 0.00% 8 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##           1.4-maint    #9271      +/-   ##
=============================================
- Coverage      80.57%   80.53%   -0.04%     
=============================================
  Files             38       38              
  Lines          11256    11264       +8     
  Branches        1771     1772       +1     
=============================================
+ Hits            9070     9072       +2     
- Misses          1616     1623       +7     
+ Partials         570      569       -1     

☔ 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...

if args.stats:
stats_logger = logging.getLogger('borg.output.stats')
stats_logger.info('Archive counts:')
stats_logger.info('Number of archives: %d', len(manifest.archives))
Copy link
Member

Choose a reason for hiding this comment

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

that way, the numbers are left-aligned.

guess I'ld prefer either:

  • no alignment (simplest)
  • right aligned

stats_logger.info('Number of archives: %d', len(manifest.archives))

if args.glob_archives:
stats_logger.info('Number of archives matching pattern: %d', len(archives_checkpoints))
Copy link
Member

Choose a reason for hiding this comment

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

maybe say "globbing pattern" to be more specific.

str(cache),
DASHES, logger=logging.getLogger('borg.output.stats'))

Copy link
Member

Choose a reason for hiding this comment

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

remove

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.

2 participants