git-bump icon indicating copy to clipboard operation
git-bump copied to clipboard

Trigger commit hooks when git bump is run

Open mtscout6 opened this issue 11 years ago • 2 comments

Coin commit hooks that can reside in ./.git/hooks/ that will be called pre and post git bump.

For the pre commit hook if you respect failures you can prevent git bump unless project specific conditions are accounted for. For example all tests must be green before bumping the version.

With the post commit hook you could then do something like publish built gem.

It may also be beneficial to support these hooks in a ./.bump directory so they could be committed and shared with the team.

mtscout6 avatar Apr 25 '14 14:04 mtscout6

Any reason this can't be handled by pre-commit and post-commit instead? We could set an environment variable or two if that helps.

I'm particularly skeptical of the post-bump example. I think requiring a separate step is a good precaution against accidental publishing.

tpope avatar Apr 29 '14 22:04 tpope

Having the environment variable is feasible, and easy to deal with in the default commit hook paradigm.

mtscout6 avatar May 15 '14 16:05 mtscout6