[PATCH] Use the best available exec path only

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Junio C Hamano <gitster@...>
Cc: Brian Gernhardt <benji@...>, Johannes Schindelin <Johannes.Schindelin@...>, Git Mailing List <git@...>
Date: Sunday, November 11, 2007 - 4:33 pm

On 2007.11.11 11:43:02 -0800, Junio C Hamano wrote:

Maybe you prefer this patch then? "make test" survived up to 9101/25,
but that fails with the current master anyway and I didn't bother to run
the remaining tests manually, so it seems to be fine. Might break some
weird setups that rely on being able to set multiple additional paths
though (not that I think that that is a good idea to begin with).

Björn
---
Instead of adding all possible exec paths to PATH, only add the best
one, following the same rules that --exec-path, without arguments, uses
to figure out which path to display.

Signed-off-by: Björn Steinbrink <B.Steinbrink@gmx.de>
---
diff --git a/exec_cmd.c b/exec_cmd.c
index 2d0a758..9c376ad 100644
--- a/exec_cmd.c
+++ b/exec_cmd.c
@@ -48,9 +48,7 @@ void setup_path(const char *cmd_path)
 
 	strbuf_init(&new_path, 0);
 
-	add_path(&new_path, argv_exec_path);
-	add_path(&new_path, getenv(EXEC_PATH_ENVIRONMENT));
-	add_path(&new_path, builtin_exec_path);
+	add_path(&new_path, git_exec_path());
 	add_path(&new_path, cmd_path);
 
 	if (old_path)
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
t7005 and vi in GIT_EXEC_PATH, Brian Gernhardt, (Sat Nov 10, 6:03 pm)
[PATCH] t7005-editor.sh: Don't invoke real vi when it is in ..., Björn Steinbrink, (Sun Nov 11, 1:38 pm)
Re: [PATCH] t7005-editor.sh: Don't invoke real vi when it is..., Johannes Schindelin, (Sun Nov 11, 1:44 pm)
Re: [PATCH] t7005-editor.sh: Don't invoke real vi when it is..., Johannes Schindelin, (Sun Nov 11, 2:31 pm)
Re: t7005 and vi in GIT_EXEC_PATH, Johannes Schindelin, (Sun Nov 11, 11:58 am)
Re: t7005 and vi in GIT_EXEC_PATH, Brian Gernhardt, (Sun Nov 11, 12:10 pm)
Re: t7005 and vi in GIT_EXEC_PATH, Junio C Hamano, (Sun Nov 11, 3:43 pm)
Re: t7005 and vi in GIT_EXEC_PATH, Junio C Hamano, (Sun Nov 11, 5:29 pm)
[PATCH] Use the best available exec path only, Björn, (Sun Nov 11, 4:33 pm)
Re: [PATCH] Use the best available exec path only, Johannes Schindelin, (Sun Nov 11, 4:50 pm)
Re: [PATCH] Use the best available exec path only, Johannes Schindelin, (Sun Nov 11, 5:40 pm)
Re: t7005 and vi in GIT_EXEC_PATH, Johannes Schindelin, (Sun Nov 11, 12:28 pm)
Re: t7005 and vi in GIT_EXEC_PATH, David Kastrup, (Sat Nov 10, 6:09 pm)
Re: t7005 and vi in GIT_EXEC_PATH, Brian Gernhardt, (Sat Nov 10, 6:45 pm)