Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElijah Newren <newren@gmail.com>2023-02-24 03:09:23 +0300
committerJunio C Hamano <gitster@pobox.com>2023-02-24 04:25:28 +0300
commit15db4e7f4ac20cc41902a2479c7784fff8edf2e9 (patch)
tree041fdf546a331a01315c23ea633d1bd5a1ac99a2
parentba3d1c73daa02152acf4729d45ca7fe4d71d5747 (diff)
treewide: remove unnecessary cache.h includes in source files
We had several C files include cache.h unnecessarily. Replace those with an include of "git-compat-util.h" instead. Much like the previous commit, these have all been verified via both ensuring that gcc -E $SOURCE_FILE | grep '"cache.h"' found no hits and that make DEVELOPER=1 ${OBJECT_FILE_FOR_SOURCE_FILE} successfully compiles without warnings. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--hashmap.c2
-rw-r--r--imap-send.c2
-rw-r--r--json-writer.c2
-rw-r--r--kwset.c2
-rw-r--r--levenshtein.c2
-rw-r--r--linear-assignment.c2
-rw-r--r--mem-pool.c2
-rw-r--r--oidmap.c2
-rw-r--r--repo-settings.c2
-rw-r--r--serve.c3
-rw-r--r--shell.c2
-rw-r--r--t/helper/test-crontab.c1
-rw-r--r--t/helper/test-ctype.c1
-rw-r--r--t/helper/test-json-writer.c1
-rw-r--r--t/helper/test-pcre2-config.c1
-rw-r--r--t/helper/test-prio-queue.c1
-rw-r--r--t/helper/test-run-command.c2
-rw-r--r--t/helper/test-sigchain.c1
-rw-r--r--t/helper/test-simple-ipc.c3
-rw-r--r--t/helper/test-wildmatch.c1
-rw-r--r--thread-utils.c2
-rw-r--r--trace2.c3
-rw-r--r--trace2/tr2_ctr.c2
-rw-r--r--trace2/tr2_tbuf.c2
-rw-r--r--trace2/tr2_tgt_event.c2
-rw-r--r--trace2/tr2_tgt_normal.c2
-rw-r--r--trace2/tr2_tgt_perf.c2
-rw-r--r--trace2/tr2_tmr.c3
-rw-r--r--unix-stream-server.c2
29 files changed, 25 insertions, 30 deletions
diff --git a/hashmap.c b/hashmap.c
index cf5fea87eb..ee45ef0085 100644
--- a/hashmap.c
+++ b/hashmap.c
@@ -1,7 +1,7 @@
/*
* Generic implementation of hash-based key value mappings.
*/
-#include "cache.h"
+#include "git-compat-util.h"
#include "hashmap.h"
#define FNV32_BASE ((unsigned int) 0x811c9dc5)
diff --git a/imap-send.c b/imap-send.c
index a50af56b82..93e9018439 100644
--- a/imap-send.c
+++ b/imap-send.c
@@ -21,7 +21,7 @@
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
-#include "cache.h"
+#include "git-compat-util.h"
#include "config.h"
#include "credential.h"
#include "exec-cmd.h"
diff --git a/json-writer.c b/json-writer.c
index f1cfd8fa8c..005c820aa4 100644
--- a/json-writer.c
+++ b/json-writer.c
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "json-writer.h"
void jw_init(struct json_writer *jw)
diff --git a/kwset.c b/kwset.c
index 08aadf0311..4b14d4f86b 100644
--- a/kwset.c
+++ b/kwset.c
@@ -32,7 +32,7 @@
String Matching: An Aid to Bibliographic Search," CACM June 1975,
Vol. 18, No. 6, which describes the failure function used below. */
-#include "cache.h"
+#include "git-compat-util.h"
#include "kwset.h"
#include "compat/obstack.h"
diff --git a/levenshtein.c b/levenshtein.c
index d2632690d5..fd8026fe20 100644
--- a/levenshtein.c
+++ b/levenshtein.c
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "levenshtein.h"
/*
diff --git a/linear-assignment.c b/linear-assignment.c
index ecffc09be6..5416cbcf40 100644
--- a/linear-assignment.c
+++ b/linear-assignment.c
@@ -3,7 +3,7 @@
* algorithm for dense and sparse linear assignment problems</i>. Computing,
* 38(4), 325-340.
*/
-#include "cache.h"
+#include "git-compat-util.h"
#include "linear-assignment.h"
#define COST(column, row) cost[(column) + column_count * (row)]
diff --git a/mem-pool.c b/mem-pool.c
index 599d8e895f..c34846d176 100644
--- a/mem-pool.c
+++ b/mem-pool.c
@@ -2,7 +2,7 @@
* Memory Pool implementation logic.
*/
-#include "cache.h"
+#include "git-compat-util.h"
#include "mem-pool.h"
#define BLOCK_GROWTH_SIZE (1024 * 1024 - sizeof(struct mp_block))
diff --git a/oidmap.c b/oidmap.c
index 49965fe856..8c1a139c97 100644
--- a/oidmap.c
+++ b/oidmap.c
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "oidmap.h"
static int oidmap_neq(const void *hashmap_cmp_fn_data UNUSED,
diff --git a/repo-settings.c b/repo-settings.c
index 3dbd3f0e2e..0a6c0b381f 100644
--- a/repo-settings.c
+++ b/repo-settings.c
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "config.h"
#include "repository.h"
#include "midx.h"
diff --git a/serve.c b/serve.c
index cbf4a143cf..d128822347 100644
--- a/serve.c
+++ b/serve.c
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "repository.h"
#include "config.h"
#include "pkt-line.h"
@@ -8,6 +8,7 @@
#include "serve.h"
#include "upload-pack.h"
#include "bundle-uri.h"
+#include "trace2.h"
static int advertise_sid = -1;
static int client_hash_algo = GIT_HASH_SHA1;
diff --git a/shell.c b/shell.c
index af0d7c734f..5c67e7bd97 100644
--- a/shell.c
+++ b/shell.c
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "quote.h"
#include "exec-cmd.h"
#include "strbuf.h"
diff --git a/t/helper/test-crontab.c b/t/helper/test-crontab.c
index e6c1b1e22b..597027a96e 100644
--- a/t/helper/test-crontab.c
+++ b/t/helper/test-crontab.c
@@ -1,5 +1,4 @@
#include "test-tool.h"
-#include "cache.h"
/*
* Usage: test-tool crontab <file> -l|<input>
diff --git a/t/helper/test-ctype.c b/t/helper/test-ctype.c
index 92c4c2313e..d6c1a2ed09 100644
--- a/t/helper/test-ctype.c
+++ b/t/helper/test-ctype.c
@@ -1,5 +1,4 @@
#include "test-tool.h"
-#include "cache.h"
static int rc;
diff --git a/t/helper/test-json-writer.c b/t/helper/test-json-writer.c
index 8c3edacc00..86887f5320 100644
--- a/t/helper/test-json-writer.c
+++ b/t/helper/test-json-writer.c
@@ -1,5 +1,4 @@
#include "test-tool.h"
-#include "cache.h"
#include "json-writer.h"
static const char *expect_obj1 = "{\"a\":\"abc\",\"b\":42,\"c\":true}";
diff --git a/t/helper/test-pcre2-config.c b/t/helper/test-pcre2-config.c
index 5258fdddba..5d0b2a2e10 100644
--- a/t/helper/test-pcre2-config.c
+++ b/t/helper/test-pcre2-config.c
@@ -1,5 +1,4 @@
#include "test-tool.h"
-#include "cache.h"
#include "grep.h"
int cmd__pcre2_config(int argc, const char **argv)
diff --git a/t/helper/test-prio-queue.c b/t/helper/test-prio-queue.c
index 133b5e6f4a..ac4c65d705 100644
--- a/t/helper/test-prio-queue.c
+++ b/t/helper/test-prio-queue.c
@@ -1,5 +1,4 @@
#include "test-tool.h"
-#include "cache.h"
#include "prio-queue.h"
static int intcmp(const void *va, const void *vb, void *data)
diff --git a/t/helper/test-run-command.c b/t/helper/test-run-command.c
index 3ecb830f4a..67b42ef50e 100644
--- a/t/helper/test-run-command.c
+++ b/t/helper/test-run-command.c
@@ -9,8 +9,6 @@
*/
#include "test-tool.h"
-#include "git-compat-util.h"
-#include "cache.h"
#include "run-command.h"
#include "strvec.h"
#include "strbuf.h"
diff --git a/t/helper/test-sigchain.c b/t/helper/test-sigchain.c
index d013bccdda..d1cf7377b7 100644
--- a/t/helper/test-sigchain.c
+++ b/t/helper/test-sigchain.c
@@ -1,5 +1,4 @@
#include "test-tool.h"
-#include "cache.h"
#include "sigchain.h"
#define X(f) \
diff --git a/t/helper/test-simple-ipc.c b/t/helper/test-simple-ipc.c
index 28365ff85b..3d1436da59 100644
--- a/t/helper/test-simple-ipc.c
+++ b/t/helper/test-simple-ipc.c
@@ -3,13 +3,14 @@
*/
#include "test-tool.h"
-#include "cache.h"
+#include "gettext.h"
#include "strbuf.h"
#include "simple-ipc.h"
#include "parse-options.h"
#include "thread-utils.h"
#include "strvec.h"
#include "run-command.h"
+#include "trace2.h"
#ifndef SUPPORTS_SIMPLE_IPC
int cmd__simple_ipc(int argc, const char **argv)
diff --git a/t/helper/test-wildmatch.c b/t/helper/test-wildmatch.c
index 2c103d1824..a95bb4da9b 100644
--- a/t/helper/test-wildmatch.c
+++ b/t/helper/test-wildmatch.c
@@ -1,5 +1,4 @@
#include "test-tool.h"
-#include "cache.h"
int cmd__wildmatch(int argc, const char **argv)
{
diff --git a/thread-utils.c b/thread-utils.c
index 5329845691..1f89ffab4c 100644
--- a/thread-utils.c
+++ b/thread-utils.c
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "thread-utils.h"
#if defined(hpux) || defined(__hpux) || defined(_hpux)
diff --git a/trace2.c b/trace2.c
index 279bddf53b..e8ba62c0c3 100644
--- a/trace2.c
+++ b/trace2.c
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "config.h"
#include "json-writer.h"
#include "quote.h"
@@ -6,6 +6,7 @@
#include "sigchain.h"
#include "thread-utils.h"
#include "version.h"
+#include "trace.h"
#include "trace2/tr2_cfg.h"
#include "trace2/tr2_cmd_name.h"
#include "trace2/tr2_ctr.h"
diff --git a/trace2/tr2_ctr.c b/trace2/tr2_ctr.c
index 483ca7c308..b342d3b1a3 100644
--- a/trace2/tr2_ctr.c
+++ b/trace2/tr2_ctr.c
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "thread-utils.h"
#include "trace2/tr2_tgt.h"
#include "trace2/tr2_tls.h"
diff --git a/trace2/tr2_tbuf.c b/trace2/tr2_tbuf.c
index 2498482d9a..c3b3822ed7 100644
--- a/trace2/tr2_tbuf.c
+++ b/trace2/tr2_tbuf.c
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "tr2_tbuf.h"
void tr2_tbuf_local_time(struct tr2_tbuf *tb)
diff --git a/trace2/tr2_tgt_event.c b/trace2/tr2_tgt_event.c
index 16f6332755..9e7aab6d51 100644
--- a/trace2/tr2_tgt_event.c
+++ b/trace2/tr2_tgt_event.c
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "config.h"
#include "json-writer.h"
#include "run-command.h"
diff --git a/trace2/tr2_tgt_normal.c b/trace2/tr2_tgt_normal.c
index fbbef68dfc..8672c2c2d0 100644
--- a/trace2/tr2_tgt_normal.c
+++ b/trace2/tr2_tgt_normal.c
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "config.h"
#include "run-command.h"
#include "quote.h"
diff --git a/trace2/tr2_tgt_perf.c b/trace2/tr2_tgt_perf.c
index adae803263..3f2b2d5311 100644
--- a/trace2/tr2_tgt_perf.c
+++ b/trace2/tr2_tgt_perf.c
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "config.h"
#include "run-command.h"
#include "quote.h"
diff --git a/trace2/tr2_tmr.c b/trace2/tr2_tmr.c
index 786762dfd2..31d0e4d1bd 100644
--- a/trace2/tr2_tmr.c
+++ b/trace2/tr2_tmr.c
@@ -1,8 +1,9 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "thread-utils.h"
#include "trace2/tr2_tgt.h"
#include "trace2/tr2_tls.h"
#include "trace2/tr2_tmr.h"
+#include "trace.h"
#define MY_MAX(a, b) ((a) > (b) ? (a) : (b))
#define MY_MIN(a, b) ((a) < (b) ? (a) : (b))
diff --git a/unix-stream-server.c b/unix-stream-server.c
index efa2a207ab..22ac2373e0 100644
--- a/unix-stream-server.c
+++ b/unix-stream-server.c
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
#include "lockfile.h"
#include "unix-socket.h"
#include "unix-stream-server.h"