public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Jonathan Tan <jonathantanmy@google•com>
To: Elijah Newren <newren@gmail•com>
Cc: Jonathan Tan <jonathantanmy@google•com>,
	Nik Garza <nikolas@applied•co>,
	git@vger•kernel.org
Subject: Re: bug report - BUG: builtin/pack-objects.c:4310: should_include_obj should only be called on existing objects
Date: Mon, 28 Apr 2025 12:23:20 -0700	[thread overview]
Message-ID: <20250428192320.3595509-1-jonathantanmy@google.com> (raw)
In-Reply-To: <CABPp-BFiLURYmELQ1omyPJ+49cVxk1h4rPYj42zMwGUW-NUUGQ@mail.gmail.com>

Elijah Newren <newren@gmail•com> writes:
> Cc'ing the author of that commit for his comments.

I took a look. I'm not sure why I made the assumption that
should_include_obj() would only ever be called on objects in the repo
- in process_tree() in list-objects.c, the case of a missing object is
handled only after should_include_obj() is called. Looking back at the
earliest mention of this on the list [1] I don't see any clues either.

In any case, the fix is probably to change it so that
should_include_obj() returns 0 if the object is absent.

Having said that, I couldn't come up with a test that exercises this
failure mode. Nik, do you have a minimal repo that reproduces this
error? If yes, if you could contribute a test in the form of the 'after
fetching descendants of non-promisor commits, gc works' test in t5616,
that would help prevent regressions in the future.

[1] https://lore.kernel.org/git/fb2c202591b466eea33b4585e47b70e9086603bb.1729549127.git.jonathantanmy@google.com/

  reply	other threads:[~2025-04-28 19:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-25 18:14 bug report - BUG: builtin/pack-objects.c:4310: should_include_obj should only be called on existing objects Nik Garza
2025-04-25 18:30 ` Elijah Newren
2025-04-28 19:23   ` Jonathan Tan [this message]
2025-04-28 22:55     ` Nik Garza
2025-10-17 15:57       ` Sam Estep

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=20250428192320.3595509-1-jonathantanmy@google.com \
    --to=jonathantanmy@google$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=newren@gmail$(echo .)com \
    --cc=nikolas@applied$(echo .)co \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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