Skip to content

Commit

Permalink
feat: changelog增加commit_id显示
Browse files Browse the repository at this point in the history
delete: changelog不再显示scope
  • Loading branch information
hamster1963 committed Jul 12, 2023
1 parent 36986bb commit f86ab5d
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions git-cliff/cliff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,20 @@ body = """
{% else %}\
## [unreleased]
{% endif %}\
{% if previous %}\
{% if previous.commit_id %}
[{{ previous.commit_id | truncate(length=7, end="") }}]({{ previous.commit_id }})...\
[{{ commit_id | truncate(length=7, end="") }}]({{ commit_id }})
{% endif %}\
{% endif %}\
{% for group, commits in commits | group_by(attribute="group") %}
### {{ group | striptags | trim | upper_first }}
{% for commit in commits
| filter(attribute="scope")
| sort(attribute="scope") %}
- *({{commit.scope}})*{% if commit.breaking %} [**breaking**]{% endif %} \
{{ commit.message | upper_first }}
{%- endfor -%}
{% raw %}\n{% endraw %}\
{%- for commit in commits %}
{%- if commit.scope -%}
{% else -%}
- *(uncategorized)*{% if commit.breaking %} [**breaking**]{% endif %} \
{{ commit.message | upper_first }}
{% endif -%}
{% endfor -%}
### {{ group | upper_first }}
{% for commit in commits %}
- {{ commit.message | upper_first }} ([{{ commit.id | truncate(length=7, end="") }}]({{ commit.id }}))\
{% for footer in commit.footers -%}
, {{ footer.token }}{{ footer.separator }}{{ footer.value }}\
{% endfor %}\
{% endfor %}
{% endfor %}\n
"""
# remove the leading and trailing whitespace from the template
Expand Down

0 comments on commit f86ab5d

Please sign in to comment.