Skip to content

docs: comment cleanup in logging and logging-sink crates - #3490

Merged
oferchen merged 1 commit into
masterfrom
docs/daemon-filter-precedence-1888
May 1, 2026
Merged

oferchen merged 1 commit into
masterfrom
docs/daemon-filter-precedence-1888

Conversation

@oferchen

@oferchen oferchen commented May 1, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Drop restatement, decorative, and redundant clarifying comments across the logging and logging-sink crates per the project's comment-cleanup rules.
  • Promote a few inline test/clarifying comments to rustdoc on private helpers where they explain non-obvious behaviour (target-matching strategy in RsyncLayer, level-1/level-2 verbosity boundaries).
  • All upstream rsync references, SAFETY invariants, and existing rustdoc are preserved.

Net: 7 files changed, +36 / -64.

Tracks in-progress task #2039.

Test plan

  • cargo fmt --all -- --check
  • CI: fmt+clippy
  • CI: nextest (stable, Linux/Windows/macOS, musl)

Add docs/daemon/filter-precedence.md covering the three filter rule
sources (daemon module config, client CLI, per-directory .rsync-filter),
their evaluation order, the wire format, and a worked example showing
why a client --include cannot override a daemon-side exclude.

Cites build_daemon_filter_rules() in helpers.rs:223, the prepend logic
in transfer.rs:868-879, and the wire encoding in wire.rs, with
references to upstream clientserver.c:874-893 and exclude.c:1658.
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label May 1, 2026
@oferchen
oferchen merged commit 87f2530 into master May 1, 2026
24 checks passed
@oferchen
oferchen deleted the docs/daemon-filter-precedence-1888 branch May 1, 2026 21:08
oferchen added a commit that referenced this pull request Jun 3, 2026
… (#5396)

* test: add interop tests for --iconv with non-ASCII filter rules (#3490)

Verify that filter rules containing non-ASCII patterns interact
correctly with --iconv filename transcoding. Tests cover:

- Exclude patterns with non-ASCII chars preventing iconv-transcoded copy
- Include patterns with non-ASCII chars allowing files under iconv
- Filter evaluation in reverse iconv direction (Latin-1 to UTF-8)
- Surviving files correctly transcoded when filter is active
- Encoding mismatch edge case (UTF-8 pattern vs Latin-1 source names)
- Mixed include/exclude chains with multiple non-ASCII patterns
- Nested directory filtering under iconv

All tests are gated on cfg(all(target_os = "linux", feature = "iconv"))
because macOS/Windows filesystems reject raw non-UTF-8 byte sequences.

* style: apply cargo fmt formatting

* fix: add directory include rule to iconv filter test

The include_non_ascii_pattern_allows_file_under_iconv test used
--include='résumé*' --exclude='*' without a directory traversal
rule. The --exclude='*' matched the source directory itself,
preventing any files from being copied. Add --include='*/' to
permit directory traversal, matching the standard upstream rsync
idiom for include+exclude-all filter chains.

* fix: canonicalize tempdir path in relative-source test for macOS

On macOS, /var is a symlink to /private/var. TempDir creates paths
under /var/folders/... but emit_implied_parents uses symlink_metadata
which returns false for is_dir() on symlink components. This caused the
ancestor assertion to fail looking for a bare "var" directory entry.

Canonicalizing the tempdir path resolves the symlink before building
the test source path, ensuring all ancestor components are real
directories.
oferchen added a commit that referenced this pull request Aug 24, 2026
… (#5396)

* test: add interop tests for --iconv with non-ASCII filter rules (#3490)

Verify that filter rules containing non-ASCII patterns interact
correctly with --iconv filename transcoding. Tests cover:

- Exclude patterns with non-ASCII chars preventing iconv-transcoded copy
- Include patterns with non-ASCII chars allowing files under iconv
- Filter evaluation in reverse iconv direction (Latin-1 to UTF-8)
- Surviving files correctly transcoded when filter is active
- Encoding mismatch edge case (UTF-8 pattern vs Latin-1 source names)
- Mixed include/exclude chains with multiple non-ASCII patterns
- Nested directory filtering under iconv

All tests are gated on cfg(all(target_os = "linux", feature = "iconv"))
because macOS/Windows filesystems reject raw non-UTF-8 byte sequences.

* style: apply cargo fmt formatting

* fix: add directory include rule to iconv filter test

The include_non_ascii_pattern_allows_file_under_iconv test used
--include='résumé*' --exclude='*' without a directory traversal
rule. The --exclude='*' matched the source directory itself,
preventing any files from being copied. Add --include='*/' to
permit directory traversal, matching the standard upstream rsync
idiom for include+exclude-all filter chains.

* fix: canonicalize tempdir path in relative-source test for macOS

On macOS, /var is a symlink to /private/var. TempDir creates paths
under /var/folders/... but emit_implied_parents uses symlink_metadata
which returns false for is_dir() on symlink components. This caused the
ancestor assertion to fail looking for a bare "var" directory entry.

Canonicalizing the tempdir path resolves the symlink before building
the test source path, ensuring all ancestor components are real
directories.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant