-
Notifications
You must be signed in to change notification settings - Fork 10
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
a present core.hooksPath
setting is ignored
#7
Comments
Could either record a previous value to The new |
An updated #!/bin/sh
PREVIOUS_HOOKS_PATH=$(git config --get team.state.previousHooksPath)
REAL_GLOBAL_HOOK="${PREVIOUS_HOOKS_PATH}/$(basename $0)"
if [ -n "${PREVIOUS_HOOKS_PATH}" ] && [ -x "${REAL_GLOBAL_HOOK}" ]; then
"${REAL_GLOBAL_HOOK}" "$@" || exit $?
else
REAL_LOCAL_HOOK="$(git rev-parse --show-toplevel)/.git/hooks/$(basename $0)"
if [ -x "${REAL_LOCAL_HOOK}" ]; then
"${REAL_LOCAL_HOOK}" "$@" || exit $?
fi
fi
exit 0 Also corrected to only use executable files, and mimic git hooks behaviour in that if a global hook is present, a local hooks is ignored (assuming that most well-written global hooks have logic to execute local hooks when present). |
Thanks for the input. My thoughts were going in a pretty similar direction. Your suggestion for |
When the git config option core.hooksPath is overriden by git-team enable, its previous value is recorded and ... - used to lookup and run other git hooks while git-team is enabled - restored when running git-team disable fixes issue 7, see: #7
Finally closed by 39bb2cc. |
Bug Report
git-team version: 1.3.4
go version: 1.12
failure description
The
git config
optioncore.hooksPath
is overriden onenable
and then unset ondisable
. If it was set before, the respective hooks will be deactivated when git-team is enabled and not re-enabled when git-team is disabled again. This is confusing for users.expected behaviour description
Existing hooks in
core.hooksPath
– apart fromprepare-commit-msg
– should be respected.The text was updated successfully, but these errors were encountered: