git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Christian Schilling <christian.schilling.de@gmail.com>
To: Taylor Blau <me@ttaylorr.com>
Cc: git@vger.kernel.org
Subject: Re: ls-refs protocol extension
Date: Mon, 25 Jan 2021 09:44:15 +0100	[thread overview]
Message-ID: <CAJsFKUBKoD-PvroY7F7=PtF6+KYszTgUD1mndH8vZmh-fSC90g@mail.gmail.com> (raw)
In-Reply-To: <YA4ZOOccXK0YEOWu@nand.local>

On Mon 25. Jan 2021 at 02:04, Taylor Blau <me@ttaylorr.com> wrote:
>
> On Sun, Jan 24, 2021 at 01:40:08PM +0100, Christian Schilling wrote:
> > Hi list,
> > I have been working on a custom git server where the sha values
> > required to respond to a ls-refs command can occasionally be expensive
> > to compute.
>
> Almost certainly the expensive part of ls-refs is actually traversing
> the references, not parsing the objects they point at and determining
> their hash.

My use case is very different. I’m working on a custom git server that
creates refs as well as the objects they are referring to on demand.

More specifically the references are derived from the repo url to
implement partial cloning.
So you can do:
git clone http://repository-url.git:/any/subdir/you/want.git

The server will do something similar to git-filter-branch and
deliver the result.
Due to the way my own branch filtering implementation works this is
usually fast enough for the users not to notice what is going on,
but the fact remains that the shas are only known after the filtering
is complete.
Also my server acts as a proxy with the canonical backing repository
hosted on a different machine.
So to start filtering the proxy has to first ask the upstream for the
current state of the repo and download
any new changes. I have done a lot of optimizations to make
all of this fast and in most cases it is, but for the occasional case,
for example if a completely new repo is cloned for the first time,
it leaves the users looking at a seemingly “frozen” command prompt
not knowing if they made a mistake or are encountering some bug or
network problem.

At first I also thought about suggesting a protocol extension that allows
to start transferring pack data before all refs are known to reduce the
total time needed, but the slow cases are infrequent enough so that this
probably not worth it.

> Incidentally, we had a discussion recently [1] that resulted in some
> patches that make it so that ls-refs often only has to read through part
> of the refs in your repository, not all of them.

I had my own struggles with the “to many refs” problem, but this is
unrelated :-)

>
> > It would be a great improvement of user experience if it was possible
> > to show progress to the user while this is happening.
>
> It's possible that that might help, but honestly I'd be surprised if
> there was a real use-case that needed it (especially after the patches
> that I mentioned which should make it fast enough that you don't have to
> care :-)).

Sorry for not being clearer about what I am trying to accomplish the first time,
I hope I convinced you that this is a very different, but real, use case.

Thanks,
Christian

>
> Thanks,
> Taylor
>
> [1]: https://lore.kernel.org/git/20210119144251.27924-1-jacob@gitlab.com/

      reply	other threads:[~2021-01-26  5:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-24 12:40 ls-refs protocol extension Christian Schilling
2021-01-25  1:04 ` Taylor Blau
2021-01-25  8:44   ` Christian Schilling [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

  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='CAJsFKUBKoD-PvroY7F7=PtF6+KYszTgUD1mndH8vZmh-fSC90g@mail.gmail.com' \
    --to=christian.schilling.de@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=me@ttaylorr.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).