git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: git@vger.kernel.org
Cc: Stefan Beller <stefanbeller@googlemail.com>,
	Siddharth Agarwal <sid0@fb.com>
Subject: [PATCH v2 2/2] repack: accept larger window-memory and max-pack-size
Date: Wed, 22 Jan 2014 11:58:05 -0800	[thread overview]
Message-ID: <1390420685-18449-3-git-send-email-gitster@pobox.com> (raw)
In-Reply-To: <1390420685-18449-1-git-send-email-gitster@pobox.com>

These quantities can be larger than an int.  Use ulong to express
them like the underlying pack-objects does, and also parse them with
the human-friendly unit suffixes.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 builtin/repack.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/builtin/repack.c b/builtin/repack.c
index a0ff5c7..8ce396b 100644
--- a/builtin/repack.c
+++ b/builtin/repack.c
@@ -130,9 +130,9 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
 	int pack_everything = 0;
 	int delete_redundant = 0;
 	char *unpack_unreachable = NULL;
-	int window = 0, window_memory = 0;
+	int window = 0;
 	int depth = 0;
-	int max_pack_size = 0;
+	unsigned long max_pack_size = 0, window_memory = 0;
 	int no_reuse_delta = 0, no_reuse_object = 0;
 	int no_update_server_info = 0;
 	int quiet = 0;
@@ -159,11 +159,11 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
 				N_("with -A, do not loosen objects older than this")),
 		OPT_INTEGER(0, "window", &window,
 				N_("size of the window used for delta compression")),
-		OPT_INTEGER(0, "window-memory", &window_memory,
+		OPT_HUM_ULONG(0, "window-memory", &window_memory,
 				N_("same as the above, but limit memory size instead of entries count")),
 		OPT_INTEGER(0, "depth", &depth,
 				N_("limits the maximum delta depth")),
-		OPT_INTEGER(0, "max-pack-size", &max_pack_size,
+		OPT_HUM_ULONG(0, "max-pack-size", &max_pack_size,
 				N_("maximum size of each packfile")),
 		OPT_END()
 	};
@@ -187,11 +187,11 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
 	if (window)
 		argv_array_pushf(&cmd_args, "--window=%u", window);
 	if (window_memory)
-		argv_array_pushf(&cmd_args, "--window-memory=%u", window_memory);
+		argv_array_pushf(&cmd_args, "--window-memory=%lu", window_memory);
 	if (depth)
 		argv_array_pushf(&cmd_args, "--depth=%u", depth);
 	if (max_pack_size)
-		argv_array_pushf(&cmd_args, "--max_pack_size=%u", max_pack_size);
+		argv_array_pushf(&cmd_args, "--max_pack_size=%lu", max_pack_size);
 	if (no_reuse_delta)
 		argv_array_pushf(&cmd_args, "--no-reuse-delta");
 	if (no_reuse_object)
-- 
1.9-rc0-151-ga5225c0

  parent reply	other threads:[~2014-01-22 19:58 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-21 22:48 git repack --max-pack-size broken in git-next Siddharth Agarwal
2014-01-21 23:01 ` Junio C Hamano
2014-01-21 23:26   ` Junio C Hamano
2014-01-22 19:58   ` [PATCH v2 0/2] Fix "repack --window-memory=4g" regression in 1.8.4 Junio C Hamano
2014-01-22 19:58     ` [PATCH v2 1/2] parse-options: refactor human-friendly-integer parser out of pack-objects Junio C Hamano
2014-01-22 19:58     ` Junio C Hamano [this message]
2014-01-23  1:06       ` [PATCH v2 2/2] repack: accept larger window-memory and max-pack-size Jeff King
2014-01-23  1:26         ` Jeff King
2014-01-23  1:27           ` [PATCH 1/3] repack: fix typo in max-pack-size option Jeff King
2014-01-23  1:28           ` [PATCH 2/3] repack: make parsed string options const-correct Jeff King
2014-01-23  1:30           ` [PATCH 3/3] repack: propagate pack-objects options as strings Jeff King
2014-01-23  1:38             ` Jeff King
2014-01-23 18:37           ` [PATCH v2 2/2] repack: accept larger window-memory and max-pack-size Junio C Hamano
2014-01-22 22:33     ` [PATCH v2 0/2] Fix "repack --window-memory=4g" regression in 1.8.4 Stefan Beller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1390420685-18449-3-git-send-email-gitster@pobox.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=sid0@fb.com \
    --cc=stefanbeller@googlemail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).