mbarkhau / bumpver

BumpVer: Automatic Versioning
https://github.com/mbarkhau/bumpver
MIT License
199 stars 36 forks source link

Error when using --no-tag-commit #209

Closed tardis4500 closed 1 year ago

tardis4500 commented 1 year ago

Whenever I use the --no-tag-commit I get an error on the push:

INFO - fetching tags from remote (to turn off use: -n / --no-fetch) INFO - Old Version: 42.0.0rc7 INFO - New Version: 42.0.0rc8 INFO - git commit --message 'bump version 42.0.0rc7 -> 42.0.0rc8' INFO - git push origin --follow-tags 42.0.0rc8 HEAD ERROR - Error running subcommand: ['git', 'push', 'origin', '--follow-tags', '42.0.0rc8', 'HEAD'] error: src refspec 42.0.0rc8 does not match any error: failed to push some refs to 'gitlab.com:arisilon/batcave.git'

mbarkhau commented 1 year ago

Thank you for your error report. It would be helpful, if you can providing a test that reproduces the underlying issue.

tardis4500 commented 1 year ago

I forked your repo to my personal space then cloned it and ran the command: bumpver update --no-tag-commit.

This results in the error:

INFO - fetching tags from remote (to turn off use: -n / --no-fetch) INFO - Old Version: 2023.1124 INFO - New Version: 2023.1125 INFO - git commit --message 'bump 2023.1124 -> 2023.1125' INFO - git push origin --follow-tags 2023.1125 HEAD ERROR - Error running subcommand: ['git', 'push', 'origin', '--follow-tags', '2023.1125', 'HEAD'] error: src refspec 2023.1125 does not match any error: failed to push some refs to 'https://github.com/tardis4500/bumpver.git'

mbarkhau commented 1 year ago

You are providing little to no context and leaving me to guess at the problem. For example, what does your bumpver configuration look like? Please provide a Minimal Reproducible Example, otherwise this is a waste of everybody's time.

I'm going to guess that the result is the exact same if you leave --no-tag-commit? Are you perhaps misinterpreting this cli flag?

tardis4500 commented 1 year ago

I provided complete context. As I said, I cloned a forked version of your bumpver repo, so the configuration is whatever is in the bumpver repo. It works if I leave off the --no-tag-commit. To reproduce this error:

  1. Clone the bumpver repository
  2. cd into the cloned bumpver repository
  3. run: bumpver update --no-tag-commit

I am sorry if I wasn't clear enough about my git interactions with use of the terms fork and clone. I know they can be a bit confusing for someone without extensive knowledge of the platform. If this still isn't clear enough, and using your own repo is too complicaated, let me know and I can create a new clean repo, invite you to it and you can try using it to reproduce the error.

mbarkhau commented 1 year ago

I see, thank you for this update.

I see two options:

tardis4500 commented 1 year ago

I would personally suggest that it cause the --follow-tags option to be omitted so that the --push is respected. It would be too easy for someone to put the push option in their config and not realize the push is no longer happening and then have to run the push themselves. I use the option because I bump the version on every commit as a pre-release version but I don't need all those tags.

mbarkhau commented 1 year ago

Fixed with 2023.1125