Skip to content

feat: promote whole_file=1 when --checksum-choice=none#4066

Merged
oferchen merged 2 commits into
masterfrom
feat/checksum-choice-none-whole-file-2139
May 14, 2026
Merged

feat: promote whole_file=1 when --checksum-choice=none#4066
oferchen merged 2 commits into
masterfrom
feat/checksum-choice-none-whole-file-2139

Conversation

@oferchen
Copy link
Copy Markdown
Owner

Summary

  • Closes G1 from the compatibility-flags mutual-exclusion audit.

  • Adds StrongChecksumAlgorithm::None and accepts --checksum-choice=none (case-insensitive, also via --cc=none), forwarding the value to remote peers.

  • ClientConfigBuilder::build now promotes whole_file to Some(true) whenever checksum_choice.transfer_is_none(), mirroring upstream target/interop/upstream-src/rsync-3.4.1/checksum.c:197-198:

    if (xfer_sum_nni->num == CSUM_NONE)
        whole_file = 1;

    The assignment is unconditional upstream, so an explicit --no-whole-file is silently overridden. The delta pipeline cannot run without a transfer checksum, so whole-file is the only valid mode.

Refs #2139, #2140, #2141.

Test plan

  • cargo fmt --all clean.
  • CI: fmt + clippy.
  • CI: nextest covers new unit tests in crates/core/src/client/config/builder/tests.rs (checksum_choice_none_promotes_whole_file, checksum_choice_none_overrides_explicit_no_whole_file, checksum_choice_md5_leaves_whole_file_untouched) and crates/core/src/client/config/enums/checksum.rs (parse_none, transfer_is_none_false_for_other_algorithms).
  • CI: nextest covers new CLI integration tests in crates/cli/tests/option_combinations_flags.rs (test_checksum_choice_none_parses, test_checksum_choice_none_via_cc_alias).
  • CI: cross-platform matrix (Linux musl, macOS, Windows).
  • CI: interop suite confirms --checksum-choice=none round-trips against upstream rsync 3.4.1.

Diff scope

8 files, +146 / -29.

Mirrors upstream rsync 3.4.1 behaviour at checksum.c:197-198 where
parse_checksum_choice unconditionally sets whole_file = 1 when the
negotiated transfer checksum is CSUM_NONE. The delta algorithm cannot
run without a transfer checksum, so whole-file transfer is the only
valid mode.

Changes:
- Add StrongChecksumAlgorithm::None and accept `none` (case-insensitive)
  via --checksum-choice/--cc, forwarding it to the remote peer.
- ClientConfigBuilder::build now promotes whole_file to Some(true)
  whenever checksum_choice.transfer_is_none(); explicit --no-whole-file
  is silently overridden (matching upstream's unconditional assignment).
- Regression tests at the builder layer
  (checksum_choice_none_promotes_whole_file,
  checksum_choice_none_overrides_explicit_no_whole_file) and at the CLI
  parser layer (test_checksum_choice_none_parses, _via_cc_alias).
- Refresh the mutual-exclusion audit matrix and oc-rsync(1) man page so
  `none` is documented; mark G1 RESOLVED.

Closes #2139, #2140, #2141.
@github-actions github-actions Bot added the enhancement New feature or request label May 14, 2026
…e-none-whole-file-2139

# Conflicts:
#	docs/audits/compatibility-flags-mutual-exclusion-matrix.md
@oferchen oferchen merged commit eeb2821 into master May 14, 2026
45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant