Re: [PATCH 2/6] packfile: rename lifecycle functions
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Nov 24, 2026, 23:47 UTC
- Message-ID
- <xmqqfqwphjw2.fsf@gitster.g>
- In-Reply-To
- <20261120-pks-packfile-global-statistics-v1-2-19beb83b145f@pks.im>
Patrick Steinhardt <ps@pks.im> writes:
> Ideally we'd modernize all of that, but that would lead to a huge amount > of churn. Instead, let's improve the subsystem one step at a time and > rename lifecycle-related functions to match modern best practices.
Scoping the rename to lifecycle functions makes this much easier to review, and add_packed_git() to packfile_from_idx() is especially welcome because the function never actually added the pack to a store. All callers of the seven renamed symbols across the repository look consistently updated with behavior preserved.
Show 7 quoted lines
> @@ -217,32 +217,33 @@ int for_each_object_in_pack(struct packed_git *p, > #define PACKDIR_FILE_GARBAGE 4 > extern void (*report_garbage)(unsigned seen_bits, const char *path); > > +uint32_t get_pack_fanout(struct packed_git *p, uint32_t value); > + > +struct object_database;
The forward declaration for struct object_database moved here was already unused in packfile.h, since odb.h is included at the top of the header and no prototype here takes that type. Moving it around can probably be skipped, or it could be dropped separately.
Other than that, the step is done very nicely.
Thanks.