diff options
author | Junio C Hamano <gitster@pobox.com> | 2014-04-03 12:38:46 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-04-03 12:38:47 -0700 |
commit | 8815d8aa7ccab3798fa5513821ab110c209b0ae7 (patch) | |
tree | 2f60257a462e3a3548a8363dd431b1b40ba8e856 /builtin | |
parent | Merge branch 'jc/fix-diff-no-index-diff-opt-parse' (diff) | |
parent | environment.c: fix constness for odb_pack_keep() (diff) | |
download | tgif-8815d8aa7ccab3798fa5513821ab110c209b0ae7.tar.xz |
Merge branch 'nd/gc-aggressive'
Allow tweaking the maximum length of the delta-chain produced by
"gc --aggressive".
* nd/gc-aggressive:
environment.c: fix constness for odb_pack_keep()
gc --aggressive: make --depth configurable
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/gc.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/builtin/gc.c b/builtin/gc.c index 11cf295515..85f5c2bc62 100644 --- a/builtin/gc.c +++ b/builtin/gc.c @@ -26,6 +26,7 @@ static const char * const builtin_gc_usage[] = { }; static int pack_refs = 1; +static int aggressive_depth = 250; static int aggressive_window = 250; static int gc_auto_threshold = 6700; static int gc_auto_pack_limit = 50; @@ -66,6 +67,10 @@ static int gc_config(const char *var, const char *value, void *cb) aggressive_window = git_config_int(var, value); return 0; } + if (!strcmp(var, "gc.aggressivedepth")) { + aggressive_depth = git_config_int(var, value); + return 0; + } if (!strcmp(var, "gc.auto")) { gc_auto_threshold = git_config_int(var, value); return 0; @@ -294,7 +299,8 @@ int cmd_gc(int argc, const char **argv, const char *prefix) if (aggressive) { argv_array_push(&repack, "-f"); - argv_array_push(&repack, "--depth=250"); + if (aggressive_depth > 0) + argv_array_pushf(&repack, "--depth=%d", aggressive_depth); if (aggressive_window > 0) argv_array_pushf(&repack, "--window=%d", aggressive_window); } |