[Bug 250015] diff -purw fails with 'error: conflicting output format options.'
bugzilla-noreply at freebsd.org
bugzilla-noreply at freebsd.org
Sat Oct 3 20:08:36 UTC 2020
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=250015
Kyle Evans <kevans at freebsd.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |bapt at FreeBSD.org
--- Comment #1 from Kyle Evans <kevans at 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.
More information about the freebsd-bugs
mailing list