{"thread":{"id":"37553","subject":"[PATCH v4 1/2] Makefile: add check-headers target","startedAt":"2014-09-14T01:00:49Z","lastAt":"2014-09-14T01:00:50Z","messageCount":2,"participants":["David Aguilar"],"isPatch":true,"patchVersion":4,"patchTotal":2},"messages":[{"id":"249369","messageId":"1410656450-96087-1-git-send-email-davvid@gmail.com","threadId":"37553","inReplyTo":null,"subject":"[PATCH v4 1/2] Makefile: add check-headers target","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2014-09-14T01:00:49Z","receivedAt":"2014-09-14T01:00:49Z","isPatch":true,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"This allows us to ensure that each header can be included\nindividually without needing to include other headers first.\n\nImplicitly include git-compat-util.h during the check since\nthe implementation files will have already included it.\n\nHelped-by: Jonathan Nieder <jrnieder@gmail.com>\nHelped-by: Junio C Hamano <gitster@pobox.com>\nHelped-by: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>\nSigned-off-by: David Aguilar <davvid@gmail.com>\n---\nChanges since last time:\n\nWe now automatically include git-compat-util.h during the check\nper the CodingGuidelines rule to always include it in all .c files.\n\nWe now use a case statement to special-case common-cmds.h, which\nallows us to replace usage of git ls-files and a pipe with a simpler\nfor header in ... loop.\n\n Makefile         |  6 ++++++\n check-headers.sh | 34 ++++++++++++++++++++++++++++++++++\n 2 files changed, 40 insertions(+)\n create mode 100755 check-headers.sh\n\ndiff --git a/Makefile b/Makefile\nindex e0f15a3..d7c9225 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2408,6 +2408,12 @@ check-docs::\n check-builtins::\n \t./check-builtins.sh\n \n+### Make sure headers include their dependencies\n+#\n+check-headers::\n+\t./check-headers.sh $(CC) $(ALL_CFLAGS) $(EXTRA_CPPFLAGS)\n+\n+\n ### Test suite coverage testing\n #\n .PHONY: coverage coverage-clean coverage-compile coverage-test coverage-report\ndiff --git a/check-headers.sh b/check-headers.sh\nnew file mode 100755\nindex 0000000..ef06f56\n--- /dev/null\n+++ b/check-headers.sh\n@@ -0,0 +1,34 @@\n+#!/bin/sh\n+\n+exit_code=0\n+\n+maybe_exit () {\n+\tstatus=\"$1\"\n+\tif test \"$status\" != 0\n+\tthen\n+\t\texit_code=\"$status\"\n+\t\tif test -n \"$CHECK_HEADERS_STOP\"\n+\t\tthen\n+\t\t\texit \"$status\"\n+\t\tfi\n+\tfi\n+}\n+\n+for header in *.h ewah/*.h vcs-svn/*.h xdiff/*.h\n+do\n+\tcase \"$header\" in\n+\tcommon-cmds.h)\n+\t\t# should only be included by help.c\n+\t\t;;\n+\t*)\n+\t\tsubdir=$(dirname \"$header\") &&\n+\t\techo \"HEADER $header\" &&\n+\t\t\"$@\" -Wno-unused -I\"$subdir\" -include git-compat-util.h \\\n+\t\t\t-c -o \"$header\".check -x c - <\"$header\" &&\n+\t\trm \"$header\".check ||\n+\t\tmaybe_exit $?\n+\t\t;;\n+\tesac\n+done\n+\n+exit $exit_code\n-- \n2.0.4.1.g929bde9\n"},{"id":"249370","messageId":"1410656450-96087-2-git-send-email-davvid@gmail.com","threadId":"37553","inReplyTo":"1410656450-96087-1-git-send-email-davvid@gmail.com","subject":"[PATCH v4 2/2] headers: include dependent headers","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2014-09-14T01:00:50Z","receivedAt":"2014-09-14T01:00:50Z","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\nMove the unicode interval types to unicode_width.h so that we\ncan include them from utf8.h.\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---\nChanges since last time:\n\nThis patch was redone to no longer add git-compat-util.h\nadditions, as it was run using the new check-headers.\n\nThe unicode interval types were moved into unicode_width.h\nto minimize dependencies.\n\n archive.h         |  1 +\n attr.h            |  2 ++\n blob.h            |  1 +\n branch.h          |  2 ++\n column.h          |  2 ++\n commit.h          |  1 +\n convert.h         |  2 ++\n csum-file.h       |  2 ++\n diff.h            |  2 +-\n diffcore.h        |  2 ++\n dir.h             |  2 ++\n ewah/ewok_rlw.h   |  2 ++\n fsck.h            |  2 ++\n gpg-interface.h   |  2 ++\n graph.h           |  2 ++\n khash.h           |  2 ++\n line-log.h        |  1 +\n list-objects.h    |  2 ++\n ll-merge.h        |  2 ++\n mailmap.h         |  2 ++\n merge-recursive.h |  2 ++\n notes-merge.h     |  4 ++++\n notes-utils.h     |  1 +\n notes.h           |  1 +\n object.h          |  2 ++\n pack-bitmap.h     |  2 ++\n pack-objects.h    |  2 ++\n patch-ids.h       |  3 +++\n reachable.h       |  2 ++\n reflog-walk.h     |  1 +\n refs.h            |  3 +++\n remote.h          |  1 +\n resolve-undo.h    |  4 ++++\n send-pack.h       |  3 +++\n sequencer.h       |  2 ++\n shortlog.h        |  1 +\n submodule.h       |  5 +++--\n tree-walk.h       |  2 ++\n tree.h            |  1 +\n unicode_width.h   | 12 ++++++++++++\n unpack-trees.h    |  2 ++\n url.h             |  2 ++\n utf8.c            |  5 -----\n utf8.h            |  3 ++-\n walker.h          |  1 +\n wt-status.h       |  1 +\n xdiff/xdiffi.h    |  2 ++\n xdiff/xemit.h     |  3 +++\n xdiff/xprepare.h  |  3 ++-\n xdiff/xutils.h    |  3 ++-\n 50 files changed, 104 insertions(+), 11 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/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/blob.h b/blob.h\nindex 59b394e..25d8618 100644\n--- a/blob.h\n+++ b/blob.h\n@@ -1,6 +1,7 @@\n #ifndef BLOB_H\n #define BLOB_H\n \n+#include \"cache.h\"\n #include \"object.h\"\n \n extern const char *blob_type;\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/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 a401ddf..a0f6d20 100644\n--- a/commit.h\n+++ b/commit.h\n@@ -1,6 +1,7 @@\n #ifndef COMMIT_H\n #define COMMIT_H\n \n+#include \"cache.h\"\n #include \"object.h\"\n #include \"tree.h\"\n #include \"strbuf.h\"\ndiff --git a/convert.h b/convert.h\nindex 0c2143c..82f81fa 100644\n--- a/convert.h\n+++ b/convert.h\n@@ -4,6 +4,8 @@\n #ifndef CONVERT_H\n #define CONVERT_H\n \n+#include \"strbuf.h\"\n+\n enum safe_crlf {\n \tSAFE_CRLF_FALSE = 0,\n \tSAFE_CRLF_FAIL = 1,\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/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 33ea2de..7ae0293 100644\n--- a/diffcore.h\n+++ b/diffcore.h\n@@ -9,6 +9,8 @@\n  * in anything else.\n  */\n \n+#include \"diff.h\"\n+\n /* We internally use unsigned short as the score value,\n  * and rely on an int capable to hold 32-bits.  -B can take\n  * -Bmerge_score/break_score format and the two scores are\ndiff --git a/dir.h b/dir.h\nindex 6c45e9d..3330771 100644\n--- a/dir.h\n+++ b/dir.h\n@@ -3,7 +3,9 @@\n \n /* See Documentation/technical/api-directory-listing.txt */\n \n+#include \"cache.h\"\n #include \"strbuf.h\"\n+#include \"pathspec.h\"\n \n struct dir_entry {\n \tunsigned int len;\ndiff --git a/ewah/ewok_rlw.h b/ewah/ewok_rlw.h\nindex 63efdf9..e84aa54 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 \"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/fsck.h b/fsck.h\nindex 1e4f527..7712cd1 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 \"cache.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/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/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..ff90e1f 100644\n--- a/mailmap.h\n+++ b/mailmap.h\n@@ -1,6 +1,8 @@\n #ifndef MAILMAP_H\n #define MAILMAP_H\n \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..9d11653 100644\n--- a/merge-recursive.h\n+++ b/merge-recursive.h\n@@ -1,6 +1,8 @@\n #ifndef MERGE_RECURSIVE_H\n #define MERGE_RECURSIVE_H\n \n+#include \"commit.h\"\n+#include \"strbuf.h\"\n #include \"string-list.h\"\n \n struct merge_options {\ndiff --git a/notes-merge.h b/notes-merge.h\nindex 1d01f6a..3f33089 100644\n--- a/notes-merge.h\n+++ b/notes-merge.h\n@@ -1,6 +1,10 @@\n #ifndef NOTES_MERGE_H\n #define NOTES_MERGE_H\n \n+#include \"commit.h\"\n+#include \"strbuf.h\"\n+#include \"notes.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..3a8beac 100644\n--- a/notes-utils.h\n+++ b/notes-utils.h\n@@ -1,6 +1,7 @@\n #ifndef NOTES_UTILS_H\n #define NOTES_UTILS_H\n \n+#include \"commit.h\"\n #include \"notes.h\"\n \n /*\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..86f39f4 100644\n--- a/pack-bitmap.h\n+++ b/pack-bitmap.h\n@@ -3,7 +3,9 @@\n \n #include \"ewah/ewok.h\"\n #include \"khash.h\"\n+#include \"pack.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/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/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 68c5770..58dd9f5 100644\n--- a/refs.h\n+++ b/refs.h\n@@ -1,6 +1,9 @@\n #ifndef REFS_H\n #define REFS_H\n \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..dcecdf9 100644\n--- a/remote.h\n+++ b/remote.h\n@@ -2,6 +2,7 @@\n #define REMOTE_H\n \n #include \"parse-options.h\"\n+#include \"strbuf.h\"\n #include \"hashmap.h\"\n \n enum {\ndiff --git a/resolve-undo.h b/resolve-undo.h\nindex 4630645..05c47f7 100644\n--- a/resolve-undo.h\n+++ b/resolve-undo.h\n@@ -1,6 +1,10 @@\n #ifndef RESOLVE_UNDO_H\n #define RESOLVE_UNDO_H\n \n+#include \"cache.h\"\n+#include \"pathspec.h\"\n+#include \"string-list.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..63cdc74 100644\n--- a/send-pack.h\n+++ b/send-pack.h\n@@ -1,6 +1,9 @@\n #ifndef SEND_PACK_H\n #define SEND_PACK_H\n \n+#include \"remote.h\"\n+#include \"run-command.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..7f036cd 100644\n--- a/sequencer.h\n+++ b/sequencer.h\n@@ -1,6 +1,8 @@\n #ifndef SEQUENCER_H\n #define SEQUENCER_H\n \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/shortlog.h b/shortlog.h\nindex de4f86f..d882a6d 100644\n--- a/shortlog.h\n+++ b/shortlog.h\n@@ -1,6 +1,7 @@\n #ifndef SHORTLOG_H\n #define SHORTLOG_H\n \n+#include \"commit.h\"\n #include \"string-list.h\"\n \n struct shortlog {\ndiff --git a/submodule.h b/submodule.h\nindex 7beec48..6985f6c 100644\n--- a/submodule.h\n+++ b/submodule.h\n@@ -1,8 +1,9 @@\n #ifndef SUBMODULE_H\n #define SUBMODULE_H\n \n-struct diff_options;\n-struct argv_array;\n+#include \"argv-array.h\"\n+#include \"diff.h\"\n+#include \"string-list.h\"\n \n enum {\n \tRECURSE_SUBMODULES_ON_DEMAND = -1,\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..aab2213 100644\n--- a/tree.h\n+++ b/tree.h\n@@ -1,6 +1,7 @@\n #ifndef TREE_H\n #define TREE_H\n \n+#include \"cache.h\"\n #include \"object.h\"\n \n extern const char *tree_type;\ndiff --git a/unicode_width.h b/unicode_width.h\nindex 47cdd23..ccdd2a0 100644\n--- a/unicode_width.h\n+++ b/unicode_width.h\n@@ -1,3 +1,13 @@\n+#ifndef UNICODE_WIDTH_H\n+#define UNICODE_WIDTH_H\n+\n+typedef unsigned int ucs_char_t;  /* assuming 32bit int */\n+\n+struct interval {\n+\tucs_char_t first;\n+\tucs_char_t last;\n+};\n+\n static const struct interval zero_width[] = {\n { 0x0300, 0x036F },\n { 0x0483, 0x0489 },\n@@ -321,3 +331,5 @@ static const struct interval double_width[] = {\n { 0x20000, 0x2FFFD },\n { 0x30000, 0x3FFFD }\n };\n+\n+#endif\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/utf8.c b/utf8.c\nindex 401a6a5..4073857 100644\n--- a/utf8.c\n+++ b/utf8.c\n@@ -4,11 +4,6 @@\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..e3ae27e 100644\n--- a/utf8.h\n+++ b/utf8.h\n@@ -1,7 +1,8 @@\n #ifndef GIT_UTF8_H\n #define GIT_UTF8_H\n \n-typedef unsigned int ucs_char_t;  /* assuming 32bit int */\n+#include \"strbuf.h\"\n+#include \"unicode_width.h\"\n \n size_t display_mode_esc_sequence_len(const char *s);\n int utf8_width(const char **start, size_t *remainder_p);\ndiff --git a/walker.h b/walker.h\nindex 95e5765..65166bd 100644\n--- a/walker.h\n+++ b/walker.h\n@@ -2,6 +2,7 @@\n #define WALKER_H\n \n #include \"remote.h\"\n+#include \"pathspec.h\"\n \n struct walker {\n \tvoid *data;\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..d2aed4a 100644\n--- a/xdiff/xemit.h\n+++ b/xdiff/xemit.h\n@@ -23,6 +23,9 @@\n #if !defined(XEMIT_H)\n #define XEMIT_H\n \n+#include \"xdiff.h\"\n+#include \"xdiffi.h\"\n+#include \"xtypes.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..2007f1b 100644\n--- a/xdiff/xprepare.h\n+++ b/xdiff/xprepare.h\n@@ -23,7 +23,8 @@\n #if !defined(XPREPARE_H)\n #define XPREPARE_H\n \n-\n+#include \"xdiff.h\"\n+#include \"xtypes.h\"\n \n int xdl_prepare_env(mmfile_t *mf1, mmfile_t *mf2, xpparam_t const *xpp,\n \t\t    xdfenv_t *xe);\ndiff --git a/xdiff/xutils.h b/xdiff/xutils.h\nindex 4646ce5..f5eda78 100644\n--- a/xdiff/xutils.h\n+++ b/xdiff/xutils.h\n@@ -23,7 +23,8 @@\n #if !defined(XUTILS_H)\n #define XUTILS_H\n \n-\n+#include \"xdiff.h\"\n+#include \"xtypes.h\"\n \n long xdl_bogosqrt(long n);\n int xdl_emit_diffrec(char const *rec, long size, char const *pre, long psize,\n-- \n2.0.4.1.g929bde9\n"}]}