Subject: Re: [GSoC][PATCH 1/5] builtin/pack-refs: factor out core logic into a helper

From: Patrick Steinhardt <[email-masked]>
Date: Wed, 3 Sep 2025 08:00:30 +0200

On Tue, Sep 02, 2025 at 10:25:44PM -0700, Junio C Hamano wrote:
> Patrick Steinhardt <[email-masked]> writes:
> 
> >>  builtin/pack-refs.c | 31 ++++++++++++++++++++-----------
> >>  pack-refs.h         | 22 ++++++++++++++++++++++
> >>  2 files changed, 42 insertions(+), 11 deletions(-)
> >>  create mode 100644 pack-refs.h
> >
> > Shouldn't that header live in "builtin/pack-refs.h"? Makes it way more
> > obvious that it exposes functions from "builtin/pack-refs.c".
> 
> There shouldn't be any *.h files in builtin/.  since the top-level
> is where the library-ish reusable things live, so that they can
> eventually be used by more than one *.c files in builtin/ and also
> by other *.c files outside builtin.

Hm, okay. I still find it puzzling if the header file for
"builtin/pack-refs.c" sits in "pack-refs.h" as it makes it very hard to
connect these two. How would you reconcile that? By moving the shared
logic into (non-"builtin/) "pack-refs.c"?

Patrick