Git development
 help / color / mirror / Atom feed
From: Patrick Steinhardt <ps@pks.im>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, Daniel Zoghalchali <daniel@latchkey.dev>
Subject: Re: [PATCH] pack-objects: handle missing objects when excluding promisor objects
Date: Wed, 28 Oct 2026 12:50:51 +0100	[thread overview]
Message-ID: <auHhm1NAL_dRnp1c@pks.im> (raw)
In-Reply-To: <xmqq7bj2e0o1.fsf@gitster.g>

On Wed, Oct 28, 2026 at 12:37:02AM -0700, Junio C Hamano wrote:
> Patrick Steinhardt <ps@pks.im> writes:
> 
> > 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?

Yeah. This is fine in practice because we always unset
`fetch_if_missing` with "--exclude-promisor-objects[-best-effort]", but
adding the flag explicitly for clarity feels sensible to me.

Patrick

      reply	other threads:[~2026-10-28 11:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-27  7:00 [PATCH] pack-objects: handle missing objects when excluding promisor objects Patrick Steinhardt
2026-10-27 16:02 ` [PATCH] pack-objects: handle missing objects kkkjwhen " Mark C. Chu-Carroll
2026-10-28  7:26   ` Patrick Steinhardt
2026-10-28  7:37 ` [PATCH] pack-objects: handle missing objects when " Junio C Hamano
2026-10-28 11:50   ` Patrick Steinhardt [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=auHhm1NAL_dRnp1c@pks.im \
    --to=ps@pks.im \
    --cc=daniel@latchkey.dev \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox