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)
Oct 18 2024, 8:39 AM
Unknown Object (File)
Oct 1 2024, 9:14 PM
Unknown Object (File)
Sep 30 2024, 10:54 PM
Unknown Object (File)
Sep 30 2024, 11:17 AM
Unknown Object (File)
Sep 19 2024, 3:52 AM
Unknown Object (File)
Sep 19 2024, 3:08 AM
Unknown Object (File)
Sep 12 2024, 9:35 PM
Unknown Object (File)
Sep 8 2024, 8:58 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.