Re: [PATCH 02/16] packfile: move packed source into "odb/" subsystem
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Jun 9, 2026, 07:27 UTC
- Message-ID
- <aifAbwJCPe4Wwklk@pks.im>
- In-Reply-To
- <CAOLa=ZQ8K53yyopSOp4_Gc-Gpq6ULA0xW6gH5OCWdWNHEyRysw@mail.gmail.com>
On Mon, Jun 08, 2026 at 08:09:06AM -0700, Karthik Nayak wrote:
Show 26 quoted lines
> Patrick Steinhardt <ps@pks.im> writes:
> > diff --git a/odb/source-packed.h b/odb/source-packed.h
> > new file mode 100644
> > index 0000000000..c17068a4f1
> > --- /dev/null
> > +++ b/odb/source-packed.h
> > @@ -0,0 +1,80 @@
> > +#ifndef ODB_SOURCE_PACKED_H
> > +#define ODB_SOURCE_PACKED_H
> > +
> > +#include "odb/source.h"
> > +#include "strmap.h"
> > +
> > +struct packfile_list {
> > + struct packfile_list_entry *head, *tail;
> > +};
> > +
> > +struct packfile_list_entry {
> > + struct packfile_list_entry *next;
> > + struct packed_git *pack;
> > +};
> > +
>
> So this is exposed, because outside of the odb, we also use packfiles in
> the transport layer. That makes me wonder if these two structures are
> better kept alonsigde `struct packed_git` in 'packfile.h'.Yeah, this is quite awkward indeed as the struct and function declarations are now split up across "packfile.h" and "odb/source-packed.h". The reason though is that there's a cyclic dependency between the two headers, so we have to move the code around.
Arguably though, the better fix would be to move it into a standalone file "packfile-list.{c,h}". Will adapt the code accordingly.
Patrick