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

[PATCH] upload-pack: Initialize the exec-path.

From
Johannes Sixt <j.sixt@viscovery.net>
Date
Feb 12, 2008, 11:28 UTC
Message-ID
<47B182C1.60006@viscovery.net>
In-Reply-To
<alpine.LSU.1.00.0802121028290.3870@racer.site>
From: Johannes Sixt <johannes.sixt@telecom.at>

Since git-upload-pack has to spawn git-pack-objects, it has to make sure that the latter can be found in the PATH. Without this patch an attempt to clone or pull via ssh from a server fails if the git tools are not in the standard PATH on the server even though git clone or git pull were invoked with --upload-pack=/path/to/git-upload-pack.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
---
Johannes Schindelin schrieb:
Show 9 quoted lines
> Hi,
> 
> On Tue, 12 Feb 2008, Johannes Sixt wrote:
>> The problem is that git-upload-pack (which is not a built-in) does not
>> call setup_path() and so does not extend PATH to contain the special
>> installation location. Now, when git-upload-pack tries to exec
>> git-pack-objects, it fails since this is not in PATH.
> 
> So, let's make git-upload-pack a builtin, no?
How about this (almost) one-liner instead?
-- Hannes
 upload-pack.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/upload-pack.c b/upload-pack.c
index 7e04311..51e3ec4 100644
--- a/upload-pack.c
+++ b/upload-pack.c
@@ -620,6 +620,9 @@ int main(int argc, char **argv)

 	if (i != argc-1)
 		usage(upload_pack_usage);
+
+	setup_path(NULL);
+
 	dir = argv[i];

 	if (!enter_repo(dir, strict))
-- 
1.5.4.rc3.24.g25a9a
Previous: Johannes SchindelinNext: Johannes Schindelin
Message 6 of 11 in “Unable to clone an ssh repository (with ugly installation-specific workaround)”
  1. Elijah NewrenFeb 12, 2008
  2. David SymondsFeb 12, 2008
  3. Jakub NarebskiFeb 12, 2008
  4. Johannes SixtFeb 12, 2008
  5. Johannes SchindelinFeb 12, 2008
  6. upload-pack: Initialize the exec-path.Johannes Sixt, Feb 12, 2008
  7. Johannes SchindelinFeb 12, 2008
  8. Johannes SchindelinFeb 12, 2008
  9. Elijah NewrenFeb 13, 2008
  10. Elijah NewrenFeb 13, 2008
  11. Stephen SinclairFeb 13, 2008

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.