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

Re: [PATCH 5/5] Add gitmodules(5)

From
JWJosef Weidendorfer <josef.weidendorfer@gmx.de>
Date
Jun 12, 2007, 12:05 UTC
Message-ID
<200706121405.08357.Josef.Weidendorfer@gmx.de>
In-Reply-To
<8c5c35580706120323t52b0d095v6ab6013ee2c8fdea@mail.gmail.com>
On Tuesday 12 June 2007, Lars Hjemli wrote:
Show 12 quoted lines
> If you're thinking about the detached HEAD: yeah, that's a problem. My
> initial plan (with later modifications) was something like this:
> 
> ...
> 
> $ git-submodule update
>   git-clone --bare git://example.com/lib.git .git/submodules/lib.git
>   git-clone -l -s -n .git/submodules/lib.git lib1
>   (cd lib1 && git-checkout $sha1)
>   git-clone -l -s -n .git/submodules/lib.git lib2
>   (cd lib2 && git-checkout $sha2)
> ...
That looks fine to me.
 
> git-submodule push:
>   (cd lib1 && git-push origin $branch1)
>   (cd lib2 && git-push origin $branch2)

This could be problematic. You are only storing changes on the given branch. Ah, you wanted to avoid this problem with the symlink?

Perhaps we need better support for "push all reachable objects which are not on the remote side together with any branch tip changes". Or is this somehow already available with git-push?

Or ...
> I thought I could avoid 'git-submodule push' by using symlinks, but
> you're right. It will not work. Back to the drawing board (again...)

... we revive the "lightweight checkout" idea: share everything but index and HEAD with a given repository. Similar to "contrib/workdir/git-new-workdir" but witt support in git-core to avoid the need for symlinks.

Show 8 quoted lines
> > A workaround for problem (1) would be to create multiple checkouts of the
> > same submodule if modified, e.g. in .git/submodule/$name/$sha1 .
> 
> And the $sha1 would be the sha1 found in the index? I don't think this
> would work either. If two branches in the superproject checkout the
> same submodule sha1, you could possibly want to keep different changes
> in the submodule depending on which branch of the superproject is
> checked out.
OK, does not work.
Show 7 quoted lines
> > Allowing people to work like that is nice, but it should not be forced.
> > It would also be nice to allow the user to specify another place where
> > submodule checkouts are to be stored, e.g. when multiple supermodules
> > share the same submodule.
> 
> True. Maybe submodule.<name>.repopath in .git/config? (If not
> specified, default to .git/submodules/<name>.git)
Sounds good. However, can be done later.
Josef
> 
> --
> larsh
>
Previous: Lars HjemliNext: Sven Verdoolaege
Message 13 of 28 in “misc. submodule related changes”
  1. 0/5 misc. submodule related changesLars Hjemli, Jun 11, 2007
  2. 1/5 t7400: barf if git-submodule removes or replaces a fileLars Hjemli, Jun 11, 2007
  3. 2/5 git-submodule: remember to checkout after cloneLars Hjemli, Jun 11, 2007
  4. 3/5 Rename sections from "module" to "submodule" in .gitmodulesLars Hjemli, Jun 11, 2007
  5. 4/5 git-submodule: give submodules proper namesLars Hjemli, Jun 11, 2007
  6. 5/5 Add gitmodules(5)Lars Hjemli, Jun 11, 2007
  7. Frank LichtenheldJun 11, 2007
  8. 5/5 Add gitmodules(5)Lars Hjemli, Jun 12, 2007
  9. Sven VerdoolaegeJun 12, 2007
  10. Lars HjemliJun 12, 2007
  11. Josef WeidendorferJun 12, 2007
  12. Lars HjemliJun 12, 2007
  13. Josef WeidendorferJun 12, 2007
  14. Sven VerdoolaegeJun 12, 2007
  15. Lars HjemliJun 12, 2007
  16. Johannes SixtJun 12, 2007
  17. Johannes SixtJun 12, 2007
  18. Junio C HamanoJun 12, 2007
  19. Sven VerdoolaegeJun 12, 2007
  20. Josef WeidendorferJun 12, 2007
  21. 5/5 Add gitmodules(5)Lars Hjemli, Jun 12, 2007
  22. Johannes SixtJun 12, 2007
  23. Lars HjemliJun 12, 2007
  24. Josef WeidendorferJun 12, 2007
  25. Lars HjemliJun 12, 2007
  26. Johannes SixtJun 12, 2007
  27. Josef WeidendorferJun 12, 2007
  28. Josef WeidendorferJun 12, 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.