Skip to content

Commit 31fb6f4

Browse files
committed
Merge branch 'jc/repack-threads'
"git repack" learned to accept the --threads=<n> option and pass it to pack-objects. * jc/repack-threads: repack: accept --threads=<n> and pass it down to pack-objects
2 parents 5f074ca + 40bcf31 commit 31fb6f4

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

Documentation/git-repack.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ git-repack - Pack unpacked objects in a repository
99
SYNOPSIS
1010
--------
1111
[verse]
12-
'git repack' [-a] [-A] [-d] [-f] [-F] [-l] [-n] [-q] [-b] [--window=<n>] [--depth=<n>]
12+
'git repack' [-a] [-A] [-d] [-f] [-F] [-l] [-n] [-q] [-b] [--window=<n>] [--depth=<n>] [--threads=<n>]
1313

1414
DESCRIPTION
1515
-----------
@@ -92,6 +92,9 @@ other objects in that pack they already have locally.
9292
to be applied that many times to get to the necessary object.
9393
The default value for --window is 10 and --depth is 50.
9494

95+
--threads=<n>::
96+
This option is passed through to `git pack-objects`.
97+
9598
--window-memory=<n>::
9699
This option provides an additional limit on top of `--window`;
97100
the window size will dynamically scale down so as to not take

builtin/repack.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
155155
int keep_unreachable = 0;
156156
const char *window = NULL, *window_memory = NULL;
157157
const char *depth = NULL;
158+
const char *threads = NULL;
158159
const char *max_pack_size = NULL;
159160
int no_reuse_delta = 0, no_reuse_object = 0;
160161
int no_update_server_info = 0;
@@ -190,6 +191,8 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
190191
N_("same as the above, but limit memory size instead of entries count")),
191192
OPT_STRING(0, "depth", &depth, N_("n"),
192193
N_("limits the maximum delta depth")),
194+
OPT_STRING(0, "threads", &threads, N_("n"),
195+
N_("limits the maximum number of threads")),
193196
OPT_STRING(0, "max-pack-size", &max_pack_size, N_("bytes"),
194197
N_("maximum size of each packfile")),
195198
OPT_BOOL(0, "pack-kept-objects", &pack_kept_objects,
@@ -234,6 +237,8 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
234237
argv_array_pushf(&cmd.args, "--window-memory=%s", window_memory);
235238
if (depth)
236239
argv_array_pushf(&cmd.args, "--depth=%s", depth);
240+
if (threads)
241+
argv_array_pushf(&cmd.args, "--threads=%s", threads);
237242
if (max_pack_size)
238243
argv_array_pushf(&cmd.args, "--max-pack-size=%s", max_pack_size);
239244
if (no_reuse_delta)

0 commit comments

Comments
 (0)