diff --stats follow-up: size_added/size_removed naming, JSON docs, test timing - #10339
Merged
ThomasWaldmann merged 1 commit intoSep 8, 2026
Merged
Conversation
…the JSON stats line Rename the "Added chunk volume" / "Removed chunk volume" summary lines to "Added size" / "Removed size" and the JSON keys added_chunk_volume / removed_chunk_volume to size_added / size_removed. These totals are the sums over all reported items of what the per-path output calls "added" / "removed" and what --sort-by size_added / size_removed sorts by, so use that existing vocabulary instead of introducing a new one. borgbackup#10327 was not released yet, so nothing depends on the old names. Document the --stats summary line of borg diff --json-lines in docs/internals/frontends.rst, which describes the JSON Lines output for frontends but did not mention it. Also add a granularity_sleep() between the two archives of the diff --stats tests: test_stats_counts_metadata_only_changes expects the input directory to be reported as changed (mtime/ctime), which fails on filesystems with whole-second timestamps (reproduced on HFS+: "Changed items: 2" instead of 3) when both archives are created within the same second. The other tests in that file already sleep there. Follow-up to borgbackup#10327 (borgbackup#796). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #10339 +/- ##
==========================================
- Coverage 87.80% 87.79% -0.01%
==========================================
Files 103 103
Lines 18828 18868 +40
Branches 2906 2914 +8
==========================================
+ Hits 16531 16566 +35
- Misses 1598 1599 +1
- Partials 699 703 +4 ☔ 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.
Follow-up to #10327 (#796), addressing three review findings:
added_chunk_volume/removed_chunk_volumeintroduced new vocabulary for a quantity the rest ofborg diffalready names: the totals are the sums over all reported items of the per-pathadded/removedbyte counts, i.e. of what--sort-by size_added/size_removedsorts by.The lines are now "Added size" / "Removed size" and the JSON keys
size_added/size_removed.diff: add --stats, showing a summary of the differences #10327 is unreleased, so nothing depends on the old names.
docs/internals/frontends.rstdocuments theborg diff --json-linesoutput forfrontend authors, but did not mention the
--statssummary line yet. It now describes the{"stats": {...}}line and its six keys, with an example matching the existing one.test_stats_counts_metadata_only_changesexpects the input directory to be reportedas changed (mtime/ctime), which requires the two archives to be created on different timestamp ticks.
The setup helper did not call
granularity_sleep()like the other tests in the file do; on HFS+(whole-second timestamps) the test failed 8 out of 8 runs with "Changed items: 2". It now sleeps
between the two archives.
Verified locally: ruff and black, the diff test module (26 passed, binary variants skipped), and a
warning-free Sphinx build of the docs.
🤖 Generated with Claude Code