diff --git a/src/client/client_cli.c b/src/client/client_cli.c index 1760226..e52cf09 100644 --- a/src/client/client_cli.c +++ b/src/client/client_cli.c @@ -610,9 +610,11 @@ static int apply_table_option(Config* config, const OptionEntry* entry, const ch int parse_args(Config* config, int argc, char* argv[], int* positional_args, int* positional_count) { bool verbose = false; - /* --no-delta seen on the command line: the user explicitly switched the - delta machinery off, so the --fuzzy implication must not override it. */ + /* Explicit --no-delta / --no-incremental seen on the command line: the user + switched part of the delta machinery off, so the --fuzzy implication must + not silently turn it back on. */ bool no_delta = false; + bool no_incremental = false; protocol_set_8_bit_output(config->eight_bit_output); /* Apply output controls before processing other options so their order is irrelevant. */ @@ -644,6 +646,8 @@ int parse_args(Config* config, int argc, char* argv[], int* positional_args, if (strncmp(argv[i], "--no-", strlen("--no-")) == 0) { if (strcmp(argv[i], "--no-delta") == 0) no_delta = true; + else if (strcmp(argv[i], "--no-incremental") == 0) + no_incremental = true; if (apply_negation(config, argv[i]) != 0) return -1; continue; @@ -1077,14 +1081,19 @@ int parse_args(Config* config, int argc, char* argv[], int* positional_args, /* -y/--fuzzy reuses an existing similar-named destination file as the delta * basis, so it is meaningless without the receiver-driven delta path: - * imply --incremental, and --delta unless --whole-file (or an explicit - * --no-delta) switched the delta machinery off. FastSync has delta OFF by - * default (unlike rsync), so a bare --fuzzy must turn it on or it would be - * a silent no-op. --whole-file/--no-delta after --fuzzy therefore leave - * fuzzy inert, matching rsync where --fuzzy only affects delta transfers. */ + * imply --incremental and --delta unless --whole-file or an explicit + * --no-delta / --no-incremental switched the machinery off. FastSync has + * delta OFF by default (unlike rsync), so a bare --fuzzy must turn it on or + * it would be a silent no-op. -W/--no-delta/--no-incremental therefore + * leave fuzzy inert, matching rsync where --whole-file makes fuzzy + * irrelevant (note: unlike the basis-dir options, --fuzzy honors an + * explicit --no-incremental instead of forcing the handshake back on). */ if (config->fuzzy) { - config->use_incremental = true; - if (!config->whole_file && !no_delta) + if (!no_incremental) + config->use_incremental = true; + /* Delta needs the incremental per-file handshake, so an explicit + * --no-incremental also suppresses the delta implication. */ + if (!config->whole_file && !no_delta && !no_incremental) config->use_delta = true; } diff --git a/src/client/usage.c b/src/client/usage.c index 268299b..95dbc41 100644 --- a/src/client/usage.c +++ b/src/client/usage.c @@ -84,7 +84,8 @@ void print_usage(void) { printf(" -y, --fuzzy Use a similar-named file already in the destination\n"); printf(" directory as the delta basis when the destination has no\n"); printf(" usable file at the exact path (saves bandwidth; implies\n"); - printf(" --incremental and --delta; inert with --whole-file)\n"); + printf(" --incremental and --delta; inert with --whole-file,\n"); + printf(" --no-delta, or --no-incremental)\n"); printf(" --no-fuzzy Disable --fuzzy\n"); printf(" --delta-block Delta block size in bytes (default: %d)\n", DELTA_BLOCK_SIZE_DEFAULT);