Skip to content

Add link on commit page to merge request that introduced that commit

We can now do this relatively easily, since every MR is copied to refs/merge-requests/:iid/head, and we already have the list of branches in which a commit occurs. We can see if any refs like that are in that list, parse the IID out of there, look up the MR by IID, and link to it.

API

Design

img

uses the icon from https://gitlab.com/gitlab-org/gitlab-ce/issues/29584

icon-merge_2x

icon-merge-v2.svg

Note: This however needs backend support as described https://gitlab.com/gitlab-org/gitlab-ce/issues/2383#note_26341393