I am facing weird behaviour in git merge when resolving conflicts in some big files where some lines of code from the incoming branch are simply ignored generating syntax and other errors.
One of the various examples :
Following is the code current branch : (stage which is never directly worked on)
Https.post(SERVER_URLS.someSync(queryParams),headers,bodyData,new ResponseHandler({req:null,res : null},function(body){
},function(err,result){
}));
Following is the code on incoming branch : (prod also never been worked on directly)
Above code only, just commented.
// Https.post(SERVER_URLS.someSync(queryParams),headers,bodyData,new ResponseHandler({req:null,res : null},function(body){
// },function(err,result){
// }));
But merge conflict is giving me following choices while merging :
<<<<<<< HEAD
Https.post(SERVER_URLS.someSync(queryParams),headers,bodyData,new ResponseHandler({req:null,res : null},function(body){
},function(err,result){
=======
// Https.post(SERVER_URLS.someSync(queryParams),headers,bodyData,new ResponseHandler({req:null,res : null},function(body){
// },function(err,result){
>>>>>>> production
As you can see, the last closing brace line is left as it is while it is commented in the production branch.
}));
Ideally it should also have been included in the conflict choices.
This way I have to be very cautious about the code that is not in the conflict options and quite many times have to edit it too to successfully resolve the conflict.
Have already tried merge options with -Xignore-all-space and -Xignore-space-change but no effect.
I am using git for over 2 years but now such problems are becoming frequent in the team as the project grows. (Not a very advanced user though as the team is fairly small)
This sometimes also break things on production as resolving conflicts is getting very tricky. So any help would be greatly appreciated.
NOTE : GIT version is 2.14.x . Some team members are using 2.6.x but I think this should not be the issue as git metadata is back-compatible and has rarely changed.