Skip to content

Bump with generating incremental changelog does not match version in previous generated changelog #297

Closed
@xvalec01

Description

@xvalec01

Description

When bumping version with generating incremental changelog which was already generated from previous bump, but with clean CHANGELOG.md file, it does not found version in changelog file and says that.

No tag found to do an incremental changelog

Ending with no added new bugfix with new version in changelog.

Steps to reproduce

My pyproject.toml:

[tool.commitizen]
name = "cz_conventional_commits"
tag_format = "$major.$minor.$patch$prerelease"
version = "0.3.2"
bump_message = "bump: version $current_version → $new_version"
update_changelog_on_bump = true

My customize template is here: cz_altair.zip

  1. cz -n cz_altair bump

Tag 0.2.0 could not be found.
Possible causes:

  • version in configuration is not the current version
  • tag_format is missing, check them using 'git tag --list'

? Is this the first tag created? Yes
bump: version 0.2.0 → 0.3.0
tag to create: 0.3.0

Is this the first tag created? Yes
bump: version 0.2.0 → 0.3.0
tag to create: 0.3.0
increment detected: MINOR

Done!

  1. git commit -m "bugfix #ALT-19: New one"
  2. cz -n cz_altair bump

Current behavior

If I bump version with generating changelog (I have update_changelog_on_bump = true in my pyproject.toml file):
cz -n cz_altair bump
and my CHANGELOG.md looks like that (it was generated by previous bump run with clean CHANGELOG.md file):

## 0.3.2 (2020-11-10)

### Bug Fixes

- bugfix [#ALT-19](https://...): Hello
- bugfix [#ALT-19](https://...): Asio
- bugfix [#ALT-19](https://...): Add new line at the end of the file

### Features

- feature [#ALT-19](https://...): Something big
- feature [#ALT-19](https://...): Commitizen initial commit

and now I make new commit, which increases patch version and do cz -n cz_altair bump again, it says that:

bump: version 0.3.2 → 0.3.3
tag to create: 0.3.3
increment detected: PATCH

No tag found to do an incremental changelog

I tried let pure version on the first line in the file like 0.3.2 without any .md symbols and it matches it but generate every commit from previous changelog + one new PATCH and insert it below:

0.3.2

### Bug Fixes

- bugfix [#ALT-19](https://...): Hello
- bugfix [#ALT-19](https://...): Asio
- bugfix [#ALT-19](https://...): Add new line at the end of the file

### Features

- feature [#ALT-19](https://...): Something big
- feature [#ALT-19](https://...): Commitizen initial commit
## 0.3.3 (2020-11-10)

### Bug Fixes

- bugfix [#ALT-19](https://...): New one
- bugfix [#ALT-19](https://...): Hello
- bugfix [#ALT-19](https://...): Asio
- bugfix [#ALT-19](https://...): Add new line at the end of the file

### Features

- feature [#ALT-19](https://...): Something big
- feature [#ALT-19](https://...): Commitizen initial commit

Desired behaviour

I expect that changelog will be generated and new version will be at the start of the file (before latest version in changelog), not at the end of it .

## 0.3.3 (2020-11-10)

### Bug Fixes

- bugfix [#ALT-19](https://...): New one


## 0.3.2 (2020-11-10)

### Bug Fixes

- bugfix [#ALT-19](https://...): Hello
- bugfix [#ALT-19](https://...): Asio
- bugfix [#ALT-19](https://...): Add new line at the end of the file

### Features

- feature [#ALT-19](https://...): Something big
- feature [#ALT-19](https://...): Commitizen initial commit

Environment

  • commitizen version: 2.6.0
  • python version: 3.8.5
  • operating system: Linux Debian9

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions