From f1e031bbebb8910ef11f1d5d566b357b50050c56 Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" <spearce@spearce.org> Date: Thu, 5 Jul 2007 22:16:38 -0400 Subject: [PATCH 1/4] git-gui: Don't bind F5/M1-R in all windows We actually only want our F5/M1-R keystroke bound in the main window. Within a browser/blame/console window pressing these keys should not execute the rescan action. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> --- git-gui.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/git-gui.sh b/git-gui.sh index 6b7321bb03..a1cf873e35 100755 --- a/git-gui.sh +++ b/git-gui.sh @@ -2149,9 +2149,9 @@ if {[is_enabled branch]} { bind . <$M1B-Key-N> do_create_branch } -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 From 840bcfa7b55dd94bd97a2d19a250f38d9ce80c77 Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" <spearce@spearce.org> Date: Thu, 5 Jul 2007 22:15:00 -0400 Subject: [PATCH 2/4] git-gui: Bind M1-P to push action Users often need to be able to push the current branch so that they can publish their recent changes to anyone they are collaborating with on the project. Associating a keyboard action with this will make it easier for keyboard-oriented users to quickly activate the push features. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> --- git-gui.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/git-gui.sh b/git-gui.sh index a1cf873e35..c22a431fdb 100755 --- a/git-gui.sh +++ b/git-gui.sh @@ -1525,7 +1525,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 } if {[is_MacOSX]} { @@ -2148,6 +2149,10 @@ 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 . <Key-F5> do_rescan bind . <$M1B-Key-r> do_rescan From 87b49a533b0ee0da06c06fb466844885ae0d35bd Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" <spearce@spearce.org> Date: Thu, 5 Jul 2007 22:19:33 -0400 Subject: [PATCH 3/4] git-gui: Include a Push action on the left toolbar Pushing changes to a remote system is a very common action for many users of git-gui, so much so that in some workflows a user is supposed to push immediately after they make a local commit so that their change(s) are immediately available for their teammates to view and build on top of. Including the push button right below the commit button on the left toolbar indicates that users should probably perform this action after they have performed the commit action. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> --- git-gui.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/git-gui.sh b/git-gui.sh index c22a431fdb..c38aa067ac 100755 --- a/git-gui.sh +++ b/git-gui.sh @@ -1822,6 +1822,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 From 47282d4646372aa859908c3b9471b96c385abe5f Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" <spearce@spearce.org> Date: Thu, 5 Jul 2007 18:39:40 -0400 Subject: [PATCH 4/4] git-gui: Ensure windows shortcuts always have .bat extension Apparently under some setups on Windows Tk is hiding our file extension recommendation of ".bat" from the user and that is allowing the user to create a shortcut file which has no file extension. Double clicking on such a file in Windows Explorer brings up the associate file dialog, as Windows does not know what application to launch. We now append the file extension ".bat" to the filename of the shortcut file if it has no extension or if it has one but it is not ".bat". Signed-off-by: Shawn O. Pearce <spearce@spearce.org> --- lib/shortcut.tcl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/shortcut.tcl b/lib/shortcut.tcl index ebf72e4452..a0a1b7dddd 100644 --- a/lib/shortcut.tcl +++ b/lib/shortcut.tcl @@ -9,6 +9,9 @@ proc do_windows_shortcut {} { -title "[appname] ([reponame]): Create Desktop Icon" \ -initialfile "Git [reponame].bat"] if {$fn != {}} { + if {[file extension $fn] ne {.bat}} { + set fn ${fn}.bat + } if {[catch { set fd [open $fn w] puts $fd "@ECHO Entering [reponame]" @@ -42,6 +45,9 @@ proc do_cygwin_shortcut {} { -initialdir $desktop \ -initialfile "Git [reponame].bat"] if {$fn != {}} { + if {[file extension $fn] ne {.bat}} { + set fn ${fn}.bat + } if {[catch { set fd [open $fn w] set sh [exec cygpath \