git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Sixt <j.sixt@viscovery.net>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: Junio C Hamano <gitster@pobox.com>,
	Git Mailing List <git@vger.kernel.org>,
	msysGit <msysgit@googlegroups.com>
Subject: [PATCH] Print RUNTIME_PREFIX warning only when GIT_TRACE is set
Date: Tue, 23 Feb 2010 12:42:56 +0100	[thread overview]
Message-ID: <4B83BF40.4070802@viscovery.net> (raw)
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

  reply	other threads:[~2010-02-23 11:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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           ` Johannes Sixt [this message]
2010-02-23 12:57             ` [PATCH] Print RUNTIME_PREFIX warning only when GIT_TRACE is set Johannes Schindelin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B83BF40.4070802@viscovery.net \
    --to=j.sixt@viscovery.net \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=msysgit@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).