All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Narebski <jnareb@gmail.com>
To: Roy Lee <roylee17@gmail.com>
Cc: Jeff King <peff@peff.net>, Teemu Likonen <tlikonen@iki.fi>,
	git@vger.kernel.org
Subject: Re: Does cloning a shallow repo require special setting in the cloned  one?
Date: Thu, 26 Feb 2009 16:42:22 -0800 (PST)	[thread overview]
Message-ID: <m3prh4vhdg.fsf@localhost.localdomain> (raw)
In-Reply-To: <6eac7f470902260501v6d826af7rbc5afd1df7b214a3@mail.gmail.com>

Roy Lee <roylee17@gmail.com> writes:
> On Thu, Feb 26, 2009 at 6:46 PM, Jeff King <peff@peff.net> wrote:
>> On Thu, Feb 26, 2009 at 08:34:51AM +0200, Teemu Likonen wrote:
>>> On 2009-02-25 19:49 (-0800), roylee17 wrote:
>>>
>>>> $ git clone --depth 1 git-full git-shallow2
>>>> 'git log' still gives a full history
>>>>
>>>> Why can't I clone a shallow repo from the git-full?
>>>> Does it requires some settings in the git-full repo?
>>>
>>> I don't know the "why" part but using file:// URL should work:
>>>
>>>     git clone --depth 1 file:///path/to/git-full git-shallow2
>>
>> I don't think the behavior is intentional, but a side effect of the
>> fact that git takes some shortcuts when cloning locally. In particular,
>> it will try to copy or hardlink the object database rather than
>> transmitting over the git protocol locally. Using file:// has always
>> been the way to suppress that shortcut.
>>
>> Perhaps to avoid surprise, that optimization should be turned off for
>> options which cause it to behave differently (like --depth). But I have
>> to wonder what the point of --depth is locally; if you are worried about
>> space, hardlinks (the default) or alternates ("clone -s") are a better
>> solution.
> 
> Actully, the original intention was to find a quick way to checkout and
> build several projects regularly. The first thing came to me was cloning
> shallow repos for saving some time. So I tried it with my local repo first.
> 
> Later, one of my co-works suggested me to try git archive, and that did
> reallly fit my needs.

Perhaps you would be interested then in contrib/workdir/git-new-workdir
script then, which allows for multiple checked out copies from a single
repository?  Be aware that if you work in those copies, and are not
careful, it can lead to confusion; but if all but one of checkouts are
read only it could be the best solution.

-- 
Jakub Narebski
Poland
ShadeHawk on #git

      reply	other threads:[~2009-02-27  0:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-26  3:49 Does cloning a shallow repo require special setting in the cloned one? roylee17
2009-02-26  6:34 ` Teemu Likonen
2009-02-26  7:33   ` Roy Lee
2009-02-26 10:46   ` Jeff King
2009-02-26 11:17     ` Johannes Schindelin
2009-02-26 13:19       ` Jeff King
2009-02-26 13:01     ` Roy Lee
2009-02-27  0:42       ` Jakub Narebski [this message]

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=m3prh4vhdg.fsf@localhost.localdomain \
    --to=jnareb@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    --cc=roylee17@gmail.com \
    --cc=tlikonen@iki.fi \
    /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.