I think the condition they're talking about is this
Change 1 (add, line 20-21):
if (condition)
doSomeStuff();
Change 2 (add, line 20-21):
if (condition)
doOtherStuff();
I would bet that some old auto-merge tool somewhere would try to be clever and say "well, you've both added the same line twice at 20, so I'll add it once; and you've added two different lines at 21, so I'll add them both." Leading to
if (condition)
doSomeStuff();
doOtherStuff();
These historic arguments tend to hang around long after every merge tool on the planet has been fixed to work differently.
Any auto-merge I've ever seen would refuse to merge two adds in the same place, meaning you have to use a manual-merge tool. At worst, it might add one before the other, which is still fine. But a decent merge tool will allow you to edit this in place and end up with
if (condition) {
doSomeStuff();
doOtherStuff();
}
if (x > 2) i++;
– GlenPeterson Dec 01 '12 at 21:26if
I tend to use the ternary operator.int x = test() ? 1:0;
– Martin Beckett Dec 02 '12 at 01:33