"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

Stefan Sperling <stsp@stsp.name>
Re: diff -p function prototypes regression
Theo Buehler <tb@theobuehler.org>
gameoftrees@openbsd.org, Tom Jones <thj@freebsd.org>
Tue, 22 Aug 2023 12:48:32 +0200

Download raw body.

On Tue, Aug 22, 2023 at 11:57:48AM +0200, Theo Buehler wrote:
> diff -p is a hack, but it usually has helpful additional info.

And I am not trying to keep -p stuck in the way it is now. But the
change we applied did have unintended unfortunate side effects. I assume
FreeBSD's diff now has the same problems as you spotted in Got diff.

BSD diff -p has problems in many areas. Another issue are goto labels in C:

If more thought and work was put into heuristics used by -p it could
be improved much further. For example, if -p took information about
the file's type into account (based on file name extensions that appear
in the diff) then language-specific heuristics could be implemented.
Heuristics for C could then be tweaked without affecting results for other
types of files such as Makefiles.

And such work needs to be done in a way that doesn't cause regressions,
which is the hard part...