Skip to content

SC-18: hard-link detection/preservation wired into pipeline - #10

Merged
iampryce merged 1 commit into
mainfrom
sc-18-hardlink-wiring
Aug 1, 2026
Merged

SC-18: hard-link detection/preservation wired into pipeline#10
iampryce merged 1 commit into
mainfrom
sc-18-hardlink-wiring

Conversation

@iampryce

@iampryce iampryce commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

pipeline.Sender runs sync.DetectHardLinks over the filtered file list, attaching grouping to the existing FrameFileList message - no new round trip. Receiver writes each group's primary member through the normal signature/delta path, links others via sync.ApplyHardLinks. Skips cleanly when HardLinksSupported() is false, degrading to independent copies (verified via os.SameFile).

Added -H/--hard-links flag, defaulting off to match real rsync, gating whether Sender runs DetectHardLinks at all - sync.AttrOptions.HardLinks already existed from SC-8 anticipating exactly this, so this was mostly consulting it rather than new plumbing. Receiver needed no changes, already no-ops on empty groups.

Threaded through all three Sender call sites: local-to-local, SSH, and rsync:// daemon client. Daemon-side module downloads respect the module's own HardLinks policy.

Verified --archive does not imply -H, matching real rsync's -a (-rlptgoD, no H) exactly - proven with real hard-linked files via TestE2E_ArchiveAloneDoesNotImplyHardLinks.

Clean on native Windows and cross-compiled Linux.

pipeline.Sender runs sync.DetectHardLinks over the filtered file list,
attaching grouping to the existing FrameFileList message - no new round
trip. Receiver writes each group's primary member through the normal
signature/delta path, links others via sync.ApplyHardLinks. Skips
cleanly when HardLinksSupported() is false, degrading to independent
copies (verified via os.SameFile).

Added -H/--hard-links flag, defaulting off to match real rsync, gating
whether Sender runs DetectHardLinks at all - sync.AttrOptions.HardLinks
already existed from SC-8 anticipating exactly this, so this was mostly
consulting it rather than new plumbing. Receiver needed no changes,
already no-ops on empty groups.

Threaded through all three Sender call sites: local-to-local, SSH, and
rsync:// daemon client. Daemon-side module downloads respect the
module's own HardLinks policy.

Verified --archive does not imply -H, matching real rsync's -a
(-rlptgoD, no H) exactly - proven with real hard-linked files via
TestE2E_ArchiveAloneDoesNotImplyHardLinks.

Clean on native Windows and cross-compiled Linux.
@iampryce
iampryce requested a review from jasonmiller-cc August 1, 2026 11:09
@iampryce
iampryce merged commit 25abd19 into main Aug 1, 2026
2 checks passed
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.

1 participant