{"thread":{"id":"30295","subject":"[PATCH] Support --threads arg for git-repack.","startedAt":"2012-04-20T15:56:52Z","lastAt":"2012-04-20T15:56:52Z","messageCount":1,"participants":["Louis Kruger"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"189763","messageId":"CAK65ue8OCVvdBcqX3W54ZcBzCte+=9o_LqGSDipJBX9aaKvNJw@mail.gmail.com","threadId":"30295","inReplyTo":null,"subject":"[PATCH] Support --threads arg for git-repack.","fromName":"Louis Kruger","fromEmail":"louisk@gmail.com","sentAt":"2012-04-20T15:56:52Z","receivedAt":"2012-04-20T15:56:52Z","isPatch":true,"sender":{"key":"louisk@gmail.com","avatar":null},"body":"This very simple patch adds a --threads argument for git-repack.  It\nsimply forwards the argument to git-pack-objects.\n\n---\n Documentation/git-repack.txt |   11 +++++++++++\n git-repack.sh                |    3 ++-\n 2 files changed, 13 insertions(+), 1 deletions(-)\n\ndiff --git a/Documentation/git-repack.txt b/Documentation/git-repack.txt\nindex 4c1aff6..be52789 100644\n--- a/Documentation/git-repack.txt\n+++ b/Documentation/git-repack.txt\n@@ -10,6 +10,7 @@ SYNOPSIS\n --------\n [verse]\n 'git repack' [-a] [-A] [-d] [-f] [-F] [-l] [-n] [-q] [--window=<n>]\n[--depth=<n>]\n+        [--threads=<n>]\n\n DESCRIPTION\n -----------\n@@ -92,6 +93,16 @@ other objects in that pack they already have locally.\n \tto be applied that many times to get to the necessary object.\n \tThe default value for --window is 10 and --depth is 50.\n\n+--threads=<n>::\n+        Specifies the number of threads to spawn when searching for best\n+        delta matches. This requires that pack-objects be compiled with\n+        pthreads otherwise this option is ignored with a warning. This is\n+        meant to reduce packing time on multiprocessor machines. The required\n+        amount of memory for the delta search window is however multiplied\n+        by the number of threads. Specifying 0 will cause git to auto-detect\n+\t`--threads=0` makes git auto-detect the number of threads to use,\n+        which is the default.\n+\n --window-memory=<n>::\n \tThis option provides an additional limit on top of `--window`;\n \tthe window size will dynamically scale down so as to not take\ndiff --git a/git-repack.sh b/git-repack.sh\nindex 624feec..c8cf5cc 100755\n--- a/git-repack.sh\n+++ b/git-repack.sh\n@@ -20,6 +20,7 @@ window=         size of the window used for delta compression\n window-memory=  same as the above, but limit memory size instead of\nentries count\n depth=          limits the maximum delta depth\n max-pack-size=  maximum size of each packfile\n+threads=        maximum number of threads\n \"\n SUBDIRECTORY_OK='Yes'\n . git-sh-setup\n@@ -38,7 +39,7 @@ do\n \t-f)\tno_reuse=--no-reuse-delta ;;\n \t-F)\tno_reuse=--no-reuse-object ;;\n \t-l)\tlocal=--local ;;\n-\t--max-pack-size|--window|--window-memory|--depth)\n+\t--max-pack-size|--window|--window-memory|--depth|--threads)\n \t\textra=\"$extra $1=$2\"; shift ;;\n \t--) shift; break;;\n \t*)\tusage ;;\n-- \n1.7.7.3\n"}]}