2 #include "commit-graph.h"
3 #include "repository.h"
4 #include "object-store.h"
8 int cmd__read_graph(int argc
, const char **argv
)
10 struct commit_graph
*graph
= NULL
;
11 struct object_directory
*odb
;
13 setup_git_directory();
14 odb
= the_repository
->objects
->odb
;
16 prepare_repo_settings(the_repository
);
18 graph
= read_commit_graph_one(the_repository
, odb
);
22 printf("header: %08x %d %d %d %d\n",
23 ntohl(*(uint32_t*)graph
->data
),
24 *(unsigned char*)(graph
->data
+ 4),
25 *(unsigned char*)(graph
->data
+ 5),
26 *(unsigned char*)(graph
->data
+ 6),
27 *(unsigned char*)(graph
->data
+ 7));
28 printf("num_commits: %u\n", graph
->num_commits
);
31 if (graph
->chunk_oid_fanout
)
32 printf(" oid_fanout");
33 if (graph
->chunk_oid_lookup
)
34 printf(" oid_lookup");
35 if (graph
->chunk_commit_data
)
36 printf(" commit_metadata");
37 if (graph
->chunk_generation_data
)
38 printf(" generation_data");
39 if (graph
->chunk_generation_data_overflow
)
40 printf(" generation_data_overflow");
41 if (graph
->chunk_extra_edges
)
42 printf(" extra_edges");
43 if (graph
->chunk_bloom_indexes
)
44 printf(" bloom_indexes");
45 if (graph
->chunk_bloom_data
)
46 printf(" bloom_data");
50 if (graph
->bloom_filter_settings
)
51 printf(" bloom(%"PRIu32
",%"PRIu32
",%"PRIu32
")",
52 graph
->bloom_filter_settings
->hash_version
,
53 graph
->bloom_filter_settings
->bits_per_entry
,
54 graph
->bloom_filter_settings
->num_hashes
);
55 if (graph
->read_generation_data
)
56 printf(" read_generation_data");
57 if (graph
->topo_levels
)
58 printf(" topo_levels");