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

Re: [PATCH 1/3] commit: avoid parsing non-commits in `lookup_commit_reference_gently()`

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 19, 2026, 17:35 UTC
Message-ID
<xmqq7bs87i1m.fsf@gitster.g>
In-Reply-To
<aZX4w8C5In9gEF33@denethor>
Justin Tobler <jltobler@gmail.com> writes:
Show 19 quoted lines
> On 26/02/16 04:38PM, Patrick Steinhardt wrote:
>> The function `lookup_commit_reference_gently()` can be used to look up a
>> committish by object ID. As such, the function knows to peel for example
>> tag objects so that we eventually end up with the commit.
>> 
>> The function is used quite a lot throughout our tree. One such user is
>> "shallow.c" via `assign_shallow_commits_to_refs()`. The intent of this
>> function is to figure out whether a shallow push is missing any objects
>> that are required to satisfy the ref updates, and if so, which of the
>> ref updates is missing objects.
>> 
>> This is done by painting the tree with `UNINTERESTING`. We start
>> painting by calling `refs_for_each_ref()` so that we can mark all
>> existing referenced objects as the boundary of objects that we already
>> have, and which are supposed to be fully connected. The reference tips
>> are then parsed via `lookup_commit_reference_gently()`, and the commit
>> commit is then marked as uninteresting.
>
> s/commit commit/commit/
Will locally amend (no need to reroll only to fix this).
Thanks for carefully reading.
Previous: Justin ToblerNext: Patrick Steinhardt
Message 4 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.