Teach Git how to parse standard power of 2 suffixes.
Sometimes its necessary to supply a value as a power of two in a configuration parameter. In this case the user may want to use the standard suffixes such as K, M, or G to indicate that the numerical value should be multiplied by a constant base before being used. Shell scripts/etc. can also benefit from this automatic option parsing with `git repo-config --int`. [jc: with a couple of test and a slight input tightening] Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:

committed by
Junio C Hamano

parent
95d3c4f546
commit
d77a64d353
@ -87,7 +87,10 @@ OPTIONS
|
||||
git-repo-config will ensure that the output is "true" or "false"
|
||||
|
||||
--int::
|
||||
git-repo-config will ensure that the output is a simple decimal number
|
||||
git-repo-config will ensure that the output is a simple
|
||||
decimal number. An optional value suffix of 'k', 'm', or 'g'
|
||||
in the config file will cause the value to be multiplied
|
||||
by 1024, 1048576, or 1073741824 prior to output.
|
||||
|
||||
|
||||
ENVIRONMENT
|
||||
|
Reference in New Issue
Block a user