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

[PATCH 0/3] git-receive-pack(1): optimize `assign_shallow_commits_to_refs()`

From
Patrick Steinhardt <ps@pks.im>
Date
Feb 16, 2026, 15:38 UTC
Message-ID
<20260216-b4-pks-receive-pack-optimize-shallow-v1-0-e98886daff2b@pks.im>
Hi,

this patch series optimizes how git-receive-pack(1) handles shallow pushes in `assign_shallow_commits_to_refs()`. This covers some edge cases that we have hit in a production repository, where shallow pushes could take many minutes and allocate a ton of memory.

Thanks!
Patrick
---
Patrick Steinhardt (3):
      commit: avoid parsing non-commits in `lookup_commit_reference_gently()`
      commit: make `repo_parse_commit_no_graph()` more robust
      commit: use commit graph in `lookup_commit_reference_gently()`
 commit.c                        | 32 +++++++++++++++++++++++++++-----
 commit.h                        | 14 ++++++++++++--
 contrib/coccinelle/commit.cocci |  2 +-
 object.c                        | 23 ++++++++++++++++++-----
 object.h                        |  5 +++++
 5 files changed, 63 insertions(+), 13 deletions(-)

--- base-commit: 852829b3dd2fe4e7c7fc4d8badde644cf1b66c74 change-id: 20260216-b4-pks-receive-pack-optimize-shallow-0a6cc508549d

Next: Patrick Steinhardt
Message 1 of 9 in “git-receive-pack(1): optimize `assign_shallow_commits_to_refs()`”
  1. 0/3 git-receive-pack(1): optimize `assign_shallow_commits_to_refs()`Patrick Steinhardt, Feb 16, 2026
  2. 1/3 commit: avoid parsing non-commits in `lookup_commit_reference_gently()`Patrick Steinhardt, Feb 16, 2026
  3. Justin ToblerFeb 18, 2026
  4. Junio C HamanoFeb 19, 2026
  5. 2/3 commit: make `repo_parse_commit_no_graph()` more robustPatrick Steinhardt, Feb 16, 2026
  6. Justin ToblerFeb 18, 2026
  7. Patrick SteinhardtFeb 19, 2026
  8. 3/3 commit: use commit graph in `lookup_commit_reference_gently()`Patrick Steinhardt, Feb 16, 2026
  9. Justin ToblerFeb 18, 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.