From: Junio C Hamano Date: Wed, 14 Aug 2013 17:04:23 GMT Subject: Re: [RFC PATCH] repack: rewrite the shell script in C. Message-ID: <7vli44td9k.fsf@alter.siamese.dyndns.org> In-Reply-To: <1376497661-30714-1-git-send-email-stefanbeller@googlemail.com> Stefan Beller writes: > diff --git a/builtin/repack.c b/builtin/repack.c > new file mode 100644 > index 0000000..d39c34e > --- /dev/null > +++ b/builtin/repack.c > @@ -0,0 +1,410 @@ > +/* > + * The shell version was written by Linus Torvalds (2005) and many others. > + * This is a translation into C by Stefan Beller (2013) > + */ > + > +#include "builtin.h" > +#include "cache.h" > +#include "dir.h" > +#include "parse-options.h" > +#include "run-command.h" > +#include "sigchain.h" > +#include "strbuf.h" > +#include "string-list.h" > + > +#include > +#include > +#include > +#include If you need these system-includes here, it means that our own platform-portability layer "git-compat-util.h" is broken. On various systems, often some system header files are missing, need a few feature macros to be defined before including, and/or need to be included in certain order, etc., and "git-compat-util.h" is meant to hide all such details from the programmers. I do not think the above four needs to be included in *.c, as long as you include either builtin.h or cache.h, both of which includes the compat-util header.