I've seen code merges being used as an argument for bracing even single statement ifs. For example:if (condition) {    do something;}Unfortunately I can't think of a change that would break a non-braced version during an automatic code merge. Could someone post an example?
Single statement non-braced ifs and code merges
version control;coding style
I think the condition they're talking about is thisChange 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 toif (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 withif (condition) {    doSomeStuff();    doOtherStuff();}