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

Why isn't builtin.h used by all builtin/*.c files?

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Sep 1, 2010, 14:17 UTC
Message-ID
<AANLkTinHtvHt0q=dK9KHtCX6JzymB5dx1NuaAZN_uu2R@mail.gmail.com>

I'm working on gettextizing the 'mainporcelain common' commands now, and I ran into this:

    $ perl -MArray::Diff -E 'chomp(my @hb = qx[ack -l builtin.h *.c]);
my @c = glob "*.c"; my $d = Array::Diff->diff( \@c, \@hb ); say for
@{$d->deleted}'
    fetch-pack.c
    hash-object.c
    index-pack.c
    merge-index.c
    merge-recursive.c
    merge-tree.c
    mktag.c
    pack-redundant.c
    pack-refs.c
    patch-id.c
    receive-pack.c
    remote-ext.c
    remote-fd.c
    remote.c
    reset.c
    send-pack.c
    skew.c
    unpack-file.c
    var.c
There seems to be no reason not to do this:
    --- a/builtin/clone.c
    +++ b/builtin/clone.c
    @@ -10,3 +10,3 @@
    -#include "cache.h"
    +#include "builtin.h"
     #include "parse-options.h"
    @@ -18,3 +18,2 @@
     #include "transport.h"
    -#include "strbuf.h"
     #include "dir.h"

builtin.h even includes the cmd_clone() prototype. I'm only asking since clone.c was added *after* builtin.h, so this seems like an omission.

Anyway, I'll convert these to builtin.h where appropriate as part of the series unless someone can find a good reason not to.

Next: Stephen Boyd
Message 1 of 5 in “Why isn't builtin.h used by all builtin/*.c files?”
  1. Ævar Arnfjörð BjarmasonSep 1, 2010
  2. Stephen BoydSep 1, 2010
  3. Junio C HamanoSep 1, 2010
  4. builtin: use builtin.h for all builtin/ commandsÆvar Arnfjörð Bjarmason, Sep 1, 2010
  5. Junio C HamanoSep 1, 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.