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

From:
Stefan Sperling <stsp@stsp.name>
Subject:
Re: diff.git: Fix ed script output
To:
Tom Jones <thj@freebsd.org>
Cc:
gameoftrees@openbsd.org
Date:
Fri, 2 Sep 2022 10:43:15 +0200

Download raw body.

Thread
On Wed, Aug 31, 2022 at 01:24:44PM +0100, Tom Jones wrote:
> I have looked into this. getchange in diff3.c takes any line that starts
> with an integer and treats it as a hunk header. 
> 
> The current diff_output_edscript.c is creating valid classic diff
> headers rather than ed edits. This seems to mean that while the edscript
> output works, it is isn't correct just in the way that diff3 wants.
> 
> I have substituted in the updated diff_output_plain.c from yesterday and
> am able to pass got's `make regress`.
> 
> For this case there is an optimisation where diff_output_plain only
> generates the headers for a hunk, but I'll leave that path for future
> hackers.
> 
> Follows is a diff with the changes I made to got, they are minimal
> beyond copying over the updated diff_output_plain.c

Thanks for digging into this. I've committed your changes to got.git.

A hunk-header-only option for plain mode would be nice to have, it
should speed up merges of large files.

Is your previously proposed ed-script diff for diff.git still valid?
Or will it need to be updated?