GNU bug report logs - #29510
3-way merge, diff3 lacking features

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: diffutils; Reported by: Lluís Batlle i Rossell <viric@HIDDEN>; dated Thu, 30 Nov 2017 13:55:02 UTC; Maintainer for diffutils is bug-diffutils@HIDDEN.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 30 Nov 2017 13:54:59 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Nov 30 08:54:59 2017
Received: from localhost ([127.0.0.1]:37658 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eKPIk-0000bV-JD
	for submit <at> debbugs.gnu.org; Thu, 30 Nov 2017 08:54:58 -0500
Received: from eggs.gnu.org ([208.118.235.92]:52914)
 by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from
 <4e01d929.AEMASbSfssgAAAAAAAAAAGyqGxEAARpcY_sAAAAAAAeRJgBaIA2O@HIDDEN>)
 id 1eKPIh-0000bI-8d
 for submit <at> debbugs.gnu.org; Thu, 30 Nov 2017 08:54:51 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from
 <4e01d929.AEMASbSfssgAAAAAAAAAAGyqGxEAARpcY_sAAAAAAAeRJgBaIA2O@HIDDEN>)
 id 1eKPIW-0006ZP-AB
 for submit <at> debbugs.gnu.org; Thu, 30 Nov 2017 08:54:46 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_20,T_DKIM_INVALID
 autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:37571)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from
 <4e01d929.AEMASbSfssgAAAAAAAAAAGyqGxEAARpcY_sAAAAAAAeRJgBaIA2O@HIDDEN>)
 id 1eKPIW-0006ZH-67
 for submit <at> debbugs.gnu.org; Thu, 30 Nov 2017 08:54:40 -0500
Received: from eggs.gnu.org ([2001:4830:134:3::10]:43880)
 by lists.gnu.org with esmtp (Exim 4.71) (envelope-from
 <4e01d929.AEMASbSfssgAAAAAAAAAAGyqGxEAARpcY_sAAAAAAAeRJgBaIA2O@HIDDEN>)
 id 1eKPIU-00055N-Km
 for bug-diffutils@HIDDEN; Thu, 30 Nov 2017 08:54:39 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from
 <4e01d929.AEMASbSfssgAAAAAAAAAAGyqGxEAARpcY_sAAAAAAAeRJgBaIA2O@HIDDEN>)
 id 1eKPIO-0006Vs-QD
 for bug-diffutils@HIDDEN; Thu, 30 Nov 2017 08:54:38 -0500
Received: from o174.p8.mailjet.com ([87.253.233.174]:43971)
 by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from
 <4e01d929.AEMASbSfssgAAAAAAAAAAGyqGxEAARpcY_sAAAAAAAeRJgBaIA2O@HIDDEN>)
 id 1eKPIO-0006Uy-Ec
 for bug-diffutils@HIDDEN; Thu, 30 Nov 2017 08:54:32 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; q=dns/txt;
 d=viric.name; i=viric@HIDDEN; s=mailjet;
 h=message-id:mime-version:from:to:subject:date:list-unsubscribe:x-accept-language:
 x-csa-complaints:x-mj-mid:content-type:content-disposition:content-transfer-encoding;
 bh=3tUhwmixU1g7WJXmhQnQVjBsmcN5IL8XsOgJNUK8om8=;
 b=iZXm6KhTu8m8FZ9W4+LCz9Nh+a9vteY5Iam2MF/+RdG1QLqiAfloam6Z3
 Emymua/LvGxv04dTUl4OrETP0S3BVG3TvZOPccbLsM/4dWhxOnCegXTt01a+
 hiCt1lwmhvLoIGEIhU59iT+4ttrpHqy7JR8SmyVX2pQPU1Pb943vqk=
