From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: James Pickens <jepicken@gmail.com>, Git ML <git@vger.kernel.org>
Subject: Re: 'git clone' doesn't use alternates automatically?
Date: Mon, 02 Feb 2009 20:30:36 -0800 [thread overview]
Message-ID: <7v7i48f8gj.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: 20090202130755.GA8487@sigio.peff.net
Jeff King <peff@peff.net> writes:
> The hardlink code operates by default because it was thought to be a
> safe optimization that couldn't bite people. But it interacts badly with
> the concept of alternates.
Yes, you are right.
To be fair, I think it was proposed/implemented by somebody who almost
never uses alternates himself, and certainly never a relative alternates.
The intention of hardlinking was while saving tons of disk space, still be
independent from the original repository.
Back when e95ab1e ([PATCH] Short-circuit git-clone-pack while cloning
locally (take 2)., 2005-07-06) was done, the packfile implementation was
still only a week old, and hardlinking made a lot of sense from space
saving's point of view. These days, if you make a local hardlinked clone,
work a little there and then repack it, most of the space saving will be
gone; there isn't much point in the hardlink optimization anymore from
that angle, even though it still is a good compromise between the clone
speed and safety, especially when no alternates are involved.
I think a possible fix would be not to copy alternates file literally, but
install an alternates file to directly borrow from the same repositories
the clone-source repository borrows from ourselves, taking relative paths
into account. Another would be to look at the alternates and hardlink the
objects and packs while cloning, and if the repositories involved reside
across filesystem boundaries, we need to fall back to copying.
next prev parent reply other threads:[~2009-02-03 4:32 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-30 22:12 'git clone' doesn't use alternates automatically? James Pickens
2009-01-31 7:12 ` Jeff King
2009-01-31 20:08 ` James Pickens
2009-01-31 21:08 ` Jakub Narebski
2009-01-31 21:43 ` James Pickens
2009-01-31 21:55 ` Jeff King
2009-02-01 1:19 ` Junio C Hamano
2009-02-02 13:07 ` Jeff King
2009-02-03 4:30 ` Junio C Hamano [this message]
2009-02-03 6:06 ` Jeff King
2009-02-01 0:55 ` Junio C Hamano
2009-02-01 1:32 ` James Pickens
2009-02-01 1:38 ` Junio C Hamano
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=7v7i48f8gj.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=jepicken@gmail.com \
--cc=peff@peff.net \
/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).