git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 0/2] Hiding some refs in ls-remote

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 20, 2013, 18:19 UTC
Message-ID
<7vip6rn2ea.fsf@alter.siamese.dyndns.org>
In-Reply-To
<7v38xxnfv3.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
Show 15 quoted lines
> Duy Nguyen <pclouds@gmail.com> writes:
>
>> Should the client side learn how to list hidden refs too? I'm thinking
>> of an extreme case where upload-pack advertises nothing (or maybe just
>> refs/heads/master) and it's up to the client to ask for the ref
>> selection it's interested in. upload-pack may need more updates to do
>> that, I think.
>
> What you are talking about is a different goal.
>
> Look at this as a mechanism for the repository owner to control the
> clutter in what is shown to the intended audience of what s/he
> publishes in the repository.  Network bandwidth reduction of
> advertisement is a side effect of clutter reduction, and not
> necessarily the primary goal.

As a separate and follow-up topic, I can see a future where we also have .delayref (in addition to .hideref) configuration, that causes the upload-pack to:

 * omit refs that are marked as "delayed";
 * advertise "allow-expand-ref=<value>" where the value is the
   pattern used to specify which refs are omitted via this mechanism
   (e.g. "refs/*" in your extreme example, or perhaps "refs/tags/"
   if you only advertise branches in order to limit the bandwidth);

and then a fetch-pack that is interested in fetching "refs/foo/bar", after seeing that it matches one of the "allow-expand-ref" patterns, to ask "expand-ref refs/foo/bar", expect the upload-pack to respond with "refs/foo/bar <value of that ref>" (or "refs/foo/bar does not exist"), before going into the usual "want" exchange ("ls-remote" would of course do the same, and pattern-less "ls-remote" may even ask to expand everything by saying "expand-ref refs/*" (where the capability said "allow-expand-ref=refs/*" in your extreme example) to grab everything discoverable).

That is _primarily_ for trading network bandwidth with initial latency; as far as the end-result is concerned, delayed ones to be expanded on demand are just as discoverable as the ones advertised initially.

I think we'd want to have both in the end. It just happens I just posted the beginning of clutter-reduction one, as I think developing both in parallel would be messy and hideref is probably less involved than the delayref.

Previous: Junio C HamanoNext: Duy Nguyen
Message 6 of 16 in “Hiding some refs in ls-remote”
  1. 0/2 Hiding some refs in ls-remoteJunio C Hamano, Jan 19, 2013
  2. 1/2 upload-pack: share more codeJunio C Hamano, Jan 19, 2013
  3. 2/2 upload-pack: allow hiding ref hiearchiesJunio C Hamano, Jan 19, 2013
  4. Duy NguyenJan 19, 2013
  5. Junio C HamanoJan 19, 2013
  6. Junio C HamanoJan 20, 2013
  7. Duy NguyenJan 21, 2013
  8. Jeff KingJan 21, 2013
  9. Michael HaggertyJan 19, 2013
  10. Jeff KingJan 19, 2013
  11. Junio C HamanoJan 20, 2013
  12. Junio C HamanoJan 20, 2013
  13. Jeff KingJan 21, 2013
  14. Junio C HamanoJan 21, 2013
  15. Jeff KingJan 21, 2013
  16. Jeff KingJan 21, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.