commitizen icon indicating copy to clipboard operation
commitizen copied to clipboard

Prune changelog to set number of previous revisions in config

Open hongkongkiwi opened this issue 3 years ago • 3 comments

Description

There seems no way to prune the changelog list apart from manually setting the changelog_start_rev

Possible Solution

There seems no way to prune the changelog apart from manually changing the config changelog_start_rev.

My changelog is becoming very large and not useful.

Additional context

Allow a config changelog_rev_count: X this allows us to set a number of previous revisions we. want to keep. Similar to manually updating the changelog_start_rev each time you use cz bump but it's automatic and handled by cz.

Additional context

No response

hongkongkiwi avatar Jun 23 '22 03:06 hongkongkiwi

Here is a workaround but it's sorta dumb :/

CHANGELOG_REV_COUNT=10
CHANGELOG_START_REV="$(git tag --list --sort=version:refname 'v[0-9]*.[0-9]*.[0-9]*' | tail -n$CHANGELOG_REV_COUNT | head -n1)"
cz changelog --start-rev "$CHANGELOG_START_REV"

hongkongkiwi avatar Jun 23 '22 04:06 hongkongkiwi

So basically, this feature wants commitizen to catch only the last few commits? If that's the case, I'm a bit against this feature as the later commits might not be able to indicate the purpose of the changes. I'd say it's users' responsibility to write and manage git commits while commitizen provides a tool for users to do so easier. @Woile what do you think?

Lee-W avatar Jul 22 '22 15:07 Lee-W

I'm not sure I understand the feature request. The idea would be to have like a maximum of versions displayed in the CHANGELOG? Like to tell cz to create a full changelog everytime only for the latest X versions. I don't think @hongkongkiwi script is stupid, is actually quite elegant solution that doesn't require adding extra code to commitizen.

woile avatar Jul 22 '22 16:07 woile