{"thread":{"id":"18638","subject":"[PATCH 0/5] Header includes cleanup","startedAt":"2009-03-30T09:55:20Z","lastAt":"2009-04-03T12:24:01Z","messageCount":17,"participants":["Nathaniel P Dawson","Johannes Sixt","Christian Couder","Junio C Hamano","Jeff King"],"isPatch":true,"patchVersion":1,"patchTotal":5},"messages":[{"id":"109871","messageId":"1238406925-15907-1-git-send-email-nathaniel.dawson@gmail.com","threadId":"18638","inReplyTo":null,"subject":"[PATCH 0/5] Header includes cleanup","fromName":"Nathaniel P Dawson","fromEmail":"nathaniel.dawson@gmail.com","sentAt":"2009-03-30T09:55:20Z","receivedAt":"2009-03-30T09:55:20Z","isPatch":true,"sender":{"key":"nathaniel.dawson@gmail.com","avatar":null},"body":"This is just the beginning for this project. I'm slowly cleaning up the header includes one chunk at a time. I hope my patches aren't too messy, I've learned how to better utilize git to make patches and organize my commits logically so I'll submit neater chunks henceforth. You can expect patches from me nightly until I've finished this project.\n\nRegards,\nNathaniel P Dawson\n"},{"id":"109874","messageId":"1238406925-15907-2-git-send-email-nathaniel.dawson@gmail.com","threadId":"18638","inReplyTo":"1238406925-15907-1-git-send-email-nathaniel.dawson@gmail.com","subject":"[PATCH 1/5] Header includes cleanup","fromName":"Nathaniel P Dawson","fromEmail":"nathaniel.dawson@gmail.com","sentAt":"2009-03-30T09:55:21Z","receivedAt":"2009-03-30T09:55:21Z","isPatch":true,"sender":{"key":"nathaniel.dawson@gmail.com","avatar":null},"body":"Deleted all header includes of git-compat-util.h, strbuf.h, cache.h, and commit.h where builtin.h was already included since builtin.h includes them.\n\nSigned-off-by: Nathaniel P Dawson <nathaniel.dawson@gmail.com>\n---\n builtin-add.c              |    1 -\n builtin-annotate.c         |    1 -\n builtin-apply.c            |    5 ++---\n builtin-archive.c          |    1 -\n builtin-blame.c            |    3 ---\n builtin-branch.c           |    5 +----\n builtin-bundle.c           |    1 -\n builtin-cat-file.c         |    3 +--\n builtin-check-attr.c       |    1 -\n builtin-check-ref-format.c |    3 +--\n builtin-checkout-index.c   |    1 -\n builtin-checkout.c         |    4 +---\n builtin-clean.c            |    1 -\n builtin-commit-tree.c      |    4 +---\n builtin-commit.c           |    5 +----\n builtin-config.c           |    1 -\n builtin-count-objects.c    |    3 +--\n builtin-describe.c         |    4 +---\n builtin-diff-files.c       |    4 +---\n builtin-diff-index.c       |    4 +---\n builtin-diff-tree.c        |    4 +---\n builtin-diff.c             |    6 ++----\n builtin-fast-export.c      |    2 --\n builtin-fetch--tool.c      |    2 --\n builtin-fetch.c            |    4 +---\n builtin-fmt-merge-msg.c    |    2 --\n builtin-for-each-ref.c     |    6 ++----\n builtin-fsck.c             |    2 --\n builtin-gc.c               |    1 -\n builtin-grep.c             |    4 +---\n builtin-help.c             |    1 -\n builtin-init-db.c          |    1 -\n builtin-log.c              |    4 +---\n builtin-ls-files.c         |    3 +--\n builtin-ls-remote.c        |    1 -\n builtin-ls-tree.c          |    4 +---\n builtin-mailinfo.c         |    2 --\n builtin-mailsplit.c        |    1 -\n builtin-merge-base.c       |    2 --\n builtin-merge-file.c       |    1 -\n builtin-merge-ours.c       |    1 -\n builtin-merge.c            |    4 +---\n builtin-mv.c               |    1 -\n builtin-name-rev.c         |    2 --\n builtin-pack-objects.c     |    2 --\n builtin-prune-packed.c     |    1 -\n builtin-prune.c            |    4 +---\n builtin-push.c             |    3 +--\n builtin-read-tree.c        |    3 +--\n builtin-reflog.c           |    2 --\n builtin-rerere.c           |    1 -\n builtin-rev-list.c         |    6 ++----\n builtin-revert.c           |    2 --\n builtin-rm.c               |    1 -\n builtin-shortlog.c         |    2 --\n builtin-show-branch.c      |    4 +---\n builtin-show-ref.c         |    1 -\n builtin-stripspace.c       |    1 -\n builtin-symbolic-ref.c     |    1 -\n builtin-tag.c              |    1 -\n builtin-tar-tree.c         |    2 --\n builtin-unpack-objects.c   |    2 --\n builtin-update-index.c     |    3 +--\n builtin-update-ref.c       |    3 +--\n builtin-upload-archive.c   |    1 -\n builtin-verify-pack.c      |    1 -\n builtin-verify-tag.c       |    1 -\n builtin-write-tree.c       |    1 -\n diff-no-index.c            |    4 +---\n fast-import.c              |    2 --\n git.c                      |    1 -\n help.c                     |    1 -\n merge-recursive.c          |    6 ++----\n 73 files changed, 34 insertions(+), 145 deletions(-)\n\ndiff --git a/builtin-add.c b/builtin-add.c\nindex cb67d2c..4d61e72 100644\n--- a/builtin-add.c\n+++ b/builtin-add.c\n@@ -3,7 +3,6 @@\n  *\n  * Copyright (C) 2006 Linus Torvalds\n  */\n-#include \"cache.h\"\n #include \"builtin.h\"\n #include \"dir.h\"\n #include \"exec_cmd.h\"\ndiff --git a/builtin-annotate.c b/builtin-annotate.c\nindex fc43eed..0a259a3 100644\n--- a/builtin-annotate.c\n+++ b/builtin-annotate.c\n@@ -3,7 +3,6 @@\n  *\n  * Copyright (C) 2006 Ryan Anderson\n  */\n-#include \"git-compat-util.h\"\n #include \"builtin.h\"\n \n int cmd_annotate(int argc, const char **argv, const char *prefix)\ndiff --git a/builtin-apply.c b/builtin-apply.c\nindex 1926cd8..356db67 100644\n--- a/builtin-apply.c\n+++ b/builtin-apply.c\n@@ -6,12 +6,11 @@\n  * This applies patches on top of some (arbitrary) version of the SCM.\n  *\n  */\n-#include \"cache.h\"\n+#include \"builtin.h\"\n+#include \"blob.h\"\n #include \"cache-tree.h\"\n #include \"quote.h\"\n-#include \"blob.h\"\n #include \"delta.h\"\n-#include \"builtin.h\"\n #include \"string-list.h\"\n #include \"dir.h\"\n #include \"parse-options.h\"\ndiff --git a/builtin-archive.c b/builtin-archive.c\nindex ab50ceb..f293d40 100644\n--- a/builtin-archive.c\n+++ b/builtin-archive.c\n@@ -2,7 +2,6 @@\n  * Copyright (c) 2006 Franck Bui-Huu\n  * Copyright (c) 2006 Rene Scharfe\n  */\n-#include \"cache.h\"\n #include \"builtin.h\"\n #include \"archive.h\"\n #include \"parse-options.h\"\ndiff --git a/builtin-blame.c b/builtin-blame.c\nindex 83141fc..a91d350 100644\n--- a/builtin-blame.c\n+++ b/builtin-blame.c\n@@ -3,11 +3,8 @@\n  *\n  * Copyright (c) 2006, Junio C Hamano\n  */\n-\n-#include \"cache.h\"\n #include \"builtin.h\"\n #include \"blob.h\"\n-#include \"commit.h\"\n #include \"tag.h\"\n #include \"tree-walk.h\"\n #include \"diff.h\"\ndiff --git a/builtin-branch.c b/builtin-branch.c\nindex 07a440e..2cb22c7 100644\n--- a/builtin-branch.c\n+++ b/builtin-branch.c\n@@ -4,12 +4,9 @@\n  * Copyright (c) 2006 Kristian HÃ¸gsberg <krh@redhat.com>\n  * Based on git-branch.sh by Junio C Hamano.\n  */\n-\n-#include \"cache.h\"\n+#include \"builtin.h\"\n #include \"color.h\"\n #include \"refs.h\"\n-#include \"commit.h\"\n-#include \"builtin.h\"\n #include \"remote.h\"\n #include \"parse-options.h\"\n #include \"branch.h\"\ndiff --git a/builtin-bundle.c b/builtin-bundle.c\nindex 9b58152..b36456e 100644\n--- a/builtin-bundle.c\n+++ b/builtin-bundle.c\n@@ -1,5 +1,4 @@\n #include \"builtin.h\"\n-#include \"cache.h\"\n #include \"bundle.h\"\n \n /*\ndiff --git a/builtin-cat-file.c b/builtin-cat-file.c\nindex 8fad19d..70c9bda 100644\n--- a/builtin-cat-file.c\n+++ b/builtin-cat-file.c\n@@ -3,11 +3,10 @@\n  *\n  * Copyright (C) Linus Torvalds, 2005\n  */\n-#include \"cache.h\"\n+#include \"builtin.h\"\n #include \"exec_cmd.h\"\n #include \"tag.h\"\n #include \"tree.h\"\n-#include \"builtin.h\"\n #include \"parse-options.h\"\n \n #define BATCH 1\ndiff --git a/builtin-check-attr.c b/builtin-check-attr.c\nindex 15a04b7..c8f0cb3 100644\n--- a/builtin-check-attr.c\n+++ b/builtin-check-attr.c\n@@ -1,5 +1,4 @@\n #include \"builtin.h\"\n-#include \"cache.h\"\n #include \"attr.h\"\n #include \"quote.h\"\n #include \"parse-options.h\"\ndiff --git a/builtin-check-ref-format.c b/builtin-check-ref-format.c\nindex 701de43..5289580 100644\n--- a/builtin-check-ref-format.c\n+++ b/builtin-check-ref-format.c\n@@ -2,9 +2,8 @@\n  * GIT - The information manager from hell\n  */\n \n-#include \"cache.h\"\n-#include \"refs.h\"\n #include \"builtin.h\"\n+#include \"refs.h\"\n \n int cmd_check_ref_format(int argc, const char **argv, const char *prefix)\n {\ndiff --git a/builtin-checkout-index.c b/builtin-checkout-index.c\nindex 0d534bc..fbdb37f 100644\n--- a/builtin-checkout-index.c\n+++ b/builtin-checkout-index.c\n@@ -37,7 +37,6 @@\n  * but get used to it in scripting!).\n  */\n #include \"builtin.h\"\n-#include \"cache.h\"\n #include \"quote.h\"\n #include \"cache-tree.h\"\n #include \"parse-options.h\"\ndiff --git a/builtin-checkout.c b/builtin-checkout.c\nindex fc55bbe..f8bb9ea 100644\n--- a/builtin-checkout.c\n+++ b/builtin-checkout.c\n@@ -1,8 +1,7 @@\n-#include \"cache.h\"\n #include \"builtin.h\"\n+#include \"blob.h\"\n #include \"parse-options.h\"\n #include \"refs.h\"\n-#include \"commit.h\"\n #include \"tree.h\"\n #include \"tree-walk.h\"\n #include \"unpack-trees.h\"\n@@ -13,7 +12,6 @@\n #include \"diff.h\"\n #include \"revision.h\"\n #include \"remote.h\"\n-#include \"blob.h\"\n #include \"xdiff-interface.h\"\n #include \"ll-merge.h\"\n \ndiff --git a/builtin-clean.c b/builtin-clean.c\nindex c5ad33d..46a483c 100644\n--- a/builtin-clean.c\n+++ b/builtin-clean.c\n@@ -7,7 +7,6 @@\n  */\n \n #include \"builtin.h\"\n-#include \"cache.h\"\n #include \"dir.h\"\n #include \"parse-options.h\"\n #include \"quote.h\"\ndiff --git a/builtin-commit-tree.c b/builtin-commit-tree.c\nindex 0453425..ea83003 100644\n--- a/builtin-commit-tree.c\n+++ b/builtin-commit-tree.c\n@@ -3,10 +3,8 @@\n  *\n  * Copyright (C) Linus Torvalds, 2005\n  */\n-#include \"cache.h\"\n-#include \"commit.h\"\n-#include \"tree.h\"\n #include \"builtin.h\"\n+#include \"tree.h\"\n #include \"utf8.h\"\n \n #define BLOCKING (1ul << 14)\ndiff --git a/builtin-commit.c b/builtin-commit.c\nindex 46e649c..aba5660 100644\n--- a/builtin-commit.c\n+++ b/builtin-commit.c\n@@ -5,20 +5,17 @@\n  * Based on git-commit.sh by Junio C Hamano and Linus Torvalds\n  */\n \n-#include \"cache.h\"\n+#include \"builtin.h\"\n #include \"cache-tree.h\"\n #include \"color.h\"\n #include \"dir.h\"\n-#include \"builtin.h\"\n #include \"diff.h\"\n #include \"diffcore.h\"\n-#include \"commit.h\"\n #include \"revision.h\"\n #include \"wt-status.h\"\n #include \"run-command.h\"\n #include \"refs.h\"\n #include \"log-tree.h\"\n-#include \"strbuf.h\"\n #include \"utf8.h\"\n #include \"parse-options.h\"\n #include \"string-list.h\"\ndiff --git a/builtin-config.c b/builtin-config.c\nindex d8da72c..6a31764 100644\n--- a/builtin-config.c\n+++ b/builtin-config.c\n@@ -1,5 +1,4 @@\n #include \"builtin.h\"\n-#include \"cache.h\"\n #include \"color.h\"\n #include \"parse-options.h\"\n \ndiff --git a/builtin-count-objects.c b/builtin-count-objects.c\nindex b814fe5..a6f2337 100644\n--- a/builtin-count-objects.c\n+++ b/builtin-count-objects.c\n@@ -4,9 +4,8 @@\n  * Copyright (c) 2006 Junio C Hamano\n  */\n \n-#include \"cache.h\"\n-#include \"dir.h\"\n #include \"builtin.h\"\n+#include \"dir.h\"\n #include \"parse-options.h\"\n \n static void count_objects(DIR *d, char *path, int len, int verbose,\ndiff --git a/builtin-describe.c b/builtin-describe.c\nindex 3a007ed..159c1ad 100644\n--- a/builtin-describe.c\n+++ b/builtin-describe.c\n@@ -1,8 +1,6 @@\n-#include \"cache.h\"\n-#include \"commit.h\"\n+#include \"builtin.h\"\n #include \"tag.h\"\n #include \"refs.h\"\n-#include \"builtin.h\"\n #include \"exec_cmd.h\"\n #include \"parse-options.h\"\n \ndiff --git a/builtin-diff-files.c b/builtin-diff-files.c\nindex 5b64011..4770aeb 100644\n--- a/builtin-diff-files.c\n+++ b/builtin-diff-files.c\n@@ -3,11 +3,9 @@\n  *\n  * Copyright (C) Linus Torvalds, 2005\n  */\n-#include \"cache.h\"\n+#include \"builtin.h\"\n #include \"diff.h\"\n-#include \"commit.h\"\n #include \"revision.h\"\n-#include \"builtin.h\"\n \n static const char diff_files_usage[] =\n \"git diff-files [-q] [-0/-1/2/3 |-c|--cc] [<common diff options>] [<path>...]\"\ndiff --git a/builtin-diff-index.c b/builtin-diff-index.c\nindex 0483749..7b8c813 100644\n--- a/builtin-diff-index.c\n+++ b/builtin-diff-index.c\n@@ -1,8 +1,6 @@\n-#include \"cache.h\"\n+#include \"builtin.h\"\n #include \"diff.h\"\n-#include \"commit.h\"\n #include \"revision.h\"\n-#include \"builtin.h\"\n \n static const char diff_cache_usage[] =\n \"git diff-index [-m] [--cached] \"\ndiff --git a/builtin-diff-tree.c b/builtin-diff-tree.c\nindex 79cedb7..0b06748 100644\n--- a/builtin-diff-tree.c\n+++ b/builtin-diff-tree.c\n@@ -1,8 +1,6 @@\n-#include \"cache.h\"\n+#include \"builtin.h\"\n #include \"diff.h\"\n-#include \"commit.h\"\n #include \"log-tree.h\"\n-#include \"builtin.h\"\n \n static struct rev_info log_tree_opt;\n \ndiff --git a/builtin-diff.c b/builtin-diff.c\nindex d75d69b..252c519 100644\n--- a/builtin-diff.c\n+++ b/builtin-diff.c\n@@ -3,16 +3,14 @@\n  *\n  * Copyright (c) 2006 Junio C Hamano\n  */\n-#include \"cache.h\"\n-#include \"color.h\"\n-#include \"commit.h\"\n+#include \"builtin.h\"\n #include \"blob.h\"\n+#include \"color.h\"\n #include \"tag.h\"\n #include \"diff.h\"\n #include \"diffcore.h\"\n #include \"revision.h\"\n #include \"log-tree.h\"\n-#include \"builtin.h\"\n \n struct blobinfo {\n \tunsigned char sha1[20];\ndiff --git a/builtin-fast-export.c b/builtin-fast-export.c\nindex 34a419c..b62e48d 100644\n--- a/builtin-fast-export.c\n+++ b/builtin-fast-export.c\n@@ -4,8 +4,6 @@\n  * Copyright (C) 2007 Johannes E. Schindelin\n  */\n #include \"builtin.h\"\n-#include \"cache.h\"\n-#include \"commit.h\"\n #include \"object.h\"\n #include \"tag.h\"\n #include \"diff.h\"\ndiff --git a/builtin-fetch--tool.c b/builtin-fetch--tool.c\nindex 29356d2..1863d5f 100644\n--- a/builtin-fetch--tool.c\n+++ b/builtin-fetch--tool.c\n@@ -1,7 +1,5 @@\n #include \"builtin.h\"\n-#include \"cache.h\"\n #include \"refs.h\"\n-#include \"commit.h\"\n #include \"sigchain.h\"\n \n static char *get_stdin(void)\ndiff --git a/builtin-fetch.c b/builtin-fetch.c\nindex 3c998ea..c203286 100644\n--- a/builtin-fetch.c\n+++ b/builtin-fetch.c\n@@ -1,10 +1,8 @@\n /*\n  * \"git fetch\"\n  */\n-#include \"cache.h\"\n-#include \"refs.h\"\n-#include \"commit.h\"\n #include \"builtin.h\"\n+#include \"refs.h\"\n #include \"string-list.h\"\n #include \"remote.h\"\n #include \"transport.h\"\ndiff --git a/builtin-fmt-merge-msg.c b/builtin-fmt-merge-msg.c\nindex a788369..772414f 100644\n--- a/builtin-fmt-merge-msg.c\n+++ b/builtin-fmt-merge-msg.c\n@@ -1,6 +1,4 @@\n #include \"builtin.h\"\n-#include \"cache.h\"\n-#include \"commit.h\"\n #include \"diff.h\"\n #include \"revision.h\"\n #include \"tag.h\"\ndiff --git a/builtin-for-each-ref.c b/builtin-for-each-ref.c\nindex 5cbb4b0..ab9bfa4 100644\n--- a/builtin-for-each-ref.c\n+++ b/builtin-for-each-ref.c\n@@ -1,11 +1,9 @@\n #include \"builtin.h\"\n-#include \"cache.h\"\n-#include \"refs.h\"\n+#include \"blob.h\"\n #include \"object.h\"\n+#include \"refs.h\"\n #include \"tag.h\"\n-#include \"commit.h\"\n #include \"tree.h\"\n-#include \"blob.h\"\n #include \"quote.h\"\n #include \"parse-options.h\"\n \ndiff --git a/builtin-fsck.c b/builtin-fsck.c\nindex 6436bc2..eae576a 100644\n--- a/builtin-fsck.c\n+++ b/builtin-fsck.c\n@@ -1,6 +1,4 @@\n #include \"builtin.h\"\n-#include \"cache.h\"\n-#include \"commit.h\"\n #include \"tree.h\"\n #include \"blob.h\"\n #include \"tag.h\"\ndiff --git a/builtin-gc.c b/builtin-gc.c\nindex fc556ed..fae3fde 100644\n--- a/builtin-gc.c\n+++ b/builtin-gc.c\n@@ -11,7 +11,6 @@\n  */\n \n #include \"builtin.h\"\n-#include \"cache.h\"\n #include \"parse-options.h\"\n #include \"run-command.h\"\n \ndiff --git a/builtin-grep.c b/builtin-grep.c\nindex 89489dd..aa5b973 100644\n--- a/builtin-grep.c\n+++ b/builtin-grep.c\n@@ -3,13 +3,11 @@\n  *\n  * Copyright (c) 2006 Junio C Hamano\n  */\n-#include \"cache.h\"\n+#include \"builtin.h\"\n #include \"blob.h\"\n #include \"tree.h\"\n-#include \"commit.h\"\n #include \"tag.h\"\n #include \"tree-walk.h\"\n-#include \"builtin.h\"\n #include \"grep.h\"\n \n #ifndef NO_EXTERNAL_GREP\ndiff --git a/builtin-help.c b/builtin-help.c\nindex 9b57a74..bdae8a3 100644\n--- a/builtin-help.c\n+++ b/builtin-help.c\n@@ -3,7 +3,6 @@\n  *\n  * Builtin help command\n  */\n-#include \"cache.h\"\n #include \"builtin.h\"\n #include \"exec_cmd.h\"\n #include \"common-cmds.h\"\ndiff --git a/builtin-init-db.c b/builtin-init-db.c\nindex fc63d0f..97728cd 100644\n--- a/builtin-init-db.c\n+++ b/builtin-init-db.c\n@@ -3,7 +3,6 @@\n  *\n  * Copyright (C) Linus Torvalds, 2005\n  */\n-#include \"cache.h\"\n #include \"builtin.h\"\n #include \"exec_cmd.h\"\n \ndiff --git a/builtin-log.c b/builtin-log.c\nindex c7a5772..5105c91 100644\n--- a/builtin-log.c\n+++ b/builtin-log.c\n@@ -4,13 +4,11 @@\n  * (C) Copyright 2006 Linus Torvalds\n  *\t\t 2006 Junio Hamano\n  */\n-#include \"cache.h\"\n+#include \"builtin.h\"\n #include \"color.h\"\n-#include \"commit.h\"\n #include \"diff.h\"\n #include \"revision.h\"\n #include \"log-tree.h\"\n-#include \"builtin.h\"\n #include \"tag.h\"\n #include \"reflog-walk.h\"\n #include \"patch-ids.h\"\ndiff --git a/builtin-ls-files.c b/builtin-ls-files.c\nindex 88e2697..4efd46c 100644\n--- a/builtin-ls-files.c\n+++ b/builtin-ls-files.c\n@@ -5,10 +5,9 @@\n  *\n  * Copyright (C) Linus Torvalds, 2005\n  */\n-#include \"cache.h\"\n+#include \"builtin.h\"\n #include \"quote.h\"\n #include \"dir.h\"\n-#include \"builtin.h\"\n #include \"tree.h\"\n #include \"parse-options.h\"\n \ndiff --git a/builtin-ls-remote.c b/builtin-ls-remote.c\nindex 78a88f7..5fe2af0 100644\n--- a/builtin-ls-remote.c\n+++ b/builtin-ls-remote.c\n@@ -1,5 +1,4 @@\n #include \"builtin.h\"\n-#include \"cache.h\"\n #include \"transport.h\"\n #include \"remote.h\"\n \ndiff --git a/builtin-ls-tree.c b/builtin-ls-tree.c\nindex 22008df..4516d14 100644\n--- a/builtin-ls-tree.c\n+++ b/builtin-ls-tree.c\n@@ -3,12 +3,10 @@\n  *\n  * Copyright (C) Linus Torvalds, 2005\n  */\n-#include \"cache.h\"\n+#include \"builtin.h\"\n #include \"blob.h\"\n #include \"tree.h\"\n-#include \"commit.h\"\n #include \"quote.h\"\n-#include \"builtin.h\"\n \n static int line_termination = '\\n';\n #define LS_RECURSIVE 1\ndiff --git a/builtin-mailinfo.c b/builtin-mailinfo.c\nindex 1eeeb4d..0139a00 100644\n--- a/builtin-mailinfo.c\n+++ b/builtin-mailinfo.c\n@@ -2,10 +2,8 @@\n  * Another stupid program, this one parsing the headers of an\n  * email to figure out authorship and subject\n  */\n-#include \"cache.h\"\n #include \"builtin.h\"\n #include \"utf8.h\"\n-#include \"strbuf.h\"\n \n static FILE *cmitmsg, *patchfile, *fin, *fout;\n \ndiff --git a/builtin-mailsplit.c b/builtin-mailsplit.c\nindex 71f3b3b..ea22d8b 100644\n--- a/builtin-mailsplit.c\n+++ b/builtin-mailsplit.c\n@@ -4,7 +4,6 @@\n  * It just splits a mbox into a list of files: \"0001\" \"0002\" ..\n  * so you can process them further from there.\n  */\n-#include \"cache.h\"\n #include \"builtin.h\"\n #include \"string-list.h\"\n \ndiff --git a/builtin-merge-base.c b/builtin-merge-base.c\nindex 03fc1c2..4f915e8 100644\n--- a/builtin-merge-base.c\n+++ b/builtin-merge-base.c\n@@ -1,6 +1,4 @@\n #include \"builtin.h\"\n-#include \"cache.h\"\n-#include \"commit.h\"\n #include \"parse-options.h\"\n \n static int show_merge_base(struct commit **rev, int rev_nr, int show_all)\ndiff --git a/builtin-merge-file.c b/builtin-merge-file.c\nindex 96edb97..7589d61 100644\n--- a/builtin-merge-file.c\n+++ b/builtin-merge-file.c\n@@ -1,5 +1,4 @@\n #include \"builtin.h\"\n-#include \"cache.h\"\n #include \"xdiff/xdiff.h\"\n #include \"xdiff-interface.h\"\n #include \"parse-options.h\"\ndiff --git a/builtin-merge-ours.c b/builtin-merge-ours.c\nindex 8f5bbaf..33b85d0 100644\n--- a/builtin-merge-ours.c\n+++ b/builtin-merge-ours.c\n@@ -7,7 +7,6 @@\n  *\n  * Pretend we resolved the heads, but declare our tree trumps everybody else.\n  */\n-#include \"git-compat-util.h\"\n #include \"builtin.h\"\n \n static const char *diff_index_args[] = {\ndiff --git a/builtin-merge.c b/builtin-merge.c\nindex 4c11935..cb4c645 100644\n--- a/builtin-merge.c\n+++ b/builtin-merge.c\n@@ -6,13 +6,11 @@\n  * Based on git-merge.sh by Junio C Hamano.\n  */\n \n-#include \"cache.h\"\n-#include \"parse-options.h\"\n #include \"builtin.h\"\n+#include \"parse-options.h\"\n #include \"run-command.h\"\n #include \"diff.h\"\n #include \"refs.h\"\n-#include \"commit.h\"\n #include \"diffcore.h\"\n #include \"revision.h\"\n #include \"unpack-trees.h\"\ndiff --git a/builtin-mv.c b/builtin-mv.c\nindex 01270fe..659471b 100644\n--- a/builtin-mv.c\n+++ b/builtin-mv.c\n@@ -3,7 +3,6 @@\n  *\n  * Copyright (C) 2006 Johannes Schindelin\n  */\n-#include \"cache.h\"\n #include \"builtin.h\"\n #include \"dir.h\"\n #include \"cache-tree.h\"\ndiff --git a/builtin-name-rev.c b/builtin-name-rev.c\nindex 08c8aab..386cafe 100644\n--- a/builtin-name-rev.c\n+++ b/builtin-name-rev.c\n@@ -1,6 +1,4 @@\n #include \"builtin.h\"\n-#include \"cache.h\"\n-#include \"commit.h\"\n #include \"tag.h\"\n #include \"refs.h\"\n #include \"parse-options.h\"\ndiff --git a/builtin-pack-objects.c b/builtin-pack-objects.c\nindex 2000d97..fe7a8de 100644\n--- a/builtin-pack-objects.c\n+++ b/builtin-pack-objects.c\n@@ -1,9 +1,7 @@\n #include \"builtin.h\"\n-#include \"cache.h\"\n #include \"attr.h\"\n #include \"object.h\"\n #include \"blob.h\"\n-#include \"commit.h\"\n #include \"tag.h\"\n #include \"tree.h\"\n #include \"delta.h\"\ndiff --git a/builtin-prune-packed.c b/builtin-prune-packed.c\nindex 2d5b2cd..99f9fab 100644\n--- a/builtin-prune-packed.c\n+++ b/builtin-prune-packed.c\n@@ -1,5 +1,4 @@\n #include \"builtin.h\"\n-#include \"cache.h\"\n #include \"progress.h\"\n \n static const char prune_packed_usage[] =\ndiff --git a/builtin-prune.c b/builtin-prune.c\nindex 545e9c1..caf2751 100644\n--- a/builtin-prune.c\n+++ b/builtin-prune.c\n@@ -1,8 +1,6 @@\n-#include \"cache.h\"\n-#include \"commit.h\"\n+#include \"builtin.h\"\n #include \"diff.h\"\n #include \"revision.h\"\n-#include \"builtin.h\"\n #include \"reachable.h\"\n #include \"parse-options.h\"\n #include \"dir.h\"\ndiff --git a/builtin-push.c b/builtin-push.c\nindex 2eabcd3..128bfd8 100644\n--- a/builtin-push.c\n+++ b/builtin-push.c\n@@ -1,10 +1,9 @@\n /*\n  * \"git push\"\n  */\n-#include \"cache.h\"\n+#include \"builtin.h\"\n #include \"refs.h\"\n #include \"run-command.h\"\n-#include \"builtin.h\"\n #include \"remote.h\"\n #include \"transport.h\"\n #include \"parse-options.h\"\ndiff --git a/builtin-read-tree.c b/builtin-read-tree.c\nindex 8e02738..dd4a9f6 100644\n--- a/builtin-read-tree.c\n+++ b/builtin-read-tree.c\n@@ -4,14 +4,13 @@\n  * Copyright (C) Linus Torvalds, 2005\n  */\n \n-#include \"cache.h\"\n+#include \"builtin.h\"\n #include \"object.h\"\n #include \"tree.h\"\n #include \"tree-walk.h\"\n #include \"cache-tree.h\"\n #include \"unpack-trees.h\"\n #include \"dir.h\"\n-#include \"builtin.h\"\n \n static int nr_trees;\n static struct tree *trees[MAX_UNPACK_TREES];\ndiff --git a/builtin-reflog.c b/builtin-reflog.c\nindex d95f515..fcd92e8 100644\n--- a/builtin-reflog.c\n+++ b/builtin-reflog.c\n@@ -1,6 +1,4 @@\n-#include \"cache.h\"\n #include \"builtin.h\"\n-#include \"commit.h\"\n #include \"refs.h\"\n #include \"dir.h\"\n #include \"tree-walk.h\"\ndiff --git a/builtin-rerere.c b/builtin-rerere.c\nindex 020af73..d0a6ebb 100644\n--- a/builtin-rerere.c\n+++ b/builtin-rerere.c\n@@ -1,5 +1,4 @@\n #include \"builtin.h\"\n-#include \"cache.h\"\n #include \"dir.h\"\n #include \"string-list.h\"\n #include \"rerere.h\"\ndiff --git a/builtin-rev-list.c b/builtin-rev-list.c\nindex 40d5fcb..bc86e3c 100644\n--- a/builtin-rev-list.c\n+++ b/builtin-rev-list.c\n@@ -1,14 +1,12 @@\n-#include \"cache.h\"\n+#include \"builtin.h\"\n+#include \"blob.h\"\n #include \"refs.h\"\n #include \"tag.h\"\n-#include \"commit.h\"\n #include \"tree.h\"\n-#include \"blob.h\"\n #include \"tree-walk.h\"\n #include \"diff.h\"\n #include \"revision.h\"\n #include \"list-objects.h\"\n-#include \"builtin.h\"\n #include \"log-tree.h\"\n #include \"graph.h\"\n \ndiff --git a/builtin-revert.c b/builtin-revert.c\nindex 3f2614e..90fea7d 100644\n--- a/builtin-revert.c\n+++ b/builtin-revert.c\n@@ -1,7 +1,5 @@\n-#include \"cache.h\"\n #include \"builtin.h\"\n #include \"object.h\"\n-#include \"commit.h\"\n #include \"tag.h\"\n #include \"wt-status.h\"\n #include \"run-command.h\"\ndiff --git a/builtin-rm.c b/builtin-rm.c\nindex 269d608..7fb865a 100644\n--- a/builtin-rm.c\n+++ b/builtin-rm.c\n@@ -3,7 +3,6 @@\n  *\n  * Copyright (C) Linus Torvalds 2006\n  */\n-#include \"cache.h\"\n #include \"builtin.h\"\n #include \"dir.h\"\n #include \"cache-tree.h\"\ndiff --git a/builtin-shortlog.c b/builtin-shortlog.c\nindex b28091b..9b6662b 100644\n--- a/builtin-shortlog.c\n+++ b/builtin-shortlog.c\n@@ -1,6 +1,4 @@\n #include \"builtin.h\"\n-#include \"cache.h\"\n-#include \"commit.h\"\n #include \"diff.h\"\n #include \"string-list.h\"\n #include \"revision.h\"\ndiff --git a/builtin-show-branch.c b/builtin-show-branch.c\nindex 828e6f8..02c2c5c 100644\n--- a/builtin-show-branch.c\n+++ b/builtin-show-branch.c\n@@ -1,7 +1,5 @@\n-#include \"cache.h\"\n-#include \"commit.h\"\n-#include \"refs.h\"\n #include \"builtin.h\"\n+#include \"refs.h\"\n \n static const char show_branch_usage[] =\n \"git show-branch [--sparse] [--current] [--all] [--remotes] [--topo-order] [--more=count | --list | --independent | --merge-base ] [--topics] [<refs>...] | --reflog[=n[,b]] <branch>\";\ndiff --git a/builtin-show-ref.c b/builtin-show-ref.c\nindex dc76c50..619b64e 100644\n--- a/builtin-show-ref.c\n+++ b/builtin-show-ref.c\n@@ -1,5 +1,4 @@\n #include \"builtin.h\"\n-#include \"cache.h\"\n #include \"refs.h\"\n #include \"object.h\"\n #include \"tag.h\"\ndiff --git a/builtin-stripspace.c b/builtin-stripspace.c\nindex d6e3896..126b37a 100644\n--- a/builtin-stripspace.c\n+++ b/builtin-stripspace.c\n@@ -1,5 +1,4 @@\n #include \"builtin.h\"\n-#include \"cache.h\"\n \n /*\n  * Returns the length of a line, without trailing spaces.\ndiff --git a/builtin-symbolic-ref.c b/builtin-symbolic-ref.c\nindex 6ae6bcc..41814bf 100644\n--- a/builtin-symbolic-ref.c\n+++ b/builtin-symbolic-ref.c\n@@ -1,5 +1,4 @@\n #include \"builtin.h\"\n-#include \"cache.h\"\n #include \"refs.h\"\n #include \"parse-options.h\"\n \ndiff --git a/builtin-tag.c b/builtin-tag.c\nindex 01e7374..15f4ab7 100644\n--- a/builtin-tag.c\n+++ b/builtin-tag.c\n@@ -6,7 +6,6 @@\n  * Based on git-tag.sh and mktag.c by Linus Torvalds.\n  */\n \n-#include \"cache.h\"\n #include \"builtin.h\"\n #include \"refs.h\"\n #include \"tag.h\"\ndiff --git a/builtin-tar-tree.c b/builtin-tar-tree.c\nindex 0713bca..9707eea 100644\n--- a/builtin-tar-tree.c\n+++ b/builtin-tar-tree.c\n@@ -1,8 +1,6 @@\n /*\n  * Copyright (c) 2005, 2006 Rene Scharfe\n  */\n-#include \"cache.h\"\n-#include \"commit.h\"\n #include \"tar.h\"\n #include \"builtin.h\"\n #include \"quote.h\"\ndiff --git a/builtin-unpack-objects.c b/builtin-unpack-objects.c\nindex 9a77323..4f5495d 100644\n--- a/builtin-unpack-objects.c\n+++ b/builtin-unpack-objects.c\n@@ -1,10 +1,8 @@\n #include \"builtin.h\"\n-#include \"cache.h\"\n #include \"object.h\"\n #include \"delta.h\"\n #include \"pack.h\"\n #include \"blob.h\"\n-#include \"commit.h\"\n #include \"tag.h\"\n #include \"tree.h\"\n #include \"tree-walk.h\"\ndiff --git a/builtin-update-index.c b/builtin-update-index.c\nindex 1fde893..9a006bd 100644\n--- a/builtin-update-index.c\n+++ b/builtin-update-index.c\n@@ -3,11 +3,10 @@\n  *\n  * Copyright (C) Linus Torvalds, 2005\n  */\n-#include \"cache.h\"\n+#include \"builtin.h\"\n #include \"quote.h\"\n #include \"cache-tree.h\"\n #include \"tree-walk.h\"\n-#include \"builtin.h\"\n #include \"refs.h\"\n \n /*\ndiff --git a/builtin-update-ref.c b/builtin-update-ref.c\nindex 378dc1b..cac86ef 100644\n--- a/builtin-update-ref.c\n+++ b/builtin-update-ref.c\n@@ -1,6 +1,5 @@\n-#include \"cache.h\"\n-#include \"refs.h\"\n #include \"builtin.h\"\n+#include \"refs.h\"\n #include \"parse-options.h\"\n \n static const char * const git_update_ref_usage[] = {\ndiff --git a/builtin-upload-archive.c b/builtin-upload-archive.c\nindex 0206b41..fe29d7b 100644\n--- a/builtin-upload-archive.c\n+++ b/builtin-upload-archive.c\n@@ -1,7 +1,6 @@\n /*\n  * Copyright (c) 2006 Franck Bui-Huu\n  */\n-#include \"cache.h\"\n #include \"builtin.h\"\n #include \"archive.h\"\n #include \"pkt-line.h\"\ndiff --git a/builtin-verify-pack.c b/builtin-verify-pack.c\nindex 0ee0a9a..070455f 100644\n--- a/builtin-verify-pack.c\n+++ b/builtin-verify-pack.c\n@@ -1,5 +1,4 @@\n #include \"builtin.h\"\n-#include \"cache.h\"\n #include \"pack.h\"\n #include \"pack-revindex.h\"\n \ndiff --git a/builtin-verify-tag.c b/builtin-verify-tag.c\nindex 729a159..039fe0a 100644\n--- a/builtin-verify-tag.c\n+++ b/builtin-verify-tag.c\n@@ -5,7 +5,6 @@\n  *\n  * Based on git-verify-tag.sh\n  */\n-#include \"cache.h\"\n #include \"builtin.h\"\n #include \"tag.h\"\n #include \"run-command.h\"\ndiff --git a/builtin-write-tree.c b/builtin-write-tree.c\nindex 9d64050..f1ce5e5 100644\n--- a/builtin-write-tree.c\n+++ b/builtin-write-tree.c\n@@ -4,7 +4,6 @@\n  * Copyright (C) Linus Torvalds, 2005\n  */\n #include \"builtin.h\"\n-#include \"cache.h\"\n #include \"tree.h\"\n #include \"cache-tree.h\"\n \ndiff --git a/diff-no-index.c b/diff-no-index.c\nindex 42c1dd8..cb68b8d 100644\n--- a/diff-no-index.c\n+++ b/diff-no-index.c\n@@ -4,16 +4,14 @@\n  * Copyright (c) 2008 by Junio C Hamano\n  */\n \n-#include \"cache.h\"\n+#include \"builtin.h\"\n #include \"color.h\"\n-#include \"commit.h\"\n #include \"blob.h\"\n #include \"tag.h\"\n #include \"diff.h\"\n #include \"diffcore.h\"\n #include \"revision.h\"\n #include \"log-tree.h\"\n-#include \"builtin.h\"\n #include \"string-list.h\"\n \n static int read_directory(const char *path, struct string_list *list)\ndiff --git a/fast-import.c b/fast-import.c\nindex db44da3..e3c138f 100644\n--- a/fast-import.c\n+++ b/fast-import.c\n@@ -141,11 +141,9 @@ Format of STDIN stream:\n */\n \n #include \"builtin.h\"\n-#include \"cache.h\"\n #include \"object.h\"\n #include \"blob.h\"\n #include \"tree.h\"\n-#include \"commit.h\"\n #include \"delta.h\"\n #include \"pack.h\"\n #include \"refs.h\"\ndiff --git a/git.c b/git.c\nindex c2b181e..b6c1884 100644\n--- a/git.c\n+++ b/git.c\n@@ -1,6 +1,5 @@\n #include \"builtin.h\"\n #include \"exec_cmd.h\"\n-#include \"cache.h\"\n #include \"quote.h\"\n #include \"run-command.h\"\n \ndiff --git a/help.c b/help.c\nindex fd87bb5..7edbc43 100644\n--- a/help.c\n+++ b/help.c\n@@ -1,4 +1,3 @@\n-#include \"cache.h\"\n #include \"builtin.h\"\n #include \"exec_cmd.h\"\n #include \"levenshtein.h\"\ndiff --git a/merge-recursive.c b/merge-recursive.c\nindex 3e1bc3e..352677c 100644\n--- a/merge-recursive.c\n+++ b/merge-recursive.c\n@@ -3,11 +3,9 @@\n  * Fredrik Kuivinen.\n  * The thieves were Alex Riesen and Johannes Schindelin, in June/July 2006\n  */\n-#include \"cache.h\"\n-#include \"cache-tree.h\"\n-#include \"commit.h\"\n-#include \"blob.h\"\n #include \"builtin.h\"\n+#include \"blob.h\"\n+#include \"cache-tree.h\"\n #include \"tree-walk.h\"\n #include \"diff.h\"\n #include \"diffcore.h\"\n-- \n1.6.1.3\n"},{"id":"109873","messageId":"1238406925-15907-3-git-send-email-nathaniel.dawson@gmail.com","threadId":"18638","inReplyTo":"1238406925-15907-2-git-send-email-nathaniel.dawson@gmail.com","subject":"[PATCH 2/5] Header includes cleanup","fromName":"Nathaniel P Dawson","fromEmail":"nathaniel.dawson@gmail.com","sentAt":"2009-03-30T09:55:22Z","receivedAt":"2009-03-30T09:55:22Z","isPatch":true,"sender":{"key":"nathaniel.dawson@gmail.com","avatar":null},"body":"Deleted header includes of object.h where blob.h was included since blob.h includes it.\n\nSigned-off-by: Nathaniel P Dawson <nathaniel.dawson@gmail.com>\n---\n alloc.c                  |    1 -\n builtin-for-each-ref.c   |    1 -\n builtin-pack-objects.c   |    1 -\n builtin-unpack-objects.c |    3 +--\n fast-import.c            |    1 -\n fsck.c                   |    1 -\n object.c                 |    1 -\n 7 files changed, 1 insertions(+), 8 deletions(-)\n\ndiff --git a/alloc.c b/alloc.c\nindex 216c23a..5b3d4a2 100644\n--- a/alloc.c\n+++ b/alloc.c\n@@ -10,7 +10,6 @@\n  * for the new allocation is.\n  */\n #include \"cache.h\"\n-#include \"object.h\"\n #include \"blob.h\"\n #include \"tree.h\"\n #include \"commit.h\"\ndiff --git a/builtin-for-each-ref.c b/builtin-for-each-ref.c\nindex ab9bfa4..6cbfb03 100644\n--- a/builtin-for-each-ref.c\n+++ b/builtin-for-each-ref.c\n@@ -1,6 +1,5 @@\n #include \"builtin.h\"\n #include \"blob.h\"\n-#include \"object.h\"\n #include \"refs.h\"\n #include \"tag.h\"\n #include \"tree.h\"\ndiff --git a/builtin-pack-objects.c b/builtin-pack-objects.c\nindex fe7a8de..c53147a 100644\n--- a/builtin-pack-objects.c\n+++ b/builtin-pack-objects.c\n@@ -1,6 +1,5 @@\n #include \"builtin.h\"\n #include \"attr.h\"\n-#include \"object.h\"\n #include \"blob.h\"\n #include \"tag.h\"\n #include \"tree.h\"\ndiff --git a/builtin-unpack-objects.c b/builtin-unpack-objects.c\nindex 4f5495d..674bede 100644\n--- a/builtin-unpack-objects.c\n+++ b/builtin-unpack-objects.c\n@@ -1,8 +1,7 @@\n #include \"builtin.h\"\n-#include \"object.h\"\n+#include \"blob.h\"\n #include \"delta.h\"\n #include \"pack.h\"\n-#include \"blob.h\"\n #include \"tag.h\"\n #include \"tree.h\"\n #include \"tree-walk.h\"\ndiff --git a/fast-import.c b/fast-import.c\nindex e3c138f..8d1d9f3 100644\n--- a/fast-import.c\n+++ b/fast-import.c\n@@ -141,7 +141,6 @@ Format of STDIN stream:\n */\n \n #include \"builtin.h\"\n-#include \"object.h\"\n #include \"blob.h\"\n #include \"tree.h\"\n #include \"delta.h\"\ndiff --git a/fsck.c b/fsck.c\nindex 511b82c..e903f6a 100644\n--- a/fsck.c\n+++ b/fsck.c\n@@ -1,5 +1,4 @@\n #include \"cache.h\"\n-#include \"object.h\"\n #include \"blob.h\"\n #include \"tree.h\"\n #include \"tree-walk.h\"\ndiff --git a/object.c b/object.c\nindex 7e6a92c..380652f 100644\n--- a/object.c\n+++ b/object.c\n@@ -1,5 +1,4 @@\n #include \"cache.h\"\n-#include \"object.h\"\n #include \"blob.h\"\n #include \"tree.h\"\n #include \"commit.h\"\n-- \n1.6.1.3\n"},{"id":"109872","messageId":"1238406925-15907-4-git-send-email-nathaniel.dawson@gmail.com","threadId":"18638","inReplyTo":"1238406925-15907-3-git-send-email-nathaniel.dawson@gmail.com","subject":"[PATCH 3/5] Header includes cleanup","fromName":"Nathaniel P Dawson","fromEmail":"nathaniel.dawson@gmail.com","sentAt":"2009-03-30T09:55:23Z","receivedAt":"2009-03-30T09:55:23Z","isPatch":true,"sender":{"key":"nathaniel.dawson@gmail.com","avatar":null},"body":"Deleted header includes of git-compat-util.h, strbuf.h, hash.h where cache.h was included since cache.h includes them.\n\nSigned-off-by: Nathaniel P Dawson <nathaniel.dawson@gmail.com>\n---\n builtin-clone.c   |    1 -\n builtin-remote.c  |    1 -\n connect.c         |    1 -\n diffcore-rename.c |    1 -\n editor.c          |    1 -\n hash.c            |    1 -\n parse-options.c   |    3 +--\n shell.c           |    1 -\n test-delta.c      |    3 +--\n 9 files changed, 2 insertions(+), 11 deletions(-)\n\ndiff --git a/builtin-clone.c b/builtin-clone.c\nindex 0031b5f..50cb6ba 100644\n--- a/builtin-clone.c\n+++ b/builtin-clone.c\n@@ -16,7 +16,6 @@\n #include \"tree-walk.h\"\n #include \"unpack-trees.h\"\n #include \"transport.h\"\n-#include \"strbuf.h\"\n #include \"dir.h\"\n #include \"pack-refs.h\"\n #include \"sigchain.h\"\ndiff --git a/builtin-remote.c b/builtin-remote.c\nindex 9ef846f..5bf8042 100644\n--- a/builtin-remote.c\n+++ b/builtin-remote.c\n@@ -3,7 +3,6 @@\n #include \"transport.h\"\n #include \"remote.h\"\n #include \"string-list.h\"\n-#include \"strbuf.h\"\n #include \"run-command.h\"\n #include \"refs.h\"\n \ndiff --git a/connect.c b/connect.c\nindex 7636bf9..12a5c2b 100644\n--- a/connect.c\n+++ b/connect.c\n@@ -1,4 +1,3 @@\n-#include \"git-compat-util.h\"\n #include \"cache.h\"\n #include \"pkt-line.h\"\n #include \"quote.h\"\ndiff --git a/diffcore-rename.c b/diffcore-rename.c\nindex 0b0d6b8..00e1ce1 100644\n--- a/diffcore-rename.c\n+++ b/diffcore-rename.c\n@@ -4,7 +4,6 @@\n #include \"cache.h\"\n #include \"diff.h\"\n #include \"diffcore.h\"\n-#include \"hash.h\"\n \n /* Table of rename/copy destinations */\n \ndiff --git a/editor.c b/editor.c\nindex 4d469d0..22fd4c0 100644\n--- a/editor.c\n+++ b/editor.c\n@@ -1,5 +1,4 @@\n #include \"cache.h\"\n-#include \"strbuf.h\"\n #include \"run-command.h\"\n \n int launch_editor(const char *path, struct strbuf *buffer, const char *const *env)\ndiff --git a/hash.c b/hash.c\nindex 1cd4c9d..5a68fdf 100644\n--- a/hash.c\n+++ b/hash.c\n@@ -2,7 +2,6 @@\n  * Some generic hashing helpers.\n  */\n #include \"cache.h\"\n-#include \"hash.h\"\n \n /*\n  * Look up a hash entry in the hash table. Return the pointer to\ndiff --git a/parse-options.c b/parse-options.c\nindex cf71bcf..bafeeea 100644\n--- a/parse-options.c\n+++ b/parse-options.c\n@@ -1,6 +1,5 @@\n-#include \"git-compat-util.h\"\n-#include \"parse-options.h\"\n #include \"cache.h\"\n+#include \"parse-options.h\"\n #include \"commit.h\"\n \n #define OPT_SHORT 1\ndiff --git a/shell.c b/shell.c\nindex e339369..37c52c2 100644\n--- a/shell.c\n+++ b/shell.c\n@@ -1,7 +1,6 @@\n #include \"cache.h\"\n #include \"quote.h\"\n #include \"exec_cmd.h\"\n-#include \"strbuf.h\"\n \n static int do_generic_cmd(const char *me, char *arg)\n {\ndiff --git a/test-delta.c b/test-delta.c\nindex 3d885ff..3d90611 100644\n--- a/test-delta.c\n+++ b/test-delta.c\n@@ -8,9 +8,8 @@\n  * published by the Free Software Foundation.\n  */\n \n-#include \"git-compat-util.h\"\n-#include \"delta.h\"\n #include \"cache.h\"\n+#include \"delta.h\"\n \n static const char usage_str[] =\n \t\"test-delta (-d|-p) <from_file> <data_file> <out_file>\";\n-- \n1.6.1.3\n"},{"id":"109876","messageId":"1238406925-15907-5-git-send-email-nathaniel.dawson@gmail.com","threadId":"18638","inReplyTo":"1238406925-15907-4-git-send-email-nathaniel.dawson@gmail.com","subject":"[PATCH 4/5] Header includes cleanup","fromName":"Nathaniel P Dawson","fromEmail":"nathaniel.dawson@gmail.com","sentAt":"2009-03-30T09:55:24Z","receivedAt":"2009-03-30T09:55:24Z","isPatch":true,"sender":{"key":"nathaniel.dawson@gmail.com","avatar":null},"body":"Deleted header includes of object.h, tree.h, strbuf.h, and decorate.h where commit.h was included since commit.h includes them.\n\nSigned-off-by: Nathaniel P Dawson <nathaniel.dawson@gmail.com>\n---\n alloc.c                |    1 -\n builtin-receive-pack.c |    1 -\n builtin-reset.c        |    2 --\n builtin.h              |    2 --\n bundle.c               |    1 -\n fsck.c                 |    3 +--\n index-pack.c           |    1 -\n list-objects.c         |    1 -\n object.c               |    1 -\n read-cache.c           |    1 -\n revision.c             |    2 --\n server-info.c          |    1 -\n sha1_file.c            |    1 -\n sha1_name.c            |    1 -\n tag.c                  |    1 -\n tree.c                 |    3 +--\n upload-pack.c          |    1 -\n walker.c               |    1 -\n wt-status.c            |    3 +--\n 19 files changed, 3 insertions(+), 25 deletions(-)\n\ndiff --git a/alloc.c b/alloc.c\nindex 5b3d4a2..af0dd88 100644\n--- a/alloc.c\n+++ b/alloc.c\n@@ -11,7 +11,6 @@\n  */\n #include \"cache.h\"\n #include \"blob.h\"\n-#include \"tree.h\"\n #include \"commit.h\"\n #include \"tag.h\"\n \ndiff --git a/builtin-receive-pack.c b/builtin-receive-pack.c\nindex a970b39..e95aa41 100644\n--- a/builtin-receive-pack.c\n+++ b/builtin-receive-pack.c\n@@ -5,7 +5,6 @@\n #include \"run-command.h\"\n #include \"exec_cmd.h\"\n #include \"commit.h\"\n-#include \"object.h\"\n #include \"remote.h\"\n #include \"transport.h\"\n \ndiff --git a/builtin-reset.c b/builtin-reset.c\nindex c0cb915..d44c935 100644\n--- a/builtin-reset.c\n+++ b/builtin-reset.c\n@@ -9,13 +9,11 @@\n  */\n #include \"cache.h\"\n #include \"tag.h\"\n-#include \"object.h\"\n #include \"commit.h\"\n #include \"run-command.h\"\n #include \"refs.h\"\n #include \"diff.h\"\n #include \"diffcore.h\"\n-#include \"tree.h\"\n #include \"branch.h\"\n #include \"parse-options.h\"\n \ndiff --git a/builtin.h b/builtin.h\nindex 1495cf6..b9ef9fc 100644\n--- a/builtin.h\n+++ b/builtin.h\n@@ -1,8 +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\"\n \ndiff --git a/bundle.c b/bundle.c\nindex d0dd818..14966f8 100644\n--- a/bundle.c\n+++ b/bundle.c\n@@ -1,6 +1,5 @@\n #include \"cache.h\"\n #include \"bundle.h\"\n-#include \"object.h\"\n #include \"commit.h\"\n #include \"diff.h\"\n #include \"revision.h\"\ndiff --git a/fsck.c b/fsck.c\nindex e903f6a..8cbb6aa 100644\n--- a/fsck.c\n+++ b/fsck.c\n@@ -1,8 +1,7 @@\n #include \"cache.h\"\n #include \"blob.h\"\n-#include \"tree.h\"\n-#include \"tree-walk.h\"\n #include \"commit.h\"\n+#include \"tree-walk.h\"\n #include \"tag.h\"\n #include \"fsck.h\"\n \ndiff --git a/index-pack.c b/index-pack.c\nindex 7546822..ac6fc84 100644\n--- a/index-pack.c\n+++ b/index-pack.c\n@@ -5,7 +5,6 @@\n #include \"blob.h\"\n #include \"commit.h\"\n #include \"tag.h\"\n-#include \"tree.h\"\n #include \"progress.h\"\n #include \"fsck.h\"\n #include \"exec_cmd.h\"\ndiff --git a/list-objects.c b/list-objects.c\nindex c8b8375..6446f81 100644\n--- a/list-objects.c\n+++ b/list-objects.c\n@@ -1,7 +1,6 @@\n #include \"cache.h\"\n #include \"tag.h\"\n #include \"commit.h\"\n-#include \"tree.h\"\n #include \"blob.h\"\n #include \"diff.h\"\n #include \"tree-walk.h\"\ndiff --git a/object.c b/object.c\nindex 380652f..83f786c 100644\n--- a/object.c\n+++ b/object.c\n@@ -1,6 +1,5 @@\n #include \"cache.h\"\n #include \"blob.h\"\n-#include \"tree.h\"\n #include \"commit.h\"\n #include \"tag.h\"\n \ndiff --git a/read-cache.c b/read-cache.c\nindex 3f58711..b50b02e 100644\n--- a/read-cache.c\n+++ b/read-cache.c\n@@ -8,7 +8,6 @@\n #include \"cache-tree.h\"\n #include \"refs.h\"\n #include \"dir.h\"\n-#include \"tree.h\"\n #include \"commit.h\"\n #include \"diff.h\"\n #include \"diffcore.h\"\ndiff --git a/revision.c b/revision.c\nindex f5771c7..827108d 100644\n--- a/revision.c\n+++ b/revision.c\n@@ -1,7 +1,6 @@\n #include \"cache.h\"\n #include \"tag.h\"\n #include \"blob.h\"\n-#include \"tree.h\"\n #include \"commit.h\"\n #include \"diff.h\"\n #include \"refs.h\"\n@@ -10,7 +9,6 @@\n #include \"grep.h\"\n #include \"reflog-walk.h\"\n #include \"patch-ids.h\"\n-#include \"decorate.h\"\n #include \"log-tree.h\"\n \n volatile show_early_output_fn_t show_early_output;\ndiff --git a/server-info.c b/server-info.c\nindex 66b0d9d..3d54c44 100644\n--- a/server-info.c\n+++ b/server-info.c\n@@ -1,6 +1,5 @@\n #include \"cache.h\"\n #include \"refs.h\"\n-#include \"object.h\"\n #include \"commit.h\"\n #include \"tag.h\"\n \ndiff --git a/sha1_file.c b/sha1_file.c\nindex 54972f9..77e6f54 100644\n--- a/sha1_file.c\n+++ b/sha1_file.c\n@@ -12,7 +12,6 @@\n #include \"blob.h\"\n #include \"commit.h\"\n #include \"tag.h\"\n-#include \"tree.h\"\n #include \"refs.h\"\n #include \"pack-revindex.h\"\n #include \"sha1-lookup.h\"\ndiff --git a/sha1_name.c b/sha1_name.c\nindex 2f75179..c98cd30 100644\n--- a/sha1_name.c\n+++ b/sha1_name.c\n@@ -1,7 +1,6 @@\n #include \"cache.h\"\n #include \"tag.h\"\n #include \"commit.h\"\n-#include \"tree.h\"\n #include \"blob.h\"\n #include \"tree-walk.h\"\n #include \"refs.h\"\ndiff --git a/tag.c b/tag.c\nindex 4470d2b..94e2903 100644\n--- a/tag.c\n+++ b/tag.c\n@@ -1,7 +1,6 @@\n #include \"cache.h\"\n #include \"tag.h\"\n #include \"commit.h\"\n-#include \"tree.h\"\n #include \"blob.h\"\n \n const char *tag_type = \"tag\";\ndiff --git a/tree.c b/tree.c\nindex 25d2e29..b9e427d 100644\n--- a/tree.c\n+++ b/tree.c\n@@ -1,8 +1,7 @@\n #include \"cache.h\"\n #include \"cache-tree.h\"\n-#include \"tree.h\"\n-#include \"blob.h\"\n #include \"commit.h\"\n+#include \"blob.h\"\n #include \"tag.h\"\n #include \"tree-walk.h\"\n \ndiff --git a/upload-pack.c b/upload-pack.c\nindex a49d872..9a91b14 100644\n--- a/upload-pack.c\n+++ b/upload-pack.c\n@@ -3,7 +3,6 @@\n #include \"pkt-line.h\"\n #include \"sideband.h\"\n #include \"tag.h\"\n-#include \"object.h\"\n #include \"commit.h\"\n #include \"exec_cmd.h\"\n #include \"diff.h\"\ndiff --git a/walker.c b/walker.c\nindex e57630e..67ddcf6 100644\n--- a/walker.c\n+++ b/walker.c\n@@ -1,7 +1,6 @@\n #include \"cache.h\"\n #include \"walker.h\"\n #include \"commit.h\"\n-#include \"tree.h\"\n #include \"tree-walk.h\"\n #include \"tag.h\"\n #include \"blob.h\"\ndiff --git a/wt-status.c b/wt-status.c\nindex 929b00f..125a4c4 100644\n--- a/wt-status.c\n+++ b/wt-status.c\n@@ -1,9 +1,8 @@\n #include \"cache.h\"\n #include \"wt-status.h\"\n #include \"color.h\"\n-#include \"object.h\"\n-#include \"dir.h\"\n #include \"commit.h\"\n+#include \"dir.h\"\n #include \"diff.h\"\n #include \"revision.h\"\n #include \"diffcore.h\"\n-- \n1.6.1.3\n"},{"id":"109875","messageId":"1238406925-15907-6-git-send-email-nathaniel.dawson@gmail.com","threadId":"18638","inReplyTo":"1238406925-15907-5-git-send-email-nathaniel.dawson@gmail.com","subject":"[PATCH 5/5] Header includes cleanup","fromName":"Nathaniel P Dawson","fromEmail":"nathaniel.dawson@gmail.com","sentAt":"2009-03-30T09:55:25Z","receivedAt":"2009-03-30T09:55:25Z","isPatch":true,"sender":{"key":"nathaniel.dawson@gmail.com","avatar":null},"body":"Deleted header includes of tree-walk.h where diff.h was included since diff.h includes it.\n\nSigned-off-by: Nathaniel P Dawson <nathaniel.dawson@gmail.com>\n---\n builtin-blame.c        |    1 -\n builtin-checkout.c     |    3 +--\n builtin-pack-objects.c |    1 -\n builtin-reflog.c       |    1 -\n builtin-rev-list.c     |    1 -\n list-objects.c         |    1 -\n merge-recursive.c      |    1 -\n 7 files changed, 1 insertions(+), 8 deletions(-)\n\ndiff --git a/builtin-blame.c b/builtin-blame.c\nindex a91d350..bce181c 100644\n--- a/builtin-blame.c\n+++ b/builtin-blame.c\n@@ -6,7 +6,6 @@\n #include \"builtin.h\"\n #include \"blob.h\"\n #include \"tag.h\"\n-#include \"tree-walk.h\"\n #include \"diff.h\"\n #include \"diffcore.h\"\n #include \"revision.h\"\ndiff --git a/builtin-checkout.c b/builtin-checkout.c\nindex f8bb9ea..3000e87 100644\n--- a/builtin-checkout.c\n+++ b/builtin-checkout.c\n@@ -3,13 +3,12 @@\n #include \"parse-options.h\"\n #include \"refs.h\"\n #include \"tree.h\"\n-#include \"tree-walk.h\"\n+#include \"diff.h\"\n #include \"unpack-trees.h\"\n #include \"dir.h\"\n #include \"run-command.h\"\n #include \"merge-recursive.h\"\n #include \"branch.h\"\n-#include \"diff.h\"\n #include \"revision.h\"\n #include \"remote.h\"\n #include \"xdiff-interface.h\"\ndiff --git a/builtin-pack-objects.c b/builtin-pack-objects.c\nindex c53147a..9d87fc7 100644\n--- a/builtin-pack-objects.c\n+++ b/builtin-pack-objects.c\n@@ -7,7 +7,6 @@\n #include \"pack.h\"\n #include \"pack-revindex.h\"\n #include \"csum-file.h\"\n-#include \"tree-walk.h\"\n #include \"diff.h\"\n #include \"revision.h\"\n #include \"list-objects.h\"\ndiff --git a/builtin-reflog.c b/builtin-reflog.c\nindex fcd92e8..4c122d6 100644\n--- a/builtin-reflog.c\n+++ b/builtin-reflog.c\n@@ -1,7 +1,6 @@\n #include \"builtin.h\"\n #include \"refs.h\"\n #include \"dir.h\"\n-#include \"tree-walk.h\"\n #include \"diff.h\"\n #include \"revision.h\"\n #include \"reachable.h\"\ndiff --git a/builtin-rev-list.c b/builtin-rev-list.c\nindex bc86e3c..cedfe9a 100644\n--- a/builtin-rev-list.c\n+++ b/builtin-rev-list.c\n@@ -3,7 +3,6 @@\n #include \"refs.h\"\n #include \"tag.h\"\n #include \"tree.h\"\n-#include \"tree-walk.h\"\n #include \"diff.h\"\n #include \"revision.h\"\n #include \"list-objects.h\"\ndiff --git a/list-objects.c b/list-objects.c\nindex 6446f81..715e06d 100644\n--- a/list-objects.c\n+++ b/list-objects.c\n@@ -3,7 +3,6 @@\n #include \"commit.h\"\n #include \"blob.h\"\n #include \"diff.h\"\n-#include \"tree-walk.h\"\n #include \"revision.h\"\n #include \"list-objects.h\"\n \ndiff --git a/merge-recursive.c b/merge-recursive.c\nindex 352677c..370151e 100644\n--- a/merge-recursive.c\n+++ b/merge-recursive.c\n@@ -6,7 +6,6 @@\n #include \"builtin.h\"\n #include \"blob.h\"\n #include \"cache-tree.h\"\n-#include \"tree-walk.h\"\n #include \"diff.h\"\n #include \"diffcore.h\"\n #include \"tag.h\"\n-- \n1.6.1.3\n"},{"id":"109884","messageId":"49D0A3DF.4000203@viscovery.net","threadId":"18638","inReplyTo":"1238406925-15907-1-git-send-email-nathaniel.dawson@gmail.com","subject":"Re: [PATCH 0/5] Header includes cleanup","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2009-03-30T10:50:07Z","receivedAt":"2009-03-30T10:50:07Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Please wrap your lines at ca. 75 columns.\n\nNathaniel P Dawson schrieb:\n> This is just the beginning for this project. I'm slowly cleaning up\n> the header includes one chunk at a time. I hope my patches aren't too\n> messy, I've learned how to better utilize git to make patches and\n> organize my commits logically so I'll submit neater chunks henceforth.\n> You can expect patches from me nightly until I've finished this project.\n\nYou have removed includes that are implied by other includes, i.e. if\nfoo.h includes bar.h, then you removed #include \"bar.h\" from *.c if there\nis #include \"foo.h\".\n\nIMO, this is not a good guiding principle to reduce includes. A better\nprinciple is to keep #include \"bar.h\" in a source or header file iff a\nfeature that is declared or defined in bar.h is *used* *directly* in that\nsource or header file, regardless of whether bar.h is included in foo.h\nthat is itself included in that source or header file.\n\nIf this latter principle is obeyed, then the build won't break by removing\nthe include of foo.h (for the reason that nothing of foo.h is *use*\n*directly* anymore).\n\n-- Hannes\n"},{"id":"109927","messageId":"20090330173319.GC25950@eiku.org","threadId":"18638","inReplyTo":"49D0A3DF.4000203@viscovery.net","subject":"Re: [PATCH 0/5] Header includes cleanup","fromName":"Nathaniel P Dawson","fromEmail":"nathaniel.dawson@gmail.com","sentAt":"2009-03-30T17:33:19Z","receivedAt":"2009-03-30T17:33:19Z","isPatch":true,"sender":{"key":"nathaniel.dawson@gmail.com","avatar":null},"body":"I'm sorry, I must have misunderstood the task on the janitor\nlist. Could you explain it a bit better so I would be able to do it\nproperly?\n\nAnd as for line wrapping I apologize, emacs on my laptop was\napparently not turning on auto-fill but has been rectified.\n\nRegards,\nNathaniel P Dawson\n\nOn Mon, Mar 30, 2009 at 12:50:07PM +0200, Johannes Sixt wrote:\n> Please wrap your lines at ca. 75 columns.\n> \n> Nathaniel P Dawson schrieb:\n> > This is just the beginning for this project. I'm slowly cleaning up\n> > the header includes one chunk at a time. I hope my patches aren't too\n> > messy, I've learned how to better utilize git to make patches and\n> > organize my commits logically so I'll submit neater chunks henceforth.\n> > You can expect patches from me nightly until I've finished this project.\n> \n> You have removed includes that are implied by other includes, i.e. if\n> foo.h includes bar.h, then you removed #include \"bar.h\" from *.c if there\n> is #include \"foo.h\".\n> \n> IMO, this is not a good guiding principle to reduce includes. A better\n> principle is to keep #include \"bar.h\" in a source or header file iff a\n> feature that is declared or defined in bar.h is *used* *directly* in that\n> source or header file, regardless of whether bar.h is included in foo.h\n> that is itself included in that source or header file.\n> \n> If this latter principle is obeyed, then the build won't break by removing\n> the include of foo.h (for the reason that nothing of foo.h is *use*\n> *directly* anymore).\n> \n> -- Hannes\n> \n"},{"id":"109972","messageId":"200903310753.11595.chriscool@tuxfamily.org","threadId":"18638","inReplyTo":"49D0A3DF.4000203@viscovery.net","subject":"Re: [PATCH 0/5] Header includes cleanup","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2009-03-31T05:53:11Z","receivedAt":"2009-03-31T05:53:11Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"Le lundi 30 mars 2009, Johannes Sixt a écrit :\n> Please wrap your lines at ca. 75 columns.\n>\n> Nathaniel P Dawson schrieb:\n> > This is just the beginning for this project. I'm slowly cleaning up\n> > the header includes one chunk at a time. I hope my patches aren't too\n> > messy, I've learned how to better utilize git to make patches and\n> > organize my commits logically so I'll submit neater chunks henceforth.\n> > You can expect patches from me nightly until I've finished this\n> > project.\n>\n> You have removed includes that are implied by other includes, i.e. if\n> foo.h includes bar.h, then you removed #include \"bar.h\" from *.c if there\n> is #include \"foo.h\".\n>\n> IMO, this is not a good guiding principle to reduce includes. A better\n> principle is to keep #include \"bar.h\" in a source or header file iff a\n> feature that is declared or defined in bar.h is *used* *directly* in that\n> source or header file, regardless of whether bar.h is included in foo.h\n> that is itself included in that source or header file.\n\nIn theory, it's perhaps the best way to do it. But we don't do that for \nsystem header includes. And I think it makes it very difficult to cleanup \nheader includes, because you have to check what is needed for each feature \nin a file. So I think we have to choose between basically no header include \ncleanup or a cleanup like the one Nathaniel started.\n\n> If this latter principle is obeyed, then the build won't break by\n> removing the include of foo.h (for the reason that nothing of foo.h is\n> *use* *directly* anymore).\n\nI think it's more likely that we will add features rather than remove some.\nAnd it's not very difficult if we remove some, to remove \"foo.h\" and \nadd \"bar.h\" at the same time.\n\nFor example, many files include \"cache.h\", does it really make sense to try \nto remove these #include because we could replace them by only includes \nof \"git-compat-util.h\" and \"hash.h\"? I don't think so.\n\nBest regards,\nChristian.\n"},{"id":"109978","messageId":"200903310859.36035.chriscool@tuxfamily.org","threadId":"18638","inReplyTo":"20090330173319.GC25950@eiku.org","subject":"Re: [PATCH 0/5] Header includes cleanup","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2009-03-31T06:59:35Z","receivedAt":"2009-03-31T06:59:35Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"Le lundi 30 mars 2009, Nathaniel P Dawson a écrit :\n> I'm sorry, I must have misunderstood the task on the janitor\n> list. Could you explain it a bit better so I would be able to do it\n> properly?\n\nActually I added this task to the Janitor page on the wiki because I was \ntired of having to find which other includes are needed each time I \ninclude \"revision.h\". And I think there are other worthwile include cleanup \nthat could be done.\n\nI think it's a good thing that you started working on it even if in the end \nwe decide that we want these cleanup to be done otherwise. At least we will \nhopefully have clarified our include header policy.\n\nThanks,\nChristian.\n"},{"id":"110023","messageId":"7vk56565m1.fsf@gitster.siamese.dyndns.org","threadId":"18638","inReplyTo":"200903310859.36035.chriscool@tuxfamily.org","subject":"Re: [PATCH 0/5] Header includes cleanup","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-03-31T16:04:38Z","receivedAt":"2009-03-31T16:04:38Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Christian Couder <chriscool@tuxfamily.org> writes:\n\n> I think it's a good thing that you started working on it even if in the end \n> we decide that we want these cleanup to be done otherwise. At least we will \n> hopefully have clarified our include header policy.\n\nBefore seeing a lot of patches to change #include all over the place, I'd\nlike to see a simple guiding principle described, not just a subjective \"I\nthink this makes things better\" but with \"... because of X and Y and Z\".\n\nThe document Documentation/CodingGuidelines describes the only policy that\nexists currently: git-compat-util.h must be the first thing the compiler\nsees.  The language should probably be stronger than what appears there:\n\n - The first #include in C files, except in platform specific\n   compat/ implementations, should be git-compat-util.h or another\n   well-known header file that includes it at the beginning, namely\n   cache.h or builtin.h.\n\nEven though http.h may include \"cache.h\" at the very beginning, I'd rather\nnot to see http-walker.c lose inclusion of \"cache.h\".  It will force us to\nremember that http.h is Ok to include as the first file, and that won't\nscale.\n\nThe reason git-compat-util.h must be the first is because inclusion of all\nthe system header files is supposed to happen there, and there are some\nplatforms that have broken system header dependencies we do not want\napplication writers to care about, and the compat-util header knows about\nthem.\n"},{"id":"110183","messageId":"200904020557.25058.chriscool@tuxfamily.org","threadId":"18638","inReplyTo":"7vk56565m1.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH 0/5] Header includes cleanup","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2009-04-02T03:57:24Z","receivedAt":"2009-04-02T03:57:24Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"Le mardi 31 mars 2009, Junio C Hamano a écrit :\n> Christian Couder <chriscool@tuxfamily.org> writes:\n> > I think it's a good thing that you started working on it even if in the\n> > end we decide that we want these cleanup to be done otherwise. At least\n> > we will hopefully have clarified our include header policy.\n>\n> Before seeing a lot of patches to change #include all over the place, I'd\n> like to see a simple guiding principle described, not just a subjective\n> \"I think this makes things better\" but with \"... because of X and Y and\n> Z\".\n>\n> The document Documentation/CodingGuidelines describes the only policy\n> that exists currently: git-compat-util.h must be the first thing the\n> compiler sees.  The language should probably be stronger than what\n> appears there:\n>\n>  - The first #include in C files, except in platform specific\n>    compat/ implementations, should be git-compat-util.h or another\n>    well-known header file that includes it at the beginning, namely\n>    cache.h or builtin.h.\n>\n> Even though http.h may include \"cache.h\" at the very beginning, I'd\n> rather not to see http-walker.c lose inclusion of \"cache.h\".  It will\n> force us to remember that http.h is Ok to include as the first file, and\n> that won't scale.\n>\n> The reason git-compat-util.h must be the first is because inclusion of\n> all the system header files is supposed to happen there, and there are\n> some platforms that have broken system header dependencies we do not want\n> application writers to care about, and the compat-util header knows about\n> them.\n\nOk, so I suggest the following simple guiding principles:\n\n- git-compat-util.h or cache.h or builtin.h should always be the first \n#include in C files,\n\n- header files should include other incude files if and only if the other \nincludes are needed to compile them,\n\n- a header file should be included in a C file only if it is needed to \ncompile the C file (it is not ok to include it only because it includes \nmany other headers that are needed)\n\n- other than the above rules, it is ok to reduce the number of includes as \nmuch as possible\n\nWhat do you think?\n\nBy the way, Nathaniel, you should try to give more meaningful titles to the \nindividual patches in your patch series and perhaps make them smaller so \nthat they are easier to review and have less conflicts with other patches.\n\nFor example your patch \"[PATCH 1/5] Header includes cleanup\" could be \nsplitted and the resulting patches could be renamed like this\n\n\"delete includes of 'git-compat-util.h' where 'builtin.h' is included\"\n\"delete includes of 'cache.h' where 'builtin.h' is included\"\n\"delete includes of 'strbuf.h' where 'builtin.h' is included\"\n\"delete includes of 'commit.h' where 'builtin.h' is included\"\n\nOr perhaps Junio would prefer that you work on a C file by C file basis? \nLike for example:\n\n\"delete useless includes in 'builtin-diff-files.c'\"\n\"delete useless includes in 'builtin-diff-index.c'\"\n...\n\nThanks,\nChristian.\n"},{"id":"110193","messageId":"7v8wmjk4p6.fsf@gitster.siamese.dyndns.org","threadId":"18638","inReplyTo":"200904020557.25058.chriscool@tuxfamily.org","subject":"Re: [PATCH 0/5] Header includes cleanup","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-04-02T05:25:09Z","receivedAt":"2009-04-02T05:25:09Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Christian Couder <chriscool@tuxfamily.org> writes:\n\n> Ok, so I suggest the following simple guiding principles:\n>\n> - git-compat-util.h or cache.h or builtin.h should always be the first \n> #include in C files,\n>\n> - header files should include other incude files if and only if the other \n> includes are needed to compile them,\n\nThis is unclear.\n\nLong before I started touching git, I used to be religious about making\nheader files self contained.  For a header file frotz.h in the project, I\nused to insist that\n\n\t$ cat >1.c <<\\EOF\n\t#include \"frotz.h\"\n        EOF\n        $ cc -Wall -c 1.c\n\ndid not fail.  \n\nAre you talking about that by \"to compile them\"?\n\nI stopped doing that long time ago, partly because the rule was cumbersome\nto enforce, but primarily because it was not helping much in the larger\npicture.\n\nSuch a rule, together with strict rules such as the order of including\nother header files in the header files themselves, may make life easier\nfor programmers who touch .c files but never .h files, because they can\ninclude only the necessary .h files and in any order.  But in practice,\npeople need to touch both .h and .c files and when they need to include\nnew system header files, they need to follow the inclusion order rule\nsomewhere anyway---at that point, it does not matter much if the rule\napplies to only .h files or both .h and .c files.\n\nSo for example, you cannot compile\n\n\t$ cat >1.c <<\\EOF\n        #include \"revision.h\"\n        EOF\n        $ cc -Wll -c 1.c\n\nin git.git project, but I do not think it is a problem.\n\n> - a header file should be included in a C file only if it is needed to \n> compile the C file (it is not ok to include it only because it includes \n> many other headers that are needed)\n\nIf that is the rule, perhaps the problem lies not in a .c program that\nincludes such a .h header, but in the .h itself that includes many other\nheader files.\n\n> - other than the above rules, it is ok to reduce the number of includes as \n> much as possible\n>\n> What do you think?\n\nWhat you did not write and I forgot to mention, which is a logical\nconclusion of the first rule, is that C files should not directly include\ncommon system header files such as unistd, sys/stat, etc.\n\nThere are exceptions to any rule.  For example, inclusion of syslog.h in\ndaemon.c is OK because most of the rest of the system does not even use\nsyslog.  If we later find a platform whose syslog.h has some funny\ninter-header dependencies, however, we will need to include it in the\ngit-compat-util.h and resolve the dependencies there, like we do for other\nsystem header files.\n\n> Or perhaps Junio would prefer that you work on a C file by C file basis? \n> Like for example:\n>\n> \"delete useless includes in 'builtin-diff-files.c'\"\n> \"delete useless includes in 'builtin-diff-index.c'\"\n\nIf the series does not involve .h file clean-up, then a series that\nconsists of one patch per .c file would be easier to handle, I think.\n"},{"id":"110207","messageId":"20090402112705.GD14599@sigill.intra.peff.net","threadId":"18638","inReplyTo":"7v8wmjk4p6.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH 0/5] Header includes cleanup","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-04-02T11:27:05Z","receivedAt":"2009-04-02T11:27:05Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Apr 01, 2009 at 10:25:09PM -0700, Junio C Hamano wrote:\n\n> > - a header file should be included in a C file only if it is needed to \n> > compile the C file (it is not ok to include it only because it includes \n> > many other headers that are needed)\n> \n> If that is the rule, perhaps the problem lies not in a .c program that\n> includes such a .h header, but in the .h itself that includes many other\n> header files.\n\nIf this were combined with splitting gigantic .h files (like cache.h)\ninto smaller logical units, then we could in theory speed up\nrecompilation times with make (we would also need to correctly track\nheader dependencies, but gcc -M can do this fairly easily).\n\nBut it does come at the price of actually having to consider which\ninclude files are necessary. I can't think of more than half a dozen\ntimes in the last year I have actually had to add a #include while\nworking on a git .c file, mostly because everything and the kitchen sink\nis included by cache.h.\n\nSo I don't know if it is worth it.\n\n-Peff\n"},{"id":"110265","messageId":"200904030558.30872.chriscool@tuxfamily.org","threadId":"18638","inReplyTo":"7v8wmjk4p6.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH 0/5] Header includes cleanup","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2009-04-03T03:58:29Z","receivedAt":"2009-04-03T03:58:29Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"Le jeudi 2 avril 2009, Junio C Hamano a écrit :\n> Christian Couder <chriscool@tuxfamily.org> writes:\n> > Ok, so I suggest the following simple guiding principles:\n> >\n> > - git-compat-util.h or cache.h or builtin.h should always be the first\n> > #include in C files,\n> >\n> > - header files should include other incude files if and only if the\n> > other includes are needed to compile them,\n>\n> This is unclear.\n>\n> Long before I started touching git, I used to be religious about making\n> header files self contained.  For a header file frotz.h in the project, I\n> used to insist that\n>\n> \t$ cat >1.c <<\\EOF\n> \t#include \"frotz.h\"\n>         EOF\n>         $ cc -Wall -c 1.c\n>\n> did not fail.\n>\n> Are you talking about that by \"to compile them\"?\n\nWell, I wanted to say that for a header file frotz.h in the project:\n\n\t$ cat >1.c <<\\EOF\n\t#include \"cache.h\"\n\t#include \"frotz.h\"\n\tEOF\n\t$ cc -Wall -c 1.c\n\t\nshould not fail.\n\n(Ok, in practice, let's say that something like:\n\n$ cc -Wall -DSHA1_HEADER='<openssl/sha.h>' -c 1.c\n\nshould not fail.)\n\n> I stopped doing that long time ago, partly because the rule was\n> cumbersome to enforce, but primarily because it was not helping much in\n> the larger picture.\n>\n> Such a rule, together with strict rules such as the order of including\n> other header files in the header files themselves, may make life easier\n> for programmers who touch .c files but never .h files, because they can\n> include only the necessary .h files and in any order.  But in practice,\n> people need to touch both .h and .c files and when they need to include\n> new system header files, they need to follow the inclusion order rule\n> somewhere anyway---at that point, it does not matter much if the rule\n> applies to only .h files or both .h and .c files.\n>\n> So for example, you cannot compile\n>\n> \t$ cat >1.c <<\\EOF\n>         #include \"revision.h\"\n>         EOF\n>         $ cc -Wll -c 1.c\n>\n> in git.git project, but I do not think it is a problem.\n\nI think it may become a problem if a header needs more headers to be \nincluded before it, and those latter headers again need more headers and so \non.\n\nThe advantage of having and using \"cache.h\" is that things are quite simple. \nYou include cache.h and then a few more headers for special features you \nneed, and, here you go, you can code up something quite interesting without \nworrying too much about includes. (Though the compilation time is perhaps a \nlittle longer than it could be.)\n\nIf we loose this simplicity because we don't take care or for some \ntheoretical reason, then I think we have lost everything that really \nmatters.\n\nA simple patch like this:\n\n---------8<------------\n$ gdiff\ndiff --git a/revision.h b/revision.h\nindex 5adfc91..495d7eb 100644\n--- a/revision.h\n+++ b/revision.h\n@@ -3,6 +3,8 @@\n\n #include \"parse-options.h\"\n #include \"grep.h\"\n+#include \"diff.h\"\n+#include \"commit.h\"\n\n #define SEEN           (1u<<0)\n #define UNINTERESTING   (1u<<1)\n---------8<------------\n\nmakes the following just work(tm):\n\n\t$ cat >1.c <<\\EOF\n\t#include \"cache.h\"\n\t#include \"revision.h\"\n\tEOF\n\t$ cc -Wall -DSHA1_HEADER='<openssl/sha.h>' -c 1.c\n\t$\n\n(By the way it's this kind of patches that I hoped would get posted first.)\n\n> > - a header file should be included in a C file only if it is needed to\n> > compile the C file (it is not ok to include it only because it includes\n> > many other headers that are needed)\n\nI should have said \"a header file other than git-compat-util.h or cache.h \nshould be included ...\"\n\n> If that is the rule, perhaps the problem lies not in a .c program that\n> includes such a .h header, but in the .h itself that includes many other\n> header files.\n\nIt depends if the .h that includes many other header files does that for a \ngood reason or not.\n\n> > - other than the above rules, it is ok to reduce the number of includes\n> > as much as possible\n> >\n> > What do you think?\n>\n> What you did not write and I forgot to mention, which is a logical\n> conclusion of the first rule, is that C files should not directly include\n> common system header files such as unistd, sys/stat, etc.\n\nYeah, I forgot to restate that.\n\n> There are exceptions to any rule.  For example, inclusion of syslog.h in\n> daemon.c is OK because most of the rest of the system does not even use\n> syslog.  If we later find a platform whose syslog.h has some funny\n> inter-header dependencies, however, we will need to include it in the\n> git-compat-util.h and resolve the dependencies there, like we do for\n> other system header files.\n\nOk, I will state that too.\n\nIf you agree I will post a patch to \"Documentation/CodingGuidelines\" with \nthe above clarifications. (I can also post an improved version of my patch \nto \"revision.h\".)\n\nThanks,\nChristian.\n\n> > Or perhaps Junio would prefer that you work on a C file by C file\n> > basis? Like for example:\n> >\n> > \"delete useless includes in 'builtin-diff-files.c'\"\n> > \"delete useless includes in 'builtin-diff-index.c'\"\n>\n> If the series does not involve .h file clean-up, then a series that\n> consists of one patch per .c file would be easier to handle, I think.\n"},{"id":"110266","messageId":"200904030614.26310.chriscool@tuxfamily.org","threadId":"18638","inReplyTo":"20090402112705.GD14599@sigill.intra.peff.net","subject":"Re: [PATCH 0/5] Header includes cleanup","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2009-04-03T04:14:26Z","receivedAt":"2009-04-03T04:14:26Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"Hi,\n\nLe jeudi 2 avril 2009, Jeff King a écrit :\n> On Wed, Apr 01, 2009 at 10:25:09PM -0700, Junio C Hamano wrote:\n> > > - a header file should be included in a C file only if it is needed\n> > > to compile the C file (it is not ok to include it only because it\n> > > includes many other headers that are needed)\n> >\n> > If that is the rule, perhaps the problem lies not in a .c program that\n> > includes such a .h header, but in the .h itself that includes many\n> > other header files.\n>\n> If this were combined with splitting gigantic .h files (like cache.h)\n> into smaller logical units, then we could in theory speed up\n> recompilation times with make (we would also need to correctly track\n> header dependencies, but gcc -M can do this fairly easily).\n>\n> But it does come at the price of actually having to consider which\n> include files are necessary. I can't think of more than half a dozen\n> times in the last year I have actually had to add a #include while\n> working on a git .c file, mostly because everything and the kitchen sink\n> is included by cache.h.\n\nYeah, I think the best feature of the actual design is the simplicity, and \nthat's why we don't have to add new #include very often. So let's keep this \nsimplicity by having and applying rules to keep things simple for the \ndeveloper.\n\n> So I don't know if it is worth it.\n\nI am not sure what you are talking about here, but if you mean that you \ndon't think it's worth splitting gigantic .h files (like cache.h) into \nsmaller logical units, then I agree.\n\nBest regards,\nChristian.\n"},{"id":"110276","messageId":"20090403122401.GA21153@coredump.intra.peff.net","threadId":"18638","inReplyTo":"200904030614.26310.chriscool@tuxfamily.org","subject":"Re: [PATCH 0/5] Header includes cleanup","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-04-03T12:24:01Z","receivedAt":"2009-04-03T12:24:01Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, Apr 03, 2009 at 06:14:26AM +0200, Christian Couder wrote:\n\n> > So I don't know if it is worth it.\n> \n> I am not sure what you are talking about here, but if you mean that you \n> don't think it's worth splitting gigantic .h files (like cache.h) into \n> smaller logical units, then I agree.\n\nWhat I meant was \"there is a tradeoff between faster compilation times\nand potentially more programmer effort, and I don't know if that\ntradeoff is worth it\". So I think you understood what I was saying, and\nI think your point is reasonable.\n\n-Peff\n"}]}