Skip to contentSkip to conversation

intended use of "git --exec-path"?

DISCUSSION Scott Parish 4 participants 5 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

"git --exec-path" presently prints out the highest priority path to find executable in. That's a what; i'm curious why and when it should be used. Basically i'm wondering if its still useful, and what, if anything, it should be printing.

Thanks
sRp

Signature · 2 lines
Scott Parish
http://srparish.net/
#1 lore raw
Quoted 4 lines · Scott Parish

"git --exec-path" presently prints out the highest priority path to find executable in. That's a what; i'm curious why and when it should be used. Basically i'm wondering if its still useful, and what, if anything, it should be printing.

git-gui uses it. git-gui runs git-* by prefixing it with the exec path. It also scans the first line of the file if we are on Windows and the "executable" doesn't end in ".exe" so it can figure out what process to run it through.

So it really can't go away.

Signature · 1 line
Shawn.
#2 lore raw
Quoted 6 lines · Shawn O. Pearce
Quoted 4 lines · Scott Parish

"git --exec-path" presently prints out the highest priority path to find executable in. That's a what; i'm curious why and when it should be used. Basically i'm wondering if its still useful, and what, if anything, it should be printing.

Quoted 6 lines

git-gui uses it. git-gui runs git-* by prefixing it with the exec path. It also scans the first line of the file if we are on Windows and the "executable" doesn't end in ".exe" so it can figure out what process to run it through.

So it really can't go away.

So it sounds like it might be more helpful for git to return its PATH, so other programs can set their PATH or search for executables accordingly.

sRp

Signature · 2 lines
Scott Parish
http://srparish.net/
#3 lore raw
Quoted 13 lines · Scott Parish
Quoted 11 lines · Shawn O. Pearce
Quoted 4 lines · Scott Parish

"git --exec-path" presently prints out the highest priority path to find executable in. That's a what; i'm curious why and when it should be used. Basically i'm wondering if its still useful, and what, if anything, it should be printing.

git-gui uses it. git-gui runs git-* by prefixing it with the exec path. It also scans the first line of the file if we are on Windows and the "executable" doesn't end in ".exe" so it can figure out what process to run it through.

Quoted 5 lines
Quoted 1 line

So it really can't go away.

So it sounds like it might be more helpful for git to return its PATH, so other programs can set their PATH or search for executables accordingly.

You don't necessarily want to be monkeying around with $PATH if you're trying to use a particular git installation (say, a build of next) instead of your "proper" install, which is in your $PATH; if you call /some/random/path/git-whatever, it should use the git tools in /some/random/path/, not in $PATH.

Dave.

#4 lore raw
In reply to Scott Parish
Quoted 5 lines · Scott Parish

"git --exec-path" presently prints out the highest priority path to find executable in. That's a what; i'm curious why and when it should be used. Basically i'm wondering if its still useful, and what, if anything, it should be printing.

git supports having all its "helpers" in a separate path. Since there were performance concerns with having scripts call the git wrapper for every invocation of every git program, the --exec-path option was added when the wrapper was rewritten in C.

Unless it's a very tight loop that runs non-builtin programs, there's really no reason for scripts to use the git-whatever form of commands, but the ability to do so should probably be retained more or less forever. See 8e49d50388211a0f3e7286f6ee600bf7736f4814 for details.

Signature · 3 lines
Andreas Ericsson                   [email protected]
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231