bump2version icon indicating copy to clipboard operation
bump2version copied to clipboard

Need a --force option

Open ederag opened this issue 4 years ago • 4 comments

Thanks for bumpversion, usually works great.

Trying to create a beta version for hamster.

$ bump2version --new-version 3.0-beta
bumpversion: error: the following arguments are required: part

Cryptic error message at first, but from #45, it is because the beta is not handled by my regexps, so --new-version role is only to bypass the automatic increment stuff.

A --force option would be useful here, to release right now, and think later about a regexp fix, or just leave it at that, as releasing a beta version is exceptional for hamster.

[Edit] Summary of the request: When --new-version is used, the new version should be exactly the one provided. No smart heuristics (they break too often). An error when the new version is not compatible with the regex would be fine. But then a --force option would allow to bypass this check and proceed.

ederag avatar Feb 09 '20 20:02 ederag

The error message is in fact correct: bumpversion requires you to specify a [part], even when it's not needed. See #22.

So this would be more correct

bump2version bogus_part --new-version 3.0-beta

To me it feels weird to use a version number that your own regex is disallowing, but let's see if other people find this useful.

florisla avatar Feb 10 '20 10:02 florisla

Agreed, it should have been "cryptic at first", edited now. That was the feeling of a new user who mistakenly thought that new-version allowed a full override. After reading #45, the error message made perfect sense.

So this would be more correct bump2version bogus_part --new-version 3.0-beta

How would that be "more correct" ? But I might have wrong preconceptions about the workings of bumpversion, even after reading the doc.

To me it feels weird to use a version number that your own regex is disallowing

Why wouldn't it be possible to use bumpversion as a smart "search&replace" with file/locations limitations to prevent any wrong replacements ? Especially as a temporary measure.

ederag avatar Feb 10 '20 16:02 ederag

The command is "more correct" in the sense that bumpversion expects a part argument, and by listing bogus_part you are in fact supplying that. See #22 .

If you supply bogus_part, you'd get a different error message.

florisla avatar Feb 11 '20 10:02 florisla

OK, thanks for the answer, that makes some sense now. Of course the proposition summary added to the OP makes even more sense to me :wink: I really like your gauging-interest tag, curious to see the result.

ederag avatar Feb 11 '20 11:02 ederag