Skip to content
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

Need a --force option #131

Open
ederag opened this issue Feb 9, 2020 · 4 comments
Open

Need a --force option #131

ederag opened this issue Feb 9, 2020 · 4 comments

Comments

@ederag
Copy link

ederag commented Feb 9, 2020

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.

@florisla
Copy link
Collaborator

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.

@ederag
Copy link
Author

ederag commented Feb 10, 2020

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.

@florisla
Copy link
Collaborator

florisla commented Feb 11, 2020

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.

@ederag
Copy link
Author

ederag commented Feb 11, 2020

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 😉
I really like your gauging-interest tag, curious to see the result.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants