Re: [PATCH v4 8/9] commit: use config-based hooks
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Sep 10, 2020, 22:21 UTC
- Message-ID
- <xmqqy2lhnuh0.fsf@gitster.c.googlers.com>
- In-Reply-To
- <a81b058c-b193-7020-30c9-9238407889ba@gmail.com>
Phillip Wood <phillip.wood123@gmail.com> writes:
Show 9 quoted lines
>> + const char *arg; >> + struct strvec hook_args = STRVEC_INIT; >> + struct strbuf hook_name = STRBUF_INIT; >> int ret; >> + strbuf_addstr(&hook_name, name); > > Seeing this makes me wonder if it would be better for run_hooks() to > take a string for the name rather than an strbuf, I suspect that > virtually all callers have a fixed hook name.
Yeah, that is a good point. It is always a good discipline to keep the type of the parameters callers need to pass to the minimum.