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 19, 2013, 19:16 UTC
Message-ID
<7v38xxnfv3.fsf@alter.siamese.dyndns.org>
In-Reply-To
<CACsJy8C4qx0P621imj5B+HdoJkow0_jaGLVDRvdCDw3YRnK98g@mail.gmail.com>
Duy Nguyen <pclouds@gmail.com> writes:
Show 5 quoted lines
> 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.

It lets me as the repository owner to say "do not list them to make these discoverable"; letting the client side learn defeats the whole point of this mechanism.

For example, if you mirror-clone from either of my repositories from GitHub:

    git clone --mirror git://github.com/git/git/
    git clone --mirror git://github.com/gitster/git/

you will see stuff that does not belong to the project; objects that are only reachable from refs/pull/* are not something I approved to be placed in my repository; I as the project owner do not want to give these objects to a cloner as if they are part of my project.

The server side can hide refs/pull/ and refs/pull-request-tags/ so that clones (and ls-remote) will not see clutter, and nobody gets hurt.

These refs are there only to support GitHub "pull requests"; the advertisement of them to ls-remote and appearance of them in mirror clones are undesirable side effects of how GitHub happened to implement the feature. GitHub has its way to notify of these pull requests, and it makes these pull requests discoverable out of band without involving Git.

Ability to say "git fetch origin $SHA1" (or "git fetch origin pull/1") is the only thing lacking, in order to get rid of these clutter. The patches do the "get rid of clutter" part by letting you hide these refs from ls-remote and clone; allowing "fetch by tip SHA1" needs to come latter.

Another example. If you run ls-remote against the above two repositories, you will notice that the latter has tons more branches. The former are to publish only the primary integration branches, while the latter are to show individual topics.

I wish I didn't have to do this if I could.

We have periodical "What's cooking" postings that let interested parties learn topics out-of-band. If I can hide refs/heads/??/* from normal users' clones while actually keeping individual topics there at the same place, I do not have to push into two places.

Previous: Duy NguyenNext: Junio C Hamano
Message 5 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.