blob: e8f77f535f3075405853f6ff6d4fdf40a4b019af [file] [log] [blame]
Derrick Stolee4ce58ee2018-04-02 16:34:18 -04001#include "builtin.h"
2#include "config.h"
Derrick Stoleef237c8b2018-04-02 16:34:20 -04003#include "dir.h"
4#include "lockfile.h"
Derrick Stolee4ce58ee2018-04-02 16:34:18 -04005#include "parse-options.h"
Derrick Stolee283e68c2018-06-27 09:24:32 -04006#include "repository.h"
Derrick Stoleef237c8b2018-04-02 16:34:20 -04007#include "commit-graph.h"
Derrick Stolee3da4b602019-06-18 11:14:32 -07008#include "object-store.h"
Taylor Blau5b6653e2020-05-13 15:59:44 -06009#include "progress.h"
Taylor Blau2f00c352020-05-13 15:59:55 -060010#include "tag.h"
Derrick Stolee4ce58ee2018-04-02 16:34:18 -040011
Ævar Arnfjörð Bjarmason8757b352021-08-23 14:30:15 +020012#define BUILTIN_COMMIT_GRAPH_VERIFY_USAGE \
Ævar Arnfjörð Bjarmasonf6a8ef02022-10-13 17:39:10 +020013 N_("git commit-graph verify [--object-dir <dir>] [--shallow] [--[no-]progress]")
Ævar Arnfjörð Bjarmason8757b352021-08-23 14:30:15 +020014
15#define BUILTIN_COMMIT_GRAPH_WRITE_USAGE \
Ævar Arnfjörð Bjarmasonf6a8ef02022-10-13 17:39:10 +020016 N_("git commit-graph write [--object-dir <dir>] [--append]\n" \
Ævar Arnfjörð Bjarmasone2f4e7e2022-10-13 17:39:06 +020017 " [--split[=<strategy>]] [--reachable | --stdin-packs | --stdin-commits]\n" \
Ævar Arnfjörð Bjarmason5af8b612022-10-13 17:39:02 +020018 " [--changed-paths] [--[no-]max-new-filters <n>] [--[no-]progress]\n" \
19 " <split options>")
Ævar Arnfjörð Bjarmason8757b352021-08-23 14:30:15 +020020
21static const char * builtin_commit_graph_verify_usage[] = {
22 BUILTIN_COMMIT_GRAPH_VERIFY_USAGE,
23 NULL
24};
25
26static const char * builtin_commit_graph_write_usage[] = {
27 BUILTIN_COMMIT_GRAPH_WRITE_USAGE,
28 NULL
29};
30
Derrick Stolee4ce58ee2018-04-02 16:34:18 -040031static char const * const builtin_commit_graph_usage[] = {
Ævar Arnfjörð Bjarmason8757b352021-08-23 14:30:15 +020032 BUILTIN_COMMIT_GRAPH_VERIFY_USAGE,
33 BUILTIN_COMMIT_GRAPH_WRITE_USAGE,
34 NULL,
Derrick Stolee4ce58ee2018-04-02 16:34:18 -040035};
36
37static struct opts_commit_graph {
38 const char *obj_dir;
Derrick Stolee59fb8772018-06-27 09:24:45 -040039 int reachable;
Derrick Stolee049d51a2018-04-10 08:56:06 -040040 int stdin_packs;
Derrick Stolee3d5df012018-04-10 08:56:07 -040041 int stdin_commits;
Derrick Stolee7547b952018-04-10 08:56:08 -040042 int append;
Derrick Stolee135a7122019-06-18 11:14:28 -070043 int split;
Derrick Stolee3da4b602019-06-18 11:14:32 -070044 int shallow;
Garima Singh73716122019-08-26 09:29:58 -070045 int progress;
Garima Singhd38e07b2020-04-06 16:59:51 +000046 int enable_changed_paths;
Derrick Stolee4ce58ee2018-04-02 16:34:18 -040047} opts;
48
Ævar Arnfjörð Bjarmason84e44842021-08-23 14:30:17 +020049static struct option common_opts[] = {
50 OPT_STRING(0, "object-dir", &opts.obj_dir,
51 N_("dir"),
52 N_("the object directory to store the graph")),
Ævar Arnfjörð Bjarmason84e44842021-08-23 14:30:17 +020053 OPT_END()
54};
55
56static struct option *add_common_options(struct option *to)
57{
58 return parse_options_concat(common_opts, to);
59}
60
SZEDER Gábor1c3b0512022-08-19 18:04:02 +020061static int graph_verify(int argc, const char **argv, const char *prefix)
Derrick Stolee283e68c2018-06-27 09:24:32 -040062{
63 struct commit_graph *graph = NULL;
Taylor Blau0bd52e22020-02-03 21:51:50 -080064 struct object_directory *odb = NULL;
Derrick Stolee283e68c2018-06-27 09:24:32 -040065 char *graph_name;
Ævar Arnfjörð Bjarmason61df89c2019-03-25 13:08:30 +010066 int open_ok;
67 int fd;
68 struct stat st;
Derrick Stolee3da4b602019-06-18 11:14:32 -070069 int flags = 0;
Derrick Stolee283e68c2018-06-27 09:24:32 -040070
71 static struct option builtin_commit_graph_verify_options[] = {
Derrick Stolee3da4b602019-06-18 11:14:32 -070072 OPT_BOOL(0, "shallow", &opts.shallow,
73 N_("if the commit-graph is split, only verify the tip file")),
Taylor Blaud5fdf302021-09-18 12:02:37 -040074 OPT_BOOL(0, "progress", &opts.progress,
75 N_("force progress reporting")),
Derrick Stolee283e68c2018-06-27 09:24:32 -040076 OPT_END(),
77 };
Ævar Arnfjörð Bjarmason84e44842021-08-23 14:30:17 +020078 struct option *options = add_common_options(builtin_commit_graph_verify_options);
Derrick Stolee283e68c2018-06-27 09:24:32 -040079
Garima Singh0bd7f572019-08-27 09:56:34 -070080 trace2_cmd_mode("verify");
81
Garima Singh73716122019-08-26 09:29:58 -070082 opts.progress = isatty(2);
Jeff Kingecd2d3e2022-08-25 06:47:00 -040083 argc = parse_options(argc, argv, prefix,
Ævar Arnfjörð Bjarmason84e44842021-08-23 14:30:17 +020084 options,
Derrick Stolee283e68c2018-06-27 09:24:32 -040085 builtin_commit_graph_verify_usage, 0);
Ævar Arnfjörð Bjarmason6d209a02021-08-23 14:30:20 +020086 if (argc)
87 usage_with_options(builtin_commit_graph_verify_usage, options);
Derrick Stolee283e68c2018-06-27 09:24:32 -040088
89 if (!opts.obj_dir)
90 opts.obj_dir = get_object_directory();
Derrick Stolee3da4b602019-06-18 11:14:32 -070091 if (opts.shallow)
92 flags |= COMMIT_GRAPH_VERIFY_SHALLOW;
Garima Singh73716122019-08-26 09:29:58 -070093 if (opts.progress)
94 flags |= COMMIT_GRAPH_WRITE_PROGRESS;
Derrick Stolee283e68c2018-06-27 09:24:32 -040095
Taylor Blau0bd52e22020-02-03 21:51:50 -080096 odb = find_odb(the_repository, opts.obj_dir);
Taylor Blauad2dd5b2020-02-03 13:18:02 -080097 graph_name = get_commit_graph_filename(odb);
Ævar Arnfjörð Bjarmason61df89c2019-03-25 13:08:30 +010098 open_ok = open_commit_graph(graph_name, &fd, &st);
Derrick Stolee3da4b602019-06-18 11:14:32 -070099 if (!open_ok && errno != ENOENT)
Ævar Arnfjörð Bjarmason7b8ce9c2019-03-25 13:08:32 +0100100 die_errno(_("Could not open commit-graph '%s'"), graph_name);
Derrick Stolee3da4b602019-06-18 11:14:32 -0700101
Derrick Stolee283e68c2018-06-27 09:24:32 -0400102 FREE_AND_NULL(graph_name);
Ævar Arnfjörð Bjarmason84e44842021-08-23 14:30:17 +0200103 FREE_AND_NULL(options);
Derrick Stolee283e68c2018-06-27 09:24:32 -0400104
Derrick Stolee3da4b602019-06-18 11:14:32 -0700105 if (open_ok)
Taylor Blauab14d062020-09-09 11:22:56 -0400106 graph = load_commit_graph_one_fd_st(the_repository, fd, &st, odb);
Taylor Blau0bd52e22020-02-03 21:51:50 -0800107 else
Taylor Blau13c24992020-02-03 13:18:00 -0800108 graph = read_commit_graph_one(the_repository, odb);
Derrick Stolee3da4b602019-06-18 11:14:32 -0700109
110 /* Return failure if open_ok predicted success */
Derrick Stolee283e68c2018-06-27 09:24:32 -0400111 if (!graph)
Derrick Stolee3da4b602019-06-18 11:14:32 -0700112 return !!open_ok;
Derrick Stolee283e68c2018-06-27 09:24:32 -0400113
Martin Ågren0bfb48e2018-10-03 10:12:17 -0700114 UNLEAK(graph);
Derrick Stolee3da4b602019-06-18 11:14:32 -0700115 return verify_commit_graph(the_repository, graph, flags);
Derrick Stolee283e68c2018-06-27 09:24:32 -0400116}
117
Derrick Stoleed6538242018-08-20 18:24:27 +0000118extern int read_replace_refs;
Taylor Blau98bb7962020-09-17 22:59:49 -0400119static struct commit_graph_opts write_opts;
Derrick Stoleed6538242018-08-20 18:24:27 +0000120
Taylor Blau4f027352020-04-13 22:04:08 -0600121static int write_option_parse_split(const struct option *opt, const char *arg,
122 int unset)
123{
Taylor Blaufdbde822020-04-13 22:04:12 -0600124 enum commit_graph_split_flags *flags = opt->value;
125
Jeff King8d2aa8d2020-09-30 08:29:02 -0400126 BUG_ON_OPT_NEG(unset);
127
Taylor Blau4f027352020-04-13 22:04:08 -0600128 opts.split = 1;
129 if (!arg)
130 return 0;
131
Taylor Blaufdbde822020-04-13 22:04:12 -0600132 if (!strcmp(arg, "no-merge"))
133 *flags = COMMIT_GRAPH_SPLIT_MERGE_PROHIBITED;
Taylor Blau8a6ac282020-04-13 22:04:17 -0600134 else if (!strcmp(arg, "replace"))
135 *flags = COMMIT_GRAPH_SPLIT_REPLACE;
Taylor Blaufdbde822020-04-13 22:04:12 -0600136 else
137 die(_("unrecognized --split argument, %s"), arg);
Taylor Blau4f027352020-04-13 22:04:08 -0600138
139 return 0;
140}
141
Taylor Blau5b6653e2020-05-13 15:59:44 -0600142static int read_one_commit(struct oidset *commits, struct progress *progress,
143 const char *hash)
Taylor Blaufa8953c2020-05-18 13:27:09 -0600144{
Taylor Blau2f00c352020-05-13 15:59:55 -0600145 struct object *result;
Taylor Blaufa8953c2020-05-18 13:27:09 -0600146 struct object_id oid;
147 const char *end;
148
149 if (parse_oid_hex(hash, &oid, &end))
150 return error(_("unexpected non-hex object ID: %s"), hash);
151
Taylor Blau2f00c352020-05-13 15:59:55 -0600152 result = deref_tag(the_repository, parse_object(the_repository, &oid),
153 NULL, 0);
154 if (!result)
155 return error(_("invalid object: %s"), hash);
Abhishek Kumar6da43d92020-06-17 14:44:08 +0530156 else if (object_as_type(result, OBJ_COMMIT, 1))
Taylor Blau2f00c352020-05-13 15:59:55 -0600157 oidset_insert(commits, &result->oid);
Taylor Blau5b6653e2020-05-13 15:59:44 -0600158
159 display_progress(progress, oidset_size(commits));
160
Taylor Blaufa8953c2020-05-18 13:27:09 -0600161 return 0;
162}
163
Taylor Blau809e0322020-09-18 09:27:27 -0400164static int write_option_max_new_filters(const struct option *opt,
165 const char *arg,
166 int unset)
167{
168 int *to = opt->value;
169 if (unset)
170 *to = -1;
171 else {
172 const char *s;
173 *to = strtol(arg, (char **)&s, 10);
174 if (*s)
Ævar Arnfjörð Bjarmason13d9fce2021-10-08 21:07:43 +0200175 return error(_("option `%s' expects a numerical value"),
176 "max-new-filters");
Taylor Blau809e0322020-09-18 09:27:27 -0400177 }
178 return 0;
179}
180
Taylor Blaud356d5d2020-09-17 22:59:57 -0400181static int git_commit_graph_write_config(const char *var, const char *value,
Ævar Arnfjörð Bjarmason5cf88fd2022-08-25 19:09:48 +0200182 void *cb UNUSED)
Taylor Blaud356d5d2020-09-17 22:59:57 -0400183{
184 if (!strcmp(var, "commitgraph.maxnewfilters"))
185 write_opts.max_new_filters = git_config_int(var, value);
186 /*
187 * No need to fall-back to 'git_default_config', since this was already
188 * called in 'cmd_commit_graph()'.
189 */
190 return 0;
191}
192
SZEDER Gábor1c3b0512022-08-19 18:04:02 +0200193static int graph_write(int argc, const char **argv, const char *prefix)
Derrick Stoleef237c8b2018-04-02 16:34:20 -0400194{
Ævar Arnfjörð Bjarmason4a047902022-03-04 19:32:12 +0100195 struct string_list pack_indexes = STRING_LIST_INIT_DUP;
Taylor Blaufa8953c2020-05-18 13:27:09 -0600196 struct strbuf buf = STRBUF_INIT;
Taylor Blau6830c362020-04-13 22:04:25 -0600197 struct oidset commits = OIDSET_INIT;
Taylor Blau0bd52e22020-02-03 21:51:50 -0800198 struct object_directory *odb = NULL;
Derrick Stoleee103f722019-06-12 06:29:37 -0700199 int result = 0;
Garima Singh73716122019-08-26 09:29:58 -0700200 enum commit_graph_write_flags flags = 0;
Taylor Blau5b6653e2020-05-13 15:59:44 -0600201 struct progress *progress = NULL;
Derrick Stolee049d51a2018-04-10 08:56:06 -0400202
Derrick Stoleef237c8b2018-04-02 16:34:20 -0400203 static struct option builtin_commit_graph_write_options[] = {
Derrick Stolee59fb8772018-06-27 09:24:45 -0400204 OPT_BOOL(0, "reachable", &opts.reachable,
205 N_("start walk at all refs")),
Derrick Stolee049d51a2018-04-10 08:56:06 -0400206 OPT_BOOL(0, "stdin-packs", &opts.stdin_packs,
207 N_("scan pack-indexes listed by stdin for commits")),
Derrick Stolee3d5df012018-04-10 08:56:07 -0400208 OPT_BOOL(0, "stdin-commits", &opts.stdin_commits,
209 N_("start walk at commits listed by stdin")),
Derrick Stolee7547b952018-04-10 08:56:08 -0400210 OPT_BOOL(0, "append", &opts.append,
211 N_("include all commits already in the commit-graph file")),
Garima Singhd38e07b2020-04-06 16:59:51 +0000212 OPT_BOOL(0, "changed-paths", &opts.enable_changed_paths,
213 N_("enable computation for changed paths")),
Taylor Blau98bb7962020-09-17 22:59:49 -0400214 OPT_CALLBACK_F(0, "split", &write_opts.split_flags, NULL,
Taylor Blau4f027352020-04-13 22:04:08 -0600215 N_("allow writing an incremental commit-graph file"),
216 PARSE_OPT_OPTARG | PARSE_OPT_NONEG,
217 write_option_parse_split),
Taylor Blau98bb7962020-09-17 22:59:49 -0400218 OPT_INTEGER(0, "max-commits", &write_opts.max_commits,
Derrick Stoleec2bc6e62019-06-18 11:14:32 -0700219 N_("maximum number of commits in a non-base split commit-graph")),
Taylor Blau98bb7962020-09-17 22:59:49 -0400220 OPT_INTEGER(0, "size-multiple", &write_opts.size_multiple,
Derrick Stoleec2bc6e62019-06-18 11:14:32 -0700221 N_("maximum ratio between two levels of a split commit-graph")),
Taylor Blau98bb7962020-09-17 22:59:49 -0400222 OPT_EXPIRY_DATE(0, "expire-time", &write_opts.expire_time,
Derrick Stoleeb09b7852020-04-01 21:00:44 +0000223 N_("only expire files older than a given date-time")),
Taylor Blau809e0322020-09-18 09:27:27 -0400224 OPT_CALLBACK_F(0, "max-new-filters", &write_opts.max_new_filters,
225 NULL, N_("maximum number of changed-path Bloom filters to compute"),
226 0, write_option_max_new_filters),
Taylor Blaud5fdf302021-09-18 12:02:37 -0400227 OPT_BOOL(0, "progress", &opts.progress,
228 N_("force progress reporting")),
Derrick Stoleef237c8b2018-04-02 16:34:20 -0400229 OPT_END(),
230 };
Ævar Arnfjörð Bjarmason84e44842021-08-23 14:30:17 +0200231 struct option *options = add_common_options(builtin_commit_graph_write_options);
Derrick Stoleef237c8b2018-04-02 16:34:20 -0400232
Garima Singh73716122019-08-26 09:29:58 -0700233 opts.progress = isatty(2);
Derrick Stolee0087a872020-07-01 13:27:24 +0000234 opts.enable_changed_paths = -1;
Taylor Blau98bb7962020-09-17 22:59:49 -0400235 write_opts.size_multiple = 2;
236 write_opts.max_commits = 0;
237 write_opts.expire_time = 0;
Taylor Blau809e0322020-09-18 09:27:27 -0400238 write_opts.max_new_filters = -1;
Derrick Stoleec2bc6e62019-06-18 11:14:32 -0700239
Garima Singh0bd7f572019-08-27 09:56:34 -0700240 trace2_cmd_mode("write");
241
Taylor Blaud356d5d2020-09-17 22:59:57 -0400242 git_config(git_commit_graph_write_config, &opts);
243
Jeff Kingecd2d3e2022-08-25 06:47:00 -0400244 argc = parse_options(argc, argv, prefix,
Ævar Arnfjörð Bjarmason84e44842021-08-23 14:30:17 +0200245 options,
Derrick Stoleef237c8b2018-04-02 16:34:20 -0400246 builtin_commit_graph_write_usage, 0);
Ævar Arnfjörð Bjarmason6d209a02021-08-23 14:30:20 +0200247 if (argc)
248 usage_with_options(builtin_commit_graph_write_usage, options);
Derrick Stoleef237c8b2018-04-02 16:34:20 -0400249
Derrick Stolee59fb8772018-06-27 09:24:45 -0400250 if (opts.reachable + opts.stdin_packs + opts.stdin_commits > 1)
251 die(_("use at most one of --reachable, --stdin-commits, or --stdin-packs"));
Derrick Stoleef237c8b2018-04-02 16:34:20 -0400252 if (!opts.obj_dir)
253 opts.obj_dir = get_object_directory();
Derrick Stolee5af80392019-06-12 06:29:38 -0700254 if (opts.append)
SZEDER Gábor39d88312019-08-05 10:02:39 +0200255 flags |= COMMIT_GRAPH_WRITE_APPEND;
Derrick Stolee135a7122019-06-18 11:14:28 -0700256 if (opts.split)
SZEDER Gábor39d88312019-08-05 10:02:39 +0200257 flags |= COMMIT_GRAPH_WRITE_SPLIT;
Garima Singh73716122019-08-26 09:29:58 -0700258 if (opts.progress)
259 flags |= COMMIT_GRAPH_WRITE_PROGRESS;
Derrick Stolee0087a872020-07-01 13:27:24 +0000260 if (!opts.enable_changed_paths)
261 flags |= COMMIT_GRAPH_NO_WRITE_BLOOM_FILTERS;
262 if (opts.enable_changed_paths == 1 ||
Garima Singhd5b873c2020-04-06 16:59:55 +0000263 git_env_bool(GIT_TEST_COMMIT_GRAPH_CHANGED_PATHS, 0))
Garima Singhd38e07b2020-04-06 16:59:51 +0000264 flags |= COMMIT_GRAPH_WRITE_BLOOM_FILTERS;
Derrick Stoleef237c8b2018-04-02 16:34:20 -0400265
Taylor Blau0bd52e22020-02-03 21:51:50 -0800266 odb = find_odb(the_repository, opts.obj_dir);
Derrick Stoleed6538242018-08-20 18:24:27 +0000267
Derrick Stoleec2bc6e62019-06-18 11:14:32 -0700268 if (opts.reachable) {
Taylor Blau98bb7962020-09-17 22:59:49 -0400269 if (write_commit_graph_reachable(odb, flags, &write_opts))
Derrick Stoleec2bc6e62019-06-18 11:14:32 -0700270 return 1;
271 return 0;
272 }
Derrick Stolee59fb8772018-06-27 09:24:45 -0400273
Taylor Blaufa8953c2020-05-18 13:27:09 -0600274 if (opts.stdin_packs) {
Derrick Stoleed88b14b2018-06-27 09:24:44 -0400275 while (strbuf_getline(&buf, stdin) != EOF)
Ævar Arnfjörð Bjarmason4a047902022-03-04 19:32:12 +0100276 string_list_append_nodup(&pack_indexes,
277 strbuf_detach(&buf, NULL));
Taylor Blaufa8953c2020-05-18 13:27:09 -0600278 } else if (opts.stdin_commits) {
279 oidset_init(&commits, 0);
Taylor Blau5b6653e2020-05-13 15:59:44 -0600280 if (opts.progress)
281 progress = start_delayed_progress(
282 _("Collecting commits from input"), 0);
Derrick Stolee049d51a2018-04-10 08:56:06 -0400283
Taylor Blaufa8953c2020-05-18 13:27:09 -0600284 while (strbuf_getline(&buf, stdin) != EOF) {
Taylor Blau5b6653e2020-05-13 15:59:44 -0600285 if (read_one_commit(&commits, progress, buf.buf)) {
Taylor Blaufa8953c2020-05-18 13:27:09 -0600286 result = 1;
287 goto cleanup;
Taylor Blau6830c362020-04-13 22:04:25 -0600288 }
SZEDER Gábor7c5c9b92019-08-05 10:02:40 +0200289 }
Taylor Blau5b6653e2020-05-13 15:59:44 -0600290
SZEDER Gábor862aead2020-07-10 21:02:38 +0200291 stop_progress(&progress);
Derrick Stolee049d51a2018-04-10 08:56:06 -0400292 }
293
Taylor Blau0bd52e22020-02-03 21:51:50 -0800294 if (write_commit_graph(odb,
Taylor Blaufa8953c2020-05-18 13:27:09 -0600295 opts.stdin_packs ? &pack_indexes : NULL,
Taylor Blau6830c362020-04-13 22:04:25 -0600296 opts.stdin_commits ? &commits : NULL,
Derrick Stoleec2bc6e62019-06-18 11:14:32 -0700297 flags,
Taylor Blau98bb7962020-09-17 22:59:49 -0400298 &write_opts))
Derrick Stoleee103f722019-06-12 06:29:37 -0700299 result = 1;
Derrick Stolee049d51a2018-04-10 08:56:06 -0400300
Taylor Blaufa8953c2020-05-18 13:27:09 -0600301cleanup:
Ævar Arnfjörð Bjarmason84e44842021-08-23 14:30:17 +0200302 FREE_AND_NULL(options);
Taylor Blaufa8953c2020-05-18 13:27:09 -0600303 string_list_clear(&pack_indexes, 0);
304 strbuf_release(&buf);
Derrick Stoleee103f722019-06-12 06:29:37 -0700305 return result;
Derrick Stoleef237c8b2018-04-02 16:34:20 -0400306}
Derrick Stolee4ce58ee2018-04-02 16:34:18 -0400307
308int cmd_commit_graph(int argc, const char **argv, const char *prefix)
309{
SZEDER Gábor1c3b0512022-08-19 18:04:02 +0200310 parse_opt_subcommand_fn *fn = NULL;
311 struct option builtin_commit_graph_options[] = {
312 OPT_SUBCOMMAND("verify", &fn, graph_verify),
313 OPT_SUBCOMMAND("write", &fn, graph_write),
314 OPT_END(),
315 };
316 struct option *options = parse_options_concat(builtin_commit_graph_options, common_opts);
Derrick Stolee4ce58ee2018-04-02 16:34:18 -0400317
Derrick Stolee4ce58ee2018-04-02 16:34:18 -0400318 git_config(git_default_config, NULL);
Derrick Stolee4ce58ee2018-04-02 16:34:18 -0400319
Ævar Arnfjörð Bjarmason095d1122021-10-15 01:37:16 +0200320 read_replace_refs = 0;
Jeff Kingdd2e50a2019-09-07 01:04:40 -0400321 save_commit_buffer = 0;
322
SZEDER Gábor1c3b0512022-08-19 18:04:02 +0200323 argc = parse_options(argc, argv, prefix, options,
324 builtin_commit_graph_usage, 0);
325 FREE_AND_NULL(options);
Derrick Stoleef237c8b2018-04-02 16:34:20 -0400326
SZEDER Gábor1c3b0512022-08-19 18:04:02 +0200327 return fn(argc, argv, prefix);
Derrick Stolee4ce58ee2018-04-02 16:34:18 -0400328}