Re: [PATCH v4 13/35] ls-refs: introduce ls-refs server command
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Mar 5, 2018, 18:29 UTC
- Message-ID
- <20180305182914.GD28067@aiede.svl.corp.google.com>
- In-Reply-To
- <20180305182155.GB72475@google.com>
Hi,
On Mon, Mar 05, 2018 at 10:21:55AM -0800, Brandon Williams wrote:
> On 03/02, Jeff King wrote:
Show 7 quoted lines
>> It also accepts "refs/h*" to get "refs/heads" and "refs/hello". I think >> it's worth going for the most-restrictive thing to start with, since >> that enables a lot more server operations without worrying about >> breaking compatibility. > > And just to clarify what do you see as being the most-restrictive case > of patterns that would should use?
Peff, can you say a little more about the downsides of accepting refs/h*?
IIRC the "git push" command already accepts such refspecs, so there's a benefit to accepting them. Reftable and packed-refs support such queries about as efficiently as refs/heads/*. For loose refs, readdir doesn't provide a way to restrict which files you look at, but loose refs are always slow anyway. :)
In other words, I see real benefits and I don't see much in the way of costs, so I'm not seeing why not to support this.
Thanks, Jonathan