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
F82103799: D34912.id.diff
Thu, Apr 25, 2:01 PM
F82022048: D34912.id105028.diff
Wed, Apr 24, 4:28 PM
Unknown Object (File)
Tue, Apr 23, 3:13 PM
Unknown Object (File)
Tue, Apr 23, 12:19 PM
Unknown Object (File)
Fri, Apr 19, 11:22 AM
Unknown Object (File)
Thu, Apr 18, 2:04 PM
Unknown Object (File)
Tue, Apr 16, 10:18 AM
Unknown Object (File)
Mar 7 2024, 10:24 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
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 45181
Build 42069: arc lint + arc unit

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