Message-Id: <4e01d929.AEMASbSfssgAAAAAAAAAAGyqGxEAARpcY_sAAAAAAAeRJgBaIA2O@HIDDEN>
MIME-Version: 1.0
From: =?UTF-8?q?Llu=C3=ADs_Batlle_i_Rossell?= <viric@HIDDEN>
To: bug-diffutils@HIDDEN
Subject: 3-way merge, diff3 lacking features
Date: Thu, 30 Nov 2017 14:54:21 +0100
X-Accept-Language: ca, es, eo, ru, en, jbo, tokipona
X-CSA-Complaints: whitelist-complaints@HIDDEN
X-MJ-Mid: AEMASbSfssgAAAAAAAAAAGyqGxEAARpcY_sAAAAAAAeRJgBaIA2Opu1yhLSMRC60kfPLGkG6oAAHNTE
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
 [fuzzy]
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -4.0 (----)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -4.0 (----)

Hello,

I've been using diff3 to do 3-way merges... and I failed to make it work
as I wanted, with properly bracketed conflicts. "git merge-file" works
much better. I wrote a summary where you can see how "git merge-file"
works better, only annotating the conflicting parts with full detail.
diff3 either brackets too much or it misses details.

Maybe I just fail to know how to operate diff3; please let me know.

Here goes the summary; "-----" lines means nonexistant. It is a screen ca=
pture
of vimdiff.

(web version: http://sprunge.us/hBjJ)

Source:

		 local.c                    base.c                   remote.c

  #include <stdio.h>      |  #include <stdio.h>      |  #include <stdio.h=
>
  ------------------------|  #include <stdlib.h>     |  -----------------=
-------
                          |                          |
  int main()              |  int main()              |  int main()
  {                       |  {                       |  {
      echo 2;             |  ------------------------|      echo 1;
  }                       |  }                       |  }
  ------------------------|  ------------------------|
  ------------------------|  ------------------------|
  ------------------------|  ------------------------|
  ------------------------|  ------------------------|  #include <hola.h>


diff3 -m local.c base.c remote.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
#include <stdio.h>
<<<<<<< base.c
#include <stdlib.h>
=3D=3D=3D=3D=3D=3D=3D
>>>>>>> remote.c

int main()
{
<<<<<<< local.c
    echo 2;
||||||| base.c
=3D=3D=3D=3D=3D=3D=3D
    echo 1;
>>>>>>> remote.c
}



#include <hola.h>
------------------------------------------------------------

diff3 -3 -m local.c base.c remote.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
#include <stdio.h>

int main()
{
    echo 2;
}



#include <hola.h>

------------------------------------------------------------

diff3 -x -m local.c base.c remote.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
#include <stdio.h>

int main()
{
    echo 1;
}
------------------------------------------------------------

diff3 -X -m local.c base.c remote.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
#include <stdio.h>

int main()
{
<<<<<<< local.c
    echo 2;
=3D=3D=3D=3D=3D=3D=3D
    echo 1;
>>>>>>> remote.c
}
------------------------------------------------------------

git merge-file -p local.c base.c remote.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
#include <stdio.h>

int main()
{
<<<<<<< local.c
    echo 2;
||||||| base.c
=3D=3D=3D=3D=3D=3D=3D
    echo 1;
>>>>>>> remote.c
}
------------------------------------------------------------

man diff3
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
       -e, --ed
              output ed script incorporating changes from OLDFILE to  YOU=
RFILE
              into MYFILE

       -E, --show-overlap
              like -e, but bracket conflicts

       -3, --easy-only
              like -e, but incorporate only nonoverlapping changes

       -x, --overlap-only
              like -e, but incorporate only overlapping changes

       -X     like -x, but bracket conflicts

       -i     append `w' and `q' commands to ed scripts

       -m, --merge
              output  actual  merged file, according to -A if no other op=
tions
              are given
------------------------------------------------------------


Regards,
Llu=EDs.

--=20
(Escriu-me xifrat si saps PGP / Write ciphered if you know PGP)
PGP key 7CBD1DA5 - https://emailselfdefense.fsf.org/




Acknowledgement sent to Lluís Batlle i Rossell <viric@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-diffutils@HIDDEN. Full text available.
Report forwarded to bug-diffutils@HIDDEN:
bug#29510; Package diffutils. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 25 Nov 2019 12:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.