From ce76ed6bb8d92eb4b44513cf1cac9d34a5ef658f Mon Sep 17 00:00:00 2001 From: RainChen Date: Thu, 27 Feb 2020 11:28:46 +0800 Subject: [PATCH] feat: update template keepachangelog changes: * capitalized commit subject * show author name for each commit * sort commits by date * unique commit subject to keep notable --- src/git_changelog/templates/keepachangelog/commit.md | 2 +- src/git_changelog/templates/keepachangelog/section.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/git_changelog/templates/keepachangelog/commit.md b/src/git_changelog/templates/keepachangelog/commit.md index c9a32f1..56398f4 100644 --- a/src/git_changelog/templates/keepachangelog/commit.md +++ b/src/git_changelog/templates/keepachangelog/commit.md @@ -1,4 +1,4 @@ -- {{ commit.subject }} ([{{ commit.hash|truncate(7, True, '') }}]({{ commit.url }})). +- {{ commit.subject|capitalize }} ([{{ commit.hash|truncate(7, True, '') }}]({{ commit.url }}) by {{ commit.author_name }}). {%- if commit.text_refs.issues_not_in_subject %} Related issues/PRs: {% for issue in commit.text_refs.issues_not_in_subject -%} {{ issue.ref }}{% if not loop.last %}, {% endif -%} {%- endfor -%}{%- endif -%} \ No newline at end of file diff --git a/src/git_changelog/templates/keepachangelog/section.md b/src/git_changelog/templates/keepachangelog/section.md index e124048..9203dd8 100644 --- a/src/git_changelog/templates/keepachangelog/section.md +++ b/src/git_changelog/templates/keepachangelog/section.md @@ -1,4 +1,4 @@ ### {{ section.type or "Misc" }} -{% for commit in section.commits|sort(attribute='subject') -%} +{% for commit in section.commits|sort(attribute='author_date',reverse=true)|unique(attribute='subject') -%} {% include 'commit.md' with context %} {% endfor %}