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

Re: [PATCH] submodule: Fetch the direct sha1 first

From
Jacob Keller <jacob.keller@gmail.com>
Date
Feb 20, 2016, 10:52 UTC
Message-ID
<CA+P7+xrjE5fF9QKe5AvAcuwNtx4O5yq8FfkXtyrR8r7+E=d8Bw@mail.gmail.com>
In-Reply-To
<xmqqpovsbdyu.fsf@gitster.mtv.corp.google.com>
On Fri, Feb 19, 2016 at 1:13 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 18 quoted lines
>> Regarding performance, the first fetch should fail quite fast iff the fetch
>> fails and then continue with the normal fetch. In case the first fetch works
>> fine getting the exact sha1, the fetch should be faster than a default fetch
>> as potentially less data needs to be fetched.
>
> "The fetch should be faster" may not be making a good trade-off
> overall--people may have depended on the branches configured to be
> fetched to be fetched after this codepath is exercised, but now if
> the commit bound to the superproject tree happens to be complete,
> even though it is not anchored by any remote tracking ref (hence the
> next GC may clobber it), the fetch of other branches will not
> happen.
>
> My knee-jerk reaction is that the order of fallback is probably the
> other way around.  That is, try "git fetch" as before, check again
> if the commit bound to the superproject tree is now complete, and
> fallback to fetch that commit with an extra "git fetch".
>

FWIW, I think the order you suggest here is probably better. It would be lower risk of breaking something since we'd only do something more in this case if the current fetch fails.

I've definitely been bit by this before thinking that the sub module would be able to be fetched just fine only to discover that it wasn't able to locate the change.

Regards, Jake

Previous: Jens Lehmann
Message 8 of 8 in “submodule: Fetch the direct sha1 first”
  1. submodule: Fetch the direct sha1 firstStefan Beller, Feb 19, 2016
  2. Junio C HamanoFeb 19, 2016
  3. Stefan BellerFeb 19, 2016
  4. Junio C HamanoFeb 19, 2016
  5. Stefan BellerFeb 19, 2016
  6. Junio C HamanoFeb 20, 2016
  7. Jens LehmannFeb 22, 2016
  8. Jacob KellerFeb 20, 2016

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.