]> granicus.if.org Git - git/commitdiff
Merge branch 'jk/packfile-reuse-cleanup' into jch
authorJunio C Hamano <gitster@pobox.com>
Thu, 24 Oct 2019 04:34:27 +0000 (13:34 +0900)
committerJunio C Hamano <gitster@pobox.com>
Thu, 24 Oct 2019 04:34:27 +0000 (13:34 +0900)
The way "git pack-objects" reuses objects stored in existing pack
to generate its result has been improved.

* jk/packfile-reuse-cleanup:
  pack-objects: improve partial packfile reuse
  builtin/pack-objects: introduce obj_is_packed()
  pack-objects: introduce pack.allowPackReuse
  csum-file: introduce hashfile_total()
  pack-bitmap: introduce bitmap_walk_contains()
  pack-bitmap: don't rely on bitmap_git->reuse_objects
  ewah/bitmap: introduce bitmap_word_alloc()
  packfile: expose get_delta_base()
  builtin/pack-objects: report reused packfile objects

1  2 
Documentation/config/pack.txt
builtin/pack-objects.c
pack-bitmap.c
pack-bitmap.h
packfile.c
packfile.h

Simple merge
index 5876583220c7d15ace8f7d4fbc7a5c4cef7a8d3b,e0b22c92fc7365c6a65d77ae1259a2c1d6b227d5..f710f8dde384eec0e1e56d3fbe5d27fd7ab67278
@@@ -1000,7 -1120,11 +1119,11 @@@ static int have_duplicate_entry(const s
  {
        struct object_entry *entry;
  
 -      entry = packlist_find(&to_pack, oid, index_pos);
+       if (reuse_packfile_bitmap &&
+           bitmap_walk_contains(bitmap_git, reuse_packfile_bitmap, oid))
+               return 1;
 +      entry = packlist_find(&to_pack, oid);
        if (!entry)
                return 0;
  
@@@ -2552,6 -2691,13 +2675,13 @@@ static void ll_find_deltas(struct objec
        free(p);
  }
  
 -      return packlist_find(&to_pack, oid, NULL) ||
+ static int obj_is_packed(const struct object_id *oid)
+ {
++      return packlist_find(&to_pack, oid) ||
+               (reuse_packfile_bitmap &&
+                bitmap_walk_contains(bitmap_git, reuse_packfile_bitmap, oid));
+ }
  static void add_tag_chain(const struct object_id *oid)
  {
        struct tag *tag;
@@@ -2699,6 -2846,14 +2830,10 @@@ static int git_pack_config(const char *
                use_bitmap_index_default = git_config_bool(k, v);
                return 0;
        }
 -      if (!strcmp(k, "pack.usesparse")) {
 -              sparse = git_config_bool(k, v);
 -              return 0;
 -      }
+       if (!strcmp(k, "pack.allowpackreuse")) {
+               allow_pack_reuse = git_config_bool(k, v);
+               return 0;
+       }
        if (!strcmp(k, "pack.threads")) {
                delta_search_threads = git_config_int(k, v);
                if (delta_search_threads < 0)
diff --cc pack-bitmap.c
Simple merge
diff --cc pack-bitmap.h
Simple merge
diff --cc packfile.c
Simple merge
diff --cc packfile.h
Simple merge