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

Re: Re: [PATCH v2 3/4] use new config API for worktree configurations of submodules

From
Heiko Voigt <hvoigt@hvoigt.net>
Date
Jul 9, 2014, 19:55 UTC
Message-ID
<20140709195547.GA3081@sandbox-ub>
In-Reply-To
<xmqqy4w38v6r.fsf@gitster.dls.corp.google.com>
On Tue, Jul 08, 2014 at 01:14:20PM -0700, Junio C Hamano wrote:
Show 18 quoted lines
> Heiko Voigt <hvoigt@hvoigt.net> writes:
> 
> > diff --git a/builtin/checkout.c b/builtin/checkout.c
> > index 07cf555..03ea20d 100644
> > --- a/builtin/checkout.c
> > +++ b/builtin/checkout.c
> > @@ -18,6 +18,7 @@
> >  #include "xdiff-interface.h"
> >  #include "ll-merge.h"
> >  #include "resolve-undo.h"
> > +#include "submodule-config.h"
> >  #include "submodule.h"
> >  #include "argv-array.h"
> >  
> 
> Hmph.  What is this change about?  
> 
> Nobody in checkout.c needs anything new, yet we add a new include?

This is because I moved the parse_submodule_config_option() function into the submodule-config.c module. This was necessary so all parsed submodule values are stored in the cache with the null_sha1. We use static functions from this module to do this and thats thats the reason for the move.

Show 14 quoted lines
> > diff --git a/diff.c b/diff.c
> > index f72769a..f692a3c 100644
> > --- a/diff.c
> > +++ b/diff.c
> > @@ -13,6 +13,7 @@
> >  #include "utf8.h"
> >  #include "userdiff.h"
> >  #include "sigchain.h"
> > +#include "submodule-config.h"
> >  #include "submodule.h"
> >  #include "ll-merge.h"
> >  #include "string-list.h"
> 
> Likewise.
Same as above.
> > It is somewhat unclear to me what real change that improves the life
> of end-users this series brings to us.   The "test-submodule-config"
> test program obviously is new but that does not really count until
> we see real uses.

Do you mean the API improvements? I split this series off from my recursive fetch series since this infrastructure is also needed by Jens recursive checkout series.

I am currently working on finishing the recursive fetch series here[1]. So until now we do not have any improvements for the end-user but only in the API for the developer. With my series it is possible to easily lookup what configuration for which submodule is in which revision. That makes is possible to also implement the recursive fetch logic for renamed submodules[2]. We are also able to decide whether (and from where) a new submodules repository can possibly be cloned during recursive fetch.

A clone on recursive fetch for new submodule makes sure we have everything available, so a recursive checkout later can work without the need for an extra fetch.

Does that make the improvements in my series clear for you? I would wait until my recursive fetch series is ready so we have real uses. Since there are others (namely Jens or submodule support for 'git archive') that need it I think it makes sense to review and merge this separately into master so they have a stable API to code against.

Cheers Heiko

[1] https://github.com/hvoigt/git/commits/hv/fetch-submodules-recursive [2] https://github.com/hvoigt/git/commit/975c370856c3b8f96ab0c5a3ed754e3839f4de45

Previous: Junio C HamanoNext: Junio C Hamano
Message 6 of 12 in “submodule config lookup API”
  1. 0/4 submodule config lookup APIHeiko Voigt, Jun 28, 2014
  2. 1/4 implement submodule config cache for lookup of submodule namesHeiko Voigt, Jun 28, 2014
  3. 2/4 extract functions for submodule config set and lookupHeiko Voigt, Jun 28, 2014
  4. 3/4 use new config API for worktree configurations of submodulesHeiko Voigt, Jun 28, 2014
  5. Junio C HamanoJul 8, 2014
  6. Heiko VoigtJul 9, 2014
  7. Junio C HamanoJul 9, 2014
  8. Heiko VoigtJul 14, 2014
  9. Junio C HamanoJul 15, 2014
  10. Heiko VoigtJul 17, 2014
  11. Junio C HamanoJul 17, 2014
  12. 4/4 do not die on error of parsing fetchrecursesubmodules optionHeiko Voigt, Jun 28, 2014

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.