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

Re: [PATCH] Glean libexec path from argv[0] for git-upload-pack and git-receive-pack.

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jul 30, 2008, 14:56 UTC
Message-ID
<alpine.LSU.1.00.0807301650060.3486@wbgn129.biozentrum.uni-wuerzburg.de>
In-Reply-To
<1217417238-26731-1-git-send-email-shaslam@lastminute.com>
Hi,
Show 11 quoted lines
> diff --git a/upload-pack.c b/upload-pack.c
> index c911e70..086eff6 100644
> --- a/upload-pack.c
> +++ b/upload-pack.c
> @@ -616,6 +616,9 @@ int main(int argc, char **argv)
>  	int i;
>  	int strict = 0;
>  
> +	if (argv[0] && *argv[0])
> +		git_extract_argv0_path(argv[0]);
> +
This is ugly.  The called function should already do it itself.

Further, why not go the full nine yards and avoid the calculation altogether, until it is necessary? Then the change to add lookup_program_in_path() would be nice and non-intrusive.

IOW why not leave the function name as-is, and just enhance system_path() to have a static variable "initialized", which does the whole calculation? I.e. move the calculation from git.c to exec_cmd.c, but at the same time do it only when needed.

And your change to set argv0_path from receive-pack and upload-pack would be a second patch.

And then the patch to add support to "glean" (did not know that word) the path from the PATH (lookup_program_in_path()) could come as a third patch.

Ciao, Dscho

Previous: Steve HaslamNext: Steve Haslam
Message 2 of 5 in “Glean libexec path from argv[0] for git-upload-pack and git-receive-pack.”
  1. Glean libexec path from argv[0] for git-upload-pack and git-receive-pack.Steve Haslam, Jul 30, 2008
  2. Johannes SchindelinJul 30, 2008
  3. Steve HaslamJul 30, 2008
  4. Johannes SchindelinJul 30, 2008
  5. Steve HaslamJul 30, 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.