Repository navigation
fix: let receiver-side rules protect under --delete-excluded, as upstream - #8258
Merged
Merged
Conversation
Carries the session_fork.rs fix from #8253 so this branch's macOS jobs stop failing on the master test-harness race: on EPERM for our own child, SIGKILL the leader before a blocking WNOWAIT wait, and accept a setpgid refusal when the child already leads its own group. The content is identical to #8253, so the two merge without conflict.
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.
Summary
--delete-excludedno longer deletes what a receiver-side rule protects. On a pull or push,--filter='-r *.keep' --delete-excludedused to delete every*.keepin the destination; rsync 3.5.1 keeps them. The cause was an oc-only OR-in inFilterChain::allows_deletion:|| delete_excluded && allows_deletion_when_excluded_removed. It let--delete-excludedoverride any exclude, whatever side the rule was on. The OR-in is removed.rule_matches()has nodelete_excludedterm. The flag acts in exactly one place,exclude.c:1479-1481parse_rule_tok(), which turns an un-modified include/exclude into a sender-side rule as it is parsed, so the receiver ignores it. oc already mirrors that at both parse sites: command-line rules incoreflags.rs(apply_implicit_sender_side_for_delete_excluded), and per-directory merge-file rules infiltersapply_merge_implicit_sender_side. With the OR-in gone, each is the only mechanism for its rule source.crates/transfer/tests/inc_recurse_pull_delete_excluded.rscovers the per-segment incremental-recursion delete (delete_in_segment) across 12 directories. It has five cells: a command-line exclude with and without--delete-excluded, a-rrule under--delete-excluded, and a destination.rsync-filterdir-merge with and without it. Each cell also asserts that every source file arrives and that unrelated extraneous files are deleted.Known, not fixed here: a LOCAL copy has the same bug.
rsync -r --delete --filter='-r *.keep' --delete-excluded src/ dest/keeps the file on 3.5.1 but deletes it on oc. The engine's local filter program carries its own copy of the OR-in as its only--delete-excludedmechanism. That code is replaced when the two filter matchers are consolidated (task 480), and this cell is that work's first proof.Test plan
-r rule, --delete-excludedcell was 0.--exclude=*.tmp --delete-excluded--exclude=*.tmp-r *.keep --delete-excluded-r *.keep: .rsync-filter --delete-excluded: .rsync-filter-rcell fails.flags.rscommand-line sender-side marking disabled: only the command-line exclude cell fails.apply_merge_implicit_sender_sidedisabled: only the dir-merge cell fails.-p filters -p transfer -p core --all-features: 7817 passed, 0 failed, 64 skipped.check_rustfmt_all.py, workspace clippy--all-targets --all-features, no-default clippy forfiltersandtransfer, windows-gnucargo check -p filters -p transfer --all-features --tests,unsafe_owner_deps.py,dead_code_census.py,xtask no-placeholders.Coordination
Conventional commit prefix
fix:Pre-merge checklist
cargo fmt --allrun locally.CHANGELOG.mdupdated (Fixed / Data integrity,#PRNUMto be filled).