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

Re: [PATCH v2 21/22] diff.h: reduce unnecessary includes

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
May 1, 2023, 17:11 UTC
Message-ID
<230501.86edo0ht7a.gmgdl@evledraar.gmail.com>
In-Reply-To
<b7a96a08d1463ec51f0d8384012d812fd5f43537.1682194652.git.gitgitgadget@gmail.com>
On Sat, Apr 22 2023, Elijah Newren via GitGitGadget wrote:
Show 97 quoted lines
> From: Elijah Newren <newren@gmail.com>
>
> Signed-off-by: Elijah Newren <newren@gmail.com>
> ---
>  attr.c              | 1 +
>  diff.h              | 1 -
>  http-push.c         | 1 +
>  line-log.c          | 1 +
>  pack-bitmap-write.c | 1 +
>  reflog.c            | 1 +
>  tree-diff.c         | 1 +
>  7 files changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/attr.c b/attr.c
> index 2d8aeb8b58c..ddf2b0cbc2e 100644
> --- a/attr.c
> +++ b/attr.c
> @@ -20,6 +20,7 @@
>  #include "object-store.h"
>  #include "setup.h"
>  #include "thread-utils.h"
> +#include "tree-walk.h"
>  
>  const char git_attr__true[] = "(builtin)true";
>  const char git_attr__false[] = "\0(builtin)false";
> diff --git a/diff.h b/diff.h
> index 53aeb02a54b..69e574f4315 100644
> --- a/diff.h
> +++ b/diff.h
> @@ -4,7 +4,6 @@
>  #ifndef DIFF_H
>  #define DIFF_H
>  
> -#include "tree-walk.h"
>  #include "pathspec.h"
>  #include "oidset.h"
>  #include "strbuf.h"
> diff --git a/http-push.c b/http-push.c
> index 3f184986362..866ba243a89 100644
> --- a/http-push.c
> +++ b/http-push.c
> @@ -16,6 +16,7 @@
>  #include "sigchain.h"
>  #include "strvec.h"
>  #include "tree.h"
> +#include "tree-walk.h"
>  #include "packfile.h"
>  #include "object-store.h"
>  #include "commit-reach.h"
> diff --git a/line-log.c b/line-log.c
> index 10c19daec4a..6a7ac312a43 100644
> --- a/line-log.c
> +++ b/line-log.c
> @@ -18,6 +18,7 @@
>  #include "setup.h"
>  #include "strvec.h"
>  #include "bloom.h"
> +#include "tree-walk.h"
>  
>  static void range_set_grow(struct range_set *rs, size_t extra)
>  {
> diff --git a/pack-bitmap-write.c b/pack-bitmap-write.c
> index 3d3fd380654..cdffe2ce47d 100644
> --- a/pack-bitmap-write.c
> +++ b/pack-bitmap-write.c
> @@ -19,6 +19,7 @@
>  #include "prio-queue.h"
>  #include "trace2.h"
>  #include "tree.h"
> +#include "tree-walk.h"
>  
>  struct bitmapped_commit {
>  	struct commit *commit;
> diff --git a/reflog.c b/reflog.c
> index 57dc7c0d051..ee1bf5d032c 100644
> --- a/reflog.c
> +++ b/reflog.c
> @@ -5,6 +5,7 @@
>  #include "refs.h"
>  #include "revision.h"
>  #include "tree.h"
> +#include "tree-walk.h"
>  #include "worktree.h"
>  
>  /* Remember to update object flag allocation in object.h */
> diff --git a/tree-diff.c b/tree-diff.c
> index 9ea2dd7a6c3..20bb15f38d9 100644
> --- a/tree-diff.c
> +++ b/tree-diff.c
> @@ -5,6 +5,7 @@
>  #include "diff.h"
>  #include "diffcore.h"
>  #include "tree.h"
> +#include "tree-walk.h"
>  
>  /*
>   * Some mode bits are also used internally for computations.

This, unlike the preceding 20/22 really does seem to strictly match its $subject, i.e. diff.h didn't need tree-walk.h, but some stuff using it needed it, so we're moving the include to those users themselves.

Previous: Elijah Newren via GitGitGadgetNext: Derrick Stolee
Message 77 of 81 in “Header cleanups (more splitting of cache.h and simplifying a few other deps)”
  1. 00/23 Header cleanups (more splitting of cache.h and simplifying a few other deps)Elijah Newren via GitGitGadget, Apr 16, 2023
  2. 06/23 copy.h: move declarations for copy.c functions from cache.hElijah Newren via GitGitGadget, Apr 16, 2023
  3. 03/23 protocol.h: move definition of DEFAULT_GIT_PORT from cache.hElijah Newren via GitGitGadget, Apr 16, 2023
  4. 02/23 symlinks.h: move declarations for symlinks.c functions from cache.hElijah Newren via GitGitGadget, Apr 16, 2023
  5. 01/23 treewide: be explicit about dependence on strbuf.hElijah Newren via GitGitGadget, Apr 16, 2023
  6. 04/23 packfile.h: move pack_window and pack_entry from cache.hElijah Newren via GitGitGadget, Apr 16, 2023
  7. 05/23 server-info.h: move declarations for server-info.c functions from cache.hElijah Newren via GitGitGadget, Apr 16, 2023
  8. 07/23 base85.h: move declarations for base85.c functions from cache.hElijah Newren via GitGitGadget, Apr 16, 2023
  9. 08/23 pkt-line.h: move declarations for pkt-line.c functions from cache.hElijah Newren via GitGitGadget, Apr 16, 2023
  10. 09/23 match-trees.h: move declarations for match-trees.c functions from cache.hElijah Newren via GitGitGadget, Apr 16, 2023
  11. 11/23 versioncmp.h: move declarations for versioncmp.c functions from cache.hElijah Newren via GitGitGadget, Apr 16, 2023
  12. 10/23 ws.h: move declarations for ws.c functions from cache.hElijah Newren via GitGitGadget, Apr 16, 2023
  13. 12/23 dir.h: move DTYPE defines from cache.hElijah Newren via GitGitGadget, Apr 16, 2023
  14. 15/23 cache,tree: move cmp_cache_name_compare from tree.[ch] to read-cache.cElijah Newren via GitGitGadget, Apr 16, 2023
  15. 16/23 cache,tree: move basic name compare functions from read-cache to treeElijah Newren via GitGitGadget, Apr 16, 2023
  16. 18/23 cache.h: remove unnecessary headersElijah Newren via GitGitGadget, Apr 16, 2023
  17. 13/23 tree-diff.c: move S_DIFFTREE_IFXMIN_NEQ define from cache.hElijah Newren via GitGitGadget, Apr 16, 2023
  18. 19/23 fsmonitor: reduce includes of cache.hElijah Newren via GitGitGadget, Apr 16, 2023
  19. 17/23 treewide: remove cache.h inclusion due to previous changesElijah Newren via GitGitGadget, Apr 16, 2023
  20. 14/23 hash.h, repository.h: reverse the order of these dependenciesElijah Newren via GitGitGadget, Apr 16, 2023
  21. Derrick StoleeApr 17, 2023
  22. Elijah NewrenApr 18, 2023
  23. Junio C HamanoApr 18, 2023
  24. Elijah NewrenApr 20, 2023
  25. Derrick StoleeApr 20, 2023
  26. Junio C HamanoApr 20, 2023
  27. Glen ChooApr 20, 2023
  28. 21/23 object-store.h: reduce unnecessary includesElijah Newren via GitGitGadget, Apr 16, 2023
  29. 20/23 commit.h: reduce unnecessary includesElijah Newren via GitGitGadget, Apr 16, 2023
  30. 22/23 diff.h: reduce unnecessary includesElijah Newren via GitGitGadget, Apr 16, 2023
  31. 23/23 reftable: ensure git-compat-util.h is the first (indirect) includeElijah Newren via GitGitGadget, Apr 16, 2023
  32. Derrick StoleeApr 17, 2023
  33. Elijah NewrenApr 18, 2023
  34. 00/22 Header cleanups (more splitting of cache.h and simplifying a few other deps)Elijah Newren via GitGitGadget, Apr 22, 2023
  35. 01/22 treewide: be explicit about dependence on strbuf.hElijah Newren via GitGitGadget, Apr 22, 2023
  36. 02/22 symlinks.h: move declarations for symlinks.c functions from cache.hElijah Newren via GitGitGadget, Apr 22, 2023
  37. 03/22 packfile.h: move pack_window and pack_entry from cache.hElijah Newren via GitGitGadget, Apr 22, 2023
  38. 07/22 pkt-line.h: move declarations for pkt-line.c functions from cache.hElijah Newren via GitGitGadget, Apr 22, 2023
  39. 04/22 server-info.h: move declarations for server-info.c functions from cache.hElijah Newren via GitGitGadget, Apr 22, 2023
  40. 05/22 copy.h: move declarations for copy.c functions from cache.hElijah Newren via GitGitGadget, Apr 22, 2023
  41. 08/22 match-trees.h: move declarations for match-trees.c functions from cache.hElijah Newren via GitGitGadget, Apr 22, 2023
  42. 06/22 base85.h: move declarations for base85.c functions from cache.hElijah Newren via GitGitGadget, Apr 22, 2023
  43. 09/22 ws.h: move declarations for ws.c functions from cache.hElijah Newren via GitGitGadget, Apr 22, 2023
  44. 10/22 versioncmp.h: move declarations for versioncmp.c functions from cache.hElijah Newren via GitGitGadget, Apr 22, 2023
  45. 11/22 dir.h: move DTYPE defines from cache.hElijah Newren via GitGitGadget, Apr 22, 2023
  46. 14/22 cache,tree: move cmp_cache_name_compare from tree.[ch] to read-cache.cElijah Newren via GitGitGadget, Apr 22, 2023
  47. 15/22 cache,tree: move basic name compare functions from read-cache to treeElijah Newren via GitGitGadget, Apr 22, 2023
  48. 12/22 tree-diff.c: move S_DIFFTREE_IFXMIN_NEQ define from cache.hElijah Newren via GitGitGadget, Apr 22, 2023
  49. Ævar Arnfjörð BjarmasonMay 1, 2023
  50. Junio C HamanoMay 1, 2023
  51. Elijah NewrenMay 2, 2023
  52. Elijah NewrenMay 2, 2023
  53. Junio C HamanoMay 2, 2023
  54. Elijah NewrenMay 2, 2023
  55. 16/22 treewide: remove cache.h inclusion due to previous changesElijah Newren via GitGitGadget, Apr 22, 2023
  56. Ævar Arnfjörð BjarmasonMay 1, 2023
  57. Elijah NewrenMay 2, 2023
  58. 17/22 cache.h: remove unnecessary headersElijah Newren via GitGitGadget, Apr 22, 2023
  59. Ævar Arnfjörð BjarmasonMay 1, 2023
  60. Elijah NewrenMay 2, 2023
  61. 18/22 fsmonitor: reduce includes of cache.hElijah Newren via GitGitGadget, Apr 22, 2023
  62. 20/22 object-store.h: reduce unnecessary includesElijah Newren via GitGitGadget, Apr 22, 2023
  63. Ævar Arnfjörð BjarmasonMay 1, 2023
  64. Elijah NewrenMay 2, 2023
  65. 13/22 hash-ll.h: split out of hash.h to remove dependency on repository.hElijah Newren via GitGitGadget, Apr 22, 2023
  66. Glen ChooApr 24, 2023
  67. Elijah NewrenApr 26, 2023
  68. Glen ChooApr 26, 2023
  69. Junio C HamanoApr 24, 2023
  70. Ævar Arnfjörð BjarmasonMay 1, 2023
  71. Elijah NewrenMay 2, 2023
  72. 19/22 commit.h: reduce unnecessary includesElijah Newren via GitGitGadget, Apr 22, 2023
  73. Ævar Arnfjörð BjarmasonMay 1, 2023
  74. Elijah NewrenMay 2, 2023
  75. 22/22 reftable: ensure git-compat-util.h is the first (indirect) includeElijah Newren via GitGitGadget, Apr 22, 2023
  76. 21/22 diff.h: reduce unnecessary includesElijah Newren via GitGitGadget, Apr 22, 2023
  77. Ævar Arnfjörð BjarmasonMay 1, 2023
  78. Derrick StoleeApr 24, 2023
  79. Junio C HamanoApr 24, 2023
  80. Glen ChooApr 26, 2023
  81. Junio C HamanoApr 26, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.