From 0ce76ded1b207063a460f859fe7bfeb6d90b4eb6 Mon Sep 17 00:00:00 2001 From: Alexander Gavrilov Date: Sun, 16 Nov 2008 21:46:49 +0300 Subject: git-gui: Add a Tools menu for arbitrary commands. Due to the emphasis on scriptability in the git design, it is impossible to provide 100% complete GUI. Currently unaccounted areas include git-svn and other source control system interfaces, TopGit, all custom scripts. This problem can be mitigated by providing basic customization capabilities in Git Gui. This commit adds a new Tools menu, which can be configured to contain items invoking arbitrary shell commands. The interface is powerful enough to allow calling both batch text programs like git-svn, and GUI editors. To support the latter use, the commands have access to the name of the currently selected file through the environment. Signed-off-by: Alexander Gavrilov Signed-off-by: Shawn O. Pearce --- git-gui.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'git-gui.sh') diff --git a/git-gui.sh b/git-gui.sh index 922bcd6796..8a4b42dbd7 100755 --- a/git-gui.sh +++ b/git-gui.sh @@ -2289,6 +2289,9 @@ if {[is_enabled transport]} { .mbar add cascade -label [mc Merge] -menu .mbar.merge .mbar add cascade -label [mc Remote] -menu .mbar.remote } +if {[is_enabled multicommit] || [is_enabled singlecommit]} { + .mbar add cascade -label [mc Tools] -menu .mbar.tools +} . configure -menu .mbar # -- Repository Menu @@ -2563,6 +2566,20 @@ if {[is_MacOSX]} { -command do_options } +# -- Tools Menu +# +if {[is_enabled multicommit] || [is_enabled singlecommit]} { + set tools_menubar .mbar.tools + menu $tools_menubar + $tools_menubar add separator + $tools_menubar add command -label [mc "Add..."] -command tools_add::dialog + $tools_menubar add command -label [mc "Remove..."] -command tools_remove::dialog + set tools_tailcnt 3 + if {[array names repo_config guitool.*.cmd] ne {}} { + tools_populate_all + } +} + # -- Help Menu # .mbar add cascade -label [mc Help] -menu .mbar.help -- cgit v1.3