]> git.ipfire.org Git - thirdparty/git.git/commitdiff
oid_array: rename source file from sha1-array
authorJeff King <peff@peff.net>
Mon, 30 Mar 2020 14:03:46 +0000 (10:03 -0400)
committerJunio C Hamano <gitster@pobox.com>
Mon, 30 Mar 2020 17:59:08 +0000 (10:59 -0700)
We renamed the actual data structure in 910650d2f8 (Rename sha1_array to
oid_array, 2017-03-31), but the file is still called sha1-array. Besides
being slightly confusing, it makes it more annoying to grep for leftover
occurrences of "sha1" in various files, because the header is included
in so many places.

Let's complete the transition by renaming the source and header files
(and fixing up a few comment references).

I kept the "-" in the name, as that seems to be our style; cf.
fc1395f4a4 (sha1_file.c: rename to use dash in file name, 2018-04-10).
We also have oidmap.h and oidset.h without any punctuation, but those
are "struct oidmap" and "struct oidset" in the code. We _could_ make
this "oidarray" to match, but somehow it looks uglier to me because of
the length of "array" (plus it would be a very invasive patch for little
gain).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
27 files changed:
Makefile
bisect.c
builtin/cat-file.c
builtin/diff.c
builtin/fetch-pack.c
builtin/pack-objects.c
builtin/pull.c
builtin/receive-pack.c
builtin/send-pack.c
builtin/tag.c
cache.h
combine-diff.c
connect.c
delta-islands.c
fetch-pack.c
object-store.h
oid-array.c [moved from sha1-array.c with 96% similarity]
oid-array.h [moved from sha1-array.h with 98% similarity]
parse-options-cb.c
ref-filter.h
remote-curl.c
send-pack.c
sha1-name.c
shallow.c
submodule.c
t/helper/test-sha1-array.c
transport.c

index 9804a0758b2458f0ba3d7130c83d7d22d9570879..30fdfb877e0d1c9fa4b665124877cbffc797317d 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -929,6 +929,7 @@ LIB_OBJS += notes-utils.o
 LIB_OBJS += object.o
 LIB_OBJS += oidmap.o
 LIB_OBJS += oidset.o
+LIB_OBJS += oid-array.o
 LIB_OBJS += packfile.o
 LIB_OBJS += pack-bitmap.o
 LIB_OBJS += pack-bitmap-write.o
@@ -978,7 +979,6 @@ LIB_OBJS += sequencer.o
 LIB_OBJS += serve.o
 LIB_OBJS += server-info.o
 LIB_OBJS += setup.o
-LIB_OBJS += sha1-array.o
 LIB_OBJS += sha1-lookup.o
 LIB_OBJS += sha1-file.o
 LIB_OBJS += sha1-name.o
index 9154f810f76af3cdbf82b8bb509f47aa392b0e01..64b579b6ea98497135ec2e945b1a0a1420fb7ba1 100644 (file)
--- a/bisect.c
+++ b/bisect.c
@@ -10,7 +10,7 @@
 #include "run-command.h"
 #include "log-tree.h"
 #include "bisect.h"
-#include "sha1-array.h"
+#include "oid-array.h"
 #include "argv-array.h"
 #include "commit-slab.h"
 #include "commit-reach.h"
index 272f9fc6d7cb540c89c3dca13969398afd3c1ee1..9406763326c266ac4511e671e2dd9d095179d78b 100644 (file)
@@ -12,7 +12,7 @@
 #include "userdiff.h"
 #include "streaming.h"
 #include "tree-walk.h"
-#include "sha1-array.h"
+#include "oid-array.h"
 #include "packfile.h"
 #include "object-store.h"
 #include "promisor-remote.h"
index 42ac803091e6a0c7e22203b097d1f0001c9f5302..8537b17bd5e42aeb52a676f39a2d9a5d48e65aef 100644 (file)
@@ -17,7 +17,7 @@
 #include "log-tree.h"
 #include "builtin.h"
 #include "submodule.h"
-#include "sha1-array.h"
+#include "oid-array.h"
 
 #define DIFF_NO_INDEX_EXPLICIT 1
 #define DIFF_NO_INDEX_IMPLICIT 2
index dc1485c8aa1bf2b623aaa18ccd710644a34e0153..47711000725b4fb7dc504c62cc2d4ac384f7d46b 100644 (file)
@@ -3,7 +3,7 @@
 #include "fetch-pack.h"
 #include "remote.h"
 #include "connect.h"
-#include "sha1-array.h"
+#include "oid-array.h"
 #include "protocol.h"
 
 static const char fetch_pack_usage[] =
index 02aa6ee4808a96f264a861bc49789341179056be..2e2e33e038428709f96ccdf982114c8c7346631b 100644 (file)
@@ -26,7 +26,7 @@
 #include "pack-bitmap.h"
 #include "delta-islands.h"
 #include "reachable.h"
