]> asedeno.scripts.mit.edu Git - git.git/blobdiff - git-gui.sh
git-gui: fix a typo in lib/commit.tcl
[git.git] / git-gui.sh
index a6e2d57a2ff6b25f873fc596f1d47ac5893f0a64..1fca11f278a89bb4d224738ed6dfca9822775a32 100755 (executable)
@@ -10,7 +10,7 @@
  exec wish "$argv0" -- "$@"
 
 set appvers {@@GITGUI_VERSION@@}
-set copyright {
+set copyright [encoding convertfrom utf-8 {
 Copyright © 2006, 2007 Shawn Pearce, et. al.
 
 This program is free software; you can redistribute it and/or modify
@@ -25,7 +25,7 @@ GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA}
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA}]
 
 ######################################################################
 ##
@@ -88,13 +88,20 @@ if {![catch {set _verbose $env(GITGUI_VERBOSE)}]} {
 
 package require msgcat
 
-proc mc {fmt args} {
-       set fmt [::msgcat::mc $fmt]
+proc _mc_trim {fmt} {
        set cmk [string first @@ $fmt]
        if {$cmk > 0} {
-               set fmt [string range $fmt 0 [expr {$cmk - 1}]]
+               return [string range $fmt 0 [expr {$cmk - 1}]]
        }
-       return [eval [list format $fmt] $args]
+       return $fmt
+}
+
+proc mc {en_fmt args} {
+       set fmt [_mc_trim [::msgcat::mc $en_fmt]]
+       if {[catch {set msg [eval [list format $fmt] $args]} err]} {
+               set msg [eval [list format [_mc_trim $en_fmt]] $args]
+       }
+       return $msg
 }
 
 proc strcat {args} {
@@ -205,6 +212,7 @@ proc disable_option {option} {
 
 proc is_many_config {name} {
        switch -glob -- $name {
+       gui.recentrepo -
        remote.*.fetch -
        remote.*.push
                {return 1}
@@ -543,8 +551,15 @@ proc apply_config {} {
                set name [lindex $option 0]
                set font [lindex $option 1]
                if {[catch {
+                       set need_weight 1
                        foreach {cn cv} $repo_config(gui.$name) {
-                               font configure $font $cn $cv -weight normal
+                               if {$cn eq {-weight}} {
+                                       set need_weight 0
+                               }
+                               font configure $font $cn $cv
+                       }
+                       if {$need_weight} {
+                               font configure $font -weight normal
                        }
                        } err]} {
                        error_popup [strcat [mc "Invalid font specified in %s:" "gui.$name"] "\n\n$err"]
@@ -754,7 +769,10 @@ git-version proc _parse_config {arr_name args} {
                array unset arr
                set buf {}
                catch {
-                       set fd_rc [eval [list git_read config --null --list] $args]
+                       set fd_rc [eval \
+                               [list git_read config] \
+                               $args \
+                               [list --null --list]]
                        fconfigure $fd_rc -translation binary
                        set buf [read $fd_rc]
                        close $fd_rc
@@ -1968,7 +1986,8 @@ if {[is_enabled multicommit] || [is_enabled singlecommit]} {
                [list .mbar.commit entryconf [.mbar.commit index last] -state]
 
        .mbar.commit add command -label [mc "Stage To Commit"] \
-               -command do_add_selection
+               -command do_add_selection \
+               -accelerator $M1T-T
        lappend disable_on_lock \
                [list .mbar.commit entryconf [.mbar.commit index last] -state]
 
@@ -2620,6 +2639,8 @@ unset gm
 # -- Key Bindings
 #
 bind $ui_comm <$M1B-Key-Return> {do_commit;break}
+bind $ui_comm <$M1B-Key-t> {do_add_selection;break}
+bind $ui_comm <$M1B-Key-T> {do_add_selection;break}
 bind $ui_comm <$M1B-Key-i> {do_add_all;break}
 bind $ui_comm <$M1B-Key-I> {do_add_all;break}
 bind $ui_comm <$M1B-Key-x> {tk_textCut %W;break}
@@ -2669,6 +2690,8 @@ bind .   <$M1B-Key-r> do_rescan
 bind .   <$M1B-Key-R> do_rescan
 bind .   <$M1B-Key-s> do_signoff
 bind .   <$M1B-Key-S> do_signoff
+bind .   <$M1B-Key-t> do_add_selection
+bind .   <$M1B-Key-T> do_add_selection
 bind .   <$M1B-Key-i> do_add_all
 bind .   <$M1B-Key-I> do_add_all
 bind .   <$M1B-Key-Return> do_commit