-
-
Notifications
You must be signed in to change notification settings - Fork 282
Support placeholders for local version bumping #436
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Sorry, I'm a bit confused. Is it a duplicate issue to #435? |
No. Not at all. The local version label is the bit after the + For example, in the following version string,
The desired behaviour would be that you could specify this placeholder in some config and then when calling Current Version: Current Version: P.s. it's not clear to me what logic you use to increment different parts of the local version. Docs just talk about +0.1.0 becoming +0.2.0 so that's the example i've used above. |
Got your point. I'm okay with this one. But need @woile 's thought as well |
I like this idea. I'm not a user of local-versions per-se, and I'd like to avoid any breaking change for people who are already using it. I guess we could make new tag_formats including the new variables? [tool.commitizen]
tag_format = "v$major.$minor.$patch$prerelease+$branch-$shortcommit-$longcommit-$localversion" Would something like that work for you? |
@woile thanks for the response. Sort of but 2 things to clarify:
I think instead, something like this might be better [tool.commitizen]
version = 1.0.0
local_version_format = "$branch-$shortcommit"
tag_format = "v$major.$minor.$patch+$branch-$shortcommit" # deliberately not trying to expand $local_version_format here because $local_version_format might be overridden by some CLI arg The way this would work with the above example is something like this There is still the brainfart of compatibility between PEP440 and SemVer to sort though. If you gave me the above, I still couldn't use it because I need 1.0.0.dev0+foo-d92197 and I can't add the .dev0 bit in my version identifier until you solve this problem. My short term workaround is just to set dev versions manually - which I'd like to do via commitizen - which is what #435 is about. |
@woile what do you think? what are the next steps? |
Local versions are specified in pep440#localversions and if we were to make changes, it should continue to work. Maybe it's not necessary to add them as part of the I like your proposal, as long as the current Sorry for the late replies, I've been quite busy lately |
Sure, I think so. |
Could this be picked up in upcoming sprint? |
Sure! Feel free to pick it up anytime 👍 |
Closing as there has not been enough interest for this feature. Feel free to open a new issue with the full proposal discussed here. |
Local versions do not have to consist of pure numbers - according to either Semantic Version Specification or PEP 440.
It is common to use things like branch names or long/short commit SHAs in local version identifiers. It would be great if commitizen would be smart enough to allow me to bump a local version based on some pattern containing placeholders that commitizen is capable of replacing.
If not, a workaround would be to allow me to specify the entire version manually - I opened a separate issue for that here. Other than that, I don't think there is a workaround right now and I am not able to use commitizen for my dev versions.
The text was updated successfully, but these errors were encountered: