git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jens Lehmann <Jens.Lehmann@web.de>
To: Jeff King <peff@peff.net>
Cc: Junio C Hamano <gitster@pobox.com>,
	git@vger.kernel.org, git-dev@github.com
Subject: Re: [PATCH] fetch: avoid quadratic loop checking for updated submodules
Date: Tue, 13 Sep 2011 21:13:10 +0200	[thread overview]
Message-ID: <4E6FAB46.30508@web.de> (raw)
In-Reply-To: <20110912224934.GA28994@sigill.intra.peff.net>

Am 13.09.2011 00:49, schrieb Jeff King:
> So with a set of changes like:
> 
>   [assume submodule at commit A, superproject at commit B]
> 
>   1. Make commit C in submodule repo.
> 
>   2. Make commit D in superproject repo.
> 
>   3. Make commit E in submodule repo.
> 
>   4. Make commit F in superproject repo.
> 
> what does it buy us to find out that the submodule changed from "A" to
> "C"? We can't actually fetch it. We can only fetch the tips of the
> submodule and hope that they include everything we wanted (i.e., both C
> and E; which might not be the case of E rewound and is not a descendant
> of C).

Yes. But working with submodules in my experience only then works well
when you never drop a submodule commit recorded in any superproject. At
my dayjob we have the convention: You may only record commits that are
on the submodule's master - or another never to be rewound integration
branch - in the superproject. That gives us all needed commits in a
simple fetch.

> So since we must accept that we can't necessarily get every intermediate
> step, I wonder if we are simply better off diffing the "before" and
> "after" state of a particular ref, rather than traversing. It's way
> cheaper, and is just as likely to give us the same information (i.e.,
> which submodule paths had changed commits).

The real world use case I have for that is that when a bug introduced by
a new submodule commit is detected later on, the superproject's fix
records an older submodule commit to remove the problematic change from
the superproject. But the submodule's branch isn't rewound (as that is
most probably master) but a fix is applied on top of it. Then that one
gets tested and - if it was found ok - recorded in the superproject.

Changes like this could be overlooked if you only compare "before" and
"after" instead of traversing, leading to not fetching a submodule which
does have new commits that are used in the newly fetched superproject's
commits. I'd like to have on-demand fetch keep the correct solution of
traversing unless we have good reasons against it, especially as teaching
checkout & friends to recursively update submodules too depends on all
needed commits being present.

  parent reply	other threads:[~2011-09-13 19:13 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-12 19:56 [PATCH] fetch: avoid quadratic loop checking for updated submodules Jeff King
2011-09-12 20:21 ` Junio C Hamano
2011-09-13 19:34   ` Jens Lehmann
2011-09-14 18:26     ` Jens Lehmann
2011-09-12 21:25 ` Junio C Hamano
2011-09-12 22:49   ` Jeff King
2011-09-12 23:06     ` Junio C Hamano
2011-09-12 23:25       ` Jeff King
2011-09-12 23:33     ` Junio C Hamano
2011-09-13 19:13     ` Jens Lehmann [this message]
2011-09-13 22:17       ` Jeff King
2011-09-14 13:20         ` Marc Branchaud
2011-09-14 18:27         ` Jens Lehmann
2011-09-14 18:29           ` Jeff King
2011-09-13 16:40 ` Christian Couder
2011-09-13 17:15   ` Jeff King
2011-09-13 17:34     ` Junio C Hamano

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=4E6FAB46.30508@web.de \
    --to=jens.lehmann@web.de \
    --cc=git-dev@github.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=peff@peff.net \
    /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).