Skip to content

Commit e8a1228

Browse files
committed
Merge git://git.kernel.org/pub/scm/gitk/gitk
* git://git.kernel.org/pub/scm/gitk/gitk: gitk: Display dirty submodules correctly gitk: Fix display of copyright symbol gitk: Add emacs editor variable block gitk: Avoid calling tk_setPalette on Windows gitk: Don't clobber "Remember this view" setting gitk: Add comments to explain encode_view_opts and decode_view_opts gitk: Use consistent font for all text input fields gitk: Set the font for all listbox widgets gitk: Set the font for all spinbox widgets gitk: Remove forced use of sans-serif font gitk: Add Ctrl-W shortcut for closing the active window
2 parents 77bc694 + a1d383c commit e8a1228

File tree

9 files changed

+60
-44
lines changed

9 files changed

+60
-44
lines changed

gitk-git/gitk

Lines changed: 44 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1877,8 +1877,11 @@ proc setoptions {} {
18771877
option add *Menubutton.font uifont startupFile
18781878
option add *Label.font uifont startupFile
18791879
option add *Message.font uifont startupFile
1880-
option add *Entry.font uifont startupFile
1880+
option add *Entry.font textfont startupFile
1881+
option add *Text.font textfont startupFile
18811882
option add *Labelframe.font uifont startupFile
1883+
option add *Spinbox.font textfont startupFile
1884+
option add *Listbox.font mainfont startupFile
18821885
}
18831886

