git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] [RFC] Make git-update-ref invoke the update and post-update hooks

From
BVBrian 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
Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 5 in “Re: [PATCH] [RFC] Make git-update-ref invoke the update and post-update hooks”
  1. Brian VandenbergJun 15, 2015
  2. Junio C HamanoJun 15, 2015
  3. Brian VandenbergJun 15, 2015
  4. Junio C HamanoJun 15, 2015
  5. Brian VandenbergJun 16, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.