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

Re: post-fetch, tweak-fetch hook

From
Jeff King <peff@peff.net>
Date
May 7, 2012, 13:38 UTC
Message-ID
<20120507133810.GA4860@sigill.intra.peff.net>
In-Reply-To
<CAKLmikNuUB01xKSm9Skd2chXWw3BcWDHT23hqWtNBJPJfYqDKQ@mail.gmail.com>
On Mon, May 07, 2012 at 11:11:30AM +0200, Mitar wrote:
Show 7 quoted lines
> On Mon, May 7, 2012 at 9:29 AM, Jeff King <peff@peff.net> wrote:
> > I would say the "most git" thing would be to implement "fetch
> > --porcelain", and use its output.
> 
> Yes, that would be also useful. It still makes two different
> interfaces for probably same post-processing (after push and after
> fetch), but still better than nothing, what is current state.

There is nothing to say that the output from "git fetch" could not look exactly like the post-receive hook's input (in fact, that seems like a very simple and sensible format). Then you could reuse the code easily.

They would still differ in that one is a hook and one is not, of course. But at the same time, not being a hook leaves the caller of "git fetch" with much more flexibility about deciding when to call the hook and when not (whereas push does not have that luxury, because the code is running on the remote side).

-Peff
Previous: Mitar
Message 6 of 6 in “post-fetch, tweak-fetch hook”
  1. MitarMay 6, 2012
  2. Seth RobertsonMay 6, 2012
  3. MitarMay 6, 2012
  4. Jeff KingMay 7, 2012
  5. MitarMay 7, 2012
  6. Jeff KingMay 7, 2012

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.