https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=250015

Kyle Evans <kev...@freebsd.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |b...@freebsd.org

--- Comment #1 from Kyle Evans <kev...@freebsd.org> ---
(In reply to Ed Maste from comment #0)

Hmm... this is unfortunate. -p sets the format to context, which is
incompatible with -u. I note that the following is what GNU diff appears to do:

kevans91:~/grep$ diff -p A B
*** A   2020-10-03 15:02:53.072790765 -0500
--- B   2020-10-03 15:03:00.652785502 -0500
***************
*** 1,7 ****
  A
  B
! C
! D
  E
  F
  G
--- 1,7 ----
  A
  B
! X
! Y
  E
  F
  G
kevans91:~/grep$ diff -pu A B
--- A   2020-10-03 15:02:53.072790765 -0500
+++ B   2020-10-03 15:03:00.652785502 -0500
@@ -1,7 +1,7 @@
 A
 B
-C
-D
+X
+Y
 E
 F
 G
kevans91:~/grep$ diff -up A B
--- A   2020-10-03 15:02:53.072790765 -0500
+++ B   2020-10-03 15:03:00.652785502 -0500
@@ -1,7 +1,7 @@
 A
 B
-C
-D
+X
+Y
 E
 F
 G

I suspect the answer here is that we should leave the diff_format as D_UNSET,
then after all option processing default it to D_CONTEXT if it's still unset
and D_PROTOTYPE is set. CC'ing bapt@ to get a second opinion.

I also note that GNU diff doesn't appear to check the format at all for -p, so
we should probably stop that as well:

kevans91:~/grep$ diff -qp A B
Files A and B differ
kevans91:~/grep$ diff -pq A B
Files A and B differ

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"

Reply via email to