Title: scm provider cant find current tag with build metadata if matched by legacy_tag_formats · Issue #2015 · commitizen-tools/commitizen · GitHub
Open Graph Title: scm provider cant find current tag with build metadata if matched by legacy_tag_formats · Issue #2015 · commitizen-tools/commitizen
X Title: scm provider cant find current tag with build metadata if matched by legacy_tag_formats · Issue #2015 · commitizen-tools/commitizen
Description: Description When using version_provider = "scm" and a legacy tag format that matches PEP 440 prerelease tags with local/build metadata, commitizen appears to match the tag but fails to use it as the current tag for bump. Even if a reacha...
Open Graph Description: Description When using version_provider = "scm" and a legacy tag format that matches PEP 440 prerelease tags with local/build metadata, commitizen appears to match the tag but fails to use it as th...
X Description: Description When using version_provider = "scm" and a legacy tag format that matches PEP 440 prerelease tags with local/build metadata, commitizen appears to match the tag but fails to us...
Opengraph URL: https://github.com/commitizen-tools/commitizen/issues/2015
X: @github
Domain: www.github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"scm provider cant find current tag with build metadata if matched by legacy_tag_formats","articleBody":"### Description\n\nWhen using `version_provider = \"scm\"` and a legacy tag format that matches PEP 440 prerelease tags with local/build metadata, commitizen appears to match the tag but fails to use it as the current tag for `bump`.\n\nEven if a reachable tag like `1.0.1rc0+gha` exists and should be used, `cz bump --prerelease rc --build-metadata gha` reports that no matching tag could be found.\n\n### Steps to reproduce\n\nIn some dummy folder:\n\n```\ngit init\n\ncat \u003e pyproject.toml \u003c\u003c'EOF'\n[tool.commitizen]\nversion_provider = \"scm\"\nversion_scheme = \"pep440\"\ntag_format = \"$version\"\nlegacy_tag_formats = [\n '$major.$minor.$patch$prerelease\\+.*',\n]\nEOF\n```\n\nthen seed the release history:\n\n```\necho \"a\" \u003e file.txt\ngit add pyproject.toml file.txt\ngit commit -m \"feat: initial\"\ngit tag 1.0.1rc0+gha\n```\n\nthen make a follow up commit, and try to make a new release:\n\n```\necho \"b\" \u003e\u003e file.txt\ngit commit -am \"fix: bar\"\ncz bump --prerelease rc --build-metadata gha --get-next\n```\n\nproduces:\n```\nNo tag matching configuration could be found.\nPossible causes:\n- version in configuration is not the current version\n- tag_format or legacy_tag_formats is missing, check them using 'git tag --list'\n\n? Is this the first tag created? No\n1.1.0rc0+gha\n```\n\n### Current behavior\n\nEven if a tag like 1.0.1rc0+gha` exists, Commitizen reports:\n\n```\nNo tag matching configuration could be found.\nPossible causes:\n- version in configuration is not the current version\n- tag_format or legacy_tag_formats is missing, check them using 'git tag --list'\n```\n\nIf answering No to “Is this the first tag created?”, Commitizen appears to compute from more history than expected instead of using 1.0.1rc0+gha:\n\n```\n? Is this the first tag created? No\n1.1.0rc0+gha\n```\n\n### Desired behavior\n\nIf the current tag is of the pattern `1.0.1rc0+gha`, cz should recognize it and properly bump to `1.0.1rc1+gha` when using `cz bump --prerelease rc --build-metadata gha --get-next`\n\n### Screenshots\n\n_No response_\n\n### Environment\n\nCommitizen Version: 4.16.3\nPython Version: 3.14.6 (main, Jun 11 2026, 04:03:53) [Clang 22.1.3 ]\nOperating System: Linux\n","author":{"url":"https://github.com/theinditector","@type":"Person","name":"theinditector"},"datePublished":"2026-06-16T15:59:23.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/2015/commitizen/issues/2015"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:f05fc01d-f54e-b927-d3e1-0e4417cd5085 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B480:2CCD50:25E82A:354C07:6A5F1345 |
| html-safe-nonce | 3b7d8627e8ec762e1381360b90b1568c66ac86276936295f61cc6df640b3033e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNDgwOjJDQ0Q1MDoyNUU4MkE6MzU0QzA3OjZBNUYxMzQ1IiwidmlzaXRvcl9pZCI6IjExMzk2MTAzMTkyOTEwNzI3MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | c77930a75b880e19c24ff8f5d5a246e9016e22c2cff76aafdf5c4d53a2a61af9 |
| hovercard-subject-tag | issue:4675850288 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/commitizen-tools/commitizen/2015/issue_layout |
| twitter:image | https://opengraph.githubassets.com/aebb14ab5e3774105079428baf07b25a19210a4fd18b543e8b6c40baea519271/commitizen-tools/commitizen/issues/2015 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/aebb14ab5e3774105079428baf07b25a19210a4fd18b543e8b6c40baea519271/commitizen-tools/commitizen/issues/2015 |
| og:image:alt | Description When using version_provider = "scm" and a legacy tag format that matches PEP 440 prerelease tags with local/build metadata, commitizen appears to match the tag but fails to use it as th... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | theinditector |
| hostname | github.com |
| expected-hostname | github.com |
| None | bf8fa4b42b6d150def6175efb9b0f1ec8e9628d7229ee2bdf6e850e7bdad923e |
| turbo-cache-control | no-preview |
| go-import | github.com/commitizen-tools/commitizen git https://github.com/commitizen-tools/commitizen.git |
| octolytics-dimension-user_id | 62252524 |
| octolytics-dimension-user_login | commitizen-tools |
| octolytics-dimension-repository_id | 106127589 |
| octolytics-dimension-repository_nwo | commitizen-tools/commitizen |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 106127589 |
| octolytics-dimension-repository_network_root_nwo | commitizen-tools/commitizen |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7debc3c6cd5de09c6e22b47a1b9982acb2aabb7b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width