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

Re: git submodules

From
Jakub Narebski <jnareb@gmail.com>
Date
Jul 28, 2008, 22:26 UTC
Message-ID
<m3r69dtzm9.fsf@localhost.localdomain>
In-Reply-To
<20080728220308.GF10409@artemis.madism.org>
Pierre Habouzit <madcoder@debian.org> writes:
> On Mon, Jul 28, 2008 at 09:40:22PM +0000, Avery Pennarun wrote:
Show 7 quoted lines
> > Further, if you don't have a separate .git directory for each
> > submodule, you can't *switch* branches on the submodule independently
> > of the supermodule in any obvious way.
> 
> Yes you can, in what I propose you have a dummy .git in each submodule,
> with probably an index, a HEAD and a config file (maybe some other
> things along) to allow that especially.

What you are (re)inventing here is something called gitlink (.git which is a file, or .gitlink file); not to be confused with 'sumbodule'/'commit' entry in a tree which is sometimes called gitlink. Alternate idea was 'unionfs' like "shadowing" .git, with 'core.gitdir' in .git/config (which would contain .git/HEAD and .git/index, and all missing files and config would be taken from `core.gitdir').

There was even some preliminary implementation IIRC, but AFAIR it was abandoned because of no "real usage".

See
  http://permalink.gmane.org/gmane.comp.version-control.msysgit/1868
  http://permalink.gmane.org/gmane.comp.version-control.git/72449
  http://permalink.gmane.org/gmane.comp.version-control.git/72457
  http://permalink.gmane.org/gmane.comp.version-control.git/72296
-- 
Jakub Narebski
Poland
ShadeHawk on #git
Previous: Pierre HabouzitNext: Junio C Hamano
Message 8 of 29 in “git submodules”
  1. Pierre HabouzitJul 28, 2008
  2. Pierre HabouzitJul 28, 2008
  3. Nigel MagnayJul 28, 2008
  4. Pierre HabouzitJul 28, 2008
  5. Pierre HabouzitJul 28, 2008
  6. Avery PennarunJul 28, 2008
  7. Pierre HabouzitJul 28, 2008
  8. Jakub NarebskiJul 28, 2008
  9. Junio C HamanoJul 28, 2008
  10. Pierre HabouzitAug 17, 2008
  11. Avery PennarunAug 17, 2008
  12. Junio C HamanoAug 17, 2008
  13. Pierre HabouzitAug 18, 2008
  14. Avery PennarunJul 28, 2008
  15. Pierre HabouzitJul 28, 2008
  16. Benjamin CollinsJul 29, 2008
  17. Shawn O. PearceJul 29, 2008
  18. Nigel MagnayJul 29, 2008
  19. Pierre HabouzitJul 29, 2008
  20. Pierre HabouzitJul 29, 2008
  21. Pierre HabouzitJul 29, 2008
  22. Petr BaudisJul 29, 2008
  23. Johannes SchindelinJul 29, 2008
  24. Pierre HabouzitJul 29, 2008
  25. Johannes SchindelinJul 29, 2008
  26. Pierre HabouzitJul 29, 2008
  27. Nigel MagnayJul 29, 2008
  28. Pierre HabouzitJul 29, 2008
  29. Junio C HamanoJul 29, 2008

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.