diff options
| author | Patrick Steinhardt <ps@pks.im> | 2022-03-14 08:42:51 +0100 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2022-03-14 22:25:13 +0000 |
| commit | a2565c48e410864c049e66a64393fd6e26eb9a55 (patch) | |
| tree | a0f0f3d13bc97b60d63ca4b02298ce9ff8aaad6f /builtin/repack.c | |
| parent | repack: refactor to avoid double-negation of update-server-info (diff) | |
| download | git-a2565c48e410864c049e66a64393fd6e26eb9a55.tar.gz git-a2565c48e410864c049e66a64393fd6e26eb9a55.zip | |
repack: add config to skip updating server info
By default, git-repack(1) will update server info that is required by
the dumb HTTP transport. This can be skipped by passing the `-n` flag,
but what we're noticably missing is a config option to permanently
disable updating this information.
Add a new option "repack.updateServerInfo" which can be used to disable
the logic. Most hosting providers have turned off the dumb HTTP protocol
anyway, and on the client-side it woudln't typically be useful either.
Giving a persistent way to disable this feature thus makes quite some
sense to avoid wasting compute cycles and storage.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/repack.c')
| -rw-r--r-- | builtin/repack.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/builtin/repack.c b/builtin/repack.c index f2ac8ad14b..d1a563d5b6 100644 --- a/builtin/repack.c +++ b/builtin/repack.c @@ -22,6 +22,7 @@ static int delta_base_offset = 1; static int pack_kept_objects = -1; static int write_bitmaps = -1; static int use_delta_islands; +static int run_update_server_info = 1; static char *packdir, *packtmp_name, *packtmp; static const char *const git_repack_usage[] = { @@ -54,6 +55,10 @@ static int repack_config(const char *var, const char *value, void *cb) use_delta_islands = git_config_bool(var, value); return 0; } + if (strcmp(var, "repack.updateserverinfo") == 0) { + run_update_server_info = git_config_bool(var, value); + return 0; + } return git_default_config(var, value, cb); } @@ -620,7 +625,6 @@ int cmd_repack(int argc, const char **argv, const char *prefix) const char *unpack_unreachable = NULL; int keep_unreachable = 0; struct string_list keep_pack_list = STRING_LIST_INIT_NODUP; - int run_update_server_info = 1; struct pack_objects_args po_args = {NULL}; int geometric_factor = 0; int write_midx = 0; |
