Re: What's cooking in git.git (Aug 2019, #03; Tue, 6)

2019-08-08 Thread Matthew DeVore
On Tue, Aug 06, 2019 at 02:58:38PM -0700, Junio C Hamano wrote: > > * md/list-objects-filter-combo (2019-06-28) 10 commits > - list-objects-filter-options: make parser void > - list-objects-filter-options: clean up use of ALLOC_GROW > - list-objects-filter-options: allow mult. --filter > - str

Re: What's cooking in git.git (Jul 2019, #04; Thu, 18)

2019-07-22 Thread Matthew DeVore
On Thu, Jul 18, 2019 at 03:36:06PM -0700, Junio C Hamano wrote: > * md/list-objects-filter-combo (2019-06-28) 10 commits > ... > > There is a bit of interaction with cc/multi-promisor topic, whose > conflict resolution I have no confidence in X-<. Extra sets of > eyes are appreciated. > ... >

Re: What's cooking in git.git (Jul 2019, #03; Fri, 12)

2019-07-14 Thread Matthew DeVore
On Fri, Jul 12, 2019 at 02:02:52PM -0700, Junio C Hamano wrote: > * md/list-objects-filter-combo (2019-06-28) 10 commits > - list-objects-filter-options: make parser void > - list-objects-filter-options: clean up use of ALLOC_GROW > - list-objects-filter-options: allow mult. --filter > - strbuf

[PATCH v5 08/10] list-objects-filter-options: allow mult. --filter

2019-06-27 Thread Matthew DeVore
-filters. We can simplify the operation if the LHS is already a combine: filter. In that case, we just append the URL-encoded RHS sub-filter to the LHS spec to get the new spec. Helped-by: Emily Shaffer Helped-by: Jeff Hostetler Helped-by: Jeff King Helped-by: Junio C Hamano Signed-off-by: Matthew

[PATCH v5 04/10] list-objects-filter: implement composite filters

2019-06-27 Thread Matthew DeVore
is better to describe the URL-encoding feature in terms of the repeated flag. Helped-by: Emily Shaffer Helped-by: Jeff Hostetler Helped-by: Johannes Schindelin Helped-by: Jonathan Tan Helped-by: Junio C Hamano Signed-off-by: Matthew DeVore --- list-objects-filter-options.c

[PATCH v5 06/10] list-objects-filter-options: make filter_spec a string_list

2019-06-27 Thread Matthew DeVore
d-by: Junio C Hamano Signed-off-by: Matthew DeVore --- builtin/clone.c | 8 ++--- builtin/fetch.c | 9 ++ builtin/rev-list.c | 6 ++-- fetch-pack.c| 20 list-objects-filter-

[PATCH v5 03/10] list-objects-filter-options: always supply *errbuf

2019-06-27 Thread Matthew DeVore
Making errbuf an optional argument complicates error reporting. Fix this by making all callers supply an errbuf, even if they may ignore it. This will be important in follow-up patches where the filter-spec parsing has more pitfalls and possible errors. Signed-off-by: Matthew DeVore --- list

[PATCH v5 07/10] strbuf: give URL-encoding API a char predicate fn

2019-06-27 Thread Matthew DeVore
Allow callers to specify exactly what characters need to be URL-encoded and which do not. This new API will be taken advantage of in a patch later in this set. Helped-by: Jeff King Signed-off-by: Matthew DeVore --- credential-store.c | 9 + http.c | 6 -- strbuf.c

[PATCH v5 09/10] list-objects-filter-options: clean up use of ALLOC_GROW

2019-06-27 Thread Matthew DeVore
Introduce a new macro ALLOC_GROW_BY which automatically zeros the added array elements and takes care of updating the nr value. Use the macro in code introduced earlier in this patchset. Signed-off-by: Matthew DeVore --- cache.h | 22 ++ list-objects

[PATCH v5 01/10] list-objects-filter: encapsulate filter components

