git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2 1/1] filter-options: Expand abbreviated numbers

From
SZEDER Gábor <szeder.dev@gmail.com>
Date
Jan 9, 2019, 19:20 UTC
Message-ID
<20190109192001.GK4673@szeder.dev>
In-Reply-To
<20190109185543.GD54613@google.com>
On Wed, Jan 09, 2019 at 10:55:43AM -0800, Josh Steadmon wrote:
Show 45 quoted lines
> On 2019.01.09 13:23, SZEDER Gábor wrote:
> > On Mon, Jan 07, 2019 at 04:17:09PM -0800, Josh Steadmon wrote:
> > > diff --git a/list-objects-filter-options.c b/list-objects-filter-options.c
> > > index 5285e7674d..9efb3e9902 100644
> > > --- a/list-objects-filter-options.c
> > > +++ b/list-objects-filter-options.c
> > 
> > > @@ -111,6 +112,21 @@ int opt_parse_list_objects_filter(const struct option *opt,
> > >  	return parse_list_objects_filter(filter_options, arg);
> > >  }
> > >  
> > > +void expand_list_objects_filter_spec(
> > > +	const struct list_objects_filter_options *filter,
> > > +	struct strbuf *expanded_spec)
> > > +{
> > > +	strbuf_init(expanded_spec, strlen(filter->filter_spec));
> > > +	if (filter->choice == LOFC_BLOB_LIMIT)
> > > +		strbuf_addf(expanded_spec, "blob:limit=%lu",
> > > +			    filter->blob_limit_value);
> > > +	else if (filter->choice == LOFC_TREE_DEPTH)
> > > +		strbuf_addf(expanded_spec, "tree:%lu",
> > > +			    filter->tree_exclude_depth);
> > > +	else
> > > +		strbuf_addstr(expanded_spec, filter->filter_spec);
> > > +}
> > > +
> > 
> > All compilers error out with something like this:
> > 
> >   list-objects-filter-options.c: In function
> >   ‘expand_list_objects_filter_spec’:
> >   list-objects-filter-options.c:124:29: error: ‘LOFC_TREE_DEPTH’ undeclared (first use in this function); did you mean ‘LOFC_TREE_NONE’?
> >     else if (filter->choice == LOFC_TREE_DEPTH)
> >                                ^~~~~~~~~~~~~~~
> >                                LOFC_TREE_NONE
> >   list-objects-filter-options.c:124:29: note: each undeclared identifier is reported only once for each function it appears in
> >   list-objects-filter-options.c:126:14: error: ‘const struct list_objects_filter_options’ has no member named ‘tree_exclude_depth’
> >           filter->tree_exclude_depth);
> >                 ^~
> >   make: *** [list-objects-filter-options.o] Error 1
> > 
> 
> Hmm, looks like you may not have applied this on top of
> md/list-objects-filter-by-depth? However, the most recent version of
> that branch has its own compilation errors at the moment.

Ah, OK. I didn't actually apply this patch anywhere, I just tried to test this topic as it is in 'pu', where it branches off from current 'master'.

Previous: Josh Steadmon
Message 11 of 11 in “Expand abbreviated filters”
  1. 0/1 Expand abbreviated filtersJosh Steadmon, Dec 19, 2018
  2. 1/1 filter-options: Expand abbreviated numbersJosh Steadmon, Dec 19, 2018
  3. Junio C HamanoJan 2, 2019
  4. Josh SteadmonJan 7, 2019
  5. Junio C HamanoJan 7, 2019
  6. Junio C HamanoJan 7, 2019
  7. 0/1 Expand abbreviated filtersJosh Steadmon, Jan 8, 2019
  8. 1/1 filter-options: Expand abbreviated numbersJosh Steadmon, Jan 8, 2019
  9. SZEDER GáborJan 9, 2019
  10. Josh SteadmonJan 9, 2019
  11. SZEDER GáborJan 9, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.