All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Scott R Parish" <srp@srparish.net>
To: "Johannes Schindelin" <Johannes.Schindelin@gmx.de>,
	git@vger.kernel.org, spearce@spearce.org, gitster@pobox.com
Subject: Re: [PATCH] Deduce exec_path also from calls to git with a  relative path
Date: Sat, 20 Oct 2007 03:13:26 -0500 (CDT)	[thread overview]
Message-ID: <1192868006.v2.fusewebmail-240137@f> (raw)


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>

> 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
>
>

             reply	other threads:[~2007-10-20  8:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-20  8:13 Scott R Parish [this message]
2007-10-20 21:31 ` [PATCH] Deduce exec_path also from calls to git with a relative path Johannes Schindelin
2007-10-20 23:04   ` Scott Parish
  -- strict thread matches above, loose matches on Subject: below --
2007-10-20  6:46 [PATCH] If git is ran with a relative path, try building an absolute exec_path from it Scott R Parish
2007-10-20  7:21 ` [PATCH] Deduce exec_path also from calls to git with a relative path Johannes Schindelin
2007-10-20 12:25   ` David Brown
2007-10-20 21:25     ` Johannes Schindelin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1192868006.v2.fusewebmail-240137@f \
    --to=srp@srparish.net \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=spearce@spearce.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.