Page MenuHomeFreeBSD

Fix ignore case when diffing recursively
ClosedPublic

Authored by thj on Feb 8 2022, 1:45 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 7 2024, 11:44 PM
Unknown Object (File)
Oct 27 2023, 10:14 PM
Unknown Object (File)
Sep 18 2023, 11:17 AM
Unknown Object (File)
Jun 15 2023, 12:10 PM
Unknown Object (File)
Jun 1 2023, 8:41 PM
Unknown Object (File)
Mar 22 2023, 6:22 PM
Unknown Object (File)
Mar 5 2023, 5:29 PM
Unknown Object (File)
Jan 13 2023, 3:27 AM

Details

Summary

With --ignore-file-name-case we need to compare files regardless of
case. We need to propigate both names down to diffit so we can look up
the correct file when the names differ based on case, otherwise we try
to look up the file using the case from the a tree which might not be
discoverable if its case is different in the b tree..

Test Plan
mkdir a
mkdir b

echo "hello" > a/foo
echo "hello" > b/FOO

set -o xtrace

gdiff -u -r --ignore-file-name-case a b
diff -u -r --ignore-file-name-case a b
$diffcmd -u -r --ignore-file-name-case a b

before diff will report:

diff: b/foo: No such file or directory

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

thj requested review of this revision.Feb 8 2022, 1:45 PM
thj edited the test plan for this revision. (Show Details)

Would be nice to add unit test

When !ignore_file_name_case will dp2->d_name be equal to dp->d_name?

  • Add tests for ignore case
  • Correct path passed to diffit when using Nflag or Pflag
This revision is now accepted and ready to land.Feb 11 2022, 7:17 PM
This revision was automatically updated to reflect the committed changes.