Skip to content

Commit

Permalink
git-gui: add directory git-gui is located in to PATH (on Windows)
Browse files Browse the repository at this point in the history
This commit modifies PATH to include a good guess where git
could be found. The first location to search for executable is
the directory git-gui is installed in. This is a good guess for
a sane installation.

Even if git is not available in PATH, git-gui is now able
to find it. Hence git-gui can be passed to wish as an absolute
path without caring about the environment.

We must modify PATH to be able to spawn shell based git commands.
For builtins it would be sufficient to located them and execute
them with their absolute path. But for shell based git commmands
PATH needs to be modified.

Signed-off-by: Steffen Prohaska <prohaska@zib.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
  • Loading branch information
Steffen Prohaska authored and Shawn O. Pearce committed Oct 10, 2007
1 parent 3ea16e5 commit be700fe
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions git-gui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,9 @@ proc _which {what} {
$env(PATH)] {;}]
set _search_exe .exe
} elseif {[is_Windows]} {
set gitguidir [file dirname [info script]]
regsub -all ";" $gitguidir "\\;" gitguidir
set env(PATH) "$gitguidir;$env(PATH)"
set _search_path [split $env(PATH) {;}]
set _search_exe .exe
} else {
Expand Down

0 comments on commit be700fe

Please sign in to comment.