Open jwodder opened 3 years ago
100% agreed!
One minor addition: I think it would be helpful to provide a list of valid parts to the user both when (1) they provide an invalid value, and (2) whenever they forget to include part argument altogether.
Speaking as someone who has done both, repeatedly. :-)
Is this fixed in #168? I just hit this again on v1.0.1 with a new developer when they typed bumpversion help
which caused confusion. Is this just waiting on the next release?
Having the opposite outcome for such a typo; it does make a commit that doesn't change the version, and "mangles" the version number in versioned files: `darrin@cornelia ~/myproject (development)> cat setup.cfg | grep version version = 1.4.0 darrin@cornelia ~/myproject (development)> bumpversion kablooie darrin@cornelia ~/myproject (development)> git log -n 1 commit 727e9ca3d2dbb2291e38132d5da5197b404106a9 (HEAD -> development) Author: Darrin Edwards dedwards@example.com Date: Thu Jun 30 16:51:41 2022 -0500
Bump version: 1.4.0 → 1.4.0
darrin@cornelia ~/myproject (development)> cat setup.cfg | grep version version = version = 1.4.0 ` (note the extra "version =" in the last line)
If a typo or other mistake is made on the command line and the user tries to run
bump2version
with an invalidpart
(e.g.,bump2version pathc
), the program will not detect thatpart
is invalid. Instead, it ends up making no changes to the repository and then tries to commit anyway, and at that point the user is shown gobs of unhelpful error messages like the following:bump2version
should instead detect invalidpart
s and error out with a human-friendly message indicating that thepart
is invalid.