From: Andreas Ericsson <ae@op5.se>
To: Scott Parish <sRp@srparish.net>
Cc: Johannes Schindelin <Johannes.Schindelin@gmx.de>,
"Shawn O. Pearce" <spearce@spearce.org>,
git@vger.kernel.org
Subject: Re: [PATCH] execv_git_cmd(): also try PATH if everything else fails.
Date: Mon, 22 Oct 2007 17:19:36 +0200 [thread overview]
Message-ID: <471CBF88.6020300@op5.se> (raw)
In-Reply-To: <20071022143637.GP16291@srparish.net>
Scott Parish wrote:
> On Sun, Oct 21, 2007 at 10:59:01PM +0100, Johannes Schindelin wrote:
>
>> Earlier, we tried to find the git commands in several possible exec
>> dirs. Now, if all of these failed, try to find the git command in
>> PATH.
>
> I'm tempted to try a different approach. What if instead of looping
> and building up strings of all the different absolute paths we want
> to try we just prepend to PATH with the correct extra precedence,
> and then call execvp on the command we want?
>
That's how the original git --exec-dir feature got implemented. There's
even a nifty function for it in git.c; prepend_to_path(). It's a
provably workable solution.
--
Andreas Ericsson andreas.ericsson@op5.se
OP5 AB www.op5.se
Tel: +46 8-230225 Fax: +46 8-230231
next prev parent reply other threads:[~2007-10-22 15:20 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-20 8:12 [PATCH] When exec'ing sub-commands, fall back on execvp (thePATH) Scott R Parish
2007-10-20 20:25 ` Johannes Schindelin
2007-10-20 20:57 ` Scott Parish
2007-10-20 22:00 ` [PATCH] execv_git_cmd(): also try PATH if everything else fails Johannes Schindelin
2007-10-21 2:36 ` Shawn O. Pearce
2007-10-21 21:59 ` Johannes Schindelin
2007-10-22 4:21 ` Shawn O. Pearce
2007-10-22 10:35 ` Johannes Schindelin
2007-10-23 4:34 ` Shawn O. Pearce
2007-10-23 11:12 ` Johannes Schindelin
2007-10-22 14:36 ` Scott Parish
2007-10-22 15:19 ` Andreas Ericsson [this message]
2007-10-22 15:36 ` Johannes Sixt
2007-10-23 11:12 ` Andreas Ericsson
2007-10-23 15:29 ` Johannes Sixt
2007-10-21 18:21 ` Scott Parish
2007-10-21 22:02 ` 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=471CBF88.6020300@op5.se \
--to=ae@op5.se \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=sRp@srparish.net \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).