-#include "sha1-array.h"
+#include "oid-array.h"
 #include "argv-array.h"
 #include "list.h"
 #include "packfile.h"
index 3e624d1e008588ed063a7a960026287d34b84965..3d5edef49a8f43e22fbce68070914a200518c0f6 100644 (file)
@@ -12,7 +12,7 @@
 #include "parse-options.h"
 #include "exec-cmd.h"
 #include "run-command.h"
-#include "sha1-array.h"
+#include "oid-array.h"
 #include "remote.h"
 #include "dir.h"
 #include "rebase.h"
index 2cc18bbffdcf41cf2510becf6fcdd74c5946494a..d46147f709b5a1a6b21eea62e3ea1c4c2f536dd2 100644 (file)
@@ -13,7 +13,7 @@
 #include "remote.h"
 #include "connect.h"
 #include "string-list.h"
-#include "sha1-array.h"
+#include "oid-array.h"
 #include "connected.h"
 #include "argv-array.h"
 #include "version.h"
index 098ebf22d0d65a6f98606c7ea567467641976f6b..f2c5a34402962ac2ff263c532462e2fc30a19622 100644 (file)
@@ -11,7 +11,7 @@
 #include "quote.h"
 #include "transport.h"
 #include "version.h"
-#include "sha1-array.h"
+#include "oid-array.h"
 #include "gpg-interface.h"
 #include "gettext.h"
 #include "protocol.h"
index e0a4c25382846f801c43cd1093ffb0ffa63f975f..7f6b43b8bf2fb80f55ad2fc578c78e70a0e2e570 100644 (file)
@@ -17,7 +17,7 @@
 #include "diff.h"
 #include "revision.h"
 #include "gpg-interface.h"
-#include "sha1-array.h"
+#include "oid-array.h"
 #include "column.h"
 #include "ref-filter.h"
 
diff --git a/cache.h b/cache.h
index 37c899b53f7c3d36f1145d33f19d5c8302b911f5..cd77f38656cf6dbb9d8e755598f3b2ba77e528bd 100644 (file)
--- a/cache.h
+++ b/cache.h
@@ -14,7 +14,7 @@
 #include "pack-revindex.h"
 #include "hash.h"
 #include "path.h"
-#include "sha1-array.h"
+#include "oid-array.h"
 #include "repository.h"
 #include "mem-pool.h"
 
index d5c4d839dcf23c0204f93d486a53d41860d8631b..002e0e5438bc27472d032ac562a2f3a29ec20a68 100644 (file)
@@ -10,7 +10,7 @@
 #include "log-tree.h"
 #include "refs.h"
 #include "userdiff.h"
