summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: eae2ce6)
raw | patch | inline | side by side (parent: eae2ce6)
author | Shawn O. Pearce <spearce@spearce.org> | |
Fri, 8 Dec 2006 03:07:38 +0000 (22:07 -0500) | ||
committer | Shawn O. Pearce <spearce@spearce.org> | |
Sun, 21 Jan 2007 07:54:15 +0000 (02:54 -0500) |
In one particular case I have a tool called 'miga' which users may need
to invoke on their repository. This is a homegrown tool which is not
(and should be) part of git-gui, but I still want to be able to run it
from within the gui.
Right now I'm taking a shortcut and adding it to the Tools menu if
we are not on Mac OS X and the support script used to launch the tool
exists in the local filesystem. This is nothing but a complete and
utter hack.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
to invoke on their repository. This is a homegrown tool which is not
(and should be) part of git-gui, but I still want to be able to run it
from within the gui.
Right now I'm taking a shortcut and adding it to the Tools menu if
we are not on Mac OS X and the support script used to launch the tool
exists in the local filesystem. This is nothing but a complete and
utter hack.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
git-gui | patch | blob | history |
index 1891215a646b8715ac08dfb408e9ea31a12b1d74..36979afd7701feafa743ffa152c217582580b5e3 100755 (executable)
--- a/git-gui
+++ b/git-gui
-command do_options \
-font font_ui
+ # -- Tools Menu
+ #
+ if {[file exists /usr/local/miga/lib/gui-miga]} {
+ proc do_miga {} {
+ global gitdir ui_status_value
+ if {![lock_index update]} return
+ set cmd [list sh --login -c "/usr/local/miga/lib/gui-miga \"[pwd]\""]
+ set miga_fd [open "|$cmd" r]
+ fconfigure $miga_fd -blocking 0
+ fileevent $miga_fd readable [list miga_done $miga_fd]
+ set ui_status_value {Running miga...}
+ }
+ proc miga_done {fd} {
+ read $fd 512
+ if {[eof $fd]} {
+ close $fd
+ unlock_index
+ rescan [list set ui_status_value {Ready.}]
+ }
+ }
+ .mbar add cascade -label Tools -menu .mbar.tools
+ menu .mbar.tools
+ .mbar.tools add command -label "Migrate" \
+ -command do_miga \
+ -font font_ui
+ lappend disable_on_lock \
+ [list .mbar.tools entryconf [.mbar.tools index last] -state]
+ }
+
# -- Help Menu
#
.mbar add cascade -label Help -menu .mbar.help