From: brian m. carlson Date: Wed, 12 Nov 2025 23:37:43 GMT Subject: Re: git fails to checkout SHA1 submodule in SHA256 repo with --depth=1 Message-ID: In-Reply-To: On 2025-11-12 at 16:32:01, Junio C Hamano wrote: > Martin Wilck writes: > > >> Subject: Re: git fails to checkout SHA1 submodule in SHA256 repo with --depth=1 > > I think it is not supposed to work to mix repositories like this, > regardless of any other option like --depth. I think brian gave a > response to that effect in a thread in the past few months. > > ... goes and looks ... > > https://lore.kernel.org/git/aJ5gOPQ9oologqj-@fruit.crustytoothpaste.net/ > https://lore.kernel.org/git/aKPJNNWMW9gtueEK@fruit.crustytoothpaste.net/ Yes, that isn't going to work and it never will unless we add some extension mechanism for that purpose. The repository in question is corrupt. I've just written a patch to check for this case and produce an error in git add, which I will send shortly. -- brian m. carlson (they/them) Toronto, Ontario, CA