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

Re: [PATCH] git-fetch: avoid local fetching from alternate (again)

From
Shawn O. Pearce <spearce@spearce.org>
Date
Nov 8, 2007, 07:35 UTC
Message-ID
<20071108073505.GI14735@spearce.org>
In-Reply-To
<7vr6j1bxuf.fsf@gitster.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> wrote:
Show 11 quoted lines
> Junio C Hamano <gitster@pobox.com> writes:
> 
> > Well spotted.  It would be a good idea to commit the big comment
> > from contrib/examples/git-fetch.sh to fetch_local_nocopy()
> > function, which would have made us realize that the patch does
> > not refrain from applying this optimization even when shallow
> > is in effect.  But I think that is actually a good change.
> 
> I take this back.  This regresses badly.
> 
> Why?
Whoops.  Good catch.  This is why you had a check for the shallow
history file in git-fetch.sh before you took this optimization path.
My fault for not including it in this patch.
 
Show 7 quoted lines
> Because the optimization is useless when we are trying to deepen
> the shallow history.  When you are trying to deepen a shallow
> history and the tips of remotes haven't moved since you fetched
> from there the last time, you have everything near the tip, and
> becuse your history is shallow, your ancestry chain is
> cauterized to make it appear that the history is complete.  The
> rev-list reachability test would not fail as we expect.

What about just inserting a check to see if --depth was supplied to git-fetch on the command line? If so then we are deepening the history and we just bypass the rev-list "fast path" test.

I will be posting an updated patch (series now) shortly.
-- 
Shawn.
Previous: Junio C HamanoNext: Shawn O. Pearce
Message 5 of 7 in “git-fetch: avoid local fetching from alternate (again)”
  1. git-fetch: avoid local fetching from alternate (again)Shawn O. Pearce, Nov 7, 2007
  2. Junio C HamanoNov 7, 2007
  3. Junio C HamanoNov 7, 2007
  4. Junio C HamanoNov 7, 2007
  5. Shawn O. PearceNov 8, 2007
  6. Shawn O. PearceNov 8, 2007
  7. Johannes SixtNov 7, 2007

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.