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

[PATCH] Print RUNTIME_PREFIX warning only when GIT_TRACE is set

From
Johannes Sixt <j.sixt@viscovery.net>
Date
Feb 23, 2010, 11:42 UTC
Message-ID
<4B83BF40.4070802@viscovery.net>
In-Reply-To
<alpine.DEB.1.00.1002231201260.3980@intel-tinevez-2-302>
From: Johannes Sixt <j6t@kdbg.org>

When RUNTIME_PREFIX is enabled, the installation prefix is derived by trying a limited set of known locations where the git executable can reside. If none of these is found, a warning is emitted.

When git is built in a directory that matches neither of these known names, the warning would always be emitted when the uninstalled executable is run. This is a problem on Windows, where gitk picks the uninstalled git when invoked from the build directory and gets confused by the warning.

Print the warning only when GIT_TRACE is set.
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
---
Johannes Schindelin schrieb:
> P.S.: I cannot recall defending the warning, but I might have thought it a 
> good idea at some stage. This is no longer so.
I do recall you defended it; good to know that you changed your mind.

Thanks, -- Hannes

 exec_cmd.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/exec_cmd.c b/exec_cmd.c
index 408e4e5..b2c07c7 100644
--- a/exec_cmd.c
+++ b/exec_cmd.c
@@ -28,7 +28,7 @@ const char *system_path(const char *path)
 	    !(prefix = strip_path_suffix(argv0_path, BINDIR)) &&
 	    !(prefix = strip_path_suffix(argv0_path, "git"))) {
 		prefix = PREFIX;
-		fprintf(stderr, "RUNTIME_PREFIX requested, "
+		trace_printf("RUNTIME_PREFIX requested, "
 				"but prefix computation failed.  "
 				"Using static fallback '%s'.\n", prefix);
 	}
-- 
1.7.0.83.g241b9.dirty
Previous: Johannes SchindelinNext: Johannes Schindelin
Message 7 of 8 in “Wrap RUNTIME_PREFIX warning in a compile-time condition”
  1. Wrap RUNTIME_PREFIX warning in a compile-time conditionJohannes Sixt, Feb 23, 2010
  2. Johannes SchindelinFeb 23, 2010
  3. Johannes SixtFeb 23, 2010
  4. Johannes SchindelinFeb 23, 2010
  5. Johannes SixtFeb 23, 2010
  6. Johannes SchindelinFeb 23, 2010
  7. Print RUNTIME_PREFIX warning only when GIT_TRACE is setJohannes Sixt, Feb 23, 2010
  8. Johannes SchindelinFeb 23, 2010

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.