From 5b14f75b41fab4cae0b5ee027e45a53993167e61 Mon Sep 17 00:00:00 2001 From: Michael Gasch Date: Wed, 9 Jun 2021 15:23:16 +0200 Subject: [PATCH] chore: Include commit details in CHANGELOG Add commit SHAs and titiles to the individual sections. Also, a BREAKING section was added which will include commits message blocks starting with `BREAKING:`. Closes: #35 Signed-off-by: Michael Gasch --- .chglog/CHANGELOG.tpl.md | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/.chglog/CHANGELOG.tpl.md b/.chglog/CHANGELOG.tpl.md index c67c63a..a78618c 100755 --- a/.chglog/CHANGELOG.tpl.md +++ b/.chglog/CHANGELOG.tpl.md @@ -8,7 +8,7 @@ ### {{ .Title }} {{ range .Commits -}} -- {{ .Subject }} +- [{{ .Hash.Short }}]{{"\t"}}{{ .Subject }}{{ range .Refs }} (#{{ .Ref }}) {{ end }} {{ end }} {{ end -}} @@ -16,26 +16,29 @@ ### ⏮ Reverts {{ range .RevertCommits -}} -- {{ .Revert.Header }} +- [{{ .Hash.Short }}]{{"\t"}}{{ .Revert.Header }}{{ range .Refs }} (#{{ .Ref }}) {{ end }} {{ end }} {{ end -}} -{{- if .NoteGroups -}} -{{ range .NoteGroups -}} -### ⚠️ {{ .Title }} +### ⚠️ BREAKING -{{ range .Notes }} -{{ .Body }} +{{ range .Commits -}} +{{ if .Notes -}} +{{ if not .Merge -}} +{{ if not (contains .Header "Update CHANGELOG for" ) -}} +{{ .Subject }} [{{ .Hash.Short }}]:{{"\n"}}{{ range .Notes }}{{ .Body }} {{ end }} {{ end -}} {{ end -}} +{{ end -}} +{{ end -}} ### 📖 Commits {{ range .Commits -}} {{ if not .Merge -}} {{ if not (contains .Header "Update CHANGELOG for" ) -}} -- {{ .Header }} [{{ .Hash.Short }}] +- [{{ .Hash.Short }}]{{"\t"}}{{ .Header }}{{ range .Refs }} (#{{ .Ref }}) {{ end }} {{ end -}} {{ end -}} {{ end -}}