summaryrefslogtreecommitdiffstats
path: root/advice.c
diff options
context:
space:
mode:
authorDamien MariƩ <damien@dam.io>2017-10-06 08:07:55 +0000
committerJunio C Hamano <gitster@pobox.com>2017-10-10 13:21:46 +0900
commitf805a00a396ee91599902cebe55620b2a4c813b9 (patch)
treeff5e8a8d4b5dabf8a80a7442fe8672d6e61822c3 /advice.c
parent217f2767cbcb562872437eed4dec62e00846d90c (diff)
downloadgit-f805a00a396ee91599902cebe55620b2a4c813b9.tar.gz
git-f805a00a396ee91599902cebe55620b2a4c813b9.tar.xz
run-command: add hint when a hook is ignored
When an hook is present but the file is not set as executable then git will ignore the hook. For now this is silent which can be confusing. This commit adds this warning to improve the situation: hint: The 'pre-commit' hook was ignored because it's not set as executable. hint: You can disable this warning with `git config advice.ignoredHook false` To allow the old use-case of enabling/disabling hooks via the executable flag a new setting is introduced: advice.ignoredHook. Signed-off-by: Damien MariƩ <damien@dam.io> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'advice.c')
-rw-r--r--advice.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/advice.c b/advice.c
index d81e1cb74..c6169bcb5 100644
--- a/advice.c
+++ b/advice.c
@@ -17,6 +17,7 @@ int advice_set_upstream_failure = 1;
int advice_object_name_warning = 1;
int advice_rm_hints = 1;
int advice_add_embedded_repo = 1;
+int advice_ignored_hook = 1;
static struct {
const char *name;
@@ -38,6 +39,7 @@ static struct {
{ "objectnamewarning", &advice_object_name_warning },
{ "rmhints", &advice_rm_hints },
{ "addembeddedrepo", &advice_add_embedded_repo },
+ { "ignoredhook", &advice_ignored_hook },
/* make this an alias for backward compatibility */
{ "pushnonfastforward", &advice_push_update_rejected }