diff - Strange conflict on git -


i read article three-way merges (diff3). gives example how detects conflict. example :

a=[1,4,5,2,3,6] o=[1,2,3,4,5,6] <<< origin b=[1,2,4,5,3,6] 

in first time computes diff between o-a , after o-b:

a=[1,4,5,2,3,   ,6] o=[1,   ,2,3,4,5,6]  

and

o=[1,2,3,4,5, ,6]  b=[1,2, ,4,5,3,6] 

after makes diff3 parse:

a=[1,4,5,2,   3    ,6] o=[1,   ,2, 3,4,5  ,6] <<< origin b=[1,   ,2, 4,5,3  ,6] 

and after detects conflict :

1 4 5 2 <<<<<<<<<a 3 |||||||o 3 4 5 ======= 4 5 3 >>>>>>b 6 

following method detect conflict, try simple example : have document :

a; b; 

i make updates user 1 update "a;", "a=0;" user 2 update "b;", "b=0;" obtain result :

xx <<<<<<< int a=0; int b; ||||||| o int a; int b; ======= int a; int b=0; >>> 

when merge these 2 documents have conflict if don't change @ same position (a , b not @ same position)! 1 can explain me why have conflict ?

this question similar this one, , answer is: that's because each diff hunk not consist of literal difference of lines of context required locate difference in file has lines added / removed , hunk offset changes. difference in context conflict because depending on patch apply first you're changing context other patch.


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -