Re: [PATCH] [RFC] Make git-update-ref invoke the update and post-update hooks
- From
- Brian Vandenberg <phantall@gmail.com>
- Date
- Jun 15, 2015, 20:58 UTC
- Message-ID
- <CAEJ-0i8mfabWoLivX_ZJHRJBYFftoENWmHw5__CGphK54oOpug@mail.gmail.com>
- In-Reply-To
- <xmqqpp4w7mco.fsf@gitster.dls.corp.google.com>
On Mon, Jun 15, 2015 at 2:22 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 5 quoted lines
> I am ultra-doubtful at this point ;-) > > For one thing, update-ref is not a tool that is exclusive to > receiving object transfer aka receive-pack, so it makes no sense for > it to pay attention to post-update.
I was a little dubious about that as well, though I like the idea of update-ref having a hook.
Show 13 quoted lines
> Also it is a low-level plumbing; the policy issues should come at a > level higher than that. I.e. Porcelain scripts implemented using > them as building blocks should be the ones that you do your policy, > e.g. > > if whatever logic you want to use in your policy says OK > then > git update-ref ...args... > else > echo >&2 "My policy does not like your arguments" > exit 1 > fi >
In principle I agree, though telling people "you should use xyz script" is one thing; in practice they're more likely to google "git alter history" and eventually find an explanation for using update-ref, completely bypassing any policy/protocol we put in place for altering history on the master repo.
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?
-Brian