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.
Is it worth to save some vertical space and move MR info to the same line as branches info? I'm not sure if it's going to be usable when there are many branches and/or merge requests on the same line.
it's funny, i found this in some old mockup i made a while back:
it has the added benefit of showing us the Merge Request name.. which can, i think, instantly give a better sense of context to the current commit you are looking at. Or would it be enough to have this information in the tooltip? What do you think @blackst0ne@elijahlynn ?
If we take a peek at how GH does this: (they only show one branch at most btw... even if the commit lives in another branch as well, which still exists)
put everything on 1 line somehow (problem with this is that we only show multiple branches on a button press .. also the amount of branches can increase by a lot (if the commit is older .... having this information in there be lost.. would be a shame i think... even for commits that have long be merged, as you would like to know that context of the commit)
possible mockup for that could be (moving the branches with the MR's of which this commit actually is part of) out of the "rest collection", so no button press is needed:
or
or (less good imo)
move the branches from parent commit line, to its own line, where we'll also show the merge requests.
possible mockup (inspired by previous point):
keep mr's to a line on itself and provide the titles instantly (not on tooltip)
(most of the time, just 1 mr will be mentioned...)
I personally most often want to find merge requests where a commit was introduced.
So I like the last mockup (MRs on a separate line).
With titles it's more readable (goodbay robots, welcome humans ), but less consistent with other parts of the product (links to MR in notes, etc).
If the line is not shown, how do we know it's not a bug, but there are just no related merge requests found?
@blackst0ne If the product is working correctly (like 95%) the user should not want to expect a merge request to be there. It can simply come to expect that there is no attached merge request if it isn't stated. If we were to display all things that aren't there.. we had to display a lot of things in a lot of places
@blackst0ne I don't think this is ready to go just yet. We also can't use the MR's source branch, because you can have multiple MRs with the same source branch (at different times).
I think ideally we would have a join table between commits and MRs, instead of serialising the commits in MR versions, but I'm not sure if it's practical to backfill that.
reasoning: Most of the time, there will be a low amount of MR's + it can flow if it needs to. I think the titles in this case make most sense to be written out.. as to show immediate sense of context to the user.. as a commit on itself doesn't say much. Plus We got 3 different people, liking the same mockup
We definitely need more backend work here, it's not as easy as it seems to go from a commit SHA to an MR, even if we have the refs/merge-requests/:iid/head branches, because you want the MR that introduced a commit, not just any MR which contains it.
git fetch origingit log --graph# Find sha# Find merged sha into master from the commit# Check a comment of the merged sha. MR id is included in the comment.# Access https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/<input the MR id>
I would like to upvote this. We are working on the software for automotive industry and we need to have 2-way traceability (a) from issue to MR (where e.g. CI happens) to code in master and b) from code in master back to MR and issue.
This is practically a deal breaker for us and we would really need to have it implemented.