git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Alyssa Ross <hi@alyssa.is>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] doc: explain why file: URLs and bundles don't mix
Date: Mon, 13 May 2019 16:54:55 +0000	[thread overview]
Message-ID: <20190513165140.vq225fscfvemol7k@x220.qyliss.net> (raw)
In-Reply-To: <xmqqv9yebwzp.fsf@gitster-ct.c.googlers.com>

[-- Attachment #1: Type: text/plain, Size: 2517 bytes --]

> > +- When cloning, the former implies --local option. See
> > +  linkgit:git-clone[1] for details.
> > +
> > +- The latter is implemented using linkgit:git-upload-pack[1], which
> > +  expects its repository to be a directory, and therefore does not
> > +  work for bundles (see linkgit:git-bundle[1]).
>
> Hmm, I do not think this is quite true.
>
> If "git clone /path/to/repo.bndl" implied --local, we would end up
> trying to hardlink into /path/to/repo.bndl/objects and would fail.
>
> I think what is closer to the reaility is that we check if the
> source is a bundle when the local filesystem path is used and try to
> clone from the bundle, before using the local filesystem path as a
> directory we can "clone --local" from.  On the other hand, when the
> <scheme>://<path> syntax is used, we do not even bother seeing if
> the named resource is a bundle, or if --local optimization is
> possible (because we do not bother seeing if the named resource is a
> local filesystem entity, either).

Would the following work better for you?

When cloning, the former will check to see if the source is a bundle.
If it is, it will clone from the bundle, otherwise it will behave as if
given --local. The latter performs neither of these checks, and
therefore does not support bundles.

> A possibly interesting tangent to think about is what would happen
> if we slightly tweak the above design.  What it would require for
> the code to take "git clone https://site/repo.bndl", realize that
> the named resource is a bundle file, curl/wget it and clone from
> that downloaded bundle?  And if it is feasible to implement, would
> it even be a good idea to begin with?  I do not have a ready answer
> to either of these questions myself.

I was very surprised to find that cloning from a bundle didn't even work
with a file URL, especially since the documentation seemed to imply that
it should. I assumed that file URLs not supporting bundles was an
oversight, and made some attempt to read the code with a view to fixing
it. Once I realised that file URLs went through a completely different
code path to paths, I decided it was better to just document things as
they were.

I think it would be nice if, at least for file URLs, bundles were
supported. I doubt supporting cloning a bundle over a network would
inherently cause problems (although I'm by no means qualified to make
such an assessment) -- if it's not clear whether it's a good idea to do
so, it could always be implemented without being advertised.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2019-05-13 16:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-13  0:23 [PATCH] doc: explain why file: URLs and bundles don't mix Alyssa Ross
2019-05-13  8:05 ` Junio C Hamano
2019-05-13 16:54   ` Alyssa Ross [this message]
2019-05-14  9:30     ` Jeff King
2019-05-14  9:29   ` Jeff King

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190513165140.vq225fscfvemol7k@x220.qyliss.net \
    --to=hi@alyssa.is \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).