Skip to content

feat(cli): add --inc-recursive-send opt-in flag for sender INC_RECURSE (#1862) - #3528

Merged
oferchen merged 2 commits into
masterfrom
feat/inc-recurse-sender-flag-1862
May 1, 2026
Merged

oferchen merged 2 commits into
masterfrom
feat/inc-recurse-sender-flag-1862

Conversation

@oferchen

@oferchen oferchen commented May 1, 2026

Copy link
Copy Markdown
Owner

Closes #1862.

Summary

  • Adds the --inc-recursive-send CLI flag that advertises the 'i' INC_RECURSE capability bit when oc-rsync acts as the sender; default off so push transfers continue to suppress the capability while sender-side INC_RECURSE is validated against upstream rsync 3.0.9 / 3.1.3 / 3.4.1.
  • Plumbs the flag through ParsedArgs -> ConfigInputs -> ClientConfig::inc_recursive_send() and updates both SSH (RemoteInvocationBuilder) and daemon (build_full_daemon_args) capability-string callsites to honour the opt-in. Single source of truth for the capability string remains crates/transfer/src/setup/capability.rs::build_capability_string().
  • Existing sender-side state machine in crates/transfer/src/generator/ is exercised end-to-end when the flag is set; receiver-direction negotiation is unchanged. Comments and module docs cite upstream compat.c:720 set_allow_inc_recurse() and options.c:3003-3050 maybe_add_e_option().

Test plan

  • cargo fmt --all -- --check
  • cargo nextest run -p core -E 'test(/inc_recursive_send/) | test(/inc_recurse/) | test(/build_full_args_pull/) | test(/build_full_args_push/) | test(/ssh_sender/) | test(/ssh_receiver_unaffected/) | test(/builds_sender_invocation/) | test(/builds_receiver_invocation/)' - 12 passed.
  • cargo nextest run -p cli -E 'test(/inc_recursive_send/) | test(/qsort/)' - 4 passed.
  • cargo nextest run -p transfer -E 'test(/capability_string/)' - 5 passed.
  • cargo nextest run -p cli -E 'test(arguments)' - 519 passed.
  • cargo nextest run -p core -E 'test(daemon_transfer) | test(invocation)' - 258 passed.
  • cargo nextest run -p core -E 'test(config)' - 620 passed.
  • CI required checks: fmt+clippy, nextest (stable), Windows (stable), macOS (stable), Linux musl (stable), interop.

#1862)

Add a `--inc-recursive-send` CLI flag that, when set, advertises the `'i'`
INC_RECURSE capability bit when oc-rsync is acting as the sender. Default
off so existing push transfers continue to suppress the capability while
sender-side incremental recursion is validated against upstream rsync
3.0.9 / 3.1.3 / 3.4.1.

The sender-side state machine and segment scheduler are already
implemented in `crates/transfer/src/generator/`; this flag exposes them
end-to-end for interop testing without changing default behaviour.

The flag is plumbed from the CLI through ParsedArgs and ConfigInputs to
ClientConfig::inc_recursive_send(). Both SSH (RemoteInvocationBuilder)
and daemon (build_full_daemon_args) callers now compute
allow_inc_recurse as `we_are_receiver || (we_are_sender &&
inc_recursive_send)` when invoking `build_capability_string()`. The
single source of truth for the capability string remains
`crates/transfer/src/setup/capability.rs::build_capability_string()`.

Tests:
- ClientConfigBuilder default + setter + clear paths.
- CLI parser default + long-flag.
- SSH builder: sender omits 'i' by default; sender advertises 'i' when
  flag set; receiver direction unaffected.
- Daemon arguments: push omits 'i' by default; push advertises 'i' when
  flag set; pull continues to advertise 'i' regardless of flag.

upstream: compat.c:720 set_allow_inc_recurse() - capability gate.
upstream: options.c:3003-3050 maybe_add_e_option() - capability string.
@github-actions github-actions Bot added the enhancement New feature or request label May 1, 2026
@oferchen
oferchen merged commit ab1cd8d into master May 1, 2026
41 checks passed
@oferchen
oferchen deleted the feat/inc-recurse-sender-flag-1862 branch May 1, 2026 21:08
oferchen added a commit that referenced this pull request May 5, 2026
#1862) (#3528)

Add a `--inc-recursive-send` CLI flag that, when set, advertises the `'i'`
INC_RECURSE capability bit when oc-rsync is acting as the sender. Default
off so existing push transfers continue to suppress the capability while
sender-side incremental recursion is validated against upstream rsync
3.0.9 / 3.1.3 / 3.4.1.

The sender-side state machine and segment scheduler are already
implemented in `crates/transfer/src/generator/`; this flag exposes them
end-to-end for interop testing without changing default behaviour.

The flag is plumbed from the CLI through ParsedArgs and ConfigInputs to
ClientConfig::inc_recursive_send(). Both SSH (RemoteInvocationBuilder)
and daemon (build_full_daemon_args) callers now compute
allow_inc_recurse as `we_are_receiver || (we_are_sender &&
inc_recursive_send)` when invoking `build_capability_string()`. The
single source of truth for the capability string remains
`crates/transfer/src/setup/capability.rs::build_capability_string()`.

Tests:
- ClientConfigBuilder default + setter + clear paths.
- CLI parser default + long-flag.
- SSH builder: sender omits 'i' by default; sender advertises 'i' when
  flag set; receiver direction unaffected.
- Daemon arguments: push omits 'i' by default; push advertises 'i' when
  flag set; pull continues to advertise 'i' regardless of flag.

upstream: compat.c:720 set_allow_inc_recurse() - capability gate.
upstream: options.c:3003-3050 maybe_add_e_option() - capability string.
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