Skip to content

fix: wire --ignore-existing, --existing, --max-delete into server path - #2573

Merged
oferchen merged 1 commit into
masterfrom
fix/wire-existing-flags-to-server
Mar 7, 2026
Merged

oferchen merged 1 commit into
masterfrom
fix/wire-existing-flags-to-server

Conversation

@oferchen

@oferchen oferchen commented Mar 7, 2026

Copy link
Copy Markdown
Owner

Summary

  • Wire --ignore-existing, --existing/--ignore-non-existing, and --max-delete=NUM into the server-side parsing and receiver filtering for remote (SSH/daemon) transfers
  • These flags were already sent by the client and handled in local-copy mode, but silently ignored on the remote server side
  • Add ignore_existing, existing_only, max_delete fields to ServerConfig
  • Parse all three in parse_server_long_flags() and register in is_known_server_long_flag()
  • Integrate ignore_existing and existing_only filtering into build_files_to_transfer() parallel stat phase
  • Refactor quick_check_ok_stateless() into quick_check_matches() - takes pre-fetched metadata to avoid redundant stat calls

Upstream references

  • generator.c:1562 - ignore_existing skip when file exists
  • generator.c:1571 - existing_only skip when file absent
  • options.c:2823 - --max-delete=NUM in server_options()

Test plan

  • cargo fmt --all -- --check passes
  • cargo clippy -p transfer -p cli --all-targets --all-features --no-deps -- -D warnings passes
  • cargo nextest run -p transfer --all-features -E 'test(negotiated)' - 23 tests pass
  • CI: fmt+clippy, nextest, Windows, macOS, Linux musl

These three flags were already sent by the client (SSH and daemon) and
handled in the local-copy engine, but the server-side never parsed or
applied them. This caused the flags to be silently ignored during remote
transfers.

Changes:
- Add ignore_existing, existing_only, max_delete fields to ServerConfig
- Parse --ignore-existing, --existing/--ignore-non-existing, and
  --max-delete=NUM in server long-flag parsing (server.rs)
- Register all three in is_known_server_long_flag() so they don't
  interfere with compact flag string discovery
- Wire ignore_existing and existing_only into build_files_to_transfer()
  receiver filtering, integrated with the parallel stat phase
- Refactor quick_check_ok_stateless() into quick_check_matches() that
  takes pre-fetched metadata, enabling a single stat() call to serve
  both existence checks and quick-check comparison

Upstream references:
- generator.c:1562 — ignore_existing skip when file exists
- generator.c:1571 — existing_only skip when file absent
- options.c:2823 — --max-delete=NUM in server_options()
@github-actions github-actions Bot added the bug Something isn't working label Mar 7, 2026
@oferchen
oferchen merged commit a731232 into master Mar 7, 2026
32 checks passed
@oferchen
oferchen deleted the fix/wire-existing-flags-to-server branch March 7, 2026 13:29
oferchen added a commit that referenced this pull request May 1, 2026
#2573)

These three flags were already sent by the client (SSH and daemon) and
handled in the local-copy engine, but the server-side never parsed or
applied them. This caused the flags to be silently ignored during remote
transfers.

Changes:
- Add ignore_existing, existing_only, max_delete fields to ServerConfig
- Parse --ignore-existing, --existing/--ignore-non-existing, and
  --max-delete=NUM in server long-flag parsing (server.rs)
- Register all three in is_known_server_long_flag() so they don't
  interfere with compact flag string discovery
- Wire ignore_existing and existing_only into build_files_to_transfer()
  receiver filtering, integrated with the parallel stat phase
- Refactor quick_check_ok_stateless() into quick_check_matches() that
  takes pre-fetched metadata, enabling a single stat() call to serve
  both existence checks and quick-check comparison

Upstream references:
- generator.c:1562 — ignore_existing skip when file exists
- generator.c:1571 — existing_only skip when file absent
- options.c:2823 — --max-delete=NUM in server_options()
oferchen added a commit that referenced this pull request May 5, 2026
#2573)

These three flags were already sent by the client (SSH and daemon) and
handled in the local-copy engine, but the server-side never parsed or
applied them. This caused the flags to be silently ignored during remote
transfers.

Changes:
- Add ignore_existing, existing_only, max_delete fields to ServerConfig
- Parse --ignore-existing, --existing/--ignore-non-existing, and
  --max-delete=NUM in server long-flag parsing (server.rs)
- Register all three in is_known_server_long_flag() so they don't
  interfere with compact flag string discovery
- Wire ignore_existing and existing_only into build_files_to_transfer()
  receiver filtering, integrated with the parallel stat phase
- Refactor quick_check_ok_stateless() into quick_check_matches() that
  takes pre-fetched metadata, enabling a single stat() call to serve
  both existence checks and quick-check comparison

Upstream references:
- generator.c:1562 — ignore_existing skip when file exists
- generator.c:1571 — existing_only skip when file absent
- options.c:2823 — --max-delete=NUM in server_options()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant