From: Jeff King Date: Fri, 13 Nov 2015 05:35:47 GMT Subject: Re: [PATCH v2] add test to demonstrate that shallow recursive clones fail Message-ID: <20151113053547.GD29708@sigill.intra.peff.net> In-Reply-To: <1447321061-74381-1-git-send-email-larsxschneider@gmail.com> On Thu, Nov 12, 2015 at 10:37:41AM +0100, larsxschneider@gmail.com wrote: > From: Lars Schneider > > "git clone --recursive --depth 1 --single-branch " clones the > submodules successfully. However, it does not obey "--depth 1" for > submodule cloning. > > The following workaround does only work if the used submodule pointer > is on the default branch. Otherwise "git submodule update" fails with > "fatal: reference is not a tree:" and "Unable to checkout". > git clone --depth 1 --single-branch > cd > git submodule update --init --recursive --depth 1 > > The workaround does not fail using the "--remote" flag. However, in that > case the wrong commit is checked out. Hrm. Do we want to make these workarounds work correctly? Or is the final solution going to be that the first command you gave simply works, and no workarounds are needed. If the latter, I wonder if we want to be adding tests for the workarounds in the first place. I'm not clear on the expected endgame. -Peff