3 #include "commit-graph.h"
4 #include "repository.h"
5 #include "object-store.h"
7 int cmd__read_graph(int argc, const char **argv)
9 struct commit_graph *graph = NULL;
10 struct object_directory *odb;
12 setup_git_directory();
13 odb = the_repository->objects->odb;
15 prepare_repo_settings(the_repository);
17 graph = read_commit_graph_one(the_repository, odb);
21 printf("header: %08x %d %d %d %d\n",
22 ntohl(*(uint32_t*)graph->data),
23 *(unsigned char*)(graph->data + 4),
24 *(unsigned char*)(graph->data + 5),
25 *(unsigned char*)(graph->data + 6),
26 *(unsigned char*)(graph->data + 7));
27 printf("num_commits: %u\n", graph->num_commits);
30 if (graph->chunk_oid_fanout)
31 printf(" oid_fanout");
32 if (graph->chunk_oid_lookup)
33 printf(" oid_lookup");
34 if (graph->chunk_commit_data)
35 printf(" commit_metadata");
36 if (graph->chunk_extra_edges)
37 printf(" extra_edges");
38 if (graph->chunk_bloom_indexes)
39 printf(" bloom_indexes");
40 if (graph->chunk_bloom_data)
41 printf(" bloom_data");