All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andreas Gruenbacher <agruen@suse.de>
To: "Shawn O. Pearce" <spearce@spearce.org>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 6/9] fetch: Check if all objects exist after fetching
Date: Thu, 18 Mar 2010 20:36:46 +0100	[thread overview]
Message-ID: <201003182036.46874.agruen@suse.de> (raw)
In-Reply-To: <20100318190816.GE10981@spearce.org>

On Thursday 18 March 2010 20:08:16 Shawn O. Pearce wrote:
> Andreas Gruenbacher <agruen@suse.de> wrote:
> > Check if all objects reachable from the fetched refs exist after
> > fetching instead of before: this allows us to distinguish between a
> > repository which is not up to date and a corrupted repository, and to
> > ensure that the repository is up to date and complete after the fetch.
> 
> I'm against this particular change because it looks like it breaks
> the idea of "quickfetch", which we introduced to support faster
> fetches from the parent repository into a shared clone on the
> same disk.

I think you misunderstand the patch.  Before the patch, we were doing a rev-
list to determine if all objects needed are present.  If rev-list fails, this 
can have two reasons: (a) some of the branches or tags needed do not exist, 
(b) all the branches and tags needed do exist, but other objects further up 
the tree are missing (i.e., a corrupted repository).

The patch changes that to first check which needed objects are missing (with 
has_sha1_file()), which is very efficient, by then fetching the objects which 
surely need to be fetched, and by then checking the repository consistency 
with rev-list.  If rev-list then fails, which should only happen in the rarest 
cases, we know that we need to fetch all branches and tags so that we are sure 
to catch missing objects further up the tree.

So we never fetch more than we did before, and in some cases, we fetch less. 
We are also guaranteed to end up with a consistent repository in the end. (The 
old logic does not always guarantee that AFAICT: there seems to be one corner 
case where a fetch succeeds without retrieving missing objects further up the 
tree.)

Thanks,
Andreas

  reply	other threads:[~2010-03-18 19:36 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-18 11:52 [PATCH 0/9] Multiple remotes without conflicts Andreas Gruenbacher
2010-03-13 17:17 ` [PATCH 1/9] fetch: Check for a "^{}" suffix with suffixcmp() Andreas Gruenbacher
2010-03-12 22:27   ` [PATCH 2/9] fetch: Properly initialize refspec on stack Andreas Gruenbacher
2010-03-15 22:18     ` [PATCH 3/9] fetch: Fix minor memory leak Andreas Gruenbacher
2010-03-16 15:45       ` [PATCH 4/9] fetch: Move deepening fetch check into builtin/fetch.c Andreas Gruenbacher
2010-03-16 17:49         ` [PATCH 5/9] fetch: Move loop checking which refs we have already Andreas Gruenbacher
2010-03-16 18:48           ` [PATCH 6/9] fetch: Check if all objects exist after fetching Andreas Gruenbacher
2010-03-17 21:42             ` [PATCH 7/9] fetch: Use the same ref map for all branches and tags Andreas Gruenbacher
2010-03-17 23:02               ` [PATCH 8/9] fetch: Don't fetch tags twice Andreas Gruenbacher
2010-03-17 23:59                 ` [PATCH 9/9] fetch: Make automatic tag following work with arbitrary refspecs Andreas Gruenbacher
2010-03-18 19:08             ` [PATCH 6/9] fetch: Check if all objects exist after fetching Shawn O. Pearce
2010-03-18 19:36               ` Andreas Gruenbacher [this message]
2010-03-18 19:07 ` [PATCH 0/9] Multiple remotes without conflicts Shawn O. Pearce
2010-03-18 19:42   ` Andreas Gruenbacher

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=201003182036.46874.agruen@suse.de \
    --to=agruen@suse.de \
    --cc=git@vger.kernel.org \
    --cc=spearce@spearce.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.