]> asedeno.scripts.mit.edu Git - git.git/blobdiff - git-gui.sh
Merge branch 'maint'
[git.git] / git-gui.sh
index e33ee03bc0b1881596115da73c875ef784cd0a93..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
 
@@ -494,7 +495,8 @@ proc rescan {after {honor_trustmtime 1}} {
 
        if {![$ui_comm edit modified]
                || [string trim [$ui_comm get 0.0 end]] eq {}} {
-               if {[load_message GITGUI_MSG]} {
+               if {[string match amend* $commit_type]} {
+               } elseif {[load_message GITGUI_MSG]} {
                } elseif {[load_message MERGE_MSG]} {
                } elseif {[load_message SQUASH_MSG]} {
                }
@@ -1063,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} {
@@ -1555,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
 }
@@ -1579,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
@@ -1657,7 +1661,7 @@ unset browser doc_path doc_url
 
 # -- Standard bindings
 #
-bind .   <Destroy> {if {{%W} eq {.}} do_quit}
+wm protocol . WM_DELETE_WINDOW do_quit
 bind all <$M1B-Key-q> do_quit
 bind all <$M1B-Key-Q> do_quit
 bind all <$M1B-Key-w> {destroy [winfo toplevel %W]}
@@ -1846,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
@@ -2173,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