Hi everyone,
We are encountering a frustrating user experience issue regarding Gerrit's mergeability check on stacked changes when the project submit strategy is set to Rebase Always.
Scenario & Steps to Reproduce
Set a project's submit strategy to Rebase Always.
Push a chain of dependent changes: Change A -> Change B -> Change C.
Submit Change A. Gerrit creates a rebased commit A' on the target branch (e.g., master).
Immediately after Change A lands, Change B is marked with a "Merge Conflict" status in the Gerrit Web UI, disabling normal UI submit/merge options.
Known Issues Context
I have checked the Gerrit issue tracker and found that this behavior is already documented in:
Issue 40006949: Gerrit claims "merge conflict" when submitting parent CL ("Rebase Always" only)
Issue 40015471: Rebase Always: "Merge conflicts" detected when parent CL lands, even when no conflicts exist
As analyzed in those threads, the underlying cause is that Gerrit's background MergeabilityChecker uses a standard 3-way git merge dry-run instead of simulating a real rebase. Since A' and B both contain changes from Base..A, the 3-way merge misinterprets overlapping modifications as content conflicts. Meanwhile, a local git rebase or submission via API/CQ succeeds cleanly without any conflict.
Practical Impact
Although downstream CI engines like Zuul CI can handle this speculatively using native Git logic without being blocked, human developers get confused by the red "Merge Conflict" badge in the UI. They end up manually rebasing and pushing new patch sets (e.g., PS2 for B), which triggers unnecessary CI test runs and significantly reduces overall CI throughput.
Questions
Are there any recommended workarounds, plugin options, or configuration tweaks to bypass or mitigate this false-positive conflict check when using Rebase Always?
Is there any active effort or planned roadmap to align the Mergeable check with the actual submit strategy semantics?
Any insights or suggestions from the community would be greatly appreciated!
Best regards,
Hu Shuai