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

Re: Making submodules easier to work with

From
Ping Yin <pkufranky@gmail.com>
Date
May 8, 2008, 01:13 UTC
Message-ID
<46dff0320805071813p34abde3aye7f954708e0bc6a7@mail.gmail.com>
In-Reply-To
<32541b130805070914n2d090971rf367c838dcfd9557@mail.gmail.com>
On Thu, May 8, 2008 at 12:14 AM, Avery Pennarun <apenwarr@gmail.com> wrote:
Show 35 quoted lines
> On 5/6/08, Roman Shaposhnik <rvs@sun.com> wrote:
>  > May be my brain is saturated with "partial cloning" but somehow the
>  >  following looks like an interesting twist on a decentralized SCM:
>  >  imagine that the picture given by Finn Arne Gangstad weren't
>  >  static. IOW, os-lib wasn't really a separate component to begin
>  >  with but was first developed as part of a "crawler" and only
>  >  when the other team started to implement "indexer" there was
>  >  a need for os-lib to be shared between two independent projects.
>  >  Is there any nice way to express such a dynamic history sharing,
>  >  short of truly refactoring os-lib into a separate Git repository
>  >  and treating it either as a submodule or a subtree-merge?
>
>  Personally, I think it would be good enough to split out the os-lib
>  into its own repo using "git-filter-branch --subdirectory-filter", and
>  then link to it in newer versions of your crawler and indexer projects
>  using git-submodule.
>
>  There would be a bit of wastage here, since crawler still contains the
>  history of os-lib, which is the same (even the same tree and file
>  objects!) as the ones in os-lib.
>
>  I can think of two responses to that:
>
>  1) It's not very important, disk space is cheap and git repositories
>  are small, and it's much better to have an accurate history of the
>  crawler project than to overoptimize for space.
>
>  2) If the supermodule and submodule shared the same object repository
>  (eg. the submodule was checked out with
>  --alternate=<supermodule-gitdir>), there would be no need to waste
>  storage space.  If/when I get my act in gear and start submitting
>  git-submodule patches, supporting this behaviour is the direction I'll
>  probably start in.
>  (http://article.gmane.org/gmane.comp.version-control.git/78675)
>

It doesn't change the workflow whether using --alternative (although i think it is a good idea).

The most interesting idea in that thread is the "When checking out a submodule, give the submodule's current commit a useful branch name". As a heavy submodule user, this will make my life much easier.

-- 
Ping Yin
Previous: Avery PennarunNext: Steven Grimm
Message 19 of 22 in “Making submodules easier to work with (auto-update on checkout or merge, stash & restore submodules)”
  1. Tim HarperApr 30, 2008
  2. Tim HarperApr 30, 2008
  3. Andreas EricssonApr 30, 2008
  4. Johannes SchindelinApr 30, 2008
  5. Avery PennarunApr 30, 2008
  6. Ping YinApr 30, 2008
  7. Roman ShaposhnikApr 30, 2008
  8. Avery PennarunApr 30, 2008
  9. Tim HarperApr 30, 2008
  10. Avery PennarunApr 30, 2008
  11. Tim HarperApr 30, 2008
  12. Avery PennarunApr 30, 2008
  13. Roman ShaposhnikApr 30, 2008
  14. Avery PennarunApr 30, 2008
  15. Finn Arne GangstadMay 1, 2008
  16. Avery PennarunMay 1, 2008
  17. Roman ShaposhnikMay 6, 2008
  18. Avery PennarunMay 7, 2008
  19. Ping YinMay 8, 2008
  20. Steven GrimmMay 1, 2008
  21. Roman ShaposhnikMay 6, 2008
  22. Ping YinMay 1, 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.