Thread (1 message) 1 message, 1 author, 2016-06-15

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

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:53:48

Heiko Voigt [off-list ref] writes:
On Tue, May 08, 2012 at 08:36:36AM -0700, Junio C Hamano wrote:
...
quoted
... 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.
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?
No, I do not, and that is exactly the point.

Making the process that works in the top-level superproject to imitate
what would happen if the processing happened inside the submodule is what
invited a bug like this.  Who knows what other discrepancies remain there.

If we forked a separate process, and made it to chdir to the submodule
tree, and had it do its usual thing there, we do not have to worry about
how good the imitation is, exactly because there won't be any imitation.
There will only be a git processing happening in the usual way inside the
submodule directory, as if the end user cd'ed there and typed the "git
status" command to see if the HEAD matches the given commit or if the
working tree is dirty.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help