All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Phillip Susi <psusi@ubuntu.com>
Cc: "git\@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: Clone from shallow bundle bug
Date: Tue, 31 Mar 2015 23:31:43 -0700	[thread overview]
Message-ID: <xmqqtwx0mka8.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <551B5E64.9070906@ubuntu.com> (Phillip Susi's message of "Tue, 31 Mar 2015 22:56:36 -0400")

Phillip Susi <psusi@ubuntu.com> writes:

> On 03/31/2015 06:17 PM, Junio C Hamano wrote:
>> Phillip Susi <psusi@ubuntu.com> writes:
>> 
>>> I made a shallow clone of my repo, then used git bundle create to
>>> pack it all into a bundle file, then cloned from that bundle.
>> 
>> I think the introdution of shallow clone feature broke git bundle
>> create by not teaching it that its shallow boundaries are
>> prerequisite commits to unbundle its contents.  IOW, the bundle
>> created from the shallow clone is broken, I would think.
>
> It seems to me that it isn't exactly broken; it just needs to put
> something in the bundle noting ...

I think you are saying the same thing as I did without realizing ;-)

The only way a bundle can record "something" "noting" that it is an
incomplete history, while allowing it to be read by existing
implementations of "git bundle unbundle" is to list the commits,
behind which there is no history available in the bundle, as
bundle's pre-requisites.  I said that the addition of shallow repository
support did not enhance "git bundle create" to do so, and you are
saying "it just needs to put", implying that it currently does not.

Now, the only way the existing implementations of "git bundle
unbundle" can extract from such a bundle with prerequisites is to
unbundle into a repository that satisifies the prerequisites (these
incomplete bundle files are designed as a medium for sneaker-net
incremental updates).  I however suspect "git clone --shallow" from
such a bundle _might_ work (I never tried it), but I wouldn't be
surprised if the existing implementations of bundle unpacking code
refused to unbundle into a repository that lacks prerequiste commits
(i.e. making the repository a shallow-clone).

Allowing "git clone" (without "--shallow") from an incomplete bundle
file create a shallow clone, instead of outright refusing to work or
silently creating a corrupt repository, might be an interesting project,
perhaps the right size for GSoC or something like that.

Patches welcome, but one thing whoever is doing such a patch needs
to be careful about is that the pack data in the bundle is likely to
be a thin one---truly requiring the repository the bundle is unpacked
into to have the prerequisite objects.

  reply	other threads:[~2015-04-01  6:31 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-31 21:10 Clone from shallow bundle bug Phillip Susi
2015-03-31 22:17 ` Junio C Hamano
2015-04-01  2:56   ` Phillip Susi
2015-04-01  6:31     ` Junio C Hamano [this message]
2015-04-01 10:01       ` Duy Nguyen
2015-04-01 13:00         ` Phillip Susi
2015-04-01 17:20         ` Junio C Hamano
2015-04-02  0:33           ` Duy Nguyen
2015-04-02  0:35             ` Duy Nguyen
2015-04-02  1:26             ` Phillip Susi
2015-04-01  9:55 ` Duy Nguyen
2015-04-01 12:53   ` Phillip Susi
2015-04-01 13:09     ` Duy Nguyen
2015-04-01 13:30       ` Phillip Susi
2015-04-01 13:36         ` Duy Nguyen
2015-04-01 14:06           ` Phillip Susi

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=xmqqtwx0mka8.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=psusi@ubuntu.com \
    /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.