From: Junio C Hamano <gitster@pobox.com>
To: James Pickens <jepicken@gmail.com>
Cc: Git ML <git@vger.kernel.org>, Jeff King <peff@peff.net>
Subject: Re: 'git clone' doesn't use alternates automatically?
Date: Sat, 31 Jan 2009 16:55:13 -0800 [thread overview]
Message-ID: <7vtz7f2cy6.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: 885649360901311208s4bc17ae3me2062b07b302291e@mail.gmail.com
James Pickens <jepicken@gmail.com> writes:
> So, is there any reason 'git clone' shouldn't automatically use
> the alternates that it copied into the new repository?
When you say "git clone" without -s, you are saying "I do not want to use
the repository I am cloning from as my alternate, because I do not know if
will stay stable. I do not trust it."
This would be a very sensible way to clone, if you were cloning my
repository whose 'pu' and its constituent topic branches are subject to
rewinding at any time. After I rebase some of the branches and rebuild
'pu', and prune the unnecessary objects from my repository, the objects
you may have been borrowing from me will be gone from my repository. Of
course, I can remove my repository altogether any time, and when that
happens, your repository will have many missing objects.
That is why "-s" is not the default.
Only when you positively know that the other repository will not drop
branches or rewind them, perhaps because you control that repository
yourself, it is safe to use it as your alternate, and you use commands
like "git clone -s" and/or "git clone --reference" to do so.
Side note. People on k.org are encouraged to use Linus's
repository as an alternate to save space on the k.org machine,
because it is known that Linus's repository will never rewind its
branches.
Now, if you are cloning from a local filesystem, by default we will copy
the objects/info/alternates from the source repository to the new one. It
may be debatable if this is a sensible thing to do. On one hand, because
you are saying you don't trust if the objects in the source repository
will stay stable by not giving "-s", it might be sensible not to trust its
choice of alternates either. But in such a case, you can always use file://
URL when cloning to get a full freestanding copy.
I suspect you are trying to improve the other extreme end: trusting all
the other repositories involved in the cloning process a lot more than the
code currently does.
I do not think it is a bad thing to do per-se.
I haven't looked at the codepaths involved recently, but if I recall
correctly, optimizing of cloning from a repository that uses alternates
itself was never a part of the initial design considerations. I suspect
there may be an ample room for you to optimize things.
next prev parent reply other threads:[~2009-02-01 0:56 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
2009-02-03 6:06 ` Jeff King
2009-02-01 0:55 ` Junio C Hamano [this message]
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=7vtz7f2cy6.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).