From: Heiko Voigt Date: Mon, 14 May 2012 17:51:26 GMT Subject: Re: git-diff-tree does not use alternate objects for submodules Message-ID: <20120514175125.GD58058@book.hvoigt.net> In-Reply-To: <7v7gweiu7b.fsf@alter.siamese.dyndns.org> Hi, On Mon, May 14, 2012 at 09:49:28AM -0700, Junio C Hamano wrote: > Heiko Voigt writes: > > > Here is the simplest approach I could think of (not sure if its maybe > > too simple). On first sight it seems to work (even if I exchange the > > absolute path in alternates with a relative one. > > Conceptually looks very sound and trivially correct as long as the > objets_directory.buf is always absolute path (I didn't check, and I do not > offhand know if read_info_alternates() was designed to work when called > with a relative path in relative_base). It looks quite so: In read_info_alternates() the alternates file underneath the passed relative_base is opened. It then passes it on to link_alt_odb_entries() which itself passes it unmodified to link_alt_odb_entry(). link_alt_odb_entry() uses realpath to combine relative entries with relative_base before recursively passing the entry to read_info_alternates(). For entries with absolute path relative_base does not seem to be relevant. Cheers Heiko