Skip to content

diff: quote special file names in headers - #325

Open
sylvestre wants to merge 1 commit into
diff-recursivefrom
diff-quote-names
Open

sylvestre wants to merge 1 commit into
diff-recursivefrom
diff-quote-names

Conversation

@sylvestre

Copy link
Copy Markdown
Collaborator

Stack created with GitHub Stacks CLI • Give Feedback 💬

@sylvestre
sylvestre added this pull request to stack #328 October 24, 2026 13:02
@sylvestre
sylvestre marked this pull request as ready for review October 24, 2026 13:14
Copilot AI balanced review requested due to automatic review settings October 24, 2026 13:14

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

Copilot AI balanced review requested due to automatic review settings October 24, 2026 20:13

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

Copilot AI balanced review requested due to automatic review settings October 25, 2026 08:41

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

Copilot AI balanced review requested due to automatic review settings October 25, 2026 09:09

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

Should make test filename-quoting pass.
Copilot AI balanced review requested due to automatic review settings November 2, 2026 08:31

Copilot AI 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.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

3 open issues

Review effort: Lite

Comment thread src/dir_diff.rs
.map(OsString::as_os_str)
.chain([from, to])
{
for arg in self.option_args {
Comment thread src/utils.rs
pub fn quote_file_name(name: &[u8]) -> Cow<'_, [u8]> {
const SPECIAL_BACKSLASH: bool = cfg!(not(windows));
let needs_quotes = |byte: u8| {
byte <= b' ' || byte == b'"' || (byte == b'\\' && SPECIAL_BACKSLASH) || byte >= 0x80
Comment thread src/utils.rs
continue;
}
byte if needs_quotes(byte) => {
quoted.extend_from_slice(format!("\\{byte:03o}").as_bytes());
@codspeed

codspeed Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will degrade performance by 6.91%

3 warnings

⚠️ 24 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

⚠️ 19 benchmarks with a significant change ran on different hardware

Their base and head results were measured on machines with a different CPU, core count or memory, so the changes might not come from the code. Run base and head on the same runner type.

Learn more about Macro Runners

See affected benchmarks

⚠️ 19 benchmarks with a significant change ran in a different software environment

Their base and head results were measured with a different OS or toolchain, such as compiler, runtime or library versions, so the changes might come from this difference rather than from the code. Open an affected benchmark to see what changed.

See affected benchmarks

⚡ 3 improved benchmarks
❌ 16 regressed benchmarks
✅ 7 untouched benchmarks

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Benchmark BASE HEAD Efficiency
❌ cmd_diff_release_equal[25000] 24.3 µs 27.7 µs -12.33%
❌ cmd_diff_gnu_equal[25000] 22.9 µs 25.9 µs -11.4%
❌ cmd_diff_gnu_equal[10000] 23 µs 25.8 µs -11.01%
❌ cmd_cmp_release_equal[25000] 24.4 µs 27.2 µs -10.39%
❌ cmd_cmp_gnu_equal[25000] 22.9 µs 25.6 µs -10.38%
❌ cmd_cmp_gnu_equal[10000] 23 µs 25.6 µs -10.16%
❌ cmd_diff_release_equal[1000] 24.7 µs 27.5 µs -10.16%
❌ cmd_diff_gnu_equal[100] 22.6 µs 25 µs -9.95%
❌ cmd_diff_release_equal[10000] 24.2 µs 26.9 µs -9.89%
❌ cmd_cmp_release_equal[1000] 24.6 µs 27.3 µs -9.79%
❌ cmd_diff_gnu_equal[1000] 22.6 µs 25 µs -9.52%
❌ cmd_cmp_release_equal[10000] 24.7 µs 27.2 µs -9.17%
❌ cmd_diff_release_equal[100] 24.6 µs 27 µs -9.14%
❌ cmd_cmp_release_equal[100] 25.3 µs 27.1 µs -6.67%
❌ cmd_cmp_gnu_equal[100] 22.8 µs 24.4 µs -6.66%
❌ cmd_cmp_gnu_equal[1000] 22.8 µs 24.3 µs -6.24%
⚡ cmp_parser 12.4 µs 10.7 µs +15.11%
⚡ diff_parser 6.1 ms 5.7 ms +7.89%
⚡ cmp_compare_files_different[100] 79.3 µs 76.8 µs +3.22%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing diff-quote-names (5e71b16) with diff-recursive (2cfca73)1

Open in CodSpeed

Footnotes

  1. No successful run was found on diff-recursive (7cada7e) during the generation of this report, so 3fb615a was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown

GNU diffutils testsuite comparison:

Test results comparison:
  Current:   TOTAL: 33 / PASSED: 16 / FAILED: 13 / SKIPPED: 4
  Reference: TOTAL: 33 / PASSED: 8 / FAILED: 21 / SKIPPED: 4

Changes from main branch:
  TOTAL: +0
  PASSED: +8
  FAILED: -8

Test improvements (8):
  + binary
  + colors
  + excess-slash
  + filename-quoting
  + function-line-vs-leading-space
  + label-vs-func
  + new-file
  + stdin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants