git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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.

Previous: Ævar Arnfjörð BjarmasonNext: Jonathan Nieder
Message 20 of 25 in “[PULL] ab/i18n-prereqs, prerequisites for ab/i18n”
  1. 0/4 [PULL] ab/i18n-prereqs, prerequisites for ab/i18nÆvar Arnfjörð Bjarmason, Nov 14, 2010
  2. 1/4 Makefile: move "Platform specific tweaks" above LIB_{H,OBJS}Ævar Arnfjörð Bjarmason, Nov 14, 2010
  3. Jonathan NiederNov 14, 2010
  4. Ævar Arnfjörð BjarmasonNov 14, 2010
  5. Jonathan NiederNov 14, 2010
  6. Junio C HamanoNov 15, 2010
  7. Jonathan NiederNov 15, 2010
  8. Ævar Arnfjörð BjarmasonNov 15, 2010
  9. Junio C HamanoNov 14, 2010
  10. Jonathan NiederNov 14, 2010
  11. Junio C HamanoNov 14, 2010
  12. 2/4 t7004-tag.sh: re-arrange git tag comment for clarityÆvar Arnfjörð Bjarmason, Nov 14, 2010
  13. Jonathan NiederNov 14, 2010
  14. Ævar Arnfjörð BjarmasonNov 14, 2010
  15. 3/4 tests: use test_cmp instead of piping to diff(1)Ævar Arnfjörð Bjarmason, Nov 14, 2010
  16. Jonathan NiederNov 14, 2010
  17. 4/4 builtin: use builtin.h for all builtin commandsÆvar Arnfjörð Bjarmason, Nov 14, 2010
  18. Sverre RabbelierNov 14, 2010
  19. Ævar Arnfjörð BjarmasonNov 14, 2010
  20. Junio C HamanoNov 14, 2010
  21. Jonathan NiederNov 14, 2010
  22. Junio C HamanoNov 17, 2010
  23. Ævar Arnfjörð BjarmasonNov 17, 2010
  24. Jonathan NiederNov 17, 2010
  25. Jonathan NiederNov 14, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.