Re: [PATCH 08/15] merge: handle NULL value for branch.<name>.mergeOptions
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Nov 11, 2026, 17:50 UTC
- Message-ID
- <xmqq8q2zntov.fsf@gitster.g>
- In-Reply-To
- <b298dd66-49b8-4019-aecd-e6dfffa2f89c@gmail.com>
Phillip Wood <phillip.wood123@gmail.com> writes:
> To me confusing thing is that we don't treat those two the same way - > I'd find it much easier to reason about if empty and missing values were > always treated the same and booleans required an explicit value, but it > is too late to change that now.
The "valueless true" was there from the beginning, as can be seen in 17712991a5 (Add ".git/config" file parser, 2005-10-10):
From: Linus Torvalds <torvalds@osdl.org>
Date: Mon, 10 Oct 2005 16:31:08 -0700
Subject: [PATCH] Add ".git/config" file parserThis is a first cut at a very simple parser for a git config file.
The format of the file is a simple ini-file like thing, ...
diff --git a/config.c b/config.c
new file mode 100644
index 0000000000..f3c4fa42ac
--- /dev/null
+++ b/config.c
@@ -0,0 +1,222 @@
...
+int git_config_bool(const char *name, const char *value)
+{
+ if (!value)
+ return 1;
+ if (!*value)
+ return 0;
+ if (!strcasecmp(value, "true"))
+ return 1;
+ if (!strcasecmp(value, "false"))
+ return 0;
+ return git_config_int(name, value) != 0;
+}So I agree that it is way too late to change now.