Page MenuHomeFreeBSD

diff: Integrate libdiff from OpenBSD GoT.
ClosedPublic

Authored by des on Mar 11 2024, 1:54 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Apr 21, 2:37 AM
Unknown Object (File)
Sat, Apr 20, 4:40 PM
Unknown Object (File)
Sat, Apr 20, 2:37 PM
Unknown Object (File)
Thu, Apr 4, 7:40 PM
Unknown Object (File)
Mar 27 2024, 11:39 AM
Unknown Object (File)
Mar 27 2024, 9:34 AM
Unknown Object (File)
Mar 23 2024, 7:03 AM
Unknown Object (File)
Mar 23 2024, 7:02 AM

Details

Summary

This adds support for two new diff algorithms, Myers diff and Patience
diff.

These algorithms perform a different form of search compared to the
classic Stone algorithm and support escapes when worst case scenarios
are encountered.

Add the -A flag to allow selection of the algorithm, but default to
using the new Myers diff implementation.

The libdiff implementation currently only supports a subset of input and
output options supported by diff. When these options are used, but the
algorithm is not selected, automatically fallback to the classic Stone
algorithm until support for these modes can be added.

Based on work originally done by thj@ with contributions from kevans@.

Sponsored by: Klara, Inc.

Diff Detail

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

Event Timeline

remove spurious verbiage from man page

usr.bin/diff/diff.1
360
usr.bin/diff/diff.1
360

I'm not entirely sure what the comment is trying to say, perhaps @thj can weigh in?

Please fix the man page typo, but otherwise looks good to me

usr.bin/diff/diff.1
360

Myers will try to avoid excessive computation in certain cases and rather than giving the minimal diff it will give a valid, but not completely optimised diff. Other than the typo fix from Ed I'm not really sure how to clarify this more.

This revision is now accepted and ready to land.Mar 27 2024, 9:40 AM
This revision was automatically updated to reflect the committed changes.