{"thread":{"id":"37503","subject":"[RFC PATCH 1/2] Makefile: add check-headers target","startedAt":"2014-09-06T19:20:10Z","lastAt":"2014-09-09T19:44:40Z","messageCount":10,"participants":["David Aguilar","René Scharfe","Jeff King","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"248990","messageId":"1410031211-14599-1-git-send-email-davvid@gmail.com","threadId":"37503","inReplyTo":null,"subject":"[RFC PATCH 1/2] Makefile: add check-headers target","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2014-09-06T19:20:10Z","receivedAt":"2014-09-06T19:20:10Z","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\nSigned-off-by: David Aguilar <davvid@gmail.com>\n---\nThis patch demonstrates how to verify PATCH 2/2.\n\n Makefile         |  6 ++++++\n check-headers.sh | 26 ++++++++++++++++++++++++++\n 2 files changed, 32 insertions(+)\n create mode 100755 check-headers.sh\n\ndiff --git a/Makefile b/Makefile\nindex 30cc622..bc54024 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2591,6 +2591,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)\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..bf85c41\n--- /dev/null\n+++ b/check-headers.sh\n@@ -0,0 +1,26 @@\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+git ls-files *.h |\n+while read header\n+do\n+\techo \"HEADER $header\" &&\n+\t\"$@\" -Wno-unused -x c -c -o \"$header\".bin - <\"$header\" &&\n+\trm \"$header\".bin ||\n+\tmaybe_exit $?\n+done\n+\n+exit $exit_code\n-- \n2.1.0.62.g7dc6c49\n"},{"id":"248991","messageId":"1410031211-14599-2-git-send-email-davvid@gmail.com","threadId":"37503","inReplyTo":"1410031211-14599-1-git-send-email-davvid@gmail.com","subject":"[RFC PATCH 2/2] headers: include dependent headers","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2014-09-06T19:20:11Z","receivedAt":"2014-09-06T19:20:11Z","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\nSigned-off-by: David Aguilar <davvid@gmail.com>\n---\nThis patch was prepared by using the \"check-headers\" target introduced\nby PATCH 1/2 to find headers that were not including their dependencies.\n\nThe only significant code movement was the movement of a struct defined\nin utf8.c to utf8.h so that it can be included by unicode_width.h.\n\n archive.h         | 1 +\n argv-array.h      | 2 ++\n attr.h            | 2 ++\n branch.h          | 3 +++\n cache-tree.h      | 1 +\n color.h           | 3 ++-\n column.h          | 2 ++\n commit.h          | 1 +\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             | 2 ++\n ewah/ewok.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           | 3 +++\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 wt-status.h       | 1 +\n 64 files changed, 133 insertions(+), 12 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..a61fd1a 100644\n--- a/branch.h\n+++ b/branch.h\n@@ -3,6 +3,9 @@\n \n /* Functions for acting on the information about branches. */\n \n+#include \"cache.h\"\n+#include \"strbuf.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/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/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..1fe0731 100644\n--- a/commit.h\n+++ b/commit.h\n@@ -7,6 +7,7 @@\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/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..727160e 100644\n--- a/dir.h\n+++ b/dir.h\n@@ -4,6 +4,8 @@\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/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..89f9579 100644\n--- a/khash.h\n+++ b/khash.h\n@@ -26,6 +26,9 @@\n #ifndef __AC_KHASH_H\n #define __AC_KHASH_H\n \n+#include \"git-compat-util.h\"\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/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,\n-- \n2.1.0.62.g7dc6c49\n"},{"id":"248994","messageId":"540B7AA0.4050208@web.de","threadId":"37503","inReplyTo":"1410031211-14599-1-git-send-email-davvid@gmail.com","subject":"Re: [RFC PATCH 1/2] Makefile: add check-headers target","fromName":"René Scharfe","fromEmail":"l.s.r@web.de","sentAt":"2014-09-06T21:20:32Z","receivedAt":"2014-09-06T21:20:32Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Am 06.09.2014 um 21:20 schrieb David Aguilar:\n> This allows us to ensure that each header can be included\n> individually without needing to include other headers first.\n\nSounds like a good objective.\n\n> Signed-off-by: David Aguilar <davvid@gmail.com>\n> ---\n> This patch demonstrates how to verify PATCH 2/2.\n>\n>   Makefile         |  6 ++++++\n>   check-headers.sh | 26 ++++++++++++++++++++++++++\n>   2 files changed, 32 insertions(+)\n>   create mode 100755 check-headers.sh\n>\n> diff --git a/Makefile b/Makefile\n> index 30cc622..bc54024 100644\n> --- a/Makefile\n> +++ b/Makefile\n> @@ -2591,6 +2591,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)\n> +\n> +\n>   ### Test suite coverage testing\n>   #\n>   .PHONY: coverage coverage-clean coverage-compile coverage-test coverage-report\n> diff --git a/check-headers.sh b/check-headers.sh\n> new file mode 100755\n> index 0000000..bf85c41\n> --- /dev/null\n> +++ b/check-headers.sh\n> @@ -0,0 +1,26 @@\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> +git ls-files *.h |\n\nThis checks all .h files in the top directory.  Would it be better to \ncheck all files in LIB_H instead?  Or even all .h files in the tree \n(using \"git ls-files '*.h'\")?  The latter might be difficult because \nsome of the files in compat/ #include system-specific headers.\n\n> +while read header\n> +do\n> +\techo \"HEADER $header\" &&\n> +\t\"$@\" -Wno-unused -x c -c -o \"$header\".bin - <\"$header\" &&\n> +\trm \"$header\".bin ||\n> +\tmaybe_exit $?\n> +done\n> +\n> +exit $exit_code\n>\n"},{"id":"248995","messageId":"540B7AA3.1090201@web.de","threadId":"37503","inReplyTo":"1410031211-14599-2-git-send-email-davvid@gmail.com","subject":"Re: [RFC PATCH 2/2] headers: include dependent headers","fromName":"René Scharfe","fromEmail":"l.s.r@web.de","sentAt":"2014-09-06T21:20:35Z","receivedAt":"2014-09-06T21:20:35Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Am 06.09.2014 um 21:20 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> Signed-off-by: David Aguilar <davvid@gmail.com>\n> ---\n\n> diff --git a/branch.h b/branch.h\n> index 64173ab..a61fd1a 100644\n> --- a/branch.h\n> +++ b/branch.h\n> @@ -3,6 +3,9 @@\n>\n>   /* Functions for acting on the information about branches. */\n>\n> +#include \"cache.h\"\n> +#include \"strbuf.h\"\n\ncache.h includes strbuf.h, so the line above isn't necessary.\n"},{"id":"248996","messageId":"20140906225738.GA15039@gmail.com","threadId":"37503","inReplyTo":"540B7AA0.4050208@web.de","subject":"Re: [RFC PATCH 1/2] Makefile: add check-headers target","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2014-09-06T22:57:39Z","receivedAt":"2014-09-06T22:57:39Z","isPatch":true,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"On Sat, Sep 06, 2014 at 11:20:32PM +0200, René Scharfe wrote:\n> Am 06.09.2014 um 21:20 schrieb David Aguilar:\n> >This allows us to ensure that each header can be included\n> >individually without needing to include other headers first.\n> \n> Sounds like a good objective.\n> \n> >Signed-off-by: David Aguilar <davvid@gmail.com>\n> >---\n> >This patch demonstrates how to verify PATCH 2/2.\n> >\n> >  Makefile         |  6 ++++++\n> >  check-headers.sh | 26 ++++++++++++++++++++++++++\n> >  2 files changed, 32 insertions(+)\n> >  create mode 100755 check-headers.sh\n> >\n> >diff --git a/Makefile b/Makefile\n> >index 30cc622..bc54024 100644\n> >--- a/Makefile\n> >+++ b/Makefile\n> >@@ -2591,6 +2591,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)\n> >+\n> >+\n> >  ### Test suite coverage testing\n> >  #\n> >  .PHONY: coverage coverage-clean coverage-compile coverage-test coverage-report\n> >diff --git a/check-headers.sh b/check-headers.sh\n> >new file mode 100755\n> >index 0000000..bf85c41\n> >--- /dev/null\n> >+++ b/check-headers.sh\n> >@@ -0,0 +1,26 @@\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> >+git ls-files *.h |\n> \n> This checks all .h files in the top directory.  Would it be better\n> to check all files in LIB_H instead?  Or even all .h files in the\n> tree (using \"git ls-files '*.h'\")?  The latter might be difficult\n> because some of the files in compat/ #include system-specific\n> headers.\n\nAh, I hadn't thought of using LIB_H; that might be the most\npractical solution.\n\nChanging it to quoted '*.h' finds compat/ files which seemed\nlike too much trouble.  OTOH blindly using all *.h files (i.e.\nnot using git ls-files) picks up the generated common-cmds.h\nwhich would require changing generate-cmdlist.h, and that seemed\nlike it might be out of scope for this patch.\n\nI'd certainly be interested in improving this part, so I'll see if\nwe can reformulate this patch to use LIB_H.\n\nI'll also fixup the unneeded strbuf.h addition in the reroll.\n\n> \n> >+while read header\n> >+do\n> >+\techo \"HEADER $header\" &&\n> >+\t\"$@\" -Wno-unused -x c -c -o \"$header\".bin - <\"$header\" &&\n> >+\trm \"$header\".bin ||\n> >+\tmaybe_exit $?\n> >+done\n> >+\n> >+exit $exit_code\n> >\n> \n\n-- \nDavid\n"},{"id":"248997","messageId":"20140906235808.GA20625@peff.net","threadId":"37503","inReplyTo":"20140906225738.GA15039@gmail.com","subject":"Re: [RFC PATCH 1/2] Makefile: add check-headers target","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2014-09-06T23:58:09Z","receivedAt":"2014-09-06T23:58:09Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sat, Sep 06, 2014 at 03:57:39PM -0700, David Aguilar wrote:\n\n> > This checks all .h files in the top directory.  Would it be better\n> > to check all files in LIB_H instead?  Or even all .h files in the\n> > tree (using \"git ls-files '*.h'\")?  The latter might be difficult\n> > because some of the files in compat/ #include system-specific\n> > headers.\n> \n> Ah, I hadn't thought of using LIB_H; that might be the most\n> practical solution.\n\nMaybe not; see d85b0dff7297fb43a57a0c1e697417bb7723247c, which is in\n'next'.\n\n-Peff\n"},{"id":"248998","messageId":"20140907002447.GB15039@gmail.com","threadId":"37503","inReplyTo":"20140906235808.GA20625@peff.net","subject":"Re: [RFC PATCH 1/2] Makefile: add check-headers target","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2014-09-07T00:24:48Z","receivedAt":"2014-09-07T00:24:48Z","isPatch":true,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"On Sat, Sep 06, 2014 at 07:58:09PM -0400, Jeff King wrote:\n> On Sat, Sep 06, 2014 at 03:57:39PM -0700, David Aguilar wrote:\n> \n> > > This checks all .h files in the top directory.  Would it be better\n> > > to check all files in LIB_H instead?  Or even all .h files in the\n> > > tree (using \"git ls-files '*.h'\")?  The latter might be difficult\n> > > because some of the files in compat/ #include system-specific\n> > > headers.\n> > \n> > Ah, I hadn't thought of using LIB_H; that might be the most\n> > practical solution.\n> \n> Maybe not; see d85b0dff7297fb43a57a0c1e697417bb7723247c, which is in\n> 'next'.\n\nThanks for the heads-up. I'll send v2 now which will basically use\nthe original approach plus a few extra paths so that we catch xdiff/,\nvcs-svn, and ewah/.\n\nWidening any more (e.g. it would be nice to say compat/*.h too) breaks\nit due to platform-specific includes so it seems good enough for catching\nthe main cross-platform headers.\n-- \nDavid\n"},{"id":"249049","messageId":"xmqqfvg2ngrn.fsf@gitster.dls.corp.google.com","threadId":"37503","inReplyTo":"540B7AA3.1090201@web.de","subject":"Re: [RFC PATCH 2/2] headers: include dependent headers","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-09-08T17:50:20Z","receivedAt":"2014-09-08T17:50:20Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"René Scharfe <l.s.r@web.de> writes:\n\n> Am 06.09.2014 um 21:20 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>> Signed-off-by: David Aguilar <davvid@gmail.com>\n>> ---\n>\n>> diff --git a/branch.h b/branch.h\n>> index 64173ab..a61fd1a 100644\n>> --- a/branch.h\n>> +++ b/branch.h\n>> @@ -3,6 +3,9 @@\n>>\n>>   /* Functions for acting on the information about branches. */\n>>\n>> +#include \"cache.h\"\n>> +#include \"strbuf.h\"\n>\n> cache.h includes strbuf.h, so the line above isn't necessary.\n\nTrue, but is \"gcc -c $header\" something we want to please in the\nfirst place (not an objection, but request for opinions)?\n"},{"id":"249050","messageId":"xmqqbnqqng1t.fsf@gitster.dls.corp.google.com","threadId":"37503","inReplyTo":"540B7AA3.1090201@web.de","subject":"Re: [RFC PATCH 2/2] headers: include dependent headers","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-09-08T18:05:50Z","receivedAt":"2014-09-08T18:05:50Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"René Scharfe <l.s.r@web.de> writes:\n\n> Am 06.09.2014 um 21:20 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>> Signed-off-by: David Aguilar <davvid@gmail.com>\n>> ---\n>\n>> diff --git a/branch.h b/branch.h\n>> index 64173ab..a61fd1a 100644\n>> --- a/branch.h\n>> +++ b/branch.h\n>> @@ -3,6 +3,9 @@\n>>\n>>   /* Functions for acting on the information about branches. */\n>>\n>> +#include \"cache.h\"\n>> +#include \"strbuf.h\"\n>\n> cache.h includes strbuf.h, so the line above isn't necessary.\n\nI think the primary objective of these two patches is to allow\nanybody who wants to use a feature X to include the header H that is\nabout that feature without having to know what other header F and G\nare required by the implementation of header H.\n\nAnd I think that cuts both ways.  Somebody who wants to use a\nfeature defined in the header H shouldn't have to know that other\nheaders I and J he includes to use other features from happen to\nalready include H for their own use.\n\nHere, branch.h does want to see \"struct strbuf\" for its own use, so\nincluding \"strbuf.h\" is the right thing to do and in line with the\nprimary objective, no?  It shouldn't have to know that \"cache.h\"\nhappens to include \"strbuf.h\".\n\nWhile assessing these two patches, we would need to decide what to\ndo with the \"include git-compat-util.h first in any C source\" rule\nin the coding guidelines.  I think it is still a good practical\nexception (in the sense that even if you do not use FLEX_ARRAY,\nsigned_add_overflows(), etc. yourself, you should follow the rule),\neven if we choose to adopt \"One that wants to use features from a\nheader only needs to include that header\".\n"},{"id":"249092","messageId":"540F58A8.7000500@web.de","threadId":"37503","inReplyTo":"xmqqfvg2ngrn.fsf@gitster.dls.corp.google.com","subject":"Re: [RFC PATCH 2/2] headers: include dependent headers","fromName":"René Scharfe","fromEmail":"l.s.r@web.de","sentAt":"2014-09-09T19:44:40Z","receivedAt":"2014-09-09T19:44:40Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Am 08.09.2014 um 19:50 schrieb Junio C Hamano:\n> René Scharfe <l.s.r@web.de> writes:\n>\n>> Am 06.09.2014 um 21:20 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>>> Signed-off-by: David Aguilar <davvid@gmail.com>\n>>> ---\n>>\n>>> diff --git a/branch.h b/branch.h\n>>> index 64173ab..a61fd1a 100644\n>>> --- a/branch.h\n>>> +++ b/branch.h\n>>> @@ -3,6 +3,9 @@\n>>>\n>>>    /* Functions for acting on the information about branches. */\n>>>\n>>> +#include \"cache.h\"\n>>> +#include \"strbuf.h\"\n>>\n>> cache.h includes strbuf.h, so the line above isn't necessary.\n>\n> True, but is \"gcc -c $header\" something we want to please in the\n> first place (not an objection, but request for opinions)?\n\nIt *sounds* useful, but we did without that feature so far.  Hmm.  It \nwould make it easier to use headers -- any dependency to other files are \nalready taken care of.  Since we have less .h files than .c files this \nseems to make sense.\n\nWould it perhaps also make using precompiled headers easier (or possible \nin the first place)?  Do we care?\n\nRené\n"}]}