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

Re: Re: [PATCH v3 0/4] submodule config lookup API

From
Heiko Voigt <hvoigt@hvoigt.net>
Date
May 26, 2015, 15:46 UTC
Message-ID
<20150526154610.GB31115@book.hvoigt.net>
In-Reply-To
<xmqqy4khixjn.fsf@gitster.dls.corp.google.com>
On Thu, May 21, 2015 at 11:40:44AM -0700, Junio C Hamano wrote:
Show 34 quoted lines
> Heiko Voigt <hvoigt@hvoigt.net> writes:
> 
> > This is finally the next iteration of the submodule config api. The last
> > iteration can be found here:
> >
> > http://article.gmane.org/gmane.comp.version-control.git/252601
> >
> > This iteration fixes the lookup of submodules by name
> > (submodule_from_name()) where one needed to pass in the gitmodule sha1
> > by mistake. To keep it simple for the user and behave as documented we
> > should take the commit sha1 which is now fixed here. We now also test
> > the lookup by name in the api tests.
> >
> > This should be ready for inclusion.
> >
> > Cheers Heiko
> >
> > Here is the interdiff to the last iteration:
> >
> > diff --git a/submodule-config.c b/submodule-config.c
> > index 96623ad..177767d 100644
> > --- a/submodule-config.c
> > +++ b/submodule-config.c
> > @@ -25,6 +25,11 @@ struct submodule_entry {
> >  	struct submodule *config;
> >  };
> >  
> > +enum lookup_type {
> > +	lookup_name,
> > +	lookup_path,
> > +};
> 
> Please lose the comma after the last element in enum.  Some
> compilers do not like it, I was told.
Fixed.
Show 9 quoted lines
> > +	switch (lookup_type) {
> > +		case lookup_name:
> > +			submodule = cache_lookup_name(cache, sha1, key);
> > +			break;
> > +		case lookup_path:
> > +			submodule = cache_lookup_path(cache, sha1, key);
> > +			break;
> 
> Is this too deeply indented?
It seems I accidentially used vim's default indenting. Fixed.

Will wait a little longer if there are more comments than the style fixes before sending another iteration.

Cheers Heiko
Previous: Junio C HamanoNext: René Scharfe
Message 7 of 9 in “submodule config lookup API”
  1. 0/4 submodule config lookup APIHeiko Voigt, May 21, 2015
  2. 1/4 implement submodule config cache for lookup of submodule namesHeiko Voigt, May 21, 2015
  3. 2/4 extract functions for submodule config set and lookupHeiko Voigt, May 21, 2015
  4. 3/4 use new config API for worktree configurations of submodulesHeiko Voigt, May 21, 2015
  5. 4/4 do not die on error of parsing fetchrecursesubmodules optionHeiko Voigt, May 21, 2015
  6. Junio C HamanoMay 21, 2015
  7. Heiko VoigtMay 26, 2015
  8. René ScharfeMay 21, 2015
  9. Heiko VoigtMay 26, 2015

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.