From 842aaf93238377976111fc801aaacbf8a491db33 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Tue, 8 May 2007 09:28:26 -0400 Subject: [PATCH] Add pack.depth option to git-pack-objects. Signed-off-by: "Theodore Ts'o" Signed-off-by: Junio C Hamano --- Documentation/config.txt | 4 ++++ Documentation/git-pack-objects.txt | 2 +- Documentation/git-repack.txt | 2 +- builtin-pack-objects.c | 6 +++++- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Documentation/config.txt b/Documentation/config.txt index 24f9655fe..840dd81b8 100644 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@ -546,6 +546,10 @@ pack.window:: The size of the window used by gitlink:git-pack-objects[1] when no window size is given on the command line. Defaults to 10. +pack.depth:: + The maximum delta depth used by gitlink:git-pack-objects[1] when no + maximum depth is given on the command line. Defaults to 10. + pull.octopus:: The default merge strategy to use when pulling multiple branches at once. diff --git a/Documentation/git-pack-objects.txt b/Documentation/git-pack-objects.txt index d9e11c653..5a7204c9f 100644 --- a/Documentation/git-pack-objects.txt +++ b/Documentation/git-pack-objects.txt @@ -83,7 +83,7 @@ base-name:: it too deep affects the performance on the unpacker side, because delta data needs to be applied that many times to get to the necessary object. - The default value for both --window and --depth is 10. + The default value for --window is 10 and --depth is 10. --incremental:: This flag causes an object already in a pack ignored diff --git a/Documentation/git-repack.txt b/Documentation/git-repack.txt index d39abc126..0d70c9f78 100644 --- a/Documentation/git-repack.txt +++ b/Documentation/git-repack.txt @@ -63,7 +63,7 @@ OPTIONS space. `--depth` limits the maximum delta depth; making it too deep affects the performance on the unpacker side, because delta data needs to be applied that many times to get to the necessary object. - The default value for both --window and --depth is 10. + The default value for --window is 10 and --depth is 10. Configuration diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c index 7bff8eadd..79d922892 100644 --- a/builtin-pack-objects.c +++ b/builtin-pack-objects.c @@ -64,6 +64,7 @@ static char tmpname[PATH_MAX]; static unsigned char pack_file_sha1[20]; static int progress = 1; static int window = 10; +static int depth = 10; static int pack_to_stdout; static int num_preferred_base; static struct progress progress_state; @@ -1489,6 +1490,10 @@ static int git_pack_config(const char *k, const char *v) window = git_config_int(k, v); return 0; } + if(!strcmp(k, "pack.depth")) { + depth = git_config_int(k, v); + return 0; + } return git_default_config(k, v); } @@ -1584,7 +1589,6 @@ static int adjust_perm(const char *path, mode_t mode) int cmd_pack_objects(int argc, const char **argv, const char *prefix) { - int depth = 10; int use_internal_rev_list = 0; int thin = 0; uint32_t i; -- 2.30.2