Subject: Re: [PATCH v3] bugreport: collect list of populated hooks

From: Jonathan Nieder <[email-masked]>
Date: Wed, 29 Apr 2020 18:53:20 -0700

Jonathan Nieder wrote:
> Emily Shaffer wrote:

>> +++ b/t/t0091-bugreport.sh
>> @@ -57,5 +57,15 @@ test_expect_success 'can create leading directories outside of a git dir' '
>>  	nongit git bugreport -o foo/bar/baz
>>  '
>>  
>> +test_expect_success 'indicates populated hooks' '
>> +	test_when_finished rm git-bugreport-hooks.txt &&
>> +	test_when_finished rm -fr .git/hooks &&
>> +	mkdir .git/hooks &&
>
> This is subtle.  Since c09a69a83e3 (Disable hooks during tests,
> 2005-10-16), the repository in which the test runs has its "hooks"
> directory renamed to "hooks-disabled", with rationale
>
>     Individual tests for hooks would want to have their own tests when
>     written.  Also we should not pick up from random templates the user
>     happens to have.
>
> That rationale is a bit strange because we explicitly passed
> --template to "git init" even then, so we could be confident that the
> built-in templates that do not enable any hooks would be in use.
>
> Mailing list diving finds [1].  We didn't have f98f8cbac01 (Ship
> sample hooks with .sample suffix, 2008-06-24) yet, which means that on
> filesystems that do not record an executable bit, the sample hooks
> were all enabled by default.  Nowadays that has been fixed and we
> should be able to get rid of the "mv .git/hooks .git/hooks-disabled"
> in the test setup.

And of course I forget to include the footnote.  Sorry for the noise.

Jonathan

[1] https://lore.kernel.org/git/[email-masked]/