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

Re: [RFC] Submodules in GIT

From
Jakub Narebski <jnareb@gmail.com>
Date
Dec 3, 2006, 11:00 UTC
Message-ID
<ekuaka$6km$1@sea.gmane.org>
In-Reply-To
<200612030224.50592.robin.rosenberg.lists@dewire.com>
Robin Rosenberg wrote:
Show 14 quoted lines
> lördag 02 december 2006 21:16 skrev Jakub Narebski:
>>
>> The problem with submodule as separate git repository is that if you
>> move submodule (subproject) somewhere else in the repository (or just
>> rename it), you have to update alternates file... and this happens not
>> only on move itself, but also on checkout and reset. But that can be
>> managed by having in alternates all possible places the submodule ends
>> into. I don't know if it is truly a problem.
> 
> A nasty problem with separate repositories for submodules is that when you 
> screw up and git complains about everything you try do do, you previously 
> could do rm -rf *; git reset --hard and retry whatever you were trying to do. 
> With separate repositories your submodules will be resting in /dev/null, 
> unless you're very, very careful. 

The solution to this concern could be having GIT_DIR for submodule outside it's working area, for example somewhere in GIT_DIR of the supermodule, and use either symlink or (to be coded) .gitlink symbolic reference to GIT_DIR file. Disadvantage of that is that it moves troubles with moving subproject (although there are no troubles with simple subproject directory renaming) from alternates file to GIT_DIR link representation in submodule.

As Linus said, there are advantages to having submodule repository use separate object database (clone and other operation scaling, index size), and I think they outweight the troubles with moving/renaming the directory submodule resides in.

P.S. I think that the problem with bad performance of too large index is similar to the problems filesystems have with directories with large number of files; some filesystems solved this problem.

-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
Previous: Jakub Narebski
Message 10 of 10 in “[RFC] Submodules in GIT”
  1. Martin WaitzNov 20, 2006
  2. Jakub NarebskiNov 20, 2006
  3. Shawn PearceNov 21, 2006
  4. Petr BaudisNov 22, 2006
  5. Jakub NarebskiDec 2, 2006
  6. Robin RosenbergDec 3, 2006
  7. Jakub NarebskiDec 3, 2006
  8. Robin RosenbergDec 3, 2006
  9. Jakub NarebskiDec 3, 2006
  10. Jakub NarebskiDec 3, 2006

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.