Skip to content

Commit 5f5dbd7

Browse files
committed
Merge branch 'master' of git://repo.or.cz/git-gui
* 'master' of git://repo.or.cz/git-gui: git-gui: Use vi-like keys in merge dialog git-gui: Include commit id/subject in merge choices git-gui: Show all possible branches for merge git-gui: Move merge support into a namespace git-gui: Allow vi keys to scroll the diff/blame regions git-gui: Move console procs into their own namespace git-gui: Refactor into multiple files to save my sanity git-gui: Track our own embedded values and rebuild when they change git-gui: Refactor to use our git proc more often git-gui: Use option database defaults to set the font git-gui: Cleanup common font handling for font_ui git-gui: Correct line wrapping for too many branch message git-gui: Warn users before making an octopus merge git-gui: Include the subject in the status bar after commit Also perform an evil merge change to update Git's main Makefile to pass the proper options down into git-gui now that it depends on reasonable values for 'sharedir' and 'TCL_PATH'. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2 parents 3082acf + ebcaada commit 5f5dbd7

File tree

18 files changed

+4147
-4159
lines changed

18 files changed

+4147
-4159
lines changed

Makefile

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,11 @@ all::
114114
#
115115
# Define NO_TCLTK if you do not want Tcl/Tk GUI.
116116
#
117-
# The TCLTK_PATH variable governs the location of the Tck/Tk interpreter.
117+
# The TCL_PATH variable governs the location of the Tcl interpreter
118+
# used to optimize git-gui for your system. Only used if NO_TCLTK
119+
# is not set. Defaults to the bare 'tclsh'.
120+
#
121+
# The TCLTK_PATH variable governs the location of the Tcl/Tk interpreter.
118122
# If not set it defaults to the bare 'wish'. If it is set to the empty
119123
# string then NO_TCLTK will be forced (this is used by configure script).
120124
#
@@ -140,7 +144,8 @@ STRIP ?= strip
140144
prefix = $(HOME)
141145
bindir = $(prefix)/bin
142146
gitexecdir = $(bindir)
143-
template_dir = $(prefix)/share/git-core/templates/
147+
sharedir = $(prefix)/share/
148+
template_dir = $(sharedir)/git-core/templates/
144149
ifeq ($(prefix),/usr)
145150
sysconfdir = /etc
146151
else
@@ -165,15 +170,18 @@ GITWEB_FAVICON = git-favicon.png
165170
GITWEB_SITE_HEADER =
166171
GITWEB_SITE_FOOTER =
167172

168-
export prefix bindir gitexecdir template_dir sysconfdir
173+
export prefix bindir gitexecdir sharedir template_dir sysconfdir
169174

170175
CC = gcc
171176
AR = ar
172177
TAR = tar
173178
INSTALL = install
174179
RPMBUILD = rpmbuild
180+
TCL_PATH = tclsh
175181
TCLTK_PATH = wish
176182

183+
export TCL_PATH TCLTK_PATH
184+
177185
# sparse is architecture-neutral, which means that we need to tell it
178186
# explicitly what architecture to check for. Fix this up for yours..
179187
SPARSE_FLAGS = -D__BIG_ENDIAN__ -D__powerpc__
@@ -713,7 +721,7 @@ endif
713721

714722
all::
715723
ifndef NO_TCLTK
716-
$(QUIET_SUBDIR0)git-gui $(QUIET_SUBDIR1) TCLTK_PATH='$(TCLTK_PATH_SQ)' all
724+
$(QUIET_SUBDIR0)git-gui $(QUIET_SUBDIR1) all
717725
endif
718726
$(QUIET_SUBDIR0)perl $(QUIET_SUBDIR1) PERL_PATH='$(PERL_PATH_SQ)' prefix='$(prefix_SQ)' all
719727
$(QUIET_SUBDIR0)templates $(QUIET_SUBDIR1)

git-gui/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
GIT-VERSION-FILE
2+
GIT-GUI-VARS
23
git-citool
34
git-gui
5+
lib/tclIndex

