git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] unpack-trees.c: assume submodules are clean during check-out

From
SVSven Verdoolaege <skimo@kotnet.org>
Date
Aug 5, 2007, 13:55 UTC
Message-ID
<20070805135529.GA999MdfPADPa@greensroom.kotnet.org>
In-Reply-To
<8c5c35580708040441ue1c3ef8qc022912a5af4883e@mail.gmail.com>
On Fri, Aug 03, 2007 at 10:13:09PM -0700, Junio C Hamano wrote:
Show 9 quoted lines
> 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.

Show 10 quoted lines
> 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@kotnet.org>
too.
skimo
Previous: Junio C HamanoNext: Eran Tromer
Message 7 of 16 in “unpack-trees.c: assume submodules are clean during check-out”
  1. unpack-trees.c: assume submodules are clean during check-outSven Verdoolaege, Jul 17, 2007
  2. Junio C HamanoJul 18, 2007
  3. Sven VerdoolaegeAug 1, 2007
  4. Junio C HamanoAug 4, 2007
  5. Lars HjemliAug 4, 2007
  6. Junio C HamanoAug 5, 2007
  7. Sven VerdoolaegeAug 5, 2007
  8. Eran TromerAug 4, 2007
  9. Junio C HamanoAug 5, 2007
  10. Sven VerdoolaegeAug 5, 2007
  11. Eran TromerAug 6, 2007
  12. Sven VerdoolaegeAug 6, 2007
  13. Eran TromerAug 7, 2007
  14. Sven VerdoolaegeAug 7, 2007
  15. Eran TromerAug 8, 2007
  16. Sven VerdoolaegeAug 8, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.