Skip to content

Version tags with patch version zero ignored if floating tags exist #1863

@Clockwork-Muse

Description

@Clockwork-Muse

Description

I'm using tags to manage my versioning, and this includes floating tags for major/minor releases in addition to the full major+minor+patch releases/tags.

On tags with a minor bump, resulting in a new 0 patch version, the patch version of the returned version is missing.

.cz.toml
[tool.commitizen]
name = "cz_conventional_commits"
tag_format = "v$version"
version_scheme = "semver2"
version_provider = "scm"
annotated_tag = true
breaking_change_exclamation_in_title = true
major_version_zero = true

Steps to reproduce

git init --initial-branch main
git add .cz.toml 
git commit -m "feat: initial commit"
git tag v1.0.0
# outputs 1.0.0
cz version --project
git tag v1.0
# outputs 1.0
cz version --project
git tag v1
# still outputs 1.0
cz version --project

Current behavior

Leaves off the patch version.

Desired behavior

Also contains the patch version

Screenshots

No response

Environment

Commitizen Version: 4.13.4
Python Version: 3.13.5 (main, Jun 25 2025, 18:55:22) [GCC 14.2.0]
Operating System: Linux

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions