All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bryan Turner <bturner@atlassian.com>
To: Caleb Gray <hey@calebgray.com>
Cc: Junio C Hamano <gitster@pobox.com>, Git Users <git@vger.kernel.org>
Subject: Re: Add a "Flattened Cache" to `git --clone`?
Date: Thu, 14 May 2020 15:44:59 -0700	[thread overview]
Message-ID: <CAGyf7-Fvyes2AwPhqAz=GhpDb=P664DLpK+4o3-ChKyR5KmJQw@mail.gmail.com> (raw)
In-Reply-To: <CAGjfG9akT+KG-tttRWEX_ZqxrqPoY_4Ed7Pymt4DkV5Rgc1CEA@mail.gmail.com>

On Thu, May 14, 2020 at 3:05 PM Caleb Gray <hey@calebgray.com> wrote:
>
> Actually those are the steps that I'm explicitly hoping can be
> skipped, both on server and client, after the first successful clone
> request transaction. The cache itself would be of the end resulting
> `.git` directory (client side)... unless I have misconceptions about
> the complexity of reproducing what ends up on the client side from the
> server side... I figured the shared library probably offers endpoints
> for the information I'd need to achieve that.

I don't know that such an approach would ever get accepted. At most it
could only be a partial replica of a `.get` directory. For example,
including `.git/config` or `.git/hooks` carries some heavy security
considerations that make it very unlikely such a change would get
accepted. When you pare down the things from the `.git` directory that
can reasonably be included, I suspect you're pretty much going to be
left with `.git/objects/pack/pack-<something>.pack`, and perhaps
`.git/packed-refs` (although the ref negotiations the client needs to
do in order to even request a pack means you're unlikely to actually
_benefit_ from including `packed-refs`).

For such client-side caching, really you may be better of not trying
to reinvent the wheel and instead, as others have suggested, simply
use `git clone --reference` (possibly plus `--dissociate` if you don't
want any long-term connection between clones) to allow `git clone` to
reference all the objects you have available locally to skip most of
the pack transfer. If you do this, then `git clone` can _already_ make
use of local `idx` files, in addition to packs, to save work.

Bryan Turner

  parent reply	other threads:[~2020-05-14 22:45 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-14 14:34 Add a "Flattened Cache" to `git --clone`? Caleb Gray
2020-05-14 20:33 ` Konstantin Ryabitsev
2020-05-14 20:54   ` Bryan Turner
2020-05-14 21:05   ` Theodore Y. Ts'o
2020-05-14 21:09     ` Eric Sunshine
2020-05-14 21:10     ` Konstantin Ryabitsev
2020-05-14 21:23       ` Junio C Hamano
2020-05-14 21:44         ` Konstantin Ryabitsev
2020-05-15 21:42           ` Eric Wong
2020-05-17 22:12             ` Konstantin Ryabitsev
     [not found]               ` <1061511589863147@mail.yandex.ru>
2020-05-25 14:02                 ` Caleb Gray
2020-05-14 21:33     ` Caleb Gray
2020-05-14 21:56       ` Junio C Hamano
2020-05-14 22:04         ` Caleb Gray
2020-05-14 22:30           ` Junio C Hamano
2020-05-14 22:44           ` Bryan Turner [this message]
2020-05-14 21:19   ` 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='CAGyf7-Fvyes2AwPhqAz=GhpDb=P664DLpK+4o3-ChKyR5KmJQw@mail.gmail.com' \
    --to=bturner@atlassian.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=hey@calebgray.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.