You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

91 lines
2.7 KiB

Index: lib/c-stack.c
--- lib/c-stack.c.orig 2004-03-08 00:51:09 +0100
+++ lib/c-stack.c 2007-09-24 21:12:08 +0200
@@ -63,6 +63,9 @@
#include <stdlib.h>
#include <string.h>
+#if defined(__FreeBSD__)
+#include <sys/types.h>
+#endif
#if HAVE_SYS_RESOURCE_H
/* Include sys/time.h here, because...
SunOS-4.1.x <sys/resource.h> fails to include <sys/time.h>.
-----------------------------------------------------------------------------
Add option "-O" to diff3(1) in order to allow one to display information
about the 2nd file (the ancestor/older one) not just under option "-A",
but also under "-E" and "-X". This way one especially can get the
consise output of "-E" (where only "unmerged" conflicts and overlaps are
shown), but still get the verbose information (introduced with "|||||||
<older-name>") about the ancestor/older file in the flagged/marked
output. This way "diff3 -m -E -O" gives one the best resolution chances
on a 3-way merge without having to deal with the useless (already
"merged") information one would get under "diff3 -m -A". --rse 20070924
Index: man/diff3.1
--- man/diff3.1.orig 2004-04-13 09:07:28 +0200
+++ man/diff3.1 2007-09-24 21:42:43 +0200
@@ -38,6 +38,9 @@
\fB\-a\fR \fB\-\-text\fR
Treat all files as text.
.TP
+\fB\-O\fR
+Always show content of OLDFILE in bracketing output of unmerged changes.
+.TP
\fB\-\-strip\-trailing\-cr\fR
Strip trailing carriage return on input.
.TP
Index: src/diff3.c
--- src/diff3.c.orig 2004-04-12 09:44:35 +0200
+++ src/diff3.c 2007-09-24 21:21:38 +0200
@@ -153,6 +153,9 @@
/* If nonzero, show information for DIFF_2ND diffs. */
static bool show_2nd;
+/* If nonzero, show information for DIFF_2ND on overlaps, too. */
+static bool show_2nd_on_overlap;
+
/* If nonzero, include `:wq' at the end of the script
to write out the file being edited. */
static bool finalwrite;
@@ -234,7 +237,7 @@
textdomain (PACKAGE);
c_stack_action (0);
- while ((c = getopt_long (argc, argv, "aeimvx3AEL:TX", longopts, 0)) != -1)
+ while ((c = getopt_long (argc, argv, "aeimvx3AEL:TXO", longopts, 0)) != -1)
{
switch (c)
{
@@ -269,6 +272,9 @@
case 'e':
incompat++;
break;
+ case 'O':
+ show_2nd_on_overlap = true;
+ break;
case 'T':
initial_tab = true;
break;
@@ -1527,7 +1533,7 @@
leading_dot = false;
if (type == DIFF_ALL)
{
- if (show_2nd)
+ if (show_2nd || show_2nd_on_overlap)
{
/* Append lines from FILE1. */
fprintf (outputfile, "||||||| %s\n", file1);
@@ -1665,7 +1671,7 @@
D_RELLEN (b, mapping[FILE0], i), outputfile);
}
- if (show_2nd)
+ if (show_2nd || show_2nd_on_overlap)
{
/* Put in lines from FILE1 with bracket. */
fprintf (outputfile, format_2nd, file1);