diff options
| author | Junio C Hamano <gitster@pobox.com> | 2025-02-12 10:08:51 -0800 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-02-12 10:08:51 -0800 |
| commit | aae91a86fb2a71ff89a71b63ccec3a947b26ca51 (patch) | |
| tree | 3bfc421ac1b1f445d22bae71a3b3524ec993fb4c /builtin/repack.c | |
| parent | 388218fac77d0405a5083cd4b4ee20f6694609c3 (diff) | |
| parent | b4cf68476a983ff063846b43cd46ee9805f2c0bb (diff) | |
| download | git-aae91a86fb2a71ff89a71b63ccec3a947b26ca51.tar.xz | |
Merge branch 'ds/name-hash-tweaks'
"git pack-objects" and its wrapper "git repack" learned an option
to use an alternative path-hash function to improve delta-base
selection to produce a packfile with deeper history than window
size.
* ds/name-hash-tweaks:
pack-objects: prevent name hash version change
test-tool: add helper for name-hash values
p5313: add size comparison test
pack-objects: add GIT_TEST_NAME_HASH_VERSION
repack: add --name-hash-version option
pack-objects: add --name-hash-version option
pack-objects: create new name-hash function version
Diffstat (limited to 'builtin/repack.c')
| -rw-r--r-- | builtin/repack.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/builtin/repack.c b/builtin/repack.c index 81d13630ea..e472586ed5 100644 --- a/builtin/repack.c +++ b/builtin/repack.c @@ -41,7 +41,9 @@ static int run_update_server_info = 1; static char *packdir, *packtmp_name, *packtmp; static const char *const git_repack_usage[] = { - N_("git repack [<options>]"), + N_("git repack [-a] [-A] [-d] [-f] [-F] [-l] [-n] [-q] [-b] [-m]\n" + "[--window=<n>] [--depth=<n>] [--threads=<n>] [--keep-pack=<pack-name>]\n" + "[--write-midx] [--name-hash-version=<n>]"), NULL }; @@ -60,6 +62,7 @@ struct pack_objects_args { int no_reuse_object; int quiet; int local; + int name_hash_version; struct list_objects_filter_options filter_options; }; @@ -308,6 +311,8 @@ static void prepare_pack_objects(struct child_process *cmd, strvec_pushf(&cmd->args, "--no-reuse-delta"); if (args->no_reuse_object) strvec_pushf(&cmd->args, "--no-reuse-object"); + if (args->name_hash_version) + strvec_pushf(&cmd->args, "--name-hash-version=%d", args->name_hash_version); if (args->local) strvec_push(&cmd->args, "--local"); if (args->quiet) @@ -1205,6 +1210,8 @@ int cmd_repack(int argc, N_("pass --no-reuse-delta to git-pack-objects")), OPT_BOOL('F', NULL, &po_args.no_reuse_object, N_("pass --no-reuse-object to git-pack-objects")), + OPT_INTEGER(0, "name-hash-version", &po_args.name_hash_version, + N_("specify the name hash version to use for grouping similar objects by path")), OPT_NEGBIT('n', NULL, &run_update_server_info, N_("do not run git-update-server-info"), 1), OPT__QUIET(&po_args.quiet, N_("be quiet")), |
