I’m wondering if I can tell git to resolve conflicts by appending “their” code blocks after “ours”.
Does he “know” at all about C-language code blocks ?
Example:
//====== ours ======
....
if(cond1)
{
do_smth();
}
....
//====== their ======
....
if(cond2)
{
do_smth_else();
}
....
Normally such a merge results in a conflict which I would like to resolve automatically as :
//======= merge result ========
if(cond1)
{
do_smth();
}
if(cond2)
{
do_smth_else();
}
Thank you !
I understand that flagging this as a conflict seems like an annoyance, but it is by design. Consider the following situation, you add:
and they add:
The portion that they added probably does not match what you were trying to accomplish. If their code were appended to yours, then
perform_action1()would be called twice.In short, there is no way to merge automatically because the few times it would be a bad idea, it would be a really bad idea.