Skip to contentSkip to conversation

git-gui: try to locate git in same directory as git-gui (on Windows)

PATCH In review Steffen Prohaska 2 participants 2 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 git-gui: try to locate git in same directory as git-gui (on Windows)

This commit adds another guess where git might be located. After searching PATH the last fallback is the directory in which git-gui is installed. This is a good guess for a sane installation.

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

PATH is searched first and the location of git-gui only as a last resort. Maybe the order should be reversed?

---
 git-gui/git-gui.sh |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
git-gui/git-gui.sh +1 -0
index 3f5927f..bb1e7f3 100755
@@ -344,6 +344,7 @@ proc _which {what} {
 			set _search_exe .exe
 		} elseif {[is_Windows]} {
 			set _search_path [split $env(PATH) {;}]
+			lappend _search_path [file dirname [info script]]
 			set _search_exe .exe
 		} else {
 			set _search_path [split $env(PATH) :]
Signature · 1 line
1.5.3.mingw.1.105.ga0fd0
#1 lore raw
Quoted 4 lines · Steffen Prohaska

This commit adds another guess where git might be located. After searching PATH the last fallback is the directory in which git-gui is installed. This is a good guess for a sane installation.

Thanks.

Signature · 1 line
Shawn.