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

Re: [PATCH] execv_git_cmd(): also try PATH if everything else fails.

From
Andreas Ericsson <ae@op5.se>
Date
Oct 22, 2007, 15:19 UTC
Message-ID
<471CBF88.6020300@op5.se>
In-Reply-To
<20071022143637.GP16291@srparish.net>
Scott Parish wrote:
Show 11 quoted lines
> 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
Previous: Scott ParishNext: Johannes Sixt
Message 12 of 17 in “Re: [PATCH] When exec'ing sub-commands, fall back on execvp (thePATH)”
  1. Scott R ParishOct 20, 2007
  2. Johannes SchindelinOct 20, 2007
  3. Scott ParishOct 20, 2007
  4. execv_git_cmd(): also try PATH if everything else fails.Johannes Schindelin, Oct 20, 2007
  5. Shawn O. PearceOct 21, 2007
  6. execv_git_cmd(): also try PATH if everything else fails.Johannes Schindelin, Oct 21, 2007
  7. Shawn O. PearceOct 22, 2007
  8. Johannes SchindelinOct 22, 2007
  9. Shawn O. PearceOct 23, 2007
  10. Johannes SchindelinOct 23, 2007
  11. Scott ParishOct 22, 2007
  12. Andreas EricssonOct 22, 2007
  13. Johannes SixtOct 22, 2007
  14. Andreas EricssonOct 23, 2007
  15. Johannes SixtOct 23, 2007
  16. Scott ParishOct 21, 2007
  17. Johannes SchindelinOct 21, 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.