Support common unit suffixes in packedGitWindowSize.
A message that is not in the archive (sent off-list or not yet received): bc77965370c83bccc9b04c68911ab7e9d7d83d58.1167530501.git.spearce@spearce.org
PATCH 2/2 Support common unit suffixes in packedGitWindowSize.
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 <[email protected]>
---
Applies on top of sp/mmap.
Documentation/config.txt | 10 ++++++++-- config.c | 6 +++--- 2 files changed, 11 insertions(+), 5 deletions(-)
Documentation/config.txt +8 -2
@@ -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
config.c +3 -3
@@ -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 ; }
Signature · 1 line
1.5.0.rc0.g6bb1