Add a custom commit message when applying a suggested change
Problem to solve
Suggesting a change in a merge request makes it easy to propose and apply feedback to a merge request. Because the commit message cannot be modified:
- at best, the commit message contains no useful information
- at worst, the commit message will violate project commit message hygiene rules and break the build
In both cases, the author of the merge request has two ways to resolve the situation:
- squash the whole merge request (which is not always enabled, and might be disabled), which may not be desirable if there are multiple well written commits
- fetch the branch locally, perform an interactive rebase to reword the commits to something useful
Good commit hygiene is considered a best practice. GitLab should encourage and enable these kinds of best practices. This feature currently creates a problem and requires workarounds that remove information, or significant manual work.
Proposal
- When clicking on the "Apply suggestion" button, the user should be prompted for a custom commit message.
- The commit message is optional and the form will have a placeholder commit message as a default.
- The placeholder commit message should come from the default commit message for suggestions.
Workflow:
- Click on "apply suggestion" button
- Reveal commit message text box
- Update placeholder commit if desired
- Commit
There is an existing UI pattern for this in the Web IDE:
Further details
GitHub requires the user applying a suggestion to review the commit message, and makes it possible to update.
Edited by Pedro Moreira da Silva