git-gui/Makefile

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
1010
SCRIPT_SH = git-gui.sh
1111
GITGUI_BUILT_INS = git-citool
1212
ALL_PROGRAMS = $(GITGUI_BUILT_INS) $(patsubst %.sh,%,$(SCRIPT_SH))
13+
ALL_LIBFILES = $(wildcard lib/*.tcl)
1314

1415
ifndef SHELL_PATH
1516
SHELL_PATH = /bin/sh
@@ -19,15 +20,21 @@ ifndef gitexecdir
1920
gitexecdir := $(shell git --exec-path)
2021
endif
2122

23+
ifndef sharedir
24+
sharedir := $(dir $(gitexecdir))/share
25+
endif
26+
2227
ifndef INSTALL
2328
INSTALL = install
2429
endif
2530

2631
ifndef V
2732
QUIET_GEN = @echo ' ' GEN $@;
2833
QUIET_BUILT_IN = @echo ' ' BUILTIN $@;
34+
QUIET_INDEX = @echo ' ' INDEX $(dir $@);
2935
endif
3036

37+
TCL_PATH ?= tclsh
3138
TCLTK_PATH ?= wish
3239

3340
ifeq ($(findstring $(MAKEFLAGS),s),s)
@@ -40,34 +47,59 @@ gitexecdir_SQ = $(subst ','\'',$(gitexecdir))
4047
SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
4148
TCLTK_PATH_SQ = $(subst ','\'',$(TCLTK_PATH))
4249

50+
libdir ?= $(sharedir)/git-gui/lib
51+
libdir_SQ = $(subst ','\'',$(libdir))
52+
4353
$(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh
4454
$(QUIET_GEN)rm -f $@ $@+ && \
4555
sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
4656
-e 's|^exec wish "$$0"|exec $(subst |,'\|',$(TCLTK_PATH_SQ)) "$$0"|' \
4757
-e 's/@@GITGUI_VERSION@@/$(GITGUI_VERSION)/g' \
58+
-e 's|@@GITGUI_LIBDIR@@|$(libdir_SQ)|' \
4859
$@.sh >$@+ && \
4960
chmod +x $@+ && \
5061
mv $@+ $@
5162

5263
$(GITGUI_BUILT_INS): git-gui
5364
$(QUIET_BUILT_IN)rm -f $@ && ln git-gui $@
5465

66+
lib/tclIndex: $(ALL_LIBFILES)
67+
$(QUIET_INDEX)echo auto_mkindex lib '*.tcl' | $(TCL_PATH)
68+
5569
# These can record GITGUI_VERSION
56-
$(patsubst %.sh,%,$(SCRIPT_SH)): GIT-VERSION-FILE
70+
$(patsubst %.sh,%,$(SCRIPT_SH)): GIT-VERSION-FILE GIT-GUI-VARS
71+
72+
TRACK_VARS = \
73+
$(subst ','\'',SHELL_PATH='$(SHELL_PATH_SQ)') \
74+
$(subst ','\'',TCLTK_PATH='$(TCLTK_PATH_SQ)') \
75+
$(subst ','\'',libdir='$(libdir_SQ)') \
76+
#end TRACK_VARS
77+
78+
GIT-GUI-VARS: .FORCE-GIT-GUI-VARS
79+
@VARS='$(TRACK_VARS)'; \
80+
if test x"$$VARS" != x"`cat $@ 2>/dev/null`" ; then \
81+
echo 1>&2 " * new locations or Tcl/Tk interpreter"; \
82+
echo 1>$@ "$$VARS"; \
83+
fi
5784

58-
all:: $(ALL_PROGRAMS)
85+
all:: $(ALL_PROGRAMS) lib/tclIndex
5986

6087
install: all
6188
$(INSTALL) -d -m755 '$(DESTDIR_SQ)$(gitexecdir_SQ)'
6289
$(INSTALL) git-gui '$(DESTDIR_SQ)$(gitexecdir_SQ)'
6390
$(foreach p,$(GITGUI_BUILT_INS), rm -f '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' && ln '$(DESTDIR_SQ)$(gitexecdir_SQ)/git-gui' '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' ;)
91+
$(INSTALL) -d -m755 '$(DESTDIR_SQ)$(libdir_SQ)'
92+
$(INSTALL) -m644 lib/tclIndex '$(DESTDIR_SQ)$(libdir_SQ)'
93+
$(foreach p,$(ALL_LIBFILES), $(INSTALL) -m644 $p '$(DESTDIR_SQ)$(libdir_SQ)' ;)
6494

6595
dist-version:
6696
@mkdir -p $(TARDIR)
6797
@echo $(GITGUI_VERSION) > $(TARDIR)/version
6898

6999
clean::
70-
rm -f $(ALL_PROGRAMS) GIT-VERSION-FILE
100+
rm -f $(ALL_PROGRAMS) lib/tclIndex
101+
rm -f GIT-VERSION-FILE GIT-GUI-VARS
71102

72103
.PHONY: all install dist-version clean
73104
.PHONY: .FORCE-GIT-VERSION-FILE
105+
.PHONY: .FORCE-GIT-GUI-VARS

0 commit comments

Comments
 (0)