Skip to content

Commit c63a3ad

Browse files
author
Junio C Hamano
committed
Merge branch 'maint' of git://repo.or.cz/git-gui into maint
* 'maint' of git://repo.or.cz/git-gui: git-gui: Guess our share/git-gui/lib path at runtime if possible Correct key bindings to Control-<foo> git-gui: Tighten internal pattern match for lib/ directory
2 parents 59d1024 + ea75ee3 commit c63a3ad

File tree

2 files changed

+19
-10
lines changed

2 files changed

+19
-10
lines changed

git-gui/Makefile

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ ifndef gitexecdir
2222
endif
2323

2424
ifndef sharedir
25-
sharedir := $(dir $(gitexecdir))/share
25+
sharedir := $(dir $(gitexecdir))share
2626
endif
2727

2828
ifndef INSTALL
@@ -53,12 +53,19 @@ TCLTK_PATH_SQ = $(subst ','\'',$(TCLTK_PATH))
5353
libdir ?= $(sharedir)/git-gui/lib
5454
libdir_SQ = $(subst ','\'',$(libdir))
5555

56+
exedir = $(dir $(gitexecdir))share/git-gui/lib
57+
exedir_SQ = $(subst ','\'',$(exedir))
58+
5659
$(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh
5760
$(QUIET_GEN)rm -f $@ $@+ && \
61+
if test '$(exedir_SQ)' = '$(libdir_SQ)'; then \
62+
GITGUI_RELATIVE=1; \
63+
fi && \
5864
sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
5965
-e 's|^exec wish "$$0"|exec $(subst |,'\|',$(TCLTK_PATH_SQ)) "$$0"|' \
6066
-e 's/@@GITGUI_VERSION@@/$(GITGUI_VERSION)/g' \
61-
-e 's|@@GITGUI_LIBDIR@@|$(libdir_SQ)|' \
67+
-e 's|@@GITGUI_RELATIVE@@|'$$GITGUI_RELATIVE'|' \
68+
-e $$GITGUI_RELATIVE's|@@GITGUI_LIBDIR@@|$(libdir_SQ)|' \
6269
$@.sh >$@+ && \
6370
chmod +x $@+ && \
6471
mv $@+ $@
@@ -88,6 +95,7 @@ TRACK_VARS = \
8895
$(subst ','\'',SHELL_PATH='$(SHELL_PATH_SQ)') \
8996
$(subst ','\'',TCL_PATH='$(TCL_PATH_SQ)') \
9097
$(subst ','\'',TCLTK_PATH='$(TCLTK_PATH_SQ)') \
98+
$(subst ','\'',gitexecdir='$(gitexecdir_SQ)') \
9199
$(subst ','\'',libdir='$(libdir_SQ)') \
92100
#end TRACK_VARS
93101

git-gui/git-gui.sh

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA}
2525
## configure our library
2626

2727
set oguilib {@@GITGUI_LIBDIR@@}
28-
if {[string match @@* $oguilib]} {
28+
set oguirel {@@GITGUI_RELATIVE@@}
29+
if {$oguirel eq {1}} {
30+
set oguilib [file dirname [file dirname [file normalize $argv0]]]
31+
set oguilib [file join $oguilib share git-gui lib]
32+
} elseif {[string match @@* $oguirel]} {
2933
set oguilib [file join [file dirname [file normalize $argv0]] lib]
3034
}
3135
set idx [file join $oguilib tclIndex]
@@ -55,7 +59,7 @@ if {$idx ne {}} {
5559
} else {
5660
set auto_path [concat [list $oguilib] $auto_path]
5761
}
58-
unset -nocomplain fd idx
62+
unset -nocomplain oguilib oguirel idx fd
5963

6064
if {![catch {set _verbose $env(GITGUI_VERBOSE)}]} {
6165
unset _verbose
@@ -1206,15 +1210,12 @@ foreach class {Button Checkbutton Entry Label
12061210
}
12071211
unset class
12081212

1209-
if {[is_Windows]} {
1210-
set M1B Control
1211-
set M1T Ctrl
1212-
} elseif {[is_MacOSX]} {
1213+
if {[is_MacOSX]} {
12131214
set M1B M1
12141215
set M1T Cmd
12151216
} else {
1216-
set M1B M1
1217-
set M1T M1
1217+
set M1B Control
1218+
set M1T Ctrl
12181219
}
12191220

12201221
proc apply_config {} {

0 commit comments

Comments
 (0)