From: Tom Jones Subject: Re: diff.git: Add classic diff output To: gameoftrees@openbsd.org Date: Fri, 2 Sep 2022 10:18:01 +0100 On Fri, Sep 02, 2022 at 11:13:27AM +0200, Stefan Sperling wrote: > On Fri, Sep 02, 2022 at 10:57:26AM +0200, Stefan Sperling wrote: > > On Tue, Aug 30, 2022 at 05:32:28PM +0200, Stefan Sperling wrote: > > > On Tue, Aug 30, 2022 at 02:50:24PM +0100, Tom Jones wrote: > > > > Working from diff_output_edscript add support for classic diff output. > > > > The main differences between these two formats is the header > > > > construction for a hunk and selection around which lines that are > > > > output. > > > > > > This is nice, thank you. I have committed it. > > > > > > There is currently no way to enable plain mode when running a compiled > > > diff binary from diff/diff.c. I briefly hacked my local copy to run > > > your code and tested it. It would be nice if this output mode was > > > reachable from the CLI so it could be tested by scripts. > > > > As a follow-up fix, consider the following patch. > > We must update the line offsets array whenever we generate a line > > of diff output. Otherwise, tools like tog would have to process > > the entire diff output again in order to figure out where the > > line-breaks occur. For large diffs which are many mega-bytes > > in size, this can be a huge performance hit. > > > > ok? > Looks good to me - Tom