public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: "Shawn O. Pearce" <spearce@spearce•org>
To: Junio C Hamano <gitster@pobox•com>
Cc: git@vger•kernel.org
Subject: Re: [PATCH] git-fetch: avoid local fetching from alternate (again)
Date: Thu, 8 Nov 2007 02:35:05 -0500	[thread overview]
Message-ID: <20071108073505.GI14735@spearce.org> (raw)
In-Reply-To: <7vr6j1bxuf.fsf@gitster.siamese.dyndns.org>

Junio C Hamano <gitster@pobox•com> wrote:
> 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.
 
> 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.

  reply	other threads:[~2007-11-08  7:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-07  2:41 [PATCH] git-fetch: avoid local fetching from alternate (again) Shawn O. Pearce
2007-11-07  6:24 ` Junio C Hamano
2007-11-07  7:45   ` Junio C Hamano
2007-11-07 20:32   ` Junio C Hamano
2007-11-08  7:35     ` Shawn O. Pearce [this message]
2007-11-08  8:04   ` Shawn O. Pearce
2007-11-07  8:12 ` Johannes Sixt

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=20071108073505.GI14735@spearce.org \
    --to=spearce@spearce$(echo .)org \
    --cc=git@vger$(echo .)kernel.org \
    --cc=gitster@pobox$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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