]> git.ipfire.org Git - thirdparty/git.git/blame - pack-bitmap.h
pack-bitmap: add support for bitmap indexes
[thirdparty/git.git] / pack-bitmap.h
CommitLineData
fff42755
VM
1#ifndef PACK_BITMAP_H
2#define PACK_BITMAP_H
3
4#include "ewah/ewok.h"
5#include "khash.h"
6
7struct bitmap_disk_entry {
8 uint32_t object_pos;
9 uint8_t xor_offset;
10 uint8_t flags;
11} __attribute__((packed));
12
13struct bitmap_disk_header {
14 char magic[4];
15 uint16_t version;
16 uint16_t options;
17 uint32_t entry_count;
18 unsigned char checksum[20];
19};
20
21static const char BITMAP_IDX_SIGNATURE[] = {'B', 'I', 'T', 'M'};
22
23enum pack_bitmap_opts {
24 BITMAP_OPT_FULL_DAG = 1
25};
26
27typedef int (*show_reachable_fn)(
28 const unsigned char *sha1,
29 enum object_type type,
30 int flags,
31 uint32_t hash,
32 struct packed_git *found_pack,
33 off_t found_offset);
34
35int prepare_bitmap_git(void);
36void count_bitmap_commit_list(uint32_t *commits, uint32_t *trees, uint32_t *blobs, uint32_t *tags);
37void traverse_bitmap_commit_list(show_reachable_fn show_reachable);
38void test_bitmap_walk(struct rev_info *revs);
39char *pack_bitmap_filename(struct packed_git *p);
40int prepare_bitmap_walk(struct rev_info *revs);
41int reuse_partial_packfile_from_bitmap(struct packed_git **packfile, uint32_t *entries, off_t *up_to);
42
43#endif