summaryrefslogtreecommitdiff
path: root/builtin/gc.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-04-03 19:38:46 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-04-03 19:38:47 (GMT)
commit8815d8aa7ccab3798fa5513821ab110c209b0ae7 (patch)
tree2f60257a462e3a3548a8363dd431b1b40ba8e856 /builtin/gc.c
parent7b6bc4d8350029fed82824a33ea9039f22788eec (diff)
parent8640d496823b0aa1d35523b98d8b3f21b54004cd (diff)
downloadgit-8815d8aa7ccab3798fa5513821ab110c209b0ae7.zip
git-8815d8aa7ccab3798fa5513821ab110c209b0ae7.tar.gz
git-8815d8aa7ccab3798fa5513821ab110c209b0ae7.tar.bz2
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/gc.c')
-rw-r--r--builtin/gc.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/builtin/gc.c b/builtin/gc.c
index 11cf295..85f5c2b 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);
}