Repository navigation
feat(cli): add --inc-recursive-send opt-in flag for sender INC_RECURSE (#1862) - #3528
Merged
Merged
Conversation
#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.
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.
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.
Closes #1862.
Summary
--inc-recursive-sendCLI 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.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 remainscrates/transfer/src/setup/capability.rs::build_capability_string().crates/transfer/src/generator/is exercised end-to-end when the flag is set; receiver-direction negotiation is unchanged. Comments and module docs cite upstreamcompat.c:720 set_allow_inc_recurse()andoptions.c:3003-3050 maybe_add_e_option().Test plan
cargo fmt --all -- --checkcargo 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.