THIS IS A TEST INSTANCE ONLY! REPOSITORIES CAN BE DELETED AT ANY TIME!

Git Source Code Mirror - This is a publish-only repository and all pull requests are ignored. Please follow Documentation/SubmittingPatches procedure for any of your improvements.
git
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

79 lines
2.3KB

  1. #ifndef PACK_BITMAP_H
  2. #define PACK_BITMAP_H
  3. #include "ewah/ewok.h"
  4. #include "khash.h"
  5. #include "pack-objects.h"
  6. struct commit;
  7. struct repository;
  8. struct rev_info;
  9. static const char BITMAP_IDX_SIGNATURE[] = {'B', 'I', 'T', 'M'};
  10. struct bitmap_disk_header {
  11. char magic[ARRAY_SIZE(BITMAP_IDX_SIGNATURE)];
  12. uint16_t version;
  13. uint16_t options;
  14. uint32_t entry_count;
  15. unsigned char checksum[GIT_MAX_RAWSZ];
  16. };
  17. #define NEEDS_BITMAP (1u<<22)
  18. enum pack_bitmap_opts {
  19. BITMAP_OPT_FULL_DAG = 1,
  20. BITMAP_OPT_HASH_CACHE = 4,
  21. };
  22. enum pack_bitmap_flags {
  23. BITMAP_FLAG_REUSE = 0x1
  24. };
  25. typedef int (*show_reachable_fn)(
  26. const struct object_id *oid,
  27. enum object_type type,
  28. int flags,
  29. uint32_t hash,
  30. struct packed_git *found_pack,
  31. off_t found_offset);
  32. struct bitmap_index;
  33. struct bitmap_index *prepare_bitmap_git(struct repository *r);
  34. void count_bitmap_commit_list(struct bitmap_index *, uint32_t *commits,
  35. uint32_t *trees, uint32_t *blobs, uint32_t *tags);
  36. void traverse_bitmap_commit_list(struct bitmap_index *,
  37. show_reachable_fn show_reachable);
  38. void test_bitmap_walk(struct rev_info *revs);
  39. struct bitmap_index *prepare_bitmap_walk(struct rev_info *revs);
  40. int reuse_partial_packfile_from_bitmap(struct bitmap_index *,
  41. struct packed_git **packfile,
  42. uint32_t *entries, off_t *up_to);
  43. int rebuild_existing_bitmaps(struct bitmap_index *, struct packing_data *mapping,
  44. kh_oid_map_t *reused_bitmaps, int show_progress);
  45. void free_bitmap_index(struct bitmap_index *);
  46. /*
  47. * After a traversal has been performed by prepare_bitmap_walk(), this can be
  48. * queried to see if a particular object was reachable from any of the
  49. * objects flagged as UNINTERESTING.
  50. */
  51. int bitmap_has_oid_in_uninteresting(struct bitmap_index *, const struct object_id *oid);
  52. void bitmap_writer_show_progress(int show);
  53. void bitmap_writer_set_checksum(unsigned char *sha1);
  54. void bitmap_writer_build_type_index(struct packing_data *to_pack,
  55. struct pack_idx_entry **index,
  56. uint32_t index_nr);
  57. void bitmap_writer_reuse_bitmaps(struct packing_data *to_pack);
  58. void bitmap_writer_select_commits(struct commit **indexed_commits,
  59. unsigned int indexed_commits_nr, int max_bitmaps);
  60. void bitmap_writer_build(struct packing_data *to_pack);
  61. void bitmap_writer_finish(struct pack_idx_entry **index,
  62. uint32_t index_nr,
  63. const char *filename,
  64. uint16_t options);
  65. #endif