Rewrite commit messages to include link to merge request
Problem to solve
In order to find more context around a particular commit, going back to the merge request where the commit was discussed and revised can be very helpful. This is possible today with MRs using actual merge commits (rather than rebase), and through the web UI. It would be nice to extend this to the commit message for rebased commits.
Further details
When using an actual-merge merge request strategy, this is immediately obvious since the commit's merge parent includes a link back to the MR. But when using a rebase strategy, there is no merge commit to provide easy navigation back to the merge request.
#2383 (closed) helps when doing archaeology through the web interface: when you navigate to the commit through the GitLab web UI, you can easily see a link back to the MR. However, it could be even better to have this as part of the Git commit text itself: rewrite the commit message for rebased commits to include a tag with a full URL to the merge request.
Proposal
What does success look like, and how can we measure that?
-
Configure a repository to use the rebase strategy for landing merge commits -
Submit a MR with broken and frankly perplexing code, with heavy discussion in the MR -
Wait some time until someone discovers your code and is perplexed -
'git blame' in their favourite editor/IDE shows the commit message which already contains a link at the bottom to the MR
Links / references
This is implemented in Patchwork, which attempts to derive meaning and sense from patches sent via email. See this example commit from the drm-tip kernel tree on freedesktop.org, which makes heavy use of all sorts of tags, including one which leads to the submission and discussion of the patch on the mailing list:
drm/i915: Remove bogus NV12 PLANE_COLOR_CTL setup
We already handle the color encoding mode properly. Remove the broken
NV12 special case.
Cc: Vidya Srinivas <vidya.srinivas@intel.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Fixes: 8ed30ab6aced ("drm/i915: Enable YUV to RGB for Gen10 in Plane Ctrl Reg")
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180521185613.5097-1-ville.syrjala@linux.intel.com
Reviewed-By: Vidya Srinivas <vidya.srinivas@intel.com>
(cherry picked from commit 012d79e6a33f095c293fe2a02b2b3b26d8c6402c)
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Thanks for the consideration!
/cc @victorwu