diff options
Diffstat (limited to 'doc/user/project/description_templates.md')
-rw-r--r-- | doc/user/project/description_templates.md | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/doc/user/project/description_templates.md b/doc/user/project/description_templates.md index 40c36236932..ffbe7447aa8 100644 --- a/doc/user/project/description_templates.md +++ b/doc/user/project/description_templates.md @@ -40,7 +40,7 @@ To create an issue description template: where `mytemplate` is the name of your issue template. 1. Commit to your default branch. -To check if this has worked correctly, [create a new issue](issues/managing_issues.md#create-an-issue) +To check if this has worked correctly, [create a new issue](issues/create_issues.md) and see if you can find your description template in the **Choose a template** dropdown list. ## Create a merge request template @@ -81,7 +81,23 @@ To discard any changes to the description you've made after selecting the templa 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). +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/create_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)** |