Skip to content

Commit 842aaf9

Browse files
tytsoJunio C Hamano
authored andcommitted
Add pack.depth option to git-pack-objects.
Signed-off-by: "Theodore Ts'o" <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent abda522 commit 842aaf9

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

Documentation/config.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,10 @@ pack.window::
546546
The size of the window used by gitlink:git-pack-objects[1] when no
547547
window size is given on the command line. Defaults to 10.
548548

549+
pack.depth::
550+
The maximum delta depth used by gitlink:git-pack-objects[1] when no
551+
maximum depth is given on the command line. Defaults to 10.
552+
549553
pull.octopus::
550554
The default merge strategy to use when pulling multiple branches
551555
at once.

Documentation/git-pack-objects.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ base-name::
8383
it too deep affects the performance on the unpacker
8484
side, because delta data needs to be applied that many
8585
times to get to the necessary object.
86-
The default value for both --window and --depth is 10.
86+
The default value for --window is 10 and --depth is 10.
8787

8888
--incremental::
8989
This flag causes an object already in a pack ignored

Documentation/git-repack.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ OPTIONS
6363
space. `--depth` limits the maximum delta depth; making it too deep
6464
affects the performance on the unpacker side, because delta data needs
6565
to be applied that many times to get to the necessary object.
66-
The default value for both --window and --depth is 10.
66+
The default value for --window is 10 and --depth is 10.
6767

6868

6969
Configuration

builtin-pack-objects.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ static char tmpname[PATH_MAX];
6464
static unsigned char pack_file_sha1[20];
6565
static int progress = 1;
6666
static int window = 10;
67+
static int depth = 10;
6768
static int pack_to_stdout;
6869
static int num_preferred_base;
6970
static struct progress progress_state;
@@ -1489,6 +1490,10 @@ static int git_pack_config(const char *k, const char *v)
14891490
window = git_config_int(k, v);
14901491
return 0;
14911492
}
1493+
if(!strcmp(k, "pack.depth")) {
1494+
depth = git_config_int(k, v);
1495+
return 0;
1496+
}
14921497
return git_default_config(k, v);
14931498
}
14941499

@@ -1584,7 +1589,6 @@ static int adjust_perm(const char *path, mode_t mode)
15841589

15851590
int cmd_pack_objects(int argc, const char **argv, const char *prefix)
15861591
{
1587-
int depth = 10;
15881592
int use_internal_rev_list = 0;
15891593
int thin = 0;
15901594
uint32_t i;

0 commit comments

Comments
 (0)