Re: [PATCH 4/4] builtin: use builtin.h for all builtin commands
From: Junio C Hamano <hidden>
Date: 2016-06-15 22:50:02
Sverre Rabbelier [off-list ref] writes:
On Sun, Nov 14, 2010 at 15:44, Ævar Arnfjörð Bjarmason [off-list ref] wrote:quoted
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.