Open glutanimate opened 5 years ago
I have a similar flow, with the same inconvenience. The limitation being that you can bump only one part at once unless you specify the full new-version
(which is error-prone).
The node semver preminor
approach requires the tool to know what is a 'pre' value for a part, which bump2version currently does not know.
I think it would be most flexible if bump2version would support multiple part
arguments at once, and also allows you to choose between "bump to the next value like usually" or "bump to the value which I explicitly choose here".
A command-line interface like this would be really sweet:
# specify an explicit value for one specific part
bump2version release=gamma
bump2version --part release=gamma
# bump multiple parts in one go
bump2version --part patch --part release
# bump two parts, with one a specific value
bump2version --part patch --part release=gamma
Definitely open to this.
This is inspired by npm's semver increments. To quote the node docs:
E.g.:
From what I understand it's not possible to replicate this with bumpversion without using
--new-version
at some point. Either you always walk through the pre-release steps or you don't walk through them at all.For instance, this config:
would behave as follows:
In many scenarios this is not desirable, as you would want to be able to push out a patch without having to walk through the pre-release steps (e.g. dev → alpha →...).
The only other option is to add
first_value = gamma
under[bumpversion:part:release]
which would change the behavior as follows:But to switch to a pre-release you would then have to use
--new-version
:It would be nice to have a shorthand for this rather than having to manually type the release.
P.S.: Thanks for all your work on bump2version! It's nice to see this project alive and thriving.