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

Support commit flag when running bump-my-version with an external config file #216

Closed
abarri opened this issue Aug 2, 2024 · 0 comments · Fixed by #219
Closed

Support commit flag when running bump-my-version with an external config file #216

abarri opened this issue Aug 2, 2024 · 0 comments · Fixed by #219

Comments

@abarri
Copy link

abarri commented Aug 2, 2024

  • bump-my-version version: 0.24.3
  • Python version: All
  • Operating System: All

Description

I have my configuration stored in an external bumpversion.toml file, so that I can use it across multiple repositories.
In these repositories, I run bump-my-version with --config-file=/path_to_external/bumpversion.toml.

What I Did

When I set the commit flag, bump-my-version tries to stage the external config file resulting in a git error.

For example:

bump-my-version bump patch pyproject.toml --config-file=/path_to_external/bumpversion.toml --commit --verbose

returns the following logs:

...
Processing config file: /path_to_external/bumpversion.toml                                                                        
Preparing Git commit                                                                                                                                                                          
  Adding changes in file '/path_to_external/bumpversion.toml' to Git                                                              
fatal: : /path_to_external/bumpversion.toml: ': /path_to_external/bumpversion.toml' is outside repository at '/path_to_repo'
...

Proposal

First check if a config file is outside the git repo before trying to stage it.

@coordt coordt linked a pull request Aug 6, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant