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

git --exec-path conversion

From
MCMarco Costalba <mcostalba@yahoo.it>
Date
Nov 19, 2005, 11:14 UTC
Message-ID
<20051119111444.82122.qmail@web26309.mail.ukl.yahoo.com>
Hi,
   if I understood correctly, git programs will be installed somewhere in $PATH for at least next
two months.

But I would like to update to what will be the future, i.e. prepending what 'git --exec-path' says to any git command.

I don't call git programs directly but I use a function QGit::run(cmd) that does this plus other things.

The problem is that I call QGit::run() also for other commands not related to git (ls, cat, etc..).

How can I make the transition?
Now I have two ways, the brute force way and the easy (peraphs tricky) way.

The brute force is to create a new function QGit::runGitCmd() that deals only with git commands _and_ replace all the occurences of run() with the latter.

The easy way is to prepend the exec-path *inside* run(), and to use to disambiguate bewteen git and shell commands the testing of first three chars of the command to launch, something like:

    if (cmd.left(3) == "git") 
         cmd = cmd.prepend(exec-path);

I would like to go with the second one, I'm a bit lazy ;-) , but I would like to ask if this is a good policy, i.e. if also inside git programs/scripts (like in git.c I guess) is used or is foreseen to keep using something like this.

Thanks Marco

__________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com

Next: Johannes Schindelin
Message 1 of 4 in “git --exec-path conversion”
  1. Marco CostalbaNov 19, 2005
  2. Johannes SchindelinNov 19, 2005
  3. Junio C HamanoNov 19, 2005
  4. Junio C HamanoNov 19, 2005

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.