From: Johannes Sixt Date: Thu, 25 Apr 2019 19:40:34 GMT Subject: Re: [PATCH 1/5] run-command: add preliminary support for multiple hooks Message-ID: <2a511c3c-ef8d-07c5-80e2-398780ee6ed4@kdbg.org> In-Reply-To: Am 25.04.19 um 02:55 schrieb Junio C Hamano: > Johannes Sixt writes: > >> Furthermore, basing a decision on whether a file is executable won't >> work on Windows as intended. So, it is better to aim for an existence check. > > That is a good point. > > So it may be OK for "do we have a single hook script for this hook > name?" to say "no" when the path exists but not executable on > POSIXPERM systems, but it is better to say "yes" for consistency > across platforms (I think that is one of the reasons why we use > .sample suffix these days). All correct. > And for the same reason, for the purpose of deciding "because we do > not have a single hook script, let's peek into .d directory > ourselves", mere presence of the file with that name, regardless of > the executable bit, should signal that we should not handle the .d > directory. > > IOW, you think access(X_OK) should be more like access(F_OK)? Yes, that's my conclusion. -- Hannes