]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin/commit-graph.c
Merge branch 'gs/commit-graph-path-filter'
[thirdparty/git.git] / builtin / commit-graph.c
index 9ceedbba0749285d2b933a3ce56ed457779574ef..15fe60317c7846df93d9975dc991ba3a67bd0758 100644 (file)
@@ -11,7 +11,7 @@ static char const * const builtin_commit_graph_usage[] = {
        N_("git commit-graph verify [--object-dir <objdir>] [--shallow] [--[no-]progress]"),
        N_("git commit-graph write [--object-dir <objdir>] [--append] "
           "[--split[=<strategy>]] [--reachable|--stdin-packs|--stdin-commits] "
-          "[--[no-]progress] <split options>"),
+          "[--changed-paths] [--[no-]progress] <split options>"),
        NULL
 };
 
@@ -23,7 +23,7 @@ static const char * const builtin_commit_graph_verify_usage[] = {
 static const char * const builtin_commit_graph_write_usage[] = {
        N_("git commit-graph write [--object-dir <objdir>] [--append] "
           "[--split[=<strategy>]] [--reachable|--stdin-packs|--stdin-commits] "
-          "[--[no-]progress] <split options>"),
+          "[--changed-paths] [--[no-]progress] <split options>"),
        NULL
 };
 
@@ -36,6 +36,7 @@ static struct opts_commit_graph {
        int split;
        int shallow;
        int progress;
+       int enable_changed_paths;
 } opts;
 
 static struct object_directory *find_odb(struct repository *r,
@@ -158,6 +159,8 @@ static int graph_write(int argc, const char **argv)
                        N_("start walk at commits listed by stdin")),
                OPT_BOOL(0, "append", &opts.append,
                        N_("include all commits already in the commit-graph file")),
+               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,
                        N_("allow writing an incremental commit-graph file"),
@@ -193,6 +196,9 @@ static int graph_write(int argc, const char **argv)
                flags |= COMMIT_GRAPH_WRITE_SPLIT;
        if (opts.progress)
                flags |= COMMIT_GRAPH_WRITE_PROGRESS;
+       if (opts.enable_changed_paths ||
+           git_env_bool(GIT_TEST_COMMIT_GRAPH_CHANGED_PATHS, 0))
+               flags |= COMMIT_GRAPH_WRITE_BLOOM_FILTERS;
 
        read_replace_refs = 0;
        odb = find_odb(the_repository, opts.obj_dir);