commitizen icon indicating copy to clipboard operation
commitizen copied to clipboard

In changelog version format should be without tag_format

Open ssiuhk opened this issue 3 years ago • 2 comments

Description

Not sure if I misunderstood, the version format shown on changelog should be $version instead of "TAG_NAME$version"

$ cat .cz.toml | grep tag_format
tag_format = "SOME_TAG_PREFIX_$version"

$ git tag -l
SOME_TAG_PREFIX_1.0.0

Steps to reproduce

  1. Create some commits
  2. Tag them with formatted tags
  3. Bump new version with the option --changelog [or]
  4. Generate changelog with existing tags

Current behavior

For new version

cz bump --dry-run --changelog
bump: version 1.0.0 → 1.1.0
tag to create: SOME_TAG_PREFIX_1.1.0
increment detected: MINOR

## SOME_TAG_PREFIX_1.1.0 (2022-08-20)

### Feat

- **Testing**: Testing something

Generate changelog

$ cz changelog --dry-run
## Unreleased

### Feat

- **Testing**: Testing something

## SOME_TAG_PREFIX_1.0.0 (2022-08-19)

Desired behavior

For new version

$ cz bump --dry-run --changelog
bump: version 1.0.0 → 1.1.0
tag to create: SOME_TAG_PREFIX_1.1.0
increment detected: MINOR

## 1.1.0 (2022-08-20)

### Feat

- **Testing**: Testing something

Generate changelog

$ cz changelog --dry-run
## Unreleased

### Feat

- **Testing**: Testing something

## 1.0.0 (2022-08-19)

Screenshots

No response

Environment

$ cat .cz.toml | grep tag_format
tag_format = "SOME_TAG_PREFIX_$version"

$ git tag -l
SOME_TAG_PREFIX_1.0.0

$ cz version --report
Commitizen Version: 2.31.0
Python Version: 3.6.8 (default, Mar 25 2022, 11:15:52)
[GCC 8.5.0 20210514 (Red Hat 8.5.0-10)]
Operating System: Linux

ssiuhk avatar Aug 20 '22 00:08 ssiuhk

I'm not sure why the version format shown on changelog should be $version instead of "TAG_NAME$version". Is there any document indicate this? @Woile do you recall how you design it?

Nonetheless, if you really need this behavior, you could try https://commitizen-tools.github.io/commitizen/customization/#custom-changelog-generator

Lee-W avatar Aug 20 '22 08:08 Lee-W

Mmm I think some changelogs in the past used to have something like v1.0.0, where v is the tag_format so I thought it would make sense to use the tag_format. But it makes more sense like described in this ticket.

woile avatar Aug 21 '22 10:08 woile