This PR introduces the `ReviewedOn` and `ReviewedBy` variables for the
default merge message templates (e.g.,
`.gitea/default_merge_message/MERGE_TEMPLATE.md`).
This allows customizing the default merge messages while retaining these
trailers.
This also moves the associated logic out of `pull.tmpl` into the
relevant Go function.
This is a first contribution towards #11077.
---
For illustration, this allows to recreate the "default default" merge
message with the following template:
```
.gitea/default_merge_message/MERGE_TEMPLATE.md
Merge pull request '${PullRequestTitle}' (${PullRequestReference}) from ${HeadBranch} into ${BaseBranch}
${ReviewedOn}
${ReviewedBy}
```
returnfmt.Sprintf("Merge pull request '%s' (%s%d) from %s into %s",pr.Issue.Title,issueReference,pr.Issue.Index,pr.HeadBranch,pr.BaseBranch),"",nil
returnfmt.Sprintf("Merge pull request '%s' (%s%d) from %s into %s",pr.Issue.Title,issueReference,pr.Issue.Index,pr.HeadBranch,pr.BaseBranch),body,nil
}
}
ifpr.HeadRepo==nil{
ifpr.HeadRepo==nil{
returnfmt.Sprintf("Merge pull request '%s' (%s%d) from <deleted>:%s into %s",pr.Issue.Title,issueReference,pr.Issue.Index,pr.HeadBranch,pr.BaseBranch),"",nil
returnfmt.Sprintf("Merge pull request '%s' (%s%d) from <deleted>:%s into %s",pr.Issue.Title,issueReference,pr.Issue.Index,pr.HeadBranch,pr.BaseBranch),body,nil
}
}
returnfmt.Sprintf("Merge pull request '%s' (%s%d) from %s:%s into %s",pr.Issue.Title,issueReference,pr.Issue.Index,pr.HeadRepo.FullName(),pr.HeadBranch,pr.BaseBranch),"",nil
returnfmt.Sprintf("Merge pull request '%s' (%s%d) from %s:%s into %s",pr.Issue.Title,issueReference,pr.Issue.Index,pr.HeadRepo.FullName(),pr.HeadBranch,pr.BaseBranch),body,nil