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.cThere 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.