Skip to content

Commit 0f639ab

Browse files
committed
Merge git://repo.or.cz/git-gui
* git://repo.or.cz/git-gui: git-gui: Request blame metadata in utf-8. git-gui: Add the Show SSH Key item to the clone dialog. git-gui: Fix focus transition in the blame viewer.
2 parents 171d766 + f75c8b3 commit 0f639ab

File tree

4 files changed

+41
-17
lines changed

4 files changed

+41
-17
lines changed

git-gui/git-gui.sh

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -997,6 +997,17 @@ citool {
997997
}
998998
}
999999
1000+
######################################################################
1001+
##
1002+
## execution environment
1003+
1004+
set have_tk85 [expr {[package vcompare $tk_version "8.5"] >= 0}]
1005+
1006+
# Suggest our implementation of askpass, if none is set
1007+
if {![info exists env(SSH_ASKPASS)]} {
1008+
set env(SSH_ASKPASS) [gitexec git-gui--askpass]
1009+
}
1010+
10001011
######################################################################
10011012
##
10021013
## repository setup
@@ -1073,15 +1084,6 @@ set selected_commit_type new
10731084
set nullid "0000000000000000000000000000000000000000"
10741085
set nullid2 "0000000000000000000000000000000000000001"
10751086
1076-
set have_tk85 [expr {[package vcompare $tk_version "8.5"] >= 0}]
1077-
1078-
######################################################################
1079-
1080-
# Suggest our implementation of askpass, if none is set
1081-
if {![info exists env(SSH_ASKPASS)]} {
1082-
set env(SSH_ASKPASS) [gitexec git-gui--askpass]
1083-
}
1084-
10851087
######################################################################
10861088
##
10871089
## task management

git-gui/lib/blame.tcl

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ constructor new {i_commit i_path i_jump} {
321321
tk_popup $w.ctxm %X %Y
322322
"
323323
bind $i <Shift-Tab> "[list focus $w_cviewer];break"
324-
bind $i <Tab> "[list focus $w_cviewer];break"
324+
bind $i <Tab> "[cb _focus_search $w_cviewer];break"
325325
}
326326

327327
foreach i [concat $w_columns $w_cviewer] {
@@ -337,10 +337,10 @@ constructor new {i_commit i_path i_jump} {
337337
bind $i <Control-Key-f> {catch {%W yview scroll 1 pages};break}
338338
}
339339

340-
bind $w_cviewer <Shift-Tab> "[list focus $w_file];break"
340+
bind $w_cviewer <Shift-Tab> "[cb _focus_search $w_file];break"
341341
bind $w_cviewer <Tab> "[list focus $w_file];break"
342-
bind $w_cviewer <Button-1> [list focus $w_cviewer]
343-
bind $w_file <Visibility> [list focus $w_file]
342+
bind $w_cviewer <Button-1> [list focus $w_cviewer]
343+
bind $w_file <Visibility> [cb _focus_search $w_file]
344344
bind $top <F7> [list searchbar::show $finder]
345345
bind $top <Escape> [list searchbar::hide $finder]
346346
bind $top <F3> [list searchbar::find_next $finder]
@@ -382,6 +382,14 @@ constructor new {i_commit i_path i_jump} {
382382
_load $this $i_jump
383383
}
384384

385+
method _focus_search {win} {
386+
if {[searchbar::visible $finder]} {
387+
focus [searchbar::editor $finder]
388+
} else {
389+
focus $win
390+
}
391+
}
392+
385393
method _handle_destroy {win} {
386394
if {$win eq $w} {
387395
_kill $this
@@ -551,7 +559,7 @@ method _read_file {fd jump} {
551559
} ifdeleted { catch {close $fd} }
552560

553561
method _exec_blame {cur_w cur_d options cur_s} {
554-
lappend options --incremental
562+
lappend options --incremental --encoding=utf-8
555563
if {$commit eq {}} {
556564
lappend options --contents $path
557565
} else {

git-gui/lib/choose_repository.tcl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,18 @@ constructor pick {} {
4343
$w.mbar.apple add command \
4444
-label [mc "About %s" [appname]] \
4545
-command do_about
46+
$w.mbar.apple add command \
47+
-label [mc "Show SSH Key"] \
48+
-command do_ssh_key
4649
} else {
4750
$w.mbar add cascade -label [mc Help] -menu $w.mbar.help
4851
menu $w.mbar.help
4952
$w.mbar.help add command \
5053
-label [mc "About %s" [appname]] \
5154
-command do_about
55+
$w.mbar.help add command \
56+
-label [mc "Show SSH Key"] \
57+
-command do_ssh_key
5258
}
5359

5460
wm protocol $top WM_DELETE_WINDOW exit

git-gui/lib/search.tcl

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ constructor new {i_w i_text args} {
1919

2020
frame $w
2121
label $w.l -text [mc Find:]
22+
entry $w.ent -textvariable ${__this}::searchstring -background lightgreen
2223
button $w.bn -text [mc Next] -command [cb find_next]
2324
button $w.bp -text [mc Prev] -command [cb find_prev]
2425
checkbutton $w.cs -text [mc Case-Sensitive] \
2526
-variable ${__this}::casesensitive -command [cb _incrsearch]
26-
entry $w.ent -textvariable ${__this}::searchstring -background lightgreen
2727
pack $w.l -side left
2828
pack $w.cs -side right
2929
pack $w.bp -side right
@@ -40,19 +40,27 @@ constructor new {i_w i_text args} {
4040
}
4141

4242
method show {} {
43-
if {![winfo ismapped $w]} {
43+
if {![visible $this]} {
4444
grid $w
4545
}
4646
focus -force $w.ent
4747
}
4848

4949
method hide {} {
50-
if {[winfo ismapped $w]} {
50+
if {[visible $this]} {
5151
focus $ctext
5252
grid remove $w
5353
}
5454
}
5555

56+
method visible {} {
57+
return [winfo ismapped $w]
58+
}
59+
60+
method editor {} {
61+
return $w.ent
62+
}
63+
5664
method _get_new_anchor {} {
5765
# use start of selection if it is visible,
5866
# or the bounds of the visible area

0 commit comments

Comments
 (0)