A developer asked where his fix to a TR had gone. After examining the branch, it was indeed not there. I assumed he had just forgotten to forward merge the fix, as is fairly common. After looking, the fix had indeed been committed with commit 'A', committed at a point 2 in the timeline.
In parallel, another branch was working on another TR. This branch was branched before 'A' was committed, and thus it was not included.
After a while, this parallel branch was merged into the main branch with commit 'B' (merge commit). Similar to:
O
| \
A |
| /
B
Despite not having touched the same files as 'A', the merge silently reverted the changes in 'A' without conflict, in fact, running
git blame
after the merge shows 'A' never happened.
However, running
git --contains
shows us that 'A' definitely happened. So the changes were all silently reverted, without a commit.
After attempting the merge between the same two parents, all changes in 'A' are indeed overridden. Furthermore, the original merge was done via a PR on ADS, so there is no chance of any crazy flags being used in the final merge. The PR shows indeed that the files will be changed, which was overlooked on the developers' part.
What could have caused Git to get the merge so wrong? Something earlier in the history? (Remember, the files in 'A' had not been touched by any commit that made up the second parent in 'B').