Thread (26 messages) 26 messages, 3 authors, 6d ago

Re: [PATCH 1/6] packfile: thread odb_source_packed through packed_object_info()

From: Justin Tobler <hidden>
Date: 2026-06-29 17:01:51

On 26/06/24 02:19PM, Patrick Steinhardt wrote:
Add an optional `struct odb_source_packed *source` parameter to
`packed_object_info()` and `packed_object_info_with_index_pos()`. This
parameter is unused at this point in time, but it will be used in a
follow-up commit so that we can record the source of a specific object.
Ok so `packed_object_info()` is responsible for populating `struct
object_info` from the provided packfile and object offset. By
additionally providing the object source, the ultimate goal is to store
the this information in `struct object_info` or some equivalent
structure.

At first, I wondered if it would make more sense for `struct packed_git`
to record the `struct odb_source_packed` it comes from, but maybe that
wouldn't be the best layer to handle this bookkeeping?
Note that callers in "odb/source-packed.c" pass the already-available
source, but all other callers pass `NULL` instead. This is fine though,
as we only care about populating this info when called via the packed
store.
Hmmm, is this because knowing the ODB source the object comes from is
only useful for callers from in "odb/source-packed.c"? Maybe this will
become a bit more clear to me in subsequent patches.

The patch itself is just wiring up `struct odb_source_packed` to the
above mentioned functions, but doesn't do anything yet with them. This
step looks trivially correct though.

-Justin
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help