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

[PATCH] git-gui: Make git-gui lib dir configurable at runtime

From
David Turner <dturner@twopensource.com>
Date
Jul 21, 2014, 18:20 UTC
Message-ID
<1405966809-30882-1-git-send-email-dturner@twitter.com>

Introduce the GIT_GUI_LIB_DIR environment variable, to tell git-gui where to look for TCL libs. This allows a git-gui which has been built with a prefix of /foo to be run out of directory /bar. This is the equivalent of GIT_EXEC_PATH or GITPERLLIB but for git-gui's TCL libraries.

Signed-off-by: David Turner <dturner@twitter.com>
---
 git-gui/Makefile   | 3 ++-
 git-gui/git-gui.sh | 6 +++++-
 2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/git-gui/Makefile b/git-gui/Makefile
index cde8b2e..56bf9e2 100644
--- a/git-gui/Makefile
+++ b/git-gui/Makefile
@@ -177,7 +177,8 @@ git-gui: GIT-VERSION-FILE GIT-GUI-VARS
 	echo then >>$@+ && \
 	echo '	'echo \'git-gui version '$(GITGUI_VERSION)'\' >>$@+ && \
 	echo else >>$@+ && \
-	echo '	'exec \''$(libdir_SQ)/Git Gui.app/Contents/MacOS/$(subst \,,$(TKEXECUTABLE))'\' \
+	echo '	libdir="$$(GIT_GUI_LIB_DIR:-$(libdir_SQ))"' >>$@+ && \
+	echo '	'exec \"'$$libdir/Git Gui.app/Contents/MacOS/$(subst \,,$(TKEXECUTABLE))'\" \
 		'"$$0" "$$@"' >>$@+ && \
 	echo fi >>$@+ && \
 	chmod +x $@+ && \
diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
index b186329..6cbb36e 100755
--- a/git-gui/git-gui.sh
+++ b/git-gui/git-gui.sh
@@ -49,7 +49,11 @@ catch {rename send {}} ; # What an evil concept...
 ##
 ## locate our library
 
-set oguilib {@@GITGUI_LIBDIR@@}
+if { [info exists ::env(GIT_GUI_LIB_DIR) ] } {
+	set oguilib $::env(GIT_GUI_LIB_DIR)
+} else {
+	set oguilib {@@GITGUI_LIBDIR@@}
+}
 set oguirel {@@GITGUI_RELATIVE@@}
 if {$oguirel eq {1}} {
 	set oguilib [file dirname [file normalize $argv0]]
-- 
1.9.1
Next: Junio C Hamano
Message 1 of 5 in “git-gui: Make git-gui lib dir configurable at runtime”
  1. git-gui: Make git-gui lib dir configurable at runtimeDavid Turner, Jul 21, 2014
  2. Junio C HamanoJul 21, 2014
  3. David TurnerJul 21, 2014
  4. Pat ThoytsAug 10, 2014
  5. Junio C HamanoAug 12, 2014

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.