diff options
author | Jason Song <i@wolfogre.com> | 2022-12-29 20:40:20 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-29 14:40:20 +0200 |
commit | 47efba78ec966631ccdea3e05a50f4cf59ca9fd3 (patch) | |
tree | 65a8ef34d5c03ab40bc70111d04fe309546f09e8 /templates | |
parent | a35749893b91db48310d91ae0a32fee3ad3bb901 (diff) | |
download | gitea-47efba78ec966631ccdea3e05a50f4cf59ca9fd3.tar.gz gitea-47efba78ec966631ccdea3e05a50f4cf59ca9fd3.zip |
Support template for merge message description (#22248)
Fix #21435.
Use the first line of the template as the git commit message title, and
the rest as the description.
## Snapshots
<img width="806" alt="image"
src="https://user-images.githubusercontent.com/9418365/209644083-5d85179c-cf58-404f-bc98-c662398a2411.png">
<img width="860" alt="image"
src="https://user-images.githubusercontent.com/9418365/209644392-22573090-e2c1-458b-ba44-855b79735632.png">
<img width="1154" alt="image"
src="https://user-images.githubusercontent.com/9418365/209644457-a1b2711a-6787-45b4-b52c-a88d7fc132d7.png">
Co-authored-by: delvh <dev.lh@web.de>
Diffstat (limited to 'templates')
-rw-r--r-- | templates/repo/issue/view_content/pull.tmpl | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/templates/repo/issue/view_content/pull.tmpl b/templates/repo/issue/view_content/pull.tmpl index d68f3e5414..665f782053 100644 --- a/templates/repo/issue/view_content/pull.tmpl +++ b/templates/repo/issue/view_content/pull.tmpl @@ -343,7 +343,8 @@ (() => { const defaultMergeTitle = {{.DefaultMergeMessage}}; const defaultSquashMergeTitle = {{.DefaultSquashMergeMessage}}; - const defaultMergeMessage = 'Reviewed-on: ' + {{$.Issue.HTMLURL}} + '\n' + {{$approvers}}; + const defaultMergeMessage = {{if .DefaultMergeBody}}{{.DefaultMergeBody}}{{else}}'Reviewed-on: ' + {{$.Issue.HTMLURL}} + '\n' + {{$approvers}}{{end}}; + const defaultSquashMergeMessage = {{if .DefaultSquashMergeBody}}{{.DefaultSquashMergeBody}}{{else}}'Reviewed-on: ' + {{$.Issue.HTMLURL}} + '\n' + {{$approvers}}{{end}}; const mergeForm = { 'baseLink': {{.Link}}, 'textCancel': {{$.locale.Tr "cancel"}}, @@ -398,7 +399,7 @@ 'allowed': {{$prUnit.PullRequestsConfig.AllowSquash}}, 'textDoMerge': {{$.locale.Tr "repo.pulls.squash_merge_pull_request"}}, 'mergeTitleFieldText': defaultSquashMergeTitle, - 'mergeMessageFieldText': {{.GetCommitMessages}} + defaultMergeMessage, + 'mergeMessageFieldText': {{.GetCommitMessages}} + defaultSquashMergeMessage, 'hideAutoMerge': generalHideAutoMerge, }, { |