18841887
# Make a menu and submenus.
@@ -2174,7 +2177,7 @@ proc makewindow {} {
21742177
set findstring {}
21752178
set fstring .tf.lbar.findstring
21762179
lappend entries $fstring
2177-
${NS}::entry $fstring -width 30 -font textfont -textvariable findstring
2180+
${NS}::entry $fstring -width 30 -textvariable findstring
21782181
trace add variable findstring write find_change
21792182
set findtype [mc "Exact"]
21802183
set findtypemenu [makedroplist .tf.lbar.findtype \
@@ -2217,7 +2220,7 @@ proc makewindow {} {
22172220
pack .bleft.top.search -side left -padx 5
22182221
set sstring .bleft.top.sstring
22192222
set searchstring ""
2220-
${NS}::entry $sstring -width 20 -font textfont -textvariable searchstring
2223+
${NS}::entry $sstring -width 20 -textvariable searchstring
22212224
lappend entries $sstring
22222225
trace add variable searchstring write incrsearch
22232226
pack $sstring -side left -expand 1 -fill x
@@ -2229,7 +2232,7 @@ proc makewindow {} {
22292232
-command changediffdisp -variable diffelide -value {1 0}
22302233
${NS}::label .bleft.mid.labeldiffcontext -text " [mc "Lines of context"]: "
22312234
pack .bleft.mid.diff .bleft.mid.old .bleft.mid.new -side left
2232-
spinbox .bleft.mid.diffcontext -width 5 -font textfont \
2235+
spinbox .bleft.mid.diffcontext -width 5 \
22332236
-from 0 -increment 1 -to 10000000 \
22342237
-validate all -validatecommand "diffcontextvalidate %P" \
22352238
-textvariable diffcontextstring
@@ -2383,6 +2386,8 @@ proc makewindow {} {
23832386
}
23842387
bindall <$::BM> "canvscan mark %W %x %y"
23852388
bindall <B$::BM-Motion> "canvscan dragto %W %x %y"
2389+
bind all <$M1B-Key-w> {destroy [winfo toplevel %W]}
2390+
bind . <$M1B-Key-w> doquit
23862391
bindkey <Home> selfirstline
23872392
bindkey <End> sellastline
23882393
bind . <Key-Up> "selnextline -1"
@@ -2782,7 +2787,7 @@ proc about {} {
27822787
message $w.m -text [mc "
27832788
Gitk - a commit viewer for git
27842789
2785-
Copyright © 2005-2009 Paul Mackerras
2790+
Copyright \u00a9 2005-2010 Paul Mackerras
27862791
27872792
Use and redistribute under the terms of the GNU General Public License"] \
27882793
-justify center -aspect 400 -border 2 -bg white -relief groove
@@ -2814,6 +2819,7 @@ proc keys {} {
28142819
[mc "Gitk key bindings:"]
28152820
28162821
[mc "<%s-Q> Quit" $M1T]
2822+
[mc "<%s-W> Close window" $M1T]
28172823
[mc "<Home> Move to first commit"]
28182824
[mc "<End> Move to last commit"]
28192825
[mc "<Up>, p, i Move up one commit"]
@@ -3805,10 +3811,10 @@ proc newview {ishighlight} {
38053811
raise $top
38063812
return
38073813
}
3814+
decode_view_opts $nextviewnum $revtreeargs
38083815
set newviewname($nextviewnum) "[mc "View"] $nextviewnum"
38093816
set newviewopts($nextviewnum,perm) 0
38103817
set newviewopts($nextviewnum,cmd) $viewargscmd($curview)
3811-
decode_view_opts $nextviewnum $revtreeargs
38123818
vieweditor $top $nextviewnum [mc "Gitk view definition"]
38133819
}
38143820

@@ -3845,6 +3851,7 @@ set known_view_options {
38453851
{cmd t50= + {} {mc "Command to generate more commits to include:"}}
38463852
}
38473853

3854+
# Convert $newviewopts($n, ...) into args for git log.
38483855
proc encode_view_opts {n} {
38493856
global known_view_options newviewopts
38503857

@@ -3878,6 +3885,7 @@ proc encode_view_opts {n} {
38783885
return [concat $rargs [shellsplit $newviewopts($n,args)]]
38793886
}
38803887

3888+
# Fill $newviewopts($n, ...) based on args for git log.
38813889
proc decode_view_opts {n view_args} {
38823890
global known_view_options newviewopts
38833891

@@ -3960,10 +3968,10 @@ proc editview {} {
39603968
raise $top
39613969
return
39623970
}
3971+
decode_view_opts $curview $viewargs($curview)
39633972
set newviewname($curview) $viewname($curview)
39643973
set newviewopts($curview,perm) $viewperm($curview)
39653974
set newviewopts($curview,cmd) $viewargscmd($curview)
3966-
decode_view_opts $curview $viewargs($curview)
39673975
vieweditor $top $curview "[mc "Gitk: edit view"] $viewname($curview)"
39683976
}
39693977

@@ -4037,7 +4045,7 @@ proc vieweditor {top n title} {
40374045
} elseif {$type eq "path"} {
40384046
${NS}::label $top.l -text $title
40394047
pack $top.l -in $top -side top -pady [list 3 0] -anchor w -padx 3
4040-
text $top.t -width 40 -height 5 -background $bgcolor -font uifont
4048+
text $top.t -width 40 -height 5 -background $bgcolor
40414049
if {[info exists viewfiles($n)]} {
40424050
foreach f $viewfiles($n) {
40434051
$top.t insert end $f
@@ -7501,7 +7509,7 @@ proc getblobdiffs {ids} {
75017509
global ignorespace
75027510
global limitdiffs vfilelimit curview
75037511
global diffencoding targetline diffnparents
7504-
global git_version
7512+
global git_version currdiffsubmod
75057513

75067514
set textconv {}
75077515
if {[package vcompare $git_version "1.6.1"] >= 0} {
@@ -7528,6 +7536,7 @@ proc getblobdiffs {ids} {
75287536
set diffencoding [get_path_encoding {}]
75297537
fconfigure $bdf -blocking 0 -encoding binary -eofchar {}
75307538
set blobdifffd($ids) $bdf
7539+
set currdiffsubmod ""
75317540
filerun $bdf [list getblobdiffline $bdf $diffids]
75327541
}
75337542

@@ -7598,7 +7607,7 @@ proc getblobdiffline {bdf ids} {
75987607
global diffnexthead diffnextnote difffilestart
75997608
global ctext_file_names ctext_file_lines
76007609
global diffinhdr treediffs mergemax diffnparents
7601-
global diffencoding jump_to_here targetline diffline
7610+
global diffencoding jump_to_here targetline diffline currdiffsubmod
76027611

76037612
set nr 0
76047613
$ctext conf -state normal
@@ -7679,19 +7688,30 @@ proc getblobdiffline {bdf ids} {
76797688

76807689
} elseif {![string compare -length 10 "Submodule " $line]} {
76817690
# start of a new submodule
7682-
if {[string compare [$ctext get "end - 4c" end] "\n \n\n"]} {
7691+
if {[regexp -indices "\[0-9a-f\]+\\.\\." $line nameend]} {
7692+
set fname [string range $line 10 [expr [lindex $nameend 0] - 2]]
7693+
} else {
7694+
set fname [string range $line 10 [expr [string first "contains " $line] - 2]]
7695+
}
7696+
if {$currdiffsubmod != $fname} {
76837697
$ctext insert end "\n"; # Add newline after commit message
76847698
}
76857699
set curdiffstart [$ctext index "end - 1c"]
76867700
lappend ctext_file_names ""
7687-
set fname [string range $line 10 [expr [string last " " $line] - 1]]
7688-
lappend ctext_file_lines $fname
7689-
makediffhdr $fname $ids
7690-
$ctext insert end "\n$line\n" filesep
7701+
if {$currdiffsubmod != $fname} {
7702+
lappend ctext_file_lines $fname
7703+
makediffhdr $fname $ids
7704+
set currdiffsubmod $fname
7705+
$ctext insert end "\n$line\n" filesep
7706+
} else {
7707+
$ctext insert end "$line\n" filesep
7708+
}
76917709
} elseif {![string compare -length 3 " >" $line]} {
7710+
set $currdiffsubmod ""
76927711
set line [encoding convertfrom $diffencoding $line]
76937712
$ctext insert end "$line\n" dresult
76947713
} elseif {![string compare -length 3 " <" $line]} {
7714+
set $currdiffsubmod ""
76957715
set line [encoding convertfrom $diffencoding $line]
76967716
$ctext insert end "$line\n" d0
76977717
} elseif {$diffinhdr} {
@@ -8527,7 +8547,7 @@ proc do_cmp_commits {a b} {
85278547
}
85288548

85298549
proc diffcommits {a b} {
8530-
global diffcontext diffids blobdifffd diffinhdr
8550+
global diffcontext diffids blobdifffd diffinhdr currdiffsubmod
85318551

85328552
set tmpdir [gitknewtmpdir]
85338553
set fna [file join $tmpdir "commit-[string range $a 0 7]"]
@@ -8548,6 +8568,7 @@ proc diffcommits {a b} {
85488568
set diffids [list commits $a $b]
85498569
set blobdifffd($diffids) $fd
85508570
set diffinhdr 0
8571+
set currdiffsubmod ""
85518572
filerun $fd [list getblobdiffline $fd $diffids]
85528573
}
85538574

@@ -10528,7 +10549,6 @@ proc mkfontdisp {font top which} {
1052810549
set fontpref($font) [set $font]
1052910550
${NS}::button $top.${font}but -text $which \
1053010551
-command [list choosefont $font $which]
10531-
if {!$use_ttk} {$top.${font}but configure -font optionfont}
1053210552
${NS}::label $top.$font -relief flat -font $font \
1053310553
-text $fontattr($font,family) -justify left
1053410554
grid x $top.${font}but $top.$font -sticky w
@@ -10791,15 +10811,6 @@ proc doprefs {} {
1079110811
mkfontdisp textfont $top [mc "Diff display font"]
1079210812
mkfontdisp uifont $top [mc "User interface font"]
1079310813

10794-
if {!$use_ttk} {
10795-
foreach w {maxpctl maxwidthl showlocal autoselect tabstopl ntag
10796-
ldiff lattr extdifff.l extdifff.b bgbut fgbut
10797-
diffoldbut diffnewbut hunksepbut markbgbut selbgbut
10798-
want_ttk ttk_note} {
10799-
$top.$w configure -font optionfont
10800-
}
10801-
}
10802-
1080310814
${NS}::frame $top.buts
1080410815
${NS}::button $top.buts.ok -text [mc "OK"] -command prefsok -default active
1080510816
${NS}::button $top.buts.can -text [mc "Cancel"] -command prefscan -default normal
@@ -10849,6 +10860,7 @@ proc setselbg {c} {
1084910860
# radiobuttons look bad. This chooses white for selectColor if the
1085010861
# background color is light, or black if it is dark.
1085110862
proc setui {c} {
10863+
if {[tk windowingsystem] eq "win32"} { return }
1085210864
set bg [winfo rgb . $c]
1085310865
set selc black
1085410866
if {[lindex $bg 0] + 1.5 * [lindex $bg 1] + 0.5 * [lindex $bg 2] > 100000} {
@@ -11411,8 +11423,6 @@ namespace import ::msgcat::mc
1141111423

1141211424
catch {source ~/.gitk}
1141311425

11414-
font create optionfont -family sans-serif -size -12
11415-
1141611426
parsefont mainfont $mainfont
1141711427
eval font create mainfont [fontflags mainfont]
1141811428
eval font create mainfontbold [fontflags mainfont 1]
@@ -11613,3 +11623,9 @@ if {[tk windowingsystem] eq "win32"} {
1161311623
}
1161411624

1161511625
getcommits {}
11626+
11627+
# Local variables:
11628+
# mode: tcl
11629+
# indent-tabs-mode: t
11630+
# tab-width: 8
11631+
# End:

gitk-git/po/de.po

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,14 +334,14 @@ msgid ""
334334
"\n"
335335
"Gitk - a commit viewer for git\n"
336336
"\n"
337-
"Copyright ©9 2005-2009 Paul Mackerras\n"
337+
"Copyright \\u00a9 2005-2010 Paul Mackerras\n"
338338
"\n"
339339
"Use and redistribute under the terms of the GNU General Public License"
340340
msgstr ""
341341
"\n"
342342
"Gitk - eine Visualisierung der Git-Historie\n"
343343
"\n"
344-
"Copyright © 2005-2009 Paul Mackerras\n"
344+
"Copyright \\u00a9 2005-2010 Paul Mackerras\n"
345345
"\n"
346346
"Benutzung und Weiterverbreitung gemäß den Bedingungen der GNU General Public License"
347347

gitk-git/po/es.po

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,14 +281,14 @@ msgid ""
281281
"\n"
282282
"Gitk - a commit viewer for git\n"
283283
"\n"
284-
"Copyright © 2005-2008 Paul Mackerras\n"
284+
"Copyright \\u00a9 2005-2010 Paul Mackerras\n"
285285
"\n"
286286
"Use and redistribute under the terms of the GNU General Public License"
287287
msgstr ""
288288
"\n"
289289
"Gitk - un visualizador de revisiones para git\n"
290290
"\n"
291-
"Copyright © 2005-2008 Paul Mackerras\n"
291+
"Copyright \\u00a9 2005-2010 Paul Mackerras\n"
292292
"\n"
293293
"Uso y redistribución permitidos según los términos de la Licencia Pública "
294294
"General de GNU (GNU GPL)"

gitk-git/po/fr.po

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,14 +334,14 @@ msgid ""
334334
"\n"
335335
"Gitk - a commit viewer for git\n"
336336
"\n"
337-
"Copyright © 2005-2008 Paul Mackerras\n"
337+
"Copyright \\u00a9 2005-2010 Paul Mackerras\n"
338338
"\n"
339339
"Use and redistribute under the terms of the GNU General Public License"
340340
msgstr ""
341341
"\n"
342342
"Gitk - visualisateur de commit pour git\n"
343343
"\n"
344-
"Copyright © 2005-2008 Paul Mackerras\n"
344+
"Copyright \\u00a9 2005-2010 Paul Mackerras\n"
345345
"\n"
346346
"Utilisation et redistribution soumises aux termes de la GNU General Public "
347347
"License"

gitk-git/po/hu.po

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,14 +333,14 @@ msgid ""
333333
"\n"
334334
"Gitk - a commit viewer for git\n"
335335
"\n"
336-
"Copyright ©9 2005-2009 Paul Mackerras\n"
336+
"Copyright \\u00a9 2005-2010 Paul Mackerras\n"
337337
"\n"
338338
"Use and redistribute under the terms of the GNU General Public License"
339339
msgstr ""
340340
"\n"
341341
"Gitk - commit nézegető a githez\n"
342342
"\n"
343-
"Szerzői jog ©9 2005-2009 Paul Mackerras\n"
343+
"Szerzői jog \\u00a9 2005-2010 Paul Mackerras\n"
344344
"\n"
345345
"Használd és terjeszd a GNU General Public License feltételei mellett"
346346

gitk-git/po/it.po

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,14 +334,14 @@ msgid ""
334334
"\n"
335335
"Gitk - a commit viewer for git\n"
336336
"\n"
337-
"Copyright © 2005-2009 Paul Mackerras\n"
337+
"Copyright \\u00a9 2005-2010 Paul Mackerras\n"
338338
"\n"
339339
"Use and redistribute under the terms of the GNU General Public License"
340340
msgstr ""
341341
"\n"
342342
"Gitk - un visualizzatore di revisioni per git\n"
343343
"\n"
344-
"Copyright © 2005-2009 Paul Mackerras\n"
344+
"Copyright \\u00a9 2005-2010 Paul Mackerras\n"
345345
"\n"
346346
"Utilizzo e redistribuzione permessi sotto i termini della GNU General Public "
347347
"License"

gitk-git/po/ja.po

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,14 +335,14 @@ msgid ""
335335
"\n"
336336
"Gitk - a commit viewer for git\n"
337337
"\n"
338-
"Copyright © 2005-2008 Paul Mackerras\n"
338+
"Copyright \\u00a9 2005-2010 Paul Mackerras\n"
339339
"\n"
340340
"Use and redistribute under the terms of the GNU General Public License"
341341
msgstr ""
342342
"\n"
343343
"Gitk - gitコミットビューア\n"
344344
"\n"
345-
"Copyright © 2005-2008 Paul Mackerras\n"
345+
"Copyright \\u00a9 2005-2010 Paul Mackerras\n"
346346
"\n"
347347
"使用および再配布は GNU General Public License に従ってください"
348348

gitk-git/po/ru.po

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,14 +313,14 @@ msgid ""
313313
"\n"
314314
"Gitk - a commit viewer for git\n"
315315
"\n"
316-
"Copyright © 2005-2008 Paul Mackerras\n"
316+
"Copyright \\u00a9 2005-2010 Paul Mackerras\n"
317317
"\n"
318318
"Use and redistribute under the terms of the GNU General Public License"
319319
msgstr ""
320320
"\n"
321321
"Gitk - программа просмотра истории репозиториев Git\n"
322322
"\n"
323-
"Copyright (c) 2005-2008 Paul Mackerras\n"
323+
"Copyright \\u00a9 2005-2010 Paul Mackerras\n"
324324
"\n"
325325
"Использование и распространение согласно условиям GNU General Public License"
326326

gitk-git/po/sv.po

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,14 +334,14 @@ msgid ""
334334
"\n"
335335
"Gitk - a commit viewer for git\n"
336336
"\n"
337-
"Copyright ©9 2005-2009 Paul Mackerras\n"
337+
"Copyright \\u00a9 2005-2010 Paul Mackerras\n"
338338
"\n"
339339
"Use and redistribute under the terms of the GNU General Public License"
340340
msgstr ""
341341
"\n"
342342
"Gitk - en incheckningsvisare för git\n"
343343
"\n"
344-
"Copyright © 2005-2009 Paul Mackerras\n"
344+
"Copyright \\u00a9 2005-2010 Paul Mackerras\n"
345345
"\n"
346346
"Använd och vidareförmedla enligt villkoren i GNU General Public License"
347347

0 commit comments

Comments
 (0)