Skip to content

Refine merge filter handling in CLI - #1023

Merged
oferchen merged 2 commits into
masterfrom
implement-missing-components-for-oc-rsync-2pgs46
Oct 24, 2025
Merged

oferchen merged 2 commits into
masterfrom
implement-missing-components-for-oc-rsync-2pgs46

Conversation

@oferchen

@oferchen oferchen commented Oct 24, 2025 •

Copy link
Copy Markdown
Owner

Summary

  • embed DirMergeOptions into merge directives so merge filters honor enforced include/exclude and CVS defaults
  • refactor apply_merge_directive to parse merge files through the options-aware helper with recursion protection
  • extend CLI tests to cover merge modifier semantics and updated helper usage

Testing

  • cargo test

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

rsync/crates/cli/src/lib.rs

Lines 4175 to 4180 in 616bed8

fn read_merge_file(path: &Path) -> Result<String, Message> {
fs::read_to_string(path).map_err(|error| {
let text = format!("failed to read filter file '{}': {}", path.display(), error);
rsync_error!(1, text).with_role(Role::Client)
})
}

P1 Badge Avoid forcing merge filter files to be UTF‑8

The refactored apply_merge_directive now reads merge files through read_merge_file (and the STDIN variant just below) which call fs::read_to_string/read_to_string. These APIs return an InvalidData error whenever the file contains bytes that are not valid UTF‑8. Prior code fed the file into read_filter_patterns, which used String::from_utf8_lossy and accepted arbitrary byte sequences. As a result, merge filters containing patterns encoded in the filesystem’s native encoding—or filenames with raw bytes—will now cause the CLI to error out before parsing. To preserve compatibility with existing rsync filters, the reader should operate on raw bytes and perform lossy decoding instead of requiring UTF‑8.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@oferchen
oferchen merged commit 3d60980 into master Oct 24, 2025
@oferchen
oferchen deleted the implement-missing-components-for-oc-rsync-2pgs46 branch October 24, 2025 15:30
oferchen added a commit that referenced this pull request May 1, 2026
…#2048) (#3520)

Investigation only - documents the current sender model, wire-ordering
constraints from upstream rsync 3.4.1, existing reorder/workqueue
infrastructure, a sketched fan-out design, a benchmark plan for the
rsync-profile container, and risks. Recommends prototyping behind a
feature flag with a benchmark gate before any wire-emitting code is
touched. Distinct from #1023 (intra-file) and #1079 (receiver-side).
oferchen added a commit that referenced this pull request May 5, 2026
…#2048) (#3520)

Investigation only - documents the current sender model, wire-ordering
constraints from upstream rsync 3.4.1, existing reorder/workqueue
infrastructure, a sketched fan-out design, a benchmark plan for the
rsync-profile container, and risks. Recommends prototyping behind a
feature flag with a benchmark gate before any wire-emitting code is
touched. Distinct from #1023 (intra-file) and #1079 (receiver-side).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant