You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The justification is that having short commit hash and issue number as clickable links in repo gives a possibility to quickly access the related code and issues/threads in github, thus having full context of the item / entity worked on, without having to search for it by hand, that would take much more time.
Possible Solution
add linked commit hash and issue number as optional variables to each commit to changelog format
@nongrata081 I got this working by modifying the template as follows:
{% for entry in tree %}
## {{ entry.version }}{% if entry.date %} ({{ entry.date }}){% endif %}
{% for change_key, changes in entry.changes.items() %}
{% if change_key %}
### {{ change_key }}
{% endif %}
{% for change in changes %}
{% if change.scope %}
-**{{ change.scope }}**: {{ change.message }} ({{ change.sha1[:7] }})
{% elif change.message %}
- {{ change.message }} ({{ change.sha1[:7] }})
{% endif %}
{% endfor %}
{% endfor %}
{% endfor %}
Adding ({{ change.sha1[:7] }}) includes the commit hash behind the change-message.
Changelog is updated with cz ch --template _templates/CHANGELOG.md.j2.
When pushing the CHANGELOG.md to GitHub/GitLab, the hash is automatically linked to the respective commit; same is ensured when referencing issue numbers or even contributors in the change messages.
Activity
kmnhan commentedon Oct 8, 2024
As a workaround, I built a plugin that tries to do what is mentioned. It will be great to have this implemented natively!
woile commentedon Oct 8, 2024
Wanna add it to the third party section in the docs?
https://commitizen-tools.github.io/commitizen/third-party-commitizen/
kapsner commentedon Jun 2, 2025
@nongrata081 I got this working by modifying the template as follows:
Adding
({{ change.sha1[:7] }})
includes the commit hash behind the change-message.Changelog is updated with
cz ch --template _templates/CHANGELOG.md.j2
.When pushing the CHANGELOG.md to GitHub/GitLab, the hash is automatically linked to the respective commit; same is ensured when referencing issue numbers or even contributors in the change messages.