On 13 Nov 2015, at 06:35, Jeff King <peff@xxxxxxxx> wrote: > On Thu, Nov 12, 2015 at 10:37:41AM +0100, larsxschneider@xxxxxxxxx wrote: > >> From: Lars Schneider <larsxschneider@xxxxxxxxx> >> >> "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-- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html