git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sven Verdoolaege <skimo@kotnet.org>
To: Junio C Hamano <gitster@pobox.com>, Lars Hjemli <hjemli@gmail.com>
Cc: git@vger.kernel.org, Eran Tromer <git2eran@tromer.org>
Subject: Re: [PATCH] unpack-trees.c: assume submodules are clean during check-out
Date: Sun, 05 Aug 2007 15:55:29 +0200	[thread overview]
Message-ID: <20070805135529.GA999MdfPADPa@greensroom.kotnet.org> (raw)
In-Reply-To: <8c5c35580708040441ue1c3ef8qc022912a5af4883e@mail.gmail.com> <7v643vj316.fsf@assigned-by-dhcp.cox.net>

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@kotnet.org>

too.

skimo

  parent reply	other threads:[~2007-08-05 13:55 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-17 18:28 [PATCH] unpack-trees.c: assume submodules are clean during check-out Sven Verdoolaege
2007-07-18  7:29 ` Junio C Hamano
2007-08-01 14:05   ` Sven Verdoolaege
2007-08-04  5:13     ` Junio C Hamano
2007-08-04 11:41       ` Lars Hjemli
2007-08-05  6:02         ` Junio C Hamano
2007-08-05 13:55         ` Sven Verdoolaege [this message]
2007-08-04 16:03       ` Eran Tromer
2007-08-05  6:12         ` Junio C Hamano
2007-08-05 14:46         ` Sven Verdoolaege
2007-08-06 18:42           ` Eran Tromer
2007-08-06 19:03             ` Sven Verdoolaege
2007-08-07  3:24               ` Eran Tromer
2007-08-07  8:51                 ` Sven Verdoolaege
2007-08-08  1:41                   ` Eran Tromer
2007-08-08 11:39                     ` Sven Verdoolaege

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070805135529.GA999MdfPADPa@greensroom.kotnet.org \
    --to=skimo@kotnet.org \
    --cc=git2eran@tromer.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=hjemli@gmail.com \
    --cc=skimo@liacs.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).