Skip to content

Commit a3b3ae3

Browse files
dturner-twpatthoyts
authored andcommitted
git-gui: Make git-gui lib dir configurable at runime
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 <[email protected]> Signed-off-by: Pat Thoyts <[email protected]>
1 parent 8871820 commit a3b3ae3

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,8 @@ git-gui: GIT-VERSION-FILE GIT-GUI-VARS
177177
echo then >>$@+ && \
178178
echo ' 'echo \'git-gui version '$(GITGUI_VERSION)'\' >>$@+ && \
179179
echo else >>$@+ && \
180-
echo ' 'exec \''$(libdir_SQ)/Git Gui.app/Contents/MacOS/$(subst \,,$(TKEXECUTABLE))'\' \
180+
echo ' libdir="$${GIT_GUI_LIB_DIR:-$(libdir_SQ)}"' >>$@+ && \
181+
echo ' 'exec \"'$$libdir/Git Gui.app/Contents/MacOS/$(subst \,,$(TKEXECUTABLE))'\" \
181182
'"$$0" "$$@"' >>$@+ && \
182183
echo fi >>$@+ && \
183184
chmod +x $@+ && \

git-gui.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,11 @@ catch {rename send {}} ; # What an evil concept...
4949
##
5050
## locate our library
5151

52-
set oguilib {@@GITGUI_LIBDIR@@}
52+
if { [info exists ::env(GIT_GUI_LIB_DIR) ] } {
53+
set oguilib $::env(GIT_GUI_LIB_DIR)
54+
} else {
55+
set oguilib {@@GITGUI_LIBDIR@@}
56+
}
5357
set oguirel {@@GITGUI_RELATIVE@@}
5458
if {$oguirel eq {1}} {
5559
set oguilib [file dirname [file normalize $argv0]]

macosx/AppMain.tcl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
set gitexecdir {@@gitexecdir@@}
2-
set gitguilib {@@GITGUI_LIBDIR@@}
2+
if { [info exists ::env(GIT_GUI_LIB_DIR) ] } {
3+
set gitguilib $::env(GIT_GUI_LIB_DIR)
4+
} else {
5+
set gitguilib {@@GITGUI_LIBDIR@@}
6+
}
7+
38
set env(PATH) "$gitexecdir:$env(PATH)"
49

510
if {[string first -psn [lindex $argv 0]] == 0} {

0 commit comments

Comments
 (0)