parity: receiver-side per-directory merge rules for --filter/-F (+ merge e/n/w/- modifiers) #315

Closed
opened 2026-09-23 02:10:49 +02:00 by TapTap · 1 comment
Owner

Protocol 2.28/2.29 carries only root-level protect_rules; per-directory .rsync-filter/merge/dir-merge rules are not re-derived on the receiver, so a destination-only entry matching ONLY a per-dir rule is not shielded from --delete. The merge-only e/n/w/- modifiers are accepted-but-ignored.

Work: add a per-directory rule section (path + rule records) to the config/delete-plan carrier, evaluate it in the delete walkers, and implement the e/n/w/- semantics. Closes the --filter=RULE and -F ⚠️ rows.

Files: src/shared/filter.c, src/shared/delete*.c, src/shared/config.[ch] (CONFIG_WIRE_PROTECT_FIELDS). Risk: filter semantics + golden frame + delete-order tests.

Protocol 2.28/2.29 carries only root-level `protect_rules`; per-directory `.rsync-filter`/`merge`/`dir-merge` rules are not re-derived on the receiver, so a destination-only entry matching ONLY a per-dir rule is not shielded from `--delete`. The merge-only `e`/`n`/`w`/`-` modifiers are accepted-but-ignored. **Work:** add a per-directory rule section (path + rule records) to the config/delete-plan carrier, evaluate it in the delete walkers, and implement the `e`/`n`/`w`/`-` semantics. Closes the `--filter=RULE` and `-F` ⚠️ rows. Files: `src/shared/filter.c`, `src/shared/delete*.c`, `src/shared/config.[ch]` (`CONFIG_WIRE_PROTECT_FIELDS`). Risk: filter semantics + golden frame + delete-order tests.
TapTap added the enhancement label 2026-09-23 02:10:49 +02:00
Author
Owner

Fixed in PR #327 (protocol 2.30.0). Per-directory merge rules are now carried on the delete carriers and evaluated deepest-first at the receiver under every delete timing; the merge-only e/n/w/- modifiers are implemented (rsync-verified). A review caught a critical coordinate bug (subdirectory rules never matched, silently deleting protected extras) — fixed by mirroring rules in the destination-relative coordinate, with new subdirectory differential cases for all timings (protect + exclude) that fail pre-fix. Residual: rsync reads the merge file from the destination while FastSync carries the sender's source-side rules, and the merge C (CVS) modifier is unimplemented — so the rows stay ⚠️. Closing as completed.

Fixed in PR #327 (protocol 2.30.0). Per-directory merge rules are now carried on the delete carriers and evaluated deepest-first at the receiver under every delete timing; the merge-only `e`/`n`/`w`/`-` modifiers are implemented (rsync-verified). A review caught a critical coordinate bug (subdirectory rules never matched, silently deleting protected extras) — fixed by mirroring rules in the destination-relative coordinate, with new subdirectory differential cases for all timings (protect + exclude) that fail pre-fix. Residual: rsync reads the merge file from the destination while FastSync carries the sender's source-side rules, and the merge `C` (CVS) modifier is unimplemented — so the rows stay ⚠️. Closing as completed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: TapTap/FastSync#315