From: Junio C Hamano Date: Mon, 20 Aug 2018 22:29:54 +0000 (-0700) Subject: Sync 'ds/multi-pack-index' to v2.19.0-rc0 X-Git-Tag: v2.20.0-rc0~249^2~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c00ba2233ef7dcfa478068c75bc4b25a7ac2a0a8;p=thirdparty%2Fgit.git Sync 'ds/multi-pack-index' to v2.19.0-rc0 * ds/multi-pack-index: (23 commits) midx: clear midx on repack packfile: skip loading index if in multi-pack-index midx: prevent duplicate packfile loads midx: use midx in approximate_object_count midx: use existing midx when writing new one midx: use midx in abbreviation calculations midx: read objects from multi-pack-index config: create core.multiPackIndex setting midx: write object offsets midx: write object id fanout chunk midx: write object ids in a chunk midx: sort and deduplicate objects from packfiles midx: read pack names into array multi-pack-index: write pack names in chunk multi-pack-index: read packfile list packfile: generalize pack directory list t5319: expand test data multi-pack-index: load into memory midx: write header information to lockfile multi-pack-index: add 'write' verb ... --- c00ba2233ef7dcfa478068c75bc4b25a7ac2a0a8 diff --cc Documentation/config.txt index 1c42364988,25f817ca42..8283443c97 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@@ -917,18 -904,15 +917,23 @@@ core.notesRef: This setting defaults to "refs/notes/commits", and it can be overridden by the `GIT_NOTES_REF` environment variable. See linkgit:git-notes[1]. -core.commitGraph:: - Enable git commit graph feature. Allows reading from the - commit-graph file. +gc.commitGraph:: + If true, then gc will rewrite the commit-graph file when + linkgit:git-gc[1] is run. When using linkgit:git-gc[1] + '--auto' the commit-graph will be updated if housekeeping is + required. Default is false. See linkgit:git-commit-graph[1] + for details. + +core.useReplaceRefs:: + If set to `false`, behave as if the `--no-replace-objects` + option was given on the command line. See linkgit:git[1] and + linkgit:git-replace[1] for more information. + core.multiPackIndex:: + Use the multi-pack-index file to track multiple packfiles using a + single index. See link:technical/multi-pack-index.html[the + multi-pack-index design document]. + core.sparseCheckout:: Enable "sparse checkout" feature. See section "Sparse checkout" in linkgit:git-read-tree[1] for more information. diff --cc Makefile index d03df31c2a,0b801d1b16..377379fcc0 --- a/Makefile +++ b/Makefile @@@ -723,9 -717,9 +723,10 @@@ TEST_BUILTINS_OBJS += test-online-cpus. TEST_BUILTINS_OBJS += test-path-utils.o TEST_BUILTINS_OBJS += test-prio-queue.o TEST_BUILTINS_OBJS += test-read-cache.o + TEST_BUILTINS_OBJS += test-read-midx.o TEST_BUILTINS_OBJS += test-ref-store.o TEST_BUILTINS_OBJS += test-regex.o +TEST_BUILTINS_OBJS += test-repository.o TEST_BUILTINS_OBJS += test-revision-walking.o TEST_BUILTINS_OBJS += test-run-command.o TEST_BUILTINS_OBJS += test-scrap-cache-tree.o @@@ -900,9 -891,8 +901,10 @@@ LIB_OBJS += merge. LIB_OBJS += merge-blobs.o LIB_OBJS += merge-recursive.o LIB_OBJS += mergesort.o + LIB_OBJS += midx.o LIB_OBJS += name-hash.o +LIB_OBJS += negotiator/default.o +LIB_OBJS += negotiator/skipping.o LIB_OBJS += notes.o LIB_OBJS += notes-cache.o LIB_OBJS += notes-merge.o diff --cc builtin/repack.c index d5886039cc,7f7cdc8b17..42be88e86c --- a/builtin/repack.c +++ b/builtin/repack.c @@@ -8,8 -8,7 +8,9 @@@ #include "strbuf.h" #include "string-list.h" #include "argv-array.h" + #include "midx.h" +#include "packfile.h" +#include "object-store.h" static int delta_base_offset = 1; static int pack_kept_objects = -1; @@@ -278,9 -166,16 +279,10 @@@ int cmd_repack(int argc, const char **a int delete_redundant = 0; const char *unpack_unreachable = NULL; int keep_unreachable = 0; - const char *window = NULL, *window_memory = NULL; - const char *depth = NULL; - const char *threads = NULL; - const char *max_pack_size = NULL; struct string_list keep_pack_list = STRING_LIST_INIT_NODUP; - int no_reuse_delta = 0, no_reuse_object = 0; int no_update_server_info = 0; - int quiet = 0; - int local = 0; + int midx_cleared = 0; + struct pack_objects_args po_args = {NULL}; struct option builtin_repack_options[] = { OPT_BIT('a', NULL, &pack_everything, diff --cc object-store.h index 67e66227d9,c2b162489a..97f1c160e5 --- a/object-store.h +++ b/object-store.h @@@ -107,9 -105,13 +109,16 @@@ struct raw_object_store */ struct oidmap *replace_map; + struct commit_graph *commit_graph; + unsigned commit_graph_attempted : 1; /* if loading has been attempted */ + + /* + * private data + * + * should only be accessed directly by packfile.c and midx.c + */ + struct multi_pack_index *multi_pack_index; + /* * private data * diff --cc t/helper/test-tool.c index 0edafcfd65,1c3ab36e6c..3276701710 --- a/t/helper/test-tool.c +++ b/t/helper/test-tool.c @@@ -28,9 -27,9 +28,10 @@@ static struct test_cmd cmds[] = { "path-utils", cmd__path_utils }, { "prio-queue", cmd__prio_queue }, { "read-cache", cmd__read_cache }, + { "read-midx", cmd__read_midx }, { "ref-store", cmd__ref_store }, { "regex", cmd__regex }, + { "repository", cmd__repository }, { "revision-walking", cmd__revision_walking }, { "run-command", cmd__run_command }, { "scrap-cache-tree", cmd__scrap_cache_tree }, diff --cc t/helper/test-tool.h index e926c416ea,6af8c08a66..70fc0285e8 --- a/t/helper/test-tool.h +++ b/t/helper/test-tool.h @@@ -22,9 -21,9 +22,10 @@@ int cmd__online_cpus(int argc, const ch int cmd__path_utils(int argc, const char **argv); int cmd__prio_queue(int argc, const char **argv); int cmd__read_cache(int argc, const char **argv); + int cmd__read_midx(int argc, const char **argv); int cmd__ref_store(int argc, const char **argv); int cmd__regex(int argc, const char **argv); +int cmd__repository(int argc, const char **argv); int cmd__revision_walking(int argc, const char **argv); int cmd__run_command(int argc, const char **argv); int cmd__scrap_cache_tree(int argc, const char **argv);