[PATCH] config: deprecate using "" as boolean value false.
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
config.c | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/config.c b/config.c
index 526a3f4..b5f1a11 100644
--- a/config.c
+++ b/config.c
@@ -300,8 +300,19 @@ int git_config_bool(const char *name, const char *value)
{
if (!value)
return 1;
- if (!*value)
+ if (!*value) {
+ fprintf(stderr,
+ "Warning: using an empty value for boolean config "
+ "variables is deprecated.\n"
+ "An empty value currently means 'false' as a "
+ "boolean, but may very well means 'true' in the "
+ "future!\n"
+ "Please consider using a 'false' value explicitely "
+ "for variable '%s', so that your config is future "
+ "proof. You can do that using:\n"
+ "\tgit config %s false\n", name, name);
return 0;
+ }
if (!strcasecmp(value, "true") || !strcasecmp(value, "yes"))
return 1;
if (!strcasecmp(value, "false") || !strcasecmp(value, "no"))
--
1.5.4.20.gc135a-dirty