aboutsummaryrefslogtreecommitdiffstats
path: root/git-gui
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2006-11-12 16:20:36 -0500
committerShawn O. Pearce <spearce@spearce.org>2006-11-13 00:10:37 -0500
commit4ccdab028263dfdeb0adf9764466bb3a43265395 (patch)
treee1025d171411b9f071f3068128f8f1da2e7dd48d /git-gui
parent7b64d0b7d62ec0eb6e8b37f0be2e62f2a719de16 (diff)
downloadgit-4ccdab028263dfdeb0adf9764466bb3a43265395.tar.gz
git-gui: Hide non-commit related commands when invoked as git-citool.
If the user is invoking us as git-citool then they want to perform a single commit and exit quickly. Since we are about to be a very short lived process we should do what we can to avoid spending CPU time setting up menus which the user will never use, like the fetch/push/pull menus. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'git-gui')
-rwxr-xr-xgit-gui42
1 files changed, 25 insertions, 17 deletions
diff --git a/git-gui b/git-gui
index e59d225cb6..249b2c894a 100755
--- a/git-gui
+++ b/git-gui
@@ -169,6 +169,7 @@ if {$cdup != ""} {
}
unset cdup
+set single_commit 0
if {$appname == {git-citool}} {
set single_commit 1
}
@@ -177,7 +178,6 @@ if {$appname == {git-citool}} {
##
## task management
-set single_commit 0
set status_active 0
set diff_active 0
set commit_active 0
@@ -1931,9 +1931,11 @@ menu .mbar -tearoff 0
.mbar add cascade -label Project -menu .mbar.project
.mbar add cascade -label Edit -menu .mbar.edit
.mbar add cascade -label Commit -menu .mbar.commit
-.mbar add cascade -label Fetch -menu .mbar.fetch
-.mbar add cascade -label Pull -menu .mbar.pull
-.mbar add cascade -label Push -menu .mbar.push
+if {!$single_commit} {
+ .mbar add cascade -label Fetch -menu .mbar.fetch
+ .mbar add cascade -label Pull -menu .mbar.pull
+ .mbar add cascade -label Push -menu .mbar.push
+}
. configure -menu .mbar
# -- Project Menu
@@ -1941,9 +1943,11 @@ menu .mbar.project
.mbar.project add command -label Visualize \
-command do_gitk \
-font font_ui
-.mbar.project add command -label {Repack Database} \
- -command do_repack \
- -font font_ui
+if {!$single_commit} {
+ .mbar.project add command -label {Repack Database} \
+ -command do_repack \
+ -font font_ui
+}
.mbar.project add command -label Quit \
-command do_quit \
-accelerator $M1T-Q \
@@ -2017,14 +2021,16 @@ lappend disable_on_lock \
lappend disable_on_lock \
[list .mbar.commit entryconf [.mbar.commit index last] -state]
-# -- Fetch Menu
-menu .mbar.fetch
+if {!$single_commit} {
+ # -- Fetch Menu
+ menu .mbar.fetch
-# -- Pull Menu
-menu .mbar.pull
+ # -- Pull Menu
+ menu .mbar.pull
-# -- Push Menu
-menu .mbar.push
+ # -- Push Menu
+ menu .mbar.push
+}
# -- Main Window Layout
panedwindow .vpane -orient vertical
@@ -2335,8 +2341,10 @@ set file_lists($ui_other) [list]
wm title . "$appname ([file normalize [file dirname $gitdir]])"
focus -force $ui_comm
-load_all_remotes
-populate_remote_menu .mbar.fetch From fetch_from
-populate_remote_menu .mbar.push To push_to
-populate_pull_menu .mbar.pull
+if {!$single_commit} {
+ load_all_remotes
+ populate_remote_menu .mbar.fetch From fetch_from
+ populate_remote_menu .mbar.push To push_to
+ populate_pull_menu .mbar.pull
+}
after 1 update_status