{"thread":{"id":"37509","subject":"[PATCH v3 2/2] headers: include dependent headers","startedAt":"2014-09-07T09:36:57Z","lastAt":"2014-09-07T21:57:56Z","messageCount":5,"participants":["David Aguilar","René Scharfe","Ramsay Jones"],"isPatch":true,"patchVersion":3,"patchTotal":2},"messages":[{"id":"249008","messageId":"1410082617-59230-1-git-send-email-davvid@gmail.com","threadId":"37509","inReplyTo":null,"subject":"[PATCH v3 2/2] headers: include dependent headers","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2014-09-07T09:36:57Z","receivedAt":"2014-09-07T09:36:57Z","isPatch":true,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"Add dependent headers so that including a header does not\nrequire including additional headers.\n\nThis makes it so that \"gcc -c $header\" succeeds for each header.\n\nHelped-by: René Scharfe <l.s.r@web.de>\nSigned-off-by: David Aguilar <davvid@gmail.com>\n---\nReplacement patch with René's suggestions squashed in.\n\n archive.h                | 1 +\n argv-array.h             | 2 ++\n attr.h                   | 2 ++\n branch.h                 | 2 ++\n builtin.h                | 1 -\n cache-tree.h             | 1 +\n cache.h                  | 1 -\n color.h                  | 3 ++-\n column.h                 | 2 ++\n commit.h                 | 2 +-\n compat/bswap.h           | 7 +++++++\n compat/precompose_utf8.h | 8 +++-----\n convert.h                | 3 +++\n credential.h             | 1 +\n csum-file.h              | 2 ++\n delta.h                  | 2 ++\n diff.h                   | 2 +-\n diffcore.h               | 2 ++\n dir.h                    | 3 ++-\n ewah/ewok.h              | 2 ++\n ewah/ewok_rlw.h          | 2 ++\n exec_cmd.h               | 2 ++\n fsck.h                   | 2 ++\n gpg-interface.h          | 2 ++\n graph.h                  | 2 ++\n hashmap.h                | 2 ++\n help.h                   | 2 ++\n khash.h                  | 2 ++\n kwset.h                  | 2 ++\n line-log.h               | 1 +\n list-objects.h           | 2 ++\n ll-merge.h               | 2 ++\n mailmap.h                | 3 +++\n merge-recursive.h        | 2 ++\n notes-cache.h            | 1 +\n notes-merge.h            | 3 +++\n notes-utils.h            | 1 +\n notes.h                  | 1 +\n object.h                 | 2 ++\n pack-bitmap.h            | 2 ++\n pack-objects.h           | 2 ++\n pack-revindex.h          | 2 ++\n parse-options.h          | 2 ++\n patch-ids.h              | 3 +++\n pathspec.h               | 2 ++\n progress.h               | 2 ++\n quote.h                  | 3 ++-\n reachable.h              | 2 ++\n reflog-walk.h            | 1 +\n refs.h                   | 4 ++++\n remote.h                 | 1 +\n resolve-undo.h           | 2 ++\n send-pack.h              | 4 ++++\n sequencer.h              | 3 +++\n sha1-lookup.h            | 2 ++\n shortlog.h               | 2 ++\n sideband.h               | 2 ++\n strbuf.h                 | 2 ++\n submodule.h              | 6 ++++--\n tag.h                    | 1 +\n tree-walk.h              | 2 ++\n tree.h                   | 1 +\n unicode_width.h          | 3 +++\n unpack-trees.h           | 2 ++\n url.h                    | 2 ++\n urlmatch.h               | 2 ++\n utf8.c                   | 7 -------\n utf8.h                   | 9 +++++++++\n vcs-svn/fast_export.h    | 5 +++--\n vcs-svn/repo_tree.h      | 3 ++-\n vcs-svn/svndiff.h        | 5 +++--\n wt-status.h              | 1 +\n xdiff/xdiffi.h           | 2 ++\n xdiff/xemit.h            | 1 +\n xdiff/xprepare.h         | 2 ++\n xdiff/xutils.h           | 2 ++\n 76 files changed, 158 insertions(+), 26 deletions(-)\n\ndiff --git a/archive.h b/archive.h\nindex 4a791e1..b2ca5bf 100644\n--- a/archive.h\n+++ b/archive.h\n@@ -1,6 +1,7 @@\n #ifndef ARCHIVE_H\n #define ARCHIVE_H\n \n+#include \"cache.h\"\n #include \"pathspec.h\"\n \n struct archiver_args {\ndiff --git a/argv-array.h b/argv-array.h\nindex c65e6e8..7d877af 100644\n--- a/argv-array.h\n+++ b/argv-array.h\n@@ -1,6 +1,8 @@\n #ifndef ARGV_ARRAY_H\n #define ARGV_ARRAY_H\n \n+#include \"git-compat-util.h\"\n+\n extern const char *empty_argv[];\n \n struct argv_array {\ndiff --git a/attr.h b/attr.h\nindex 8b08d33..34e63f8 100644\n--- a/attr.h\n+++ b/attr.h\n@@ -1,6 +1,8 @@\n #ifndef ATTR_H\n #define ATTR_H\n \n+#include \"cache.h\"\n+\n /* An attribute is a pointer to this opaque structure */\n struct git_attr;\n \ndiff --git a/branch.h b/branch.h\nindex 64173ab..d5fdcc6 100644\n--- a/branch.h\n+++ b/branch.h\n@@ -3,6 +3,8 @@\n \n /* Functions for acting on the information about branches. */\n \n+#include \"cache.h\"\n+\n /*\n  * Creates a new branch, where head is the branch currently checked\n  * out, name is the new branch name, start_name is the name of the\ndiff --git a/builtin.h b/builtin.h\nindex 5d91f31..07c9328 100644\n--- a/builtin.h\n+++ b/builtin.h\n@@ -1,7 +1,6 @@\n #ifndef BUILTIN_H\n #define BUILTIN_H\n \n-#include \"git-compat-util.h\"\n #include \"strbuf.h\"\n #include \"cache.h\"\n #include \"commit.h\"\ndiff --git a/cache-tree.h b/cache-tree.h\nindex b47ccec..30b0775 100644\n--- a/cache-tree.h\n+++ b/cache-tree.h\n@@ -3,6 +3,7 @@\n \n #include \"tree.h\"\n #include \"tree-walk.h\"\n+#include \"cache.h\"\n \n struct cache_tree;\n struct cache_tree_sub {\ndiff --git a/cache.h b/cache.h\nindex 4d5b76c..8b827d7 100644\n--- a/cache.h\n+++ b/cache.h\n@@ -1,7 +1,6 @@\n #ifndef CACHE_H\n #define CACHE_H\n \n-#include \"git-compat-util.h\"\n #include \"strbuf.h\"\n #include \"hashmap.h\"\n #include \"advice.h\"\ndiff --git a/color.h b/color.h\nindex 9a8495b..6b50a0f 100644\n--- a/color.h\n+++ b/color.h\n@@ -1,7 +1,8 @@\n #ifndef COLOR_H\n #define COLOR_H\n \n-struct strbuf;\n+#include \"git-compat-util.h\"\n+#include \"strbuf.h\"\n \n /*  2 + (2 * num_attrs) + 8 + 1 + 8 + 'm' + NUL */\n /* \"\\033[1;2;4;5;7;38;5;2xx;48;5;2xxm\\0\" */\ndiff --git a/column.h b/column.h\nindex 0a61917..5d094b4 100644\n--- a/column.h\n+++ b/column.h\n@@ -1,6 +1,8 @@\n #ifndef COLUMN_H\n #define COLUMN_H\n \n+#include \"string-list.h\"\n+\n #define COL_LAYOUT_MASK   0x000F\n #define COL_ENABLE_MASK   0x0030   /* always, never or auto */\n #define COL_PARSEOPT      0x0040   /* --column is given from cmdline */\ndiff --git a/commit.h b/commit.h\nindex aa8c3ca..dddc876 100644\n--- a/commit.h\n+++ b/commit.h\n@@ -3,10 +3,10 @@\n \n #include \"object.h\"\n #include \"tree.h\"\n-#include \"strbuf.h\"\n #include \"decorate.h\"\n #include \"gpg-interface.h\"\n #include \"string-list.h\"\n+#include \"cache.h\"\n \n struct commit_list {\n \tstruct commit *item;\ndiff --git a/compat/bswap.h b/compat/bswap.h\nindex f6fd9a6..0c164be 100644\n--- a/compat/bswap.h\n+++ b/compat/bswap.h\n@@ -1,3 +1,8 @@\n+#ifndef COMPAT_BSWAP_H\n+#define COMPAT_BSWAP_H\n+\n+#include \"git-compat-util.h\"\n+\n /*\n  * Let's make sure we always have a sane definition for ntohl()/htonl().\n  * Some libraries define those as a function call, just to perform byte\n@@ -173,3 +178,5 @@ static inline uint64_t git_bswap64(uint64_t x)\n \t*((unsigned char *)(p) + 3) = __v >>  0; } while (0)\n \n #endif\n+\n+#endif\ndiff --git a/compat/precompose_utf8.h b/compat/precompose_utf8.h\nindex 3b73585..34d1051 100644\n--- a/compat/precompose_utf8.h\n+++ b/compat/precompose_utf8.h\n@@ -1,9 +1,8 @@\n #ifndef PRECOMPOSE_UNICODE_H\n-#include <sys/stat.h>\n-#include <sys/types.h>\n-#include <dirent.h>\n-#include <iconv.h>\n+#define  PRECOMPOSE_UNICODE_H\n \n+#include \"git-compat-util.h\"\n+#include <iconv.h>\n \n typedef struct dirent_prec_psx {\n \tino_t d_ino;            /* Posix */\n@@ -41,5 +40,4 @@ int precompose_utf8_closedir(PREC_DIR *dirp);\n #define DIR PREC_DIR\n #endif /* PRECOMPOSE_UNICODE_C */\n \n-#define  PRECOMPOSE_UNICODE_H\n #endif /* PRECOMPOSE_UNICODE_H */\ndiff --git a/convert.h b/convert.h\nindex 0c2143c..bb3266b 100644\n--- a/convert.h\n+++ b/convert.h\n@@ -4,6 +4,9 @@\n #ifndef CONVERT_H\n #define CONVERT_H\n \n+#include \"git-compat-util.h\"\n+#include \"strbuf.h\"\n+\n enum safe_crlf {\n \tSAFE_CRLF_FALSE = 0,\n \tSAFE_CRLF_FAIL = 1,\ndiff --git a/credential.h b/credential.h\nindex 0c3e85e..cfa87f1 100644\n--- a/credential.h\n+++ b/credential.h\n@@ -1,6 +1,7 @@\n #ifndef CREDENTIAL_H\n #define CREDENTIAL_H\n \n+#include \"git-compat-util.h\"\n #include \"string-list.h\"\n \n struct credential {\ndiff --git a/csum-file.h b/csum-file.h\nindex bb543d5..9e29e35 100644\n--- a/csum-file.h\n+++ b/csum-file.h\n@@ -1,6 +1,8 @@\n #ifndef CSUM_FILE_H\n #define CSUM_FILE_H\n \n+#include \"cache.h\"\n+\n struct progress;\n \n /* A SHA1-protected file */\ndiff --git a/delta.h b/delta.h\nindex 9b67531..668e163 100644\n--- a/delta.h\n+++ b/delta.h\n@@ -1,6 +1,8 @@\n #ifndef DELTA_H\n #define DELTA_H\n \n+#include \"git-compat-util.h\"\n+\n /* opaque object for delta index */\n struct delta_index;\n \ndiff --git a/diff.h b/diff.h\nindex b4a624d..27f7696 100644\n--- a/diff.h\n+++ b/diff.h\n@@ -6,11 +6,11 @@\n \n #include \"tree-walk.h\"\n #include \"pathspec.h\"\n+#include \"strbuf.h\"\n \n struct rev_info;\n struct diff_options;\n struct diff_queue_struct;\n-struct strbuf;\n struct diff_filespec;\n struct userdiff_driver;\n struct sha1_array;\ndiff --git a/diffcore.h b/diffcore.h\nindex c876dac..1f3290c 100644\n--- a/diffcore.h\n+++ b/diffcore.h\n@@ -4,6 +4,8 @@\n #ifndef DIFFCORE_H\n #define DIFFCORE_H\n \n+#include \"diff.h\"\n+\n /* This header file is internal between diff.c and its diff transformers\n  * (e.g. diffcore-rename, diffcore-pickaxe).  Never include this header\n  * in anything else.\ndiff --git a/dir.h b/dir.h\nindex 6c45e9d..6b00001 100644\n--- a/dir.h\n+++ b/dir.h\n@@ -3,7 +3,8 @@\n \n /* See Documentation/technical/api-directory-listing.txt */\n \n-#include \"strbuf.h\"\n+#include \"pathspec.h\"\n+#include \"cache.h\"\n \n struct dir_entry {\n \tunsigned int len;\ndiff --git a/ewah/ewok.h b/ewah/ewok.h\nindex f6ad190..7812863 100644\n--- a/ewah/ewok.h\n+++ b/ewah/ewok.h\n@@ -20,6 +20,8 @@\n #ifndef __EWOK_BITMAP_H__\n #define __EWOK_BITMAP_H__\n \n+#include \"git-compat-util.h\"\n+\n #ifndef ewah_malloc\n #\tdefine ewah_malloc xmalloc\n #endif\ndiff --git a/ewah/ewok_rlw.h b/ewah/ewok_rlw.h\nindex 63efdf9..b34dfa1 100644\n--- a/ewah/ewok_rlw.h\n+++ b/ewah/ewok_rlw.h\n@@ -20,6 +20,8 @@\n #ifndef __EWOK_RLW_H__\n #define __EWOK_RLW_H__\n \n+#include \"ewah/ewok.h\"\n+\n #define RLW_RUNNING_BITS (sizeof(eword_t) * 4)\n #define RLW_LITERAL_BITS (sizeof(eword_t) * 8 - 1 - RLW_RUNNING_BITS)\n \ndiff --git a/exec_cmd.h b/exec_cmd.h\nindex e4c9702..daa26e2 100644\n--- a/exec_cmd.h\n+++ b/exec_cmd.h\n@@ -1,6 +1,8 @@\n #ifndef GIT_EXEC_CMD_H\n #define GIT_EXEC_CMD_H\n \n+#include \"git-compat-util.h\"\n+\n extern void git_set_argv_exec_path(const char *exec_path);\n extern const char *git_extract_argv0_path(const char *path);\n extern const char *git_exec_path(void);\ndiff --git a/fsck.h b/fsck.h\nindex 1e4f527..99b2802 100644\n--- a/fsck.h\n+++ b/fsck.h\n@@ -1,6 +1,8 @@\n #ifndef GIT_FSCK_H\n #define GIT_FSCK_H\n \n+#include \"object.h\"\n+\n #define FSCK_ERROR 1\n #define FSCK_WARN 2\n \ndiff --git a/gpg-interface.h b/gpg-interface.h\nindex 37c23da..f42b706 100644\n--- a/gpg-interface.h\n+++ b/gpg-interface.h\n@@ -1,6 +1,8 @@\n #ifndef GPG_INTERFACE_H\n #define GPG_INTERFACE_H\n \n+#include \"strbuf.h\"\n+\n struct signature_check {\n \tchar *payload;\n \tchar *gpg_output;\ndiff --git a/graph.h b/graph.h\nindex 0be62bd..17e6a11 100644\n--- a/graph.h\n+++ b/graph.h\n@@ -1,6 +1,8 @@\n #ifndef GRAPH_H\n #define GRAPH_H\n \n+#include \"revision.h\"\n+\n /* A graph is a pointer to this opaque structure */\n struct git_graph;\n \ndiff --git a/hashmap.h b/hashmap.h\nindex ab7958a..8605fae 100644\n--- a/hashmap.h\n+++ b/hashmap.h\n@@ -1,6 +1,8 @@\n #ifndef HASHMAP_H\n #define HASHMAP_H\n \n+#include \"git-compat-util.h\"\n+\n /*\n  * Generic implementation of hash-based key-value mappings.\n  * See Documentation/technical/api-hashmap.txt.\ndiff --git a/help.h b/help.h\nindex b21d7c9..a3bf882 100644\n--- a/help.h\n+++ b/help.h\n@@ -1,6 +1,8 @@\n #ifndef HELP_H\n #define HELP_H\n \n+#include \"git-compat-util.h\"\n+\n struct cmdnames {\n \tint alloc;\n \tint cnt;\ndiff --git a/khash.h b/khash.h\nindex 06c7906..fc8b1bf 100644\n--- a/khash.h\n+++ b/khash.h\n@@ -26,6 +26,8 @@\n #ifndef __AC_KHASH_H\n #define __AC_KHASH_H\n \n+#include \"cache.h\"\n+\n #define AC_VERSION_KHASH_H \"0.2.8\"\n \n typedef uint32_t khint32_t;\ndiff --git a/kwset.h b/kwset.h\nindex a21b2ea..2acc585 100644\n--- a/kwset.h\n+++ b/kwset.h\n@@ -25,6 +25,8 @@\n    The author may be reached (Email) at the address mike@ai.mit.edu,\n    or (US mail) as Mike Haertel c/o Free Software Foundation. */\n \n+#include \"git-compat-util.h\"\n+\n struct kwsmatch\n {\n   int index;\t\t\t/* Index number of matching keyword. */\ndiff --git a/line-log.h b/line-log.h\nindex a9212d8..e1d47e0 100644\n--- a/line-log.h\n+++ b/line-log.h\n@@ -2,6 +2,7 @@\n #define LINE_LOG_H\n \n #include \"diffcore.h\"\n+#include \"string-list.h\"\n \n struct rev_info;\n struct commit;\ndiff --git a/list-objects.h b/list-objects.h\nindex 136a1da..8810db6 100644\n--- a/list-objects.h\n+++ b/list-objects.h\n@@ -1,6 +1,8 @@\n #ifndef LIST_OBJECTS_H\n #define LIST_OBJECTS_H\n \n+#include \"revision.h\"\n+\n typedef void (*show_commit_fn)(struct commit *, void *);\n typedef void (*show_object_fn)(struct object *, const struct name_path *, const char *, void *);\n void traverse_commit_list(struct rev_info *, show_commit_fn, show_object_fn, void *);\ndiff --git a/ll-merge.h b/ll-merge.h\nindex 244a31f..b72b199 100644\n--- a/ll-merge.h\n+++ b/ll-merge.h\n@@ -5,6 +5,8 @@\n #ifndef LL_MERGE_H\n #define LL_MERGE_H\n \n+#include \"xdiff/xdiff.h\"\n+\n struct ll_merge_options {\n \tunsigned virtual_ancestor : 1;\n \tunsigned variant : 2;\t/* favor ours, favor theirs, or union merge */\ndiff --git a/mailmap.h b/mailmap.h\nindex ed7c93b..27ac3c7 100644\n--- a/mailmap.h\n+++ b/mailmap.h\n@@ -1,6 +1,9 @@\n #ifndef MAILMAP_H\n #define MAILMAP_H\n \n+#include \"git-compat-util.h\"\n+#include \"string-list.h\"\n+\n int read_mailmap(struct string_list *map, char **repo_abbrev);\n void clear_mailmap(struct string_list *map);\n \ndiff --git a/merge-recursive.h b/merge-recursive.h\nindex 9e090a3..05500b3 100644\n--- a/merge-recursive.h\n+++ b/merge-recursive.h\n@@ -1,7 +1,9 @@\n #ifndef MERGE_RECURSIVE_H\n #define MERGE_RECURSIVE_H\n \n+#include \"strbuf.h\"\n #include \"string-list.h\"\n+#include \"commit.h\"\n \n struct merge_options {\n \tconst char *ancestor;\ndiff --git a/notes-cache.h b/notes-cache.h\nindex 356f88f..4ecd767 100644\n--- a/notes-cache.h\n+++ b/notes-cache.h\n@@ -1,6 +1,7 @@\n #ifndef NOTES_CACHE_H\n #define NOTES_CACHE_H\n \n+#include \"git-compat-util.h\"\n #include \"notes.h\"\n \n struct notes_cache {\ndiff --git a/notes-merge.h b/notes-merge.h\nindex 1d01f6a..73d961d 100644\n--- a/notes-merge.h\n+++ b/notes-merge.h\n@@ -1,6 +1,9 @@\n #ifndef NOTES_MERGE_H\n #define NOTES_MERGE_H\n \n+#include \"notes.h\"\n+#include \"commit.h\"\n+\n #define NOTES_MERGE_WORKTREE \"NOTES_MERGE_WORKTREE\"\n \n enum notes_merge_verbosity {\ndiff --git a/notes-utils.h b/notes-utils.h\nindex 890ddb3..eaac967 100644\n--- a/notes-utils.h\n+++ b/notes-utils.h\n@@ -2,6 +2,7 @@\n #define NOTES_UTILS_H\n \n #include \"notes.h\"\n+#include \"commit.h\"\n \n /*\n  * Create new notes commit from the given notes tree\ndiff --git a/notes.h b/notes.h\nindex 2a3f923..12318a4 100644\n--- a/notes.h\n+++ b/notes.h\n@@ -1,6 +1,7 @@\n #ifndef NOTES_H\n #define NOTES_H\n \n+#include \"strbuf.h\"\n #include \"string-list.h\"\n \n /*\ndiff --git a/object.h b/object.h\nindex 5e8d8ee..e61b290 100644\n--- a/object.h\n+++ b/object.h\n@@ -1,6 +1,8 @@\n #ifndef OBJECT_H\n #define OBJECT_H\n \n+#include \"cache.h\"\n+\n struct object_list {\n \tstruct object *item;\n \tstruct object_list *next;\ndiff --git a/pack-bitmap.h b/pack-bitmap.h\nindex 8b7f4e9..945ff30 100644\n--- a/pack-bitmap.h\n+++ b/pack-bitmap.h\n@@ -1,9 +1,11 @@\n #ifndef PACK_BITMAP_H\n #define PACK_BITMAP_H\n \n+#include \"git-compat-util.h\"\n #include \"ewah/ewok.h\"\n #include \"khash.h\"\n #include \"pack-objects.h\"\n+#include \"revision.h\"\n \n struct bitmap_disk_entry {\n \tuint32_t object_pos;\ndiff --git a/pack-objects.h b/pack-objects.h\nindex d1b98b3..2c28bea 100644\n--- a/pack-objects.h\n+++ b/pack-objects.h\n@@ -1,6 +1,8 @@\n #ifndef PACK_OBJECTS_H\n #define PACK_OBJECTS_H\n \n+#include \"pack.h\"\n+\n struct object_entry {\n \tstruct pack_idx_entry idx;\n \tunsigned long size;\t/* uncompressed size */\ndiff --git a/pack-revindex.h b/pack-revindex.h\nindex d737f98..4e574b3 100644\n--- a/pack-revindex.h\n+++ b/pack-revindex.h\n@@ -1,6 +1,8 @@\n #ifndef PACK_REVINDEX_H\n #define PACK_REVINDEX_H\n \n+#include \"git-compat-util.h\"\n+\n struct revindex_entry {\n \toff_t offset;\n \tunsigned int nr;\ndiff --git a/parse-options.h b/parse-options.h\nindex 7940bc7..933a1b7 100644\n--- a/parse-options.h\n+++ b/parse-options.h\n@@ -1,6 +1,8 @@\n #ifndef PARSE_OPTIONS_H\n #define PARSE_OPTIONS_H\n \n+#include \"git-compat-util.h\"\n+\n enum parse_opt_type {\n \t/* special types */\n \tOPTION_END,\ndiff --git a/patch-ids.h b/patch-ids.h\nindex c8c7ca1..016eb2d 100644\n--- a/patch-ids.h\n+++ b/patch-ids.h\n@@ -1,6 +1,9 @@\n #ifndef PATCH_IDS_H\n #define PATCH_IDS_H\n \n+#include \"commit.h\"\n+#include \"diff.h\"\n+\n struct patch_id {\n \tunsigned char patch_id[20];\n \tchar seen;\ndiff --git a/pathspec.h b/pathspec.h\nindex 0c11262..c92fafc 100644\n--- a/pathspec.h\n+++ b/pathspec.h\n@@ -1,6 +1,8 @@\n #ifndef PATHSPEC_H\n #define PATHSPEC_H\n \n+#include \"git-compat-util.h\"\n+\n /* Pathspec magic */\n #define PATHSPEC_FROMTOP\t(1<<0)\n #define PATHSPEC_MAXDEPTH\t(1<<1)\ndiff --git a/progress.h b/progress.h\nindex 611e4c4..4c78a2c 100644\n--- a/progress.h\n+++ b/progress.h\n@@ -1,6 +1,8 @@\n #ifndef PROGRESS_H\n #define PROGRESS_H\n \n+#include \"git-compat-util.h\"\n+\n struct progress;\n \n void display_throughput(struct progress *progress, off_t total);\ndiff --git a/quote.h b/quote.h\nindex 71dcc3a..37f857b 100644\n--- a/quote.h\n+++ b/quote.h\n@@ -1,7 +1,8 @@\n #ifndef QUOTE_H\n #define QUOTE_H\n \n-struct strbuf;\n+#include \"git-compat-util.h\"\n+#include \"strbuf.h\"\n \n /* Help to copy the thing properly quoted for the shell safety.\n  * any single quote is replaced with '\\'', any exclamation point\ndiff --git a/reachable.h b/reachable.h\nindex 5d082ad..5536382 100644\n--- a/reachable.h\n+++ b/reachable.h\n@@ -1,6 +1,8 @@\n #ifndef REACHEABLE_H\n #define REACHEABLE_H\n \n+#include \"revision.h\"\n+\n struct progress;\n extern void mark_reachable_objects(struct rev_info *revs, int mark_reflog, struct progress *);\n \ndiff --git a/reflog-walk.h b/reflog-walk.h\nindex 50265f5..d5378b9 100644\n--- a/reflog-walk.h\n+++ b/reflog-walk.h\n@@ -2,6 +2,7 @@\n #define REFLOG_WALK_H\n \n #include \"cache.h\"\n+#include \"commit.h\"\n \n struct reflog_walk_info;\n \ndiff --git a/refs.h b/refs.h\nindex ec46acd..5c43232 100644\n--- a/refs.h\n+++ b/refs.h\n@@ -1,6 +1,10 @@\n #ifndef REFS_H\n #define REFS_H\n \n+#include \"git-compat-util.h\"\n+#include \"strbuf.h\"\n+#include \"string-list.h\"\n+\n struct ref_lock {\n \tchar *ref_name;\n \tchar *orig_ref_name;\ndiff --git a/remote.h b/remote.h\nindex 8b62efd..24bcbd7 100644\n--- a/remote.h\n+++ b/remote.h\n@@ -3,6 +3,7 @@\n \n #include \"parse-options.h\"\n #include \"hashmap.h\"\n+#include \"strbuf.h\"\n \n enum {\n \tREMOTE_CONFIG,\ndiff --git a/resolve-undo.h b/resolve-undo.h\nindex 4630645..815050d 100644\n--- a/resolve-undo.h\n+++ b/resolve-undo.h\n@@ -1,6 +1,8 @@\n #ifndef RESOLVE_UNDO_H\n #define RESOLVE_UNDO_H\n \n+#include \"cache.h\"\n+\n struct resolve_undo_info {\n \tunsigned int mode[3];\n \tunsigned char sha1[3][20];\ndiff --git a/send-pack.h b/send-pack.h\nindex 8e84392..f0c463a 100644\n--- a/send-pack.h\n+++ b/send-pack.h\n@@ -1,6 +1,10 @@\n #ifndef SEND_PACK_H\n #define SEND_PACK_H\n \n+#include \"git-compat-util.h\"\n+#include \"run-command.h\"\n+#include \"remote.h\"\n+\n struct send_pack_args {\n \tunsigned verbose:1,\n \t\tquiet:1,\ndiff --git a/sequencer.h b/sequencer.h\nindex db43e9c..c817247 100644\n--- a/sequencer.h\n+++ b/sequencer.h\n@@ -1,6 +1,9 @@\n #ifndef SEQUENCER_H\n #define SEQUENCER_H\n \n+#include \"git-compat-util.h\"\n+#include \"strbuf.h\"\n+\n #define SEQ_DIR\t\t\"sequencer\"\n #define SEQ_HEAD_FILE\t\"sequencer/head\"\n #define SEQ_TODO_FILE\t\"sequencer/todo\"\ndiff --git a/sha1-lookup.h b/sha1-lookup.h\nindex 20af285..f375596 100644\n--- a/sha1-lookup.h\n+++ b/sha1-lookup.h\n@@ -1,6 +1,8 @@\n #ifndef SHA1_LOOKUP_H\n #define SHA1_LOOKUP_H\n \n+#include \"git-compat-util.h\"\n+\n typedef const unsigned char *sha1_access_fn(size_t index, void *table);\n \n extern int sha1_pos(const unsigned char *sha1,\ndiff --git a/shortlog.h b/shortlog.h\nindex de4f86f..e5949e7 100644\n--- a/shortlog.h\n+++ b/shortlog.h\n@@ -1,6 +1,8 @@\n #ifndef SHORTLOG_H\n #define SHORTLOG_H\n \n+#include \"git-compat-util.h\"\n+#include \"commit.h\"\n #include \"string-list.h\"\n \n struct shortlog {\ndiff --git a/sideband.h b/sideband.h\nindex e46bed0..411aa51 100644\n--- a/sideband.h\n+++ b/sideband.h\n@@ -1,6 +1,8 @@\n #ifndef SIDEBAND_H\n #define SIDEBAND_H\n \n+#include \"git-compat-util.h\"\n+\n #define SIDEBAND_PROTOCOL_ERROR -2\n #define SIDEBAND_REMOTE_ERROR -1\n \ndiff --git a/strbuf.h b/strbuf.h\nindex 7bdc1da..c3ea9a2 100644\n--- a/strbuf.h\n+++ b/strbuf.h\n@@ -1,6 +1,8 @@\n #ifndef STRBUF_H\n #define STRBUF_H\n \n+#include \"git-compat-util.h\"\n+\n /* See Documentation/technical/api-strbuf.txt */\n \n extern char strbuf_slopbuf[];\ndiff --git a/submodule.h b/submodule.h\nindex 7beec48..52bb673 100644\n--- a/submodule.h\n+++ b/submodule.h\n@@ -1,8 +1,10 @@\n #ifndef SUBMODULE_H\n #define SUBMODULE_H\n \n-struct diff_options;\n-struct argv_array;\n+#include \"git-compat-util.h\"\n+#include \"diff.h\"\n+#include \"argv-array.h\"\n+#include \"string-list.h\"\n \n enum {\n \tRECURSE_SUBMODULES_ON_DEMAND = -1,\ndiff --git a/tag.h b/tag.h\nindex bc8a1e4..68b0334 100644\n--- a/tag.h\n+++ b/tag.h\n@@ -1,6 +1,7 @@\n #ifndef TAG_H\n #define TAG_H\n \n+#include \"git-compat-util.h\"\n #include \"object.h\"\n \n extern const char *tag_type;\ndiff --git a/tree-walk.h b/tree-walk.h\nindex ae7fb3a..0818126 100644\n--- a/tree-walk.h\n+++ b/tree-walk.h\n@@ -1,6 +1,8 @@\n #ifndef TREE_WALK_H\n #define TREE_WALK_H\n \n+#include \"strbuf.h\"\n+\n struct name_entry {\n \tconst unsigned char *sha1;\n \tconst char *path;\ndiff --git a/tree.h b/tree.h\nindex d84ac63..9565406 100644\n--- a/tree.h\n+++ b/tree.h\n@@ -2,6 +2,7 @@\n #define TREE_H\n \n #include \"object.h\"\n+#include \"pathspec.h\"\n \n extern const char *tree_type;\n \ndiff --git a/unicode_width.h b/unicode_width.h\nindex 47cdd23..b35bdc4 100644\n--- a/unicode_width.h\n+++ b/unicode_width.h\n@@ -1,3 +1,6 @@\n+#include \"git-compat-util.h\"\n+#include \"utf8.h\"\n+\n static const struct interval zero_width[] = {\n { 0x0300, 0x036F },\n { 0x0483, 0x0489 },\ndiff --git a/unpack-trees.h b/unpack-trees.h\nindex 36a73a6..e4792ec 100644\n--- a/unpack-trees.h\n+++ b/unpack-trees.h\n@@ -1,7 +1,9 @@\n #ifndef UNPACK_TREES_H\n #define UNPACK_TREES_H\n \n+#include \"cache.h\"\n #include \"string-list.h\"\n+#include \"tree-walk.h\"\n \n #define MAX_UNPACK_TREES 8\n \ndiff --git a/url.h b/url.h\nindex abdaf6f..f4a23c3 100644\n--- a/url.h\n+++ b/url.h\n@@ -1,6 +1,8 @@\n #ifndef URL_H\n #define URL_H\n \n+#include \"strbuf.h\"\n+\n extern int is_url(const char *url);\n extern int is_urlschemechar(int first_flag, int ch);\n extern char *url_decode(const char *url);\ndiff --git a/urlmatch.h b/urlmatch.h\nindex b461dfd..9f7c781 100644\n--- a/urlmatch.h\n+++ b/urlmatch.h\n@@ -1,4 +1,6 @@\n #ifndef URL_MATCH_H\n+\n+#include \"git-compat-util.h\"\n #include \"string-list.h\"\n \n struct url_info {\ndiff --git a/utf8.c b/utf8.c\nindex b30790d..fb9f299 100644\n--- a/utf8.c\n+++ b/utf8.c\n@@ -2,13 +2,6 @@\n #include \"strbuf.h\"\n #include \"utf8.h\"\n \n-/* This code is originally from http://www.cl.cam.ac.uk/~mgk25/ucs/ */\n-\n-struct interval {\n-\tucs_char_t first;\n-\tucs_char_t last;\n-};\n-\n size_t display_mode_esc_sequence_len(const char *s)\n {\n \tconst char *p = s;\ndiff --git a/utf8.h b/utf8.h\nindex 65d0e42..af855c5 100644\n--- a/utf8.h\n+++ b/utf8.h\n@@ -1,8 +1,17 @@\n #ifndef GIT_UTF8_H\n #define GIT_UTF8_H\n \n+#include \"strbuf.h\"\n+\n typedef unsigned int ucs_char_t;  /* assuming 32bit int */\n \n+/* This code is originally from http://www.cl.cam.ac.uk/~mgk25/ucs/ */\n+\n+struct interval {\n+\tucs_char_t first;\n+\tucs_char_t last;\n+};\n+\n size_t display_mode_esc_sequence_len(const char *s);\n int utf8_width(const char **start, size_t *remainder_p);\n int utf8_strnwidth(const char *string, int len, int skip_ansi);\ndiff --git a/vcs-svn/fast_export.h b/vcs-svn/fast_export.h\nindex c8b5adb..7fd5364 100644\n--- a/vcs-svn/fast_export.h\n+++ b/vcs-svn/fast_export.h\n@@ -1,8 +1,9 @@\n #ifndef FAST_EXPORT_H_\n #define FAST_EXPORT_H_\n \n-struct strbuf;\n-struct line_buffer;\n+#include \"git-compat-util.h\"\n+#include \"strbuf.h\"\n+#include \"vcs-svn/line_buffer.h\"\n \n void fast_export_init(int fd);\n void fast_export_deinit(void);\ndiff --git a/vcs-svn/repo_tree.h b/vcs-svn/repo_tree.h\nindex 889c6a3..3a946f7 100644\n--- a/vcs-svn/repo_tree.h\n+++ b/vcs-svn/repo_tree.h\n@@ -1,7 +1,8 @@\n #ifndef REPO_TREE_H_\n #define REPO_TREE_H_\n \n-struct strbuf;\n+#include \"git-compat-util.h\"\n+#include \"strbuf.h\"\n \n #define REPO_MODE_DIR 0040000\n #define REPO_MODE_BLB 0100644\ndiff --git a/vcs-svn/svndiff.h b/vcs-svn/svndiff.h\nindex 74eb464..d0cbd51 100644\n--- a/vcs-svn/svndiff.h\n+++ b/vcs-svn/svndiff.h\n@@ -1,8 +1,9 @@\n #ifndef SVNDIFF_H_\n #define SVNDIFF_H_\n \n-struct line_buffer;\n-struct sliding_view;\n+#include \"git-compat-util.h\"\n+#include \"vcs-svn/line_buffer.h\"\n+#include \"vcs-svn/sliding_window.h\"\n \n extern int svndiff0_apply(struct line_buffer *delta, off_t delta_len,\n \t\tstruct sliding_view *preimage, FILE *postimage);\ndiff --git a/wt-status.h b/wt-status.h\nindex 283a9fe..38f930a 100644\n--- a/wt-status.h\n+++ b/wt-status.h\n@@ -4,6 +4,7 @@\n #include <stdio.h>\n #include \"string-list.h\"\n #include \"color.h\"\n+#include \"pathspec.h\"\n \n enum color_wt_status {\n \tWT_STATUS_HEADER = 0,\ndiff --git a/xdiff/xdiffi.h b/xdiff/xdiffi.h\nindex 8b81206..d1f0e1d 100644\n--- a/xdiff/xdiffi.h\n+++ b/xdiff/xdiffi.h\n@@ -23,6 +23,8 @@\n #if !defined(XDIFFI_H)\n #define XDIFFI_H\n \n+#include \"xdiff.h\"\n+#include \"xtypes.h\"\n \n typedef struct s_diffdata {\n \tlong nrec;\ndiff --git a/xdiff/xemit.h b/xdiff/xemit.h\nindex d297107..ad719ad 100644\n--- a/xdiff/xemit.h\n+++ b/xdiff/xemit.h\n@@ -23,6 +23,7 @@\n #if !defined(XEMIT_H)\n #define XEMIT_H\n \n+#include \"xdiffi.h\"\n \n typedef int (*emit_func_t)(xdfenv_t *xe, xdchange_t *xscr, xdemitcb_t *ecb,\n \t\t\t   xdemitconf_t const *xecfg);\ndiff --git a/xdiff/xprepare.h b/xdiff/xprepare.h\nindex 8fb06a5..a2958cf 100644\n--- a/xdiff/xprepare.h\n+++ b/xdiff/xprepare.h\n@@ -23,6 +23,8 @@\n #if !defined(XPREPARE_H)\n #define XPREPARE_H\n \n+#include \"xdiff.h\"\n+#include \"xtypes.h\"\n \n \n int xdl_prepare_env(mmfile_t *mf1, mmfile_t *mf2, xpparam_t const *xpp,\ndiff --git a/xdiff/xutils.h b/xdiff/xutils.h\nindex 4646ce5..a55237b 100644\n--- a/xdiff/xutils.h\n+++ b/xdiff/xutils.h\n@@ -23,6 +23,8 @@\n #if !defined(XUTILS_H)\n #define XUTILS_H\n \n+#include \"xdiff.h\"\n+#include \"xtypes.h\"\n \n \n long xdl_bogosqrt(long n);\n-- \n2.1.0.62.g724b830\n"},{"id":"249009","messageId":"540C350F.3080906@web.de","threadId":"37509","inReplyTo":"1410082617-59230-1-git-send-email-davvid@gmail.com","subject":"Re: [PATCH v3 2/2] headers: include dependent headers","fromName":"René Scharfe","fromEmail":"l.s.r@web.de","sentAt":"2014-09-07T10:35:59Z","receivedAt":"2014-09-07T10:35:59Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Am 07.09.2014 um 11:36 schrieb David Aguilar:\n> Add dependent headers so that including a header does not\n> require including additional headers.\n>\n> This makes it so that \"gcc -c $header\" succeeds for each header.\n\n> diff --git a/cache.h b/cache.h\n> index 4d5b76c..8b827d7 100644\n> --- a/cache.h\n> +++ b/cache.h\n> @@ -1,7 +1,6 @@\n>   #ifndef CACHE_H\n>   #define CACHE_H\n>\n> -#include \"git-compat-util.h\"\n>   #include \"strbuf.h\"\n>   #include \"hashmap.h\"\n>   #include \"advice.h\"\n\nOh, that's a new change and worth mentioning in the commit message.\n\n> diff --git a/color.h b/color.h\n> index 9a8495b..6b50a0f 100644\n> --- a/color.h\n> +++ b/color.h\n> @@ -1,7 +1,8 @@\n>   #ifndef COLOR_H\n>   #define COLOR_H\n>\n> -struct strbuf;\n> +#include \"git-compat-util.h\"\n> +#include \"strbuf.h\"\n>\n>   /*  2 + (2 * num_attrs) + 8 + 1 + 8 + 'm' + NUL */\n>   /* \"\\033[1;2;4;5;7;38;5;2xx;48;5;2xxm\\0\" */\n\nI didn't notice this one the first time around.  Isn't the forward\ndeclaration of struct strbuf enough?\n\n> diff --git a/diff.h b/diff.h\n> index b4a624d..27f7696 100644\n> --- a/diff.h\n> +++ b/diff.h\n> @@ -6,11 +6,11 @@\n>\n>   #include \"tree-walk.h\"\n>   #include \"pathspec.h\"\n> +#include \"strbuf.h\"\n>\n>   struct rev_info;\n>   struct diff_options;\n>   struct diff_queue_struct;\n> -struct strbuf;\n>   struct diff_filespec;\n>   struct userdiff_driver;\n>   struct sha1_array;\n\nSame here.\n\n> diff --git a/quote.h b/quote.h\n> index 71dcc3a..37f857b 100644\n> --- a/quote.h\n> +++ b/quote.h\n> @@ -1,7 +1,8 @@\n>   #ifndef QUOTE_H\n>   #define QUOTE_H\n>\n> -struct strbuf;\n> +#include \"git-compat-util.h\"\n> +#include \"strbuf.h\"\n>\n>   /* Help to copy the thing properly quoted for the shell safety.\n>    * any single quote is replaced with '\\'', any exclamation point\n\nAnd here.\n\n > diff --git a/submodule.h b/submodule.h\n > index 7beec48..52bb673 100644\n > --- a/submodule.h\n > +++ b/submodule.h\n > @@ -1,8 +1,10 @@\n >   #ifndef SUBMODULE_H\n >   #define SUBMODULE_H\n >\n > -struct diff_options;\n > -struct argv_array;\n > +#include \"git-compat-util.h\"\n > +#include \"diff.h\"\n > +#include \"argv-array.h\"\n > +#include \"string-list.h\"\n >\n >   enum {\n >   \tRECURSE_SUBMODULES_ON_DEMAND = -1,\n\nSimilarly here with structs diff_options and argv_array.\n\n> diff --git a/utf8.c b/utf8.c\n> index b30790d..fb9f299 100644\n> --- a/utf8.c\n> +++ b/utf8.c\n> @@ -2,13 +2,6 @@\n>   #include \"strbuf.h\"\n>   #include \"utf8.h\"\n>\n> -/* This code is originally from http://www.cl.cam.ac.uk/~mgk25/ucs/ */\n> -\n> -struct interval {\n> -\tucs_char_t first;\n> -\tucs_char_t last;\n> -};\n> -\n>   size_t display_mode_esc_sequence_len(const char *s)\n>   {\n>   \tconst char *p = s;\n> diff --git a/utf8.h b/utf8.h\n> index 65d0e42..af855c5 100644\n> --- a/utf8.h\n> +++ b/utf8.h\n> @@ -1,8 +1,17 @@\n>   #ifndef GIT_UTF8_H\n>   #define GIT_UTF8_H\n>\n> +#include \"strbuf.h\"\n> +\n>   typedef unsigned int ucs_char_t;  /* assuming 32bit int */\n>\n> +/* This code is originally from http://www.cl.cam.ac.uk/~mgk25/ucs/ */\n> +\n> +struct interval {\n> +\tucs_char_t first;\n> +\tucs_char_t last;\n> +};\n> +\n>   size_t display_mode_esc_sequence_len(const char *s);\n>   int utf8_width(const char **start, size_t *remainder_p);\n>   int utf8_strnwidth(const char *string, int len, int skip_ansi);\n\nThe move of struct interval was mentioned in the comment section of\nthe first patch.  Perhaps include a note in the commit message?\n\n> diff --git a/vcs-svn/fast_export.h b/vcs-svn/fast_export.h\n> index c8b5adb..7fd5364 100644\n> --- a/vcs-svn/fast_export.h\n> +++ b/vcs-svn/fast_export.h\n> @@ -1,8 +1,9 @@\n>   #ifndef FAST_EXPORT_H_\n>   #define FAST_EXPORT_H_\n>\n> -struct strbuf;\n> -struct line_buffer;\n> +#include \"git-compat-util.h\"\n> +#include \"strbuf.h\"\n> +#include \"vcs-svn/line_buffer.h\"\n>\n>   void fast_export_init(int fd);\n>   void fast_export_deinit(void);\n\nstruct strbuf forward declaration vs. including strbuf.h again.\n\n> diff --git a/vcs-svn/repo_tree.h b/vcs-svn/repo_tree.h\n> index 889c6a3..3a946f7 100644\n> --- a/vcs-svn/repo_tree.h\n> +++ b/vcs-svn/repo_tree.h\n> @@ -1,7 +1,8 @@\n>   #ifndef REPO_TREE_H_\n>   #define REPO_TREE_H_\n>\n> -struct strbuf;\n> +#include \"git-compat-util.h\"\n> +#include \"strbuf.h\"\n>\n>   #define REPO_MODE_DIR 0040000\n>   #define REPO_MODE_BLB 0100644\n\nAnd again.\n\n> diff --git a/vcs-svn/svndiff.h b/vcs-svn/svndiff.h\n> index 74eb464..d0cbd51 100644\n> --- a/vcs-svn/svndiff.h\n> +++ b/vcs-svn/svndiff.h\n> @@ -1,8 +1,9 @@\n>   #ifndef SVNDIFF_H_\n>   #define SVNDIFF_H_\n>\n> -struct line_buffer;\n> -struct sliding_view;\n> +#include \"git-compat-util.h\"\n> +#include \"vcs-svn/line_buffer.h\"\n> +#include \"vcs-svn/sliding_window.h\"\n>\n>   extern int svndiff0_apply(struct line_buffer *delta, off_t delta_len,\n>   \t\tstruct sliding_view *preimage, FILE *postimage);\n\nSimilar issue here with different structs.\n"},{"id":"249010","messageId":"540C3AEC.7080908@ramsay1.demon.co.uk","threadId":"37509","inReplyTo":"540C350F.3080906@web.de","subject":"Re: [PATCH v3 2/2] headers: include dependent headers","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2014-09-07T11:01:00Z","receivedAt":"2014-09-07T11:01:00Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"On 07/09/14 11:35, René Scharfe wrote:\n> Am 07.09.2014 um 11:36 schrieb David Aguilar:\n>> Add dependent headers so that including a header does not\n>> require including additional headers.\n>>\n>> This makes it so that \"gcc -c $header\" succeeds for each header.\n> \n>> diff --git a/cache.h b/cache.h\n>> index 4d5b76c..8b827d7 100644\n>> --- a/cache.h\n>> +++ b/cache.h\n>> @@ -1,7 +1,6 @@\n>>   #ifndef CACHE_H\n>>   #define CACHE_H\n>>\n>> -#include \"git-compat-util.h\"\n>>   #include \"strbuf.h\"\n>>   #include \"hashmap.h\"\n>>   #include \"advice.h\"\n> \n> Oh, that's a new change and worth mentioning in the commit message.\n\nHmm, does this not break git? Unless you also change each '.c' file which\nincludes cache.h to also include git-compat-util.h first, then I suspect\n(if nothing else) file I/O may be broken. (see _FILE_OFFSET_BITS).\n\nAlso, see Documentation/CodingGuidelines (lines 331-333).\n\nATB,\nRamsay Jones\n"},{"id":"249018","messageId":"20140907203715.GB61326@gmail.com","threadId":"37509","inReplyTo":"540C3AEC.7080908@ramsay1.demon.co.uk","subject":"Re: [PATCH v3 2/2] headers: include dependent headers","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2014-09-07T20:37:16Z","receivedAt":"2014-09-07T20:37:16Z","isPatch":true,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"On Sun, Sep 07, 2014 at 12:01:00PM +0100, Ramsay Jones wrote:\n> On 07/09/14 11:35, René Scharfe wrote:\n> > Am 07.09.2014 um 11:36 schrieb David Aguilar:\n> >> Add dependent headers so that including a header does not\n> >> require including additional headers.\n> >>\n> >> This makes it so that \"gcc -c $header\" succeeds for each header.\n> > \n> >> diff --git a/cache.h b/cache.h\n> >> index 4d5b76c..8b827d7 100644\n> >> --- a/cache.h\n> >> +++ b/cache.h\n> >> @@ -1,7 +1,6 @@\n> >>   #ifndef CACHE_H\n> >>   #define CACHE_H\n> >>\n> >> -#include \"git-compat-util.h\"\n> >>   #include \"strbuf.h\"\n> >>   #include \"hashmap.h\"\n> >>   #include \"advice.h\"\n> > \n> > Oh, that's a new change and worth mentioning in the commit message.\n> \n> Hmm, does this not break git? Unless you also change each '.c' file which\n> includes cache.h to also include git-compat-util.h first, then I suspect\n> (if nothing else) file I/O may be broken. (see _FILE_OFFSET_BITS).\n> \n> Also, see Documentation/CodingGuidelines (lines 331-333).\n\nThis one should be okay because hashmap.h includes git-compat-util.h.\n\nJonathan will be re-rolling so I'll definitely read and test the\npatches when they're ready.  They'll probably be a more focused,\nsurgical change then this version.\n\ncheers,\n-- \nDavid\n"},{"id":"249019","messageId":"540CD4E4.7060600@ramsay1.demon.co.uk","threadId":"37509","inReplyTo":"20140907203715.GB61326@gmail.com","subject":"Re: [PATCH v3 2/2] headers: include dependent headers","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2014-09-07T21:57:56Z","receivedAt":"2014-09-07T21:57:56Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"On 07/09/14 21:37, David Aguilar wrote:\n> On Sun, Sep 07, 2014 at 12:01:00PM +0100, Ramsay Jones wrote:\n>> On 07/09/14 11:35, René Scharfe wrote:\n>>> Am 07.09.2014 um 11:36 schrieb David Aguilar:\n>>>> Add dependent headers so that including a header does not\n>>>> require including additional headers.\n>>>>\n>>>> This makes it so that \"gcc -c $header\" succeeds for each header.\n>>>\n>>>> diff --git a/cache.h b/cache.h\n>>>> index 4d5b76c..8b827d7 100644\n>>>> --- a/cache.h\n>>>> +++ b/cache.h\n>>>> @@ -1,7 +1,6 @@\n>>>>   #ifndef CACHE_H\n>>>>   #define CACHE_H\n>>>>\n>>>> -#include \"git-compat-util.h\"\n>>>>   #include \"strbuf.h\"\n>>>>   #include \"hashmap.h\"\n>>>>   #include \"advice.h\"\n>>>\n>>> Oh, that's a new change and worth mentioning in the commit message.\n>>\n>> Hmm, does this not break git? Unless you also change each '.c' file which\n>> includes cache.h to also include git-compat-util.h first, then I suspect\n>> (if nothing else) file I/O may be broken. (see _FILE_OFFSET_BITS).\n>>\n>> Also, see Documentation/CodingGuidelines (lines 331-333).\n> \n> This one should be okay because hashmap.h includes git-compat-util.h.\n\nIt is important that each compilation unit include 'git-compat-util.h'\nat the start. From the CodingGuidelines we see that 'cache.h' and\n'builtin.h' are *blessed* headers which can be used instead. (I have\nalways thought that this was a mistake; it would be much easier to\njust stick to using 'git-compat-util.h' at the top of each '.c' file ;-)\n\nThe fact that hashmap.h happens to include git-compat-util.h is not\nat all relevant here.\n\n> \n> Jonathan will be re-rolling so I'll definitely read and test the\n> patches when they're ready.  They'll probably be a more focused,\n> surgical change then this version.\n\nOK.\n\nATB,\nRamsay Jones\n"}]}