git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yann Droneaud <ydroneaud@opteya.com>
To: git@vger.kernel.org
Cc: ydroneaud@opteya.com
Subject: git fetch --reference
Date: Tue, 03 Sep 2013 18:55:29 +0200	[thread overview]
Message-ID: <ae657fa74373b58feba41615d335504e@meuh.org> (raw)

Hi,

I surprised myself trying to run git fetch --reference <local directory> 
<remote>
in the hope git would use my <local directory> to resolve objects 
present in <remote> but not
in my current repository ... just like git clone --reference <local 
directory> <URL>:

--reference <repository>
            If the reference repository is on the local machine, 
automatically setup
            .git/objects/info/alternates to obtain objects from the 
reference repository.
            Using an already existing repository as an alternate will 
require fewer objects
            to be copied from the repository being cloned, reducing 
network and local storage
            costs.

git fetch --reference would set up a temporary objects/info/alternates 
... and skrew everything up.

Having a git fetch --reference option would be great, so that I could 
fetch one remote and the other related one in a row without any special 
setup. [At this point, you're likely to suggest me to use a local mirror 
that I would git clone/fetch from, and your probably right, but for a 
one time hack, it's cumbersome.]

In the end I've read 
http://git-blame.blogspot.fr/2012/08/bringing-bit-more-sanity-to-alternates.html

First I thought having "git alternatives add" would enable me to 
temporary add the --reference <directory>
before running git fetch ... But it seems --reference doesn't work as I 
first understand it:
git clone --reference don't *copy* object from the --reference 
<repository> instead of *copying* them from the cloned <url>, eg. using 
--reference <repository> as kind of mirror.
Instead --reference <repository> seems to add a kind of a symlink. And 
if the --reference <repository> disappear, things are going to be lost.  
See this : 
http://randyfay.com/content/git-clone-reference-considered-harmfu

So setting a temporary alternate with git fetch --reference is a 
non-sense ...
To achieve what I intend to do with this option, a git repack would need 
to be issued to actually
copy the objects from the --reference <repository>.

So what's the best way to do a git fetch <remote>, copying objects from 
another local repository
to resolve delta ?

Regards.

-- 
Yann Droneaud
OPTEYA

             reply	other threads:[~2013-09-03 16:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-03 16:55 Yann Droneaud [this message]
2013-09-03 17:19 ` git fetch --reference Andreas Schwab

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=ae657fa74373b58feba41615d335504e@meuh.org \
    --to=ydroneaud@opteya.com \
    --cc=git@vger.kernel.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).