[PATCH v2] docs: document core.hooksPath=/dev/null
- From
Derrick Stolee via GitGitGadget <gitgitgadget@gmail.com>
- Date
- Apr 16, 2025, 15:42 UTC
- Message-ID
- <pull.1899.v2.git.1744818135435.gitgitgadget@gmail.com>
- In-Reply-To
- <pull.1899.git.1743719888430.gitgitgadget@gmail.com>
From: Derrick Stolee <stolee@gmail.com>
If a user wishes to disable hooks, then they can do so using the established pattern of setting 'core.hooksPath' to /dev/null. This is already tested in t1350-config-hooks-path.sh, but has not previously been visible in the documentation.
Update the documentation to include this as an option.
Signed-off-by: Derrick Stolee <stolee@gmail.com>
---
docs: document core.hooksPath=/dev/null
Based on the discussion of the proposed --no-hooks option in v1, that
code change is dropped in favor of this documentation of
core.hooksPath=/dev/null.
Thanks,
* StoleePublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-1899%2Fderrickstolee%2Fno-hooks-v2 Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1899/derrickstolee/no-hooks-v2 Pull-Request: https://github.com/gitgitgadget/git/pull/1899
Range-diff vs v1:
1: 91e82850e7d < -: ----------- git: add --no-hooks global option -: ----------- > 1: a9cd4bd5100 docs: document core.hooksPath=/dev/null
Documentation/config/core.adoc | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/Documentation/config/core.adoc b/Documentation/config/core.adoc index 8f6d8e77541..9fde1ab63a7 100644 --- a/Documentation/config/core.adoc +++ b/Documentation/config/core.adoc @@ -512,6 +512,11 @@ centrally configure your Git hooks instead of configuring them on a per-repository basis, or as a more flexible and centralized alternative to having an `init.templateDir` where you've changed default hooks. ++ +You can also disable all hooks entirely by setting `core.hooksPath` +to `/dev/null`. This is usually only advisable for expert users and +on a per-command basis using configuration parameters of the form +`git -c core.hooksPath=/dev/null ...`. core.editor:: Commands such as `commit` and `tag` that let you edit base-commit: 5b97a56fa0e7d580dc8865b73107407c9b3f0eff
-- gitgitgadget