Thread (1 message) 1 message, 1 author, 2021-02-12

Re: [PATCH v3] config: improve error message for boolean config

From: Junio C Hamano <hidden>
Date: 2021-02-12 19:53:00

Jeff King [off-list ref] writes:
Thanks, all the changes here look good to me except for one curiosity:
quoted
diff --git a/config.c b/config.c
index b922b4f28572..f90b633dba21 100644
--- a/config.c
+++ b/config.c
@@ -1180,6 +1180,20 @@ static void die_bad_number(const char *name, const char *value)
 	}
 }
 
+NORETURN
+static void die_bad_bool(const char *name, const char *value)
+{
+	if (!strcmp(name, "GIT_TEST_GETTEXT_POISON"))
+		/*
+		 * We explicitly *don't* use _() here since it would
+		 * cause an infinite loop with _() needing to call
+		 * use_gettext_poison().
+		 */
+		die("bad boolean config value '%s' for '%s'", value, name);
+	else
+		die(_("bad boolean config value '%s' for '%s'"), value, name);
+}
...if this is rebased on the current master that does not have
GIT_TEST_GETTEXT_POISON anymore, then I think this whole function can be
simplified down to the final line.

Since it looks like Junio applied this on top of v2.30.1, which still
has GETTEXT_POISON, we need it here. But we should remember to remove it
with the rest of the GETTEXT_POISON once it's all merged together.
Thanks for being extra careful.  I sort-of considered that this was
a bugfix and that was why it is made mergeable down to the maint
track, but I do not mind making this one of the "incentives" to
upgrade for our users ;-)

I actually suspect that without any of us worrying about it, Ævar
will take care of the cleaning up when the dust settles.

Thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help