From 8f8c6fafd92fd547547bd7735e2d121a20997703 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Thu, 9 Apr 2009 12:40:39 -0700 Subject: Allow users to un-configure rename detection On Thu, 9 Apr 2009, Linus Torvalds wrote: > > [diff] > renames = no Btw, while doing this, I also though that "renames = on/off" made more sense, but while we allow yes/no and true/false for booleans, we don't allow on/off. Should we? Maybe. Here's a stupid patch. Linus Signed-off-by: Junio C Hamano diff --git a/config.c b/config.c index b76fe4c..e7d91f5 100644 --- a/config.c +++ b/config.c @@ -331,9 +331,9 @@ int git_config_bool_or_int(const char *name, const char *value, int *is_bool) return 1; if (!*value) return 0; - if (!strcasecmp(value, "true") || !strcasecmp(value, "yes")) + if (!strcasecmp(value, "true") || !strcasecmp(value, "yes") || !strcasecmp(value, "on")) return 1; - if (!strcasecmp(value, "false") || !strcasecmp(value, "no")) + if (!strcasecmp(value, "false") || !strcasecmp(value, "no") || !strcasecmp(value, "off")) return 0; *is_bool = 0; return git_config_int(name, value); -- cgit v0.10.2-6-g49f6 From 0cbcf7ad71559245b59b90a324011fcf0657af8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Kiedrowicz?= Date: Fri, 17 Apr 2009 22:34:25 +0200 Subject: Documentation: boolean value may be given by on/off MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: MichaƂ Kiedrowicz Signed-off-by: Junio C Hamano diff --git a/Documentation/config.txt b/Documentation/config.txt index 3afd124..103ea9b 100644 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@ -61,7 +61,7 @@ Internal whitespace within a variable value is retained verbatim. The values following the equals sign in variable assign are all either a string, an integer, or a boolean. Boolean values may be given as yes/no, -0/1 or true/false. Case is not significant in boolean values, when +0/1, true/false or on/off. Case is not significant in boolean values, when converting value to the canonical form using '--bool' type specifier; 'git-config' will ensure that the output is "true" or "false". -- cgit v0.10.2-6-g49f6