Re: [PATCH] [RFC] Make git-update-ref invoke the update and post-update hooks
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 15, 2015, 21:45 UTC
- Message-ID
- <xmqqd20w7ii4.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <CAEJ-0i8mfabWoLivX_ZJHRJBYFftoENWmHw5__CGphK54oOpug@mail.gmail.com>
Brian Vandenberg <phantall@gmail.com> writes:
> Would you be less doubtful about adding a lower-level hook for > update-ref? Or in lieu of that, a config option that can affect the > behavior of its "-m" and "-d" options?
Not really.
Those who want to bypass your policy can use "vi .git/packed-refs" and/or "rm .git/refs/heads/foo"; you would not propose to patch "rm" and "vi" to pay attention to git configuration, because they are not about "git" at all, and there are cases where these bare-metal level editing of repositories is necessary. You would instead tell them "don't do that".
When I say "update-ref is a low-level plumbing command that should not enforce policy", I am suggesting you to treat the command just like you would treat "rm" and "vi".