{"thread":{"id":"4953","subject":"[PATCH] pack-objects: check pack.window for default window size","startedAt":"2006-07-23T05:50:30Z","lastAt":"2006-07-24T06:43:48Z","messageCount":2,"participants":["Jeff King","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"24009","messageId":"20060723055030.GA25790@coredump.intra.peff.net","threadId":"4953","inReplyTo":null,"subject":"[PATCH] pack-objects: check pack.window for default window size","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2006-07-23T05:50:30Z","receivedAt":"2006-07-23T05:50:30Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"Signed-off-by: Jeff King <peff@peff.net>\n---\nFor some repositories, deltas simply don't make sense. One can disable\nthem for git-repack by adding --window, but git-push insists on making\nthe deltas which can be very CPU-intensive for little benefit.\n\n Documentation/config.txt |    4 ++++\n pack-objects.c           |   13 ++++++++++++-\n 2 files changed, 16 insertions(+), 1 deletions(-)\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex 0b434c1..bc43da8 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -193,6 +193,10 @@ merge.summary::\n \tWhether to include summaries of merged commits in newly created\n \tmerge commit messages. False by default.\n \n+pack.window::\n+\tThe size of the window used by gitlink:git-pack-objects[1] when no\n+\twindow size is given on the command line. Defaults to 10.\n+\n pull.octopus::\n \tThe default merge strategy to use when pulling multiple branches\n \tat once.\ndiff --git a/pack-objects.c b/pack-objects.c\nindex 04a48b9..861c7f0 100644\n--- a/pack-objects.c\n+++ b/pack-objects.c\n@@ -63,6 +63,7 @@ static const char *base_name;\n static unsigned char pack_file_sha1[20];\n static int progress = 1;\n static volatile sig_atomic_t progress_update = 0;\n+static int window = 10;\n \n /*\n  * The object names in objects array are hashed with this hashtable,\n@@ -1216,16 +1217,26 @@ static void setup_progress_signal(void)\n \tsetitimer(ITIMER_REAL, &v, NULL);\n }\n \n+static int git_pack_config(const char *k, const char *v)\n+{\n+\tif(!strcmp(k, \"pack.window\")) {\n+\t\twindow = git_config_int(k, v);\n+\t\treturn 0;\n+\t}\n+\treturn git_default_config(k, v);\n+}\n+\n int main(int argc, char **argv)\n {\n \tSHA_CTX ctx;\n \tchar line[40 + 1 + PATH_MAX + 2];\n-\tint window = 10, depth = 10, pack_to_stdout = 0;\n+\tint depth = 10, pack_to_stdout = 0;\n \tstruct object_entry **list;\n \tint num_preferred_base = 0;\n \tint i;\n \n \tsetup_git_directory();\n+\tgit_config(git_pack_config);\n \n \tprogress = isatty(2);\n \tfor (i = 1; i < argc; i++) {\n-- \n1.4.2.rc1.ge7a0-dirty\n"},{"id":"24046","messageId":"7vac6zfqor.fsf@assigned-by-dhcp.cox.net","threadId":"4953","inReplyTo":"20060723055030.GA25790@coredump.intra.peff.net","subject":"Re: [PATCH] pack-objects: check pack.window for default window size","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-07-24T06:43:48Z","receivedAt":"2006-07-24T06:43:48Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> Signed-off-by: Jeff King <peff@peff.net>\n> ---\n> For some repositories, deltas simply don't make sense. One can disable\n> them for git-repack by adding --window, but git-push insists on making\n> the deltas which can be very CPU-intensive for little benefit.\n\nMakes sense.  Will apply but with the above three lines as part\nof the commit message.\n"}]}