]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'jk/object-filter-with-bitmap'
authorJunio C Hamano <gitster@pobox.com>
Mon, 2 Mar 2020 23:07:18 +0000 (15:07 -0800)
committerJunio C Hamano <gitster@pobox.com>
Mon, 2 Mar 2020 23:07:18 +0000 (15:07 -0800)
The object reachability bitmap machinery and the partial cloning
machinery were not prepared to work well together, because some
object-filtering criteria that partial clones use inherently rely
on object traversal, but the bitmap machinery is an optimization
to bypass that object traversal.  There however are some cases
where they can work together, and they were taught about them.

* jk/object-filter-with-bitmap:
  rev-list --count: comment on the use of count_right++
  pack-objects: support filters with bitmaps
  pack-bitmap: implement BLOB_LIMIT filtering
  pack-bitmap: implement BLOB_NONE filtering
  bitmap: add bitmap_unset() function
  rev-list: use bitmap filters for traversal
  pack-bitmap: basic noop bitmap filter infrastructure
  rev-list: allow commit-only bitmap traversals
  t5310: factor out bitmap traversal comparison
  rev-list: allow bitmaps when counting objects
  rev-list: make --count work with --objects
  rev-list: factor out bitmap-optimized routines
  pack-bitmap: refuse to do a bitmap traversal with pathspecs
  rev-list: fallback to non-bitmap traversal when filtering
  pack-bitmap: fix leak of haves/wants object lists
  pack-bitmap: factor out type iterator initialization

1  2 
builtin/pack-objects.c
ewah/bitmap.c
ewah/ewok.h
object.c
pack-bitmap.c
pack-bitmap.h
t/t6000-rev-list-misc.sh

Simple merge
diff --cc ewah/bitmap.c
Simple merge
diff --cc ewah/ewok.h
index 1b98b57c8b7b623f4e76024b488081d09bf9bad6,59f4ef7c4fa4ef44cc898b21b990260d6b4fd9fe..011852bef179191b867b96e9d0fb57b099bc60b3
@@@ -172,8 -172,8 +172,9 @@@ struct bitmap 
  };
  
  struct bitmap *bitmap_new(void);
 +struct bitmap *bitmap_word_alloc(size_t word_alloc);
  void bitmap_set(struct bitmap *self, size_t pos);
+ void bitmap_unset(struct bitmap *self, size_t pos);
  int bitmap_get(struct bitmap *self, size_t pos);
  void bitmap_reset(struct bitmap *self);
  void bitmap_free(struct bitmap *self);
diff --cc object.c
Simple merge
diff --cc pack-bitmap.c
index 5a8689cdf8a379976901e49b8150a4e0662c812c,9d680065e4e8bbc921300ad2000ab37d2ce2c247..82bfd6672ad249943725187b9bc141ba629c918d
@@@ -637,15 -663,13 +670,15 @@@ static void show_objects_for_type
  
        struct bitmap *objects = bitmap_git->result;
  
-       ewah_iterator_init(&it, type_filter);
 -      if (bitmap_git->reuse_objects == bitmap_git->pack->num_objects)
 -              return;
 -
+       init_type_iterator(&it, bitmap_git, object_type);
  
 -      while (i < objects->word_alloc && ewah_iterator_next(&filter, &it)) {
 +      for (i = 0; i < objects->word_alloc &&
 +                      ewah_iterator_next(&filter, &it); i++) {
                eword_t word = objects->words[i] & filter;
 +              size_t pos = (i * BITS_IN_EWORD);
 +
 +              if (!word)
 +                      continue;
  
                for (offset = 0; offset < BITS_IN_EWORD; ++offset) {
                        struct object_id oid;
diff --cc pack-bitmap.h
index bcd03b8993fd7a409cd12a40ddab366b4f6ab22e,956775d0bb4c06b8b93d995d000ad49114f2e236..1203120c4321c15d488e623385d0ce9633b66477
@@@ -45,13 -45,14 +46,15 @@@ struct bitmap_index *prepare_bitmap_git
  void count_bitmap_commit_list(struct bitmap_index *, uint32_t *commits,
                              uint32_t *trees, uint32_t *blobs, uint32_t *tags);
  void traverse_bitmap_commit_list(struct bitmap_index *,
+                                struct rev_info *revs,
                                 show_reachable_fn show_reachable);
  void test_bitmap_walk(struct rev_info *revs);
- struct bitmap_index *prepare_bitmap_walk(struct rev_info *revs);
+ struct bitmap_index *prepare_bitmap_walk(struct rev_info *revs,
+                                        struct list_objects_filter_options *filter);
  int reuse_partial_packfile_from_bitmap(struct bitmap_index *,
                                       struct packed_git **packfile,
 -                                     uint32_t *entries, off_t *up_to);
 +                                     uint32_t *entries,
 +                                     struct bitmap **reuse_out);
  int rebuild_existing_bitmaps(struct bitmap_index *, struct packing_data *mapping,
                             kh_oid_map_t *reused_bitmaps, int show_progress);
  void free_bitmap_index(struct bitmap_index *);
Simple merge