[RFC/PATCH 0/4] real reachability checks for upload-archive
- From
Jeff King <peff@peff.net>
- Date
- Jun 5, 2013, 22:35 UTC
- Message-ID
- <20130605223551.GF8664@sigill.intra.peff.net>
- In-Reply-To
- <20130605163823.GE8664@sigill.intra.peff.net>
On Wed, Jun 05, 2013 at 12:38:23PM -0400, Jeff King wrote:
Show 5 quoted lines
> 2. Actually do a reachability check. Doing a full object check to > allow fetching an arbitrary tree by sha1 is probably prohibitively > expensive[2], but we could allow the form "<commit>[:<path>]", check > that "<commit>" is reachable, and then allow arbitrary paths within > it.
Thinking on this more, the full reachability check is no worse than what a clone has to do to fetch the full repository. Here's a series that does the full check. I'm not entirely happy with the performance, though; details are in patch 3.
I think I'd be tempted to just go the more limiting "commit is reachable" route, instead, which would solve your case (and most sane cases).
[1/4]: clear parsed flag when we free tree buffers [2/4]: upload-archive: restrict remote objects with reachability check [3/4]: list-objects: optimize "revs->blob_objects = 0" case [4/4]: archive: ignore blob objects when checking reachability
-Peff