@matheusbsbs / matheus-bagliano / commits / fe299ec5ae
Fork 0

oid_array: rename source file from sha1-array

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>

Jeff King committed Mar 30, 2020 at 10:03 UTC fe299ec5ae7b419990bbc3efd4e6bfa3f0773b45
27 files changed +28 -28
Makefile
+1 -1
@@ -929,6 +929,7 @@ LIB_OBJS += notes-utils.o
929 LIB_OBJS += object.o
930 LIB_OBJS += oidmap.o
931 LIB_OBJS += oidset.o
932 +LIB_OBJS += oid-array.o
933 LIB_OBJS += packfile.o
934 LIB_OBJS += pack-bitmap.o
935 LIB_OBJS += pack-bitmap-write.o
@@ -978,7 +979,6 @@ LIB_OBJS += sequencer.o
979 LIB_OBJS += serve.o
980 LIB_OBJS += server-info.o
981 LIB_OBJS += setup.o
981 -LIB_OBJS += sha1-array.o
982 LIB_OBJS += sha1-lookup.o
983 LIB_OBJS += sha1-file.o
984 LIB_OBJS += sha1-name.o
bisect.c
+1 -1
@@ -10,7 +10,7 @@
10 #include "run-command.h"
11 #include "log-tree.h"
12 #include "bisect.h"
13 -#include "sha1-array.h"
13 +#include "oid-array.h"
14 #include "argv-array.h"
15 #include "commit-slab.h"
16 #include "commit-reach.h"
builtin/cat-file.c
+1 -1
@@ -12,7 +12,7 @@
12 #include "userdiff.h"
13 #include "streaming.h"
14 #include "tree-walk.h"
15 -#include "sha1-array.h"
15 +#include "oid-array.h"
16 #include "packfile.h"
17 #include "object-store.h"
18 #include "promisor-remote.h"
builtin/diff.c
+1 -1
@@ -17,7 +17,7 @@
17 #include "log-tree.h"
18 #include "builtin.h"
19 #include "submodule.h"
20 -#include "sha1-array.h"
20 +#include "oid-array.h"
21
22 #define DIFF_NO_INDEX_EXPLICIT 1
23 #define DIFF_NO_INDEX_IMPLICIT 2
builtin/fetch-pack.c
+1 -1
@@ -3,7 +3,7 @@
3 #include "fetch-pack.h"
4 #include "remote.h"
5 #include "connect.h"
6 -#include "sha1-array.h"
6 +#include "oid-array.h"
7 #include "protocol.h"
8
9 static const char fetch_pack_usage[] =
builtin/pack-objects.c
+1 -1
@@ -26,7 +26,7 @@
26 #include "pack-bitmap.h"
27 #include "delta-islands.h"
28 #include "reachable.h"
29 -#include "sha1-array.h"
29 +#include "oid-array.h"
30 #include "argv-array.h"
31 #include "list.h"
32 #include "packfile.h"
builtin/pull.c
+1 -1
@@ -12,7 +12,7 @@
12 #include "parse-options.h"
13 #include "exec-cmd.h"
14 #include "run-command.h"
15 -#include "sha1-array.h"
15 +#include "oid-array.h"
16 #include "remote.h"
17 #include "dir.h"
18 #include "rebase.h"
builtin/receive-pack.c
+1 -1
@@ -13,7 +13,7 @@
13 #include "remote.h"
14 #include "connect.h"
15 #include "string-list.h"
16 -#include "sha1-array.h"
16 +#include "oid-array.h"
17 #include "connected.h"
18 #include "argv-array.h"
19 #include "version.h"
builtin/send-pack.c
+1 -1
@@ -11,7 +11,7 @@
11 #include "quote.h"
12 #include "transport.h"
13 #include "version.h"
14 -#include "sha1-array.h"
14 +#include "oid-array.h"
15 #include "gpg-interface.h"
16 #include "gettext.h"
17 #include "protocol.h"
builtin/tag.c
+1 -1
@@ -17,7 +17,7 @@
17 #include "diff.h"
18 #include "revision.h"
19 #include "gpg-interface.h"
20 -#include "sha1-array.h"
20 +#include "oid-array.h"
21 #include "column.h"
22 #include "ref-filter.h"
23
cache.h
+1 -1
@@ -14,7 +14,7 @@
14 #include "pack-revindex.h"
15 #include "hash.h"
16 #include "path.h"
17 -#include "sha1-array.h"
17 +#include "oid-array.h"
18 #include "repository.h"
19 #include "mem-pool.h"
20
combine-diff.c
+1 -1
@@ -10,7 +10,7 @@
10 #include "log-tree.h"
11 #include "refs.h"
12 #include "userdiff.h"
13 -#include "sha1-array.h"
13 +#include "oid-array.h"
14 #include "revision.h"
15
16 static int compare_paths(const struct combine_diff_path *one,
connect.c
+1 -1
@@ -9,7 +9,7 @@
9 #include "connect.h"
10 #include "url.h"
11 #include "string-list.h"
12 -#include "sha1-array.h"
12 +#include "oid-array.h"
13 #include "transport.h"
14 #include "strbuf.h"
15 #include "version.h"
delta-islands.c
+1 -1
@@ -17,7 +17,7 @@
17 #include "pack-bitmap.h"
18 #include "pack-objects.h"
19 #include "delta-islands.h"
20 -#include "sha1-array.h"
20 +#include "oid-array.h"
21 #include "config.h"
22
23 KHASH_INIT(str, const char *, void *, 1, kh_str_hash_func, kh_str_hash_equal)
fetch-pack.c
+1 -1
@@ -15,7 +15,7 @@
15 #include "connect.h"
16 #include "transport.h"
17 #include "version.h"
18 -#include "sha1-array.h"
18 +#include "oid-array.h"
19 #include "oidset.h"
20 #include "packfile.h"
21 #include "object-store.h"
object-store.h
+1 -1
@@ -4,7 +4,7 @@
4 #include "cache.h"
5 #include "oidmap.h"
6 #include "list.h"
7 -#include "sha1-array.h"
7 +#include "oid-array.h"
8 #include "strbuf.h"
9 #include "thread-utils.h"
10
oid-array.c renamed
+2 -2
@@ -1,5 +1,5 @@
1 #include "cache.h"
2 -#include "sha1-array.h"
2 +#include "oid-array.h"
3 #include "sha1-lookup.h"
4
5 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,
48 {
49 size_t i;
50
51 - /* No oid_array_sort() here! See sha1-array.h */
51 + /* No oid_array_sort() here! See oid-array.h */
52
53 for (i = 0; i < array->nr; i++) {
54 int ret = fn(array->oid + i, data);
oid-array.h renamed
+1 -1
@@ -19,7 +19,7 @@
19 *
20 * void some_func(void)
21 * {
22 - * struct sha1_array hashes = OID_ARRAY_INIT;
22 + * struct oid_array hashes = OID_ARRAY_INIT;
23 * struct object_id oid;
24 *
25 * // Read objects into our set
parse-options-cb.c
+1 -1
@@ -5,7 +5,7 @@
5 #include "color.h"
6 #include "string-list.h"
7 #include "argv-array.h"
8 -#include "sha1-array.h"
8 +#include "oid-array.h"
9
10 /*----- some often used options -----*/
11
ref-filter.h
+1 -1
@@ -1,7 +1,7 @@
1 #ifndef REF_FILTER_H
2 #define REF_FILTER_H
3
4 -#include "sha1-array.h"
4 +#include "oid-array.h"
5 #include "refs.h"
6 #include "commit.h"
7 #include "parse-options.h"
remote-curl.c
+1 -1
@@ -12,7 +12,7 @@
12 #include "sideband.h"
13 #include "argv-array.h"
14 #include "credential.h"
15 -#include "sha1-array.h"
15 +#include "oid-array.h"
16 #include "send-pack.h"
17 #include "protocol.h"
18 #include "quote.h"
send-pack.c
+1 -1
@@ -12,7 +12,7 @@
12 #include "quote.h"
13 #include "transport.h"
14 #include "version.h"
15 -#include "sha1-array.h"
15 +#include "oid-array.h"
16 #include "gpg-interface.h"
17 #include "cache.h"
18
sha1-name.c
+1 -1
@@ -8,7 +8,7 @@
8 #include "refs.h"
9 #include "remote.h"
10 #include "dir.h"
11 -#include "sha1-array.h"
11 +#include "oid-array.h"
12 #include "packfile.h"
13 #include "object-store.h"
14 #include "repository.h"
shallow.c
+1 -1
@@ -8,7 +8,7 @@
8 #include "pkt-line.h"
9 #include "remote.h"
10 #include "refs.h"
11 -#include "sha1-array.h"
11 +#include "oid-array.h"
12 #include "diff.h"
13 #include "revision.h"
14 #include "commit-slab.h"
submodule.c
+1 -1
@@ -12,7 +12,7 @@
12 #include "diffcore.h"
13 #include "refs.h"
14 #include "string-list.h"
15 -#include "sha1-array.h"
15 +#include "oid-array.h"
16 #include "argv-array.h"
17 #include "blob.h"
18 #include "thread-utils.h"
t/helper/test-sha1-array.c
+1 -1
@@ -1,6 +1,6 @@
1 #include "test-tool.h"
2 #include "cache.h"
3 -#include "sha1-array.h"
3 +#include "oid-array.h"
4
5 static int print_oid(const struct object_id *oid, void *data)
6 {
transport.c
+1 -1
@@ -16,7 +16,7 @@
16 #include "url.h"
17 #include "submodule.h"
18 #include "string-list.h"
19 -#include "sha1-array.h"
19 +#include "oid-array.h"
20 #include "sigchain.h"
21 #include "transport-internal.h"
22 #include "protocol.h"