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

Re: [RFC] Third round of support for cloning submodules

From
SVSven Verdoolaege <skimo@kotnet.org>
Date
May 20, 2007, 19:59 UTC
Message-ID
<20070520195930.GX942MdfPADPa@greensroom.kotnet.org>
In-Reply-To
<7vhcq7l3ar.fsf@assigned-by-dhcp.cox.net>
On Sun, May 20, 2007 at 12:10:04PM -0700, Junio C Hamano wrote:
Show 7 quoted lines
> > bash-3.00$ ./git-config --remote=http://www.liacs.nl/~sverdool/isa.git --get-regexp 'submodule\..*\.url' 
> > submodule.cloog.url /home/sverdool/public_html/cloog.git
> > submodule.cloog.url http://www.liacs.nl/~sverdool/cloog.git
> 
> You are priming the process by having these configuration
> variables in the superproject to be cloned (i.e. this is done by
> the owner of the superproject).

Is that a question? The answer would be that if the user didn't put this information in a config file, then git will try to get the information from any remote it can get its hands on.

Show 5 quoted lines
> What's the design like to make clone and checkout work together?
> When you run the first clone with -n ("do not checkout"), what
> should happen (I am not asking what your code does, but what the
> desired behaviour should be)?  My take on that question is
> "subproject cloning is done by checkout, not clone".

Then I guess you are not asking me. I took the suggestion of doing the subproject cloning during checkout from you.

Show 5 quoted lines
> I am very worried about this big red switch that says "all
> subprojects to be cloned and checked out, or nothing".  I think
> this would not work well with projects that truly need
> superproject support (i.e. very large ones, where most people
> would not want to clone and check out every single subproject).

It's pretty easy to add a "submodule.*.skip" or "submodule.*.ignore". Since the subcloning only happens at checkout, you could set these before doing a checkout.

Show 10 quoted lines
> > I currently do not fetch after the initial clone, since
> > I'm not sure what ref to use for the revision I need to
> > fetch for the supermodule.
> 
> I think fetching inside the subproject can be safely done with
> the default (i.e. refs/heads/*:refs/remotes/origin/*) of 1.5.0
> or later, as long as we tell the users of the feature that they
> should make sure that the commit referenced by superproject tree
> entries are available with such a fetch, which is a sane thing
> to require anyway.

Seems like a pretty strict requirement, but it's easy to implement, so I guess I can do that in the fourth version.

Show 10 quoted lines
> The more important issue I think is at what point in the
> superproject operation does a recursive checkout in a subproject
> should happen, and how we should do the checkout.  Issues I can
> think of offhand are (no way exhaustive):
> 
>  - Do we checkout a branch? if so which one?
> 
>  - Do we detach HEAD if the commit named by the superproject
>    tree is not at the tip of the current branch of subproject?
>    do we detach always even if the commit is at the tip?

I thought there was a consensus to detach the HEAD. I don't have a strong opinion on this issue, but a detached HEAD seems the most appropriate to me.

>  - What would we do when the subproject working tree is not
>    clean?

I was planning on adding a --dry-run to git-checkout. The superproject would run this in each subproject before doing the actual checkout of the superproject.

Show 6 quoted lines
>  - How can a user decide which subproject to descend into and
>    which subproject to ignore, and how does git remember the
>    earlier decision made by the user without asking the same
>    again, and how does a user express "now I want to also track
>    that subproject I've ignored so far" and "now I am not
>    interested in following that subproject anymore"?
Just twiddle the "submodule.*.skip" option.
> So I tend to disagree with not having the indirection we
> discussed on the other thread about .gitmodules, but I consider
> it a minor detail of cloning, and it is not a major deal to me.

Some form of indirection is definitely required (although not for my use of submodules) and I'll probably add it in a future round.

skimo
Previous: Junio C HamanoNext: Alex Riesen
Message 26 of 53 in “[RFC] Third round of support for cloning submodules”
  1. skimo@liacs.nlMay 20, 2007
  2. 01/15 Add dump-configskimo@liacs.nl, May 20, 2007
  3. 02/15 git-config: add --remote option for reading config from remote reposkimo@liacs.nl, May 20, 2007
  4. Frank LichtenheldMay 20, 2007
  5. Sven VerdoolaegeMay 20, 2007
  6. Frank LichtenheldMay 20, 2007
  7. 03/15 http.h: make fill_active_slots a function pointerskimo@liacs.nl, May 20, 2007
  8. 04/15 git-config: read remote config files over HTTPskimo@liacs.nl, May 20, 2007
  9. 05/15 unpack-trees.c: pass cache_entry * to verify_absent rather than just the nameskimo@liacs.nl, May 20, 2007
  10. 06/15 git-read-tree: take --submodules optionskimo@liacs.nl, May 20, 2007
  11. Martin WaitzMay 20, 2007
  12. Sven VerdoolaegeMay 20, 2007
  13. 07/15 unpack-trees.c: assume submodules are cleanskimo@liacs.nl, May 20, 2007
  14. 08/15 Add run_command_v_opt_cd: chdir into a directory before execskimo@liacs.nl, May 20, 2007
  15. 09/15 entry.c: optionally checkout submodulesskimo@liacs.nl, May 20, 2007
  16. Martin WaitzMay 20, 2007
  17. Sven VerdoolaegeMay 20, 2007
  18. Sven VerdoolaegeMay 24, 2007
  19. 10/15 git-checkout: pass --submodules option to git-read-treeskimo@liacs.nl, May 20, 2007
  20. 11/15 git-read-tree: treat null commit as empty treeskimo@liacs.nl, May 20, 2007
  21. 12/15 git_config: add void * for callback dataskimo@liacs.nl, May 20, 2007
  22. 13/15 unpack-trees.c: optionally clone submodules for later checkoutskimo@liacs.nl, May 20, 2007
  23. 14/15 entry.c: optionall checkout newly cloned submodulesskimo@liacs.nl, May 20, 2007
  24. 15/15 git-clone: add --submodules for cloning submodulesskimo@liacs.nl, May 20, 2007
  25. Junio C HamanoMay 20, 2007
  26. Sven VerdoolaegeMay 20, 2007
  27. Alex RiesenMay 20, 2007
  28. Sven VerdoolaegeMay 20, 2007
  29. Alex RiesenMay 20, 2007
  30. Sven VerdoolaegeMay 20, 2007
  31. Alex RiesenMay 20, 2007
  32. Sven VerdoolaegeMay 21, 2007
  33. Josef WeidendorferMay 21, 2007
  34. Martin WaitzMay 21, 2007
  35. Martin WaitzMay 20, 2007
  36. Alex RiesenMay 20, 2007
  37. Martin WaitzMay 20, 2007
  38. Alex RiesenMay 20, 2007
  39. Martin WaitzMay 20, 2007
  40. Alex RiesenMay 22, 2007
  41. Martin WaitzMay 24, 2007
  42. Steven GrimmMay 21, 2007
  43. Sven VerdoolaegeMay 21, 2007
  44. Alex RiesenMay 22, 2007
  45. Martin WaitzMay 20, 2007
  46. Alex RiesenMay 20, 2007
  47. Martin WaitzMay 20, 2007
  48. Martin WaitzMay 20, 2007
  49. Sven VerdoolaegeMay 21, 2007
  50. Martin WaitzMay 21, 2007
  51. Sven VerdoolaegeMay 21, 2007
  52. Martin WaitzMay 21, 2007
  53. Sven VerdoolaegeMay 21, 2007

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.