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

Re: [RFC PATCH v2 2/2] headers: include dependent headers

From
René Scharfe <l.s.r@web.de>
Date
Sep 7, 2014, 06:41 UTC
Message-ID
<540BFE2C.6060409@web.de>
In-Reply-To
<1410049821-49861-2-git-send-email-davvid@gmail.com>
Am 07.09.2014 um 02:30 schrieb David Aguilar:
Show 9 quoted lines
> Add dependent headers so that including a header does not
> require including additional headers.
> 
> This makes it so that "gcc -c $header" succeeds for each header.
> 
> Signed-off-by: David Aguilar <davvid@gmail.com>
> ---
> Addresses René's note to not include strbuf.h when cache.h is already
> included.

Perhaps squash this in in order to catch two more cases and also avoid including git-compat-util.h if we already have cache.h:

diff --git a/builtin.h b/builtin.h
index df40fce..0419af3 100644
--- a/builtin.h
+++ b/builtin.h
@@ -1,7 +1,6 @@
 #ifndef BUILTIN_H
 #define BUILTIN_H
 
-#include "git-compat-util.h"
 #include "cache.h"
 #include "commit.h"
 
diff --git a/commit.h b/commit.h
index 1fe0731..dddc876 100644
--- a/commit.h
+++ b/commit.h
@@ -3,7 +3,6 @@
 
 #include "object.h"
 #include "tree.h"
-#include "strbuf.h"
 #include "decorate.h"
 #include "gpg-interface.h"
 #include "string-list.h"
diff --git a/dir.h b/dir.h
index 727160e..6b00001 100644
--- a/dir.h
+++ b/dir.h
@@ -3,7 +3,6 @@
 
 /* See Documentation/technical/api-directory-listing.txt */
 
-#include "strbuf.h"
 #include "pathspec.h"
 #include "cache.h"
 
diff --git a/khash.h b/khash.h
index 89f9579..fc8b1bf 100644
--- a/khash.h
+++ b/khash.h
@@ -26,7 +26,6 @@
 #ifndef __AC_KHASH_H
 #define __AC_KHASH_H
 
-#include "git-compat-util.h"
 #include "cache.h"
 
 #define AC_VERSION_KHASH_H "0.2.8"
Previous: David AguilarNext: Jonathan Nieder
Message 3 of 14 in “Makefile: add check-headers target”
  1. 1/2 Makefile: add check-headers targetDavid Aguilar, Sep 7, 2014
  2. 2/2 headers: include dependent headersDavid Aguilar, Sep 7, 2014
  3. René ScharfeSep 7, 2014
  4. Jonathan NiederSep 7, 2014
  5. Johannes SixtSep 7, 2014
  6. Jonathan NiederSep 7, 2014
  7. David AguilarSep 7, 2014
  8. Jonathan NiederSep 7, 2014
  9. Junio C HamanoSep 8, 2014
  10. Matthieu MoySep 8, 2014
  11. Junio C HamanoSep 8, 2014
  12. David AguilarSep 10, 2014
  13. Junio C HamanoSep 10, 2014
  14. Matthieu MoySep 10, 2014

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.