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

Re: git-diff-tree does not use alternate objects for submodules

From
Heiko Voigt <hvoigt@hvoigt.net>
Date
May 9, 2012, 21:58 UTC
Message-ID
<20120509215815.GC74366@book.hvoigt.net>
In-Reply-To
<7v1umuznuj.fsf@alter.siamese.dyndns.org>
Hi,
On Tue, May 08, 2012 at 08:36:36AM -0700, Junio C Hamano wrote:
Show 23 quoted lines
> Orgad and Raizel Shaneh <orgads@gmail.com> writes:
> 
> > I have a project with a submodule. Both have objects/info/alternate
> > (different ones).
> >
> > After running 'git gc', running gitk on the superproject results in:
> > ?? Submodule sub 227e2b5...d8597e2 (commits not present)
> 
> When "--submodule" option was implemented in 752c0c, it was done with an
> premature and incomplete optimization, and I think you are seeing an
> unfortunate side effect of it. The code attempts to link the object store
> of the submodule repository into the in-core representation of the object
> store of the superproject (in submodule.c::add_submodule_odb()), but does
> not do a good job of it.  It does not take alternates into account, and
> who knows what else is missing.  Sigh...
> 
> The right approach to implement this feature would have been to fork a
> child process and perform the submodule operation inside the child, which
> will chdir into the submodule and treat as if it is a freestanding git
> repository, without contaminating the superproject process.
> 
> For now, an easiest workaround would be to rephrase the error message to
> "commits not present" to "commit not present or missing", or something.

I will have a look if I can come up with something that reads the submodules alternate config and uses it. Do you have other config related things in mind that might be missing?

Cheers Heiko
Previous: Junio C HamanoNext: Junio C Hamano
Message 4 of 12 in “git-diff-tree does not use alternate objects for submodules”
  1. Orgad and Raizel ShanehMay 8, 2012
  2. Junio C HamanoMay 8, 2012
  3. Junio C HamanoMay 8, 2012
  4. Heiko VoigtMay 9, 2012
  5. Junio C HamanoMay 9, 2012
  6. Junio C HamanoMay 9, 2012
  7. Heiko VoigtMay 13, 2012
  8. Heiko VoigtMay 13, 2012
  9. teach add_submodule_odb() to look for alternatesHeiko Voigt, May 14, 2012
  10. Junio C HamanoMay 14, 2012
  11. Heiko VoigtMay 14, 2012
  12. Junio C HamanoMay 14, 2012

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.