From decd0a1ea594232f3b84831104257a0225be0085 Mon Sep 17 00:00:00 2001 From: Jens Lehmann Date: Tue, 2 Feb 2010 23:11:28 +0100 Subject: gitk: Add Ctrl-W shortcut for closing the active window To make the user experience between git gui and gitk more homogeneous, use Ctrl-W in gitk for closing the active window. When closing the main window doquit is called for proper cleanup. Signed-off-by: Jens Lehmann Signed-off-by: Paul Mackerras diff --git a/gitk b/gitk index 1f36a3e..50773a3 100755 --- a/gitk +++ b/gitk @@ -2383,6 +2383,8 @@ proc makewindow {} { } bindall <$::BM> "canvscan mark %W %x %y" bindall "canvscan dragto %W %x %y" + bind all <$M1B-Key-w> {destroy [winfo toplevel %W]} + bind . <$M1B-Key-w> doquit bindkey selfirstline bindkey sellastline bind . "selnextline -1" @@ -2814,6 +2816,7 @@ proc keys {} { [mc "Gitk key bindings:"] [mc "<%s-Q> Quit" $M1T] +[mc "<%s-W> Close window" $M1T] [mc " Move to first commit"] [mc " Move to last commit"] [mc ", p, i Move up one commit"] -- cgit v0.10.2-6-g49f6 From 75eb2af0e02b9d38742d04929b1c4da46b8d13c9 Mon Sep 17 00:00:00 2001 From: Mark Hills Date: Wed, 13 Jan 2010 20:40:18 +0000 Subject: gitk: Remove forced use of sans-serif font The X resources set using uifont cover this case. Signed-off-by: Mark Hills Signed-off-by: Paul Mackerras diff --git a/gitk b/gitk index 50773a3..59970af 100755 --- a/gitk +++ b/gitk @@ -10531,7 +10531,6 @@ proc mkfontdisp {font top which} { set fontpref($font) [set $font] ${NS}::button $top.${font}but -text $which \ -command [list choosefont $font $which] - if {!$use_ttk} {$top.${font}but configure -font optionfont} ${NS}::label $top.$font -relief flat -font $font \ -text $fontattr($font,family) -justify left grid x $top.${font}but $top.$font -sticky w @@ -10794,15 +10793,6 @@ proc doprefs {} { mkfontdisp textfont $top [mc "Diff display font"] mkfontdisp uifont $top [mc "User interface font"] - if {!$use_ttk} { - foreach w {maxpctl maxwidthl showlocal autoselect tabstopl ntag - ldiff lattr extdifff.l extdifff.b bgbut fgbut - diffoldbut diffnewbut hunksepbut markbgbut selbgbut - want_ttk ttk_note} { - $top.$w configure -font optionfont - } - } - ${NS}::frame $top.buts ${NS}::button $top.buts.ok -text [mc "OK"] -command prefsok -default active ${NS}::button $top.buts.can -text [mc "Cancel"] -command prefscan -default normal @@ -11414,8 +11404,6 @@ namespace import ::msgcat::mc catch {source ~/.gitk} -font create optionfont -family sans-serif -size -12 - parsefont mainfont $mainfont eval font create mainfont [fontflags mainfont] eval font create mainfontbold [fontflags mainfont 1] -- cgit v0.10.2-6-g49f6 From 0933b04e5204674784b3ff7bcff68b663e633f8b Mon Sep 17 00:00:00 2001 From: Mark Hills Date: Wed, 13 Jan 2010 20:40:19 +0000 Subject: gitk: Set the font for all spinbox widgets Use the X resources to set the font, removing the need to set the font for specific widgets. Signed-off-by: Mark Hills Signed-off-by: Paul Mackerras diff --git a/gitk b/gitk index 59970af..f1e70ad 100755 --- a/gitk +++ b/gitk @@ -1879,6 +1879,7 @@ proc setoptions {} { option add *Message.font uifont startupFile option add *Entry.font uifont startupFile option add *Labelframe.font uifont startupFile + option add *Spinbox.font textfont startupFile } # Make a menu and submenus. @@ -2229,7 +2230,7 @@ proc makewindow {} { -command changediffdisp -variable diffelide -value {1 0} ${NS}::label .bleft.mid.labeldiffcontext -text " [mc "Lines of context"]: " pack .bleft.mid.diff .bleft.mid.old .bleft.mid.new -side left - spinbox .bleft.mid.diffcontext -width 5 -font textfont \ + spinbox .bleft.mid.diffcontext -width 5 \ -from 0 -increment 1 -to 10000000 \ -validate all -validatecommand "diffcontextvalidate %P" \ -textvariable diffcontextstring -- cgit v0.10.2-6-g49f6 From 207ad7b8878caa8b1d09c39ea0754f0192daece5 Mon Sep 17 00:00:00 2001 From: Mark Hills Date: Wed, 13 Jan 2010 20:40:20 +0000 Subject: gitk: Set the font for all listbox widgets This affects the font chooser. Signed-off-by: Mark Hills Signed-off-by: Paul Mackerras diff --git a/gitk b/gitk index f1e70ad..ccfc8dd 100755 --- a/gitk +++ b/gitk @@ -1880,6 +1880,7 @@ proc setoptions {} { option add *Entry.font uifont startupFile option add *Labelframe.font uifont startupFile option add *Spinbox.font textfont startupFile + option add *Listbox.font mainfont startupFile } # Make a menu and submenus. -- cgit v0.10.2-6-g49f6 From b9b142ffa218b50dadad091bd660ba801d0ca5d5 Mon Sep 17 00:00:00 2001 From: Mark Hills Date: Wed, 13 Jan 2010 20:40:22 +0000 Subject: gitk: Use consistent font for all text input fields Instead of setting the font for specific widgets, set the font for the widget type. If themed widgets are not available, this is via the X resources. If themed widgets are available, the theme font is used. The exception is the SHA1 ID which is forced to use the fixed-width font, even where themed widgets are used. Signed-off-by: Mark Hills Signed-off-by: Paul Mackerras diff --git a/gitk b/gitk index ccfc8dd..a47abc1 100755 --- a/gitk +++ b/gitk @@ -1877,7 +1877,8 @@ proc setoptions {} { option add *Menubutton.font uifont startupFile option add *Label.font uifont startupFile option add *Message.font uifont startupFile - option add *Entry.font uifont startupFile + option add *Entry.font textfont startupFile + option add *Text.font textfont startupFile option add *Labelframe.font uifont startupFile option add *Spinbox.font textfont startupFile option add *Listbox.font mainfont startupFile @@ -2176,7 +2177,7 @@ proc makewindow {} { set findstring {} set fstring .tf.lbar.findstring lappend entries $fstring - ${NS}::entry $fstring -width 30 -font textfont -textvariable findstring + ${NS}::entry $fstring -width 30 -textvariable findstring trace add variable findstring write find_change set findtype [mc "Exact"] set findtypemenu [makedroplist .tf.lbar.findtype \ @@ -2219,7 +2220,7 @@ proc makewindow {} { pack .bleft.top.search -side left -padx 5 set sstring .bleft.top.sstring set searchstring "" - ${NS}::entry $sstring -width 20 -font textfont -textvariable searchstring + ${NS}::entry $sstring -width 20 -textvariable searchstring lappend entries $sstring trace add variable searchstring write incrsearch pack $sstring -side left -expand 1 -fill x @@ -4042,7 +4043,7 @@ proc vieweditor {top n title} { } elseif {$type eq "path"} { ${NS}::label $top.l -text $title pack $top.l -in $top -side top -pady [list 3 0] -anchor w -padx 3 - text $top.t -width 40 -height 5 -background $bgcolor -font uifont + text $top.t -width 40 -height 5 -background $bgcolor if {[info exists viewfiles($n)]} { foreach f $viewfiles($n) { $top.t insert end $f -- cgit v0.10.2-6-g49f6 From e7feb695bf93d57c1c5fdf9f2acc2039e3fdf850 Mon Sep 17 00:00:00 2001 From: Jonathan Nieder Date: Sat, 6 Mar 2010 16:48:38 -0600 Subject: gitk: Add comments to explain encode_view_opts and decode_view_opts Summarize these functions to save the reader some time. Signed-off-by: Jonathan Nieder Signed-off-by: Paul Mackerras diff --git a/gitk b/gitk index a47abc1..140fe1f 100755 --- a/gitk +++ b/gitk @@ -3851,6 +3851,7 @@ set known_view_options { {cmd t50= + {} {mc "Command to generate more commits to include:"}} } +# Convert $newviewopts($n, ...) into args for git log. proc encode_view_opts {n} { global known_view_options newviewopts @@ -3884,6 +3885,7 @@ proc encode_view_opts {n} { return [concat $rargs [shellsplit $newviewopts($n,args)]] } +# Fill $newviewopts($n, ...) based on args for git log. proc decode_view_opts {n view_args} { global known_view_options newviewopts -- cgit v0.10.2-6-g49f6 From 5d11f794de3c1a5cd592af008a369a90fa30d2e9 Mon Sep 17 00:00:00 2001 From: Jonathan Nieder Date: Sat, 6 Mar 2010 16:58:42 -0600 Subject: gitk: Don't clobber "Remember this view" setting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In the View → Edit View... dialog, the "Remember this view" option always starts out unset. Using the dialog to change an existing view and ignoring the parts of the dialog that aren’t relevant results in both the old and new versions of the view being lost. The cause: right after newviewopts($curview,perm) is set to an appropriate value, decode_view_opts is clobbering it with the default value. If that call is moved a little earlier, the "Remember this view" option gets properly set to its previous value, fixing the problem. Reported-by: Steve Cotton Signed-off-by: Jonathan Nieder Signed-off-by: Paul Mackerras diff --git a/gitk b/gitk index 140fe1f..8a4f727 100755 --- a/gitk +++ b/gitk @@ -3811,10 +3811,10 @@ proc newview {ishighlight} { raise $top return } + decode_view_opts $nextviewnum $revtreeargs set newviewname($nextviewnum) "[mc "View"] $nextviewnum" set newviewopts($nextviewnum,perm) 0 set newviewopts($nextviewnum,cmd) $viewargscmd($curview) - decode_view_opts $nextviewnum $revtreeargs vieweditor $top $nextviewnum [mc "Gitk view definition"] } @@ -3968,10 +3968,10 @@ proc editview {} { raise $top return } + decode_view_opts $curview $viewargs($curview) set newviewname($curview) $viewname($curview) set newviewopts($curview,perm) $viewperm($curview) set newviewopts($curview,cmd) $viewargscmd($curview) - decode_view_opts $curview $viewargs($curview) vieweditor $top $curview "[mc "Gitk: edit view"] $viewname($curview)" } -- cgit v0.10.2-6-g49f6 From 2e58c944cdaf63a23ebd35c43d31e639e1e23d9f Mon Sep 17 00:00:00 2001 From: Pat Thoyts Date: Fri, 12 Mar 2010 18:31:47 +0000 Subject: gitk: Avoid calling tk_setPalette on Windows This just messes up the system colors. Leave them alone. Signed-off-by: Pat Thoyts Signed-off-by: Paul Mackerras diff --git a/gitk b/gitk index 8a4f727..ba91bba 100755 --- a/gitk +++ b/gitk @@ -10847,6 +10847,7 @@ proc setselbg {c} { # radiobuttons look bad. This chooses white for selectColor if the # background color is light, or black if it is dark. proc setui {c} { + if {[tk windowingsystem] eq "win32"} { return } set bg [winfo rgb . $c] set selc black if {[lindex $bg 0] + 1.5 * [lindex $bg 1] + 0.5 * [lindex $bg 2] > 100000} { -- cgit v0.10.2-6-g49f6 From adab0dabcc95d02c3ab2076f0db5e5f94b30a96d Mon Sep 17 00:00:00 2001 From: Pat Thoyts Date: Fri, 12 Mar 2010 18:31:48 +0000 Subject: gitk: Add emacs editor variable block Help contributors use the correct indentation style. Signed-off-by: Pat Thoyts Signed-off-by: Paul Mackerras diff --git a/gitk b/gitk index ba91bba..9da0526 100755 --- a/gitk +++ b/gitk @@ -11610,3 +11610,9 @@ if {[tk windowingsystem] eq "win32"} { } getcommits {} + +# Local variables: +# mode: tcl +# indent-tabs-mode: t +# tab-width: 8 +# End: -- cgit v0.10.2-6-g49f6 From e7d516b67b02cfc4c18408d2d39118c61345bf6d Mon Sep 17 00:00:00 2001 From: Pat Thoyts Date: Fri, 12 Mar 2010 18:31:49 +0000 Subject: gitk: Fix display of copyright symbol The script file uses utf-8 encoding but when sourced it will be read using the default system encoding which is never utf8 on windows. This causes the copyright symbol to display incorrectly in the about dialog. Using the unicode escape sequence avoids incorrect decoding but does require a double escape in the .po files. Also adjusted the year range. Signed-off-by: Pat Thoyts Signed-off-by: Paul Mackerras diff --git a/gitk b/gitk index 9da0526..db8977d 100755 --- a/gitk +++ b/gitk @@ -2787,7 +2787,7 @@ proc about {} { message $w.m -text [mc " Gitk - a commit viewer for git -Copyright © 2005-2009 Paul Mackerras +Copyright \u00a9 2005-2010 Paul Mackerras Use and redistribute under the terms of the GNU General Public License"] \ -justify center -aspect 400 -border 2 -bg white -relief groove diff --git a/po/de.po b/po/de.po index c79aa9c..bd194a3 100644 --- a/po/de.po +++ b/po/de.po @@ -334,14 +334,14 @@ msgid "" "\n" "Gitk - a commit viewer for git\n" "\n" -"Copyright ©9 2005-2009 Paul Mackerras\n" +"Copyright \\u00a9 2005-2010 Paul Mackerras\n" "\n" "Use and redistribute under the terms of the GNU General Public License" msgstr "" "\n" "Gitk - eine Visualisierung der Git-Historie\n" "\n" -"Copyright © 2005-2009 Paul Mackerras\n" +"Copyright \\u00a9 2005-2010 Paul Mackerras\n" "\n" "Benutzung und Weiterverbreitung gemäß den Bedingungen der GNU General Public License" diff --git a/po/es.po b/po/es.po index 0e19b5e..0471dd0 100644 --- a/po/es.po +++ b/po/es.po @@ -281,14 +281,14 @@ msgid "" "\n" "Gitk - a commit viewer for git\n" "\n" -"Copyright © 2005-2008 Paul Mackerras\n" +"Copyright \\u00a9 2005-2010 Paul Mackerras\n" "\n" "Use and redistribute under the terms of the GNU General Public License" msgstr "" "\n" "Gitk - un visualizador de revisiones para git\n" "\n" -"Copyright © 2005-2008 Paul Mackerras\n" +"Copyright \\u00a9 2005-2010 Paul Mackerras\n" "\n" "Uso y redistribución permitidos según los términos de la Licencia Pública " "General de GNU (GNU GPL)" diff --git a/po/fr.po b/po/fr.po index cb0e1ed..5370ddc 100644 --- a/po/fr.po +++ b/po/fr.po @@ -334,14 +334,14 @@ msgid "" "\n" "Gitk - a commit viewer for git\n" "\n" -"Copyright © 2005-2008 Paul Mackerras\n" +"Copyright \\u00a9 2005-2010 Paul Mackerras\n" "\n" "Use and redistribute under the terms of the GNU General Public License" msgstr "" "\n" "Gitk - visualisateur de commit pour git\n" "\n" -"Copyright © 2005-2008 Paul Mackerras\n" +"Copyright \\u00a9 2005-2010 Paul Mackerras\n" "\n" "Utilisation et redistribution soumises aux termes de la GNU General Public " "License" diff --git a/po/hu.po b/po/hu.po index 1df212e..7262b61 100644 --- a/po/hu.po +++ b/po/hu.po @@ -333,14 +333,14 @@ msgid "" "\n" "Gitk - a commit viewer for git\n" "\n" -"Copyright ©9 2005-2009 Paul Mackerras\n" +"Copyright \\u00a9 2005-2010 Paul Mackerras\n" "\n" "Use and redistribute under the terms of the GNU General Public License" msgstr "" "\n" "Gitk - commit nézegető a githez\n" "\n" -"Szerzői jog ©9 2005-2009 Paul Mackerras\n" +"Szerzői jog \\u00a9 2005-2010 Paul Mackerras\n" "\n" "Használd és terjeszd a GNU General Public License feltételei mellett" diff --git a/po/it.po b/po/it.po index 4818652..a730d63 100644 --- a/po/it.po +++ b/po/it.po @@ -334,14 +334,14 @@ msgid "" "\n" "Gitk - a commit viewer for git\n" "\n" -"Copyright © 2005-2009 Paul Mackerras\n" +"Copyright \\u00a9 2005-2010 Paul Mackerras\n" "\n" "Use and redistribute under the terms of the GNU General Public License" msgstr "" "\n" "Gitk - un visualizzatore di revisioni per git\n" "\n" -"Copyright © 2005-2009 Paul Mackerras\n" +"Copyright \\u00a9 2005-2010 Paul Mackerras\n" "\n" "Utilizzo e redistribuzione permessi sotto i termini della GNU General Public " "License" diff --git a/po/ja.po b/po/ja.po index c0c92ad..4f47051 100644 --- a/po/ja.po +++ b/po/ja.po @@ -335,14 +335,14 @@ msgid "" "\n" "Gitk - a commit viewer for git\n" "\n" -"Copyright © 2005-2008 Paul Mackerras\n" +"Copyright \\u00a9 2005-2010 Paul Mackerras\n" "\n" "Use and redistribute under the terms of the GNU General Public License" msgstr "" "\n" "Gitk - gitコミットビューア\n" "\n" -"Copyright © 2005-2008 Paul Mackerras\n" +"Copyright \\u00a9 2005-2010 Paul Mackerras\n" "\n" "使用および再配布は GNU General Public License に従ってください" diff --git a/po/ru.po b/po/ru.po index 704eba8..c3d0285 100644 --- a/po/ru.po +++ b/po/ru.po @@ -313,14 +313,14 @@ msgid "" "\n" "Gitk - a commit viewer for git\n" "\n" -"Copyright © 2005-2008 Paul Mackerras\n" +"Copyright \\u00a9 2005-2010 Paul Mackerras\n" "\n" "Use and redistribute under the terms of the GNU General Public License" msgstr "" "\n" "Gitk - программа просмотра истории репозиториев Git\n" "\n" -"Copyright (c) 2005-2008 Paul Mackerras\n" +"Copyright \\u00a9 2005-2010 Paul Mackerras\n" "\n" "Использование и распространение согласно условиям GNU General Public License" diff --git a/po/sv.po b/po/sv.po index 0f5e2fd..386763a 100644 --- a/po/sv.po +++ b/po/sv.po @@ -334,14 +334,14 @@ msgid "" "\n" "Gitk - a commit viewer for git\n" "\n" -"Copyright ©9 2005-2009 Paul Mackerras\n" +"Copyright \\u00a9 2005-2010 Paul Mackerras\n" "\n" "Use and redistribute under the terms of the GNU General Public License" msgstr "" "\n" "Gitk - en incheckningsvisare för git\n" "\n" -"Copyright © 2005-2009 Paul Mackerras\n" +"Copyright \\u00a9 2005-2010 Paul Mackerras\n" "\n" "Använd och vidareförmedla enligt villkoren i GNU General Public License" -- cgit v0.10.2-6-g49f6 From a1d383c5ab90ec19c8a77158f65e5ea7d61fb42c Mon Sep 17 00:00:00 2001 From: Jens Lehmann Date: Fri, 9 Apr 2010 22:16:42 +0200 Subject: gitk: Display dirty submodules correctly Since recently "git diff --submodule" prints out extra lines when the submodule contains untracked or modified files. Show all those lines of one submodule under the same header. Also for newly added or removed submodules the submodule name contained trailing garbage because the extraction of the name was not done right. Signed-off-by: Jens Lehmann Signed-off-by: Paul Mackerras diff --git a/gitk b/gitk index db8977d..1b0e09a 100755 --- a/gitk +++ b/gitk @@ -7509,7 +7509,7 @@ proc getblobdiffs {ids} { global ignorespace global limitdiffs vfilelimit curview global diffencoding targetline diffnparents - global git_version + global git_version currdiffsubmod set textconv {} if {[package vcompare $git_version "1.6.1"] >= 0} { @@ -7536,6 +7536,7 @@ proc getblobdiffs {ids} { set diffencoding [get_path_encoding {}] fconfigure $bdf -blocking 0 -encoding binary -eofchar {} set blobdifffd($ids) $bdf + set currdiffsubmod "" filerun $bdf [list getblobdiffline $bdf $diffids] } @@ -7606,7 +7607,7 @@ proc getblobdiffline {bdf ids} { global diffnexthead diffnextnote difffilestart global ctext_file_names ctext_file_lines global diffinhdr treediffs mergemax diffnparents - global diffencoding jump_to_here targetline diffline + global diffencoding jump_to_here targetline diffline currdiffsubmod set nr 0 $ctext conf -state normal @@ -7687,19 +7688,30 @@ proc getblobdiffline {bdf ids} { } elseif {![string compare -length 10 "Submodule " $line]} { # start of a new submodule - if {[string compare [$ctext get "end - 4c" end] "\n \n\n"]} { + if {[regexp -indices "\[0-9a-f\]+\\.\\." $line nameend]} { + set fname [string range $line 10 [expr [lindex $nameend 0] - 2]] + } else { + set fname [string range $line 10 [expr [string first "contains " $line] - 2]] + } + if {$currdiffsubmod != $fname} { $ctext insert end "\n"; # Add newline after commit message } set curdiffstart [$ctext index "end - 1c"] lappend ctext_file_names "" - set fname [string range $line 10 [expr [string last " " $line] - 1]] - lappend ctext_file_lines $fname - makediffhdr $fname $ids - $ctext insert end "\n$line\n" filesep + if {$currdiffsubmod != $fname} { + lappend ctext_file_lines $fname + makediffhdr $fname $ids + set currdiffsubmod $fname + $ctext insert end "\n$line\n" filesep + } else { + $ctext insert end "$line\n" filesep + } } elseif {![string compare -length 3 " >" $line]} { + set $currdiffsubmod "" set line [encoding convertfrom $diffencoding $line] $ctext insert end "$line\n" dresult } elseif {![string compare -length 3 " <" $line]} { + set $currdiffsubmod "" set line [encoding convertfrom $diffencoding $line] $ctext insert end "$line\n" d0 } elseif {$diffinhdr} { @@ -8535,7 +8547,7 @@ proc do_cmp_commits {a b} { } proc diffcommits {a b} { - global diffcontext diffids blobdifffd diffinhdr + global diffcontext diffids blobdifffd diffinhdr currdiffsubmod set tmpdir [gitknewtmpdir] set fna [file join $tmpdir "commit-[string range $a 0 7]"] @@ -8556,6 +8568,7 @@ proc diffcommits {a b} { set diffids [list commits $a $b] set blobdifffd($diffids) $fd set diffinhdr 0 + set currdiffsubmod "" filerun $fd [list getblobdiffline $fd $diffids] } -- cgit v0.10.2-6-g49f6