88#include "object-store.h"
99
1010static char const * const builtin_commit_graph_usage [] = {
11- N_ ("git commit-graph read [--object-dir <objdir>]" ),
1211 N_ ("git commit-graph verify [--object-dir <objdir>] [--shallow] [--[no-]progress]" ),
1312 N_ ("git commit-graph write [--object-dir <objdir>] [--append|--split] [--reachable|--stdin-packs|--stdin-commits] [--[no-]progress] <split options>" ),
1413 NULL
@@ -19,11 +18,6 @@ static const char * const builtin_commit_graph_verify_usage[] = {
1918 NULL
2019};
2120
22- static const char * const builtin_commit_graph_read_usage [] = {
23- N_ ("git commit-graph read [--object-dir <objdir>]" ),
24- NULL
25- };
26-
2721static const char * const builtin_commit_graph_write_usage [] = {
2822 N_ ("git commit-graph write [--object-dir <objdir>] [--append|--split] [--reachable|--stdin-packs|--stdin-commits] [--[no-]progress] <split options>" ),
2923 NULL
@@ -93,66 +87,6 @@ static int graph_verify(int argc, const char **argv)
9387 return verify_commit_graph (the_repository , graph , flags );
9488}
9589
96- static int graph_read (int argc , const char * * argv )
97- {
98- struct commit_graph * graph = NULL ;
99- char * graph_name ;
100- int open_ok ;
101- int fd ;
102- struct stat st ;
103-
104- static struct option builtin_commit_graph_read_options [] = {
105- OPT_STRING (0 , "object-dir" , & opts .obj_dir ,
106- N_ ("dir" ),
107- N_ ("The object directory to store the graph" )),
108- OPT_END (),
109- };
110-
111- trace2_cmd_mode ("read" );
112-
113- argc = parse_options (argc , argv , NULL ,
114- builtin_commit_graph_read_options ,
115- builtin_commit_graph_read_usage , 0 );
116-
117- if (!opts .obj_dir )
118- opts .obj_dir = get_object_directory ();
119-
120- graph_name = get_commit_graph_filename (opts .obj_dir );
121-
122- open_ok = open_commit_graph (graph_name , & fd , & st );
123- if (!open_ok )
124- die_errno (_ ("Could not open commit-graph '%s'" ), graph_name );
125-
126- graph = load_commit_graph_one_fd_st (fd , & st );
127- if (!graph )
128- return 1 ;
129-
130- FREE_AND_NULL (graph_name );
131-
132- printf ("header: %08x %d %d %d %d\n" ,
133- ntohl (* (uint32_t * )graph -> data ),
134- * (unsigned char * )(graph -> data + 4 ),
135- * (unsigned char * )(graph -> data + 5 ),
136- * (unsigned char * )(graph -> data + 6 ),
137- * (unsigned char * )(graph -> data + 7 ));
138- printf ("num_commits: %u\n" , graph -> num_commits );
139- printf ("chunks:" );
140-
141- if (graph -> chunk_oid_fanout )
142- printf (" oid_fanout" );
143- if (graph -> chunk_oid_lookup )
144- printf (" oid_lookup" );
145- if (graph -> chunk_commit_data )
146- printf (" commit_metadata" );
147- if (graph -> chunk_extra_edges )
148- printf (" extra_edges" );
149- printf ("\n" );
150-
151- UNLEAK (graph );
152-
153- return 0 ;
154- }
155-
15690extern int read_replace_refs ;
15791static struct split_commit_graph_opts split_opts ;
15892
@@ -268,8 +202,6 @@ int cmd_commit_graph(int argc, const char **argv, const char *prefix)
268202 save_commit_buffer = 0 ;
269203
270204 if (argc > 0 ) {
271- if (!strcmp (argv [0 ], "read" ))
272- return graph_read (argc , argv );
273205 if (!strcmp (argv [0 ], "verify" ))
274206 return graph_verify (argc , argv );
275207 if (!strcmp (argv [0 ], "write" ))
0 commit comments