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

Re: --exec-path not always honored

From
Johannes Sixt <j.sixt@viscovery.net>
Date
Mar 18, 2009, 07:42 UTC
Message-ID
<49C0A5FD.70004@viscovery.net>
In-Reply-To
<7v7i2nmlpt.fsf@gitster.siamese.dyndns.org>
Junio C Hamano schrieb:
Show 8 quoted lines
> Johannes Sixt <j.sixt@viscovery.net> writes:
> 
>> git-gc is a builtin. Should git setenv("GIT_EXEC_PATH") before it runs
>> other git commands?
> 
> I think we just never have bothered about such a use case, but you are
> right.  It probably is a good solution, although setenv makes me feel a
> bit nervous for no rational reason.
This patch fixes the use case and is IMO the most logical solution.
diff --git a/exec_cmd.c b/exec_cmd.c
index 217c125..408e4e5 100644
--- a/exec_cmd.c
+++ b/exec_cmd.c
@@ -61,6 +61,10 @@ const char *git_extract_argv0_path(const char *argv0)
 void git_set_argv_exec_path(const char *exec_path)
 {
 	argv_exec_path = exec_path;
+	/*
+	 * Propagate this setting to external programs.
+	 */
+	setenv(EXEC_PATH_ENVIRONMENT, exec_path, 1);
 }
Previous: Junio C Hamano
Message 5 of 5 in “--exec-path not always honored”
  1. Johannes SixtMar 17, 2009
  2. Johannes SchindelinMar 17, 2009
  3. Johannes SixtMar 17, 2009
  4. Junio C HamanoMar 18, 2009
  5. Johannes SixtMar 18, 2009

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.