Skip to content

SC-11: dry-run mode (--dry-run / -n) - #11

Merged
iampryce merged 1 commit into
mainfrom
sc-11-dry-run
Aug 1, 2026
Merged

SC-11: dry-run mode (--dry-run / -n)#11
iampryce merged 1 commit into
mainfrom
sc-11-dry-run

Conversation

@iampryce

@iampryce iampryce commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Only Receiver needed dry-run awareness - Sender's planning work runs unconditionally regardless of dry-run. All 8 write call sites in Receiver (directory/symlink creation, ApplyAttributes for symlinks/ dirs/files, ApplyHardLinks, WriteFile) individually gated behind dry-run - a disclosed, deliberate divergence from real rsync's docs, since grsync has no cheap size+mtime shortcut to skip it the way real rsync's default mode does (pre-existing architectural choice from SC-3/SC-16, not something to invent here).

New -i/--itemize-changes flag implementing real rsync's YXcstpoguax format, verified against the actual man page, scoped honestly to what grsync tracks (u/a/x always ., no checksum-gated c). Added an h code for hard-link secondaries beyond the ticket's explicit list, since SC-18 already computes that grouping and >f+++++++++ would otherwise misrepresent a linked file as an ordinary new one.

Dry-run safety verified across all three transports. Itemize/verbose output works for local, SSH (new stderr passthrough in transport.Session), and daemon-GET - daemon-PUT has no channel back to the client once the handshake ends, disclosed explicitly (README + a one-time CLI notice) rather than silently broken or over-engineered.

TestReceiver_DryRunMakesNoFilesystemChanges proves zero filesystem changes against a tree exercising all 8 write paths. Dry-run vs. real-run itemize output proven byte-identical at pipeline and CLI level.

Clean on native Windows and cross-compiled Linux.

Only Receiver needed dry-run awareness - Sender's planning work runs
unconditionally regardless of dry-run. All 8 write call sites in
Receiver (directory/symlink creation, ApplyAttributes for symlinks/
dirs/files, ApplyHardLinks, WriteFile) individually gated behind
dry-run - a disclosed, deliberate divergence from real rsync's docs,
since grsync has no cheap size+mtime shortcut to skip it the way real
rsync's default mode does (pre-existing architectural choice from
SC-3/SC-16, not something to invent here).

New -i/--itemize-changes flag implementing real rsync's YXcstpoguax
format, verified against the actual man page, scoped honestly to what
grsync tracks (u/a/x always ., no checksum-gated c). Added an h code
for hard-link secondaries beyond the ticket's explicit list, since
SC-18 already computes that grouping and >f+++++++++ would otherwise
misrepresent a linked file as an ordinary new one.

Dry-run safety verified across all three transports. Itemize/verbose
output works for local, SSH (new stderr passthrough in
transport.Session), and daemon-GET - daemon-PUT has no channel back to
the client once the handshake ends, disclosed explicitly (README + a
one-time CLI notice) rather than silently broken or over-engineered.

TestReceiver_DryRunMakesNoFilesystemChanges proves zero filesystem
changes against a tree exercising all 8 write paths. Dry-run vs.
real-run itemize output proven byte-identical at pipeline and CLI
level.

Clean on native Windows and cross-compiled Linux.
@iampryce
iampryce requested a review from jasonmiller-cc August 1, 2026 12:39
@iampryce
iampryce merged commit 5ab2e54 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