Re: [PATCH v2] add test to demonstrate that shallow recursive clones fail
- From
Lars Schneider <larsxschneider@gmail.com>
- Date
- Nov 15, 2015, 12:53 UTC
- Message-ID
- <D21E9A9A-7444-4585-9066-3546F172A0EC@gmail.com>
- In-Reply-To
- <20151113053547.GD29708@sigill.intra.peff.net>
On 13 Nov 2015, at 06:35, Jeff King <peff@peff.net> wrote:
Show 24 quoted lines
> On Thu, Nov 12, 2015 at 10:37:41AM +0100, larsxschneider@gmail.com wrote: > >> From: Lars Schneider <larsxschneider@gmail.com> >> >> "git clone --recursive --depth 1 --single-branch <url>" 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 <url> >> cd <repo-name> >> 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.
I see your point. I'll remove the workaround tests in the next roll. That being said, I think the we should do something about the workarounds, too, because it certainly confused me as Git user. Would you merge a patch that prints a warning message like "--depth parameter not supported for submodules update command" or something if a user tries this command?
Thanks, Lars