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

[PATCH 2/2] formatting for error messages

From
Andrew Klotz via GitGitGadget <gitgitgadget@gmail.com>
Date
Sep 18, 2020, 02:17 UTC
Message-ID
<1e9caf1911d3b2663365f4487016499f47390333.1600395427.git.gitgitgadget@gmail.com>
In-Reply-To
<pull.841.git.git.1600395427.gitgitgadget@gmail.com>
From: Andrew Klotz <agc.klotz@gmail.com>
we no longer need to use `N_` instead of `_` here.

we had been using `N_` instead of `_` in the case this function was being called by with `GIT_TEST_GETTEXT_POISON` leading to an infinite loop.

Since we have moved `GIT_TEST_GETTEXT_POISON` out of this function, (it is evaluated as a boolean, not an int) we no longer need to handle the special case and can use `_`.

Signed-off-by: Andrew Klotz <agc.klotz@gmail.com>
---
 config.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/config.c b/config.c
index 198d0d3216..624fb30fdd 100644
--- a/config.c
+++ b/config.c
@@ -990,8 +990,8 @@ NORETURN
 static void die_bad_number(const char *name, const char *value)
 {
 	const char *error_type = (errno == ERANGE) ?
-		N_("out of range") : N_("invalid unit");
-	const char *bad_numeric = N_("bad numeric config value '%s' for '%s': %s");
+		_("out of range") : _("invalid unit");
+	const char *bad_numeric = _("bad numeric config value '%s' for '%s': %s");
 
 	if (!value)
 		value = "";
-- 
gitgitgadget
Previous: Junio C HamanoNext: Junio C Hamano
Message 6 of 13 in “config: improve error message for boolean config”
  1. 0/2 config: improve error message for boolean configAndrew Klotz via GitGitGadget, Sep 18, 2020
  2. 1/2 config: improve error message for boolean configAndrew Klotz via GitGitGadget, Sep 18, 2020
  3. Jeff KingSep 18, 2020
  4. Phillip WoodSep 18, 2020
  5. Junio C HamanoSep 18, 2020
  6. 2/2 formatting for error messagesAndrew Klotz via GitGitGadget, Sep 18, 2020
  7. Junio C HamanoSep 18, 2020
  8. config: improve error message for boolean configAndrew Klotz via GitGitGadget, Feb 9, 2021
  9. Jeff KingFeb 9, 2021
  10. Junio C HamanoFeb 9, 2021
  11. config: improve error message for boolean configAndrew Klotz via GitGitGadget, Feb 11, 2021
  12. Jeff KingFeb 12, 2021
  13. Junio C HamanoFeb 12, 2021

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.