All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/2] Support common unit suffixes in packedGitWindowSize.
       [not found] <bc77965370c83bccc9b04c68911ab7e9d7d83d58.1167530501.git.spearce@spearce.org>
@ 2006-12-31  2:02 ` Shawn O. Pearce
  0 siblings, 0 replies; only message in thread
From: Shawn O. Pearce @ 2006-12-31  2:02 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

Make use of the new git_config_datasize function to parse the value
for core.packedGitWindowSize and core.packedGitLimit, as these
need to be a bytecount internally but the user will probably want
to specify them with standard units, such as "32 MiB".

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
---
 Applies on top of sp/mmap.

 Documentation/config.txt |   10 ++++++++--
 config.c                 |    6 +++---
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/Documentation/config.txt b/Documentation/config.txt
index d71653d..17d5b53 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -123,21 +123,27 @@ core.packedGitWindowSize::
 	single mapping operation.  Larger window sizes may allow
 	your system to process a smaller number of large pack files
 	more quickly.  Smaller window sizes will negatively affect
-	performance due to increased calls to the opreating system's
+	performance due to increased calls to the operating system's
 	memory manager, but may improve performance when accessing
 	a large number of large pack files.  Default is 32 MiB,
 	which should be reasonable for all users/operating systems.
 	You probably do not need to adjust this value.
 
+	Common unit suffixes of 'k', 'kb', 'kib', 'm', 'mb', 'mib',
+	'g', 'gb', 'gib' are supported.
+
 core.packedGitLimit::
 	Maximum number of bytes to map simultaneously into memory
 	from pack files.  If Git needs to access more than this many
 	bytes at once to complete an operation it will unmap existing
 	regions to reclaim virtual address space within the process.
 	Default is 256 MiB, which should be reasonable for all
-	users/operating systems, except on largest Git projects.
+	users/operating systems, except on the largest projects.
 	You probably do not need to adjust this value.
 
+	Common unit suffixes of 'k', 'kb', 'kib', 'm', 'mb', 'mib',
+	'g', 'gb', 'gib' are supported.
+
 alias.*::
 	Command aliases for the gitlink:git[1] command wrapper - e.g.
 	after defining "alias.last = cat-file commit HEAD", the invocation
diff --git a/config.c b/config.c
index 07ad2f1..a9f4497 100644
--- a/config.c
+++ b/config.c
@@ -324,8 +324,8 @@ int git_default_config(const char *var, const char *value)
 	}
 
 	if (!strcmp(var, "core.packedgitwindowsize")) {
-		int pgsz = getpagesize();
-		packed_git_window_size = git_config_int(var, value);
+		unsigned long pgsz = getpagesize();
+		packed_git_window_size = git_config_datasize(var, value);
 		packed_git_window_size /= pgsz;
 		if (packed_git_window_size < 2)
 			packed_git_window_size = 2;
@@ -334,7 +334,7 @@ int git_default_config(const char *var, const char *value)
 	}
 
 	if (!strcmp(var, "core.packedgitlimit")) {
-		packed_git_limit = git_config_int(var, value);
+		packed_git_limit = git_config_datasize(var, value);
 		return 0;
 	}
 
-- 
1.5.0.rc0.g6bb1

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2006-12-31  2:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bc77965370c83bccc9b04c68911ab7e9d7d83d58.1167530501.git.spearce@spearce.org>
2006-12-31  2:02 ` [PATCH 2/2] Support common unit suffixes in packedGitWindowSize Shawn O. Pearce

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.