Re: [PATCH v2] run-command: add hint when a hook is ignored

2017-10-06 Thread Damien
Thanks for the help, a new patch is coming with those fixes applied. On Fri, Oct 6, 2017 at 7:53 AM, Junio C Hamano wrote: > Junio C Hamano writes: > >> I think it is easier to reason about if this were not "else if", but >> just a simple "if". > > And here are two small suggested changes to the

Re: [PATCH v2] run-command: add hint when a hook is ignored

2017-10-05 Thread Junio C Hamano
Junio C Hamano writes: > I think it is easier to reason about if this were not "else if", but > just a simple "if". And here are two small suggested changes to the code portion of your patch. - break if / else if cascade into two independent if / if statements for clarity. - give the "ign

Re: [PATCH v2] run-command: add hint when a hook is ignored

2017-10-05 Thread Junio C Hamano
Here is a suggested rewrite of t7519 (I used t7520 to avoid crashing with another topic in flight). - use unused/unallocated 7520 to avoid crashes with bp/fsmonitor topic - use setup inside test_expect_success - use test_i18ngrep to avoid gettext-poison build gotchas - look for specific

Re: [PATCH v2] run-command: add hint when a hook is ignored

2017-10-05 Thread Junio C Hamano
Junio C Hamano writes: >> diff --git a/t/t7519-ignored-hook-warning.sh >> b/t/t7519-ignored-hook-warning.sh >> new file mode 100755 Another thing; t7519 is taken by another topic in flight. Let's use t7520 instead.

Re: [PATCH v2] run-command: add hint when a hook is ignored

2017-10-05 Thread Junio C Hamano
Damien MariƩ writes: > if (access(path.buf, X_OK) < 0) { > + int err = errno; OK, so we remember how/why we failed in err. > #ifdef STRIP_EXTENSION > strbuf_addstr(&path, STRIP_EXTENSION); > if (access(path.buf, X_OK) >= 0) >

[PATCH v2] run-command: add hint when a hook is ignored

2017-10-05 Thread Damien MariƩ
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