git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Wrap RUNTIME_PREFIX warning in a compile-time condition
@ 2010-02-23  8:32 Johannes Sixt
  2010-02-23  9:42 ` Johannes Schindelin
  0 siblings, 1 reply; 8+ messages in thread
From: Johannes Sixt @ 2010-02-23  8:32 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Git Mailing List, msysGit

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 on the build directory and gets confused by the warning.

With this patch, individual developers can disable the warning by setting

   BASIC_CFLAGS += -DNO_WARN_RUNTIME_PREFIX

in config.mak.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
---
 exec_cmd.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/exec_cmd.c b/exec_cmd.c
index 408e4e5..5a22635 100644
--- a/exec_cmd.c
+++ b/exec_cmd.c
@@ -28,9 +28,11 @@ const char *system_path(const char *path)
 	    !(prefix = strip_path_suffix(argv0_path, BINDIR)) &&
 	    !(prefix = strip_path_suffix(argv0_path, "git"))) {
 		prefix = PREFIX;
+#ifndef NO_WARN_RUNTIME_PREFIX
 		fprintf(stderr, "RUNTIME_PREFIX requested, "
 				"but prefix computation failed.  "
 				"Using static fallback '%s'.\n", prefix);
+#endif
 	}
 #endif

-- 
1.7.0.84.g6ef09

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2010-02-23 12:58 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-23  8:32 [PATCH] Wrap RUNTIME_PREFIX warning in a compile-time condition Johannes Sixt
2010-02-23  9:42 ` Johannes Schindelin
2010-02-23  9:43   ` Johannes Sixt
2010-02-23 10:03     ` Johannes Schindelin
2010-02-23 10:10       ` Johannes Sixt
2010-02-23 11:07         ` Johannes Schindelin
2010-02-23 11:42           ` [PATCH] Print RUNTIME_PREFIX warning only when GIT_TRACE is set Johannes Sixt
2010-02-23 12:57             ` Johannes Schindelin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).