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

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

From
Steffen Prohaska <prohaska@zib.de>
Date
Oct 6, 2007, 09:36 UTC
Message-ID
<11916634041243-git-send-email-prohaska@zib.de>

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?

Signed-off-by: Steffen Prohaska <prohaska@zib.de>
---
 git-gui/git-gui.sh |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
index 3f5927f..bb1e7f3 100755
--- a/git-gui/git-gui.sh
+++ b/git-gui/git-gui.sh
@@ -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) :]
-- 
1.5.3.mingw.1.105.ga0fd0
Next: Shawn O. Pearce
Message 1 of 2 in “git-gui: try to locate git in same directory as git-gui (on Windows)”
  1. git-gui: try to locate git in same directory as git-gui (on Windows)Steffen Prohaska, Oct 6, 2007
  2. Shawn O. PearceOct 7, 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.