I am not certain I can trust Git to merge automatically. Here is a scenario.
Create a program in the master:
MOVE 0 TO I.
A.
PERFORM X-PROC.
IF I IS EQUAL TO 25 THEN GO TO A.
Developer 1 makes a branch and notices that there is a bug: an infinite loop. He fixes it:
MOVE 0 TO I.
A.
ADD 1 TO I.
PERFORM X-PROC.
IF I IS EQUAL TO 25 THEN GO TO A.
Meanwhile Developer 2 makes a branch and fixes the bug in her own way:
MOVE 0 TO I.
A.
PERFORM X-PROC.
ADD 1 TO I.
IF I IS EQUAL TO 25 THEN GO TO A.
Both developers test their code and find it correct. Both merge to the master:
MOVE 0 TO I.
A.
ADD 1 TO I.
PERFORM X-PROC.
ADD 1 TO I.
IF I IS EQUAL TO 25 THEN GO TO A.
The infinite loop is back.
It seems to me that this problem must happen often in any sort of distributed development environment. When I tested this, Git did not report a merge conflict. Sometimes this problem could go undetected for a long time. A regression test should find it, but regression tests are merged in Git too, so we can't trust them either.
What can I do about this? Do I need to do a code reading after every merge?