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

Re: [PATCH 0/3] send-pack: avoid resending unchanged objects after rebasing

From
Marc Strapetz <marc.strapetz@syntevo.com>
Date
Oct 26, 2026, 21:23 UTC
Message-ID
<729930b3-1be6-4612-823c-55cb20d555b8@syntevo.com>
In-Reply-To
<xmqq1p9cs79b.fsf@gitster.g>
On 26/10/2026 18:26, Junio C Hamano wrote:
> This sounds like the exact problem push negotiation was designed to
> address.

Thanks for pointing this out. This series aims to optimize Git's default packing for forced non-fast-forward updates, without adding a negotiation phase. I should have explained that scope more clearly in the cover letter:

    `pack-objects` can resend unchanged objects from an advertised old
    branch tip even though `send-pack` already supplies that tip as an
    exclusion. This series improves default packing for forced updates
    by applying the existing sparse tree marking to selected old tips.
    It targets this inefficiency without the additional negotiation
    exchanges of `push.negotiate` or the broader recursive tree marking
    of `--objects-edge-aggressive`. Neither is enabled by default for
    ordinary pushes from non-shallow repositories. This series targets
    a narrower opportunity within that default behavior.
    A divergent old tip can lie outside the boundary reached by the
    ordinary revision walk. Passing it to `pack-objects` as
    `--inspect-have` lets us compare its root tree with the outgoing
    trees, pruning identical and receiver-only subtrees. The additional
    inspection is limited to forced non-fast-forward updates of
    existing branches with locally available old tips. Large blobs
    retained across a rebase are a particularly costly example of the
    redundant transfer this avoids.

I would also add the following section at the end to explain how this relates to the existing optimizations:

    `push.negotiate` discovers additional common commits through a
    separate fetch negotiation, potentially requiring multiple protocol
    round trips. This can reduce the pack when ref advertisement alone
    is insufficient, but adds latency even when the advertised tips
    already suffice. For small pushes that latency can outweigh the
    transfer savings. Even if negotiation achieves the same pack-size
    reduction, improving the default packing path avoids the need to
    pay that additional protocol cost.
    `--objects-edge-aggressive` already considers excluded tips beyond
    the ordinary walk's boundary, but recursively marks their trees.
    The decision to enable it automatically only for shallow pushes was
    made for performance reasons: the 2014 series [1] records a
    regression from 4.785 to 23.322 seconds with 22,400 refs [2], and
    keeps non-shallow repositories on `--objects-edge` for better
    performance in the general case [3]. This series instead limits
    inspection to the old tips of branches being forcibly updated and
    uses sparse comparison to prune identical and receiver-only
    subtrees.
    The additional inspection requires no protocol exchange or walk of
    the old tip's commit history. Ordinary fast-forward pushes keep
    their existing path, including those made with `--force`. No server
    or wire-protocol change is needed.
    [1]
https://lore.kernel.org/git/1419462340-769147-3-git-send-email-sandals@crustytoothpaste.net/T/
    [2]
https://github.com/git/git/commit/1684c1b219e02c91655ad929f752f4f864c72faf
    [3]
https://github.com/git/git/commit/2dacf26d0985521c0f30e535963a45257b63ea21
Previous: Junio C HamanoNext: Marc Strapetz
Message 6 of 7 in “send-pack: avoid resending unchanged objects after rebasing”
  1. 0/3 send-pack: avoid resending unchanged objects after rebasingMarc Strapetz via GitGitGadget, Oct 26, 2026
  2. 1/3 t5516: record redundant blobs after rebasingMarc Strapetz via GitGitGadget, Oct 26, 2026
  3. 2/3 pack-objects: inspect selected haves for shared objectsMarc Strapetz via GitGitGadget, Oct 26, 2026
  4. 3/3 send-pack: avoid resending unchanged blobs after rebasingMarc Strapetz via GitGitGadget, Oct 26, 2026
  5. Junio C HamanoOct 26, 2026
  6. Marc StrapetzOct 26, 2026
  7. Marc StrapetzNov 4, 2026

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.