Two developers are working on the develop branch on two entirely different changes (say, two different files). They both submit their work at the same time, triggering two Jenkins builds. Those builds go fine but one review takes longer than the other.
The first dev submits their patch set and there are no intermediate commits on develop so Gerrit merges it right in.
The second dev later submits their patch set. Though there's an intermediate commit now, the merge itself is trivial and Gerrit performs the merge.
Now we have two builds, neither of which contains the work of the other.
I'd like to block the second submission if there are any intermediate commits, even if the merge would be totally trivial, causing the developer to instead rebase and update their submission (and trigger a new build in Jenkins in the process).
What do I set in Gerrit to block such trivial-but-unwanted merges when a review is complete, the patch set is being submitted but the target branch has intermediate merges on it?
You can change project options in Gerrit To fast-forward only, This would prevent the change from going in as it is not a fast forward merge. Then forcing developer2 to git pull --rebase and push again, now the change that developer1 did will be part of the verification.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With