git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] config: deprecate using "" as boolean value false.

From
Christian Couder <chriscool@tuxfamily.org>
Date
Feb 11, 2008, 07:22 UTC
Message-ID
<20080211082216.e9212310.chriscool@tuxfamily.org>
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
Next: Junio C Hamano
Message 1 of 4 in “config: deprecate using "" as boolean value false.”
  1. config: deprecate using "" as boolean value false.Christian Couder, Feb 11, 2008
  2. Junio C HamanoFeb 11, 2008
  3. Junio C HamanoFeb 11, 2008
  4. teach config parsers to diagnose missing valuesJunio C Hamano, Feb 11, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.