On Fri, Aug 03, 2007 at 10:13:09PM -0700, Junio C Hamano wrote: > Let me understand the problem first. If your first checkout > does not check out the submodule, switching between revisions > that has different commit of the submodule there would not fail, > but once you checkout the submodule, switching without updating > the submodule would be Ok (because by design updating the > submodule is optional) but then further switching out of that > state will fail because submodule in the supermodule tree and > checked-out submodule repository are now out of sync. Is that > the problem? Yes. > In any case, I doubt ce_compare_gitlink() is the right layer to > work this around -- it is not about "can we switch" but is about > "is it different". It is at too low a level. You are right. I followed the logic down to ce_compare_gitlink, but I should have backed up again. > The current policy is to consider it is perfectly normal that > checked-out submodule is out-of-sync wrt the supermodule index, > if I am reading you right. I think it is a good policy, at > least until we introduce a superproject repository configuration > option that says "in this repository, I do care about this > submodule and at any time I move around in the superproject, > recursively check out the submodule to match". The most extreme > case of this policy is that the superproject index knows about > the submodule but the subdirectory does not even have to be > checked out, which is what we have now. Yes. Alex Riesen convinced me that having the submodule checked out is a good indication that you care about the submodule being in sync (although you then apparently convinced him that this is not a good idea). You didn't take any patch that implements this yet, so I'll probably try again after you release 1.5.3. Since some people seem to like the current situation, I'd only do the updating of checked-out submodules if some "autoUpdateSubmodules" is set. > How about doing something like this instead? Works like a charm. On Sat, Aug 04, 2007 at 01:41:06PM +0200, Lars Hjemli wrote: > Btw: I've applied your patch to rc-4 and tested the result in my cgit > repo: very nice, and very ack'd ;-) If it matters, a definite Acked-by: Sven Verdoolaege <skimo@xxxxxxxxxx> too. skimo - 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