git-cliff icon indicating copy to clipboard operation
git-cliff copied to clipboard

Patch version is bumped on breaking change if scope contains space

Open lgatellier opened this issue 10 months ago • 3 comments

Is there an existing issue for this?

  • [x] I have searched the existing issues

Description of the bug

If the scope mentioned in a commit message contains a space, and this commit mentions a breaking change, git-cliff bumps the patch version instead of the major version.

The space in the scope with the breaking flag are properly rendered in the changelog.

Steps To Reproduce

  1. Create an initial tag 1.0.0 on a Git repo
$ git tag 1.0.0
  1. Create a commit with a breaking change and a space in the commit message scope :
$ git commit --allow-empty -m 'feat(my scope)!: this is a test commit'

NB : The BREAKING CHANGE commit footer leads to the same behavior

  1. Invoke git-cliff to get next bumped version :
$ git-cliff --bumped-version
1.0.1

Expected behavior

The major version is bumped (version 2.0.0 is returned by git-cliff --bumped-version)

Screenshots / Logs

No response

Software information

Same behavior with the latest OCI image from docker.io/orhunp/git-cliff.

Additional context

No response

lgatellier avatar Jan 16 '25 16:01 lgatellier

Thanks for opening your first issue at git-cliff! Be sure to follow the issue template! ⛰️

welcome[bot] avatar Jan 16 '25 16:01 welcome[bot]

Thanks for reporting! I'm able to reproduce, reported to upstream library: https://github.com/release-plz/release-plz/issues/1996

orhun avatar Jan 18 '25 21:01 orhun

Thanks @orhun 😺

NB : I also reproduced the bug with a minor non-breaking change, only the patch version is bumped.

lgatellier avatar Jan 20 '25 14:01 lgatellier