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

Re: [RFC PATCH] push: perform negotiation before sending packfile

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 18, 2021, 21:33 UTC
Message-ID
<xmqqlfbldprt.fsf@gitster.g>
In-Reply-To
<xmqqy2fldsy4.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> writes:
Show 12 quoted lines
>  - With this approach, we can cut down the initial ref advertisement
>    from the receiving end to the minimum.  The protocol with
>    negotiation could work correctly without receiving end
>    advertising no refs, but I suspect that it would be very common
>    in a publishing repository (not a shared everybody-pushes-into
>    repository) that the tip of the target repository is known by the
>    pusher, and it may help such a case to know where the ref being
>    updated with this push originally points at.  But even in such a
>    case, additional negotiation may help---the target branch may
>    have not advanced, but may of the side branches the pusher have
>    merged into the commit being pushed to the target branch may
>    already be known by the receiver.

Addendum. The original push protocol where the pusher learns all the tips of refs the receiver has cuts down the resulting packdata transfer in such a "side branches already known by the receiver, only the fact that they were merged to the target branch is new" case. The pain only starts happening when we try to reduce the advertisement made by the receiver.

As the "negotiation" is more targetted for the ref that actually is being pushed (as opposed to the blanket "here is everything I have" that can get unreasonably big), I think the idea to introduce the same common ancestor discovery that happens on the "fetch" side, and to share the code with the "fetch" side that has been battle tested, is a great one.

Previous: Junio C HamanoNext: Jonathan Tan
Message 4 of 9 in “push: perform negotiation before sending packfile”
  1. push: perform negotiation before sending packfileJonathan Tan, Feb 18, 2021
  2. Junio C HamanoFeb 18, 2021
  3. Junio C HamanoFeb 18, 2021
  4. Junio C HamanoFeb 18, 2021
  5. Jonathan TanFeb 19, 2021
  6. Junio C HamanoFeb 20, 2021
  7. Jonathan TanFeb 22, 2021
  8. Junio C HamanoFeb 22, 2021
  9. Jonathan TanFeb 18, 2021

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.