2019-06-27 Thread Matthew DeVore
turn the filter constituents in various places (filter_fn and filter_free_fn as out parameters, and filter_data as the function's return value); they can just initialize the "struct filter" passed in. Helped-by: Jeff Hostetler Helped-by: Jonathan Tan Helped-by: Junio C Hamano Signed-off

[PATCH v5 05/10] list-objects-filter-options: move error check up

2019-06-27 Thread Matthew DeVore
to the parse_list_objects_filter function. Signed-off-by: Matthew DeVore --- list-objects-filter-options.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/list-objects-filter-options.c b/list-objects-filter-options.c index 75d0236ee2..5fe2814841 100644 --- a/list-obje

[PATCH v5 02/10] list-objects-filter: put omits set in filter struct

2019-06-27 Thread Matthew DeVore
The oidset *omits pointer must be accessed by the combine filter in a type-agnostic way once the graph traversal is over. Store that pointer in the general `filter` struct. This will be used in a follow-up patch to implement the combine filter. Signed-off-by: Matthew DeVore --- list-objects

[PATCH v5 10/10] list-objects-filter-options: make parser void

2019-06-27 Thread Matthew DeVore
This function always returns 0, so make it return void instead. Signed-off-by: Matthew DeVore --- list-objects-filter-options.c | 12 +--- list-objects-filter-options.h | 2 +- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/list-objects-filter-options.c b/list-objects

[PATCH v5 00/10] Filter combination

2019-06-27 Thread Matthew DeVore
This applies suggestions made by Jonathan Tan, as well as fixes a Coccinelle-breaking error in strbuf usage, and makes an additional string localizable. Thanks, Matthew DeVore (10): list-objects-filter: encapsulate filter components list-objects-filter: put omits set in filter struct list

Re: [PATCH v4 10/10] list-objects-filter-options: make parser void

2019-06-27 Thread Matthew DeVore
On Thu, Jun 27, 2019 at 02:24:57PM -0700, Matthew DeVore wrote: > Great. I feel much better about the comments and commit messages now. I > am about to send a roll-up (v5). Here is the interdiff which catches > your comments and Dscho's comment about strbuf_addstr: > > For

Re: [PATCH v4 10/10] list-objects-filter-options: make parser void

2019-06-27 Thread Matthew DeVore
On Fri, Jun 21, 2019 at 05:46:31PM -0700, Jonathan Tan wrote: > > This function always returns 0, so make it return void instead. > > And...patches 7-10 look straightforward and good to me. > > In summary, I don't think any changes need to be made to all 10 patches > other than textual ones (comm

Re: [PATCH v4 06/10] list-objects-filter-options: make filter_spec a string_list

2019-06-27 Thread Matthew DeVore
On Fri, Jun 21, 2019 at 05:37:13PM -0700, Jonathan Tan wrote: > Patch 5 and this patch look good to me. > > > > So expand_list_objects_filter_spec() now returns a filter_options-owned > string (instead of previously writing to a strbuf), which is why we no > longer need to do any freeing or rele

Re: [PATCH v4 04/10] list-objects-filter: implement composite filters

2019-06-27 Thread Matthew DeVore
On Fri, Jun 21, 2019 at 05:26:26PM -0700, Jonathan Tan wrote: > > Allow combining filters such that only objects accepted by all filters > > are shown. The motivation for this is to allow getting directory > > listings without also fetching blobs. This can be done by combining > > blob:none with tr

Re: What's cooking in git.git (Jun 2019, #06; Wed, 26)

2019-06-27 Thread Matthew DeVore
On Wed, Jun 26, 2019 at 03:29:29PM -0700, Junio C Hamano wrote: > * md/list-objects-filter-combo (2019-06-17) 10 commits > - list-objects-filter-options: make parser void > - list-objects-filter-options: clean up use of ALLOC_GROW > - list-objects-filter-options: allow mult. --filter > - strbuf

Re: [PATCH v4 01/10] list-objects-filter: make API easier to use

2019-06-26 Thread Matthew DeVore
On Fri, Jun 21, 2019 at 03:58:38PM -0700, Jonathan Tan wrote: > So what happens is that filter_fn, filter_free_fn, and filter_data are > encapsulated into one opaque object, and users will now use filter_fn > and filter_free_fn through other functions that we expose, allowing us > to add some conve

[PATCH v3 0/1] Sort detached heads line firstly

2019-06-18 Thread Matthew DeVore
7;ve added a cautionary comment to not add the ( back to the translatable string. Thank you, Matthew DeVore (1): ref-filter: sort detached HEAD lines firstly ref-filter.c | 32 wt-status.c | 4 ++-- wt-status.h | 3 +++ 3 files changed, 21 insertions(+), 18

[PATCH v3 1/1] ref-filter: sort detached HEAD lines firstly

2019-06-18 Thread Matthew DeVore
ove the ( from the localizable portion of messages so the sorting happens properly regardless of locale. Helped-by: Johannes Schindelin Helped-by: Jonathan Nieder Signed-off-by: Matthew DeVore --- ref-filter.c | 32 wt-status.c | 4 ++-- wt-status.h | 3 ++

Re: [PATCH v4 04/10] list-objects-filter: implement composite filters

2019-06-18 Thread Matthew DeVore
On Tue, Jun 18, 2019 at 10:42:10AM +0200, Johannes Schindelin wrote: > > + if (!subspecs[0]) { > > + strbuf_addf(errbuf, > > + _("expected something after combine:")); > > Please squash this in, to pacify Coccinelle: > > -- snipsnap -- > diff --git a/list-objects

[PATCH v4 08/10] list-objects-filter-options: allow mult. --filter

2019-06-14 Thread Matthew DeVore
-filters. We can simplify the operation if the LHS is already a combine: filter. In that case, we just append the URL-encoded RHS sub-filter to the LHS spec to get the new spec. Helped-by: Emily Shaffer Helped-by: Jeff Hostetler Helped-by: Jeff King Helped-by: Junio C Hamano Signed-off-by: Matthew

[PATCH v4 06/10] list-objects-filter-options: make filter_spec a string_list

2019-06-14 Thread Matthew DeVore
d-by: Junio C Hamano Signed-off-by: Matthew DeVore --- builtin/clone.c | 8 ++--- builtin/fetch.c | 9 ++ builtin/rev-list.c | 6 ++-- fetch-pack.c| 20 list-objects-filter-

[PATCH v4 07/10] strbuf: give URL-encoding API a char predicate fn

2019-06-14 Thread Matthew DeVore
Allow callers to specify exactly what characters need to be URL-encoded and which do not. This new API will be taken advantage of in a patch later in this set. Helped-by: Jeff King Signed-off-by: Matthew DeVore --- credential-store.c | 9 + http.c | 6 -- strbuf.c

[PATCH v4 10/10] list-objects-filter-options: make parser void

2019-06-14 Thread Matthew DeVore
This function always returns 0, so make it return void instead. Signed-off-by: Matthew DeVore --- list-objects-filter-options.c | 12 +--- list-objects-filter-options.h | 2 +- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/list-objects-filter-options.c b/list-objects

[PATCH v4 00/10] Filter combination

2019-06-14 Thread Matthew DeVore
spamminess. Thanks, Matthew DeVore (10): list-objects-filter: make API easier to use list-objects-filter: put omits set in filter struct list-objects-filter-options: always supply *errbuf list-objects-filter: implement composite filters list-objects-filter-options: move error check up list

[PATCH v4 09/10] list-objects-filter-options: clean up use of ALLOC_GROW

2019-06-14 Thread Matthew DeVore
Introduce a new macro ALLOC_GROW_BY which automatically zeros the added array elements and takes care of updating the nr value. Use the macro in code introduced earlier in this patchset. Signed-off-by: Matthew DeVore --- cache.h | 22 ++ list-objects

[PATCH v4 01/10] list-objects-filter: make API easier to use

2019-06-14 Thread Matthew DeVore
Make the list-objects-filter.h API more opaque and easier to use. This prepares for combined filter support, where filters will be created and used in a new context. Helped-by: Jeff Hostetler Helped-by: Junio C Hamano Signed-off-by: Matthew DeVore --- list-objects-filter.c | 111

[PATCH v4 05/10] list-objects-filter-options: move error check up

2019-06-14 Thread Matthew DeVore
to the parse_list_objects_filter function. Signed-off-by: Matthew DeVore --- list-objects-filter-options.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/list-objects-filter-options.c b/list-objects-filter-options.c index 1c402c6059..ab2c983031 100644 --- a/list-obje

[PATCH v4 02/10] list-objects-filter: put omits set in filter struct

2019-06-14 Thread Matthew DeVore
The oidset *omits pointer must be accessed by the combine filter in a type-agnostic way once the graph traversal is over. Store that pointer in the general `filter` struct. This will be used in a follow-up patch to implement the combine filter. Signed-off-by: Matthew DeVore --- list-objects

[PATCH v4 03/10] list-objects-filter-options: always supply *errbuf

2019-06-14 Thread Matthew DeVore
Making errbuf an optional argument complicates error reporting. Fix this by making all callers supply an errbuf, even if they may ignore it. This will be important in follow-up patches where the filter-spec parsing has more pitfalls and possible errors. Signed-off-by: Matthew DeVore --- list

[PATCH v4 04/10] list-objects-filter: implement composite filters

2019-06-14 Thread Matthew DeVore
-by: Emily Shaffer Helped-by: Jeff Hostetler Helped-by: Junio C Hamano Signed-off-by: Matthew DeVore --- list-objects-filter-options.c | 106 ++- list-objects-filter-options.h | 17 ++- list-objects-filter.c | 159 t/t6112

[PATCH v3 07/10] strbuf: give URL-encoding API a char predicate fn

2019-06-13 Thread Matthew DeVore
Allow callers to specify exactly what characters need to be URL-encoded and which do not. This new API will be taken advantage of in a patch later in this set. Helped-by: Jeff King Signed-off-by: Matthew DeVore --- credential-store.c | 9 + http.c | 6 -- strbuf.c

[PATCH v3 10/10] list-objects-filter-options: make parser void

2019-06-13 Thread Matthew DeVore
This function always returns 0, so make it return void instead. Signed-off-by: Matthew DeVore --- list-objects-filter-options.c | 12 +--- list-objects-filter-options.h | 2 +- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/list-objects-filter-options.c b/list-objects

[PATCH v3 03/10] list-objects-filter-options: always supply *errbuf

2019-06-13 Thread Matthew DeVore
Making errbuf an optional argument complicates error reporting. Fix this by making all callers supply an errbuf, even if they may ignore it. This will be important in follow-up patches where the filter-spec parsing has more pitfalls and possible errors. Signed-off-by: Matthew DeVore --- list

[PATCH v3 06/10] list-objects-filter-options: make filter_spec a string_list

2019-06-13 Thread Matthew DeVore
d-by: Junio C Hamano Signed-off-by: Matthew DeVore --- builtin/clone.c | 8 ++--- builtin/fetch.c | 9 ++ builtin/rev-list.c | 6 ++-- fetch-pack.c| 20 list-objects-filter-

[PATCH v3 05/10] list-objects-filter-options: move error check up

2019-06-13 Thread Matthew DeVore
to the parse_list_objects_filter function. Signed-off-by: Matthew DeVore --- list-objects-filter-options.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/list-objects-filter-options.c b/list-objects-filter-options.c index ffbadf337b..5ff5135a91 100644 --- a/list-obje

[PATCH v3 08/10] list-objects-filter-options: allow mult. --filter

2019-06-13 Thread Matthew DeVore
-filters. We can simplify the operation if the LHS is already a combine: filter. In that case, we just append the URL-encoded RHS sub-filter to the LHS spec to get the new spec. Helped-by: Emily Shaffer Helped-by: Jeff Hostetler Helped-by: Jeff King Helped-by: Junio C Hamano Signed-off-by: Matthew

[PATCH v3 09/10] list-objects-filter-options: clean up use of ALLOC_GROW

2019-06-13 Thread Matthew DeVore
Introduce a new macro ALLOC_GROW_BY which automatically zeros the added array elements and takes care of updating the nr value. Use the macro in code introduced earlier in this patchset. Signed-off-by: Matthew DeVore --- cache.h | 22 ++ list-objects

[PATCH v3 00/10] Filter combination

2019-06-13 Thread Matthew DeVore
e. Thanks, Matthew DeVore (10): list-objects-filter: make API easier to use list-objects-filter: put omits set in filter struct list-objects-filter-options: always supply *errbuf list-objects-filter: implement composite filters list-objects-filter-options: move error check up list-obje

[PATCH v3 02/10] list-objects-filter: put omits set in filter struct

2019-06-13 Thread Matthew DeVore
The oidset *omits pointer must be accessed by the combine filter in a type-agnostic way once the graph traversal is over. Store that pointer in the general `filter` struct. This will be used in a follow-up patch to implement the combine filter. Signed-off-by: Matthew DeVore --- list-objects

[PATCH v3 01/10] list-objects-filter: make API easier to use

2019-06-13 Thread Matthew DeVore
Make the list-objects-filter.h API more opaque and easier to use. This prepares for combined filter support, where filters will be created and used in a new context. Helped-by: Jeff Hostetler Helped-by: Junio C Hamano Signed-off-by: Matthew DeVore --- list-objects-filter.c | 122

[PATCH v3 04/10] list-objects-filter: implement composite filters

2019-06-13 Thread Matthew DeVore
-by: Emily Shaffer Helped-by: Jeff Hostetler Helped-by: Junio C Hamano Signed-off-by: Matthew DeVore --- list-objects-filter-options.c | 106 ++- list-objects-filter-options.h | 17 ++- list-objects-filter.c | 159 t/t6112

Re: [PATCH v2 1/1] ref-filter: sort detached HEAD lines firstly

2019-06-13 Thread Matthew DeVore
On Wed, Jun 12, 2019 at 02:09:53PM -0700, Junio C Hamano wrote: > Junio C Hamano writes: > > >> + /* > >> + * When sorting by name, we should put "detached" head lines, > >> + * which are all the lines in parenthesis, before all others. > >> + * This usually

Re: [PATCH v2 1/1] ref-filter: sort detached HEAD lines firstly

2019-06-13 Thread Matthew DeVore
On Wed, Jun 12, 2019 at 02:09:53PM -0700, Junio C Hamano wrote: > Junio C Hamano writes: > Stepping back a bit, why are we even allowing the surrounding () > pair to be futzed by the translators? > > IOW, shouldn't our code more like this from the beginning, with or > without Chinese translation?

Re: [PATCH v2 6/9] list-objects-filter-options: make filter_spec a strbuf

2019-06-12 Thread Matthew DeVore
On Tue, Jun 11, 2019 at 05:37:16PM -0700, Matthew DeVore wrote: > On Tue, Jun 11, 2019 at 02:48:51PM -0700, Junio C Hamano wrote: > > Matthew DeVore writes: > > > > >> It is brittle because callers are bound to forget doing "if > > >> (!x->buf.buf)

Re: [PATCH v2 6/9] list-objects-filter-options: make filter_spec a strbuf

2019-06-11 Thread Matthew DeVore
On Tue, Jun 11, 2019 at 02:48:51PM -0700, Junio C Hamano wrote: > Matthew DeVore writes: > > >> It is brittle because callers are bound to forget doing "if > >> (!x->buf.buf) lazy_init(&x->buf)" at some point, and blindly use an > >>

Re: [PATCH v2 6/9] list-objects-filter-options: make filter_spec a strbuf

2019-06-11 Thread Matthew DeVore
On Tue, Jun 11, 2019 at 11:44:27AM -0700, Matthew DeVore wrote: > A corallary proposition would be to make this particular strbuf a "struct > strbuf *" rather than an inline strbuf. It should then be rather clear to > users > that it may be null. Then whoever allocates the

Re: [PATCH v2 6/9] list-objects-filter-options: make filter_spec a strbuf

2019-06-11 Thread Matthew DeVore
On Tue, Jun 11, 2019 at 10:33:18AM -0700, Junio C Hamano wrote: > Matthew DeVore writes: > > >> convention, and it may even be a useful one (i.e. it allows you to > >> calloc() a structure with an embedded strbuf in it and the "if > >> .buf==NULL, ca

[PATCH v2 1/1] ref-filter: sort detached HEAD lines firstly

2019-06-11 Thread Matthew DeVore
leties. Helped-by: Johannes Schindelin Helped-by: Jonathan Nieder Signed-off-by: Matthew DeVore --- ref-filter.c | 20 t/lib-gettext.sh | 22 +++--- t/t3207-branch-intl.sh | 41 + 3 files changed, 76 inserti

[PATCH v2 0/1] Sort detached HEAD lines firstly

2019-06-11 Thread Matthew DeVore
ocale detection Thanks, Matthew DeVore (1): ref-filter: sort detached HEAD lines firstly ref-filter.c | 20 t/lib-gettext.sh | 22 +++--- t/t3207-branch-intl.sh | 41 + 3 files changed, 76 insertions(+), 7 dele

Re: [RFC PATCH] ref-filter: sort detached HEAD lines firstly

2019-06-11 Thread Matthew DeVore
On Mon, Jun 10, 2019 at 05:41:06PM -0700, Jonathan Nieder wrote: > Git seems to be inconsistent about this. Documentation/CodingGuidelines > says > > - When there are multiple arms to a conditional and some of them > require braces, enclose even a single line block in braces for

Re: [PATCH v2 6/9] list-objects-filter-options: make filter_spec a strbuf

2019-06-10 Thread Matthew DeVore
On Mon, Jun 10, 2019 at 01:13:54PM -0700, Junio C Hamano wrote: > Matthew DeVore writes: > > > - filter_options->filter_spec = strdup(core_partial_clone_filter_default); > > + if (!filter_options->filter_spec.buf) > > + strbuf_init(&filter_option

Re: [RFC PATCH] ref-filter: sort detached HEAD lines firstly

2019-06-10 Thread Matthew DeVore
On Sun, Jun 09, 2019 at 10:17:19AM +0200, Johannes Schindelin wrote: > > if (get_ref_atom_value(a, s->atom, &va, &err)) > > die("%s", err.buf); > > if (get_ref_atom_value(b, s->atom, &vb, &err)) > > die("%s", err.buf); > > strbuf_release(&err); > > cmp_fn = s

Re: [PATCH v1 0/5] Filter combination

2019-06-06 Thread Matthew DeVore
If you are looking for the latest version of this patchset, it is here: https://public-inbox.org/git/20190601003603.90794-1-matv...@google.com/ But also has these interdiffs: https://public-inbox.org/git/20190604234951.gb43...@comcast.net/#t https://public-inbox.org/git/2019060347.gg4...@com

Re: [PATCH v2 4/9] list-objects-filter: implement composite filters

2019-06-06 Thread Matthew DeVore
On Mon, Jun 03, 2019 at 05:51:28PM -0400, Jeff Hostetler wrote: > Since we are assuming 'compose' is an AND operation, there may be an > opportunity to short-cut some of this loop for blobs. That is, if the > object is a blob and any filter rejects it, it is omitted, so we don't > need to keep loo

[RFC PATCH] ref-filter: sort detached HEAD lines firstly

2019-06-06 Thread Matthew DeVore
a full-width "(" symbol (codepoint FF08). This meant that the detached HEAD line would appear after all local refs and even after the remote refs if there were any. Deliberately sort the detached HEAD refs before other refs when sorting by refname rather than rely on codepoint subtleties.

Re: [PATCH v1 3/5] list-objects-filter: implement composite filters

2019-06-04 Thread Matthew DeVore
On Tue, Jun 04, 2019 at 07:14:18PM -0400, Jeff King wrote: > Right, that has to be a real colon because it's syntactically > significant (but a colon in the username _must_ be encoded). That strbuf > function doesn't really understand whole URLs, and it's up to the caller > to assemble the parts. >

Re: [PATCH v1 3/5] list-objects-filter: implement composite filters

2019-06-04 Thread Matthew DeVore
On Tue, Jun 04, 2019 at 02:51:08PM -0400, Jeff King wrote: > > The purpose of has_reserved_character is to allow for future > > extensibility if someone decides to implement a more sophisticated DSL > > and give meaning to these characters. That may be a long-shot, but it > > seems worth it. > > I

Re: [PATCH v2 0/2] Harden url.c URL-decoding logic

2019-06-04 Thread Matthew DeVore
First message had incorrect recipient list. Re-sending with non-typo'd Jeff's e-mail address. Someone also politely reminded me off-band that I should make subsequent versions of patchsets be respond-to on the cover-letter of v1 of that patchset. I will do that from next time.

[PATCH v2 0/2] Harden url.c URL-decoding logic

2019-06-04 Thread Matthew DeVore
This roll-up includes simple but important fixes from Brian Carlson and René Scharfe. - fix typo of "NUL" in commit heading - re-enable %-decoding in non-NULL-terminated strings Matthew DeVore (2): url: do not read past end of buffer url: do not allow %00 to represent NUL in UR

[PATCH v2 2/2] url: do not allow %00 to represent NUL in URLs

2019-06-04 Thread Matthew DeVore
security vulnerability to introduce a payload. Helped-by: brian m. carlson Signed-off-by: Matthew DeVore --- url.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/url.c b/url.c index 9ea9d5611b..1b8ef78cea 100644 --- a/url.c +++ b/url.c @@ -41,21 +41,21 @@ static char

[PATCH v2 1/2] url: do not read past end of buffer

2019-06-04 Thread Matthew DeVore
: René Scharfe Signed-off-by: Matthew DeVore --- url.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/url.c b/url.c index 25576c390b..9ea9d5611b 100644 --- a/url.c +++ b/url.c @@ -39,21 +39,21 @@ static char *url_decode_internal(const char **query, int len

Re: [PATCH 2/2] url: do not allow %00 to represent NULL in URLs

2019-06-04 Thread Matthew DeVore
On Tue, Jun 04, 2019 at 01:02:43AM +, brian m. carlson wrote: > It looks like several of the places we do this are in the credential > manager code, and I think I can agree that usernames and passwords > should not contain NUL characters (for Basic auth, RFC 7617 prohibits > it). It also seems

Re: [PATCH 2/2] url: do not allow %00 to represent NULL in URLs

2019-06-04 Thread Matthew DeVore
On Tue, Jun 04, 2019 at 07:01:01AM +0200, René Scharfe wrote: > It's a bit hard to see with the (extended, but still) limited context, > but url_decode_internal() effectively returns a NUL-terminated string, > even though it does use a strbuf parameter named "out" for temporary > storage. So calle

Re: [PATCH 1/2] url: do not read past end of buffer

2019-06-04 Thread Matthew DeVore
On Tue, Jun 04, 2019 at 07:00:34AM +0200, René Scharfe wrote: > Am 03.06.19 um 22:45 schrieb Matthew DeVore: > > url_decode_internal could have been tricked into reading past the length > > of the **query buffer if there are fewer than 2 characters after a % (in > > a n

Re: [PATCH v1 3/5] list-objects-filter: implement composite filters

2019-06-04 Thread Matthew DeVore
On Tue, Jun 04, 2019 at 12:13:32PM -0400, Jeff King wrote: > > - return has_reserved_character(subspec, errbuf) || > > - url_decode(subspec, errbuf) || > > - gently_parse_list_objects_filter( > > - &filter_options->sub[new_index], subspec->buf, errbuf); > > +

Re: [PATCH v2 8/9] list-objects-filter-options: clean up use of ALLOC_GROW

2019-06-03 Thread Matthew DeVore
On Mon, Jun 03, 2019 at 03:07:40PM -0700, Jacob Keller wrote: > > +/* > > + * Similar to ALLOC_GROW but handles updating of the nr value and > > + * zeroing the bytes of the newly-grown array elements. > > + * > > + * DO NOT USE any expression with side-effect for any of the > > + * arguments. > >

[PATCH 1/2] url: do not read past end of buffer

2019-06-03 Thread Matthew DeVore
-off-by: Matthew DeVore --- url.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/url.c b/url.c index 25576c390b..c0bb4e23c3 100644 --- a/url.c +++ b/url.c @@ -39,21 +39,21 @@ static char *url_decode_internal(const char **query, int len, unsigned char c = *q

Re: [PATCH v1 3/5] list-objects-filter: implement composite filters

2019-06-03 Thread Matthew DeVore
On Mon, Jun 03, 2019 at 08:34:35AM -0400, Jeff King wrote: > Great. We might want to stop there, but it's possible could reuse even > more code. I didn't look closely before, but it seems this code is > decoding a URL. We already have a url_decode() routine in url.c. Could > it be reused? Very nic

[PATCH 0/2] Harden url.c URL-decoding logic

2019-06-03 Thread Matthew DeVore
Fixing two minor issues related to string-handling corner cases in url.c Thanks, Matthew DeVore (2): url: do not read past end of buffer url: do not allow %00 to represent NULL in URLs url.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.17.1

[PATCH 2/2] url: do not allow %00 to represent NULL in URLs

2019-06-03 Thread Matthew DeVore
security vulnerability to introduce a payload. Signed-off-by: Matthew DeVore --- url.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/url.c b/url.c index c0bb4e23c3..cf791cb139 100644 --- a/url.c +++ b/url.c @@ -41,21 +41,21 @@ static char *url_decode_internal(const char **query

[PATCH v2 8/9] list-objects-filter-options: clean up use of ALLOC_GROW

2019-05-31 Thread Matthew DeVore
Introduce a new macro ALLOC_GROW_BY which automatically zeros the added array elements and takes care of updating the nr value. Use the macro in code introduced earlier in this patchset. Signed-off-by: Matthew DeVore --- cache.h | 22 ++ list-objects

[PATCH v2 7/9] list-objects-filter-options: allow mult. --filter

2019-05-31 Thread Matthew DeVore
-filters. We can simplify the operation if the LHS is already a combine: filter. In that case, we just append the URL-encoded RHS sub-filter to the LHS spec to get the new spec. Helped-by: Emily Shaffer Helped-by: Jeff Hostetler Helped-by: Junio C Hamano Signed-off-by: Matthew DeVore

[PATCH v2 1/9] list-objects-filter: make API easier to use

2019-05-31 Thread Matthew DeVore
Make the list-objects-filter.h API more opaque and easier to use. This prepares for combined filter support, where filters will be created and used in a new context. Helped-by: Jeff Hostetler Helped-by: Junio C Hamano Signed-off-by: Matthew DeVore --- list-objects-filter.c | 122

[PATCH v2 2/9] list-objects-filter: put omits set in filter struct

2019-05-31 Thread Matthew DeVore
The oidset *omits pointer must be accessed by the combine filter in a type-agnostic way once the graph traversal is over. Store that pointer in the general `filter` struct. This will be used in a follow-up patch to implement the combine filter. Signed-off-by: Matthew DeVore --- list-objects

[PATCH v2 4/9] list-objects-filter: implement composite filters

2019-05-31 Thread Matthew DeVore
-by: Emily Shaffer Helped-by: Jeff Hostetler Helped-by: Junio C Hamano Signed-off-by: Matthew DeVore --- list-objects-filter-options.c | 135 ++- list-objects-filter-options.h | 17 ++- list-objects-filter.c | 159 +++ t

[PATCH v2 3/9] list-objects-filter-options: always supply *errbuf

2019-05-31 Thread Matthew DeVore
Making errbuf an optional argument complicates error reporting. Fix this by making all callers supply an errbuf, even if they may ignore it. This will be important in follow-up patches where the filter-spec parsing has more pitfalls and possible errors. Signed-off-by: Matthew DeVore --- list

[PATCH v2 6/9] list-objects-filter-options: make filter_spec a strbuf

2019-05-31 Thread Matthew DeVore
Make the filter_spec string a strbuf rather than a raw C string. A future patch will need to grow this string dynamically. Signed-off-by: Matthew DeVore --- builtin/rev-list.c| 2 +- list-objects-filter-options.c | 16 ++-- list-objects-filter-options.h | 2 +- upload

[PATCH v2 0/9] Filter combination

2019-05-31 Thread Matthew DeVore
cases to use sparse:oid= rather than sparse:path= since the latter is being disabled. Thank you, Matthew DeVore (9): list-objects-filter: make API easier to use list-objects-filter: put omits set in filter struct list-objects-filter-options: always supply *errbuf list-objects-filter

[PATCH v2 9/9] list-objects-filter-options: make parser void

2019-05-31 Thread Matthew DeVore
This function always returns 0, so make it return void instead. Signed-off-by: Matthew DeVore --- list-objects-filter-options.c | 12 +--- list-objects-filter-options.h | 2 +- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/list-objects-filter-options.c b/list-objects

[PATCH v2 5/9] list-objects-filter-options: move error check up

2019-05-31 Thread Matthew DeVore
to the parse_list_objects_filter function. Signed-off-by: Matthew DeVore --- list-objects-filter-options.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/list-objects-filter-options.c b/list-objects-filter-options.c index 0f1d4181cb..e8132b811e 100644 --- a/list-obje

Re: [PATCH v1 3/5] list-objects-filter: implement composite filters

2019-05-31 Thread Matthew DeVore
On Fri, May 31, 2019 at 05:10:42PM -0400, Jeff King wrote: > On Fri, May 31, 2019 at 01:48:21PM -0700, Matthew DeVore wrote: > > > > > +static int digit_value(int c, struct strbuf *errbuf) { > > > > + if (c >= '0' && c <= '9'

Re: [PATCH v1 3/5] list-objects-filter: implement composite filters

2019-05-31 Thread Matthew DeVore
On Fri, May 24, 2019 at 05:01:15PM -0400, Jeff Hostetler wrote: > We are allowing an unlimited number of filters in the composition. > In the code, the compose filter data has space for a LHS and RHS, so > I'm assuming we're mapping > > --filter=f1 --filter=f2 --filter=f3 --filter=f4 > or --f

Re: [PATCH v1 3/5] list-objects-filter: implement composite filters

2019-05-31 Thread Matthew DeVore
On Thu, May 30, 2019 at 10:01:47AM -0400, Jeff Hostetler wrote: > BTW, I don't think I've seen this mentioned anywhere and I don't > remember if this got into the code or not. But we discussed having > a repo-local config setting to remember the filter-spec used by the > partial clone that would b

Re: [PATCH v1 3/5] list-objects-filter: implement composite filters

2019-05-31 Thread Matthew DeVore
On Tue, May 28, 2019 at 02:53:59PM -0700, Emily Shaffer wrote: > > + } else if (skip_prefix(arg, "combine:", &v0)) { > > + int sub_parse_res = parse_combine_filter( > > + filter_options, v0, errbuf); > > + if (sub_parse_res) > > + return sub

[PATCH] list-objects-filter: correct usage of ALLOC_GROW

2019-05-31 Thread Matthew DeVore
. Address that TODO and fix the memory leak. Signed-off-by: Matthew DeVore --- list-objects-filter.c | 21 - 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/list-objects-filter.c b/list-objects-filter.c index ee449de3f7..19158cc712 100644 --- a/list-objects

[PATCH 0/1] Trivial fix: make a user-facing error localizable

2019-05-31 Thread Matthew DeVore
This is a patch that I'm separating from a longer patchset previously sent. Thanks, Matthew DeVore (1): list-objects-filter-options: error is localizeable list-objects-filter-options.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.17.1

[PATCH 1/1] list-objects-filter-options: error is localizeable

2019-05-31 Thread Matthew DeVore
The "invalid filter-spec" message is user-facing and not a BUG, so make it localizeable. For reference, the message appears in this context: $ git rev-list --filter=blob:nonse --objects HEAD fatal: invalid filter-spec 'blob:nonse' Signed-off-by: Matthew DeVor

Re: [PATCH] list-objects-filter: merge filter data structs

2019-05-30 Thread Matthew DeVore
On Wed, May 29, 2019 at 04:57:23PM -0400, Jeff Hostetler wrote: > I'd also suggest keeping the "oidset omits" inside each of the > sub-structures, but that's just me. I just reminded myself that the omits need to be outside of the specialized sub-structures because the combine filter logic needs t

Re: [RFC PATCH v2] list-objects-filter: merge filter data structs

2019-05-30 Thread Matthew DeVore
On Thu, May 30, 2019 at 09:12:06AM -0700, Junio C Hamano wrote: > > + union { > > + struct { > > Name this, and the ohter two union members, and the union itself as > one member inside the outer struct; some compilers would be unhappy > with the GCC extension that allows you to refer t

[RFC PATCH v2] list-objects-filter: merge filter data structs

2019-05-29 Thread Matthew DeVore
ssing void * anymore. The "free" operation is handled by the trampoline function for all filter types, so simple filters that don't do heap allocation can avoid implementing a __clear function. Helped-by: Emily Shaffer Helped-by: Jeff Hostetler Helped-by: Junio C Hamano Signe

Re: [PATCH v1 3/5] list-objects-filter: implement composite filters

2019-05-29 Thread Matthew DeVore
On Wed, May 29, 2019 at 05:29:14PM -0400, Jeff Hostetler wrote: > Was sparse:path filter the only reason for needing all the URL encoding? > The sparse:oid form allows values : and these (or at least > the portion) may contain special characters. So don't we need to > URL encode this form too? O

Re: [PATCH] list-objects-filter: merge filter data structs

2019-05-29 Thread Matthew DeVore
> > I am hoping that I am not misreading the intention but you do not > > plan to use the above so that you can say "apply 'tree:depth=4' and > > 'blobs:limit=1G' at the same time" by filling the fields in a single > > struct, do you? For combined filter, you'll still have multiple > > instances o

Re: [PATCH v1 3/5] list-objects-filter: implement composite filters

2019-05-29 Thread Matthew DeVore
On Tue, May 28, 2019 at 10:59:31AM -0700, Junio C Hamano wrote: > Jeff Hostetler writes: > > > In the RFC version, there was discussion [2] of the wire format > > and the need to be backwards compatible with existing servers and > > so use the "combine:" syntax so that we only have a single filte

Re: [PATCH v1 2/5] list-objects-filter-options: error is localizeable

2019-05-28 Thread Matthew DeVore
On Thu, May 23, 2019 at 05:55:12PM -0700, Emily Shaffer wrote: > What does it look like? Is it human-readable in its current form? I ask > because (without having looked ahead) I think you're going to move it You can make the error appear in this way: $ git rev-list --filter=blob:nonse --objects

[PATCH] list-objects-filter: merge filter data structs

2019-05-28 Thread Matthew DeVore
instance, and in exchange, invoking filters is not only easier but the list-objects-filter public API is simpler and more opaque. Helped-by: Emily Shaffer Signed-off-by: Matthew DeVore --- list-objects-filter-options.h | 19 +++ list-objects-filter.c | 227

Re: [PATCH v1 1/5] list-objects-filter: refactor into a context struct

2019-05-28 Thread Matthew DeVore
On Thu, May 23, 2019 at 05:49:38PM -0700, Emily Shaffer wrote: > This commit message might read more easily on its own if you define > "this bundle of data" at least once. Since there are things being moved > from both list-objects-filter.c (filter_blobs_none_data) and > list-objects-filter.h (list

  1   2   3   4   >