Is it possible to temporarily disable a hook when running a mercurial command? e.g., something like:
hg push --no-hook
Is it possible to temporarily disable a hook when running a mercurial command? e.g., something like:
hg push --no-hook
You can't disable a remote repository's hook. But you could enable or disable a local hook via --config
option:
$ hg commit -m test --config 'hooks.commit.info=set | grep "^HG_"'
According to this bugfeature, the following skips local hooks:
hg --config alias._pull=pull _pull
Obviously this is a hack, but it has worked since 2011, and is the only way to skip local hooks given the lack of a '--no-hooks' option.
hg --config alias.fpush=push fpush
doesn't appear to work. It's still running my preoutgoing
hook. –
Sanfred pull
and not push
. –
Sixteenth You can't disable a remote repository's hook. But you could enable or disable a local hook via --config
option:
$ hg commit -m test --config 'hooks.commit.info=set | grep "^HG_"'
If this is an outgoing
or preoutgoing
hook that is locally configured, you can disable it by commenting out its entry under [hooks]
in .hg/hgrc
. If this is a hook configured on the repository that you are pushing to (changegroup
, incoming
, prechangegroup
, pretxnchangegroup
), you will have to comment out its entry under [hooks]
in the target repository's .hg/hgrc
(if you have access to it).
© 2022 - 2024 — McMap. All rights reserved.
pull
with other commands (e.g.commit
) to run those without their local hooks. – Vlad