Page MenuHomeFreeBSD

diff3: allow diff3 ed scripts to generate deletions
ClosedPublic

Authored by thj on Apr 14 2022, 3:28 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Mar 7, 10:24 AM
Unknown Object (File)
Jan 14 2024, 8:36 AM
Unknown Object (File)
Jan 5 2024, 4:12 AM
Unknown Object (File)
Jan 5 2024, 4:12 AM
Unknown Object (File)
Jan 5 2024, 4:12 AM
Unknown Object (File)
Dec 23 2023, 4:44 AM
Unknown Object (File)
Nov 8 2023, 6:07 AM
Unknown Object (File)
Nov 7 2023, 8:54 AM
Subscribers

Details

Summary

diff3 with the -e (ed script flag) can generate line deletions, add support for
deletions and add a test case to exercise this behaviour. This functionality
was unearthed through comparison of bsd diff3 and gnu diff3 output.

Diff Detail

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

Event Timeline

thj requested review of this revision.Apr 14 2022, 3:28 PM
usr.bin/diff3/diff3.c
142

I would use bool. It's a minor nit, but I think this code is unclear as it is.

527

The value of the boolean expression is used only once, so maybe it would be better to evaluate it directly in the function call?
Otherwise I would change the type of delete and move it to the if block - it doesn't seem to be used anywhere else.

usr.bin/diff3/diff3.c
527

I'll convert it to bool, I think having a variable helps make the code a little clearer here.

When -A and -m output modes come in they use the value of delete and I think consistency between the three output modes is a good idea.

  • Only end ed input stream if we aren't issuing a delete
This revision is now accepted and ready to land.Apr 15 2022, 1:55 PM
  • pass bool into prange in change
This revision now requires review to proceed.Apr 15 2022, 1:56 PM
This revision is now accepted and ready to land.Apr 15 2022, 1:57 PM