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

Re: [PATCH] update-hook: Major overhaul (handling tags, mainly).

From
Junio C Hamano <junkio@cox.net>
Date
Jan 6, 2006, 22:37 UTC
Message-ID
<7vd5j5rnib.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<20060104161729.7FD9C5BE85@nox.op5.se>
Andreas Ericsson <ae@op5.se> writes:
Show 15 quoted lines
> This is the update hook we use in all our git-repos.
>
> It has some improvements over the original version, namely:
> * Don't send every commit since dawn of time when adding a new tag.
> * When updating an annotated tag, just send the diffs since the last tag.
> * Add diffstat output for 'normal' commits (top) and annotated tags (bottom).
> * Block un-annotated tags in shared repos.
>
> I'm a bit uncertain about that last one, but it demonstrates how to
> disallow updates of a ref which we use, so I kept it.
>
> Note that git-describe is needed for the "changes since last annotated tag"
> thing to work.
>
> Signed-off-by: Andreas Ericsson <ae@op5.se>

templates/hooks--* is a good place to showcase these "best current practices", but unfortunately we can have only one BCP per script there. If nobody objects I'd take this patch.

I have been wondering if we would want to have an "examples/" directory in the source tree.

Previous: Andreas Ericsson
Message 2 of 2 in “update-hook: Major overhaul (handling tags, mainly).”
  1. update-hook: Major overhaul (handling tags, mainly).Andreas Ericsson, Jan 4, 2006
  2. Junio C HamanoJan 6, 2006

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.