Re: [PATCH 4/4] builtin: use builtin.h for all builtin commands
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Nov 14, 2010, 18:55 UTC
- Message-ID
- <7v8w0v3fbq.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <AANLkTi=SbqD_3yYsRGCsmSxh-B8kpupnjq0XPGjMsxdK@mail.gmail.com>
Sverre Rabbelier <srabbelier@gmail.com> writes:
Show 11 quoted lines
> On Sun, Nov 14, 2010 at 15:44, Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote: >> diff --git a/wt-status.c b/wt-status.c >> index fc2438f..bfc97fb 100644 >> --- a/wt-status.c >> +++ b/wt-status.c >> @@ -1,4 +1,4 @@ >> -#include "cache.h" >> +#include "builtin.h" > > Doesn't this suggest wt-status.c should be moved to builtin? Or > something like that.
Why? builtin.h is to declare cmd_foo() and to be included by files that implement cmd_foo() (i.e. builtin/*.c) and the file that needs to see cmd_foo() declarations (i.e. git.c).
wt-status.c is about giving common service routines for status related commands in builtin/commit.c to implement both commit and status. Its services may have gained callers outside builtin/cocmmit.c, but that is not a good reason to export its services via builtin.h nor for it to include builtin.h.
This is a tangent but I think for the same reason the types and functions related to notes-rewrite currently in builtin.h do not belong there; they should be moved to notes.h or somewhere.