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

Re: [PATCH] fetch: avoid quadratic loop checking for updated submodules

From
Jens Lehmann <jens.lehmann@web.de>
Date
Sep 14, 2011, 18:27 UTC
Message-ID
<4E70F224.2080401@web.de>
In-Reply-To
<20110913221745.GB24549@sigill.intra.peff.net>
Am 14.09.2011 00:17, schrieb Jeff King:
Show 23 quoted lines
> 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.

Show 7 quoted lines
> 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.
Previous: Marc BranchaudNext: Jeff King
Message 13 of 17 in “fetch: avoid quadratic loop checking for updated submodules”
  1. fetch: avoid quadratic loop checking for updated submodulesJeff King, Sep 12, 2011
  2. Junio C HamanoSep 12, 2011
  3. Jens LehmannSep 13, 2011
  4. Jens LehmannSep 14, 2011
  5. Junio C HamanoSep 12, 2011
  6. Jeff KingSep 12, 2011
  7. Junio C HamanoSep 12, 2011
  8. Jeff KingSep 12, 2011
  9. Junio C HamanoSep 12, 2011
  10. Jens LehmannSep 13, 2011
  11. Jeff KingSep 13, 2011
  12. Marc BranchaudSep 14, 2011
  13. Jens LehmannSep 14, 2011
  14. Jeff KingSep 14, 2011
  15. Christian CouderSep 13, 2011
  16. Jeff KingSep 13, 2011
  17. Junio C HamanoSep 13, 2011

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.