Open camilonova opened 9 years ago
Yes, you're right. Thanks for finding this!
Would you want to prepare a pull-request?
I tried to fix it, but your argument parsing seems more complicated that it should be.
I ran into this problems as well (accidentally ran bumpversion bugfix
rather than bumpversion patch
), but in my case it had rather disastrous consequences. I'm using this .bumpversion.cfg:
[bumpversion]
current_version = 1.3.6
commit = True
tag = True
tag_name = {new_version}
[bumpversion:file:tmtpds/__init__.py]
[bumpversion:file:requirements.Linux.rpm.txt]
search = tmtpds.git@{current_version}
replace = tmtpds.git@{new_version}
When I ran bumpversion bugfix
, it made an incorrect change to requirements.Linux.rpm.txt, then committed with a "Bump version: 1.3.4 → 1.3.4" commit message. But it didn't tag the commit, and didn't bump the version number.
The incorrect change it made was:
diff --git a/requirements.Linux.rpm.txt b/requirements.Linux.rpm.txt
index 42ecad9..2f1b6b9 100644
--- a/requirements.Linux.rpm.txt
+++ b/requirements.Linux.rpm.txt
@@ -29,4 +29,4 @@ Unidecode==0.04.16
# Update this for every release build.
--e git+git@bitbucket.org:[REDACTED]/tmtpds.git@1.3.4#egg=tmtpds
+-e git+git@bitbucket.org:[REDACTED]/tmtpds.git@tmtpds.git@1.3.4#egg=tmtpds
Notice that it duplicated tmtpds.git@
and didn't bump the version.
Since I have bumpversion configured to immediately commit the changes it makes, this problem silently crept into my git repo without me noticing. That is a critical bug that requires immediate developer intervention.
Hey, @coredumperror could you make a new issue for this maybe including more details or a reduced test case so I can look into this ? I don' think this is related to the original issue @camilonova is describing here.
@camilonova yes, bumpversion is just config parsing at heart. But there's a very heavy test suite I use to keep myself from breaking things accidentally :) If you use that you should be on the safe side.
@camilonova Also, if you'd like me to take a look at this problem could you please share your config and/or a (reduced) test case so I can reproduce this ?
@peritus Sure, I'll open a new issue. I managed to replicate it with a super simply repo, so it shouldn't be hard to track down.
It should tell me
mayor
is not a valid argument.