Support Full Suite of git trailers in template variables
<!--IssueSummary start--> <details> <summary> Everyone can contribute. [Help move this issue forward](https://handbook.gitlab.com/handbook/marketing/developer-relations/contributor-success/community-contributors-workflows/#contributor-links) while earning points, leveling up and collecting rewards. </summary> - [Close this issue](https://contributors.gitlab.com/manage-issue?action=close&projectId=278964&issueIid=385092) </details> <!--IssueSummary end--> ### Proposal GitLab supports the use of [commit templates](https://docs.gitlab.com/ee/user/project/merge_requests/commit_templates.html) for merge commits and squash merges undertaken through the user interface. In the case of squash commits this can lead to an unexpected loss of data (see [Zendesk #33478](https://support.gitlab.com/hc/en-us/requests/344781) for further analysis) We would like to propose three things: 1. The [supported variables](https://docs.gitlab.com/ee/user/project/merge_requests/commit_templates.html#supported-variables-in-commit-templates) is expanded to include other common git message trailers (e.g. **Signed-off-by** from `git commit --signoff`) 2. An additional variable is added `%{latest_git_trailers}` that provides all of the trailers specified on the latest commit (i.e. the equivalent of `git log --max-count=1 --format="%(trailers)"` 3. The default template for [squash merges](https://docs.gitlab.com/ee/user/project/merge_requests/commit_templates.html#default-template-for-squash-commits) is updated to include (2). In the case of (1) and (3), with specific reference to `Signed-off-by:` this is important due to recent feature additions such as the [DCO push rule](https://docs.gitlab.com/ee/user/project/repository/push_rules.html#reject-commits-that-arent-dco-certified) In the case of (2) this is desirable as we record additional information in commit trailers, for example the `shasum -a 256` of the repository [.pre-commit-config.yaml](https://gitlab.com/adam-moss/pre-commit-trailer) alongside any steps that have been [skipped](https://pre-commit.com/#temporarily-disabling-hooks). --- Link to request: https://gitlab.my.salesforce.com/0016100000K8E5P Priority: ~"customer priority::4" Why interested: As outlined above Problem they are trying to solve: maintaining audit information Current solution for this problem: manually update commit message, or perform squash client-side Impact to the customer of not having this: Ongoing risk of unexpected data loss/disabling of UI based squashed merges on our account Questions: PM to mention:
issue