From 36bf19589055fb71aac0ed6719dfe5b385adc2bf Mon Sep 17 00:00:00 2001 From: Elijah Newren Date: Fri, 24 Feb 2023 00:09:24 +0000 Subject: alloc.h: move ALLOC_GROW() functions from cache.h This allows us to replace includes of cache.h with includes of the much smaller alloc.h in many places. It does mean that we also need to add includes of alloc.h in a number of C files. Signed-off-by: Elijah Newren Signed-off-by: Junio C Hamano --- diffcore-rename.c | 1 + 1 file changed, 1 insertion(+) (limited to 'diffcore-rename.c') diff --git a/diffcore-rename.c b/diffcore-rename.c index c0422d9e70..62c0299984 100644 --- a/diffcore-rename.c +++ b/diffcore-rename.c @@ -3,6 +3,7 @@ * Copyright (C) 2005 Junio C Hamano */ #include "cache.h" +#include "alloc.h" #include "diff.h" #include "diffcore.h" #include "object-store.h" -- cgit 1.2.3-korg From fc7bd51b06424694c2e3dd97c11fa095d84d52b1 Mon Sep 17 00:00:00 2001 From: Elijah Newren Date: Fri, 24 Feb 2023 00:09:34 +0000 Subject: treewide: replace cache.h with more direct headers, where possible Signed-off-by: Elijah Newren Signed-off-by: Junio C Hamano --- advice.c | 4 +++- decorate.c | 3 ++- diffcore-order.c | 3 ++- diffcore-rename.c | 6 +++++- diffcore-rotate.c | 3 ++- graph.c | 3 ++- hook.c | 5 ++++- quote.c | 1 + sha1dc_git.c | 3 ++- unix-socket.c | 3 ++- url.c | 3 ++- urlmatch.c | 4 +++- 12 files changed, 30 insertions(+), 11 deletions(-) (limited to 'diffcore-rename.c') diff --git a/advice.c b/advice.c index fd18968943..a5ea460ab8 100644 --- a/advice.c +++ b/advice.c @@ -1,6 +1,8 @@ -#include "cache.h" +#include "git-compat-util.h" +#include "advice.h" #include "config.h" #include "color.h" +#include "gettext.h" #include "help.h" #include "string-list.h" diff --git a/decorate.c b/decorate.c index 2036d15967..71e79daa82 100644 --- a/decorate.c +++ b/decorate.c @@ -2,7 +2,8 @@ * decorate.c - decorate a git object with some arbitrary * data. */ -#include "cache.h" +#include "git-compat-util.h" +#include "hashmap.h" #include "object.h" #include "decorate.h" diff --git a/diffcore-order.c b/diffcore-order.c index 19e73311f9..57ccab2846 100644 --- a/diffcore-order.c +++ b/diffcore-order.c @@ -1,7 +1,8 @@ /* * Copyright (C) 2005 Junio C Hamano */ -#include "cache.h" +#include "git-compat-util.h" +#include "gettext.h" #include "diff.h" #include "diffcore.h" diff --git a/diffcore-rename.c b/diffcore-rename.c index 62c0299984..7e9ff96d43 100644 --- a/diffcore-rename.c +++ b/diffcore-rename.c @@ -2,15 +2,19 @@ * * Copyright (C) 2005 Junio C Hamano */ -#include "cache.h" +#include "git-compat-util.h" #include "alloc.h" #include "diff.h" #include "diffcore.h" #include "object-store.h" #include "hashmap.h" +#include "mem-pool.h" +#include "oid-array.h" #include "progress.h" #include "promisor-remote.h" +#include "string-list.h" #include "strmap.h" +#include "trace2.h" /* Table of rename/copy destinations */ diff --git a/diffcore-rotate.c b/diffcore-rotate.c index 445f060ab0..533986cf63 100644 --- a/diffcore-rotate.c +++ b/diffcore-rotate.c @@ -2,7 +2,8 @@ * Copyright (C) 2021, Google LLC. * Based on diffcore-order.c, which is Copyright (C) 2005, Junio C Hamano */ -#include "cache.h" +#include "git-compat-util.h" +#include "gettext.h" #include "diff.h" #include "diffcore.h" diff --git a/graph.c b/graph.c index 568b6e7cd4..2a9dc430fa 100644 --- a/graph.c +++ b/graph.c @@ -1,4 +1,5 @@ -#include "cache.h" +#include "git-compat-util.h" +#include "gettext.h" #include "config.h" #include "commit.h" #include "color.h" diff --git a/hook.c b/hook.c index 1a84831863..f6ddd79098 100644 --- a/hook.c +++ b/hook.c @@ -1,7 +1,10 @@ -#include "cache.h" +#include "git-compat-util.h" +#include "advice.h" +#include "gettext.h" #include "hook.h" #include "run-command.h" #include "config.h" +#include "strbuf.h" const char *find_hook(const char *name) { diff --git a/quote.c b/quote.c index 2453397fbb..7ccb5a06cd 100644 --- a/quote.c +++ b/quote.c @@ -1,6 +1,7 @@ #include "cache.h" #include "alloc.h" #include "quote.h" +#include "strbuf.h" #include "strvec.h" int quote_path_fully = 1; diff --git a/sha1dc_git.c b/sha1dc_git.c index 72709606fd..9b675a046e 100644 --- a/sha1dc_git.c +++ b/sha1dc_git.c @@ -1,4 +1,5 @@ -#include "cache.h" +#include "git-compat-util.h" +#include "sha1dc_git.h" #include "hex.h" #ifdef DC_SHA1_EXTERNAL diff --git a/unix-socket.c b/unix-socket.c index e0be1badb5..79800d8063 100644 --- a/unix-socket.c +++ b/unix-socket.c @@ -1,4 +1,5 @@ -#include "cache.h" +#include "git-compat-util.h" +#include "strbuf.h" #include "unix-socket.h" #define DEFAULT_UNIX_STREAM_LISTEN_BACKLOG (5) diff --git a/url.c b/url.c index bf318c0520..2e1a9f6fee 100644 --- a/url.c +++ b/url.c @@ -1,5 +1,6 @@ -#include "cache.h" +#include "git-compat-util.h" #include "hex.h" +#include "strbuf.h" #include "url.h" int is_urlschemechar(int first_flag, int ch) diff --git a/urlmatch.c b/urlmatch.c index 2965cbe774..eba0bdd77f 100644 --- a/urlmatch.c +++ b/urlmatch.c @@ -1,5 +1,7 @@ -#include "cache.h" +#include "git-compat-util.h" +#include "gettext.h" #include "hex.h" +#include "strbuf.h" #include "urlmatch.h" #define URL_ALPHA "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" -- cgit 1.2.3-korg