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

Re: [PATCH] add post-fetch hook

From
Joey Hess <joey@kitenet.net>
Date
Dec 27, 2011, 15:49 UTC
Message-ID
<20111227154907.GB15006@gnu.kitenet.net>
In-Reply-To
<7v8vly8qqx.fsf@alter.siamese.dyndns.org>
Junio C Hamano wrote:
Show 9 quoted lines
> Joey Hess <joey@kitenet.net> writes:
> 
> > .... And other code in git uses an async feeder similarly,
> > see for example convert.c's apply_filter(). So I think this is ok..?
> 
> Yeah, I didn't look at your patch (sorry) but if it uses async like the
> filtering codepath does, it should be perfectly fine (please forget about
> the select(2) based kludge I alluded to; the async interface is the right
> thing to use here).

No problem, I was surprised to be getting responses at all over the holidays. :)

Then async also seems the right thing to use for the hook refactoring. A caller can provide two function pointers; a feeder function that is called async, and a reader that is *not* called async (which would allow it to modify program state), and the refactored hook function handles running the hook(s) and connecting them to the feeder and/or reader.

-- 
see shy jo
Previous: Junio C HamanoNext: Junio C Hamano
Message 13 of 16 in “add post-fetch hook”
  1. add post-fetch hookJoey Hess, Dec 24, 2011
  2. Junio C HamanoDec 25, 2011
  3. Joey HessDec 25, 2011
  4. Junio C HamanoDec 25, 2011
  5. Jakub NarebskiDec 25, 2011
  6. Joey HessDec 25, 2011
  7. Junio C HamanoDec 26, 2011
  8. Joey HessDec 25, 2011
  9. add post-fetch hookJoey Hess, Dec 26, 2011
  10. Junio C HamanoDec 26, 2011
  11. Joey HessDec 26, 2011
  12. Junio C HamanoDec 27, 2011
  13. Joey HessDec 27, 2011
  14. Junio C HamanoDec 27, 2011
  15. Johannes SixtDec 27, 2011
  16. Joey HessDec 28, 2011

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.