create: add --exclude-dataless to skip cloud files not materialized locally (1.4-maint)#9755
Merged
ThomasWaldmann merged 1 commit intoJun 10, 2026
Conversation
…ocally, fixes borgbackup#9746 macOS flags files whose content is stored in cloud storage (e.g. iCloud Drive) and not present locally with SF_DATALESS. Reading such a file triggers downloading its content. With --exclude-dataless, borg create checks the flags (cheap, after stat, before open) and skips such files/dirs, so backups do not force a download of all cloud-stored data. stat.SF_DATALESS is only available from Python 3.13 on, so we fall back to the value from macOS' sys/stat.h on older Pythons. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 1.4-maint #9755 +/- ##
=============================================
+ Coverage 81.96% 81.98% +0.01%
=============================================
Files 38 38
Lines 11365 11372 +7
Branches 1793 1794 +1
=============================================
+ Hits 9315 9323 +8
+ Misses 1461 1460 -1
Partials 589 589 ☔ View full report in Codecov by Harness. |
ThomasWaldmann
added a commit
to ThomasWaldmann/borg
that referenced
this pull request
Jun 11, 2026
…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>
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.
Fixes #9746.
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.Notes:
stat.SF_DATALESSonly exists from Python 3.13 on, so there is a fallback to the value from macOS'sys/stat.h(0x40000000).get_flagssinceSF_DATALESScannot be set from userspace.create.rst.inc) left for the usual regeneration.🤖 Generated with Claude Code