]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'jk/packfile-reuse-cleanup'
authorJunio C Hamano <gitster@pobox.com>
Fri, 14 Feb 2020 20:54:19 +0000 (12:54 -0800)
committerJunio C Hamano <gitster@pobox.com>
Fri, 14 Feb 2020 20:54:19 +0000 (12:54 -0800)
The way "git pack-objects" reuses objects stored in existing pack
to generate its result has been improved.

* jk/packfile-reuse-cleanup:
  pack-bitmap: don't rely on bitmap_git->reuse_objects
  pack-objects: add checks for duplicate objects
  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: simplify bitmap_has_oid_in_uninteresting()
  pack-bitmap: uninteresting oid can be outside bitmapped packfile
  pack-bitmap: introduce bitmap_walk_contains()
  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 393c20a2d78b50f8852ed11bc9e943b27ba58d2e,d40ee424727279ea36f0a1926daae15962665f4e..b1998202fb00a1ad8d63bcc89e57489ab5d121c3
@@@ -1000,7 -1128,11 +1127,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 -2699,13 +2683,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 -2854,14 +2838,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