how remerge works and when to use it?

John Arbash Meinel john at arbash-meinel.com
Wed Aug 5 15:50:13 BST 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Martin Pool wrote:
>>> What is reprocess actually and
>>> for which merge algorithms it is applicable?
>> What a great question.  It reduces the number of conflicts, at some
>> risk that it won't conflict on things were it should.  I'd have to
>> check the code...
> 
> OK, so essentially (and I may be wrong) it means that if there are
> common lines between the two alternatives in a conflict region, the
> two sides are taken to assume on those lines and the region is split
> in two.
> 
> It's set by supports_reprocess which is true for merge3 and weave, and
> by inheritance for LCAMerger and Diff3Merger.  Therefore apparently
> for everything(?) but maybe not external merges?
> 

To be technical:

  1) merge algorithms generate regions that conflict
  2) basic 3-way merge generates these by doing a diff of THIS versus
     BASE and OTHER vs BASE and then notes which regions overlapped.
  3) Often these regions are strictly larger than they have to be.
     Either because THIS and OTHER actually share some more history, or
     two people did similar edits, etc.
  4) reprocess grabs the conflicting regions and performs a 2-way diff
     on them. For sub-regions that match, reprocess removes them from
     the conflict.

As a specific example imagine you have:

BASE:
 a
 b
 c

THIS:

 a
 X
 Y
 Z
 b
 c

OTHER:
 a
 X
 Z
 F
 b
 c

diff of THIS vs BASE
 a
+X
+Y
+Z
 b

diff of OTHER vs BASE
 a
+X
+Z
+F
 b
 c

plain --merge3 --no-reprocess --show-base
 a
<<<<<<< THIS
 X
 Y
 Z
|||||||| BASE
======== OTHER
 X
 Z
 F
>>>>>>>>
 b
 c

after --reprocess  (I think)
 a
 X
<<<<<<< THIS
 Y
======== OTHER
>>>>>>>>
 Z
<<<<<<< THIS
======== OTHER
 F
>>>>>>>>
 b
 c


I'm not sure I got the details 100% right, but that should be close
enough to give an understanding of what it does.

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkp5nCUACgkQJdeBCYSNAAMfIwCffzWUtK7wUBzM3gt8nsGVcFBk
ve8An32JC5WmZW7p1+6MQjD3u9QP4deW
=ev7j
-----END PGP SIGNATURE-----



More information about the bazaar mailing list