From: Jonathan Nieder <jrnieder@gmail.com>
To: Jonathan Tan <jonathantanmy@google.com>
Cc: git@vger.kernel.org, Jeff Hostetler <git@jeffhostetler.com>
Subject: Re: RFC: Missing blob hook might be invoked infinitely recursively
Date: Thu, 29 Jun 2017 12:24:41 -0700 [thread overview]
Message-ID: <20170629192441.GA68015@aiede.mtv.corp.google.com> (raw)
In-Reply-To: <20170629114830.39dc2161@twelve2.svl.corp.google.com>
Hi,
Jonathan Tan wrote:
> 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.
[...]
> 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
next prev parent reply other threads:[~2017-06-29 19:25 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-29 18:48 RFC: Missing blob hook might be invoked infinitely recursively Jonathan Tan
2017-06-29 19:24 ` Jonathan Nieder [this message]
2017-06-30 18:28 ` Jeff Hostetler
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170629192441.GA68015@aiede.mtv.corp.google.com \
--to=jrnieder@gmail.com \
--cc=git@jeffhostetler.com \
--cc=git@vger.kernel.org \
--cc=jonathantanmy@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox