Add first_commit and first_multiline_commit to commit template
What does this MR do and why?
This MR adds first_commit
and first_multiline_commit
to merge/squash commit message templates.
Solves #346805 (closed).
The linked issue only asked for first_multiline_commit
, but reading through the previous discussions, some users were disliking the arbitrary way it works - it uses first non-merge commit with more than one line in message body.
You can have a couple commits with well-defined but single-line messages, then a revert, and revert would be used, as it tends to have more than one line.
Also, first_multiline_commit
becomes MR title when no multiline commit exists in MR.
This was brought up in comment #330646 (comment 572918071).
For these reasons, I've decided to also add first_commit
variable.
Screenshots or screen recordings
Added new variables to documentation, also added version history to this section and fixed %{description}
example:
Example of using this new variables. New variables are also listed below textareas:
Example of message templates from previous screenshot in use - rendered messages:
How to set up and validate locally
- Go to project settings.
- Fill in
Merge commit message template
orSquash commit message template
with one of new variables (%{first_commit}
,%{first_multiline_commit}
). - Create a new MR.
- Check that the default message in mr widget renders correctly.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.