-#include "sha1-array.h"
+#include "oid-array.h"
 #include "revision.h"
 
 static int compare_paths(const struct combine_diff_path *one,
index b6451ab5e8909017edc678b3021384f3920fbe75..23013c634436adeeac65bd5e6a0d895a06fe6fe6 100644 (file)
--- a/connect.c
+++ b/connect.c
@@ -9,7 +9,7 @@
 #include "connect.h"
 #include "url.h"
 #include "string-list.h"
-#include "sha1-array.h"
+#include "oid-array.h"
 #include "transport.h"
 #include "strbuf.h"
 #include "version.h"
index 09dbd3cf72ba99d0f8ab793298b6b80215d450d3..aa98b2e54146f7de1f349f16a9a01e754a3a0b73 100644 (file)
@@ -17,7 +17,7 @@
 #include "pack-bitmap.h"
 #include "pack-objects.h"
 #include "delta-islands.h"
-#include "sha1-array.h"
+#include "oid-array.h"
 #include "config.h"
 
 KHASH_INIT(str, const char *, void *, 1, kh_str_hash_func, kh_str_hash_equal)
index 1734a573b010dd2f87541154cc70e5bb71b00463..0b07b3ee73b8727ce2af65b90b43f2cb10246ea9 100644 (file)
@@ -15,7 +15,7 @@
 #include "connect.h"
 #include "transport.h"
 #include "version.h"
-#include "sha1-array.h"
+#include "oid-array.h"
 #include "oidset.h"
 #include "packfile.h"
 #include "object-store.h"
index be72fee7d557758a9e0efbaa13efeb2b6fb84276..d1e490f2035d2f48583a30eb7a44cc4613a662fd 100644 (file)
@@ -4,7 +4,7 @@
 #include "cache.h"
 #include "oidmap.h"
 #include "list.h"
-#include "sha1-array.h"
+#include "oid-array.h"
 #include "strbuf.h"
 #include "thread-utils.h"
 
similarity index 96%
rename from sha1-array.c
rename to oid-array.c
index bada0c43537b47abc87b1e07f1044b5293eeac73..8657a5cedfa68cbc3711d4b288e514978ff5b6df 100644 (file)
@@ -1,5 +1,5 @@
 #include "cache.h"
-#include "sha1-array.h"
+#include "oid-array.h"
 #include "sha1-lookup.h"
 
 void oid_array_append(struct oid_array *array, const struct object_id *oid)
@@ -48,7 +48,7 @@ int oid_array_for_each(struct oid_array *array,
 {
        size_t i;
 
-       /* No oid_array_sort() here! See sha1-array.h */
+       /* No oid_array_sort() here! See oid-array.h */
 
        for (i = 0; i < array->nr; i++) {
                int ret = fn(array->oid + i, data);
similarity index 98%
rename from sha1-array.h
rename to oid-array.h
index c5e4b9324fd67280ad74478fbd1ab168bd596d97..f28d322c9006553c1335b836cea9252f80bb1e96 100644 (file)
@@ -19,7 +19,7 @@
  *
  * void some_func(void)
  * {
- *     struct sha1_array hashes = OID_ARRAY_INIT;
+ *     struct oid_array hashes = OID_ARRAY_INIT;
  *     struct object_id oid;
  *
  *     // Read objects into our set
index a28b55be48dc84582f18df446b1eb36f26b17167..86cd3930136e269ca68759b0113875e0a8e80e8a 100644 (file)
@@ -5,7 +5,7 @@
 #include "color.h"
 #include "string-list.h"
 #include "argv-array.h"
-#include "sha1-array.h"
+#include "oid-array.h"
 
 /*----- some often used options -----*/
 
index f1dcff4c6e23e831eff9915b659da062a835e8c8..64330e9601a6bf88b52f01ac3b9db88df8321d1b 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef REF_FILTER_H
 #define REF_FILTER_H
 
-#include "sha1-array.h"
+#include "oid-array.h"
 #include "refs.h"
 #include "commit.h"
 #include "parse-options.h"
index e4cd3218447ff385d31d621eb70f67f295f3f92a..1c9aa3d0ab978c1f98f1b4ff45143d765fcf6c27 100644 (file)
@@ -12,7 +12,7 @@
 #include "sideband.h"
 #include "argv-array.h"
 #include "credential.h"
-#include "sha1-array.h"
+#include "oid-array.h"
 #include "send-pack.h"
 #include "protocol.h"
 #include "quote.h"
index 0407841ae87af99254f254b65bb53815790fec9a..da4741ce4ae1d447fdefbb81cd99b9d7cfc33eaf 100644 (file)
@@ -12,7 +12,7 @@
 #include "quote.h"
 #include "transport.h"
 #include "version.h"
-#include "sha1-array.h"
+#include "oid-array.h"
 #include "gpg-interface.h"
 #include "cache.h"
 
index 5bb006e5a9e0fe6373a3a69c3d2c3cb7d1147738..6561cd90979b4bf831d07f2f8bf59f1763f4ec4f 100644 (file)
@@ -8,7 +8,7 @@
 #include "refs.h"
 #include "remote.h"
 #include "dir.h"
-#include "sha1-array.h"
+#include "oid-array.h"
 #include "packfile.h"
 #include "object-store.h"
 #include "repository.h"
index 7fd04afed19af7de9dc1438b328567d0b7f2b2b4..14f7fa6e27ebd22a15be35edaf867f619a054703 100644 (file)
--- a/shallow.c
+++ b/shallow.c
@@ -8,7 +8,7 @@
 #include "pkt-line.h"
 #include "remote.h"
 #include "refs.h"
-#include "sha1-array.h"
+#include "oid-array.h"
 #include "diff.h"
 #include "revision.h"
 #include "commit-slab.h"
index 31f391d7d2541c1498387248e669248de3430b5d..8b5559c8b157d42d65cc14d2d12ed1ed28f410e8 100644 (file)
@@ -12,7 +12,7 @@
 #include "diffcore.h"
 #include "refs.h"
 #include "string-list.h"
-#include "sha1-array.h"
+#include "oid-array.h"
 #include "argv-array.h"
 #include "blob.h"
 #include "thread-utils.h"
index ad5e69f9d3b0e03442f0d23b3b559bbfc163ee7b..6f7d3b939e744e3ab82758eda637963cd42ac726 100644 (file)
@@ -1,6 +1,6 @@
 #include "test-tool.h"
 #include "cache.h"
-#include "sha1-array.h"
+#include "oid-array.h"
 
 static int print_oid(const struct object_id *oid, void *data)
 {
index 1fdc7dac1a6230bdf3492cbebd6642fc825dac5f..471c5bd339c07e83701026968d46b79faa39e2cd 100644 (file)
@@ -16,7 +16,7 @@
 #include "url.h"
 #include "submodule.h"
 #include "string-list.h"
-#include "sha1-array.h"
+#include "oid-array.h"
 #include "sigchain.h"
 #include "transport-internal.h"
 #include "protocol.h"