Re: [RTC/PATCH] Add 'update-branch' hook
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Apr 21, 2014, 23:00 UTC
- Message-ID
- <xmqqtx9m70fh.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <53559b0cc066_6c39e772f09d@nysa.notmuch>
Felipe Contreras <felipe.contreras@gmail.com> writes:
> ... there are _already_ hooks without pre/post.
Like commit-msg? Yes, it would have been nicer if it were named verify-commit-message or something.
Old mistakes are harder to change because of inertia. It is not a good excuse to knowingly make a new mistake to add new exceptions that the users need to check documentations for, is it?
> And it's not confusing,
A simple fact that Ilya asked the question tells us otherwise ;-)
I personally do not see an immediate need for post-update-branch, but if the new hook is about intervening an operation, it would be a good idea to name the hook with "pre-" like other "before doing something, validate the operation and forbid" hooks. Otherwise it would be impossible to later add "post-update-branch" for whatever reason without inviting "why does pre-update-branch hook is misnamed as just update-branch, when other validation and post-action pair are named pre-something and post-something?".