Skip to content

Commit b833651

Browse files
committed
Merge branch 'maint' of git://repo.or.cz/git-gui into maint
* 'maint' of git://repo.or.cz/git-gui: git-gui: Don't require a .pvcsrc to create Tools/Migrate menu hack git-gui: Don't nice git blame on MSYS as nice is not supported git-gui: Don't require $DISPLAY just to get --version git-gui: Bind Tab/Shift-Tab to cycle between panes in blame git-gui: Correctly install to /usr/bin on Cygwin
2 parents b69ba46 + 7e508eb commit b833651

File tree

3 files changed

+26
-12
lines changed

3 files changed

+26
-12
lines changed

git-gui/Makefile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
77
@$(SHELL_PATH) ./GIT-VERSION-GEN
88
-include GIT-VERSION-FILE
99

10+
uname_O := $(shell sh -c 'uname -o 2>/dev/null || echo not')
11+
1012
SCRIPT_SH = git-gui.sh
1113
GITGUI_BUILT_INS = git-citool
1214
ALL_PROGRAMS = $(GITGUI_BUILT_INS) $(patsubst %.sh,%,$(SCRIPT_SH))
@@ -58,11 +60,15 @@ exedir_SQ = $(subst ','\'',$(exedir))
5860

5961
$(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh
6062
$(QUIET_GEN)rm -f $@ $@+ && \
63+
GITGUI_RELATIVE= && \
6164
if test '$(exedir_SQ)' = '$(libdir_SQ)'; then \
62-
GITGUI_RELATIVE=1; \
65+
if test "$(uname_O)" = Cygwin; \
66+
then GITGUI_RELATIVE= ; \
67+
else GITGUI_RELATIVE=1; \
68+
fi; \
6369
fi && \
6470
sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
65-
-e 's|^exec wish "$$0"|exec $(subst |,'\|',$(TCLTK_PATH_SQ)) "$$0"|' \
71+
-e 's|^ exec wish "$$0"| exec $(subst |,'\|',$(TCLTK_PATH_SQ)) "$$0"|' \
6672
-e 's/@@GITGUI_VERSION@@/$(GITGUI_VERSION)/g' \
6773
-e 's|@@GITGUI_RELATIVE@@|'$$GITGUI_RELATIVE'|' \
6874
-e $$GITGUI_RELATIVE's|@@GITGUI_LIBDIR@@|$(libdir_SQ)|' \

git-gui/git-gui.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
#!/bin/sh
22
# Tcl ignores the next line -*- tcl -*- \
3-
exec wish "$0" -- "$@"
3+
if test "z$*" = zversion \
4+
|| test "z$*" = z--version; \
5+
then \
6+
echo 'git-gui version @@GITGUI_VERSION@@'; \
7+
exit; \
8+
fi; \
9+
exec wish "$0" -- "$@"
410

511
set appvers {@@GITGUI_VERSION@@}
612
set copyright {
@@ -271,11 +277,6 @@ proc tk_optionMenu {w varName args} {
271277
##
272278
## version check
273279

274-
if {{--version} eq $argv || {version} eq $argv} {
275-
puts "git-gui version $appvers"
276-
exit
277-
}
278-
279280
set req_maj 1
280281
set req_min 5
281282

@@ -1544,8 +1545,7 @@ if {[is_MacOSX]} {
15441545

15451546
# -- Tools Menu
15461547
#
1547-
if {[file exists /usr/local/miga/lib/gui-miga]
1548-
&& [file exists .pvcsrc]} {
1548+
if {[is_Cygwin] && [file exists /usr/local/miga/lib/gui-miga]} {
15491549
proc do_miga {} {
15501550
global ui_status_value
15511551
if {![lock_index update]} return

git-gui/lib/blame.tcl

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,8 @@ constructor new {i_commit i_path} {
272272
set cursorW %W
273273
tk_popup $w.ctxm %X %Y
274274
"
275+
bind $i <Shift-Tab> "[list focus $w_cviewer];break"
276+
bind $i <Tab> "[list focus $w_cviewer];break"
275277
}
276278

277279
foreach i [concat $w_columns $w_cviewer] {
@@ -287,8 +289,10 @@ constructor new {i_commit i_path} {
287289
bind $i <Control-Key-f> {catch {%W yview scroll 1 pages};break}
288290
}
289291

292+
bind $w_cviewer <Shift-Tab> "[list focus $w_file];break"
293+
bind $w_cviewer <Tab> "[list focus $w_file];break"
290294
bind $w_cviewer <Button-1> [list focus $w_cviewer]
291-
bind $top <Visibility> [list focus $top]
295+
bind $w_file <Visibility> [list focus $w_file]
292296

293297
grid configure $w.header -sticky ew
294298
grid configure $w.file_pane -sticky nsew
@@ -483,7 +487,11 @@ method _read_file {fd jump} {
483487
} ifdeleted { catch {close $fd} }
484488

485489
method _exec_blame {cur_w cur_d options cur_s} {
486-
set cmd [list nice git blame]
490+
set cmd [list]
491+
if {![is_Windows] || [is_Cygwin]} {
492+
lappend cmd nice
493+
}
494+
lappend cmd git blame
487495
set cmd [concat $cmd $options]
488496
lappend cmd --incremental
489497
if {$commit eq {}} {

0 commit comments

Comments
 (0)