We are using git/gerrit for our source control. One of our devs recently pushed a commit just like always, but pushed to the wrong target branch (wrong being not the same base as he was working out of).
The devs workspace/repo was based on branch CF2, but when he pushed to Gerrit, he pushed to PLR. It /appears/ that the PLR branch was rebased to CF2 because 2 additional commits were magically inserted into PLR, causing a build failure. Had those commits not caused a failure, this would have gone unnoticed.
Looking back, you can see in the Depends section of Gerrit the branches are different, but typically the depends section is closed/folded if the dependency isn't an issue.
Is there any way to 'prevent' cross-pushing like this? From what I think I know about branching, the answer is no. And if not, is there anyway to have Gerrit enforce that the dependencies are on the same branch?
We are Gerrit 2.5. The project is set to Merge if necessary.