-
-
Notifications
You must be signed in to change notification settings - Fork 925
Closed
Description
search you tried in the issue tracker
pre-push
describe your issue
I am attempting to write a pre-push hook which prevents tag deletion.
By way of print statements, I observe the following behavior.
When I install the pre-push hook via pre-commit:
- I push a tag with
git push origin tmptag, the hook is invoked. - I delete a tag with
git push origin :tmptag, the hook is not invoked
In contrast, if I forgo pre-commit and manually put a pre-push file in my .git/hooks/ folder
- I push a tag with
git push origin tmptag, the hook is invoked. - I delete a tag with
git push origin :tmptag, the hook is invoked
Am I misunderstanding how the pre-push hook of pre-commit is supposed to work? Or is there some logic within pre-commit to skip the execution of pre-push hooks under certain circumstances?
pre-commit --version
3.3.3
.pre-commit-config.yaml
- repo: local
hooks:
- id: prevent-tag-deletion
name: prevent tag deletion
entry: python
language: system
args: ['pre_push.py']
stages: [pre-push]
verbose: true~/.cache/pre-commit/pre-commit.log (if present)
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels