Skip to content

Merge/squash commit templates: add %{all_commits} variable

Piotr Stankowski requested to merge trakos/gitlab:all-commit-messages into master

What does this MR do and why?

Implements #26303 (closed).

This MR adds %{all_commits} variable to commit message templates. It can be used in both merge and squash commit template, but realistically it only makes sense in squash one.

Format used:

* Commit title 1

Commit body 1

* Commit title 2

Commit body 2

Exclusions:

  • I'm skipping messages of merge commits.
  • For MRs exceeding 100 commits, only 100 most recent commits are used.
  • For commits with messages over 100KiB, only commit title is used.

Screenshots or screen recordings

Example result for 2 commits:

image

Template used in screenshot above:

Squashed commits:

%{all_commits}

Documentation:

image

How to set up and validate locally

Used this new variable in a merge or squash commit template, for example:

Squashed commits:

%{all_commits}

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Piotr Stankowski

Merge request reports