create: add --exclude-dataless to skip cloud files not materialized locally#9756
Merged
ThomasWaldmann merged 1 commit intoJun 11, 2026
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #9756 +/- ##
==========================================
+ Coverage 84.86% 84.88% +0.01%
==========================================
Files 92 92
Lines 14970 14979 +9
Branches 2234 2236 +2
==========================================
+ Hits 12705 12715 +10
Misses 1571 1571
+ Partials 694 693 -1 ☔ View full report in Codecov by Harness. |
…ocally Ports borgbackup#9755 (1.4-maint) to master. macOS flags files whose content lives in cloud storage (e.g. iCloud Drive) and is not present locally with SF_DATALESS. Reading such a file triggers downloading its content. This adds --exclude-dataless to borg create: the flags are checked right after stat() and before any open(), so excluded files/dirs never get materialized. Skipped paths are reported with the usual 'x' status, analogous to --exclude-nodump. Notes: - stat.SF_DATALESS only exists from Python 3.13 on, so there is a fallback to the value from macOS' sys/stat.h (0x40000000). - The check covers directories too (they can also be dataless), and we skip before opening/recursing into them. - Test fakes get_flags via monkeypatch since SF_DATALESS cannot be set from userspace. - Fish shell completion updated; bash/zsh completions don't exist in master. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
0e155ce to
f484741
Compare
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.
Ports #9755 to master.
macOS flags files whose content lives in cloud storage (e.g. iCloud Drive) and is not present locally with
SF_DATALESS. Reading such a file triggers downloading its content.This adds
--exclude-datalesstoborg create: the flags are checked right afterstat()and before anyopen(), so excluded files/dirs never get materialized. Skipped paths are reported with the usualxstatus, analogous to--exclude-nodump.Adaptation for master
In master,
archiver.pywas split intoarchiver/and the nodump exclusion moved intomaybe_exclude_by_attr()inarchive.py— which runs after the file is opened. Opening a dataless file triggers the cloud download, soSF_DATALESScannot be handled there. The check is placed in_rec_walk()right afterstat()and before the file/dir branch, matching the spirit of the 1.4-maint PR.Notes
stat.SF_DATALESSonly exists from Python 3.13 on; falls back to0x40000000from macOS'sys/stat.h.OsOpen/ recursion.get_flagsviamonkeypatchsinceSF_DATALESScannot be set from userspace.🤖 Generated with Claude Code