callowayproject / bump-my-version

A small command line tool to simplify releasing software by updating all version strings in your source code by the correct increment and optionally commit and tag the changes.
https://callowayproject.github.io/bump-my-version/
MIT License
349 stars 21 forks source link

Issue with commiting with `pre-commit` enabled in the workspace #217

Closed lnxpy closed 3 months ago

lnxpy commented 3 months ago

Description

When I have pre-commit enabled, if my cache is empty, pre-commit clones the hooks and tries to use them for the rest of committing moments. Since bump-my-version uses the classic git commit command, it will trigger pre-commit. That's why if I'm not connected to the internet or don't have access to those pre-commit hooks repositories, bumping my version would stop in the committing stage. Then, I have to commit them on my own. Ultimately, do git tag because git tag happens after git commit.

This is what it raises after a few minutes:

Failed to run ['git', 'commit', '-F', '/var/folders/w8/1ylgn1zn1ks8qrqyt1w32gjc0000gn/T/tmpex2iowly']: return code 1,     │
│ output: b''

Worth noting

Adding the --no-verify option when committing, won't trigger the pre-commit hooks.

git commit -m "..." --no-verify
coordt commented 3 months ago

You can add the --no-verify argument to the configuration

lnxpy commented 3 months ago

Nice! @coordt