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

Re: most annoying thing in git-push

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 23, 2009, 06:08 UTC
Message-ID
<7vd48va3dd.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20090622192147.GE5743@altlinux.org>
"Alexey I. Froloff" <raorn@altlinux.org> writes:
> Is is possible to add such functionality to git-push, so it will
> push tags that point at objects that were uploaded to the remote
> repository?

I think it is doable, because the protocol is for the receiver to first advertise all its existing refs, which means that the sender can learn what is missing by first enumerating the tags it has, subtracting what the receiver has, and then computing the ones that are missing from the receiver and are reachable from the commits it is pushing, before the sender has to respond which refs it wants to update with what object and then send the packfile to transfer necessary objects. You do not need to change the protocol, nor what the receiving side does, to implement it. You only need to update what the push side does.

It however is entirely a different matter if it is a sensible thing to do.

Often, a fetch is made from a public distribution point, which by definition has only branches and tags that are meant for public consumption. It makes sense to auto-follow tags by default.

On the other hand, a push is almost always made from a private working repository to a public distribution point, in order to update the latter with only refs and objects meant for public consumption. A developer working in such a private working repository will use tags that are not meant for public consumption while developing, and pushing all tags that are reachable from the commits that are being pushed out to the public distribution point is not necessarily desirable, as it will push out many tags that are only private to the working repository.

It certainly is not a sensible default behaviour, even though it might be handy as an option for special cases.

Previous: ZoltánFüzesiNext: Jakub Narebski
Message 3 of 5 in “most annoying thing in git-push”
  1. Alexey I. FroloffJun 22, 2009
  2. ZoltánFüzesiJun 23, 2009
  3. Junio C HamanoJun 23, 2009
  4. Jakub NarebskiJun 23, 2009
  5. Alexey I. FroloffJun 23, 2009

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.