1
1
mirror of https://github.com/orhun/git-cliff.git synced 2024-11-25 13:22:17 +03:00

fix(template): use 7 digits for short SHA

This commit is contained in:
orhun 2021-08-03 00:33:21 +03:00
parent dfab97842f
commit 1f85263f84
No known key found for this signature in database
GPG Key ID: B928720AEC532117
2 changed files with 4 additions and 4 deletions

View File

@ -16,14 +16,14 @@ body = """
{% endif %}\
{% if previous %}\
{% if previous.commit_id %}
[{{ previous.commit_id | truncate(length=8, end="") }}]({{ previous.commit_id }})...\
[{{ commit_id | truncate(length=8, end="") }}]({{ 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 | upper_first }}
{% for commit in commits %}
- {{ commit.message | upper_first }} ([{{ commit.id | truncate(length=8, end="") }}]({{ commit.id }}))\
- {{ commit.message | upper_first }} ([{{ commit.id | truncate(length=7, end="") }}]({{ commit.id }}))\
{% endfor %}
{% endfor %}\n
"""

View File

@ -13,7 +13,7 @@ if [ -n "$1" ]; then
{% for group, commits in commits | group_by(attribute=\"group\") %}
{{ group | upper_first }}\
{% for commit in commits %}
- {{ commit.message | upper_first }} ({{ commit.id | truncate(length=8, end=\"\") }})\
- {{ commit.message | upper_first }} ({{ commit.id | truncate(length=7, end=\"\") }})\
{% endfor %}
{% endfor %}"
changelog=$(cargo run -- --unreleased --strip all)