commit-graph: rename 'split_commit_graph_opts'
In the subsequent commit, additional options will be added to the commit-graph API which have nothing to do with splitting. Rename the 'split_commit_graph_opts' structure to the more-generic 'commit_graph_opts' to encompass both. Likewise, rename the 'flags' member to instead be 'split_flags' to clarify that it only has to do with the behavior implied by '--split'. Suggested-by: Derrick Stolee <dstolee@microsoft.com> Signed-off-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
59f0d5073f
commit
98bb796191
@ -119,7 +119,7 @@ static int graph_verify(int argc, const char **argv)
|
||||
}
|
||||
|
||||
extern int read_replace_refs;
|
||||
static struct split_commit_graph_opts split_opts;
|
||||
static struct commit_graph_opts write_opts;
|
||||
|
||||
static int write_option_parse_split(const struct option *opt, const char *arg,
|
||||
int unset)
|
||||
@ -187,24 +187,24 @@ static int graph_write(int argc, const char **argv)
|
||||
OPT_BOOL(0, "changed-paths", &opts.enable_changed_paths,
|
||||
N_("enable computation for changed paths")),
|
||||
OPT_BOOL(0, "progress", &opts.progress, N_("force progress reporting")),
|
||||
OPT_CALLBACK_F(0, "split", &split_opts.flags, NULL,
|
||||
OPT_CALLBACK_F(0, "split", &write_opts.split_flags, NULL,
|
||||
N_("allow writing an incremental commit-graph file"),
|
||||
PARSE_OPT_OPTARG | PARSE_OPT_NONEG,
|
||||
write_option_parse_split),
|
||||
OPT_INTEGER(0, "max-commits", &split_opts.max_commits,
|
||||
OPT_INTEGER(0, "max-commits", &write_opts.max_commits,
|
||||
N_("maximum number of commits in a non-base split commit-graph")),
|
||||
OPT_INTEGER(0, "size-multiple", &split_opts.size_multiple,
|
||||
OPT_INTEGER(0, "size-multiple", &write_opts.size_multiple,
|
||||
N_("maximum ratio between two levels of a split commit-graph")),
|
||||
OPT_EXPIRY_DATE(0, "expire-time", &split_opts.expire_time,
|
||||
OPT_EXPIRY_DATE(0, "expire-time", &write_opts.expire_time,
|
||||
N_("only expire files older than a given date-time")),
|
||||
OPT_END(),
|
||||
};
|
||||
|
||||
opts.progress = isatty(2);
|
||||
opts.enable_changed_paths = -1;
|
||||
split_opts.size_multiple = 2;
|
||||
split_opts.max_commits = 0;
|
||||
split_opts.expire_time = 0;
|
||||
write_opts.size_multiple = 2;
|
||||
write_opts.max_commits = 0;
|
||||
write_opts.expire_time = 0;
|
||||
|
||||
trace2_cmd_mode("write");
|
||||
|
||||
@ -232,7 +232,7 @@ static int graph_write(int argc, const char **argv)
|
||||
odb = find_odb(the_repository, opts.obj_dir);
|
||||
|
||||
if (opts.reachable) {
|
||||
if (write_commit_graph_reachable(odb, flags, &split_opts))
|
||||
if (write_commit_graph_reachable(odb, flags, &write_opts))
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
@ -261,7 +261,7 @@ static int graph_write(int argc, const char **argv)
|
||||
opts.stdin_packs ? &pack_indexes : NULL,
|
||||
opts.stdin_commits ? &commits : NULL,
|
||||
flags,
|
||||
&split_opts))
|
||||
&write_opts))
|
||||
result = 1;
|
||||
|
||||
cleanup:
|
||||
|
Reference in New Issue
Block a user