Repository navigation
fix(diff): pair same-name entries in recursive directory comparison (#1344) - #1414
Merged
Merged
Conversation
This was referenced Oct 27, 2026
CI on 718c1c1: only the EXPECT_TRUE(r.stdout_text.empty()) assertion failed (diff_unit_test.cpp:341); exit_code==0 and the no-"Only in" assertions hold on Windows, as does the Wine repro locally. The cluster REPORT section 3 specifies this case as rc=0 + no "Only in"; drop the stricter empty-stdout assertion to match. No product change; no user-visible text change (i18n catalog unaffected).
caomengxuan666
force-pushed
the
fix/winx3-diff
branch
from
October 27, 2026 14:22
3c1125c to
2abf33c
Compare
caomengxuan666
added a commit
that referenced
this pull request
Oct 27, 2026
….1.21 release checklist - packaging/ffi/README.md: DESIGN 4.1 layout on the packaging side (usr/bin/ffi/v1.1.21/winuxcore.dll + tiers.tsv, current.txt pointer, SHA256SUMS.txt incl. the DLL line, keep-last-2 GC, rollback), wpm-index ffi field wiring described (P2, not applied) - packaging/ffi/FFI-EXPERIMENTAL-NOTICE.md: in-package D8 notice - default off, NIU_WINUXCMD_FFI=1 to enable, SmartScreen/Defender notes, signed DLL as the hard gate for non-experimental FFI - packaging/ffi-interim-release-checklist.md: 12 pre-release gates, all honestly marked unmet where unmet (incl. the real CI snapshot for PRs #1414/#1415/#1423), plus the CMake install-rule patch proposal for the coordinator - CMakeLists/CMakePresets/src are outside this prep's file surface and are NOT touched - prep only: no tag, no release
caomengxuan666
marked this pull request as ready for review
October 27, 2026 16:43
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.
Root cause
compare_directory_pair(src/commands/diff.cpp) merges the two sorted directory listings with two take-predicates.take1uses<=, buttake2used a strict<: an entry was taken from side 2 only when it was strictly less than side 1's current entry. For equal names neither side was taken as a pair — both were emitted asOnly in <dir>: <name>and file contents were never compared, sodiff -rreported every same-name file as one-sided on both sides.Fix
One line:
take2's<→<=, so equal names pair up (take both) and flow into the normal file comparison. Plus 5 regression tests intests/unit/diff/diff_unit_test.cpp(diff_recursive_*_issue1344: identical trees stay quiet, differing contents produce a content diff, one-sided entries still reportOnly in, nested subdirectories recurse, missing directory exits 2).Local verification (winx window round 5, Wine mini harness)
Baseline binary (unfixed): the bug reproduces in 5 of 8 repro cases —
diff -ron trees with same-name files printsOnly in A: f.txt/Only in B: f.txtand never a content diff; identical trees are not quiet (rc=1 with spuriousOnly inlines). Controls pass (one-sided entries, single-file diff).Fixed binary: repro 8/8 PASS — content diff
1c1for differing files, identical trees silent rc=0, nested recursion compares contents, backslash paths work, missing directory exits 2.MSYS-style absolute paths (
/tmp/...): probed under Wine, output matches the GNU oracle (record-only; the path-spelling face is a separate item, not this PR).One repro pin was corrected with oracle evidence during verification: the missing-directory case expected
cannot read directory, but GNU diffutils 3.10 printsdiff: <path>: No such file or directory(rc=2) for a missing operand — the product already matched GNU; only the pin changed.Local gtest execution is deferred to this PR's Windows CI (window precedent: the gtest suite needs the full product build). CI failure set will be compared line-by-line against main's own set before merge.
Fixes #1344
CI round 1 (head
718c1c1, run 40452789262)x64: 9 failed / 3233 = main's own 8 (find.issue_1309 + xargs ×7, identical to run 40414608075 on
beb56558) plus one new failure in this PR's own tests:diff_recursive_same_name_identical_files_quiet_issue1344failed only onEXPECT_TRUE(r.stdout_text.empty())(diff_unit_test.cpp:341) — exit code 0 and the no-"Only in" assertions hold on Windows, and the other four new tests pass. The cluster REPORT §3 specifies this case as rc=0 + no "Only in"; the empty-stdout assertion was stricter than spec. Relaxed in3c1125c(tests-only, product untouched). Note: the product's identical-tree stdout on Windows is non-empty in some residue the ctest log does not dump (no "Only in", rc=0) — recorded as a micro-observation, not chased here. arm64 + oracle + compare green; i18n sync skipped (no user-visible text change).