7 #include "pack-objects.h"
12 struct list_objects_filter_options
;
14 static const char BITMAP_IDX_SIGNATURE
[] = {'B', 'I', 'T', 'M'};
16 struct bitmap_disk_header
{
17 char magic
[ARRAY_SIZE(BITMAP_IDX_SIGNATURE
)];
21 unsigned char checksum
[GIT_MAX_RAWSZ
];
24 #define NEEDS_BITMAP (1u<<22)
26 enum pack_bitmap_opts
{
27 BITMAP_OPT_FULL_DAG
= 1,
28 BITMAP_OPT_HASH_CACHE
= 4,
31 enum pack_bitmap_flags
{
32 BITMAP_FLAG_REUSE
= 0x1
35 typedef int (*show_reachable_fn
)(
36 const struct object_id
*oid
,
37 enum object_type type
,
40 struct packed_git
*found_pack
,
45 struct bitmap_index
*prepare_bitmap_git(struct repository
*r
);
46 void count_bitmap_commit_list(struct bitmap_index
*, uint32_t *commits
,
47 uint32_t *trees
, uint32_t *blobs
, uint32_t *tags
);
48 void traverse_bitmap_commit_list(struct bitmap_index
*,
49 struct rev_info
*revs
,
50 show_reachable_fn show_reachable
);
51 void test_bitmap_walk(struct rev_info
*revs
);
52 struct bitmap_index
*prepare_bitmap_walk(struct rev_info
*revs
,
53 struct list_objects_filter_options
*filter
);
54 int reuse_partial_packfile_from_bitmap(struct bitmap_index
*,
55 struct packed_git
**packfile
,
57 struct bitmap
**reuse_out
);
58 int rebuild_existing_bitmaps(struct bitmap_index
*, struct packing_data
*mapping
,
59 kh_oid_map_t
*reused_bitmaps
, int show_progress
);
60 void free_bitmap_index(struct bitmap_index
*);
61 int bitmap_walk_contains(struct bitmap_index
*,
62 struct bitmap
*bitmap
, const struct object_id
*oid
);
65 * After a traversal has been performed by prepare_bitmap_walk(), this can be
66 * queried to see if a particular object was reachable from any of the
67 * objects flagged as UNINTERESTING.
69 int bitmap_has_oid_in_uninteresting(struct bitmap_index
*, const struct object_id
*oid
);
71 off_t
get_disk_usage_from_bitmap(struct bitmap_index
*, struct rev_info
*);
73 void bitmap_writer_show_progress(int show
);
74 void bitmap_writer_set_checksum(unsigned char *sha1
);
75 void bitmap_writer_build_type_index(struct packing_data
*to_pack
,
76 struct pack_idx_entry
**index
,
78 uint32_t *create_bitmap_mapping(struct bitmap_index
*bitmap_git
,
79 struct packing_data
*mapping
);
80 int rebuild_bitmap(const uint32_t *reposition
,
81 struct ewah_bitmap
*source
,
83 struct ewah_bitmap
*bitmap_for_commit(struct bitmap_index
*bitmap_git
,
84 struct commit
*commit
);
85 void bitmap_writer_select_commits(struct commit
**indexed_commits
,
86 unsigned int indexed_commits_nr
, int max_bitmaps
);
87 void bitmap_writer_build(struct packing_data
*to_pack
);
88 void bitmap_writer_finish(struct pack_idx_entry
**index
,