You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
diff -r: every file reported as 'Only in' on BOTH sides (even identical files); contents never compared #1344
diff -r (directory recursion) is fundamentally broken on Windows paths: every file present in both directories — even byte-identical ones — is reported as Only in <dirA> AND Only in <dirB>, and file contents are never compared. Single-file diff works correctly.
Environment
diff (WinuxCmd) 1.1.17 shipped with Niubash 1.4.4 (C:/Users/<user>/AppData/Local/Programs/Niubash/winuxcmd/usr/bin/diff.exe)
Windows 10 19045 x64
Minimal repro
setT=%TEMP%\difr
mkdir"%T%\A""%T%\B"echo hello >"%T%\A\f.txt"echo world >"%T%\B\f.txt"echo same >"%T%\A\g.txt"echo same >"%T%\B\g.txt""%LOCALAPPDATA%\Programs\Niubash\winuxcmd\usr\bin\diff.exe" -r "%T%\A""%T%\B"
Actual output
Only in C:/Users/<user>/AppData/Local/Temp/difr/A: f.txt
Only in C:/Users/<user>/AppData/Local/Temp/difr/B: f.txt
Only in C:/Users/<user>/AppData/Local/Temp/difr/A: g.txt
Only in C:/Users/<user>/AppData/Local/Temp/difr/B: g.txt
exit code 1
Expected (GNU diff behavior)
diff -r A/f.txt B/f.txt
1c1
< hello
---
> world
(g.txt identical → no output, exit 0)
Notes
Single-file comparison (diff A/f.txt B/f.txt) produces a correct content diff, so the content-diff engine works; the directory walker fails to match same-named entries between the two trees (possibly a path-normalization issue — note the Only in lines print forward-slash mixed paths while the input was backslash).
diff -r with an MSYS-style path (/tmp/...) fails differently: diff: cannot read directory '/tmp/difr/A' (rc=2), same for /usr/bin/diff inside Niubash.
Workaround we use: compare via md5sum listings + join/comm.
Found during a real two-tree source audit where this produced ~1000 false "Only in" lines and masked nothing being content-compared.
Activity
fix(diff): pair same-name entries in recursive directory comparison (#…
Merge pull request #1414 from unixwin/fix/winx3-diff