]> asedeno.scripts.mit.edu Git - git.git/blobdiff - git-gui.sh
Merge branch 'maint'
[git.git] / git-gui.sh
index 3237f3d59627d60e3d5ac18ee588a61b0ce87576..0096f4913aa03bada1cfde879478926c5fe9ec06 100755 (executable)
@@ -1,6 +1,12 @@
 #!/bin/sh
 # Tcl ignores the next line -*- tcl -*- \
-exec wish "$0" -- "$@"
+ if test "z$*" = zversion \
+ || test "z$*" = z--version; \
+ then \
+       echo 'git-gui version @@GITGUI_VERSION@@'; \
+       exit; \
+ fi; \
+ exec wish "$0" -- "$@"
 
 set appvers {@@GITGUI_VERSION@@}
 set copyright {
@@ -302,11 +308,6 @@ proc tk_optionMenu {w varName args} {
 ##
 ## version check
 
-if {{--version} eq $argv || {version} eq $argv} {
-       puts "git-gui version $appvers"
-       exit
-}
-
 set req_maj 1
 set req_min 5
 
@@ -1064,15 +1065,17 @@ proc do_gitk {revs} {
        #    lets us bypass using shell process on Windows systems.
        #
        set cmd [list [info nameofexecutable]]
-       lappend cmd [gitexec gitk]
+       set exe [gitexec gitk]
+       lappend cmd $exe
        if {$revs ne {}} {
                append cmd { }
                append cmd $revs
        }
 
-       if {[catch {eval exec $cmd &} err]} {
-               error_popup "Failed to start gitk:\n\n$err"
+       if {! [file exists $exe]} {
+               error_popup "Unable to start gitk:\n\n$exe does not exist"
        } else {
+               eval exec $cmd &
                set ui_status_value $starting_gitk_msg
                after 10000 {
                        if {$ui_status_value eq $starting_gitk_msg} {
@@ -1556,7 +1559,8 @@ if {[is_enabled transport]} {
 
        menu .mbar.push
        .mbar.push add command -label {Push...} \
-               -command do_push_anywhere
+               -command do_push_anywhere \
+               -accelerator $M1T-P
        .mbar.push add command -label {Delete...} \
                -command remote_branch_delete::dialog
 }
@@ -1580,8 +1584,7 @@ if {[is_MacOSX]} {
 
        # -- Tools Menu
        #
-       if {[file exists /usr/local/miga/lib/gui-miga]
-               && [file exists .pvcsrc]} {
+       if {[is_Cygwin] && [file exists /usr/local/miga/lib/gui-miga]} {
        proc do_miga {} {
                global ui_status_value
                if {![lock_index update]} return
@@ -1847,6 +1850,10 @@ pack .vpane.lower.commarea.buttons.commit -side top -fill x
 lappend disable_on_lock \
        {.vpane.lower.commarea.buttons.commit conf -state}
 
+button .vpane.lower.commarea.buttons.push -text {Push} \
+       -command do_push_anywhere
+pack .vpane.lower.commarea.buttons.push -side top -fill x
+
 # -- Commit Message Buffer
 #
 frame .vpane.lower.commarea.buffer
@@ -2174,10 +2181,14 @@ if {[is_enabled branch]} {
        bind . <$M1B-Key-n> do_create_branch
        bind . <$M1B-Key-N> do_create_branch
 }
+if {[is_enabled transport]} {
+       bind . <$M1B-Key-p> do_push_anywhere
+       bind . <$M1B-Key-P> do_push_anywhere
+}
 
-bind all <Key-F5> do_rescan
-bind all <$M1B-Key-r> do_rescan
-bind all <$M1B-Key-R> do_rescan
+bind .   <Key-F5>     do_rescan
+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-i> do_add_all