]> git.ipfire.org Git - thirdparty/git.git/commitdiff
treewide: remove unnecessary cache.h includes in source files
authorElijah Newren <newren@gmail.com>
Fri, 24 Feb 2023 00:09:23 +0000 (00:09 +0000)
committerJunio C Hamano <gitster@pobox.com>
Fri, 24 Feb 2023 01:25:28 +0000 (17:25 -0800)
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>
29 files changed:
hashmap.c
imap-send.c
json-writer.c
kwset.c
levenshtein.c
linear-assignment.c
mem-pool.c
oidmap.c
repo-settings.c
serve.c
shell.c
t/helper/test-crontab.c
t/helper/test-ctype.c
t/helper/test-json-writer.c
t/helper/test-pcre2-config.c
t/helper/test-prio-queue.c
t/helper/test-run-command.c
t/helper/test-sigchain.c
t/helper/test-simple-ipc.c
t/helper/test-wildmatch.c
thread-utils.c
trace2.c
trace2/tr2_ctr.c
trace2/tr2_tbuf.c
trace2/tr2_tgt_event.c
trace2/tr2_tgt_normal.c
trace2/tr2_tgt_perf.c
trace2/tr2_tmr.c
unix-stream-server.c

index cf5fea87eb02bf753d408f1eeb00f5de2a02e907..ee45ef00852c86b5f0fe0de8177c806c53d7efa0 100644 (file)
--- 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)
index a50af56b827033dc68923e038566e7718fb81a65..93e9018439c51193b12a52609ae125ae2ae6cfdb 100644 (file)
@@ -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"
index f1cfd8fa8c664bfca0dcaada59e59af8dd2db38a..005c820aa42e1f3c98bd2c1a376bd3a52bfc32a2 100644 (file)
@@ -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 08aadf03117c5069116bb7e7fa4aa5ed7a9b1fb0..4b14d4f86b8d1965023a49586fdd56631631cb8e 100644 (file)
--- 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"
index d2632690d5107b53ee8a7ac4832cd85eb8c7bfc1..fd8026fe20182e5d90dad6db72ab453b5ed0a23c 100644 (file)
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "levenshtein.h"
 
 /*
index ecffc09be6ec5c1a9646ac152a899f3415f6321d..5416cbcf409d2689d4fe620564f2e010a93131b8 100644 (file)
@@ -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)]
index 599d8e895f81216e0e0cb44696734cb2a157309b..c34846d176c886ecb9f028ec48bb847402d242f9 100644 (file)
@@ -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))
index 49965fe856814393c9381788dced2b05d35aed1f..8c1a139c974d360afcd9b23608484af134d77c9f 100644 (file)
--- 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,
index 3dbd3f0e2ec33df0753780f4d84605b16ebdc2b3..0a6c0b381fe13b50fb14b5b6e31ca06c0d44f695 100644 (file)
@@ -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 cbf4a143cfea9bd450d5d033b1ec051025af8a1f..d128822347d3e4ff0de8d7117deace1bb221d73f 100644 (file)
--- 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 af0d7c734f8347082ab094cf1fc8898cbf26b64d..5c67e7bd97e2c825d79c3503267b5b41cd83bb8a 100644 (file)
--- 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"
index e6c1b1e22bb36da604af3238341f6b7b14753796..597027a96e96c923ff630567a8de2f8c47dad3b2 100644 (file)
@@ -1,5 +1,4 @@
 #include "test-tool.h"
-#include "cache.h"
 
 /*
  * Usage: test-tool crontab <file> -l|<input>
index 92c4c2313e78a305dd0da1e7a853e58e325d2f84..d6c1a2ed09ca56955043c3d3563d4c67ace3ae0f 100644 (file)
@@ -1,5 +1,4 @@
 #include "test-tool.h"
-#include "cache.h"
 
 static int rc;
 
index 8c3edacc0007df7ddb52f2f65d00e44b95edeb5a..86887f53203c0d7c1c7b9dd5b71ae78cb156b390 100644 (file)
@@ -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}";
index 5258fdddba0eb36829c04216fbb71b1a196810d0..5d0b2a2e10fa66e16dd954f97ba7561b106fce50 100644 (file)
@@ -1,5 +1,4 @@
 #include "test-tool.h"
-#include "cache.h"
 #include "grep.h"
 
 int cmd__pcre2_config(int argc, const char **argv)
index 133b5e6f4ae5fdbd90f6594223df60f918a036f4..ac4c65d7056d13490c259be03c60a9bcd91e1b95 100644 (file)
@@ -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)
index 3ecb830f4a8cd196f20ff0c371108c8f5579f3cd..67b42ef50eb92543505dd11234b22114557f9fcd 100644 (file)
@@ -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"
index d013bccddaebd9c7fb0eb4b4c4e1be0643f82260..d1cf7377b7c60e0259f747a334983563b6c86715 100644 (file)
@@ -1,5 +1,4 @@
 #include "test-tool.h"
-#include "cache.h"
 #include "sigchain.h"
 
 #define X(f) \
index 28365ff85b69bbda4ca47b5284b2cbd7bebea9e9..3d1436da59872fcfe7551a5586c7720893221ddb 100644 (file)
@@ -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)
index 2c103d1824cfc7f035aea4a6453c9706f9b4491e..a95bb4da9b174e547b41eb2c57dee9fd9273c5ea 100644 (file)
@@ -1,5 +1,4 @@
 #include "test-tool.h"
-#include "cache.h"
 
 int cmd__wildmatch(int argc, const char **argv)
 {
index 532984569132de11f6f05b561f817817523a3468..1f89ffab4c32bc02b5d955851401628a5b9a540e 100644 (file)
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "thread-utils.h"
 
 #if defined(hpux) || defined(__hpux) || defined(_hpux)
index 279bddf53b4804c9a8f51b453c59f184976cc31e..e8ba62c0c3dc8293bd973f7d5c39d024f5eb85f7 100644 (file)
--- 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"
index 483ca7c308fa216055c1a6de293a1bfbf9de0bb2..b342d3b1a3c033bf539037bb5035ae57af119d6d 100644 (file)
@@ -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"
index 2498482d9ad82a29b2e734b0d726599d594a20c6..c3b3822ed7e4af449adeb0af9b5e512cefdd4779 100644 (file)
@@ -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)
index 16f6332755e0d6497643a32d046459b262c01294..9e7aab6d510e1205a15ba6cccb552c670ea8b689 100644 (file)
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "config.h"
 #include "json-writer.h"
 #include "run-command.h"
index fbbef68dfc01a546240384fbf12582ccb9d64c54..8672c2c2d04c33d70a730119c196649534439446 100644 (file)
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "config.h"
 #include "run-command.h"
 #include "quote.h"
index adae8032639016a90cca56175e5cd59ea21d4e27..3f2b2d53118f0820db816d1350413a9f06e7e58d 100644 (file)
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "config.h"
 #include "run-command.h"
 #include "quote.h"
index 786762dfd26ffc477dec6317178a51435615ea05..31d0e4d1bd1220ea0c9d9b204223766235d81e07 100644 (file)
@@ -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))
index efa2a207abcd42021fcae682da1d7e5afbc856fa..22ac2373e0788d9a0c7f377b86a756e5ef4ee518 100644 (file)
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "lockfile.h"
 #include "unix-socket.h"
 #include "unix-stream-server.h"