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

Re: [PATCH] pack-objects: handle missing objects when excluding promisor objects

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 28, 2026, 07:37 UTC
Message-ID
<xmqq7bj2e0o1.fsf@gitster.g>
In-Reply-To
<20261027-b4-pks-pack-objects-repack-links-with-missing-objects-v1-1-f50f90651274@pks.im>
Patrick Steinhardt <ps@pks.im> writes:
Show 16 quoted lines
> this patch fixes the issue reported in [1]. Thanks!
>  builtin/pack-objects.c   |  3 ++-
>  t/t5616-partial-clone.sh | 55 ++++++++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 57 insertions(+), 1 deletion(-)
>
> diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
> index ca3a891dfbc..d6caed16d97 100644
> --- a/builtin/pack-objects.c
> +++ b/builtin/pack-objects.c
> @@ -5085,7 +5085,8 @@ static int is_not_in_promisor_pack_obj(struct object *obj, void *data UNUSED)
>  	};
>  
>  	if (odb_read_object_info_extended(the_repository->objects, &obj->oid, &info, 0))
> -		BUG("should_include_obj should only be called on existing objects");
> +		/* Missing; assume it is a promisor object */
> +		return 0;

It is not entirely the fault of this patch, but the code relies on .fetch_if_missing being set to 0 elsewhere. While that is not wrong per se, shouldn't this call to odb_read_object_info_extended() pass the OBJECT_INFO_SKIP_FETCH_OBJECT bit explicitly for clarity?

>  	return source_info.source->type != ODB_SOURCE_PACKED || !source_info.u.packed.pack->pack_promisor;
>  }
Thanks.
Previous: Patrick SteinhardtNext: Patrick Steinhardt
Message 4 of 5 in “pack-objects: handle missing objects when excluding promisor objects”
  1. pack-objects: handle missing objects when excluding promisor objectsPatrick Steinhardt, Oct 27, 2026
  2. Mark C. Chu-CarrollOct 27, 2026
  3. Patrick SteinhardtOct 28, 2026
  4. Junio C HamanoOct 28, 2026
  5. Patrick SteinhardtOct 28, 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.