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

Re: [PATCH] Deduce exec_path also from calls to git with a relative path

From
Scott R Parish <srp@srparish.net>
Date
Oct 20, 2007, 08:13 UTC
Message-ID
<1192868006.v2.fusewebmail-240137@f>
Wow, that sure cleaned up nicely! :)

Thanks sRp

----- Original Message -----
Subject: [PATCH] Deduce exec_path also from calls to git with a relative path
Date: Sat, October 20, 2007 0:21
From: "Johannes Schindelin" <Johannes.Schindelin@gmx.de>
Show 57 quoted lines
> There is already logic in the git wrapper to deduce the exec_path from
> argv[0], when the git wrapper was called with an absolute path.  Extend
> that logic to handle relative paths as well.
>
> For example, when you call "../../hello/world/git", it will not turn
> "../../hello/world" into an absolute path, and use that.
>
> Initial implementation by Scott R Parish.
>
> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> ---
>
>         On Fri, 19 Oct 2007, Scott R Parish wrote:
>
>         >  Signed-off-by: Scott R Parish <srp@srparish.net>
>
>         That is a little short for a commit message ;-)
>
>         >  git.c |   35 +++++++++++++++++++++++++++++++++--
>         >  1 files changed, 33 insertions(+), 2 deletions(-)
>
>         I had commented on this before.  Probably I did a very bad job
>         at explaining things, so hopefully this is better:
>
>  git.c |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/git.c b/git.c
> index d7c6bca..1dad764 100644
> --- a/git.c
> +++ b/git.c
> @@ -414,13 +414,14 @@ int main(int argc, const char **argv)
>          /*
>           * Take the basename of argv[0] as the command
>           * name, and the dirname as the default exec_path
> -         * if it's an absolute path and we don't have
> -         * anything better.
> +         * if we don't have anything better.
>           */
>          if (slash) {
>                  *slash++ = 0;
>                  if (*cmd == '/')
>                          exec_path = cmd;
> +                else
> +                        exec_path = xstrdup(make_absolute_path(cmd));
>                  cmd = slash;
>          }
>
> --
> 1.5.3.4.1287.g8b31e
>
> -
> 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
>
>
Next: Johannes Schindelin
Message 1 of 3 in “Re: [PATCH] Deduce exec_path also from calls to git with a relative path”
  1. Scott R ParishOct 20, 2007
  2. Johannes SchindelinOct 20, 2007
  3. Scott ParishOct 20, 2007

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.