Skip to content

Indicate when an MR diverged from the target branch

This adds an indicator to the "Merge MR" box, to tell if and how much an MR diverged from its target branch.

For instance, consider an MR to merge the branch feature into master. Some other commits were added to master since feature was created, and the two branches diverged.

o master
|
o    o feature
|    |
o    o
|  /
o

In this case, there will be a label in the MR Merge box stating:

This MR is by 3 commits behind the target branch master.

Screenshots

The branch diverged from the target (UI Proposal)

UI_suggestion_1

The branch diverged from the target (alternative UI Proposal)

UI_suggestion_2

How is this useful?

  • In a rebase-workflow (MR are preferably rebased before being merged), the reviewer wants to know if an MR is rebased on the target branch before merging it.

    With this indicator, the reviewer knows immediately if the branch is rebased, or if she needs to ask the committer to rebase its branch.


  • To keep the git history readable, a team prefers to avoid merging branches that really lag a lot behind the target branch. Merging an MR that is 10 commits behind is fine, but 200 is too much.

    With this indicator, the reviewer can see on the MR page if the branch is really far behind the target – or only a few commits behind.

Open questions

We've been using this at @captaintrain for a few months now, and found it quite useful.

I guess the open-questions are mostly: what UI would be the more adequate? Any thoughts on this, on the general usefulness and/or on the code?

Merge request reports