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

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

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 19, 2013, 00:37 UTC
Message-ID
<1358555826-11883-1-git-send-email-gitster@pobox.com>

This is an early preview of reducing the network cost while talking with a repository with tons of refs, most of which are of use by very narrow audiences (e.g. refs under Gerrit's refs/changes/ are useful only for people who are interested in the changes under review). As long as these narrow audiences have a way to learn the names of refs or objects pointed at by the refs out-of-band, it is not necessary to advertise these refs.

On the server end, you tell upload-pack that some refs do not have to be advertised with the uploadPack.hiderefs multi-valued configuration variable:

	[uploadPack]
		hiderefs = refs/changes

The changes necessary on the client side to allow fetching objects at the tip of a ref in hidden hierarchies are much more involved and not part of this early preview, but the end user UI is expected to be like these:

	$ git fetch $there refs/changes/72/41672/1
	$ git fetch $there 9598d59cdc098c5d9094d68024475e2430343182

That is, you ask for a refname as usual even though it is not part of ls-remote response, or you ask for the commit object that is at the tip of whatever hidden ref you are interested in.

Junio C Hamano (2):
  upload-pack: share more code
  upload-pack: allow hiding ref hiearchies
 t/t5512-ls-remote.sh |  9 ++++++
 upload-pack.c        | 86 ++++++++++++++++++++++++++++++++++++++++++----------
 2 files changed, 79 insertions(+), 16 deletions(-)
-- 
1.8.1.1.454.g48d39c0
Next: Junio C Hamano
Message 1 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.