From: Jens Lehmann <Jens.Lehmann@web.de>
To: Jeff King <peff@peff.net>
Cc: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org
Subject: Re: [PATCH] fetch: avoid quadratic loop checking for updated submodules
Date: Wed, 14 Sep 2011 20:27:48 +0200 [thread overview]
Message-ID: <4E70F224.2080401@web.de> (raw)
In-Reply-To: <20110913221745.GB24549@sigill.intra.peff.net>
Am 14.09.2011 00:17, schrieb Jeff King:
> One thing that could make it slightly less expensive (but I wouldn't
> worry about implementing until it becomes an issue): you do a full diff
> and collect any changed GITLINK entries, and then compare the paths we
> get with the submodule config. Couldn't you instead do something like
> this:
>
> - let S = set of submodule paths that we care about, from the config
> - start the "git rev-list $new --not $old" traversal, as we do now
> - for each commit
> - diff using a pathspec of S
> - for each changed entry
> - add it to the set of changed submodules
> - remove it from S
> - if S is empty, break
>
> That has two advantages:
>
> 1. We limit the diff by pathspec, which means we can avoid looking at
> irrelevant parts of the tree (we don't do this yet, but hopefully
> we will in the future).
>
> 2. You can break out of the traversal early if you already know you
> have changes in each submodule of interest.
I think this would work for the functionality which is implemented right
now. But with Frederik's gitfile work I hope to enable git to support
submodules being moved around in the work tree rather soonish. Then we
would be blind for any changes in the new location. Until it hurts us
I'd prefer to stay with the correct version, even if it is a bit slower.
> Out of curiosity, what happens if we don't have such a commit? I know
> you said that your policy is never to rewind a submodule's commit that
> has been published in a superproject, and I think that's the only sane
> thing to do. But it's not enforced by git itself, and I wonder how badly
> we break if it does happen (i.e., I'm hoping the answer is "you can't
> diff or checkout superproject revisions that reference the missing bit"
> and not "git log crashes when it gets to that point in history").
No worries, nothing bad happens in that case.
next prev parent reply other threads:[~2011-09-14 18:28 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
2011-09-13 22:17 ` Jeff King
2011-09-14 13:20 ` Marc Branchaud
2011-09-14 18:27 ` Jens Lehmann [this message]
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=4E70F224.2080401@web.de \
--to=jens.lehmann@web.de \
--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).