git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Shawn O. Pearce" <spearce@spearce.org>
To: Jon Smirl <jonsmirl@gmail.com>
Cc: Junio C Hamano <junkio@cox.net>, Nicolas Pitre <nico@cam.org>,
	Git Mailing List <git@vger.kernel.org>
Subject: Re: Efficiency of initial clone from server
Date: Mon, 12 Feb 2007 12:04:03 -0500	[thread overview]
Message-ID: <20070212170403.GA29621@spearce.org> (raw)
In-Reply-To: <9e4733910702120840p3fd2a18ar2e3b91564556dc43@mail.gmail.com>

Jon Smirl <jonsmirl@gmail.com> wrote:
> On 2/12/07, Jon Smirl <jonsmirl@gmail.com> wrote:
> >On 2/12/07, Junio C Hamano <junkio@cox.net> wrote:
> >> Time to learn to use --reference perhaps?
> >>
> >>         git clone --reference linux-2.6 
> >git://.../linville/wireless-dev.git
> >>
> >> where "linux-2.6" is local repository which is my personal copy
> >> of Linus's repo.
> 
> Does this use hard links so that if I whack my linux-2.6 it won't also
> destroy my wireless-dev repo?

No.  It uses a Git specific 'symlink workalike'.  We record
the path to the reference repository in the plain text file

  .git/objects/info/alternates

This file can list multiple repositories that this repository borrows
objects from.  If you delete any of those, then this repository
will likely lose access to objects it thinks should be here,
thereby totally screwing this repository.

There's also some risk with repacking or pruneing the reference
source (your linux-2.6 repository) as that repository doesn't know
what objects it has which it itself doesn't need, but which are in
use by the other repositories.


The easiest way to prevent this from destroying a repository later
on is to make your shiny new wireless-dev clone standalone by
completely repacking it after creation (*without* -l !) :

  git repack -a -d
  rm .git/objects/info/alternates

Another solution is don't clone from the remote, but instead clone
locally then update the origin and refetch:

  git clone -l -n linux-2.6 wireless-dev
  cd wireless-dev
  git config remote.origin.url git://.../linville/wireless-dev.git
  git fetch

The initial clone will setup hardlinks, but also uses the wrong
origin URL.  Hence we have to change it just before we attempt to
fetch from wireless-dev.

-- 
Shawn.

  reply	other threads:[~2007-02-12 17:05 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-11 19:53 Efficiency of initial clone from server Jon Smirl
2007-02-11 22:53 ` Shawn O. Pearce
2007-02-11 23:25   ` Jon Smirl
2007-02-11 23:51     ` Jon Smirl
2007-02-12  1:38     ` Nicolas Pitre
2007-02-12  2:15       ` Jon Smirl
2007-02-12  3:55         ` Nicolas Pitre
2007-02-12  4:49           ` Shawn O. Pearce
2007-02-12 16:42             ` Nicolas Pitre
2007-02-12  4:16       ` Junio C Hamano
2007-02-12  4:29         ` Jon Smirl
2007-02-12  4:33           ` Junio C Hamano
2007-02-12  4:53             ` Jon Smirl
2007-02-12  5:01               ` Jon Smirl
2007-02-12  5:11                 ` Shawn O. Pearce
2007-02-12  5:17                   ` Jon Smirl
2007-02-12 15:20                     ` Nicolas Pitre
2007-02-12 19:35                       ` Theodore Tso
2007-02-12 20:53                         ` Junio C Hamano
2007-02-12 21:33                           ` Nicolas Pitre
2007-02-13  0:51                           ` Jakub Narebski
2007-02-12  5:30                 ` Junio C Hamano
2007-02-12  5:55                   ` Jon Smirl
2007-02-12  6:08                     ` Junio C Hamano
2007-02-12 15:24                       ` Jon Smirl
2007-02-12 16:40                         ` Jon Smirl
2007-02-12 17:04                           ` Shawn O. Pearce [this message]
2007-02-12 11:45                   ` Johannes Schindelin
2007-02-12 14:31                     ` Jon Smirl
2007-02-12 17:06                       ` Shawn O. Pearce
2007-02-13 15:03               ` Andreas Ericsson
2007-02-11 23:29   ` Jon Smirl

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=20070212170403.GA29621@spearce.org \
    --to=spearce@spearce.org \
    --cc=git@vger.kernel.org \
    --cc=jonsmirl@gmail.com \
    --cc=junkio@cox.net \
    --cc=nico@cam.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).