Sync 'ds/multi-pack-index' to v2.19.0-rc0
authorJunio C Hamano <gitster@pobox.com>
Mon, 20 Aug 2018 22:29:54 +0000 (15:29 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 20 Aug 2018 22:29:54 +0000 (15:29 -0700)
* 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
...

13 files changed:
1  2 
.gitignore
Documentation/config.txt
Makefile
builtin.h
builtin/repack.c
command-list.txt
git.c
object-store.h
packfile.c
packfile.h
sha1-name.c
t/helper/test-tool.c
t/helper/test-tool.h
diff --cc .gitignore
Simple merge
index 1c42364988ac1890007b617f50653061c1cc2350,25f817ca427c4506b941419dfcf8a12f915b32ca..8283443c979ec4543ebfe4539cf21c2bf4a8569b
@@@ -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 d03df31c2a61b29caa60928eb3b3f131562152d3,0b801d1b16b96f46b0d3008dbe03d45e0ddce93d..377379fcc05c1dbb04cb7849ee610e235c3ef4ab
+++ 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.h
Simple merge
index d5886039cc6656609962fd522a27f61eda6cd0ec,7f7cdc8b17dcd2bd823897df641693eb8a889629..42be88e86ce6fd5541ad067c17f5b29a4d492feb
@@@ -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,
Simple merge
diff --cc git.c
Simple merge
diff --cc object-store.h
index 67e66227d9c41e2f3036d0aeb89afaf5a17ec98a,c2b162489a161f6e3e01aa97dd3b0b81b82ea26d..97f1c160e59b96b63011afea03e8c0a9e8f521d1
@@@ -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 packfile.c
Simple merge
diff --cc packfile.h
Simple merge
diff --cc sha1-name.c
Simple merge
index 0edafcfd65db7586bc1521d2e1afa99fbde50292,1c3ab36e6c3ef06c10c78945df61ba3a577aaf80..32767017102650db48115ffa69aea5c6b5636a4c
@@@ -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 },
index e926c416ea48bc25412097944d454ebd922e624a,6af8c08a6655ada30235e0368be7483adb7a92e2..70fc0285e8ddf1680fc0e7754e3ee0898d4d1e18
@@@ -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);