Page MenuHomeFreeBSD

diff3: make the diff3 -E -m and diff3 -m behaviour match gnu diff3
ClosedPublic

Authored by bapt on Sep 5 2023, 11:28 AM.
Tags
None
Referenced Files
F102601013: D41730.diff
Thu, Nov 14, 3:29 PM
Unknown Object (File)
Tue, Nov 12, 7:24 PM
Unknown Object (File)
Fri, Nov 8, 12:54 PM
Unknown Object (File)
Fri, Nov 8, 9:39 AM
Unknown Object (File)
Thu, Nov 7, 4:27 PM
Unknown Object (File)
Thu, Nov 7, 3:36 AM
Unknown Object (File)
Wed, Nov 6, 9:23 AM
Unknown Object (File)
Sun, Nov 3, 5:23 AM
Subscribers

Details

Summary

In gnu diff3 3 way merging files where the new file and the target are
already the same will die and show what has failed to be merged except
if -E is passed in argument, in this case it will finish the merge.

This difference in behaviour was breaking one of the etcupdate testcase
with bsd diff3

Diff Detail

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

Event Timeline

bapt requested review of this revision.Sep 5 2023, 11:28 AM
usr.bin/diff3/tests/Makefile
26–27

these files missing from review

Hmm, I already get matching output between diff3 in main and gdiff3 with -m and -E -m, e.g.

$ diff3 -m -L 1 -L 2 -L 3 out.txt fbsdid1.txt fbsdid2.txt
<<<<<<< 2
# $FreeBSD: head/local 12000 jhb $
=======
# $FreeBSD: head/local 12345 jhb $
>>>>>>> 3

this is a file

these are some local mods to the file

Oops, I actually had an old copy of GNU diff3 installed

It seems the functionality provided by -E isn't obvious from the (GNU diff3) man page, but this does provide parity with the implementation

This revision is now accepted and ready to land.Sep 5 2023, 4:06 PM