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

Re: RFC: Missing blob hook might be invoked infinitely recursively

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Jun 29, 2017, 19:24 UTC
Message-ID
<20170629192441.GA68015@aiede.mtv.corp.google.com>
In-Reply-To
<20170629114830.39dc2161@twelve2.svl.corp.google.com>
Hi,
Jonathan Tan wrote:
Show 7 quoted lines
> Suppose you have missing blob AB12 and CD34 that you now need, so
> fetch-blob is invoked. It sends the literals AB12 and CD34 to a new
> server endpoint and obtains a packfile, which it then pipes through "git
> index-pack". The issue is that "git index-pack" wants to try to access
> AB12 and CD34 in the local repo in order to do a SHA-1 collision check,
> and therefore fetch-blob is invoked once again, creating infinite
> recursion.
[...]
Show 6 quoted lines
> 2. Add support for an environment variable to Git that suppresses access
> to the missing blob manifest, in effect, suppressing invocation of the
> hook. This allows anyone (the person configuring Git or the hook writer)
> to suppress this access, although they might need in-depth knowledge to
> know whether the hook is meant to be run with such access suppressed or
> required.

Small tweak: what if Git itself sets that environment variable when invoking the hook? A fetch-blob hook author can then explicitly unset the environment variable to request recursion if they need it.

I should credit Shawn Pearce for saying this a little more clearly offline a moment ago.

Thanks, Jonathan

Previous: Jonathan TanNext: Jeff Hostetler
Message 2 of 3 in “RFC: Missing blob hook might be invoked infinitely recursively”
  1. Jonathan TanJun 29, 2017
  2. Jonathan NiederJun 29, 2017
  3. Jeff HostetlerJun 30, 2017

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.