SC-18: hard-link detection/preservation wired into pipeline - #10
Merged
Conversation
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.
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.
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.