diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-12-05 15:08:19 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-12-05 15:08:19 +0300 |
commit | 12b995e0e7aace4b7695c4424aed71b053c2c2a6 (patch) | |
tree | 0f2c9a902693aa5b7c9265c3ed24e842eedb6a96 /doc/user/project/description_templates.md | |
parent | 1e02d1c756e1b5e79453fcc805c9737bb6520fca (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'doc/user/project/description_templates.md')
-rw-r--r-- | doc/user/project/description_templates.md | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/doc/user/project/description_templates.md b/doc/user/project/description_templates.md index 40c36236932..7774b567e8b 100644 --- a/doc/user/project/description_templates.md +++ b/doc/user/project/description_templates.md @@ -83,6 +83,22 @@ NOTE: You can create shortcut links to create an issue using a designated template. For example: `https://gitlab.com/gitlab-org/gitlab/-/issues/new?issuable_template=Feature%20proposal`. Read more about [creating issues using a URL with prefilled values](issues/managing_issues.md#using-a-url-with-prefilled-values). +### Supported variables in merge request templates + +> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/89810) in GitLab 15.7. + +When you save a merge request for the first time, GitLab replaces these variables in +your merge request template with their values: + +| Variable | Description | Output example | +|----------|-------------|----------------| +| `%{all_commits}` | Messages from all commits in the merge request. Limited to 100 most recent commits. Skips commit bodies exceeding 100 KiB and merge commit messages. | `* Feature introduced` <br><br> `This commit implements feature` <br> `Changelog:added` <br><br> `* Bug fixed` <br><br> `* Documentation improved` <br><br>`This commit introduced better docs.` | +| `%{co_authored_by}` | Names and emails of commit authors in a `Co-authored-by` Git commit trailer format. Limited to authors of 100 most recent commits in merge request. | `Co-authored-by: Zane Doe <zdoe@example.com>` <br> `Co-authored-by: Blake Smith <bsmith@example.com>` | +| `%{first_commit}` | Full message of the first commit in merge request diff. | `Update README.md` | +| `%{first_multiline_commit}` | Full message of the first commit that's not a merge commit and has more than one line in message body. Merge request title if all commits aren't multiline. | `Update README.md`<br><br>`Improved project description in readme file.` | +| `%{source_branch}` | The name of the branch being merged. | `my-feature-branch` | +| `%{target_branch}` | The name of the branch that the changes are applied to. | `main` | + ### Set instance-level description templates **(PREMIUM SELF)** You can set a description template at the **instance level** for issues |