Re: [PATCH v3 1/2] list-objects-filter: only parse sparse OID when 'have_git_dir'
- From
Jeff King <peff@peff.net>
- Date
- Sep 9, 2019, 17:08 UTC
- Message-ID
- <20190909170823.GA30470@sigill.intra.peff.net>
- In-Reply-To
- <f32d2e8c-abec-0ec1-daa7-4c10470c5553@jeffhostetler.com>
On Mon, Sep 09, 2019 at 09:54:36AM -0400, Jeff Hostetler wrote:
Show 5 quoted lines
> It would be nice if we could continue to let parse_list_objects_filter() > do the syntax checking -- that is, we can still check that we received a > ulong in "blob:limit:<nr>" and that "sparse:oid:<oid>" looks like a hex > value, for example. Just save the actual <oid> lookup to the higher > layer, if and when that makes sense.
Yeah, I agree that is the right place to do syntactic checking. But I think we can't do much checking for the sparse-oid. We currently accept not just a hex oid, but any name. And I think that is useful; I should be able to say "master:sparse-file" and have it resolved by the remote side.
So it really is "any name which is syntactically resolvable as a sha1 expression". At which point I think you might as well punt and just wait until we _actually_ try to resolve the name to see if it's valid.
I'll work up what I sent earlier into a real patch, and include some of this discussion.
-Peff