Re: [PATCH v4 13/35] ls-refs: introduce ls-refs server command

2018-03-13 Thread Brandon Williams
On 03/02, Junio C Hamano wrote: > Brandon Williams writes: > > > + ls-refs > > +- > > + > > +`ls-refs` is the command used to request a reference advertisement in v2. > > +Unlike the current reference advertisement, ls-refs takes in arguments > > +which can be used to

Re: [PATCH v4 13/35] ls-refs: introduce ls-refs server command

2018-03-13 Thread Brandon Williams
On 03/05, Jeff King wrote: > On Mon, Mar 05, 2018 at 10:21:55AM -0800, Brandon Williams wrote: > > > > Hmm, so this would accept stuff like "refs/heads/*/foo" but quietly > > > ignore the "/foo" part. > > > > Yeah that's true...this should probably not do that. Since > > "refs/heads/*/foo"

Re: [PATCH v4 13/35] ls-refs: introduce ls-refs server command

2018-03-05 Thread Jeff King
On Mon, Mar 05, 2018 at 10:29:14AM -0800, Jonathan Nieder wrote: > >> 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 > >>

Re: [PATCH v4 13/35] ls-refs: introduce ls-refs server command

2018-03-05 Thread Jeff King
On Mon, Mar 05, 2018 at 10:21:55AM -0800, Brandon Williams wrote: > > Hmm, so this would accept stuff like "refs/heads/*/foo" but quietly > > ignore the "/foo" part. > > Yeah that's true...this should probably not do that. Since > "refs/heads/*/foo" violates what the spec is, really this should

Re: [PATCH v4 13/35] ls-refs: introduce ls-refs server command

2018-03-05 Thread Jonathan Nieder
Hi, On Mon, Mar 05, 2018 at 10:21:55AM -0800, Brandon Williams wrote: > On 03/02, Jeff King wrote: >> 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

Re: [PATCH v4 13/35] ls-refs: introduce ls-refs server command

2018-03-05 Thread Brandon Williams
On 03/02, Jeff King wrote: > On Wed, Feb 28, 2018 at 03:22:30PM -0800, Brandon Williams wrote: > > > +static void add_pattern(struct pattern_list *patterns, const char *pattern) > > +{ > > + struct ref_pattern p; > > + const char *wildcard; > > + > > + p.pattern = strdup(pattern); > >

Re: [PATCH v4 13/35] ls-refs: introduce ls-refs server command

2018-03-02 Thread Jeff King
On Wed, Feb 28, 2018 at 03:22:30PM -0800, Brandon Williams wrote: > +static void add_pattern(struct pattern_list *patterns, const char *pattern) > +{ > + struct ref_pattern p; > + const char *wildcard; > + > + p.pattern = strdup(pattern); xstrdup? > + wildcard = strchr(pattern,

Re: [PATCH v4 13/35] ls-refs: introduce ls-refs server command

2018-03-02 Thread Junio C Hamano
Brandon Williams writes: > + ls-refs > +- > + > +`ls-refs` is the command used to request a reference advertisement in v2. > +Unlike the current reference advertisement, ls-refs takes in arguments > +which can be used to limit the refs sent from the server. OK. >

[PATCH v4 13/35] ls-refs: introduce ls-refs server command

2018-02-28 Thread Brandon Williams
Introduce the ls-refs server command. In protocol v2, the ls-refs command is used to request the ref advertisement from the server. Since it is a command which can be requested (as opposed to mandatory in v1), a client can sent a number of parameters in its request to limit the ref advertisement