feat(changelog): expose commits sha1
, author
and author_email
in changelog tree (fix #987)
#1013
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
…
Description
This PR adds the
sha1
,author
andauthor_email
field to each commit/changelog change.Fixes #987
Checklist
./scripts/format
and./scripts/test
locally to ensure this change passes linter check and testExpected behavior
Template can access
sha1
,author
andauthor_email
on each changelog entrySteps to Test This Pull Request
Override the changelog template and try using
change.sha1
,change.author
andchange.author_email
, it should be defined for each.Additional context
This change is easy but comes with a drawback which needs discussion before merge:
this is really increasing memory usage by commit. While it is impact-less on small repositories, it can make commitizen not fit in memory on big repositories (might need an estimation to measure impact).
So we need to discuss whether the overhead is acceptable or not and if this is OK should be merged as it is, opt-in and protected by a flag, a plugin only feature (consistent with the fact that we need a template to benefit from those variables) or just something to add as a
changelog_message_builder_hook
(and we just provide the recipe)My opinion: I am OK with this change, I just need to make an estimation of the overhead to decide.