patch versus 3-way merge for moved contents
John A Meinel
john at arbash-meinel.com
Thu Oct 27 23:48:09 BST 2005
Sometimes, one of the advantages of patch is that it uses a local
context to determine where the patch should be applied.
The specific advantage I'm mentioning is if code has been moved (without
being modified).
For example if I had:
int function2(int a, int b)
{
// do something
// and then something else
return 1;
}
int function1(int a)
{
// do something different
// and return an integer
return 2;
}
Then I realize that function1 should come before function2
alphabetically, and rearrange the code.
If someone then submitted patches which made corrections to both
function1 and function2, it would be possible for patch to determine the
correct location from context.
With diff3/3-way merge (and probably weave merge), these lines show up
as a completely new set of lines, unrelated to the previous ones.
(at least one set shows up that way).
I don't know if that use case is worth doing anything about. But I
thought I would mention it since I just thought about it.
John
=:->
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 249 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20051027/d2cbea6a/attachment.pgp
More information about the bazaar
mailing list